/** * Layer 2: Claude Code stream-json output parser. * * Parses lines from Claude Code's `--output-format stream-json` stdout * and extracts structured [BEACON:*] markers into typed AgentMarker objects. * * This module does not import from Layer 1. */ import type { AgentMarker, ActivityEvent } from './types.js'; /** * Parse a single line from Claude Code's stream-json output. * * Each line is a JSON envelope. We only care about "assistant" and "result" * types -- all others (system, tool_use, tool_result) are ignored. * * Returns an AgentMarker if the text inside the envelope contains a * [BEACON:*] marker, or null otherwise. */ export declare function parseStreamLine(line: string): AgentMarker | null; /** * Extract a [BEACON:*] marker from a text string. * * Marker format: `[BEACON:TYPE] {"json":"payload"}` * * Returns the typed AgentMarker if a valid marker is found, or null if * the text contains no marker, the marker type is unknown, or the JSON * payload fails to parse or is missing required fields. */ export declare function extractBeaconMarker(text: string): AgentMarker | null; /** * Truncate a string to a maximum length, appending "..." if truncated. */ export declare function truncateMessage(text: string, max?: number): string; /** * Parse a single line from Claude Code's stream-json output and extract * human-readable activity for real-time display. * * Unlike `parseStreamLine()` which only extracts [BEACON:*] markers, * this function extracts activity from *all* stream-json event types: * - `assistant` with text → first ~200 chars of text content * - `assistant` with tool_use → tool name + input summary * - `tool_result`, `system`, and other types → skipped (null) * * Activity events are ephemeral (not persisted to DB) and are broadcast * via SSE for real-time dashboard updates only. */ export declare function parseStreamActivity(line: string): ActivityEvent | null; //# sourceMappingURL=output-parser.d.ts.map