Expand description
Normalized usage windows (issue #57).
Claude Code streams rate_limit_event.rate_limit_info (one window per
event, utilization as a 0-1 fraction). Codex reports
rate_limits.{primary,secondary} in rollout token_count events
(used_percent, window_minutes, resets_at) and in app-server
account/rateLimits/* (usedPercent, windowDurationMins, resetsAt).
Both become one UsageWindow shape; resets_at stays in epoch seconds
like limit_resets_at.
Structs§
- Usage
Window - One provider usage window
Constants§
- USAGE_
WINDOW_ KINDS - Window kinds, shortest first.
Functions§
- claude_
rate_ limit_ windows - Normalize one Claude
rate_limit_info. - codex_
rate_ limit_ windows - Normalize a Codex
rate_limitssnapshot (rollout snake_case or app-server camelCase). - extract_
usage_ windows - Fold every usage window a run reported, newest value per window.
- merge_
usage_ windows - Merge a partial update into known windows by
id. - usage_
windows_ from_ message - The windows one stream or rollout message carries.