Skip to main content

Module context_bundle

Module context_bundle 

Source
Expand description

Budgeted context bundles for chat products (#1885).

lean-ctx pack --limit 128k produces one self-contained XML document that fits a chat input box: the files most relevant to the task in full, the next tier as signatures, and everything else only in the directory tree. The limit is a hard cap on the emitted document, measured in characters (what chat UIs count) or o200k_base tokens.

Modules§

export
Where a bundle may be written as a file.

Structs§

Bundle
A rendered bundle plus everything needed to explain it.
BundleOptions
What to bundle and how big it may get.
PlannedFile
A ranked file and its placement.
Withheld
A file that was never a candidate for inclusion.

Enums§

IntentSource
Where the task description came from.
Placement
Where a ranked file ended up.
Unit
What a bundle limit counts.

Constants§

DEFAULT_KNOWLEDGE_CATEGORIES
DEFAULT_KNOWLEDGE_LIMIT
DEFAULT_LIMIT

Functions§

build
Build a bundle. Errors are user-facing (bad path, bad glob).
parse_limit
Parse a limit such as 128000, 128k, 2M or 1.5m.