/** * Wire-event parsing and content sanitization for session history * rehydration. Extracted verbatim from `agent-bridge.ts`. Pure helpers — * no bridge state. */ import type { ImageContent, TextContent } from "../../sdk/ai/types.js"; import type { RestoredMemorySnapshot } from "../../memory/types.js"; import type { SessionMemorySnapshot } from "../storage.js"; interface ParsedWireToolEvents { toolCalls: Array<{ id: string; name: string; arguments: Record | undefined; }>; toolResults: Array<{ id: string; result: unknown; isError: boolean; }>; } /** * Parse the newline-delimited JSON of wire events persisted alongside an * assistant message and extract all tool_call / tool_result events. * * These are used during session rehydration to reconstruct the full tool * interaction history (call → result) so the LLM context is complete — * without this, reconnected sessions would see only the assistant text * and never the tool results, causing the model to get confused about * the conversation state. */ export declare function parseWireToolEvents(eventsJsonl: string): ParsedWireToolEvents; export declare function sanitizeRehydratedBlock(block: TextContent | ImageContent): TextContent | ImageContent; export declare function toRestoredMemorySnapshot(snapshot: SessionMemorySnapshot): RestoredMemorySnapshot; export {}; //# sourceMappingURL=rehydrate.d.ts.map