import type { SandboxSession } from "#shared/sandbox-session.js"; /** How long a `bash` call waits before it leaves the command running in the background. */ export declare const BASH_YIELD_SECONDS = 30; /** * Typed input accepted by {@link executeBashOnSandbox}. */ export interface BashInput { readonly command: string; } /** * Per-call options for {@link executeBashOnSandbox}. */ export interface BashExecutionOptions { /** * Stops the command when aborted before the call returns. A command * already returned as `running` keeps running. */ readonly abortSignal?: AbortSignal; } interface BashStreams { readonly stderr: string; readonly stdout: string; /** True when stdout or stderr was shortened to fit within output limits. */ readonly truncated: boolean; } /** * Structured result returned from {@link executeBashOnSandbox}: the command * finished, or it is still running in the background. */ type BashResult = (BashStreams & { readonly status: "completed"; readonly exitCode: number; }) | (BashStreams & { readonly status: "running"; readonly pid: number; readonly outputDirectory: string; readonly message: string; }); /** * Executes one shell command inside the agent's sandbox. * * A command that finishes within {@link BASH_YIELD_SECONDS} returns its exit * code and output. A slower command keeps running in the sandbox as its own * process group, writing to files the model reads with later commands, and * the call returns its output so far with `status: "running"`. Sandboxes that * cannot run background processes, such as `just-bash`, run every command to * completion. * * Both stdout and stderr are tail-truncated to keep the end of the output * (where errors and final results typically appear) within the shared * output limits. */ export declare function executeBashOnSandbox(sandbox: SandboxSession, args: BashInput, options?: BashExecutionOptions): Promise; export {};