/** * YAML config-merge helper for Hermes (SMI-5456 Wave 1 Step 5). * * Hermes is the one target harness whose MCP config is YAML * (`~/.hermes/config.yaml`, key `mcp_servers:` — spike report §(b), * well-verified against three independent official doc pages). The repo * already carries a real `yaml` dependency (`packages/core/package.json` / * root `package.json`, `"yaml": "^2.8.3"` — also already used by * `packages/core/src/services/agent-pack/agent-pack.test.ts`), so this uses * the library's structured Document API (`parseDocument`/`Document#setIn`) * rather than the textual delimited-block scheme the task brief allowed as a * fallback for "no YAML dep" — that fallback does not apply here since the * dependency exists. * * GOVERNANCE FIX (SMI-5456 code review, 2026-07-01): this module originally * used the library's plain `parse`/`stringify` functions. Those DISCARD * every comment in the source file on round-trip (verified: `# top comment` * + `# a server` + a trailing inline `# inline comment` all vanish after a * `parse` → mutate → `stringify` cycle) — a straightforward * preserve-user-content violation for anyone who annotates their own * `~/.hermes/config.yaml`. `yaml`'s `Document`/`parseDocument`/`setIn` API * operates on the CST and round-trips comments, anchors, and key ordering * untouched, only rewriting the one path this module actually sets — see the * in-container verification in the SMI-5456 code review report. One * documented gap remains: a source file whose root is YAML-null (`~`/`null`, * or a fully empty document) with a comment attached to that null node loses * that specific comment when the null root is replaced with a fresh mapping * (there is no collection node for `setIn` to attach into) — an edge case for * a config file that carries no actual config, accepted rather than adding a * bespoke CST-splicing path for it. * * @module @skillsmith/core/install/agent-config-merge.yaml */ import { type MergeOptions, type MergeResult } from './agent-config-merge.types.js'; /** * Merge a `skillsmith` entry into `mcp_servers:` of a YAML config file. * Same created/updated/unchanged/conflict/error contract as * {@link import('./agent-config-merge.json.js').mergeJsonMcpEntry}. Uses the * `yaml` package's `Document` (CST-backed) API so every comment, anchor, and * unrelated key in the user's file survives the merge byte-for-byte except * for the one path this function actually sets — see module header. */ export declare function mergeYamlMcpEntry(opts: MergeOptions & { mcpServersKey: string; }): MergeResult; //# sourceMappingURL=agent-config-merge.yaml.d.ts.map