Documentation
¶
Overview ¶
Package contextpack defines the user-editable markers and helpers for the repository context pack. The generated pack is Markdown; the block between the BEGIN/END markers is owned by the user and is preserved across regenerations.
Index ¶
Constants ¶
const ( // BeginMarker and EndMarker delimit the user-editable section. BeginMarker = "<!-- USER-CONTEXT:BEGIN -->" EndMarker = "<!-- USER-CONTEXT:END -->" // UserHeading is the heading displayed above the user-editable section. UserHeading = "## 7. Additional Context — user-editable" // DefaultUserBlock is inserted when a pack has no user section yet. DefaultUserBlock = BeginMarker + "\n" + "<!-- Add free-form text, design notes, constraints, URLs, examples, etc.\n" + " This block is preserved when the context pack is regenerated. -->\n" + EndMarker )
Variables ¶
This section is empty.
Functions ¶
func EnsureUserBlock ¶
EnsureUserBlock appends the user-editable section when doc does not contain the markers. Existing blocks are left untouched apart from adding the section heading when the model omitted it.
func ExtractUserBlock ¶
ExtractUserBlock returns the full user block (including markers) and true when both markers are present. The returned text is verbatim.
func ReplaceUserBlock ¶
ReplaceUserBlock replaces the existing user block with block. When the document has no user block, the block is appended under UserHeading. The bool reports whether an existing block was replaced.
func StripOuterCodeFence ¶
StripOuterCodeFence removes a Markdown fence that wraps the entire document. Models sometimes return the whole pack inside ```markdown ... ``` even when asked not to. Inner fences are left intact.
Types ¶
This section is empty.