/** * JSON Schema definition for the `exec` tool. * * The exec tool runs shell commands, optionally in parallel or background, * with retry, timeout, expectation-checking, and pre-command file operations. */ export declare const EXEC_TOOL_SCHEMA: { readonly type: "object"; readonly properties: { readonly commands: { readonly type: "array"; readonly description: "Commands to execute. Run sequentially by default, parallel if parallel=true."; readonly items: { readonly type: "object"; readonly properties: { readonly cmd: { readonly type: "string"; readonly description: "Shell command to execute via sh -c."; }; readonly cmd_base64: { readonly type: "string"; readonly description: "Base64-encoded command. Use when cmd contains special characters."; }; readonly cwd: { readonly type: "string"; readonly description: "Per-command working directory override. Prefer top-level working_dir for the project root."; }; readonly working_dir: { readonly type: "string"; readonly description: "Alias for cwd on a command item. For a single-command call, this can also supply the required top-level working_dir."; }; readonly timeout_ms: { readonly type: "integer"; readonly minimum: 1; readonly description: "Per-command timeout in milliseconds. Default: 120000 (2 min)."; }; readonly env: { readonly type: "object"; readonly description: "Additional environment variables merged with the current process env."; readonly additionalProperties: { readonly type: "string"; }; }; readonly expect: { readonly type: "object"; readonly description: "Expectations to validate after the command completes."; readonly properties: { readonly exit_code: { readonly type: "integer"; readonly description: "Expected exit code."; }; readonly stdout_contains: { readonly type: "string"; readonly description: "Substring that stdout must contain."; }; readonly stderr_contains: { readonly type: "string"; readonly description: "Substring that stderr must contain."; }; }; }; readonly background: { readonly type: "boolean"; readonly description: string; }; readonly retry: { readonly type: "object"; readonly description: "Retry configuration for transient failures."; readonly properties: { readonly max: { readonly type: "integer"; readonly minimum: 1; readonly maximum: 10; readonly description: "Maximum retry attempts. Default: 3."; }; readonly delay_ms: { readonly type: "integer"; readonly minimum: 0; readonly description: "Base delay between retries in ms. Default: 1000."; }; readonly max_delay_ms: { readonly type: "integer"; readonly minimum: 0; readonly description: "Max jitter cap for exponential backoff in ms. Default: 30000."; }; readonly backoff: { readonly type: "string"; readonly enum: readonly ["fixed", "exponential"]; readonly description: "Backoff strategy. Default: exponential."; }; readonly on: { readonly type: "array"; readonly items: { readonly type: "string"; readonly enum: readonly ["network", "lock", "busy", "oom"]; }; readonly description: "Error categories to retry on. Default: [\"network\", \"lock\", \"busy\"]."; }; }; }; readonly until: { readonly type: "object"; readonly description: "Pattern-based early termination. Watch stdout/stderr for a regex match."; readonly properties: { readonly pattern: { readonly type: "string"; readonly description: "Regex to watch for in combined stdout/stderr."; }; readonly timeout_ms: { readonly type: "integer"; readonly minimum: 1; readonly description: "Max wait time in ms. Defaults to command timeout."; }; readonly kill_after: { readonly type: "boolean"; readonly description: "Kill the process when pattern matches. Default false (promotes to background)."; }; }; readonly required: readonly ["pattern"]; }; readonly progress: { readonly type: "boolean"; readonly description: string; }; readonly interactive: { readonly type: "boolean"; readonly description: string; }; }; }; readonly minItems: 1; readonly maxItems: 10; }; readonly parallel: { readonly type: "boolean"; readonly description: "Run all commands in parallel. Default: false (sequential)."; }; readonly working_dir: { readonly type: "string"; readonly description: string; }; readonly timeout_ms: { readonly type: "integer"; readonly minimum: 1; readonly description: "Global timeout in ms applied to all commands. Default: 120000."; }; readonly verbosity: { readonly type: "string"; readonly enum: readonly ["count_only", "minimal", "standard", "verbose"]; readonly description: string; }; readonly stop_on_error: { readonly type: "boolean"; readonly description: string; }; readonly fail_fast: { readonly type: "boolean"; readonly description: string; }; readonly file_ops: { readonly type: "array"; readonly description: "File operations to execute BEFORE commands run."; readonly items: { readonly type: "object"; readonly properties: { readonly op: { readonly type: "string"; readonly enum: readonly ["copy", "move", "delete"]; readonly description: "Operation type."; }; readonly source: { readonly type: "string"; readonly description: "Source path (relative or absolute, within project root)."; }; readonly destination: { readonly type: "string"; readonly description: "Destination path. Required for copy and move."; }; readonly recursive: { readonly type: "boolean"; readonly description: "Copy/delete directories recursively."; }; readonly overwrite: { readonly type: "boolean"; readonly description: string; readonly default: false; }; readonly dry_run: { readonly type: "boolean"; readonly description: string; readonly default: false; }; readonly update_imports: { readonly type: "boolean"; readonly description: string; readonly default: false; }; }; readonly required: readonly ["op", "source"]; }; }; }; readonly required: readonly ["commands"]; }; export type ExecVerbosity = 'count_only' | 'minimal' | 'standard' | 'verbose'; export interface ExecExpect { exit_code?: number | undefined; stdout_contains?: string | undefined; stderr_contains?: string | undefined; } export interface ExecRetry { max?: number | undefined; delay_ms?: number | undefined; /** Max jitter cap for exponential backoff. Default: 30000. */ max_delay_ms?: number | undefined; backoff?: 'fixed' | 'exponential' | undefined; /** Error categories to retry on. Default: ['network', 'lock', 'busy']. */ on?: ReadonlyArray<'network' | 'lock' | 'busy' | 'oom'> | undefined; } export interface ExecUntil { pattern: string; timeout_ms?: number | undefined; kill_after?: boolean | undefined; } export interface ExecFileOp { op: 'copy' | 'move' | 'delete'; source: string; destination?: string | undefined; recursive?: boolean | undefined; /** Overwrite destination if it exists (copy/move only). Default: false. */ overwrite?: boolean | undefined; /** Preview what would be deleted without deleting (delete only). Default: false. */ dry_run?: boolean | undefined; /** Rewrite TS/JS import paths after move (move only). Default: false. */ update_imports?: boolean | undefined; } export interface ExecCommandInput { cmd?: string | undefined; cmd_base64?: string | undefined; cwd?: string | undefined; working_dir?: string | undefined; timeout_ms?: number | undefined; env?: Record | undefined; expect?: ExecExpect | undefined; background?: boolean | undefined; retry?: ExecRetry | undefined; until?: ExecUntil | undefined; /** Stream stdout to a pollable progress file. Auto-enabled when timeout_ms > 30000. */ progress?: boolean | undefined; /** * Run under a PTY with the prompt-answer path (see exec/interactive.ts). * true forces it (when the host has a PTY backend), false forces the plain * pipe path, undefined auto-engages for prompt-prone base commands only. */ interactive?: boolean | undefined; } export interface ExecInput { commands: ExecCommandInput[]; parallel?: boolean | undefined; working_dir?: string | undefined; timeout_ms?: number | undefined; verbosity?: ExecVerbosity | undefined; file_ops?: ExecFileOp[] | undefined; /** * Stop sequential execution on first failed command. * Unexecuted commands appear as {skipped: true} entries. Default: false. */ fail_fast?: boolean | undefined; /** Alias for fail_fast. */ stop_on_error?: boolean | undefined; } export interface ExecCommandResult { cmd: string; exit_code: number | null; stdout: string; stderr: string; success: boolean; /** Set when expectations are violated. */ expectation_error?: string | undefined; /** Set when command exceeded timeout. */ timed_out?: boolean | undefined; /** Set when an external AbortSignal cancelled the command (orchestration engine cancellation). Never combined with timed_out. */ cancelled?: boolean | undefined; /** Set when command ran in background. */ process_id?: string | undefined; pid?: number | undefined; /** Timing info (verbose only). */ duration_ms?: number | undefined; cwd?: string | undefined; env?: Record | undefined; /** * Credential-bearing environment variable NAMES withheld from the spawned * process by the exec env scrub (never values). Present only when at least one * variable was withheld, so a clean spawn stays quiet. */ withheld_env?: string[] | undefined; /** Truncation note. */ stdout_truncated?: boolean | undefined; stderr_truncated?: boolean | undefined; /** Number of retry attempts used. */ retries?: number | undefined; /** Set when this command was not executed due to fail_fast/stop_on_error. */ skipped?: boolean | undefined; /** * Set when the guard refused the command before execution. Nothing ran, so * the reason is the whole result and reporting must not be shortened by * verbosity, see formatResult in exec/runtime.ts. */ denied?: boolean | undefined; /** Structured denial: full reason plus the per-segment classification breakdown. */ denial_detail?: Record | undefined; /** Path to the pollable progress file when progress tracking is enabled. */ progress_file?: string | undefined; /** Tool-level warnings for degraded command collection or side effects. */ warnings?: string[] | undefined; /** * Whether this command ran inside the per-command OS sandbox boundary. Present * only when the sandbox was active for the run, so a non-sandboxed exec stays * quiet. False with a `sandbox_boundary` reason when the sandbox was requested * but the host could not provide it (honest-unavailable, ran unsandboxed). */ sandboxed?: boolean | undefined; /** One-line summary of the boundary that was applied (or why there was none). */ sandbox_boundary?: string | undefined; /** Network posture inside the boundary: disabled, enabled, or unconfirmed (unknown). */ sandbox_network?: 'disabled' | 'enabled' | 'unknown' | undefined; /** Named host-access escalations granted to this sandboxed run (network, writable extras). */ sandbox_escalations?: string[] | undefined; /** * One dense line naming the isolation that applied to this run, so an absence * observed inside the boundary is not read as an absence on the host. * * The boundary has a different world than the machine: a separate network * namespace (host `localhost` services, the goodvibes daemon among them, are * unreachable), a read-only filesystem outside the workspace, a masked /tmp * and $HOME, and narrower device and process visibility. Without this line a * missing `bluetoothctl` or an empty device list reads as fact about the * user's computer, which is how a sandboxed probe came to report that a * headset that was plugged in did not exist. */ sandbox_note?: string | undefined; /** * Whether this command ran under the PTY prompt-answer path. Present only on * interactive runs; the PTY merges stderr into stdout, so `stdout` carries * the full terminal transcript and `stderr` is empty. */ pty?: boolean | undefined; /** Number of terminal prompts answered through the approval machinery. */ prompts_answered?: number | undefined; /** * The detected-but-unanswered terminal prompt at the moment the run ended * (timeout, decline, or cancellation), the honest diagnosis of what the * child was waiting on. */ pending_prompt?: string | undefined; /** Set when the surfaced prompt ask was declined and the run was stopped. */ prompt_declined?: boolean | undefined; } export type { BackgroundProcess } from '../shared/process-manager.js'; //# sourceMappingURL=schema.d.ts.map