@jununfly/zj-loop-cost
v0.1.5
Published
Estimate token budgets and daily costs for agentic loop working patterns. By cadence, readiness level (L1/L2/L3), and coding agent tool.
Maintainers
Readme
zj-loop-cost
Estimate daily token spend for agentic loop working patterns by cadence and readiness level (L1–L3).
Uses cost metadata from patterns/registry.yaml. When run with a project root,
the project-local registry is preferred over the packaged default.
Install & Run
npx @jununfly/zj-loop-cost . --pattern ci-sweeper --cadence 15m --level L2
npx @jununfly/zj-loop-cost . --pattern daily-triage --level L1 --json
npx @jununfly/zj-loop-cost --registry patterns/registry.yaml --pattern daily-triage
npx @jununfly/zj-loop-cost --package-registry --pattern daily-triage
npx @jununfly/zj-loop-cost --listIf npx stalls on package resolution, use an installed binary or npm's local cache:
zj-loop-cost . --pattern daily-triage --level L1
npm exec --offline --package=@jununfly/zj-loop-cost -- zj-loop-cost . --pattern daily-triage --level L1From this repo:
cd tools/zj-loop-cost
npm install
npm testOptions
| Flag | Description |
|------|-------------|
| --pattern | Pattern id (see --list) |
| --registry | Explicit registry file |
| --package-registry | Use packaged registry defaults first |
| --cadence | Override cadence (e.g. 15m, 1d) |
| --level | L1, L2, or L3 cost/readiness model (default L1) |
| --conservative | Use slower cadence from ranges |
| --json | Machine-readable output |
Scenarios
Each estimate includes:
- Early-exit / no-op — empty watchlist, minimal tokens
- Full triage — every run does a full scan
- Action every run — implementer + verifier every time (worst case)
- Realistic blend — level-based mix (documented in output)
Pair with zj-loop/zj-loop-budget.md (scaffolded by zj-loop-init) and zj-loop-audit cost observability checks.
Cost level is not execution authority. Route Table policy and pattern-specific guards decide whether a loop is report-only, request-only, dry-run, or live.
