import type { McpPhysicalConfig } from './mcp-physical-config.js'; import { type DesiredRegistration } from './mcp-config-document.js'; export type { DesiredRegistration, PersistedRegistration, RegistrationEdit } from './mcp-config-document.js'; export interface McpRegistration { command?: string; args?: string[]; dkgHome?: string; } export type RegistrationRead = { kind: 'absent'; } | { kind: 'invalid'; } | { kind: 'entry'; registration: McpRegistration; }; export declare function classifyRegistration(current: RegistrationRead, expected: DesiredRegistration): 'registered' | 'stale' | 'not-registered'; /** The launch shape of one registered MCP server, as the client stores it. */ export interface RegisteredMcpServer { command: string; /** * The declared launch arguments. `[]` means the key was absent — a legitimate * args-less server. `null` means the key was PRESENT but is not a string * array, which is not a launch block we can compare. The distinction matters: * quietly dropping a non-string element would rewrite `args: [123]` into `[]` * and let it match an args-less registry entry, manufacturing an install. */ args: string[] | null; /** String-valued env entries only; non-string values are not represented. */ env?: Record; } /** * Outcome of inspecting one client config for registered MCP servers. * `ok: false` is "we could not look", never "we looked and found nothing". * * Carries the blocks rather than only their names. A server registered under a * slug is evidence that THAT integration is installed only if it also launches * what the registry entry says it should — the name alone cannot tell a real * installation apart from an unrelated server that happens to share it. */ export type ServerKeyProbe = { ok: true; servers: Record; } | { ok: false; reason: string; }; /** * Names of every MCP server registered in a client's config, whatever container * that client uses (`mcpServers`, `servers`, `mcp_servers`) and whatever format * it is written in (JSON, TOML). * * `dkg mcp setup` cares about one fixed leaf (`…dkg`); integration detection * needs the sibling keys instead, because an installed integration registers * itself under its own slug. Exposed here so `dkg integration list` reads the * same client targets and container paths that `dkg mcp setup` writes, rather * than maintaining a second, narrower list that silently misses clients. * * Absence of evidence is not evidence of absence, so the two are returned as * different values rather than both as []. `ok: false` means we could not look * — the file is present but unreadable, unparseable, or malformed at the * container we needed. A caller that reports install state must not render * that as "not installed": it would tell a user an integration is missing when * the truth is that their config could not be read. */ export declare function readRegisteredServerKeys(target: McpPhysicalConfig): ServerKeyProbe; /** Inspect only: stale/null entries still count as an owned registration. */ export declare function inspectRegistration(target: McpPhysicalConfig): boolean; /** Remove only the owned leaf from one source snapshot. */ export declare function removeRegistration(target: McpPhysicalConfig): boolean; export declare function writeRegistration(target: McpPhysicalConfig, entry: DesiredRegistration): void; /** Read the owned entry for setup classification; no mutation. */ export declare function readRegistration(target: McpPhysicalConfig): RegistrationRead; //# sourceMappingURL=mcp-client-config.d.ts.map