/** * Streaming bash — async-iterator shell with real-time output chunks. * * The TypeScript port of `python/src/adk_fluent/_harness/_streaming.py`. * * Unlike the blocking process tools, `StreamingBash` yields output as it * arrives, which is essential for long-running commands (builds, tests, * installs) where the LLM or user wants progressive feedback. * * Usage: * ```ts * const streamer = new StreamingBash(sandbox); * for await (const chunk of streamer.run("npm test")) { * process.stdout.write(chunk); * } * ``` */ import { type SandboxPolicy } from "./sandbox.js"; export interface StreamingBashRunOptions { /** Maximum execution time in seconds. Defaults to 120. */ timeoutSec?: number; /** Optional callback fired for each output chunk before it is yielded. */ onOutput?: (chunk: string) => void; } /** * Streaming shell executor. * * Spawns commands via `bash -c ` inside the sandbox workspace, * yielding stdout+stderr chunks as they arrive. Honors `sandbox.allowShell`, * `sandbox.workspace`, and `sandbox.maxOutputBytes` exactly like the * blocking `processTools()` flow. */ export declare class StreamingBash { readonly sandbox: SandboxPolicy; constructor(sandbox: SandboxPolicy); /** * Execute a command and yield output chunks as they arrive. * * Output is decoded as UTF-8. Stderr is merged into stdout. The iterator * completes when the process exits, the timeout fires, or the cumulative * output exceeds `sandbox.maxOutputBytes`. */ run(command: string, opts?: StreamingBashRunOptions): AsyncIterableIterator; /** * Execute a command and return the full collected output as a string. * * Like `run()` but joins every chunk. If `onOutput` is supplied it still * fires for each chunk as it arrives, so callers can stream and collect * simultaneously. */ runCollected(command: string, opts?: StreamingBashRunOptions): Promise; } //# sourceMappingURL=streaming.d.ts.map