import type { ProfileManager } from '../core/ProfileManager.js'; import type { Entry } from '../core/EntrySchema.js'; import type { ContextBlock, PackedContextResult } from './ContextPacker.js'; import type { ContextMode } from './ContextBudgetPolicy.js'; import type { ResumeResult } from '../metrics/ResumeMetrics.js'; import type { Clock } from '../shared/Clock.js'; export interface ContextResumeOptions { windowTokens: number; mode?: ContextMode; confidenceThreshold?: number; } export interface ContextResumeResult { packed: PackedContextResult; resume: ResumeResult; restoredEntries: Entry[]; } /** Convert a memory Entry to a ContextBlock for the packer. */ export declare function entryToContextBlock(entry: Entry, nowMs: number): ContextBlock; export declare class ContextRestoreService { private profileManager; private clock; constructor(profileManager: ProfileManager, clock?: Clock); /** * Build the Structured Judgment Protocol block (~50 tokens). * Guides the LLM on how to judge what memories to store via brain_append. */ private buildJudgmentProtocolBlock; /** * Build the Memory Context block — compact summary of protected entries. * Enables LLM to perform dedup checks and upsert existing memories. */ private buildMemoryContextBlock; /** * Restore context from synced profile. * Loads active entries, converts to ContextBlocks, packs within budget. * Includes Layer 1 (Judgment Protocol) and Layer 2 (Memory Context). */ restore(options: ContextResumeOptions): Promise; }