/**
 * Memory-store accessors for compression (retire-Rust RES-4a). The memory store IS the libSQL
 * `lessons` table (source:'memory'); compression needs two things the base store
 * (src/rag/backends/libsql_store.ts) doesn't expose: a get-by-id and an insert that carries the two
 * compression columns (`derived_from`, `consumed_by_user_lessons`). These are added ADDITIVELY via
 * `ensureCompressionColumns` (idempotent `ALTER TABLE ADD COLUMN` — existing rows default, so the
 * RES-1/3 recall/memorize paths are unaffected). Kept here (not in libsql_store) so the memory-
 * compression concern stays cohesive and the base backend's private client is untouched.
 *
 * Imports from: @libsql/client, ./compress.js.
 * Imported by: RES-4b (consolidate wires compress's getMemoryById/insertMemory deps) — not yet wired.
 */
import type { Client } from '@libsql/client';
import type { MemoryRow } from './compress.js';
/** Idempotently add the two compression columns to an existing `lessons` table. */
export declare function ensureCompressionColumns(client: Client): Promise<void>;
/** Load one memory by id (the `lessons` row), or null. */
export declare function getMemoryById(client: Client, id: string): Promise<MemoryRow | null>;
/**
 * Insert a memory carrying the compression columns (+ FTS + optional vector). Idempotent upsert by id.
 * File-first when `sourceDir` is given: writes the per-file source-of-truth (atomic) BEFORE the DB
 * upsert, mirroring `storeLesson` — so a consolidated memory survives a `rebuildLibsqlIndex` (which
 * re-indexes from files only). `sourceDir` undefined → DB-only (the pre-existing behavior).
 */
export declare function insertMemory(client: Client, m: MemoryRow, sourceDir?: string): Promise<void>;
/** The auto-memory import marker, as a tag (libSQL has no `origin` column): `origin:import:<name>`. */
export declare const IMPORT_TAG_PREFIX = "origin:import:";
export interface ListMemoriesResult {
    results: MemoryRow[];
    returned: number;
    total: number;
}
/** Paged list of memory rows in a deterministic order, each carrying its tags (the import marker). */
export declare function listMemories(client: Client, opts: {
    limit: number;
    offset: number;
}): Promise<ListMemoriesResult>;
/**
 * Update a memory's content (the folded `description\n\nbody`) + its `scope:` tag, re-embedding via
 * `embed`. Preserves every OTHER tag (incl. the `origin:import:` marker) + derived_from/counters by
 * loading the row and reusing the file-first `insertMemory` upsert. Throws if the id is absent.
 */
export declare function updateMemory(client: Client, embed: (text: string) => Promise<number[] | null>, opts: {
    id: string;
    content: string;
    scope?: string;
}): Promise<void>;
//# sourceMappingURL=store.d.ts.map