Skip to main content

CommandExecParams

Struct CommandExecParams 

Source
pub struct CommandExecParams {
Show 14 fields pub command: Vec<String>, pub cwd: Option<String>, pub disable_output_cap: Option<bool>, pub disable_timeout: Option<bool>, pub env: Option<HashMap<String, Option<String>>>, pub output_bytes_cap: Option<u32>, pub permission_profile: Option<String>, pub process_id: Option<String>, pub sandbox_policy: Option<SandboxPolicy>, pub size: Option<CommandExecTerminalSize>, pub stream_stdin: Option<bool>, pub stream_stdout_stderr: Option<bool>, pub timeout_ms: Option<i64>, pub tty: Option<bool>,
}
Expand description

Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.

The final command/exec response is deferred until the process exits and is sent only after all command/exec/outputDelta notifications for that connection have been emitted.

JSON schema
{
 "title": "CommandExecParams",
 "description": "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.",
 "type": "object",
 "required": [
   "command"
 ],
 "properties": {
   "command": {
     "description": "Command argv vector. Empty arrays are rejected.",
     "type": "array",
     "items": {
       "type": "string"
     }
   },
   "cwd": {
     "description": "Optional working directory. Defaults to the server cwd.",
     "type": [
       "string",
       "null"
     ]
   },
   "disableOutputCap": {
     "description": "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.",
     "type": "boolean"
   },
   "disableTimeout": {
     "description": "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.",
     "type": "boolean"
   },
   "env": {
     "description": "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.",
     "type": [
       "object",
       "null"
     ],
     "additionalProperties": {
       "type": [
         "string",
         "null"
       ]
     }
   },
   "outputBytesCap": {
     "description": "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.",
     "type": [
       "integer",
       "null"
     ],
     "format": "uint",
     "minimum": 0.0
   },
   "permissionProfile": {
     "description": "Optional active permissions profile id for this command.\n\nDefaults to the user's configured permissions when omitted. Cannot be combined with `sandboxPolicy`.",
     "type": [
       "string",
       "null"
     ]
   },
   "processId": {
     "description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.",
     "type": [
       "string",
       "null"
     ]
   },
   "sandboxPolicy": {
     "description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.",
     "anyOf": [
       {
         "$ref": "#/definitions/SandboxPolicy"
       },
       {
         "type": "null"
       }
     ]
   },
   "size": {
     "description": "Optional initial PTY size in character cells. Only valid when `tty` is true.",
     "anyOf": [
       {
         "$ref": "#/definitions/CommandExecTerminalSize"
       },
       {
         "type": "null"
       }
     ]
   },
   "streamStdin": {
     "description": "Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.",
     "type": "boolean"
   },
   "streamStdoutStderr": {
     "description": "Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.",
     "type": "boolean"
   },
   "timeoutMs": {
     "description": "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.",
     "type": [
       "integer",
       "null"
     ],
     "format": "int64"
   },
   "tty": {
     "description": "Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`.",
     "type": "boolean"
   }
 },
 "$schema": "http://json-schema.org/draft-07/schema#"
}

Fields§

§command: Vec<String>

Command argv vector. Empty arrays are rejected.

§cwd: Option<String>

Optional working directory. Defaults to the server cwd.

§disable_output_cap: Option<bool>

Disable stdout/stderr capture truncation for this request.

Cannot be combined with outputBytesCap.

§disable_timeout: Option<bool>

Disable the timeout entirely for this request.

Cannot be combined with timeoutMs.

§env: Option<HashMap<String, Option<String>>>

Optional environment overrides merged into the server-computed environment.

Matching names override inherited values. Set a key to null to unset an inherited variable.

§output_bytes_cap: Option<u32>

Optional per-stream stdout/stderr capture cap in bytes.

When omitted, the server default applies. Cannot be combined with disableOutputCap.

§permission_profile: Option<String>

Optional active permissions profile id for this command.

Defaults to the user’s configured permissions when omitted. Cannot be combined with sandboxPolicy.

§process_id: Option<String>

Optional client-supplied, connection-scoped process id.

Required for tty, streamStdin, streamStdoutStderr, and follow-up command/exec/write, command/exec/resize, and command/exec/terminate calls. When omitted, buffered execution gets an internal id that is not exposed to the client.

§sandbox_policy: Option<SandboxPolicy>

Optional sandbox policy for this command.

Uses the same shape as thread/turn execution sandbox configuration and defaults to the user’s configured policy when omitted. Cannot be combined with permissionProfile.

§size: Option<CommandExecTerminalSize>

Optional initial PTY size in character cells. Only valid when tty is true.

§stream_stdin: Option<bool>

Allow follow-up command/exec/write requests to write stdin bytes.

Requires a client-supplied processId.

§stream_stdout_stderr: Option<bool>

Stream stdout/stderr via command/exec/outputDelta notifications.

Streamed bytes are not duplicated into the final response and require a client-supplied processId.

§timeout_ms: Option<i64>

Optional timeout in milliseconds.

When omitted, the server default applies. Cannot be combined with disableTimeout.

§tty: Option<bool>

Enable PTY mode.

This implies streamStdin and streamStdoutStderr.

Trait Implementations§

Source§

impl Clone for CommandExecParams

Source§

fn clone(&self) -> CommandExecParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandExecParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CommandExecParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CommandExecParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,