import { homedir } from 'os';
import { join } from 'path';
const DEFAULT_DB_PATH = join(homedir(), '.mcp-guardian', 'history.db');
const MCP_SERVER_DB_PATH = join(homedir(), '.mcp-guardian', 'mcp-server.db');
/** Canonical SQLite path for all Guardian processes (proxy, TUI, scan, audit). */
export function resolveGuardianDbPath(explicit) {
    if (explicit === ':memory:')
        return ':memory:';
    return explicit ?? process.env['MCP_GUARDIAN_DB_PATH'] ?? DEFAULT_DB_PATH;
}
export function getDefaultGuardianDbPath() {
    return DEFAULT_DB_PATH;
}
/**
 * MCP stdio server DB (Cline cannot pass env) — separate file from proxy history to avoid locks.
 */
export function resolveMcpServerDbPath() {
    return process.env['MCP_GUARDIAN_DB_PATH'] ?? MCP_SERVER_DB_PATH;
}
//# sourceMappingURL=guardian-db-path.js.map