/** * Structured-output parsing for harnesses that emit JSON / NDJSON * (antigravity `--output-format json`, claude `stream-json`, gemini json, ...). * * The reply loops call parseHarnessOutput() on the raw stdout and get back the * plain-text reply. Defensive by design: when nothing structured is found the * raw text is returned unchanged, so plain-text harnesses (opencode, codex * exec) are never touched. * * formatHarnessEvent() is the live-streaming counterpart: it converts a single * NDJSON event line into a human-readable transcript line for the console/tee. */ /** * Parse a harness NDJSON event line into a human-readable transcript line. * Returns null when the line is not a recognized JSON event (falls through * to raw logging for plain-text harnesses or non-JSON lines). * * Supports: opencode, claude, cursor, gemini/antigravity, goose, copilot, * openhands — all harnesses that emit `--output-format json` or `--format json`. */ export declare function formatHarnessEvent(raw: string): string | null; /** * Best-effort extraction of the plain-text reply from structured stdout. * Returns null when nothing structured was found (caller keeps raw text). */ export declare function tryExtractStructuredReply(raw: string): string | null; /** * Extract the plain-text reply for a harness. `structured` mirrors the * adapter's `structuredOutput` flag; plain-text harnesses pass through. */ export declare function parseHarnessOutput(structured: boolean, raw: string): string;