/**
 * MCP config scanning and installation for Neotoma CLI.
 * Scans cwd and subdirectories for MCP config files (Cursor, Claude Code, Windsurf, etc.),
 * detects dev/prod server configurations, and offers to install missing servers.
 */
type McpConfig = {
    mcpServers?: Record<string, {
        command?: string;
        args?: string[];
        url?: string;
        [key: string]: unknown;
    }>;
};
/**
 * Parse MCP config file and return mcpServers object if valid, else null.
 */
export declare function parseMcpConfig(filePath: string): Promise<McpConfig | null>;
/** Optional session ports from CLI; supports default dev/prod and selected active instance. */
export type SessionPorts = {
    devPort?: number;
    prodPort?: number;
    activePort?: number;
    activeEnv?: "dev" | "prod";
};
/**
 * Detect whether a given mcpServers object has dev and prod Neotoma servers configured.
 * When sessionPorts are provided, URL-based entries must use those ports; command-based (stdio) entries always count.
 */
export declare function detectNeotomaServers(mcpServers: Record<string, unknown> | undefined, sessionPorts?: SessionPorts): {
    hasDev: boolean;
    hasProd: boolean;
};
/**
 * Analyze MCP config for misconfigurations.
 * For local Neotoma usage, HTTP MCP URLs are the default.
 */
export declare function analyzeMcpConfigIssues(mcpServers: Record<string, unknown> | undefined, options: {
    sessionPorts?: SessionPorts;
    isLocalRepo?: boolean;
}): McpConfigIssue[];
/**
 * Generate neotoma-dev and neotoma (prod) stdio MCP server entries.
 * This lets MCP clients launch Neotoma directly without requiring a separate API server.
 */
type McpServerEntry = {
    url: string;
} | {
    command: string;
    args?: string[];
    env?: Record<string, string>;
};
export type McpTransportChoice = "a" | "b" | "c" | "d";
export declare function neotomaServerEntries(repoRoot: string, _sessionPorts?: SessionPorts): {
    "neotoma-dev": McpServerEntry;
    neotoma: McpServerEntry;
};
export declare function parseMcpTransportChoice(answer: string | undefined): McpTransportChoice;
export declare function neotomaServerEntriesForTransport(repoRoot: string, sessionPorts?: SessionPorts, transport?: McpTransportChoice): {
    "neotoma-dev": McpServerEntry;
    neotoma: McpServerEntry;
};
/**
 * Detect whether AAuth keys exist at the standard CLI location
 * (`~/.neotoma/aauth/private.jwk`). When present, the proxy path
 * should be offered as the recommended MCP entry.
 */
export declare function hasAAuthKeys(): boolean;
export declare function ensureAAuthKeysForSignedTransport(transport: McpTransportChoice, silent: boolean): Promise<void>;
/**
 * Build MCP server entries that use the identity proxy instead of direct stdio.
 * The proxy bridges stdio to HTTP with clientInfo injection and optional AAuth signing.
 */
export declare function neotomaProxyServerEntries(repoRoot: string, options?: {
    aauth?: boolean;
    downstreamUrl?: string;
}): {
    "neotoma-dev": McpServerEntry;
    neotoma: McpServerEntry;
};
/**
 * Walk up from startDir to find project root (directory with .git, package.json, or .cursor).
 *
 * Fix #168: Only anchor on .git when walking up. If startDir already has any
 * project marker (.git, package.json, .cursor) return it immediately so we
 * never escape to a parent workspace directory that happens to have .cursor.
 */
export declare function getProjectRoot(startDir: string): Promise<string>;
/**
 * Find all MCP config paths starting from a root directory.
 * When userLevelFirst is true, checks user-level paths first; if any exist, returns only those (skips project-based).
 * Otherwise walks up to find project root, scans project-local paths, and optionally adds user-level paths.
 */
export declare function findMcpConfigPaths(startDir: string, options?: {
    includeUserLevel?: boolean;
    userLevelFirst?: boolean;
    maxDepth?: number;
}): Promise<string[]>;
/** Issue detected in MCP config (misconfiguration or suboptimal setup). */
export type McpConfigIssue = {
    type: "http_locally";
    serverId: string;
    description: string;
} | {
    type: "port_mismatch";
    serverId: string;
    expectedPort: number;
    actualPort: number;
    description: string;
} | {
    type: "invalid_claude_server_id";
    serverId: string;
    description: string;
};
export type ConfigStatus = {
    path: string;
    hasDev: boolean;
    hasProd: boolean;
    /** Issues that suggest fixing (e.g. HTTP locally when stdio recommended, port mismatch). */
    issues?: McpConfigIssue[];
};
export type McpHookHarness = "cursor" | "claude-code" | "codex";
/** Infer hook-capable harnesses from MCP config paths that already contain a Neotoma server. */
export declare function inferHookHarnessesFromMcpConfigs(configs: ConfigStatus[]): McpHookHarness[];
/**
 * Scan for MCP configs from cwd and return status for each found config.
 * When userLevelFirst is true, checks user-level config first and skips project-based if any user config exists.
 * When devPort/prodPort are set (e.g. from NEOTOMA_SESSION_*), URL-based entries must use those ports to count as configured.
 * When neotomaRepoRoot is provided, uses it for issue analysis and install; otherwise resolves from cwd.
 */
export declare function scanForMcpConfigs(cwd: string, options?: {
    includeUserLevel?: boolean;
    userLevelFirst?: boolean;
    devPort?: number;
    prodPort?: number;
    activePort?: number;
    activeEnv?: "dev" | "prod";
    neotomaRepoRoot?: string | null;
}): Promise<{
    configs: ConfigStatus[];
    repoRoot: string | null;
}>;
type InstallEnvChoice = "dev" | "prod" | "both" | "skip";
export declare function parseInstallEnvironmentChoice(answer: string): InstallEnvChoice;
/**
 * Offer to fix misconfigured MCP configs (HTTP locally, port mismatch).
 * Returns true if user accepted and changes were applied.
 */
export declare function offerFix(configs: ConfigStatus[], repoRoot: string | null, options?: {
    silent?: boolean;
    devPort?: number;
    prodPort?: number;
    assumeYes?: boolean;
}): Promise<{
    fixed: boolean;
    message: string;
    updatedPaths: string[];
}>;
/**
 * Offer to install missing dev/prod servers into found configs or create new configs.
 * When sessionPorts are provided, new entries get env set and existing URL-based entries are rewritten to use those ports.
 * Also offers to fix misconfigurations (HTTP locally, port mismatch) before or instead of adding missing servers.
 */
/** MCP config status box title (for width alignment). */
export declare const MCP_STATUS_BOX_TITLE = " MCP config status ";
/** Return lines for MCP status box (for computing shared box width). */
export declare function getMcpStatusBoxLines(configs: ConfigStatus[]): string[];
/** Format MCP config status as a box (for display below intro). */
export declare function formatMcpStatusBox(configs: ConfigStatus[], sessionBoxWidth?: number): string;
export declare function offerInstall(configs: ConfigStatus[], repoRoot: string | null, options?: {
    silent?: boolean;
    devPort?: number;
    prodPort?: number;
    cwd?: string;
    /** When true, skip printing the status box (caller already showed it below intro). */
    boxAlreadyShown?: boolean;
    /** When set, only consider and install the server for this env (e.g. on CLI session start). */
    currentEnv?: "dev" | "prod";
    /** Optional init default: skip env prompt and use this env target. */
    autoInstallEnv?: "dev" | "prod" | "both";
    /** Optional init default: skip target prompt and use this scope. */
    autoInstallScope?: "project" | "user" | "both";
    /** Optional install default: skip transport prompt and use this MCP transport mode. */
    mcpTransport?: McpTransportChoice;
    /**
     * When true, apply the selected transport to every JSON MCP config in the chosen install scope,
     * not only configs missing dev or prod. Use to switch presets (A–D) or refresh script paths.
     */
    rewriteExistingNeotoma?: boolean;
    /** Non-interactive default: accept repair prompts instead of waiting on stdin. */
    assumeYes?: boolean;
    /** When true, do not run sync:mcp (avoids writing project-level MCP configs). */
    skipProjectSync?: boolean;
}): Promise<{
    installed: boolean;
    message: string;
    scope?: "project" | "user" | "both";
    updatedPaths?: string[];
}>;
export {};
//# sourceMappingURL=mcp_config_scan.d.ts.map