export declare const IMPLEMENTED_CLIENTS: readonly ["claude", "claude-code", "cursor"]; export declare const MANUAL_CLIENTS: readonly ["windsurf", "vscode"]; export type ImplementedClient = (typeof IMPLEMENTED_CLIENTS)[number]; export type ManualClient = (typeof MANUAL_CLIENTS)[number]; export declare function isImplementedClient(client: string): client is ImplementedClient; export declare function isManualClient(client: string): client is ManualClient; export interface McpEntry { type: 'http'; url: string; headers: { Authorization: string; }; } export declare function buildMcpEntry(url: string, token: string): McpEntry; /** Resolve the base `http://host:port/mcp` this daemon serves on, the same * way `serve`/`doctor`/`reinstall` resolve port/host — an explicit `--url` * wins outright (treated as the daemon's base URL; `/mcp` is appended). */ export declare function resolveMcpUrl(urlOverride?: string): string; /** SEC-10 precedence (CLI > env > OS credential store > secrets.env > * default) — the same resolver `serve` uses, so the token this command * writes is the one the running daemon actually accepts. */ export declare function resolveMcpToken(): string; /** Claude Desktop's config path per-OS. `homeDir`/`env`/`plat` are * injectable so tests never touch the real OS paths. Linux Claude Desktop * is unofficial/community-packaged; this mirrors the XDG-style path those * builds commonly use. */ export declare function claudeDesktopConfigPath(env?: NodeJS.ProcessEnv, plat?: NodeJS.Platform, homeDir?: string): string; export interface ClientTarget { path: string; serversKey: 'mcpServers'; entryKey: string; } export interface ResolveClientTargetOpts { cwd?: string; homeDir?: string; env?: NodeJS.ProcessEnv; plat?: NodeJS.Platform; } /** Where each implemented client's config lives, and the key(s) inside it we * own. `opts` overrides are injection points for tests — production callers * omit them and get the real cwd/homedir/env/platform. */ export declare function resolveClientTarget(client: ImplementedClient, opts?: ResolveClientTargetOpts): ClientTarget; /** * Pure merge: parses `existingText` (if any), upserts `entry` at * `parsed[serversKey][entryKey]`, and returns the pretty-printed result plus * whether the entry actually changed (idempotency signal — the CLI reports * "already up to date" when a second run is a no-op). Throws on invalid * existing JSON; the caller must surface that rather than silently * overwriting a file it couldn't parse. */ export declare function mergeServersJson(existingText: string | null, serversKey: string, entryKey: string, entry: Record): { text: string; changed: boolean; }; export interface RunMcpInstallOpts { client: string; urlOverride?: string; dryRun?: boolean; /** Injection points so tests exercise the real file-merge/backup logic * against a fixture directory instead of the real OS paths / credential * store. Production (mcpInstallCommand) omits all of these. */ targetOpts?: ResolveClientTargetOpts; resolveUrl?: (urlOverride?: string) => string; resolveToken?: () => string; } export interface RunMcpInstallResult { ok: boolean; manual: boolean; path?: string; wrote: boolean; changed: boolean; } /** * Core logic shared by the CLI entry point and tests. Returns a result * object (rather than relying solely on console output + exit codes) so * tests can assert outcomes directly. */ export declare function runMcpInstall(opts: RunMcpInstallOpts): RunMcpInstallResult; export declare function mcpInstallCommand(args: string[]): Promise;