/** * Parses the line-oriented JSON a background task's agent process writes to * stdout (`claude -p --output-format stream-json --verbose`) into the two * things TaskManager actually needs: compact human-readable progress lines * for the canvas pane's live activity view, and the final result event's * error state. Pure and defensive — a task's stdout is another program's * output format, so anything unrecognized degrades to "no update", never a * throw. * * Event shapes handled (everything else is ignored): * - {"type":"system","subtype":"init",...} → "Agent started" * - {"type":"assistant","message":{"content":[...]}} → one line per block: * {"type":"tool_use","name":"Write","input":{...}} → "Write " * {"type":"text","text":"..."} → truncated snippet * - {"type":"result","is_error":bool,"result":"..."} → final result */ export interface TaskStreamUpdate { /** Zero or more new progress lines (an assistant message can carry several * content blocks). */ statusLines: string[]; /** Present only for the final "result" event. */ result?: { isError: boolean; text: string; }; } /** * Parses one stdout line. Returns null for anything that isn't a recognized * stream event (blank lines, non-JSON noise, event types we don't render). */ export declare function parseTaskStreamLine(line: string): TaskStreamUpdate | null; //# sourceMappingURL=task-stream.d.ts.map