import type { MemoryPromptBudget } from "../../context/memory-prompt-budget.ts"; import { type PiOkfType } from "../../context/okf-memory.ts"; import type { ToolDefinition } from "../../extensions/types.ts"; import type { MemoryLifecycleContext, MemoryProvider } from "../memory-provider.ts"; /** * Confront-before-write (anti append-rot): if `content` is a near-duplicate of an existing * non-empty line (token Jaccard ≥ threshold — i.e. the same fact reworded), supersede that line in * place and return the rewritten file; otherwise return null (the caller appends normally). */ export declare function supersedeNearDuplicateLine(existing: string, content: string): string | null; export interface FileStoreProviderOptions { onDurableMemoryChanged?: () => void; /** Test seam between loss-safe OKF creation and exact hot-memory removal. */ beforeOrganizeHotRemoval?: () => void | Promise; } export type StructuredReflectionWrite = { kind: "okf_add"; type: PiOkfType; title: string; description: string; text: string; tags?: string[]; evidenceRefs: string[]; } | { kind: "okf_organize"; type: PiOkfType; title: string; description: string; text: string; sourceText: string; tags?: string[]; evidenceRefs: string[]; }; export interface StructuredReflectionApplyResult { applied: boolean; created: boolean; digest?: string; sourceRemoved?: boolean; error?: string; } export interface StructuredReflectionRollback { type: PiOkfType; title: string; expectedDigest?: string; sourceText?: string; removeRecord: boolean; } export declare const FILE_STORE_MEMORY_SYSTEM_NOTE = "[System Note: Below is a snapshot of persistent memory. Proactively record verified reusable project facts and user preferences with the 'memory' tool. Keep MEMORY.md for compact hot facts, USER.md for preferences, and use target 'okf' for durable project decisions, architecture, rules, findings, and references. Never store transient noise.]"; export declare class FileStoreProvider implements MemoryProvider { readonly name = "file-store"; readonly egress = "local"; private ctx?; private memoryFilePath; private userFilePath; private memoryStatePath; private userStatePath; private lastWrittenMemory; private lastWrittenUser; private userArchive?; private okfStore?; private readonly options; private static readonly BUDGET_MEMORY; private static readonly BUDGET_USER; constructor(options?: FileStoreProviderOptions); isAvailable(): boolean; getCapabilities(): { surfaces: "context"[]; }; initialize(_sessionId: string, ctx: MemoryLifecycleContext): Promise; private initializeManagedFile; systemPromptBlock(budget?: MemoryPromptBudget): string; prefetch(_query: string): Promise; shutdown(): Promise; private executeMemoryCommand; private hasExactHotMemoryItem; private removeExactHotMemoryItem; /** Reflection-owned structured write. Organization is OKF-first, then exact hot-memory removal. */ applyStructuredReflectionWrite(write: StructuredReflectionWrite, signal?: AbortSignal): Promise; /** Restore hot memory first, then conditionally remove the exact audited OKF bytes. */ rollbackStructuredReflectionWrite(rollback: StructuredReflectionRollback, signal?: AbortSignal): Promise; getContextMarkers(): string[]; getToolDefinitions(): ToolDefinition[]; } //# sourceMappingURL=file-store.d.ts.map