zcode-acp-server 0.65.0 → 0.66.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 +1 -1
- package/dist/bin/quota.js +2 -2
- package/dist/code-fingerprint.json +1 -1
- package/dist/goal-loop/driver.d.ts.map +1 -1
- package/dist/goal-loop/driver.js +3 -13
- package/dist/goal-loop/driver.js.map +1 -1
- package/dist/handlers/account.d.ts +20 -0
- package/dist/handlers/account.d.ts.map +1 -1
- package/dist/handlers/account.js +18 -3
- package/dist/handlers/account.js.map +1 -1
- package/dist/handlers/io.d.ts +14 -1
- package/dist/handlers/io.d.ts.map +1 -1
- package/dist/handlers/io.js +15 -2
- package/dist/handlers/io.js.map +1 -1
- package/dist/quota/ollama-cloud/client.d.ts +13 -4
- package/dist/quota/ollama-cloud/client.d.ts.map +1 -1
- package/dist/quota/ollama-cloud/client.js +14 -5
- package/dist/quota/ollama-cloud/client.js.map +1 -1
- package/dist/quota/ollama-cloud/format.d.ts +3 -2
- package/dist/quota/ollama-cloud/format.d.ts.map +1 -1
- package/dist/quota/ollama-cloud/format.js +22 -2
- package/dist/quota/ollama-cloud/format.js.map +1 -1
- package/dist/quota/ollama-cloud/index.d.ts +17 -1
- package/dist/quota/ollama-cloud/index.d.ts.map +1 -1
- package/dist/quota/ollama-cloud/index.js +92 -43
- package/dist/quota/ollama-cloud/index.js.map +1 -1
- package/dist/quota/ollama-cloud/types.d.ts +32 -8
- package/dist/quota/ollama-cloud/types.d.ts.map +1 -1
- package/dist/quota/ollama-cloud/types.js +13 -5
- package/dist/quota/ollama-cloud/types.js.map +1 -1
- package/dist/remote/hub-sandbox.d.ts +3 -2
- package/dist/remote/hub-sandbox.d.ts.map +1 -1
- package/dist/remote/hub-sandbox.js +42 -4
- package/dist/remote/hub-sandbox.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -2
- package/dist/server.js.map +1 -1
- package/docs/CLI.md +15 -12
- package/docs/REMOTE-CLIENTS.md +17 -9
- package/docs/REPLAY-GUIDE.md +16 -5
- package/package.json +1 -1
package/docs/CLI.md
CHANGED
|
@@ -136,10 +136,10 @@ Without credentials, the default multi-provider mode silently shows GLM only
|
|
|
136
136
|
## Ollama Cloud setup
|
|
137
137
|
|
|
138
138
|
Ollama Cloud exposes an (undocumented) usage endpoint at
|
|
139
|
-
`ollama.com/api/usage` that the CLI queries with your API key
|
|
140
|
-
at [cloud.ollama.ai](https://cloud.ollama.ai) →
|
|
141
|
-
two sources, with the **config file taking
|
|
142
|
-
variable:
|
|
139
|
+
`ollama.com/api/usage` that the CLI queries with your API key (the rolling
|
|
140
|
+
`30d` window). Create a key at [cloud.ollama.ai](https://cloud.ollama.ai) →
|
|
141
|
+
API keys. The key comes from two sources, with the **config file taking
|
|
142
|
+
precedence** over the environment variable:
|
|
143
143
|
|
|
144
144
|
- **Config file** (`~/.config/zcode-acp/config.json`, `quota` section):
|
|
145
145
|
```json
|
|
@@ -150,14 +150,17 @@ variable:
|
|
|
150
150
|
export OLLAMA_API_KEY="your_ollama_api_key"
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
The
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
The API was rewritten upstream (2026-10): it now reports **spend analytics**
|
|
154
|
+
(`usage_usd`, request/token counts) and no longer exposes usage fractions or
|
|
155
|
+
plan limits. The card therefore derives the `Month` percent from the 30d
|
|
156
|
+
spend ÷ the plan's monthly credit (`/api/me` → `Plan`; credits from
|
|
157
|
+
ollama.com/pricing: Pro $60, Max $300, Team $1000 — unknown plans show the
|
|
158
|
+
spend line only, no bar) and shows a spend detail line
|
|
159
|
+
(`$1.57 of $60 · 246 req (30d)`) under the bars. The monthly reset is derived
|
|
160
|
+
from the `/api/me` billing period end or — on new credit plans, which return
|
|
161
|
+
only a `CreatedAt` — the next subscription-day anniversary. Without a key,
|
|
162
|
+
the default mode silently skips the Ollama section; `zcode-acp quota oc`
|
|
163
|
+
without a key prints a setup hint.
|
|
161
164
|
|
|
162
165
|
## Hub and server subcommands
|
|
163
166
|
|
package/docs/REMOTE-CLIENTS.md
CHANGED
|
@@ -419,9 +419,15 @@ section — so clients can reproduce the CLI layout exactly:
|
|
|
419
419
|
"ollama": {
|
|
420
420
|
"kind": "success",
|
|
421
421
|
"windows": [
|
|
422
|
-
{ "key": "
|
|
423
|
-
|
|
424
|
-
]
|
|
422
|
+
{ "key": "monthly", "label": "Month", "usagePercent": 2.6,
|
|
423
|
+
"resetsAt": 1729071480308 }
|
|
424
|
+
],
|
|
425
|
+
"usage": {
|
|
426
|
+
"plan": "pro", "usageUsd": 1.5747, "creditUsd": 60,
|
|
427
|
+
"requestCount": 246, "inputTokens": 14294081,
|
|
428
|
+
"cachedInputTokens": 12922504, "outputTokens": 940919,
|
|
429
|
+
"window": "30d"
|
|
430
|
+
}
|
|
425
431
|
}
|
|
426
432
|
} }
|
|
427
433
|
```
|
|
@@ -438,12 +444,14 @@ section — so clients can reproduce the CLI layout exactly:
|
|
|
438
444
|
means the user never set OpenCode Go credentials — omit the section, like
|
|
439
445
|
the CLI does.
|
|
440
446
|
- `ollama` (`kind`: `success` | `not_configured` | `auth_error` |
|
|
441
|
-
`unavailable`):
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
+
`unavailable`): since the 2026-10 upstream API rewrite the endpoint reports
|
|
448
|
+
spend only, so on success `windows` carries the derived `monthly` (`Month`)
|
|
449
|
+
entry — 30d `usageUsd` ÷ the plan's monthly credit, absent when the plan's
|
|
450
|
+
credit is unknown — with `resetsAt` (epoch ms, from the `/api/me` billing
|
|
451
|
+
period or subscription-day anniversary) when available. The additive
|
|
452
|
+
`usage` object carries the raw analytics (`plan`, `usageUsd`,
|
|
453
|
+
`creditUsd?`, `requestCount`/token totals, `window: "30d"`) for clients
|
|
454
|
+
that want to render spend directly; older clients ignore it.
|
|
447
455
|
`not_configured` means no
|
|
448
456
|
Ollama API key is set — omit the section, like the CLI does.
|
|
449
457
|
- Provider failures are per-section `kind` strings, not JSON-RPC errors —
|
package/docs/REPLAY-GUIDE.md
CHANGED
|
@@ -128,7 +128,7 @@ update's `_meta`:
|
|
|
128
128
|
too. These updates never collide with live tool_call ids (they carry the
|
|
129
129
|
`histfold_` prefix).
|
|
130
130
|
|
|
131
|
-
## Turn running state (`replayMeta.turnActive` +
|
|
131
|
+
## Turn running state (`replayMeta.turnActive` + turnState notifications)
|
|
132
132
|
|
|
133
133
|
A turn may already be in flight when you attach — started by the editor or
|
|
134
134
|
another remote client (the bridge runs it to completion regardless of who
|
|
@@ -137,16 +137,26 @@ prompted). Two signals cover it:
|
|
|
137
137
|
- **Attach snapshot**: `session/load`'s `replayMeta.turnActive` (boolean) —
|
|
138
138
|
`true` when any turn for this session is running at attach time. Seed your
|
|
139
139
|
spinner/running state from it.
|
|
140
|
-
- **Out-of-band updates**: the notification
|
|
140
|
+
- **Out-of-band updates**: the turn-state notification with params
|
|
141
141
|
`{ sessionId: string, running: boolean }` — emitted when a turn starts and
|
|
142
142
|
when it ends (including failures, e.g. a failed subscribe). On preemption (a
|
|
143
143
|
new prompt interrupts an in-flight one) the old turn's exit reports
|
|
144
144
|
`running: true`: the preempting turn took over, so the session is still busy.
|
|
145
145
|
|
|
146
|
+
The notification is **dual-emitted under two names** (#311): the deprecated
|
|
147
|
+
`$/zcode/turnState` (LSP-style prefix) and the spec-compliant
|
|
148
|
+
`_zcode/turnState` (ACP reserves `_`-prefixed names for extension
|
|
149
|
+
notifications). Subscribe to exactly ONE of them — a client handling both
|
|
150
|
+
sees every transition twice. New clients should use `_zcode/turnState`; the
|
|
151
|
+
`$/` spelling remains for existing consumers (martty, zcode-acp-remote) and
|
|
152
|
+
will be removed once they migrate. Both names are advertised in
|
|
153
|
+
`initialize`'s `agentCapabilities._meta.zcode.turnState`.
|
|
154
|
+
|
|
146
155
|
The client that sent `session/prompt` already knows its own turn via the
|
|
147
156
|
request/response; these signals exist for the OTHER attached clients
|
|
148
157
|
(re-attached mobile, second editor). Unknown notifications are ignorable —
|
|
149
|
-
clients that don't handle
|
|
158
|
+
clients that don't handle the turn-state notifications lose nothing (Zed
|
|
159
|
+
ignores them).
|
|
150
160
|
|
|
151
161
|
## Scroll-up pagination
|
|
152
162
|
|
|
@@ -202,8 +212,9 @@ Never parse the cursor — it is opaque. (For the curious it round-trips
|
|
|
202
212
|
- [ ] `session/load` params include `cwd` and `mcpServers` (even `[]`).
|
|
203
213
|
- [ ] Message list keyed/deduped by `messageId`; tool cards by `toolCallId`.
|
|
204
214
|
- [ ] Pagination pages prepended, live updates appended.
|
|
205
|
-
- [ ] Running state seeded from `replayMeta.turnActive` and updated from
|
|
206
|
-
|
|
215
|
+
- [ ] Running state seeded from `replayMeta.turnActive` and updated from the
|
|
216
|
+
turn-state notifications — `_zcode/turnState` (or the deprecated `$/`
|
|
217
|
+
spelling; pick ONE) — covering other clients' turns.
|
|
207
218
|
- [ ] `"cursor expired"` handled by full re-attach.
|
|
208
219
|
- [ ] Cursor stored per session, never parsed, never persisted across app
|
|
209
220
|
runs (it is only meaningful to the bridge that minted it).
|