import type { MemoryScopeKind } from "./types.js"; export interface TokenBudgets { catalogTokens: number; recallTokens: number; perProviderTokens: number; } export interface PlannerConfig { minimumConfidence: number; maxTopics: number; } export interface SemanticPlannerConfig { enabled: boolean; minimumSimilarity: number; deterministicHighConfidence: number; } export interface CaptureConfig { enabled: boolean; /** Promote screened explicit user statements immediately instead of creating review candidates. */ autoPromote: boolean; queueLimit: number; maxInputCharacters: number; maxCandidateCharacters: number; timeoutMs: number; } /** * The runtime plugin-options embedding shape (`{backend, modelPath}`), * distinct from `EmbeddingAppConfig` (`storage/config-file.ts`), the * persisted app-config shape (`{provider, model, dimensions}`) `remem init` * writes to disk. Confusing the two was the direct root cause of a real * bug (the OpenCode plugin only recognized this shape's `backend` field, * silently ignoring `remem init`'s neural default written in the other * shape) -- kept intentionally distinctly named so that mistake is harder * to make again. */ export interface EmbeddingPluginOptions { backend: "hash" | "neural"; modelPath?: string; } export interface MarkdownProviderConfig { type: "markdown"; id: string; paths: string[]; exclude: string[]; scope: MemoryScopeKind; maxFileBytes: number; maxFiles: number; } export interface PostgresProviderConfig { type: "postgres"; id: string; connectionString: string; primary: boolean; maxConnections: number; catalogLimit: number; } export type MemoryProviderConfig = MarkdownProviderConfig | PostgresProviderConfig; export interface OrchestratorConfig { budgets: TokenBudgets; planner: PlannerConfig; semantic?: SemanticPlannerConfig; providerTimeoutMs: number; maxResults: number; debug: boolean; } export interface RememConfig extends OrchestratorConfig { providers: MemoryProviderConfig[]; compaction: boolean; capture: CaptureConfig; embedding: EmbeddingPluginOptions; /** Minimum time between hook-triggered opportunistic re-embed attempts (see `shouldAttemptReembed`). */ reembedCooldownMs: number; } export interface ConfigDiagnostic { level: "warn" | "error"; message: string; } export interface ParsedConfig { config: RememConfig; diagnostics: ConfigDiagnostic[]; } export declare function parseConfig(options: unknown): ParsedConfig;