import { type MemoryStatus } from "./memory-config.js";
import type { GraphQueryResult, MemoryMindmap, MemoryOntology, MemorySearchResult } from "./local-graph-memory-store.js";
import type { MemoryBackend } from "./memory-config.js";
import type { RunManifest } from "../contracts/run.js";
export interface MemoryStoreOptions {
    projectRoot?: string;
    sessionId?: string;
    source?: string;
    env?: NodeJS.ProcessEnv;
}
export interface UnifiedMemoryStore {
    readonly status: MemoryStatus;
    readonly strict: boolean;
    readonly mirrorFiles: boolean;
    readonly migrateFiles: boolean;
    read(path: string): Promise<string>;
    write(path: string, content: string): Promise<void>;
    append(path: string, content: string): Promise<void>;
    search(query: string, limit?: number): Promise<MemorySearchResult[]>;
    ontology?: () => Promise<MemoryOntology | null>;
    mindmap?: (query?: string, limit?: number) => Promise<MemoryMindmap | null>;
    graphQuery?: (query: string) => Promise<GraphQueryResult>;
    linkRun?: (runId: string, manifest: RunManifest) => Promise<void>;
}
export interface LinkRunToGraphOptions {
    projectRoot?: string;
    sessionId?: string;
    source?: string;
    env?: NodeJS.ProcessEnv;
}
/**
 * Idempotent, non-fatal finalizer: links a finalized run manifest into the
 * local graph memory backend. Returns true when the active backend linked the
 * run, false when no graph backend is available (e.g. file-only backend).
 *
 * Only ids/status/paths/sha256/counts are persisted — never raw evidence or
 * decision bodies, and never secrets. Callers should still wrap this in their
 * own try/catch so a graph write failure can never fail a run.
 */
export declare function linkRunToGraph(runId: string, manifest: RunManifest, options?: LinkRunToGraphOptions): Promise<boolean>;
export declare function createMemoryStore(backend: MemoryBackend, options?: MemoryStoreOptions): Promise<UnifiedMemoryStore | null>;
export declare class MemoryStore {
    private readonly options;
    private readonly basePath;
    private settingsPromise?;
    private graphStorePromise?;
    private graphStatePromise?;
    constructor(basePath: string, options?: MemoryStoreOptions);
    ensureGraphState(): Promise<void>;
    private safePath;
    read(path: string): Promise<string>;
    write(path: string, content: string): Promise<void>;
    append(path: string, content: string): Promise<void>;
    readRunMemory(runId: string, path: string): Promise<string>;
    writeRunMemory(runId: string, path: string, content: string): Promise<void>;
    search(query: string, limit?: number): Promise<MemorySearchResult[]>;
    ontology(): Promise<MemoryOntology | null>;
    mindmap(query?: string, limit?: number): Promise<MemoryMindmap | null>;
    graphQuery(query: string): Promise<GraphQueryResult>;
    status(): Promise<MemoryStatus>;
    private readFileContent;
    private writeFileContent;
    private safeRunPath;
    private getSettings;
    private getGraphStore;
}
