import type { MemoryPromptBudget } from "../context/memory-prompt-budget.ts"; import { type MemoryEgressPolicy } from "../context/memory-provider-contract.ts"; import type { ToolDefinition } from "../extensions/types.ts"; import type { MemoryLifecycleContext, MemoryProvider } from "./memory-provider.ts"; export interface MemoryPrefetchOptions { externalEgressPolicy?: MemoryEgressPolicy; } export interface MemoryManagerOptions { /** Maximum time a provider lifecycle call may keep the session waiting. */ lifecycleTimeoutMs?: number; } export type MemoryLifecycleOperation = "isAvailable" | "initialize" | "prefetch" | "syncTurn" | "onPreCompress" | "onSessionEnd" | "shutdown"; export interface MemoryLifecycleDiagnostic { provider: string; operation: MemoryLifecycleOperation; status: "timeout" | "error" | "abandoned"; message: string; } export declare class MemoryManager { /** Provider identities remain fenced while late timed-out operations are still pending, without retaining them strongly. */ private static readonly ABANDONED_PROVIDERS; private readonly providers; private readonly activeProviders; private readonly registeredToolNames; private ctx?; private systemPromptBlockCache?; private readonly lifecycleTimeoutMs; private readonly lifecycleDiagnostics; private static readonly RESERVED_CORE_TOOL_NAMES; constructor(options?: MemoryManagerOptions); /** Bounded, source-labelled diagnostics for lifecycle failures; no provider payloads are retained. */ getLifecycleDiagnostics(): MemoryLifecycleDiagnostic[]; private recordLifecycleDiagnostic; private abandonProvider; private releaseAbandonedProvider; private invokeProvider; registerProvider(p: MemoryProvider): void; initializeAll(sessionId: string, ctx: MemoryLifecycleContext): Promise; buildSystemPromptBlock(budget?: MemoryPromptBudget): string; /** * Compose the memory block freshly from the providers, BYPASSING the frozen cache used by the * system prompt. Used by end-of-loop reflection so its confront-before-write sees the live memory * (including writes made earlier in the same session) without churning the prefix-cache-stable * system prompt block. */ buildSystemPromptBlockFresh(budget?: MemoryPromptBudget): string; private _composeSystemPromptBlock; prefetch(query: string, options?: MemoryPrefetchOptions): Promise; syncTurn(user: string, assistant: string): Promise; onPreCompress(): Promise; onSessionEnd(): Promise; shutdownAll(): Promise; getToolDefinitions(): ToolDefinition[]; getContextMarkers(): string[]; reset(): void; } //# sourceMappingURL=memory-manager.d.ts.map