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
impl Clone for CommandExecParams
Source§fn clone(&self) -> CommandExecParams
fn clone(&self) -> CommandExecParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more