export type MemorySource = "memory" | "sessions";
/**
 * L3 long-term memory chunk classification. Drives kind-specific decay rates
 * and promotion selection to `memory/symi-core.md` vs `memory/symi-beliefs.md`.
 *
 * - observation: raw per-turn notes captured by the agent. Short half-life.
 * - belief: synthesized from clusters of observations during stage 4. Long half-life.
 * - preference: user style / cadence / taste. Long half-life.
 * - fact: stable world/user fact. Medium-long half-life.
 * - lesson: "what went wrong / what worked" from past work. Long half-life.
 * - identity: who Symi is to this user, the relationship itself. Longest half-life.
 */
export type ChunkKind = "observation" | "belief" | "preference" | "fact" | "lesson" | "identity";
export declare const CHUNK_KINDS: readonly ChunkKind[];
export type MemorySearchResult = {
    path: string;
    startLine: number;
    endLine: number;
    score: number;
    weight?: number;
    snippet: string;
    source: MemorySource;
    citation?: string;
};
export type MemoryEdge = {
    sourceChunkId: string;
    targetChunkId: string;
    relation: string;
    weight: number;
    createdAt: string;
};
/**
 * Result of a single L3 cycle run. All numbers are per-stage counts for
 * telemetry + the `symi memory consolidate` CLI output; paths refer to the
 * L3-owned markdown files that were (re)written.
 */
export type L3CycleResult = {
    ranAt: number;
    durationMs: number;
    decayed: number;
    reinforced: number;
    propagated: number;
    clustersSynthesized: number;
    beliefsCreated: number;
    promoted: number;
    pruned: number;
    paths: {
        symiCore?: string;
        symiBeliefs?: string;
    };
    skipped?: {
        reason: string;
    };
};
export type MemoryEmbeddingProbeResult = {
    ok: boolean;
    error?: string;
};
export type MemorySyncProgressUpdate = {
    completed: number;
    total: number;
    label?: string;
};
export type MemoryProviderStatus = {
    backend: "builtin" | "qmd";
    provider: string;
    model?: string;
    requestedProvider?: string;
    files?: number;
    chunks?: number;
    dirty?: boolean;
    workspaceDir?: string;
    dbPath?: string;
    extraPaths?: string[];
    sources?: MemorySource[];
    sourceCounts?: Array<{
        source: MemorySource;
        files: number;
        chunks: number;
    }>;
    cache?: {
        enabled: boolean;
        entries?: number;
        maxEntries?: number;
    };
    fts?: {
        enabled: boolean;
        available: boolean;
        error?: string;
    };
    fallback?: {
        from: string;
        reason?: string;
    };
    vector?: {
        enabled: boolean;
        available?: boolean;
        extensionPath?: string;
        loadError?: string;
        dims?: number;
    };
    batch?: {
        enabled: boolean;
        failures: number;
        limit: number;
        wait: boolean;
        concurrency: number;
        pollIntervalMs: number;
        timeoutMs: number;
        lastError?: string;
        lastProvider?: string;
    };
    custom?: Record<string, unknown>;
};
/**
 * Result of a pin/unpin operation. `match` is the chunk that was located
 * and flipped; `found: false` means no chunk matched the query closely
 * enough to pin.
 */
export type MemoryPinResult = {
    found: true;
    chunkId: string;
    path: string;
    startLine: number;
    endLine: number;
    snippet: string;
    pinned: boolean;
} | {
    found: false;
    reason: string;
};
export interface MemorySearchManager {
    search(query: string, opts?: {
        maxResults?: number;
        minScore?: number;
        sessionKey?: string;
    }): Promise<MemorySearchResult[]>;
    readFile(params: {
        relPath: string;
        from?: number;
        lines?: number;
    }): Promise<{
        text: string;
        path: string;
    }>;
    status(): MemoryProviderStatus;
    sync?(params?: {
        reason?: string;
        force?: boolean;
        progress?: (update: MemorySyncProgressUpdate) => void;
    }): Promise<void>;
    probeEmbeddingAvailability(): Promise<MemoryEmbeddingProbeResult>;
    probeVectorAvailability(): Promise<boolean>;
    /**
     * Lock a chunk as durable — exempts it from L3 decay / pruning and
     * boosts its promotion rank. Takes a natural-language query and pins
     * the top search hit if it scores above `minScore`. Optional — QMD
     * backend doesn't implement it.
     */
    pin?(params: {
        query: string;
        minScore?: number;
    }): Promise<MemoryPinResult>;
    unpin?(params: {
        query: string;
        minScore?: number;
    }): Promise<MemoryPinResult>;
    /**
     * Run the L3 long-term-memory cycle. Optional — implemented only by
     * the builtin backend. `synthesize` enables stage 4 (cluster → belief);
     * omit to run the cheap stages only.
     */
    runL3CycleIfDue?(params?: {
        minIntervalMs?: number;
        force?: boolean;
    }): Promise<L3CycleResult>;
    close?(): Promise<void>;
}
