import type { DelegateTaskStreamEvent, DelegateTaskUsage } from './types'; /** * Parses Agent sandbox `--output-format stream-json` output into typed events. * * Agent sandbox emits one JSON object per line. This parser converts each line * into zero or more DelegateTaskStreamEvent objects and accumulates token * usage/cost across the full run. * * Designed for use both in real-time streaming (parse each line as it arrives) * and post-hoc parsing (parse all stdout lines after execution completes). */ export declare class StreamParser { private accumulatedUsage; private lastResponse; /** * Parse a single line of Agent sandbox stream-json output into zero or more * DelegateTaskStreamEvents. Returns an empty array for empty lines, invalid * JSON, or unknown message types. */ parseLine(line: string): DelegateTaskStreamEvent[]; /** Return a copy of the usage accumulated across all parsed messages. */ getAccumulatedUsage(): DelegateTaskUsage; /** Return the last assistant response text seen in the stream. */ getLastResponse(): string; }