import Database from "better-sqlite3"; export type Scope = "workspace" | "global" | "project"; export interface Config { scope: Scope; dbPath: string; workspaceRoot: string; } export interface ProjectIdentity { /** Numeric FK into the projects table. */ projectId: number; /** Opaque slug persisted in .cogmemory/config.json. */ slug: string; /** Display label (defaults to folder basename; never used for identity). */ label: string; /** True when a new project row was created during this boot. */ isNewProject: boolean; } /** * Resolve the CogMemory configuration following priority order: * 1. `.cogmemory/config.json` in workspace root → `"scope": "workspace" | "global" | "project"` * 2. Environment variable `COGMEMORY_SCOPE` * 3. User-level `~/.cogmemory/config.json` (scope/settings fallback) * 4. Default: `project` (one database per clone under ~/.cogmemory/projects/) */ export declare function resolveConfig(workspaceRoot: string, dataDir?: string): Config; /** * Try to resolve and validate a path. Returns it if it exists, null otherwise. */ export declare function validateWorkspaceRoot(path: string): string; export type ResolutionSource = "override" | "git-root" | "dotcogmemory" | "cwd-fallback" | "runtime-switch"; export interface WorkspaceResolution { root: string; source: ResolutionSource; } /** * Determine the workspace root using the following priority: * 1. `--workspace ` CLI argument (explicit override) * 2. `COGMEMORY_WORKSPACE` environment variable (explicit override) * 3. Walk up from CWD looking for a `.git/` entry (git-root discovery, ADR-7) * 4. Walk up from CWD looking for a `.cogmemory/` directory * 5. Fall back to CWD */ export declare function resolveWorkspaceRoot(argv: string[]): WorkspaceResolution; export declare function readProjectBinding(workspaceRoot: string): string; /** Keep the persisted UUID authoritative; serialize bootstrap across MCP processes. */ export declare function resolveProjectIdentity(workspaceRoot: string, db: Database.Database, scope: Scope): ProjectIdentity; //# sourceMappingURL=config.d.ts.map