/** Marker pair wrapping every managed region (PRD AC-5, GitNexus precedent). */ export declare const START_MARKER = ""; export declare const END_MARKER = ""; export interface LineInsertOptions { filePath: string; line: string; /** Line convention locating the existing rules list (e.g. /^@rules\//). */ convention?: RegExp; } /** * Line insert (claude `@rules/`, gemini `@` import in GEMINI.md): * marker-wrapped single line appended under the existing rules list when * the convention matches (matches INSIDE marker-owned spans are skipped — * ours and foreign tools' `` pairs), else at file end. Bytes outside the wrapped line * are preserved verbatim; re-running is a zero diff. The managed region * follows the FILE's own line ending (#131) — a CRLF file gets CRLF glue, * and idempotency recognizes regions written with either glue form. A * pre-existing UNWRAPPED pointer line is user-owned content — registration * is a no-op (never rewritten into the wrapped form). */ export declare function lineInsert(options: LineInsertOptions): Promise; export interface MarkerBlockInsertOptions { filePath: string; content: string; version: string; } /** * Marker block (codex AGENTS.md augment, qwen QWEN.md create-or-augment): * `` … rule text … * ``. Same-version re-run is a zero diff; a version * bump rewrites the region in place and bytes outside stay identical. A * foreign marker pair (inner content not ours) is user content — the * append paths leave it byte-untouched. */ export declare function markerBlockInsert(options: MarkerBlockInsertOptions): Promise; export interface JsonArrayInsertOptions { filePath: string; /** Absolute pointer path appended to the target's JSON array (opencode instructions). */ element: string; } /** * JSON array insert (opencode `instructions`, DESIGN D2): locate the array, * skip if the element is already present (idempotent), surgically insert * `,\n ""` before the closing `]` as TEXT (preserves all other * formatting); empty array inserts without the leading comma; absent key * inserts a new top-level `"instructions": [""]`; then JSON.parse * validates — failure restores the original bytes and rejects (init-time * registration exits non-zero; refresh contexts catch and degrade). */ export declare function jsonArrayInsert(options: JsonArrayInsertOptions): Promise; export declare function backupPathFor(filePath: string): string; /** * Remove OUR managed region(s) from a file, preserving every other byte — * including marker pairs whose inner content is not ours (a user-authored * ` … ` block is foreign * user content; DESIGN D2 strips inserted regions by OUR markers AND our * content, never by markers alone). Deletes the file outright only when it * is byte-empty after the strip (the registration itself created it); a * whitespace-only survivor is user-owned bytes and is written back * verbatim (#123). No-op on ENOENT. * Used by line AND block pointers — both wrap their bytes in the same * marker pair. */ export declare function stripManagedRegion(filePath: string, expectedContent: string): Promise; /** * Remove `element` from the `instructions` array of a JSON file by exact * string match (D2 symmetry with `jsonArrayInsert`). No-op on ENOENT or * when the element is absent. String-aware scan keyed to the TOP-LEVEL * `instructions` key (shared walker with insert) so a `]` inside a string * cannot confuse it. Re-validates JSON before * writing; a parse failure after removal leaves the file untouched. */ export declare function jsonArrayRemove(options: { filePath: string; element: string; }): Promise; //# sourceMappingURL=engines.d.ts.map