/** * JSON config-merge helper for `sklx agent install` (SMI-5456 Wave 1 Step 5). * * Targets the `mcpServers`/`mcp`-shaped config files four of the seven * harnesses use (claude-code, cursor, copilot, windsurf; also opencode's * best-effort `mcp` key — see `agent-harness-targets.ts`). Backup-first, * idempotent, preserve-and-prompt semantics per the plan's P-5 "Harness MCP * config files" invariant: "Installer merges keys it owns, never whole-file * writes; detects foreign `skillsmith` entries and prompts." * * Survey of existing config-write patterns (plan-mandated, "convention check * before novelty"): `grep -rn "mcp.json\|mcp_config\|claude.json" * packages/cli/src/ packages/core/src/` turned up * `mcp-server.template.snippets.ts` (SMI-4580, docs-only — renders snippet * TEXT for a human to paste, never writes a file) and * `skill-installation.policy.ts` (classifies `.mcp.json` as a scan target, * never writes one). Neither is a merge-writer to follow structurally, so * this module's shape instead mirrors the nearest write-path precedent in * the codebase: `config/index.ts`'s `saveConfig()` (mkdir 0700 + writeFile * 0600, read-merge-write, JSON.stringify(..., null, 2)). * * @module @skillsmith/core/install/agent-config-merge.json */ import { type MergeOptions, type MergeResult } from './agent-config-merge.types.js'; /** * Merge a Skillsmith MCP server entry into a JSON config file at * `opts.path`, under `opts.keyPath` (e.g. `['mcpServers']`). * * Never performs a whole-file write of unrelated keys — the file is parsed, * exactly one nested key (`opts.entryKey`, defaulting to `'skillsmith'` — * see `MergeOptions.entryKey`) is set at `[...keyPath, entryKey]`, and the * WHOLE document (all other keys untouched) is re-serialized. A missing * file is treated as `{}` (created fresh). */ export declare function mergeJsonMcpEntry(opts: MergeOptions & { keyPath: readonly string[]; }): MergeResult; //# sourceMappingURL=agent-config-merge.json.d.ts.map