import type { CaptureConfig, MemoryProviderConfig, PlannerConfig, TokenBudgets } from "../config.js"; import { EMBEDDING_DIMENSIONS, LOCAL_HASH_MODEL_ID, NEURAL_MODEL_ID } from "./embedding-model-ids.js"; import { type RememPaths } from "./paths.js"; export interface ManagedStorageConfig { mode: "managed"; connectionString: string; composeFile: string; environmentFile: string; projectName: string; database: string; user: string; port: number; } export interface ExternalStorageConfig { mode: "external"; connectionString: string; } /** * The persisted app-config embedding shape (`{provider, model, dimensions}`) * `remem init` writes to disk, distinct from `EmbeddingPluginOptions` * (`../config.js`), the runtime plugin-options shape (`{backend, * modelPath}`). See that type's doc comment for why these are deliberately * named differently rather than sharing a name. */ export type EmbeddingAppConfig = { provider: "local-hash"; model: typeof LOCAL_HASH_MODEL_ID; dimensions: typeof EMBEDDING_DIMENSIONS; } | { provider: "neural"; model: typeof NEURAL_MODEL_ID; dimensions: typeof EMBEDDING_DIMENSIONS; }; export interface RememAppConfig { version: 1; storage: ManagedStorageConfig | ExternalStorageConfig; providers: MemoryProviderConfig[]; budgets?: Partial; planner?: Partial & { semantic?: boolean; semanticMinimumSimilarity?: number; deterministicHighConfidence?: number; }; providerTimeoutMs?: number; maxResults?: number; debug?: boolean; compaction?: boolean; capture?: Partial; embedding: EmbeddingAppConfig; opencode?: { configured: boolean; /** OpenCode plugin API selected during `remem init`. */ hostVersion?: "v1" | "v2"; configPath?: string; }; pi?: { configured: boolean; settingsPath?: string; }; } export declare function validateAppConfig(value: unknown): asserts value is RememAppConfig; export declare function readAppConfig(paths?: RememPaths): Promise; export declare function writeAppConfig(config: RememAppConfig, paths?: RememPaths): Promise; export declare function loadInstalledPluginOptions(options: unknown): Promise;