import type { Readable } from 'node:stream'; import type { AgentMessage } from './agent-runner.js'; export declare class StdioToolBridge { private stdin; private toolTimeoutMs; private emit; /** Invoked synchronously on a cancel frame — wired to terminate(). */ private onCancel?; private pending; private counter; private closed; private buffer; private stopped; constructor(stdin: Readable, toolTimeoutMs: number, emit: (ev: Record) => void, /** Invoked synchronously on a cancel frame — wired to terminate(). */ onCancel?: (() => void) | undefined); start(): void; private handleLine; /** Set when the caller sends a cancel frame; polled by the engine loop. */ cancelRequested: boolean; /** Invoke a tool on the caller: emit tool_call, await tool_result, echo it. */ call(name: string, args: Record): Promise<{ text: string; }>; /** Stop reading; fail anything still pending. */ stop(): void; } export declare class UsageTracker { private cumulative; /** Running sum of every delta; `usd` stays null until a cost is reported. */ readonly total: { in: number; out: number; usd: number | null; }; /** `usd` is null when the runner reported no cost (unknown, never $0): * a missing or non-finite `cost_usd` stays null instead of becoming 0. */ delta(m: AgentMessage): { in: number; out: number; usd: number | null; }; } //# sourceMappingURL=agent-exec-bridge.d.ts.map