@nhtio/adk/batteries/context/exceptions
Shared exception for the context-management batteries — the one failure class thrift and compact have in common.
Remarks
Both thrift (subtractToFit) and compact (summariseTurns, assembleCompactedTurns) require a caller-injected resolver (estimateTokens, and for compact also summarize) because neither battery bundles a tokenizer or a model transport of its own — see each battery's contracts.ts for the "surface, don't impose" rationale. A missing resolver is the SAME failure shape in both batteries (a required injected function wasn't supplied), so it is minted ONCE here rather than duplicated per-battery. This module lives at the context domain level (a sibling of thrift/ and compact/, not inside either) specifically so both can import it without either depending on the other, and re-exports from ../index.ts so a consumer of either battery's public barrel sees it without a deep import. Minted via createException from @nhtio/adk/factories, matching every other battery's exception convention.
Variables
| Variable | Description |
|---|---|
| E_CONTEXT_RESOLVER_MISSING | Thrown when a context-management battery function is called without a REQUIRED injected resolver (estimateTokens, or — for Compact's summarize seam — the model-call function). |