import { type ClientTarget, type ServerKeyProbe } from '../mcp-setup.js'; import { type IntegrationEntry } from './schema.js'; export type InstalledState = 'installed' | 'not installed' | 'unknown'; export interface InstalledRow { slug: string; kind: string; state: InstalledState; /** Human-readable evidence: version found, or which client it is wired into. */ detail: string; } /** Injectable so tests spawn no npm and touch no real config files. */ export interface DetectDeps { /** Resolves `null` when the probe could not run — NOT an empty map. */ listGlobalNpm?: () => Promise | null>; /** Defaults to the same client targets `dkg mcp setup` registers into. */ clients?: ClientTarget[]; /** * Defaults to probing each client's registered server keys. Returns a * probe result, not a bare list, so "could not read this config" stays * distinguishable from "read it, nothing registered". */ readServerKeys?: (target: ClientTarget) => ServerKeyProbe; } /** * Split out from the spawn so the failure-vs-empty distinction is testable * without mocking a child process. This is where the false negative would come * back if someone "simplified" a `null` return to `{}`, so it is covered * directly rather than only through an injected fake. * * `null` = we have no answer. `{}` = npm answered, nothing is installed. * A machine with no global packages still emits valid JSON (`{"dependencies":{}}`), * so empty stdout genuinely means the probe failed rather than came back empty. */ export declare function parseGlobalNpmList(stdout: string): Record | null; /** * Which of `entries` are present locally. Never claims 'not installed' for a * kind the CLI cannot detect — that is reported as 'unknown'. */ export declare function detectInstalled(entries: IntegrationEntry[], deps?: DetectDeps): Promise; //# sourceMappingURL=detect-installed.d.ts.map