The Volcengine ARK Agent Plan catalogue, hand-maintained in core/ark.json
from the docs (tiers, AFP quota, coefficients, model gates). Exposed here for
the same reason as ZEN_JSON: the arkuse bin includes it from the
published crate.
The OpenCode Go/Zen catalogue, as generated by scripts/extract-zen.ts into
core/zen.json. Exposed here so the ocuse bin can include it without
reaching outside its own crate (which cargo refuses at package time).
Bare model id with any provider qualifier stripped: everything after the
FIRST colon. blockedModels entries are provider-qualified
(“anthropic:claude-opus-5”); we only serve via command-code lanes, so match
on the id portion. A model id that itself contains ‘:’ keeps it.
Compact thousands/millions. Rounds half-away-from-zero explicitly before
formatting: {:.1} alone is round-half-to-even, which disagrees with JS
Math.round at exact .x5 ties (1_250_000 → “1.2M” vs “1.3M”).
Assemble the monthly usage window from the plan cap and subscription
period: used = cap − remaining (clamped to [0, cap]), reset = period end,
duration = period length. Returns (window, duration secs). Single source
for cli + zed; the opencode TS port mirrors it via conformance vectors.
Seconds until spend hits cap at the current rate, if that lands before the
window resets. None = no warning. Suppressed before 10% of the window has
elapsed — the flat-rate projection is unreliable that early.
Percent string of used/cap at one decimal: “34.2%” or “—” when cap unknown.
Multiply-rounds to one decimal ((x*10).round()/10) before formatting,
matching JS toFixed(1)/Math.round in the opencode port; format!("{:.1}")
alone is half-to-even and drifts at exact .x5 ties.
True when plan_id matched a NAME_RULES entry rather than falling through
to DEFAULT_NAME. Callers warn on false: the API returned a plan we don’t
know, so its name/cap may be wrong until plans.json is updated.