/** * Memory Bridge — the lazy per-path backend cache, the process-wide local * models (embedder + cross-encoder reranker) and their kill switch, and * bridge lifecycle. Owns all of that module-level state; other bridge * modules only read it. Split out of memory-bridge.ts, which re-exports the * public symbols. */ export declare let _embedder: ((text: string) => Promise) | null; /** Disable local model loads for THIS process only (see `org run`/`org serve`). */ export declare function disableLocalModels(): void; export declare function localEmbeddingsDisabled(): boolean; export declare function rerankerDisabled(): boolean; export declare const BRIDGE_RERANKER_MODEL = "cross-encoder/ettin-reranker-32m-v1"; /** Where reranker export / head files live. */ export declare function rerankerModelsDir(): string; export declare function rerankerKind(): 'export' | 'head' | null; export declare let _reranker: ((query: string, passage: string) => Promise) | null; export declare let _rerankerPromise: Promise | null; /** Pre-load the cross-encoder reranker model. Idempotent, no-op when * MONOMIND_RERANKER=0. Exported so the eval harness can force-load before * the network guard blocks model downloads. */ export declare function loadReranker(): Promise; /** Rerank an array of results using the cross-encoder. Mutates nothing; returns * a new sorted array with reranker scores in provenance. */ export declare function rerankResults(query: string, results: any[], limit: number): Promise<{ reranked: any[]; applied: boolean; }>; /** Flush after mutations: the sql.js fallback backend is in-memory WASM and * only reaches disk via persist(); the CLI process is short-lived, so waiting * for an auto-persist interval would lose writes. No-op on better-sqlite3. */ export declare function flushBackend(backend: any): Promise; /** Fetches the local embedding model into the transformers cache so later * loadEmbedder() calls (local_files_only) find it. Same model, revision and * dtype as loadEmbedder() — only the network is allowed here, which is why it * is reserved for explicit opt-in steps (`init --with-embeddings`). Throws * when the model cannot be fetched (offline, disabled, package missing); * callers degrade. Loads onnxruntime, so ADR-R001 applies to the caller. */ export declare function downloadEmbeddingModel(): Promise; /** * Open the native SQLite backend, falling back to sql.js only when better-sqlite3 * itself cannot be loaded. Any other failure (locked, corrupt, unwritable database) * is about the database, not the engine: sql.js would open a stale in-memory copy of * the same file and later overwrite it, so the error is surfaced instead. */ export declare function openBackendWithFallback(mod: any, cfg: object): Promise; export declare function getBackend(dbPath?: string): Promise; export declare function isBridgeAvailable(dbPath?: string): Promise; export declare function shutdownBridge(): Promise; //# sourceMappingURL=memory-bridge-backend.d.ts.map