/** * pi-loom: Context Offloader — TDAM-inspired symbolic short-term memory * * Stores large tool outputs to external files and replaces them with * lightweight symbolic references — cutting token usage while preserving * full traceability via node_id. * * Architecture: * Tool output (100K tokens) * → 1. Full text → .pi-loom/refs//.md * → 2. Symbolic summary → [REF: node_id] + brief description * → 3. Agent can grep for node_id to recover full text on demand * * Mermaid integration (optional): * Generates lightweight Mermaid task graphs from accumulated refs. */ export interface OffloadResult { nodeId: string; filePath: string; originalBytes: number; compressedBytes: number; summary: string; refString: string; } export declare function offloadText(content: string, sessionId: string, label: string, maxInlineChars?: number): OffloadResult; export declare function retrieveOffload(nodeId: string, sessionId?: string): string | null; export declare function generateMermaidGraph(sessionId: string): string; export declare function listSessionRefs(sessionId: string): Array<{ nodeId: string; filename: string; size: number; }>; export declare function cleanOldRefs(retentionDays?: number): number;