dsh-grok-provider 1.0.1 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -1,12 +1,27 @@
1
1
  # Changelog
2
2
 
3
- ## 1.0.1 - Unreleased
3
+ ## 1.0.3 - 2026-08-31
4
+
5
+ - Recover one pre-stream 401/403 by asking the official Grok CLI to refresh its shared session, reloading the validated credential, and retrying the request exactly once. Concurrent rejections from the same credential revision share one bounded refresh; a persistent rejection remains `AUTH`.
6
+ - Never replay a request after a successful response begins. Abort a response after two continuous minutes without any wire bytes; each received byte chunk refreshes this idle deadline. If the source disconnects, idles out, or reaches clean EOF after only bounded text/reasoning chunks, preserve that partial output, close its visible blocks, and append a bilingual interruption notice asking the user to send “continue.” Any observed tool call, unknown chunk, malformed protocol, user abort, or empty partial response keeps the established fail-closed behavior.
7
+ - Distinguish a clean premature SSE EOF from malformed events so only the former is eligible for partial-output preservation. Focused regressions cover one-shot recovery, persistent auth failure, concurrent single-flight refresh, post-start no-retry, idle timeout, transport interruption, clean EOF, status-bearing stream rejection, and partial tool-call rejection. The exact Node `24.19.0` suite passes with 274 tests, 272 pass, 0 fail, and 2 platform skips.
8
+ - Complete one redacted real-account success-path request with exact `grok-4.6` at Low Effort through the production adapter. It produced 2 block starts, 14 reasoning deltas, 2 block ends, 1 text delta, 1 usage chunk, and 1 finish. No response text, prompt output, URL, identity, credential, or raw event was retained; this does not simulate a future 401 or network stall.
9
+ - Code PR #37 merged as `9958f487abf8ebd062eecb4368689e4d049b1d35`; main CI run `33377849906` passed on macOS 14 and Windows 2022. Artifact digests and publication evidence remain pending until the release-evidence commit is merged and one tarball is frozen from that exact commit.
10
+
11
+ ## 1.0.2 - 2026-08-30
12
+
13
+ - Suppress contentless Harness reasoning blocks for upstream reasoning lifecycles that fully close without any visible summary or raw delta. The decoder now starts a visible block only when the first non-empty reasoning delta arrives; non-empty reasoning items remain separate blocks with their existing ordering.
14
+ - Preserve the strict protocol boundary while changing the projection: ordinary empty items retain their existing ID/type, sequence, output-index, status, summary/content, size, optional encrypted-content, and closure checks; Search-backed same-ID reuse additionally retains exact own-data key/accessor validation. Invalid reuse, ordering violations, and incomplete responses with an open reused lifecycle continue to fail closed.
15
+ - Preserve output-index order when a later visible block must wait for an earlier unresolved reasoning item. The shared delayed-chunk queue now fails closed above 65,536 chunks or 32 MiB of dynamic UTF-8 payload, preventing an unresolved item from amplifying memory across otherwise individually bounded blocks. Response text, tool calls, usage, finish reasons, visible non-empty replay, Search replay suppression, authentication, models, images, fixed endpoints, citation/URL handling, and Harness permissions remain unchanged. A hidden ordinary empty item has no replay-alignment slot, so validated encrypted content from that item is not persisted; existing empty `Think` rows stored in old conversations are not rewritten.
16
+ - Package the bilingual README with durable `1.0.2` wording and an exact `dsh-grok-provider@1.0.2` installation command. The exact Node `24.19.0` local suite passes with 265 tests, 263 pass, 0 fail, and 2 platform skips; production audit reports zero vulnerabilities and the isolated-cache dry-run pack lists 74 files. Final release commit `be200f9352afe93b27dd2856d89c01674f0cd637` passed dual-platform final CI run `33318426571`; annotated tag object `b7efd3aabb99c73e1747d2d87890cdf9b284c438` peels to that commit. Trusted Publisher run `33319150964` attempt 1 published the explicitly authorized unique 74-file artifact: 255,282 bytes packed, 789,962 bytes unpacked, SHA-1 `3feddb7048fe4c796037804518999b12ae491802`, SHA-256 `010a21770cb3e4e42b7195984df1f5bf8dc5027066198cf99b7d713ac045f605`, and SRI `sha512-TcvvPUXBJZEA728pVnUrXSZebGfIoB5ATG5041wA1OFzOE+hFTO98C5Fxl99WuFW2y7V89gkusYIKCpGlLNQIg==`. The frozen candidate, GitHub Release asset, and npm Registry tarball are byte-identical; npm reports `latest=1.0.2`, the locked Node `24.19.0` / npm `11.5.1` Host/client smoke and production audit passed, package metadata exposes 1 Registry signature and 2 attestations, `npm audit signatures` verified 11 signed packages and 2 attested packages, and SLSA provenance exactly binds `release.yml`, `refs/tags/v1.0.2`, the release commit, and publish run. Real-device Windows external-browser launch remains unverified.
17
+
18
+ ## 1.0.1 - 2026-08-30
4
19
 
5
20
  - Fix fixed-Proxy HTTP 400 failures when enabled xAI server `web_search` / `x_search` descriptors coexist with Harness function definitions using the same reserved names. Every source function is still fully validated first; only the definitions whose names collide with enabled server tools are omitted from the wire request. The same local functions remain available whenever the corresponding server Search setting is off.
6
21
  - Preserve historical `function_call` / `function_call_output` items, including prior `web_search` and `x_search` calls, so an existing conversation can continue without rewriting or discarding its tool history. Bind the response decoder to a receipt that rejects any function/server-tool name intersection.
7
22
  - Preserve transport failures raised while reading the SSE source instead of relabeling them as parser failures. Fixed-Proxy HTTP 400 maps to `PROVIDER_ERROR`; focused adapter coverage also locks 401/403 to `AUTH`, 429 to `RATE_LIMIT`, and `AbortError` to `ABORTED`, while malformed, truncated, or unsupported SSE continues to map to `INVALID_RESPONSE`.
8
23
  - Complete one redacted real-account replay of the original failing X-session structure: 8 messages and 40 source functions compiled to 38 function definitions plus 2 server Search descriptors while preserving 2 historical reserved-name calls. One models GET and one Responses POST yielded 314 events and `response.completed`. No message text, result text, URL, account identity, or credential was retained.
9
- - Set the source manifest and lockfile to the unpublished `1.0.1` candidate. The exact Node `24.19.0` local suite passes with 253 tests, 251 pass, 0 fail, and 2 platform skips; the production dependency audit reports zero vulnerabilities, an isolated-cache dry-run pack lists 73 files, and the secret-pattern scan finds only the explicit fixture canary and its checklist record. Code PR #31, its push/PR CI, merge commit `0c60200e12c3b8455331f31a317ece9b1945c458`, and main CI run `33312621786` passed on macOS 14 and Windows 2022. A fixed final release commit, frozen artifact, isolated installation, Registry publication, signatures, attestations, provenance, and real-device Windows validation remain pending and must not be inferred from local or code-merge gates.
24
+ - Set the source manifest and lockfile to `1.0.1`. The exact Node `24.19.0` local suite passes with 253 tests, 251 pass, 0 fail, and 2 platform skips; the production dependency audit reports zero vulnerabilities, an isolated-cache dry-run pack lists 73 files, and the secret-pattern scan finds only the explicit fixture canary and its checklist record. Code PR #31, merge commit `0c60200e12c3b8455331f31a317ece9b1945c458`, and main CI run `33312621786` passed on macOS 14 and Windows 2022. Release commit `3c25a53571531e35ac888df16df4fe6c01849e85` passed final dual-platform CI run `33312946205`; annotated tag object `ab79b1bb1e408a0112166cadc26761a327819c3f` peels to that commit. Trusted Publisher run `33313699790` attempt 1 published the explicitly authorized unique 73-file artifact: 240,904 bytes packed, 748,888 bytes unpacked, SHA-1 `9e6449160947104e8dbb71b7201c53e81b073f83`, SHA-256 `e3e15646d38de23c32c71ed759f9c10be9b2d790d4b10b4b8dfe59a44fbfef9f`, and SRI `sha512-Bm1qjJQ9i7CWT0oWah7QKDVBP8dR2YQtvEEZGE/BOSwZCo8sZbrW2v2QSfUfLsOLHcQXFZZ0jlDCAztr1m/q+A==`. The frozen candidate, GitHub Release, and npm tarballs are byte-identical; npm reports `latest=1.0.1`, the locked Node `24.19.0` / npm `11.5.1` Host/client smoke and production audit passed, package metadata exposes 1 Registry signature and 2 attestations, `npm audit signatures` verified 11 signed packages and 2 attestations, and SLSA provenance binds `release.yml`, `refs/tags/v1.0.1`, the release commit, and publish run. Real-device Windows external-browser launch remains unverified.
10
25
 
11
26
  ## 1.0.0 - 2026-08-30
12
27
 
package/README.en.md CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  Use an already authenticated official Grok Build account from DeepSeek Harness, with dynamic model discovery, streaming reasoning, image input, optional Web/X Search, tool calls, and an account quota/model capability dashboard.
6
6
 
7
- > Unofficial community project; not affiliated with xAI or DeepSeek Harness. The current stable release and npm Registry `latest` are both `1.0.0`. Source is preparing an unpublished `1.0.1` repair candidate; version `0.1.8` was published and then withdrawn and cannot be reused.
7
+ > Unofficial community project; not affiliated with xAI or DeepSeek Harness. This README describes the `dsh-grok-provider@1.0.3` artifact; version `0.1.8` was published and then withdrawn and cannot be reused.
8
8
 
9
- The current source candidate is `1.0.1`; npm Registry `latest` is `1.0.0`. Continue installing `1.0.0` until a `1.0.1` artifact is frozen, receives separate exact publication authorization, and completes Registry readback.
9
+ `1.0.3` addresses two real-session interruption paths. A 401/403 received before streaming begins triggers one bounded refresh through the official Grok CLI and at most one retry. Once streaming starts, the request is never replayed. If a connection then ends after only safe text/reasoning output, the Provider preserves those chunks and asks the user to send “continue”; tool calls, unknown events, and malformed protocol still fail closed.
10
10
 
11
- The `1.0.1` candidate fixes another real Search failure: when xAI server `web_search` / `x_search` is enabled, same-name Harness function definitions alongside those server tools cause fixed-Proxy HTTP 400. The candidate fully validates every function before omitting only enabled-name collisions from the wire definitions; historical function calls/results remain. The SSE layer also propagates transport errors, so HTTP 400 surfaces as `PROVIDER_ERROR` instead of a misleading `INVALID_RESPONSE`.
11
+ This README is included in the `1.0.3` npm tarball, and the exact installation command below is pinned to `1.0.3`. The previous version with completed supply-chain readback is `1.0.2`.
12
12
 
13
13
  ## What it provides
14
14
 
@@ -19,7 +19,7 @@ The `1.0.1` candidate fixes another real Search failure: when xAI server `web_se
19
19
  | Models | Discovers every model visible to the account at runtime; no static model allowlist |
20
20
  | Conversations | Streaming Responses text, reasoning, encrypted reasoning replay, usage, and finish reasons |
21
21
  | Images | Only exact `grok-4.6` accepts bounded JPEG/PNG images from Harness attachments; `grok-4.5` and all other models remain text-only |
22
- | Search | Published `1.0.0` provides default-off Web/X Search for exact `grok-4.6`; the `1.0.1` candidate resolves HTTP 400 conflicts between server Search and same-name Harness function definitions |
22
+ | Search | Exact `grok-4.6` provides default-off Web/X Search; `1.0.3` adds pre-stream authentication recovery and safe partial-output preservation without replaying a started stream |
23
23
  | Tools | Returns function calls to the Harness permission layer; the provider never executes tools, and local `web_search` / `x_search` remain when the corresponding Search setting is off |
24
24
  | Account dashboard | Login status, weekly/monthly quota, reset time, dynamic model capabilities and reasoning efforts |
25
25
  | Surfaces | Bilingual Web settings and a closed `/grok` TUI command set |
@@ -44,10 +44,10 @@ When the network is reachable and OIDC discovery succeeds, the official CLI open
44
44
 
45
45
  ### 2. Install the provider
46
46
 
47
- Install the exact published version that has been read back from the Registry:
47
+ Install the exact version:
48
48
 
49
49
  ```sh
50
- dsh plugin --profile web add dsh-grok-provider@1.0.0
50
+ dsh plugin --profile web add dsh-grok-provider@1.0.3
51
51
  dsh web
52
52
  ```
53
53
 
@@ -134,9 +134,10 @@ Uninstalling the provider does not remove the official Grok CLI or directly modi
134
134
 
135
135
  ## Sources and discovery
136
136
 
137
- - Current npm stable release: [dsh-grok-provider@1.0.0](https://www.npmjs.com/package/dsh-grok-provider/v/1.0.0) (unique artifact, dual-platform CI, signatures, attestations, and provenance verified)
138
- - Most recent GitHub release and integrity values: [v1.0.0](https://github.com/yoshino-xiao7/dsh-grok-provider/releases/tag/v1.0.0)
139
- - Release evidence: release commit `c6548199582b122f1d285422eabea0205eaf602f`, annotated tag object `192561cda1ac58cbc4077f0de8fa614dff9a5557` peeling to that commit, final CI run [`33308603394`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33308603394), and Trusted Publisher run [`33309083806` attempt 1](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33309083806/attempts/1). The repository owner explicitly authorized the unique 72-file artifact, which is 226,704 bytes packed and 715,014 bytes unpacked; SHA-1 is `50e5d898dba241d1e19def7705db216e3060b892`, SHA-256 is `30cd83dad77f7d2611126b3c4737c8fabffeae79f385fa623e61dcecfe39f5e2`, and SRI is `sha512-WL2f6Kfg5yT5nNf1p4//mLSajCnZttL/pDR3BISrFgSGtZd9DEJlnibq08ETz503n1wHIdCBcU/ICMPG9K4vOw==`. Frozen-candidate, GitHub Release, and npm Registry copies are byte-identical; an isolated Node 24 install passed Host `name`/`apply` and client `id` smoke checks. `npm audit signatures` confirmed verified Registry signatures for 11 packages and verified attestations for 2 packages; this package's public metadata exposes 1 Registry signature and 2 attestations, and provenance binds `release.yml`, `v1.0.0`, the release commit, and publish run exactly.
137
+ - Exact npm version described by this README: [dsh-grok-provider@1.0.2](https://www.npmjs.com/package/dsh-grok-provider/v/1.0.2)
138
+ - Current GitHub release with completed readback: [v1.0.2](https://github.com/yoshino-xiao7/dsh-grok-provider/releases/tag/v1.0.2)
139
+ - Release evidence: release commit `be200f9352afe93b27dd2856d89c01674f0cd637`, annotated tag object `b7efd3aabb99c73e1747d2d87890cdf9b284c438` peeling to that commit, final CI run [`33318426571`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33318426571), and Trusted Publisher run [`33319150964` attempt 1](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33319150964/attempts/1). The repository owner explicitly authorized the unique 74-file artifact, which is 255,282 bytes packed and 789,962 bytes unpacked; SHA-1 is `3feddb7048fe4c796037804518999b12ae491802`, SHA-256 is `010a21770cb3e4e42b7195984df1f5bf8dc5027066198cf99b7d713ac045f605`, and SRI is `sha512-TcvvPUXBJZEA728pVnUrXSZebGfIoB5ATG5041wA1OFzOE+hFTO98C5Fxl99WuFW2y7V89gkusYIKCpGlLNQIg==`. The frozen candidate, GitHub Release asset, and npm Registry tarball are byte-identical, and npm confirms that `dsh-grok-provider@1.0.2` is installable and `latest=1.0.2`. A locked Registry install under Node `24.19.0` / npm `11.5.1` passed Host registration/`apply`/injection and client registration/factory/`apply`/injection smoke checks with zero production vulnerabilities. `npm audit signatures` confirmed verified Registry signatures for 11 packages and verified attestations for 2 packages; this package's public metadata exposes 1 Registry signature and 2 attestations, while SLSA provenance exactly binds `release.yml`, `refs/tags/v1.0.2`, the release commit, and publish run.
140
+ - npm page documentation correction: the `1.0.1` tarball retained an older installation example; the README in the published `1.0.2` tarball uses the exact `@1.0.2` command. Published `1.0.1` bytes are not replaced.
140
141
  - GitHub community discovery: the repository carries the DeepSeek Harness-recommended `dsh-plugin` and `dsh` topics
141
142
  - YukiRyou managed source: [deepseek-yukiryou-plugin-catalog](https://github.com/yoshino-xiao7/deepseek-yukiryou-plugin-catalog), still pinned to the real-device-accepted `dsh-grok-provider@0.1.0` and marking only `darwin-arm64`
142
143
 
@@ -144,13 +145,22 @@ Directory inclusion is not an endorsement by xAI or DeepSeek Harness. [Listing P
144
145
 
145
146
  ## Compatibility and scope
146
147
 
147
- ### `1.0.1` candidate repair boundary
148
+ ### `1.0.2` repair boundary
149
+
150
+ - An ordinary strictly empty reasoning item retains the existing ID/type, sequence, output-index, status, empty summary/content, size, optional encrypted-content, and closure checks. A same-ID Search-backed reuse additionally retains exact own-data key and accessor rejection. This release does not expand the accepted protocol domain.
151
+ - The Provider delays creating a Harness reasoning block until the first non-empty summary/raw delta, then emits the existing delta and block-end sequence. A lifecycle that remains empty produces no visible reasoning chunk.
152
+ - Multiple non-empty reasoning items remain separate in output-index order. Text, tool calls, usage, finish reasons, visible non-empty reasoning replay, Search replay suppression, and fail-closed behavior are unchanged. A hidden ordinary empty item occupies no visible block/replay alignment slot, so its validated bounded encrypted content is not persisted.
153
+ - The exact Node `24.19.0` local gate reports 265 tests, 263 pass, 0 fail, and 2 platform skips; production audit reports zero vulnerabilities. Final release commit `be200f9352afe93b27dd2856d89c01674f0cd637` for the 74-file artifact and final CI run [`33318426571`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33318426571) pass on macOS 14 and Windows 2022. Unique-artifact authorization, isolated installation, Registry, signature, attestation, and provenance readback are complete.
154
+ - The repair affects new responses after upgrading; empty `Think` rows already persisted in older conversations are not rewritten.
155
+ - Search settings, models, authentication, images, fixed endpoints, citation/URL handling, and the Harness tool-permission boundary are unchanged. This is not real-device Windows browser-login acceptance.
156
+
157
+ ### `1.0.1` repair boundary
148
158
 
149
159
  - The cause is not the model, account, Search response shape, or a 42-tool total. It is the coexistence of a same-name Harness function definition with `{ type: "web_search" }` / `{ type: "x_search" }` when server Search is enabled; the fixed Proxy returns HTTP 400 for that combination.
150
160
  - The compiler fully validates all 40 source functions before omitting only wire definitions that collide with an enabled server Search tool. Local tools remain unchanged when the corresponding setting is off, and historical `function_call` / `function_call_output` items are neither deleted nor renamed.
151
161
  - The final request receipt rejects every function/server-tool name intersection. The SSE parser preserves source transport errors, so HTTP 400 maps to `PROVIDER_ERROR` while genuine SSE/protocol faults remain `INVALID_RESPONSE`.
152
162
  - One explicitly authorized redacted real-account replay used the original failing X-session structure: 8 messages, 40 source functions, 38 wire functions + 2 server tools, with 2 historical reserved-name calls preserved. Exactly 1 models GET and 1 Responses POST yielded 314 events and `response.completed`. No message/response text, URL, identity, or credential was retained.
153
- - The exact Node `24.19.0` local suite reports 253 tests, 251 pass, 0 fail, and 2 platform skips; the production dependency audit reports zero vulnerabilities, an isolated-cache dry-run pack lists 73 files, and the secret-pattern scan finds only the explicit fixture canary and its checklist record. Code PR #31 push/PR CI, merge commit `0c60200e12c3b8455331f31a317ece9b1945c458`, and main CI run `33312621786` pass on macOS 14 and Windows 2022. This evidence still does not establish a fixed final release commit, frozen artifact, isolated installation, publication, supply-chain readback, or real-device Windows browser login. See [`docs/releases/v1.0.1.md`](docs/releases/v1.0.1.md) for candidate details.
163
+ - The exact Node `24.19.0` local suite reports 253 tests, 251 pass, 0 fail, and 2 platform skips; the production dependency audit reports zero vulnerabilities, an isolated-cache dry-run pack lists 73 files, and the secret-pattern scan finds only the explicit fixture canary and its checklist record. Code PR #31, main CI run `33312621786`, the final release commit, dual-platform final CI, unique authorized artifact, isolated installation, Registry, signatures, attestations, and provenance readback are complete. This evidence still does not establish real-device Windows browser login. See [`docs/releases/v1.0.1.md`](docs/releases/v1.0.1.md) for details.
154
164
 
155
165
  ### `1.0.0` repair boundary
156
166
 
@@ -161,12 +171,12 @@ Directory inclusion is not an endorsement by xAI or DeepSeek Harness. [Listing P
161
171
  - Two-layer redacted real-account verification passed against the final source: raw Web/X probes each completed one 64-event response, observed the requested Search kind, and reached `completed`; the production adapter completed 5 Responses calls, with direct Web/X both ending in `stop` and a Harness-shaped local `x_search` call/result continuation ending `tool-calls`, `tool-calls`, then `stop`, with one local call in each of the first two turns. That continuation did not place a Harness `x_search` function definition beside an xAI `{ type: "x_search" }` server descriptor in the same wire request; `1.0.1` later isolated that combination as an HTTP 400 conflict. No results, URLs, prompts, identity, or credentials were retained; this is not publication, OAuth, or real-device Windows evidence.
162
172
  - The manifest and lockfile are synchronized at `1.0.0`; the Node 24 suite reports 245 tests, 243 pass, 0 fail, and 2 platform skips. Production audit reports zero vulnerabilities, and the deterministic build/bundle comparison, 72-entry dry-run pack, secret scan, and diff check pass. Code PR #28, main CI run [`33308371009`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33308371009), the final release commit, dual-platform final CI, unique artifact, exact authorization, and Registry/signature/attestation/provenance readback are complete.
163
173
 
164
- | Item | Published `1.0.0` status |
174
+ | Item | Published `1.0.2` compatibility boundary |
165
175
  | --- | --- |
166
176
  | DeepSeek Harness | Exact support for `0.1.1-rc.2` |
167
177
  | Node.js | `>=24.19.0` |
168
- | macOS arm64 | Image sending has real-Harness confirmation; focused `1.0.0` regressions, the redacted Search probes, final macOS 14 CI, and unique-artifact acceptance all pass |
169
- | Windows x64 | Final `1.0.0` Windows 2022 CI and existing slow fakes pass. On a reachable network the official CLI generates the URL and opens the browser, and that path still lacks real-device Windows acceptance |
178
+ | macOS arm64 | Image sending has real-Harness confirmation; `1.0.2` only changes the visible projection of strictly empty reasoning |
179
+ | Windows x64 | The code path and existing slow fakes are unchanged. On a reachable network the official CLI generates the URL and opens the browser, and that path still lacks real-device Windows acceptance |
170
180
  | macOS x64 / Linux | Unsupported |
171
181
  | Grok CLI | No full-version lock; official path, `login --oauth` capability, and production OIDC credential contract are enforced |
172
182
  | Models | Every account catalog model whose backend has a strict codec in this release |
@@ -281,6 +291,8 @@ Read the [contributing guide](CONTRIBUTING.md) before filing an issue or PR. Cha
281
291
  - [x] Publish `0.1.10`: `llm-grok` registration, per-call capture, unique artifact, dual-platform CI, signatures, and provenance are complete
282
292
  - [x] Publish `0.1.11`: repair High Effort + Web Search reasoning-lifecycle compatibility; the unique artifact, final dual-platform CI, exact authorization, Registry, signatures, attestations, and provenance readback are complete
283
293
  - [x] Publish `1.0.0`: repair multiple strictly empty reasoning-ID reuses and completed Web Search `open_page` actions; the unique artifact, final dual-platform CI, exact authorization, Registry, signatures, attestations, and provenance readback are complete
294
+ - [x] Publish `1.0.1`: repair HTTP 400 conflicts between server Search and same-name Harness function definitions while preserving true transport-error classification; the unique artifact, final dual-platform CI, exact authorization, Registry, signatures, attestations, and provenance readback are complete
295
+ - [x] Publish `1.0.2`: hide contentless `Think` projections for strictly empty reasoning while preserving protocol validation and output-index order; the unique artifact, final dual-platform CI, exact authorization, Registry, signatures, attestations, and provenance readback are complete
284
296
  - [ ] A subsequent slice: opt-in image generation (inline results only, committed through Harness attachments)
285
297
  - [ ] Complete independent Windows x64 acceptance and publish a later stable fix if needed
286
298
 
package/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  让 DeepSeek Harness 使用你已登录的官方 Grok Build 账号:动态模型发现、流式推理、图片输入、可选 Web/X Search、工具调用,以及账号额度与模型能力面板。
6
6
 
7
- > 非官方社区项目,与 xAI 或 DeepSeek Harness 官方无隶属关系。当前稳定版及 npm Registry 的 `latest` 均为 `1.0.0`。源码正在准备尚未发布的 `1.0.1` 修复候选;`0.1.8` 曾发布后撤回且版本号不可复用。
7
+ > 非官方社区项目,与 xAI 或 DeepSeek Harness 官方无隶属关系。本说明对应 `dsh-grok-provider@1.0.3` 制品;`0.1.8` 曾发布后撤回且版本号不可复用。
8
8
 
9
- 当前源码候选版为 `1.0.1`;npm Registry 的 `latest` 为 `1.0.0`。在 `1.0.1` 制品冻结、另行获得精确发布授权并完成 Registry 回读前,请继续安装 `1.0.0`。
9
+ `1.0.3` 修复两类真实运行中断:流开始前遇到 401/403 时,通过官方 Grok CLI 进行一次有界会话刷新并仅重试一次;流已开始后绝不重放。若连接中断前只收到安全的文本/reasoning,Provider 会保留已收到内容并提示用户发送“继续”;一旦出现工具调用、未知事件或协议异常,仍严格失败关闭。
10
10
 
11
- `1.0.1` 候选修复另一类真实 Search 失败:启用 xAI server `web_search` / `x_search` 时,Harness 同名 function definitions 与 server tools 共存会被固定 Proxy 以 HTTP 400 拒绝。候选先完整验证全部 functions,再只过滤已启用的同名 wire definition;历史 function calls/results 保留。SSE 层也会透传 transport error,使 HTTP 400 显示为 `PROVIDER_ERROR`,而不是误报 `INVALID_RESPONSE`。
11
+ 本 README 随 `1.0.3` 一起进入 npm tarball,下面的精确安装命令也固定为 `1.0.3`。上一份已完成供应链回读的版本为 `1.0.2`。
12
12
 
13
13
  ## 它解决什么问题
14
14
 
@@ -19,7 +19,7 @@
19
19
  | 模型 | 运行时读取账号可见的全部 Grok Build 模型,不维护静态模型白名单 |
20
20
  | 对话 | Responses 流式文本、reasoning、加密 reasoning replay、usage 与 finish reason |
21
21
  | 图片 | 仅精确 `grok-4.6` 接收 Harness attachment 中有界的 JPEG/PNG 图片;`grok-4.5` 与其他模型保持 text-only |
22
- | 搜索 | 已发布 `1.0.0` 为精确 `grok-4.6` 提供默认关闭的 Web/X Search;`1.0.1` 候选解决 server Search 与 Harness 同名 function definition 的 HTTP 400 冲突 |
22
+ | 搜索 | 精确 `grok-4.6` 提供默认关闭的 Web/X Search;`1.0.3` 增加流前认证恢复与安全的部分输出保留,不自动重放已开始的流 |
23
23
  | 工具 | 将 function call 交回 Harness 权限层;Provider 本身不执行工具,关闭对应 Search 开关时保留本地 `web_search` / `x_search` |
24
24
  | 账户面板 | 登录状态、每周/月额度、重置时间、动态模型能力与 reasoning 档位 |
25
25
  | 界面 | Web 设置页中英文切换;TUI 提供闭合的 `/grok` 命令 |
@@ -44,10 +44,10 @@ grok models
44
44
 
45
45
  ### 2. 安装 Provider
46
46
 
47
- 从 npm 安装已发布并完成 Registry 回读的精确版本:
47
+ 安装精确版本:
48
48
 
49
49
  ```sh
50
- dsh plugin --profile web add dsh-grok-provider@1.0.0
50
+ dsh plugin --profile web add dsh-grok-provider@1.0.3
51
51
  dsh web
52
52
  ```
53
53
 
@@ -134,9 +134,10 @@ dsh web
134
134
 
135
135
  ## 项目来源与发现
136
136
 
137
- - npm 当前稳定版:[dsh-grok-provider@1.0.0](https://www.npmjs.com/package/dsh-grok-provider/v/1.0.0)(唯一制品、双平台 CI、签名、attestations 与 provenance 已验证)
138
- - GitHub 最近发行版与校验值:[v1.0.0](https://github.com/yoshino-xiao7/dsh-grok-provider/releases/tag/v1.0.0)
139
- - 发布证据:release commit `c6548199582b122f1d285422eabea0205eaf602f`,annotated tag object `192561cda1ac58cbc4077f0de8fa614dff9a5557` peel 至该提交,final CI run [`33308603394`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33308603394),Trusted Publisher run [`33309083806` attempt 1](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33309083806/attempts/1)。仓库所有者明确授权的唯一 tarball 含 72 个文件、226,704 bytes,unpacked size 715,014 bytes;SHA-1 为 `50e5d898dba241d1e19def7705db216e3060b892`,SHA-256 为 `30cd83dad77f7d2611126b3c4737c8fabffeae79f385fa623e61dcecfe39f5e2`,SRI 为 `sha512-WL2f6Kfg5yT5nNf1p4//mLSajCnZttL/pDR3BISrFgSGtZd9DEJlnibq08ETz503n1wHIdCBcU/ICMPG9K4vOw==`。冻结候选、GitHub Release 与 npm Registry 制品逐字节一致;Node 24 Registry 隔离安装的 Host `name`/`apply` 与 client `id` smoke 通过。`npm audit signatures` 确认安装图中 11 个包具有已验证 Registry 签名、2 个包具有已验证 attestations;本包公开 metadata 包含 1 个 Registry signature、2 个 attestations,provenance 精确绑定 `release.yml`、`v1.0.0`、release commit 与 publish run。
137
+ - 本说明对应的 npm 精确版本:[dsh-grok-provider@1.0.2](https://www.npmjs.com/package/dsh-grok-provider/v/1.0.2)
138
+ - 当前已完成回读的 GitHub Release:[v1.0.2](https://github.com/yoshino-xiao7/dsh-grok-provider/releases/tag/v1.0.2)
139
+ - 发布证据:release commit `be200f9352afe93b27dd2856d89c01674f0cd637`,annotated tag object `b7efd3aabb99c73e1747d2d87890cdf9b284c438` peel 至该提交,final CI run [`33318426571`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33318426571),Trusted Publisher run [`33319150964` attempt 1](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33319150964/attempts/1)。仓库所有者明确授权的唯一 tarball 含 74 个文件、255,282 bytes,unpacked size 789,962 bytes;SHA-1 为 `3feddb7048fe4c796037804518999b12ae491802`,SHA-256 为 `010a21770cb3e4e42b7195984df1f5bf8dc5027066198cf99b7d713ac045f605`,SRI 为 `sha512-TcvvPUXBJZEA728pVnUrXSZebGfIoB5ATG5041wA1OFzOE+hFTO98C5Fxl99WuFW2y7V89gkusYIKCpGlLNQIg==`。冻结候选、GitHub Release asset 与 npm Registry tarball 逐字节一致,npm 确认 `dsh-grok-provider@1.0.2` 可安装且 `latest=1.0.2`;Node `24.19.0` / npm `11.5.1` 的 Registry 锁定隔离安装通过 Host 注册/`apply`/注入与 client 注册/factory/`apply`/注入 smoke,生产依赖审计为 0 漏洞。`npm audit signatures` 确认安装图中 11 个包具有已验证 Registry 签名、2 个包具有已验证 attestations;本包公开 metadata 包含 1 个 Registry signature、2 个 attestations,SLSA provenance 精确绑定 `release.yml`、`refs/tags/v1.0.2`、release commit 与 publish run。
140
+ - npm 页面文档修正:`1.0.1` tarball 内曾保留旧安装示例;已发布的 `1.0.2` tarball 内,本 README 使用精确 `@1.0.2` 命令。已发布的 `1.0.1` 字节不会被覆盖。
140
141
  - GitHub 社区发现:仓库已添加 DeepSeek Harness 官方推荐的 `dsh-plugin` 与 `dsh` Topics
141
142
  - YukiRyou 受管来源:[deepseek-yukiryou-plugin-catalog](https://github.com/yoshino-xiao7/deepseek-yukiryou-plugin-catalog),当前仍锁定已完成真机验收的 `dsh-grok-provider@0.1.0`,且只标记 `darwin-arm64`
142
143
 
@@ -144,13 +145,22 @@ dsh web
144
145
 
145
146
  ## 兼容性与范围
146
147
 
147
- ### `1.0.1` 候选修复边界
148
+ ### `1.0.2` 修复边界
149
+
150
+ - 普通严格空 reasoning item 继续执行既有 ID/type、sequence、output index、状态、summary/content 空性、大小、可选 encrypted content 与闭合校验;Search-backed 同 ID 复用项继续额外执行精确 own-data 键集与 accessor 拒绝。本版没有扩大协议接受域。
151
+ - Provider 延迟创建 Harness reasoning block,只有收到首个非空 summary/raw delta 才发送 `block-start`,随后按原顺序发送 delta 和 `block-end`。完整生命周期最终为空时产生零个可见 reasoning chunk。
152
+ - 多个非空 reasoning item 继续按 output index 保持独立块;正文、工具调用、usage、finish reason、可见非空 reasoning replay、Search 后 replay 抑制和失败关闭行为不变。被隐藏的普通空 item 不占可见 block/replay 对齐槽,其有界 encrypted content 通过校验后不持久化。
153
+ - 精确 Node `24.19.0` 本地门禁为 265 tests、263 pass、0 fail、2 platform skips;生产依赖审计 0 漏洞,74 文件制品的 final release commit `be200f9352afe93b27dd2856d89c01674f0cd637` 与 final CI run [`33318426571`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33318426571) 已在 macOS 14 / Windows 2022 全绿。唯一授权制品、隔离安装、Registry、签名、attestations 与 provenance 回读均已完成。
154
+ - 修复只影响升级后的新回复;旧会话中已经持久化的空 `Think` 行不会被回写删除。
155
+ - 本版不改变 Search 开关、模型、认证、图片、固定 endpoint、citation/URL 或 Harness 工具权限边界,也不构成 Windows 真机浏览器登录验收。
156
+
157
+ ### `1.0.1` 修复边界
148
158
 
149
159
  - 根因不是模型、账号、Search 响应形状或 42 项工具总数,而是启用 server Search 时,同名 Harness function definition 与 `{ type: "web_search" }` / `{ type: "x_search" }` 共存;固定 Proxy 对该组合返回 HTTP 400。
150
160
  - 编译器先完整验证 40 个源 functions,再仅过滤与已启用 server Search 同名的 wire definitions。关闭对应开关时,本地工具保持原样;已有会话中的历史 `function_call` / `function_call_output` 也不删除或改名。
151
161
  - 最终 request receipt 拒绝 function/server-tool 名称交集;SSE parser 保留 source transport error,HTTP 400 因而映射到 `PROVIDER_ERROR`,真正的 SSE/协议错误仍为 `INVALID_RESPONSE`。
152
162
  - 一次经明确授权的脱敏真实账号回放使用原失败 X 会话结构:8 条 messages、40 个 source functions、wire 38 functions + 2 server tools、保留 2 个历史 reserved-name calls;只执行 1 次 models GET 和 1 次 Responses POST,接收 314 events 并以 `response.completed` 闭合。未保存消息/回复正文、URL、身份或凭据。
153
- - 精确 Node `24.19.0` 本地全量门禁为 253 tests、251 pass、0 fail、2 platform skips;生产依赖审计为 0 漏洞,隔离 cache 的 dry-run pack 列出 73 个文件,秘密模式扫描只命中显式 fixture canary 及其检查表记录。代码 PR #31 的 push/PR CI、merge commit `0c60200e12c3b8455331f31a317ece9b1945c458` 及 main CI run `33312621786` 已在 macOS 14 / Windows 2022 全绿。上述证据仍不代表最终 release commit、冻结制品、隔离安装、发布、供应链回读或 Windows 真机浏览器登录已经完成。候选详情见 [`docs/releases/v1.0.1.md`](docs/releases/v1.0.1.md)。
163
+ - 精确 Node `24.19.0` 本地全量门禁为 253 tests、251 pass、0 fail、2 platform skips;生产依赖审计为 0 漏洞,隔离 cache 的 dry-run pack 列出 73 个文件,秘密模式扫描只命中显式 fixture canary 及其检查表记录。代码 PR #31、main CI run `33312621786`、最终 release commit、双平台 final CI、唯一授权制品、隔离安装、Registry、签名、attestations 与 provenance 回读均已完成;这些证据仍不代表 Windows 真机浏览器登录已经完成。详情见 [`docs/releases/v1.0.1.md`](docs/releases/v1.0.1.md)。
154
164
 
155
165
  ### `1.0.0` 修复边界
156
166
 
@@ -161,12 +171,12 @@ dsh web
161
171
  - 最终源码完成两层脱敏真实账号复验:原始 Web/X 协议探针各 1 次请求、各 64 events,分别观察到对应 Search 且终态 `completed`;生产 adapter 共完成 5 次 Responses,direct Web/X 均为 `stop`,Harness 形状的本地 `x_search` call/result 续跑三轮依次为 `tool-calls`、`tool-calls`、`stop`,前两轮各 1 次本地调用。该续跑没有在同一 wire request 中同时放入 Harness `x_search` function definition 与 xAI `{ type: "x_search" }` server descriptor;`1.0.1` 后续才隔离出这一 HTTP 400 冲突。未保存结果、URL、prompt、身份或凭据;这些不是发布、OAuth 或 Windows 真机证据。
162
172
  - manifest/lock 已同步为 `1.0.0`;Node 24 全量测试为 245 项、243 pass、0 fail、2 项平台跳过,生产依赖审计为 0 漏洞,确定性 build/bundle、72 项 dry-run pack、秘密模式扫描与 diff 检查均通过。代码 PR #28、main CI run [`33308371009`](https://github.com/yoshino-xiao7/dsh-grok-provider/actions/runs/33308371009)、最终 release commit、双平台 final CI、唯一制品、精确授权及 Registry/signature/attestation/provenance 回读均已完成。
163
173
 
164
- | 项目 | `1.0.0` 已发布状态 |
174
+ | 项目 | `1.0.2` 已发布兼容边界 |
165
175
  | --- | --- |
166
176
  | DeepSeek Harness | 精确支持 `0.1.1-rc.2` |
167
177
  | Node.js | `>=24.19.0` |
168
- | macOS arm64 | 图片发送已完成真实 Harness 验证;`1.0.0` 聚焦回归、脱敏真实 Search 探针、final macOS 14 CI 与唯一制品验收均通过 |
169
- | Windows x64 | `1.0.0` final Windows 2022 CI 与现有 slow-fake 通过;网络可达时由官方 CLI 生成 URL 并打开浏览器,该路径仍未完成 Windows 真机验收 |
178
+ | macOS arm64 | 图片发送已完成真实 Harness 验证;`1.0.2` 只调整严格空 reasoning 的可见投影 |
179
+ | Windows x64 | 代码路径与现有 slow-fake 保持不变;网络可达时由官方 CLI 生成 URL 并打开浏览器,该路径仍未完成 Windows 真机验收 |
170
180
  | macOS x64 / Linux | 不支持 |
171
181
  | Grok CLI | 不锁完整版本;严格校验官方路径、`login --oauth` 能力与生产 OIDC 凭据契约 |
172
182
  | 模型 | 当前账号目录中 backend 已被严格 codec 支持的全部模型 |
@@ -281,6 +291,8 @@ npm run pack:check
281
291
  - [x] 发布 `0.1.10`:`llm-grok` 注册、按调用读取设置、唯一制品、双平台 CI、签名与 provenance 已完成
282
292
  - [x] 发布 `0.1.11`:修复 High Effort + Web Search reasoning 生命周期兼容;唯一制品、双平台 final CI、精确授权、Registry、签名、attestations 与 provenance 回读均已完成
283
293
  - [x] 发布 `1.0.0`:修复多次严格空 reasoning ID 复用和完成态 Web Search `open_page` action;唯一制品、双平台 final CI、精确授权、Registry、签名、attestations 与 provenance 回读均已完成
294
+ - [x] 发布 `1.0.1`:修复 server Search 与 Harness 同名 function definition 的 HTTP 400 冲突,并保留真实 transport error 分类;唯一制品、双平台 final CI、精确授权、Registry、签名、attestations 与 provenance 回读均已完成
295
+ - [x] 发布 `1.0.2`:隐藏严格空 reasoning 的无内容 `Think` 投影,同时保持协议校验与 output-index 顺序;唯一制品、双平台 final CI、精确授权、Registry、签名、attestations 与 provenance 回读均已完成
284
296
  - [ ] 再后续独立切片:默认关闭的图片生成(只收内联结果,提交 Harness attachment)
285
297
  - [ ] 完成 Windows x64 独立真机验收并按需发布后续稳定修复版
286
298
 
package/SECURITY.md CHANGED
@@ -4,11 +4,15 @@
4
4
 
5
5
  ## 支持范围
6
6
 
7
- 本安全策略对应当前稳定版 `1.0.0`,npm Registry 的 `latest` 也指向 `1.0.0`。最终 release commit 为 `c6548199582b122f1d285422eabea0205eaf602f`;annotated tag object `192561cda1ac58cbc4077f0de8fa614dff9a5557` peel 到该提交,final CI run `33308603394` 双平台全绿,Trusted Publisher run `33309083806` attempt 1 发布了仓库所有者明确授权的唯一 72 文件制品。该 tarball 为 226,704 bytes,unpacked size 715,014 bytes,SHA-1 为 `50e5d898dba241d1e19def7705db216e3060b892`,SHA-256 为 `30cd83dad77f7d2611126b3c4737c8fabffeae79f385fa623e61dcecfe39f5e2`,SRI 为 `sha512-WL2f6Kfg5yT5nNf1p4//mLSajCnZttL/pDR3BISrFgSGtZd9DEJlnibq08ETz503n1wHIdCBcU/ICMPG9K4vOw==`;冻结候选、GitHub Release 与 npm Registry 字节一致。Node 24 Registry 隔离安装的 Host `name`/`apply` 与 client `id` smoke 通过;`npm audit signatures` 确认安装图中 11 个包具有已验证 Registry 签名、2 个包具有已验证 attestations,本包公开 metadata 包含 1 个 Registry signature、2 个 attestations,provenance 精确绑定 `release.yml`、`v1.0.0`、release commit 与 publish run。`0.1.8` 曾发布后撤回且版本号不可复用。DeepSeek Harness、Node.js 与操作系统按发布线明确维护;网络可达 Windows 真机外部浏览器弹出仍未验收。
7
+ 本安全策略对应 `dsh-grok-provider@1.0.3` 制品。它只在 200/SSE 开始前为 401/403 增加一次官方 CLI 会话刷新与同请求重试;同一凭据版本的并发拒绝共享一次刷新。流开始后绝不自动重放。只有已投影且有界的 text/reasoning 可在无工具调用、未知 chunk、协议异常或用户取消时被保留并附加中断提示;其他情况继续失败关闭。协议接受域、固定 origin、refresh-token 隔离、Search、模型、图片、工具和 URL 边界均不放宽。`0.1.8` 曾发布后撤回且版本号不可复用;网络可达 Windows 真机外部浏览器弹出仍未验收。
8
+
9
+ `1.0.3` 不把 HTTP 401/403 解释为 API Key 模式,也不自行刷新 OAuth grant:固定且有界的官方 `grok models` 子进程拥有刷新行为,插件随后重新读取并严格校验共享凭据。第二次拒绝仍为 `AUTH`。SSE source 的无状态 transport failure 和干净过早 EOF 与畸形事件分开;只有前两者能进入安全部分输出保留,status-bearing transport error、工具调用和所有 `INVALID_RESPONSE` 均不得被吞掉。部分内容不生成 replay metadata,提示不包含上游错误正文。
8
10
 
9
11
  `1.0.0` 把 reasoning ID 复用收窄为 Search-backed 且严格空的完整生命周期:可见 summary/content 及 summary/raw lifecycle 必须为空,允许有界 opaque `encrypted_content`;每次复用都必须到达自己的 `response.output_item.done`,仅当 `response.incomplete` 到来时仍有复用段未闭合才失败关闭,所有复用段闭合后的 `max_output_tokens` 终态仍有效。非空、跨类型、未知 terminal 字段或 accessor 字段继续拒绝。完成态 Web Search `open_page` 只允许精确且有界的 `type + url`,streamed/final action 的类型与 URL 必须一致,校验后 URL 被丢弃且不会被访问、预览、下载或回放。脱敏真实账号复验未保存结果、URL、prompt、身份或凭据;供应链回读也不构成 OAuth、完整桌面会话或 Windows 真机浏览器验收。
10
12
 
11
- 当前 npm Registry `latest` 与稳定发布版均为 `1.0.0`;源码 manifest/lock 已进入尚未发布的 `1.0.1` 候选。候选在启用 server Search 时先完整验证全部 Harness functions,再只从最终 wire definitions 过滤与已启用 `web_search` / `x_search` 精确同名的 callable definition;历史 function call/result 保留,关闭对应开关时本地 function 保留。request 与 decoder receipt 都拒绝 function/server-tool 名称交集。SSE source transport error 原样上抛并保持既有认证、限流、中止与 `PROVIDER_ERROR` 映射,只有 framing、JSON 或协议错误归类为 `INVALID_RESPONSE`;失败后不自动降级或重放 POST。一次授权的脱敏原失败会话结构回放已完成,但没有保存正文、URL、身份、凭据或原始响应,也不构成制品、CI、发布或 Windows 真机浏览器登录证据。
13
+ `1.0.1` 已完成同名 function/server-tool 冲突、receipt 和 transport 错误归因修复及其独立供应链回读。`1.0.2` 不改变这些 request 或错误规则:普通空 reasoning 在决定“不可见”前继续执行既有 ID/type、sequence、output-index、状态、summary/content 空性、大小、可选 encrypted-content 与 terminal 闭合校验;Search-backed 同 ID 复用继续额外执行精确 own-data 键集与 accessor 拒绝。非空复用、乱序和未闭合复用项继续归类为 `INVALID_RESPONSE`。隐藏的普通空项不占 replay 对齐槽,其有界 encrypted content 校验后不持久化;server Search 仍不投影为本地工具。
14
+
15
+ `1.0.2` 的发布回读已关闭:最终 release commit `be200f9352afe93b27dd2856d89c01674f0cd637`,annotated tag object `b7efd3aabb99c73e1747d2d87890cdf9b284c438`,macOS 14 / Windows 2022 final CI run `33318426571`,Trusted Publisher run `33319150964` attempt 1。仓库所有者明确授权的唯一 74 文件制品为 255,282 bytes packed / 789,962 bytes unpacked,SHA-1 `3feddb7048fe4c796037804518999b12ae491802`、SHA-256 `010a21770cb3e4e42b7195984df1f5bf8dc5027066198cf99b7d713ac045f605`、SRI `sha512-TcvvPUXBJZEA728pVnUrXSZebGfIoB5ATG5041wA1OFzOE+hFTO98C5Fxl99WuFW2y7V89gkusYIKCpGlLNQIg==`;冻结候选、GitHub Release asset 与 npm Registry tarball 逐字节一致,npm `latest=1.0.2`。锁定隔离安装、本包 1 个 Registry signature / 2 个 package attestations、安装图 11 个 signed / 2 个 attested packages,以及精确绑定 `release.yml` / `refs/tags/v1.0.2` / release commit / publish run 的 SLSA provenance 均已验证。候选源码的真实账号验收只保留 Web `5/1/0/1/1` 与 X `3/1/0/1/1` 的 Search/non-empty-reasoning/empty-reasoning/non-empty-text/finish 计数;不保存内容、URL、身份、凭据或原始响应。上述证据均不构成 OAuth、完整桌面会话或网络可达 Windows 真机外部浏览器弹出验收。
12
16
 
13
17
  `0.1.11` 沿用已发布版本的图片边界:只为精确 `grok-4.6` 提供有界图片输入;`grok-4.5` 与所有其他模型保持 text-only。普通 user/system 历史中的私有 reasoning 会被省略并保留相邻可见 text/image;只有有效的同 Provider assistant 历史可进入加密 reasoning replay,一层 tool-result 仍只接受公开 text/image。图片只能来自 Harness attachment service 的已验证 JPEG/PNG 投影,以 `detail:"high"` 发送,并受单图字节、像素、边长、数量、总字节与最终 JSON 上限约束;URL、路径、file ID 和调用方预制 data URL 都会被拒绝。
14
18
 
@@ -42,8 +46,8 @@
42
46
 
43
47
  ---
44
48
 
45
- Release security note: `1.0.0` accepts only complete Search-backed strictly empty reasoning reuse (empty visible summary/content and no summary/raw lifecycle, with bounded opaque `encrypted_content` allowed) and exact bounded completed `open_page` type/URL pairs whose streamed and final values agree. Every reuse requires its own `response.output_item.done`; an open/incomplete reused lifecycle, non-empty or cross-type reuse, unknown terminal fields, and accessor-backed Search items or response containers fail closed. A later max-token response remains valid after every reused lifecycle has closed. Redacted probes retained no results, URLs, prompts, identity, or credentials. Release commit `c6548199582b122f1d285422eabea0205eaf602f`, final CI run `33308603394`, the unique artifact, explicit authorization, Trusted Publisher run `33309083806` attempt 1, Registry integrity, signatures, attestations, and provenance are verified.
49
+ Release security note: the published `1.0.2` artifact changes visible reasoning projection and its aligned replay envelope. A reasoning lifecycle that remains strictly empty produces no Harness block, while the first non-empty summary/raw delta begins the same visible block lifecycle used previously. Ordinary empty items retain their existing validation, and Search-backed same-ID reuse retains exact own-data/accessor checks. A hidden ordinary empty item's validated encrypted content is not persisted because no visible replay-alignment slot exists. No authentication, model, image, fixed-origin, URL, permission, or protocol-acceptance boundary is expanded. Version-specific publication and supply-chain facts above come from completed Registry, GitHub Release, signature, attestation, and provenance readback.
46
50
 
47
- The current stable release and npm Registry `latest` are both `1.0.0`; the source manifest and lockfile now describe an unpublished `1.0.1` candidate. When server Search is enabled, the candidate fully validates every Harness function before omitting only callable definitions whose names exactly collide with enabled `web_search` / `x_search` server descriptors. Historical calls/results remain, local functions remain when the matching switch is off, and request/decoder receipts reject every function/server-tool intersection. SSE source transport errors retain their existing auth, rate-limit, abort, and `PROVIDER_ERROR` mappings; only framing, JSON, and protocol failures become `INVALID_RESPONSE`, and failures are never silently retried without Search. One authorized redacted replay of the original failing session structure completed without retaining text, URLs, identity, credentials, or raw responses. This is not artifact, CI, publication, or real-device Windows login evidence.
51
+ The `1.0.2` artifact retains the `1.0.1` function/server-tool collision and transport-error rules. An ordinary strictly empty lifecycle keeps the existing ID/type, sequence, output-index, status, empty summary/content, size, optional encrypted-content, and closure checks; a Search-backed same-ID reuse additionally keeps exact own-data key/accessor validation. Invalid reused content, ordering violations, and an open reused lifecycle at an incomplete terminal still fail closed; an ordinary non-reused partial item retains the existing max-token behavior. Visible non-empty replay and Search replay suppression remain unchanged, while a hidden ordinary empty item has no replay slot. Existing stored conversations are not rewritten, and this change does not establish real-device Windows browser login.
48
52
 
49
- English summary: GitHub Private vulnerability reporting is enabled and preferred. The current stable release and npm Registry `latest` are both `1.0.0`; version `0.1.8` was published and then withdrawn, and npm version numbers cannot be reused. Release commit `c6548199582b122f1d285422eabea0205eaf602f`, annotated tag object `192561cda1ac58cbc4077f0de8fa614dff9a5557`, final dual-platform CI run `33308603394`, and Trusted Publisher run `33309083806` attempt 1 bind the explicitly authorized unique 72-file artifact. The tarball is 226,704 bytes packed and 715,014 bytes unpacked, with SHA-1 `50e5d898dba241d1e19def7705db216e3060b892`, SHA-256 `30cd83dad77f7d2611126b3c4737c8fabffeae79f385fa623e61dcecfe39f5e2`, and SRI `sha512-WL2f6Kfg5yT5nNf1p4//mLSajCnZttL/pDR3BISrFgSGtZd9DEJlnibq08ETz503n1wHIdCBcU/ICMPG9K4vOw==`. Frozen-candidate, GitHub Release, and Registry copies are byte-identical; the isolated Node 24 Host/client smoke and `npm audit signatures` passed. Public metadata exposes 1 Registry signature and 2 attestations, and provenance exactly binds `release.yml`, `v1.0.0`, the release commit, and publish run. The release accepts only complete Search-backed strictly empty reasoning reuse and exact bounded completed `open_page` pairs, discards validated URLs without visiting them, and retains the fixed-origin, credential, settings, model, image, and platform boundaries. Network-reachable external-browser launch remains unverified on a physical Windows device. Search results and citations remain untrusted remote data. Never send credentials, identity data, prompts, tool arguments, cookies, image bytes, Search contents, or unreviewed diagnostics.
53
+ English summary: GitHub Private vulnerability reporting is enabled and preferred. This policy describes the published `1.0.2` artifact, which suppresses the visible block for a reasoning lifecycle that remains strictly empty. The first non-empty summary/raw delta starts the existing block lifecycle in output-index order. Ordinary empty items retain their existing validation; Search-backed same-ID reuse retains exact key/accessor rejection; invalid, out-of-order, or incomplete responses with an open reused lifecycle still fail closed. Hidden ordinary empty items have no replay slot, while visible non-empty replay and Search suppression remain unchanged. Ordinary non-reused partial items retain the existing max-token behavior. The final release commit, tag object, CI and Trusted Publisher runs, byte-identical frozen/Release/Registry tarballs, Registry metadata, signatures, attestations, isolated installation, and SLSA provenance have all been read back for `1.0.2`; these supply-chain facts do not prove OAuth, complete live desktop sessions, or real-device Windows browser launch. Version `0.1.8` was published and withdrawn and cannot be reused. Fixed-origin, credential, settings, Search, model, image, URL, permission, and platform boundaries remain unchanged. Network-reachable external-browser launch is still unverified on a physical Windows device. Search results and citations remain untrusted remote data. Never send credentials, identity data, prompts, tool arguments, cookies, image bytes, Search contents, or unreviewed diagnostics.
@@ -34,104 +34,132 @@ export function createCredentialSource({ contract, load, now, refresh }) {
34
34
  throw new TypeError("Invalid credential source dependencies")
35
35
  }
36
36
  let activeRefresh
37
+ let refreshRevision = 0
37
38
 
38
39
  const refreshOnce = async () => {
39
40
  if (activeRefresh === undefined) {
40
- activeRefresh = Promise.resolve().then(refresh).finally(() => {
41
- activeRefresh = undefined
42
- })
41
+ activeRefresh = Promise.resolve()
42
+ .then(refresh)
43
+ .then((result) => {
44
+ refreshRevision += 1
45
+ return result
46
+ })
47
+ .finally(() => {
48
+ activeRefresh = undefined
49
+ })
43
50
  }
44
51
  return activeRefresh
45
52
  }
46
53
 
47
- return Object.freeze({
48
- async withAccessToken(operation) {
49
- if (typeof operation !== "function") {
50
- throw new TypeError("Access-token operation must be a function")
51
- }
54
+ const withAccessToken = async (operation, recoveryAllowed) => {
55
+ if (typeof operation !== "function") {
56
+ throw new TypeError("Access-token operation must be a function")
57
+ }
52
58
 
53
- let raw
54
- let rawText
55
- let parsed
56
- let accessToken
57
- let metadata
58
- let refreshAttempted = false
59
-
60
- try {
61
- while (accessToken === undefined) {
62
- try {
63
- raw = await load()
64
- if (utf8ByteLength(raw) > 64 * 1024) {
65
- throw new CredentialFileTooLargeError()
66
- }
67
- rawText = decodeUtf8(raw)
68
- parsed = JSON.parse(rawText)
59
+ let raw
60
+ let rawText
61
+ let parsed
62
+ let accessToken
63
+ let metadata
64
+ let refreshAttempted = false
65
+ let recoveryAttempted = false
66
+
67
+ try {
68
+ while (accessToken === undefined) {
69
+ try {
70
+ raw = await load()
71
+ if (utf8ByteLength(raw) > 64 * 1024) {
72
+ throw new CredentialFileTooLargeError()
73
+ }
74
+ rawText = decodeUtf8(raw)
75
+ parsed = JSON.parse(rawText)
69
76
 
70
- if (!isPlainObject(parsed)) throw new UnsupportedCredentialError()
77
+ if (!isPlainObject(parsed)) throw new UnsupportedCredentialError()
71
78
 
72
- const entries = Object.entries(parsed)
73
- if (entries.length !== 1 || entries[0][0] !== contract.scope) {
74
- throw new UnsupportedCredentialError()
75
- }
79
+ const entries = Object.entries(parsed)
80
+ if (entries.length !== 1 || entries[0][0] !== contract.scope) {
81
+ throw new UnsupportedCredentialError()
82
+ }
76
83
 
77
- const record = entries[0][1]
78
- if (
79
- !isPlainObject(record) ||
80
- record.auth_mode !== contract.authMode ||
81
- record.oidc_issuer !== contract.issuer ||
82
- record.oidc_client_id !== contract.clientId ||
83
- typeof record.key !== "string" ||
84
- record.key.length === 0 ||
85
- !isDateTime(record.expires_at)
86
- ) {
84
+ const record = entries[0][1]
85
+ if (
86
+ !isPlainObject(record) ||
87
+ record.auth_mode !== contract.authMode ||
88
+ record.oidc_issuer !== contract.issuer ||
89
+ record.oidc_client_id !== contract.clientId ||
90
+ typeof record.key !== "string" ||
91
+ record.key.length === 0 ||
92
+ !isDateTime(record.expires_at)
93
+ ) {
94
+ throw new UnsupportedCredentialError()
95
+ }
96
+ const currentTime = now()
97
+ if (!(currentTime instanceof Date) || !Number.isFinite(currentTime.getTime())) {
98
+ throw new TypeError("Invalid credential source clock")
99
+ }
100
+ if (!isFutureDateTime(record.expires_at, currentTime)) throw new CredentialRefreshRequiredError()
101
+
102
+ accessToken = record.key
103
+ metadata = Object.freeze({
104
+ ...(isHeaderValue(record.user_id) ? { userId: record.user_id } : {}),
105
+ })
106
+ } catch (error) {
107
+ if (
108
+ error instanceof CredentialRefreshRequiredError &&
109
+ refresh !== undefined &&
110
+ !refreshAttempted
111
+ ) {
112
+ refreshAttempted = true
113
+ try {
114
+ await refreshOnce()
115
+ } catch {
87
116
  throw new UnsupportedCredentialError()
88
117
  }
89
- const currentTime = now()
90
- if (!(currentTime instanceof Date) || !Number.isFinite(currentTime.getTime())) {
91
- throw new TypeError("Invalid credential source clock")
92
- }
93
- if (!isFutureDateTime(record.expires_at, currentTime)) throw new CredentialRefreshRequiredError()
94
-
95
- accessToken = record.key
96
- metadata = Object.freeze({
97
- ...(isHeaderValue(record.user_id) ? { userId: record.user_id } : {}),
98
- })
99
- } catch (error) {
100
- if (
101
- error instanceof CredentialRefreshRequiredError &&
102
- refresh !== undefined &&
103
- !refreshAttempted
104
- ) {
105
- refreshAttempted = true
106
- try {
107
- await refreshOnce()
108
- } catch {
109
- throw new UnsupportedCredentialError()
110
- }
111
- raw = undefined
112
- rawText = undefined
113
- parsed = undefined
114
- continue
118
+ raw = undefined
119
+ rawText = undefined
120
+ parsed = undefined
121
+ continue
122
+ }
123
+ if (
124
+ error instanceof UnsupportedCredentialError ||
125
+ error instanceof CredentialFileTooLargeError ||
126
+ error instanceof TypeError
127
+ ) {
128
+ throw error
129
+ }
130
+ throw new UnsupportedCredentialError()
131
+ }
132
+ }
133
+
134
+ const loadedRevision = refreshRevision
135
+ const recover = recoveryAllowed
136
+ ? async (recoveryOperation) => {
137
+ if (typeof recoveryOperation !== "function" || recoveryAttempted) {
138
+ throw new TypeError("Invalid access-token recovery operation")
115
139
  }
116
- if (
117
- error instanceof UnsupportedCredentialError ||
118
- error instanceof CredentialFileTooLargeError ||
119
- error instanceof TypeError
120
- ) {
121
- throw error
140
+ recoveryAttempted = true
141
+ if (refresh === undefined) throw new UnsupportedCredentialError()
142
+ try {
143
+ if (loadedRevision === refreshRevision) await refreshOnce()
144
+ } catch {
145
+ throw new UnsupportedCredentialError()
122
146
  }
123
- throw new UnsupportedCredentialError()
147
+ return withAccessToken(recoveryOperation, false)
124
148
  }
125
- }
149
+ : undefined
150
+ return await operation(accessToken, metadata, recover)
151
+ } finally {
152
+ metadata = undefined
153
+ accessToken = undefined
154
+ parsed = undefined
155
+ rawText = undefined
156
+ raw = undefined
157
+ }
158
+ }
126
159
 
127
- return await operation(accessToken, metadata)
128
- } finally {
129
- metadata = undefined
130
- accessToken = undefined
131
- parsed = undefined
132
- rawText = undefined
133
- raw = undefined
134
- }
160
+ return Object.freeze({
161
+ withAccessToken(operation) {
162
+ return withAccessToken(operation, true)
135
163
  },
136
164
  })
137
165
  }
@@ -1,4 +1,5 @@
1
1
  import { parseModelCatalogResponse } from "./model-catalog.mjs"
2
+ import { preserveSafePartialResponse } from "./partial-response-recovery.mjs"
2
3
  import { createResponsesCallProtocol } from "./responses-call.mjs"
3
4
 
4
5
  export class GrokAdapterError extends Error {
@@ -131,10 +132,11 @@ async function* streamWithGeneration(generation, preparedRoute, requestPlan, map
131
132
  try {
132
133
  requireProvider(requestPlan.provider)
133
134
  const route = preparedRoute ?? await resolveRoute(generation, requestPlan)
134
- for await (const chunk of requestPlan.stream({
135
+ const stream = requestPlan.stream({
135
136
  route,
136
137
  transport: generation.transport,
137
- })) yield chunk
138
+ })
139
+ for await (const chunk of preserveSafePartialResponse(stream)) yield chunk
138
140
  } catch (error) {
139
141
  throw mapError(error, requestPlan.signal)
140
142
  }