/** * Marker-delimited TOML block merge for Codex (SMI-5456 Wave 1 Step 5). * * Codex's config lives entirely in `~/.codex/config.toml` — MCP server * registration (`[mcp_servers.skillsmith]`), the named-agent shim * (`[agents.skillsmith-agent]`, already rendered as TOML text by * `renderCodexToml` in the — locked for this step — agent-pack generator), * and hook wiring all share this one file. The repo has no confirmed real * TOML dependency (`smol-toml` appears only under root `overrides`, pinning * a transitive tool dependency, not a direct `dependencies`/`devDependencies` * entry of `@skillsmith/core` or `@skillsmith/cli`) — adding one is a * lockfile-risk change out of scope for this step. Per the task brief's * explicit fallback for "no [format] dep": generate the block textually with * a clearly-delimited managed section, exactly mirroring how * `renderCodexToml` (shims.ts, locked) already emits raw TOML text via * `JSON.stringify`-quoted strings rather than a library. This keeps every * OTHER line of the user's `config.toml` — their own tables, comments, * formatting — completely untouched; only the text between our markers is * ever rewritten. * * Ownership model: text between `# >>> skillsmith: >>>` and * `# <<< skillsmith: <<<` is unambiguously ours (idempotent * update-in-place). A bare occurrence of the target table header OUTSIDE any * marker block (`foreignHeaderPattern`) is a hand-written foreign entry — * `force` does NOT override this case: appending a second `[table]` header * with the same name risks producing invalid/ambiguous TOML without a real * parser to detect and merge it, so this always returns `'conflict'` for a * genuinely foreign, non-delimited entry regardless of `force`. * * @module @skillsmith/core/install/agent-config-merge.toml-block */ import { type MergeResult } from './agent-config-merge.types.js'; export interface TomlBlockMergeOptions { path: string; /** Stable id for the marker comment, e.g. `'mcp_servers.skillsmith'`. */ markerId: string; /** Raw TOML text to install between the markers (no marker lines, no leading/trailing blank lines required). */ blockContent: string; /** Matches a bare (non-delimited) occurrence of the same table header, e.g. `/^\[mcp_servers\.skillsmith\]/m`. */ foreignHeaderPattern: RegExp; backupDir: string; force?: boolean; /** See `MergeOptions.alreadyBackedUpPaths` — Codex merges TWO blocks (MCP + agents shim) into the same `config.toml` per install run. */ alreadyBackedUpPaths?: Set; } /** Merge a marker-delimited TOML block into `opts.path`. See module header for the full ownership contract. */ export declare function mergeTomlBlock(opts: TomlBlockMergeOptions): MergeResult; //# sourceMappingURL=agent-config-merge.toml-block.d.ts.map