Expand description
Marker-delimited managed block: string surgery over a host file.
The canon owns exactly one region of a consumer’s .pre-commit-config.yaml
— the lines between its BEGIN and END markers — and everything here is a
pure function over the host text: validate the markers, strip the region,
splice a new one into the repos: sequence, and hash what is present.
Every line outside the markers passes through byte-identical. What the
block contains is the hook renderer’s business, and reading or writing
the file is the installer’s.
Enums§
- Marker
Error - A host file whose markers cannot be trusted, or that cannot host a block.
Constants§
- AGENTS_
BEGIN - The line that opens the managed documentation region in
AGENTS.md. - AGENTS_
END - The line that closes the managed documentation region in
AGENTS.md. - BEGIN
- The line that opens the managed pre-commit region.
- END
- The line that closes the managed pre-commit region.
Functions§
- block_
hash - The hash the manifest records for a host file’s managed pre-commit region.
- block_
hash_ with - The hash the manifest records for a host file’s region under a marker pair.
- block_
region - The managed region — BEGIN through END inclusive — as present in a host
text, or
Nonewhen no complete region exists. - block_
region_ with - The marked region — begin through end inclusive — for the given marker
pair, or
Nonewhen no complete region exists. - place_
agents_ block - Place an
AGENTS.mdblock into a host, preserving every outside byte. - splice
- Splice a rendered block (BEGIN through END, newline-terminated) into the
repos:sequence of a marker-free base, returning the new host text and the indentation the block’s entries should have used. - splice_
indent - The indentation a spliced block’s sequence items should carry, measured from the base the block will join.
- split_
block - Split a host text into its lines outside the managed region and the region itself, validating the markers first.
- split_
block_ with - Split a host text into its lines outside a marked region and the region.