pi-hypercharm-provider 1.1.4 → 1.2.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.
@@ -0,0 +1,106 @@
1
+ {
2
+ "format": 1,
3
+ "entries": {
4
+ "topology/hosts/e0efb9d647e046c355b8bff12785e7805d774e7b89892edb38b4b29667ddc15f": {
5
+ "key": "topology/hosts/e0efb9d647e046c355b8bff12785e7805d774e7b89892edb38b4b29667ddc15f",
6
+ "value": {
7
+ "format": 1,
8
+ "id": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
9
+ "rootId": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
10
+ "identity": {
11
+ "id": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
12
+ "name": "main",
13
+ "kind": "main",
14
+ "sessionId": "019fe2d3-1ac4-7f63-a2e7-b396c7bb1738"
15
+ },
16
+ "startedAt": 1786216915272,
17
+ "updatedAt": 1786219071101,
18
+ "expiresAt": 1786219086101
19
+ },
20
+ "version": 603,
21
+ "updatedAt": 1786219071102,
22
+ "updatedBy": {
23
+ "id": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
24
+ "name": "main",
25
+ "kind": "main",
26
+ "sessionId": "019fe2d3-1ac4-7f63-a2e7-b396c7bb1738"
27
+ }
28
+ },
29
+ "sessions/019fe2d3-1ac4-7f63-a2e7-b396c7bb1738": {
30
+ "key": "sessions/019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
31
+ "value": {
32
+ "id": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
33
+ "name": "Peer 019fe2d3",
34
+ "kind": "peer",
35
+ "status": "running",
36
+ "runner": "pi",
37
+ "transport": "host",
38
+ "cwd": "/Users/monotykamary/VCS/working-remote/open-source/pi-hypercharm-provider",
39
+ "sessionId": "019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
40
+ "model": "neuralwatt/kimi-k3",
41
+ "thinking": "max",
42
+ "startedAt": 1786216915272,
43
+ "updatedAt": 1786219071101,
44
+ "pendingMessages": false,
45
+ "local": false
46
+ },
47
+ "version": 603,
48
+ "updatedAt": 1786219071103,
49
+ "updatedBy": {
50
+ "id": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
51
+ "name": "main",
52
+ "kind": "main",
53
+ "sessionId": "019fe2d3-1ac4-7f63-a2e7-b396c7bb1738"
54
+ }
55
+ },
56
+ "topology/participants/e0efb9d647e046c355b8bff12785e7805d774e7b89892edb38b4b29667ddc15f": {
57
+ "key": "topology/participants/e0efb9d647e046c355b8bff12785e7805d774e7b89892edb38b4b29667ddc15f",
58
+ "value": {
59
+ "format": 1,
60
+ "id": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
61
+ "kind": "root",
62
+ "rootId": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
63
+ "ownerHostId": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
64
+ "ownerIdentityId": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
65
+ "name": "main",
66
+ "status": "running",
67
+ "runner": "pi",
68
+ "transport": "host",
69
+ "capabilities": [
70
+ "steer",
71
+ "followUp",
72
+ "fabric"
73
+ ],
74
+ "cwd": "/Users/monotykamary/VCS/working-remote/open-source/pi-hypercharm-provider",
75
+ "sessionId": "019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
76
+ "model": "neuralwatt/kimi-k3",
77
+ "thinking": "max",
78
+ "startedAt": 1786216915272,
79
+ "updatedAt": 1786219071101,
80
+ "pendingMessages": false,
81
+ "controlProtocol": "v1"
82
+ },
83
+ "version": 603,
84
+ "updatedAt": 1786219071103,
85
+ "updatedBy": {
86
+ "id": "session:019fe2d3-1ac4-7f63-a2e7-b396c7bb1738",
87
+ "name": "main",
88
+ "kind": "main",
89
+ "sessionId": "019fe2d3-1ac4-7f63-a2e7-b396c7bb1738"
90
+ }
91
+ }
92
+ },
93
+ "versions": {
94
+ "topology/hosts/e9758aa8c95305a8d60a8aa2c20fd53195591d479b2460e1273457793d3f1fec": 18,
95
+ "sessions/019fe2c8-1dd2-7435-9fa1-fa664831df18": 17,
96
+ "topology/participants/e9758aa8c95305a8d60a8aa2c20fd53195591d479b2460e1273457793d3f1fec": 18,
97
+ "topology/hosts/e0efb9d647e046c355b8bff12785e7805d774e7b89892edb38b4b29667ddc15f": 603,
98
+ "sessions/019fe2d3-1ac4-7f63-a2e7-b396c7bb1738": 603,
99
+ "topology/participants/e0efb9d647e046c355b8bff12785e7805d774e7b89892edb38b4b29667ddc15f": 603
100
+ },
101
+ "tombstoneOrder": [
102
+ "sessions/019fe2c8-1dd2-7435-9fa1-fa664831df18",
103
+ "topology/participants/e9758aa8c95305a8d60a8aa2c20fd53195591d479b2460e1273457793d3f1fec",
104
+ "topology/hosts/e9758aa8c95305a8d60a8aa2c20fd53195591d479b2460e1273457793d3f1fec"
105
+ ]
106
+ }
package/AGENTS.md CHANGED
@@ -18,7 +18,8 @@ When a model needs overrides, new properties, or corrections, edit the appropria
18
18
  |------|---------|
19
19
  | `patch.json` | Per-model overrides keyed by model ID. Add reasoning flags, compat settings, pricing corrections, thinking level maps, etc. Applied on top of `models.json` at runtime and for README generation. |
20
20
  | `custom-models.json` | Models that don't exist in the provider API (hidden models, router endpoints, cross-provider aliases). Merged after patch. Format: array of full model objects (same schema as `models.json` entries). |
21
- | `index.ts` | Provider extension code. |
21
+ | `index.ts` | Provider extension code: model sync, streaming wrapper, footer-status wiring. |
22
+ | `status.ts` | Footer-status presentation: config schema, hypercredit/rate-limit formatters, progressive-disclosure tiers, width-aware widget. Pure module — no pi imports; exercised by `tests/status.smoke.ts`. |
22
23
  | `scripts/update-models.js` | The sync script itself (edit only if changing how models are fetched/transformed). |
23
24
 
24
25
  ## Data Flow
package/README.md CHANGED
@@ -15,40 +15,41 @@ _Hyperoptimized coding models — DeepSeek, GLM, Kimi, Qwen, MiniMax, Gemma, GPT
15
15
 
16
16
  ## Features
17
17
 
18
- - **23+ AI Models** including DeepSeek V4 Flash/Pro, GLM 5/5.1, Kimi K2.5/K2.6, Qwen3.6/3.7, MiniMax M2.7, Gemma 4, GPT-OSS, and Llama
19
- - **DeepSeek Native Thinking** — Uses the `deepseek` thinking format with `reasoning_effort` and 384K max output for DeepSeek V4 models
18
+ - **24+ AI Models** including DeepSeek V4 Flash/Pro, GLM 5/5.1, Kimi K2.5/K2.6, Qwen3.6/3.7, MiniMax M2.7, Gemma 4, GPT-OSS, and Llama
19
+ - **DeepSeek Native Thinking** — Uses the `deepseek` thinking format for Charm Hyper requests, with native `reasoning_effort` on models that publish levels
20
20
  - **OpenAI-compatible API** via Charm Hyper's `/v1/chat/completions` endpoint
21
- - **Cost Tracking** with per-model pricing from the API
22
- - **Reasoning Models** with `reasoning_effort` parameter support on select models
23
- - **Vision Support** for image-capable models (Kimi K2.5/K2.6, GLM 5.1, Qwen3.6/3.7, Gemma 4)
21
+ - **Official Catalog Sync** from Charm's typed `/v1/provider` endpoint, matching `@charmland/pi-hyper-provider`
22
+ - **Reasoning Models** with provider-published on/off states and exact effort levels
23
+ - **Attachment Support** for models the official catalog marks as attachment-capable
24
24
 
25
25
  ## Available Models
26
26
 
27
27
  | Model | Type | Context | Max Tokens | Input Cost | Output Cost |
28
28
  |-------|------|---------|------------|------------|-------------|
29
29
  | DeepSeek V4 Flash | Text | 1.0M | 384K | $0.20 | $0.40 |
30
+ | DeepSeek V4 Flash 0731 | Text | 1.0M | 384K | $0.15 | $0.30 |
30
31
  | DeepSeek V4 Pro | Text | 1.0M | 384K | $2.40 | $4.80 |
31
- | Gemma 4 26B A4B | Text + Image | 256K | 26K | $0.12 | $0.41 |
32
- | GLM 5.1 | Text + Image | 203K | 131K | $1.40 | $4.40 |
33
- | GLM-5 | Text | 203K | 20K | $0.81 | $2.59 |
32
+ | Gemma 4 26B A4B | Text | 256K | 26K | $0.12 | $0.42 |
33
+ | GLM-5.1 | Text | 203K | 131K | $1.52 | $4.79 |
34
34
  | GLM-5.2 | Text | 1.0M | 128K | $1.40 | $4.40 |
35
- | GPT-OSS 120B | Text | 131K | 13K | $0.17 | $0.56 |
36
- | Kimi K2.5 | Text + Image | 262K | 26K | $0.52 | $2.72 |
35
+ | gpt-oss-120b | Text | 131K | 13K | $0.18 | $0.71 |
36
+ | Kimi K2.5 | Text | 262K | 26K | $0.55 | $2.89 |
37
37
  | Kimi K2.6 | Text + Image | 262K | 262K | $0.95 | $4.00 |
38
- | Kimi K2.7 Code | Text | 256K | 16K | $0.95 | $4.00 |
39
- | Kimi K3 | Text | 1.0M | 131K | Free | Free |
38
+ | Kimi K2.7 Code | Text + Image | 256K | 16K | $0.95 | $4.00 |
39
+ | Kimi K3 | Text + Image | 1.0M | 131K | $3.27 | $16.33 |
40
40
  | Llama 3.3 70B Instruct | Text | 128K | 13K | $0.61 | $1.04 |
41
- | Llama 4 Maverick 17B 128E FP8 | Text | 430K | 43K | $0.28 | $0.93 |
42
- | MiniMax M2.7 | Text | 205K | 20K | $0.42 | $1.56 |
43
- | MiniMax M3 | Text | 512K | 512K | Free | Free |
44
- | Qwen3 Coder 480B A35B INT4 | Text | 106K | 11K | $0.60 | $2.08 |
45
- | Qwen3 Next 80B A3B | Text | 262K | 26K | $0.12 | $1.14 |
41
+ | Llama 4 Maverick 17B 128E Instruct FP8 | Text | 430K | 43K | $0.27 | $0.90 |
42
+ | MiniMax M2.7 | Text | 262K | 7K | $0.44 | $1.72 |
43
+ | MiniMax M3 | Text + Image | 512K | 512K | $0.33 | $1.31 |
44
+ | Qwen3 Coder 480B A35B Instruct INT4 Mixed AR | Text | 106K | 11K | $0.57 | $2.13 |
45
+ | Qwen3 Next 80B A3B Instruct | Text | 262K | 26K | $0.12 | $1.14 |
46
46
  | Qwen3.6-Flash | Text + Image | 1.0M | 64K | $1.00 | $4.00 |
47
- | Qwen3.6-Max | Text + Image | 256K | 64K | $2.00 | $12.00 |
47
+ | Qwen3.6-Max | Text | 256K | 64K | $2.00 | $12.00 |
48
48
  | Qwen3.6-Plus | Text + Image | 1.0M | 64K | $2.00 | $6.00 |
49
- | Qwen3.7-Flash | Text | 1.0M | 64K | Free | Free |
50
- | Qwen3.7-Max | Text + Image | 1.0M | 64K | $2.50 | $7.50 |
51
- | Qwen3.7-Plus | Text | 1.0M | 64K | $1.20 | $4.80 |
49
+ | Qwen3.7-Flash | Text + Image | 1.0M | 64K | $0.20 | $0.80 |
50
+ | Qwen3.7-Max | Text | 1.0M | 64K | $2.50 | $7.50 |
51
+ | Qwen3.7-Plus | Text + Image | 1.0M | 64K | $1.20 | $4.80 |
52
+ | Qwen3.8-Max | Text + Image | 1.0M | 66K | $2.00 | $6.00 |
52
53
  *Costs are per million tokens. Prices subject to change — check [hyper.charm.land](https://hyper.charm.land) for current pricing.*
53
54
 
54
55
  ## Installation
@@ -118,12 +119,57 @@ For reasoning models that support `reasoning_effort`, control thinking depth:
118
119
  pi --provider hypercharm --model deepseek-v4-pro --reasoning-effort max
119
120
  ```
120
121
 
121
- Values: `none`, `low`, `medium`, `high`, `max`
122
+ Supported levels are model-specific and come from Charm's `/v1/provider` catalog (for example `low`/`medium`/`high` on Kimi K2.6). Models with no published levels support the Hyper thinking on state through Pi's `max` level.
122
123
 
123
124
  ### Thinking Mode
124
125
 
125
126
  DeepSeek V4 models use the `deepseek` thinking format — the same native format as the [pi-deepseek-provider](https://github.com/monotykamary/pi-deepseek-provider). This sends `thinking: {type: "enabled/disabled"}` plus `reasoning_effort` mapped via `thinkingLevelMap` (`high` → `"high"`, `max` → `"max"`). Replayed assistant messages include empty `reasoning_content` as required by DeepSeek's API.
126
127
 
128
+ ## Footer Status
129
+
130
+ A Neuralwatt-style status line sits below the editor. It appears after the
131
+ session's first HyperCharm turn completes (never before — no half-empty line
132
+ on fresh sessions or other providers), refreshes its balance when the agent
133
+ run fully settles, and makes no status-related API calls in sessions that
134
+ never use HyperCharm:
135
+
136
+ ```
137
+ ⚡ 1.24 hc · 7 req Xu's Team ◆ 249 hc · 996/1k/h · 29d
138
+ └─ session spend+requests ─┘ └─ team · balance · rate limits ──┘
139
+ ```
140
+
141
+ The left side tracks what the current session has sent/spent, read from
142
+ Hyper's `usage.cost.hypercredits` extension on each response (no polling).
143
+ The right side shows the team name (`/v1/teams` — works for API-key auth),
144
+ the Hypercredit balance (`/v1/credits`), the per-hour and per-day request
145
+ rate limits captured from response headers, and days until the OAuth device
146
+ session expires when signed in with OAuth. The right side compresses
147
+ progressively as the terminal narrows, and turns to a warning color at/below
148
+ the `lowBalanceHc` threshold.
149
+
150
+ ### Configuration
151
+
152
+ Edit `~/.pi/agent/extensions/hypercharm.json` or run `/hypercharm-status`:
153
+
154
+ | Setting | Values | Default |
155
+ |---------|--------|---------|
156
+ | `session` | `widget` \| `statusbar` \| `off` | `widget` |
157
+ | `account` | `widget` \| `statusbar` \| `off` | `widget` |
158
+ | `hideOnOtherProvider` | `true` \| `false` | `true` |
159
+ | `lowBalanceHc` | number \| `null` | `25` |
160
+
161
+ Non-interactive toggles:
162
+
163
+ ```
164
+ /hypercharm-status session widget|statusbar|off
165
+ /hypercharm-status account widget|statusbar|off
166
+ /hypercharm-status hide true|false
167
+ /hypercharm-status lowBalance 50|off
168
+ /hypercharm-status refresh
169
+ /hypercharm-status reset
170
+ ```
171
+
172
+
127
173
  ## Authentication
128
174
 
129
175
  The HyperCharm API key can be configured in multiple ways (resolved in this order):
@@ -156,37 +202,21 @@ Add to your pi configuration for automatic loading:
156
202
  }
157
203
  ```
158
204
 
159
- ### Compat Settings
205
+ ### Catalog and Compat Settings
160
206
 
161
- Charm Hyper uses an OpenAI-compatible API. Compatibility settings are managed via `patch.json`:
207
+ Model metadata matches Charm's official [`@charmland/pi-hyper-provider`](https://github.com/charmbracelet/pi-hyper-provider) transform:
162
208
 
163
- **DeepSeek models** use the `deepseek` thinking format (identical to the native DeepSeek API):
209
+ - canonical `/v1/provider` names, prices, context windows, output caps, attachment flags, and `can_reason`
210
+ - `thinkingFormat: "deepseek"`, which maps Pi thinking levels onto Hyper's `thinking` envelope
211
+ - `reasoning_effort` only when the catalog publishes concrete level names
212
+ - `maxTokensField: "max_tokens"` and `supportsStore: false`
213
+ - zero `cacheWrite`, because Hyper reports discounted cached-output pricing, not cache-write cost
164
214
 
165
- - **`thinkingFormat: "deepseek"`** Sends `thinking: {type: "enabled/disabled"}` to toggle thinking mode
166
- - **`supportsReasoningEffort: true`** — Supports `reasoning_effort: "high" | "max"` via `thinkingLevelMap`
167
- - **`requiresReasoningContentOnAssistantMessages: true`** — Replayed assistant messages include empty `reasoning_content` when reasoning is enabled
168
- - **`maxTokensField: "max_tokens"`** — Uses `max_tokens` (not `max_completion_tokens`)
169
-
170
- **Other reasoning models** (GLM, Kimi, Qwen, MiniMax, Gemma, GPT-OSS) use the `openai` thinking format:
171
-
172
- - **`thinkingFormat: "openai"`** — Returns `reasoning_content` in OpenAI format
173
- - **`supportsReasoningEffort: true`** — Accepts `reasoning_effort` parameter on supported models
174
- - **`maxTokensField: "max_tokens"`** — Uses `max_tokens` (not `max_completion_tokens`)
175
- - **`supportsDeveloperRole: true`** — Developer role messages are accepted
176
- - **`supportsStore: false`** — The `store` parameter is not supported
177
-
178
- > **Note:** The HyperCharm `/v1/models` endpoint reports `supports_reasoning: true` for all models,
179
- > including those that don't natively support extended thinking (e.g., Llama 3.3 70B). `models.json`
180
- > curates reasoning flags based on known model capabilities; `patch.json` adds compat overrides.
215
+ `patch.json` is reserved only for a verified provider regression and is currently empty.
181
216
 
182
217
  ### Patch Overrides
183
218
 
184
- The `patch.json` file contains overrides applied on top of `models.json` data:
185
-
186
- - Correcting API-derived values (e.g., DeepSeek `maxTokens` from 8000 to 384000)
187
- - Adding compat settings that the API doesn't provide
188
- - Setting `thinkingFormat: "deepseek"` + `thinkingLevelMap` for DeepSeek V4 models
189
- - Overriding pricing when official rates change
219
+ `patch.json` is applied on top of `models.json` only for verified endpoint corrections. It is currently empty because every live field comes from Charm's canonical provider catalog.
190
220
 
191
221
  ## Updating Models
192
222
 
@@ -199,10 +229,11 @@ node scripts/update-models.js
199
229
 
200
230
  This will:
201
231
  1. Fetch models from `https://hyper.charm.land/v1/models`
202
- 2. Preserve curated data (reasoning, vision, DeepSeek compat) from existing `models.json`
203
- 3. Apply overrides from `patch.json`
232
+ 2. Regenerate `models.json` as pure metadata from Charm's typed `/v1/provider` catalog
233
+ 3. Apply overrides from `patch.json` only when building the README
204
234
  4. Remove custom models now available upstream from `custom-models.json`
205
- 5. Update `models.json` and the README model table
235
+ 5. Reconcile delisted models through the 14-day `deprecated-models.json` grace layer
236
+ 6. Update `models.json` and the README model table
206
237
 
207
238
  A GitHub Actions workflow runs this daily and creates a PR if models have changed.
208
239
 
@@ -1 +1,34 @@
1
- {}
1
+ {
2
+ "glm-5": {
3
+ "id": "glm-5",
4
+ "name": "GLM-5",
5
+ "reasoning": true,
6
+ "thinkingLevelMap": {
7
+ "off": "off",
8
+ "minimal": null,
9
+ "low": null,
10
+ "medium": null,
11
+ "high": null,
12
+ "xhigh": null,
13
+ "max": "max"
14
+ },
15
+ "input": [
16
+ "text"
17
+ ],
18
+ "cost": {
19
+ "input": 0.85,
20
+ "output": 2.742,
21
+ "cacheRead": 0.425,
22
+ "cacheWrite": 0
23
+ },
24
+ "contextWindow": 202752,
25
+ "maxTokens": 20275,
26
+ "compat": {
27
+ "supportsStore": false,
28
+ "supportsReasoningEffort": false,
29
+ "thinkingFormat": "deepseek",
30
+ "maxTokensField": "max_tokens"
31
+ },
32
+ "deprecatedAt": "2026-08-08T02:00:08.813Z"
33
+ }
34
+ }