/** * Transcript parser for `claude -p --output-format stream-json`. The format * is one JSON object per line; we collect the assistant text + tool-use * events for the observation record. * * The stream-json schema is informally documented and may shift between * Claude Code releases. This parser is intentionally tolerant of unknown * event kinds — anything we don't recognise is appended to `raw`. * * Shape notes (empirically verified): * - `tool_use` content blocks carry `input.command` for Bash calls. * - `tool_result` content blocks (on `user` events) carry `is_error`. * - `parent_tool_use_id` lives on the TOP-LEVEL event object (not the content * block) — `null` for top-level tool calls, the parent's tool_use id for * subagent-attributed calls. * - The terminal `result` event carries `subtype`, `is_error`, `num_turns`, * and `total_cost_usd`. */ export interface ParsedTranscript { text: string; toolUseEvents: Array<{ name: string; inputSummary: string; }>; errors: string[]; raw: string[]; toolUses: Array<{ id: string | null; name: string; command?: string; inputSummary: string; parentToolUseId: string | null; }>; toolResults: Array<{ toolUseId: string | null; isError: boolean; contentSummary: string; }>; result?: { subtype?: string; isError: boolean; numTurns?: number; totalCostUsd?: number; }; rateLimited: boolean; } export declare function parseStreamJsonTranscript(streamText: string): ParsedTranscript; export declare function detectInvocationFromTranscript(parsed: ParsedTranscript, invocationSignals: readonly string[]): boolean; //# sourceMappingURL=transcript.d.ts.map