/**
 * RAG types: `Lesson`, `RecallHit`, `RagBackend`.
 *
 * The `RagBackend` interface is the ONLY surface that `src/functions/rag.ts`
 * sees — no `@libsql/client` types leak past this boundary. That is what
 * makes the backend pluggable: Task 1.11 lands `libsql-lexical`, Task 1.12
 * lands `claude-auto-memory`, and neither requires touching the primitives.
 *
 * `embed()` returns `Promise<number[] | null>` rather than throwing on
 * embedder-down because the backend treats Ollama-absent as a degraded
 * (lexical-only) mode, not an error. The primitive caller decides what to
 * do with `null` — by default, `store_lesson` still inserts the row.
 *
 * Imports from: nothing (leaf type module).
 * Imported by: src/rag/* + src/functions/rag.ts.
 */
export interface Lesson {
    id: string;
    content: string;
    tags: string[];
    source: string;
    author: 'user' | 'agent';
    createdAt: string;
    derivedFrom?: string[];
    consumedByUserLessons?: number;
    tier?: MemoryTier;
    namespace?: string | null;
}
/**
 * A memory's scope tier. `shared` crosses every project (user/global knowledge); `project` is isolated
 * to one umbrella `namespace`. Kept to exactly two grounded values — every write path can produce both
 * (memorize enum-maps, the importer resolves the umbrella). See T-memory-scope-isolation.
 */
export type MemoryTier = 'shared' | 'project';
/** The required recall scope: the caller's resolved umbrella namespace (null = no project context). */
export interface RecallScope {
    namespace: string | null;
}
/**
 * The PURE eligibility predicate — the one place the cross/isolate rule lives, so it is unit-testable and
 * cannot drift. A hit is eligible iff it is `shared`, OR it is `project` AND its namespace matches the
 * recall scope. A null recall namespace (no project context) therefore matches ONLY `shared` rows
 * (fail-closed: project memory is never leaked when the project is unknown). Absent tier ⇒ `shared`.
 */
export declare function inScope(tier: MemoryTier | undefined, namespace: string | null | undefined, scope: RecallScope): boolean;
export interface RecallHit {
    lesson: Lesson;
    score: number;
    source: 'semantic' | 'lexical' | 'fused';
}
/** Result of `deleteLesson`. `deleted:false` = id not found (caller maps to INVALID_PARAMS). */
export interface DeleteResult {
    deleted: boolean;
    forced: boolean;
}
/**
 * Thrown by `deleteLesson` when the target is a `user`-authored lesson and `force` was not set.
 * Defined here (not in mcp/tools) so every backend can throw it without depending on the MCP layer
 * (`forget.ts` re-exports it for back-compat with existing imports). Mirrors the engine's
 * USER_MEMORY_IMMUNE (-32003) — explicit user deletion is allowed (with force); automatic eviction
 * of user memories is forbidden (the no-auto-delete invariant).
 */
export declare class UserAuthoredImmunityError extends Error {
    readonly id: string;
    constructor(id: string);
}
export interface RagBackend {
    init(): Promise<void>;
    embed(text: string): Promise<number[] | null>;
    recall(query: string, k: number, scope: RecallScope): Promise<RecallHit[]>;
    storeLesson(lesson: Lesson): Promise<void>;
    deleteLesson(id: string, opts?: {
        force?: boolean;
    }): Promise<DeleteResult>;
}
//# sourceMappingURL=types.d.ts.map