Skip to main content

Module codebase_pack

Module codebase_pack 

Source
Expand description

codebase-pack adapter (#1097): Repomix pack_codebase โ†’ a lean-ctx archive handle.

Repomix returns a one-shot summary (directoryStructure, totals) plus an outputId the agent later reads via read_repomix_output/ grep_repomix_output. This adapter additionally persists the verbatim pack into the content-addressed archive, so the agent can retrieve any slice through the single lean-ctx path (ctx_expand) โ€” the repomix outputId stays surfaced for grep. lean-ctx becomes the unified retrieval layer.

Deterministic (#498): the archive id is a content hash and the returned summary is a pure function of the pack output.

Functionsยง

transform
If text is a Repomix pack result, archive it verbatim and return a compact summary + a ctx_expand retrieval handle. Returns None for non-pack tools, non-JSON output, or when archiving is unavailable (caller falls back).