export interface SageSplit { /** Tool result text with the SAGE block removed. */ cleanOutput: string; /** Extracted SAGE block lines (including the `--- SAGE:` header), or empty. */ sageLines: string[]; } /** * One SAGE memory line split into its structured fields, so the renderer shows * clean key/value rows instead of an opaque blob. The producer shape (see * `packages/sage/src/retrieval/format.ts`) is: * * - [kind][importance?] escaped text (anchor)? [relation=…; tags=…] */ export interface ParsedSageMemoryLine { id: string; text: string; labels: string[]; anchor?: string | undefined; relation?: string | undefined; tags?: string[] | undefined; } /** * Strict counterpart to the canonical gate regex (kept private in * `sage-output-block.ts`). The gate only decides "does this line belong to a * SAGE block?" and stays permissive (greedy body, opaque `(?: .*)?` trailer) * so block extraction survives future format additions. This one captures * named groups and therefore requires the exact `(anchor)` / `[meta]` shapes * the producer emits today; a line that passes the gate but fails here falls * back to a literal render row, so the memory is still shown. */ export declare const SAGE_MEMORY_DETAIL: RegExp; export declare function parseSageMemoryLine(line: string): ParsedSageMemoryLine | null; export declare function extractSageBlock(output: string): SageSplit; /** * Resolve the SAGE block for a tool history entry. * * Live entries carry the block as structured `sageLines` (from * `tool.executed.sage`), split off by the backend BEFORE the event's ~400-char * preview cap — that cap used to slice a memory line mid-fence, and the * unparseable remainder then rendered as raw tool text. Replayed entries have * no such field and still carry the block inline in `output`, so fall back to * splitting the text. */ export declare function resolveEntrySage(output: string | undefined, sageLines: readonly string[] | undefined): SageSplit; export declare function formatToolOutputSageWith(input: { toolName: string; output: string | undefined; ok: boolean; /** Structured SAGE lines from the event, when the surface has them. */ sageLines?: readonly string[] | undefined; outputBytes?: number | undefined; outputLines?: number | undefined; formatToolOutput(toolName: string, output: string | undefined, ok: boolean, outputBytes?: number | undefined, outputLines?: number | undefined): string[]; }): { cleanOutput: string; outLines: string[]; sageLines: string[]; }; //# sourceMappingURL=sage-output-format.d.ts.map