A rate-limit-aware wrapper around gh: it classifies each call into a budget
bucket, gates it before spending, and records an audit trail.
GitHub's API has several distinct rate limits (core, search, GraphQL, …). This package classifies a call into its bucket, checks the remaining budget before making it, and logs what was spent and why — so a long-running agent doesn't blow a limit mid-task.
npm install @bounded-systems/github-budget @bounded-systems/audit-context @bounded-systems/env @bounded-systems/proc zodzod is a peer dependency (^3.25 || ^4).
// Classify, gate, and audit a gh call before it spends from its bucket.
// The pre-call gate consults the remaining budget for the call's bucket;
// the audit trail records the spend with attribution from audit-context.- Gate before spend. Bucket classification + a pre-call check keep usage inside the limit rather than discovering the limit by hitting it.
- Attributed audit. Spends are recorded with the verb/actor attribution from
@bounded-systems/audit-context. An extractability test enforces thataudit-context,env, andprocare the only repo dependencies.
MIT © Bounded Systems