/** * OpenKernel — Backend output parsing helpers * * Third-party CLIs emit different JSON shapes (and different versions change * them), so parsing is deliberately defensive: try JSON, pull the common * fields, and always fall back to raw text. Nothing here throws. */ export declare function tryJson(line: string): Record | null; export declare function str(v: unknown): string | undefined; /** Append a line to an accumulating text body. */ export declare function appendLine(acc: string | undefined, line: string): string; /** * Pull assistant text out of a wide range of JSON event shapes: * Anthropic/Claude content arrays, plain `content` strings, and the usual * `text`/`response`/`result`/`message` fields other CLIs use. */ export declare function extractText(obj: Record): string | undefined; /** Common session-id keys across the CLIs, plus a bare-UUID fallback. */ export declare function extractSessionId(obj: Record): string | undefined; export declare function sessionIdFromText(line: string): string | undefined;