/** * Merge primitive for the generated instruction files (CLAUDE.md, * .agents/shared_instructions.md) that mix monomind's own body with * hand-authored project content. */ /** * Confines generated content to a delimited * `` / `` * pair within a file that may otherwise hold hand-authored content, so a * `--force` refresh only ever touches that one block. In order: * * 1. An unmarked body left by a pre-delimiter version is replaced in place * (or, when a delimited block already exists elsewhere in the file, * simply removed — that is the shape GH #276 produced, and it heals back * to a single copy). * 2. A same-marker block in the current form is refreshed in place. * 3. A same-marker block in the older `monomind:start`/`monomind:end` form is * migrated to the current form, in place. * 4. Otherwise the block is appended after whatever content already exists * (verbatim, never modified). * * Every path is idempotent: a second run matches case 2 and rewrites byte-for- * byte identical content. Content outside the block is never touched. * * The delimiter text is deliberately NOT the `monomind:start ` * convention platform-adapters/merge.ts uses for its own instruction blocks: * that text is also matched, none too precisely, by the legacy bare-block * migration regexes in platform-adapters/migration.ts, which would treat a * newly-introduced `# monomind:start ` block as an old-style *bare* * block to migrate and could mangle it into an unrelated `instructions:*` * block. Distinct delimiter text sidesteps that rather than taking on a * dependency on that subsystem. */ export declare function dropLegacyUnmarked(text: string, generated: string): string; /** * Swaps an undelimited generated body for `block`, keeping its position in the * file, or reports that there is none to swap (`null`) so the caller can fall * back to appending. Callers owning a different delimiter form reuse this and * `dropLegacyUnmarked` to get the same conservative detection — see * platform-adapters/merge.ts for the skill writer (GH #286). */ export declare function replaceLegacyUnmarked(text: string, generated: string, block: string): string | null; /** The body of the current-form `marker` block in `text`, or null if absent. */ export declare function readGeneratedBlock(text: string, marker: string): string | null; export declare function mergeGeneratedBlock(existing: string, marker: string, generated: string): string; //# sourceMappingURL=managed-block.d.ts.map