ccstatusline-usage 2.3.16 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/dist/ccstatusline.js +829 -924
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,6 +36,42 @@ This fork adds API-based usage widgets beyond the upstream:
|
|
|
36
36
|
- **Context Window Display** - Visual bar showing context usage
|
|
37
37
|
- **Off Peak** - Shows peak/off-peak status with countdown timer (peak hours drain sessions faster)
|
|
38
38
|
- **Two-line Layout** - Session info on line 1, context on line 2
|
|
39
|
+
- **Multi-provider routing** - Usage widgets dispatch per model: Anthropic models hit the usage API; opencode/local models (GLM, Kimi, MiniMax, Qwen, Ollama) skip the fetch and gracefully hide usage bars while keeping the real-time context bar.
|
|
40
|
+
|
|
41
|
+
### Multi-Provider Routing (Opencode / Local Models)
|
|
42
|
+
|
|
43
|
+
Claude Code can route individual prompts to non-Anthropic backends via opencode or a local Ollama runtime. The status line reads the `model.id` that Claude Code sends on stdin each render and dispatches through a per-provider resolver (`src/utils/usage/resolver.ts`):
|
|
44
|
+
|
|
45
|
+
- **Anthropic** (`opus`, `sonnet`, `haiku` in the id) — fetches Session/Weekly/Reset from the usage API.
|
|
46
|
+
- **Opencode** (`glm`, `kimi`, `minimax`, `mm-`, `qwen`, `owen`, `mimo`) — no usage API call; Session/Weekly/Reset widgets hide themselves. Context Bar still renders when `context_window` is in the payload.
|
|
47
|
+
- **Unknown model id** — same behavior as opencode (hides usage widgets).
|
|
48
|
+
|
|
49
|
+
This means opencode-routed turns don't trigger pointless Anthropic API calls or rate-limiting during heavy local usage.
|
|
50
|
+
|
|
51
|
+
Example — configure Claude Code to route a model through opencode (edit `~/.claude/settings.json`):
|
|
52
|
+
|
|
53
|
+
```jsonc
|
|
54
|
+
{
|
|
55
|
+
"statusLine": {
|
|
56
|
+
"type": "command",
|
|
57
|
+
"command": "npx -y ccstatusline-usage@latest",
|
|
58
|
+
"padding": 0
|
|
59
|
+
},
|
|
60
|
+
"model": "glm-5.1" // or "kimi-k2.6", "minimax-m2.7", "qwen-3.6-plus", "qwen3.6:35b-a3b-q4_K_M" for local Ollama
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
What the status line renders per model:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
# Anthropic (opus / sonnet / haiku)
|
|
68
|
+
Session: [████░░░░░░░░░░░] 27.0% | Weekly: [████░░░░░░░░░░░] 34.0% | 2:03 hr | Model: Opus 4.7
|
|
69
|
+
Context: [██████░░░░░░░░░] 389k/1M (39%) | Pace: [░░░░░░█|░░░░░░░] D4/7 -8% | Off-peak (4:03 hr)
|
|
70
|
+
|
|
71
|
+
# Opencode / local (glm-5.1, kimi, qwen, …)
|
|
72
|
+
Model: glm-5.1 | Off-peak (4:03 hr)
|
|
73
|
+
Context: [██░░░░░░░░░░░░░] 50k/200k (25%)
|
|
74
|
+
```
|
|
39
75
|
|
|
40
76
|
### Enhanced Status Line Preview
|
|
41
77
|
|
|
@@ -67,6 +103,18 @@ Session: [████░░░░░░░░░░░] 27.0% | Weekly: [██
|
|
|
67
103
|
|
|
68
104
|
## 🆕 Recent Updates
|
|
69
105
|
|
|
106
|
+
### [v2.4.0](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.4.0) - Multi-provider router for usage widgets
|
|
107
|
+
|
|
108
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Provider pattern end-to-end** — Usage widgets now dispatch through `resolveProvider(modelId)` in `src/utils/usage/resolver.ts`. Anthropic models (`opus`/`sonnet`/`haiku`) fetch from the usage API; opencode/local models (`glm`, `kimi`, `minimax`, `mm-`, `qwen`, `owen`, `mimo`) skip the fetch entirely so heavy local-model sessions no longer trigger needless Anthropic API calls or rate-limiting.
|
|
109
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): The prefetch layer (`usage-prefetch.ts`) now reads `data.model.id` from the payload and dispatches via `provider.fetchUsage()` instead of the hardcoded Anthropic path. `opencodeProvider` / `nullProvider` return empty `UsageData`, so Session/Weekly/Reset widgets hide themselves naturally.
|
|
110
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Context Bar stays backend-agnostic** — renders whenever `context_window` is present in the payload, regardless of which provider handled the turn.
|
|
111
|
+
- See the new [Multi-Provider Routing](#multi-provider-routing-opencode--local-models) section under Fork Enhancements for example config.
|
|
112
|
+
|
|
113
|
+
### [v2.3.17](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.3.17) - Local model fallback for API usage widgets
|
|
114
|
+
|
|
115
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Local model fallback** — When the active model is not Opus/Sonnet/Haiku (e.g. a local Ollama model like `qwen3-coder:30b`), the Session, Weekly, and Context widgets now render empty-bar placeholders (`[░░░░░░░░░░░░░░░] -.0%`) and the Reset Timer shows `-:00 hr` instead of misleading Claude API values.
|
|
116
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): Qwen models keep showing real context usage when `context_window` is present in the payload.
|
|
117
|
+
|
|
70
118
|
### [v2.3.16](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.3.16) - Reset Timer fix + model ref updates + upstream sync
|
|
71
119
|
|
|
72
120
|
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Reset Timer fix** — When session hits 100% but weekly is still below 100%, the Reset Timer now correctly shows the session reset countdown (5-hour window) instead of the weekly reset time. Previously it jumped to the weekly timer as soon as session filled up.
|