/** * LargeAnswerStore — prevents `ask_subagent` results from bloating the * director's context window. * * Problem: `ask_subagent` returns full subagent responses as tool_result * content. A single response can be 10-50K+ tokens. When the director * calls `ask` multiple times, these accumulate in ctx.messages and can * push context pressure past 100%, causing provider overflow errors or * silent quality degradation. * * Solution: responses above `sizeThreshold` chars are stored here * (in-memory Map keyed by stable id). The tool result returns only a * compact summary + the store key. Callers retrieve the full result * via `retrieveAnswer(key)` when they need it. * * The store is scoped to a single Director.run() lifecycle. * It is NOT persisted — if the process crashes the results are lost, * which is acceptable since the subagent already finished and the * summary is in context. */ export declare class LargeAnswerStore { private static readonly DEFAULT_MAX_ENTRIES; private static readonly DEFAULT_MAX_BYTES; /** * Responses above this size (in characters) are stored out-of-context. * Below this, the full answer is returned inline (no overhead). * Default: 2000 chars ≈ 400-600 tokens. */ readonly sizeThreshold: number; private readonly store; private readonly maxEntries; private readonly maxBytes; private storedBytes; constructor(sizeThreshold?: number, opts?: { maxEntries?: number | undefined; maxBytes?: number | undefined; }); /** * Store a value, returning a summary + key for inline use. * If the value is below sizeThreshold, returns it as-is (no store entry). */ storeAnswer(value: unknown): { key?: string | undefined; summary: string; inline: boolean; }; /** * Retrieve a previously stored answer by its key. * Returns undefined if the key is unknown or the store was cleared. */ retrieveAnswer(key: string): unknown | undefined; /** * Check if a key exists in the store. */ hasAnswer(key: string): boolean; /** Number of stored entries. */ get size(): number; /** Total characters stored. */ get totalChars(): number; /** Serialized UTF-8 bytes retained by the store. */ get totalBytes(): number; /** Clear all stored entries. Call at the end of a director run. */ clear(): void; } //# sourceMappingURL=large-answer-store.d.ts.map