dsh-grok-provider 0.1.7 → 0.1.10
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 +24 -1
- package/README.en.md +22 -17
- package/README.md +22 -17
- package/SECURITY.md +7 -5
- package/dist/client/client.js +99 -3
- package/dist/host/index.mjs +25 -2
- package/dist/internal/grok-adapter.mjs +21 -14
- package/dist/internal/llm-error.mjs +9 -1
- package/dist/internal/model-catalog.mjs +4 -0
- package/dist/internal/responses-call.mjs +60 -0
- package/dist/internal/responses-codec.mjs +684 -30
- package/dist/internal/responses-request-compiler.mjs +159 -4
- package/dist/internal/responses-request.mjs +39 -2
- package/docs/01-product-requirements.md +10 -5
- package/docs/03-security-threat-model.md +14 -2
- package/docs/04-harness-contract.md +2 -2
- package/docs/05-test-plan.md +8 -3
- package/docs/06-release-plan.md +6 -6
- package/docs/09-implementation-status.md +43 -10
- package/docs/10-release-checklist.md +39 -3
- package/docs/11-capability-roadmap.md +26 -12
- package/docs/12-upstream-image-input-evidence.md +1 -1
- package/docs/13-upstream-search-evidence.md +94 -0
- package/docs/README.md +15 -8
- package/docs/adr/0010-default-off-web-x-search.md +109 -0
- package/docs/releases/v0.1.10.md +48 -0
- package/docs/releases/v0.1.7.md +2 -2
- package/docs/releases/v0.1.8.md +22 -0
- package/docs/releases/v0.1.9.md +76 -0
- package/package.json +4 -2
- package/types/index.d.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.10 - 2026-08-30
|
|
4
|
+
|
|
5
|
+
- Register the `llm-grok` Host settings namespace through Harness's canonical settings module so the Web Search and X Search controls are writable instead of permanently `unavailable`.
|
|
6
|
+
- Resolve Search settings from schema defaults, composition config, and the persisted user layer, while retaining the composition config when no settings provider is mounted.
|
|
7
|
+
- Snapshot the current Search policy once at each adapter-call boundary before model discovery awaits; later calls observe committed setting changes while prepared and in-flight calls keep their original policy.
|
|
8
|
+
- Add real `SettingsProvider` integration coverage for namespace defaults, lifecycle cleanup, persisted updates, composition fallback, and prepared-call isolation, plus a deferred-discovery adapter regression.
|
|
9
|
+
- Keep authentication, credentials, endpoints, Search protocol allowlists, citation handling, image input, and platform support unchanged.
|
|
10
|
+
|
|
11
|
+
## 0.1.9 - 2026-08-30
|
|
12
|
+
|
|
13
|
+
- Add independent, default-off Web Search and X Search Provider settings for exact `grok-4.6`; keep every other dynamically discovered model Search-disabled until the same fixed-Proxy evidence exists.
|
|
14
|
+
- Compile Harness function tools followed by `web_search` and `x_search` under one 128-tool and 16 MiB request budget, while preserving the byte-identical `0.1.7` request path when both settings are off and disabling Search for non-interactive `purpose` calls.
|
|
15
|
+
- Bind each final request to a private response receipt so undeclared function names, disabled server tools, unknown events, malformed citations, and incomplete or out-of-order Search lifecycles fail closed before they can be projected into Harness.
|
|
16
|
+
- Decode the fixed Proxy's standard Web Search lifecycle and its Grok-Build-specific four-name X Search `custom_tool_call` lifecycle as server-executed activity that emits no Harness tool-call chunks; observing either category suppresses encrypted reasoning replay for that response.
|
|
17
|
+
- Preserve inline citation Markdown as assistant text while bounding and discarding structured citation metadata; never follow, preview, or download citation URLs.
|
|
18
|
+
- Add bilingual Search risk disclosures to the existing Grok Build settings page through Harness `settingsScope`, without a second configuration RPC, renderer-local persistence, a production dependency, a new endpoint, or a new authentication mode.
|
|
19
|
+
- Known issue: the published Host omitted the matching `llm-grok` settings registration, leaving both user-facing Search controls disabled. `0.1.10` repairs this integration and the missing live-setting consumption path.
|
|
20
|
+
|
|
21
|
+
## 0.1.8 - 2026-08-30 (withdrawn)
|
|
22
|
+
|
|
23
|
+
- Briefly published a Grok-only sidebar quota card that moved the sidebar's Grok quota querying and display ownership into the Provider, then withdrew the release by reverting that change.
|
|
24
|
+
- The npm Registry version `dsh-grok-provider@0.1.8` remains permanently reserved and cannot be reused after unpublish; `latest` returned to `0.1.7` after withdrawal, and the independent Search slice moved to the subsequently published `0.1.9`.
|
|
25
|
+
|
|
3
26
|
## 0.1.7 - 2026-08-29
|
|
4
27
|
|
|
5
28
|
- Add a separate Host diagnostics RPC that reports the installed package version and a closed Grok Build CLI state/version without exposing executable paths, stderr, environment, proxy data, or OAuth URLs.
|
|
@@ -8,7 +31,7 @@
|
|
|
8
31
|
- Keep runtime diagnostics single-flight and lifecycle-owned: capability teardown cancels and awaits inspection, cleanup failure latches the CLI instance and aborts its in-flight authentication actions, and serial authentication polling uses a request epoch to reject stale responses after user actions, settlement, or unmount.
|
|
9
32
|
- Document the Windows pre-browser OIDC failure boundary and keep runtime diagnostics outside the authentication status polling path; the official CLI still owns sign-in URL generation and external-browser launch, so this release does not claim to repair Windows network/proxy conditions or to have verified network-reachable browser launch on a real Windows device.
|
|
10
33
|
- Render the MIT-licensed `IconThinkOutline16` path geometry from `@deepseek-ai/dsh-client-ui-primitives@0.1.0-rc.7` for the one exact Grok Build settings navigation match through a scoped, lifecycle-owned compatibility layer; ambiguous labels or unexpected DOM structure retain the Host gear, unload removes every injected resource, and the bundled third-party notice preserves attribution.
|
|
11
|
-
- Keep Web/X Search, image generation, new server-tool events, arbitrary URL downloads, API-key mode, and custom endpoints out of this maintenance release; the independent Search slice moves to `0.1.8
|
|
34
|
+
- Keep Web/X Search, image generation, new server-tool events, arbitrary URL downloads, API-key mode, and custom endpoints out of this maintenance release; the independent Search slice moves to `0.1.9` because the sidebar-quota `0.1.8` release was withdrawn and its Registry version cannot be reused.
|
|
12
35
|
|
|
13
36
|
## 0.1.6 - 2026-08-28
|
|
14
37
|
|
package/README.en.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md) | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
Use an already authenticated official Grok Build account from DeepSeek Harness, with dynamic model discovery, streaming reasoning, tool calls, and an account quota/model capability dashboard.
|
|
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 source candidate is `0.1.
|
|
7
|
+
> Unofficial community project; not affiliated with xAI or DeepSeek Harness. The current source candidate is `0.1.10`; the current stable release and npm Registry `latest` are both `0.1.9`. Published `0.1.9` completed unique-artifact, dual-platform CI, signature, and provenance verification, but omitted Host settings registration, so its Web/X Search controls remain unavailable; unpublished `0.1.10` is the focused repair. Version `0.1.8` was published and then withdrawn and cannot be reused. The project no longer publishes prereleases; stable defects are fixed in a new incremented stable version.
|
|
8
8
|
|
|
9
9
|
## What it provides
|
|
10
10
|
|
|
@@ -15,6 +15,7 @@ Use an already authenticated official Grok Build account from DeepSeek Harness,
|
|
|
15
15
|
| Models | Discovers every model visible to the account at runtime; no static model allowlist |
|
|
16
16
|
| Conversations | Streaming Responses text, reasoning, encrypted reasoning replay, usage, and finish reasons |
|
|
17
17
|
| Images | Only exact `grok-4.6` accepts bounded JPEG/PNG images from Harness attachments; `grok-4.5` and all other models remain text-only |
|
|
18
|
+
| Search | `0.1.9` includes the protocol and settings page, but its controls are unavailable because Host registration for `llm-grok` is missing; the `0.1.10` candidate repairs registration so exact `grok-4.6` gets independent, default-off Web Search and X Search, while remote lifecycles are never misrepresented as local tools |
|
|
18
19
|
| Tools | Returns function calls to the Harness permission layer; the provider never executes tools |
|
|
19
20
|
| Account dashboard | Login status, weekly/monthly quota, reset time, dynamic model capabilities and reasoning efforts |
|
|
20
21
|
| Surfaces | Bilingual Web settings and a closed `/grok` TUI command set |
|
|
@@ -35,14 +36,14 @@ grok --version
|
|
|
35
36
|
grok models
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
When the network is reachable and OIDC discovery succeeds, the official CLI opens a browser on first use. The provider supports only the official default `~/.grok` directory (`%USERPROFILE%\.grok` on Windows).
|
|
39
40
|
|
|
40
41
|
### 2. Install the provider
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
`0.1.10` is not published yet. After it is published and read back from the Registry, install that exact version from npm:
|
|
43
44
|
|
|
44
45
|
```sh
|
|
45
|
-
dsh plugin --profile web add dsh-grok-provider@0.1.
|
|
46
|
+
dsh plugin --profile web add dsh-grok-provider@0.1.10
|
|
46
47
|
dsh web
|
|
47
48
|
```
|
|
48
49
|
|
|
@@ -65,6 +66,7 @@ The Web settings page shows:
|
|
|
65
66
|
- the official installation link and “Check again” recovery when the CLI is missing or invalid;
|
|
66
67
|
- used/remaining quota and the real billing-period reset time;
|
|
67
68
|
- account-visible models, context windows, reasoning efforts, and image-input, streaming, and tool capabilities.
|
|
69
|
+
- independent, default-off Web Search and X Search settings with nearby remote-query, additional-usage, citation, and prompt-injection disclosures.
|
|
68
70
|
|
|
69
71
|
When protobuf-backed billing includes a complete weekly/monthly period but omits a zero-valued percentage, the page restores “0% used / 100% remaining.” Other incomplete responses remain unknown.
|
|
70
72
|
|
|
@@ -128,8 +130,8 @@ Uninstalling the provider does not remove the official Grok CLI or directly modi
|
|
|
128
130
|
|
|
129
131
|
## Sources and discovery
|
|
130
132
|
|
|
131
|
-
- Current npm stable release: [dsh-grok-provider@0.1.
|
|
132
|
-
- Most recent GitHub release and integrity values: [v0.1.
|
|
133
|
+
- Current npm stable release: [dsh-grok-provider@0.1.9](https://www.npmjs.com/package/dsh-grok-provider/v/0.1.9) (release artifact verified; known Search settings-registration defect)
|
|
134
|
+
- Most recent GitHub release and integrity values: [v0.1.9](https://github.com/yoshino-xiao7/dsh-grok-provider/releases/tag/v0.1.9)
|
|
133
135
|
- GitHub community discovery: the repository carries the DeepSeek Harness-recommended `dsh-plugin` and `dsh` topics
|
|
134
136
|
- 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`
|
|
135
137
|
|
|
@@ -137,19 +139,21 @@ Directory inclusion is not an endorsement by xAI or DeepSeek Harness. [Listing P
|
|
|
137
139
|
|
|
138
140
|
## Compatibility and scope
|
|
139
141
|
|
|
140
|
-
| Item | `0.1.
|
|
142
|
+
| Item | `0.1.9` stable / `0.1.10` candidate status |
|
|
141
143
|
| --- | --- |
|
|
142
144
|
| DeepSeek Harness | Exact support for `0.1.1-rc.2` |
|
|
143
145
|
| Node.js | `>=24.19.0` |
|
|
144
|
-
| macOS arm64 |
|
|
145
|
-
| Windows x64 |
|
|
146
|
+
| macOS arm64 | Image sending has real-Harness confirmation; the `0.1.10` Search repair passes real SettingsProvider/LLM tests, candidate-tarball isolated install, settings API, browser switch-write acceptance, and candidate macOS 14 CI |
|
|
147
|
+
| Windows x64 | Code, slow fakes, and `0.1.10` candidate Windows 2022 CI pass. On a reachable network the official CLI generates the URL and opens the browser, and that path still lacks real-device Windows acceptance |
|
|
146
148
|
| macOS x64 / Linux | Unsupported |
|
|
147
149
|
| Grok CLI | No full-version lock; official path, `login --oauth` capability, and production OIDC credential contract are enforced |
|
|
148
150
|
| Models | Every account catalog model whose backend has a strict codec in this release |
|
|
149
151
|
|
|
150
|
-
`0.1.
|
|
152
|
+
`0.1.10` preserves the published image boundary: image input is enabled only for exact `grok-4.6`, while `grok-4.5` and every other dynamically discovered model remain text-only. Image sending has been confirmed in a real Harness conversation. Images must be verified JPEG/PNG projections from the Harness attachment service. Ordinary user content and images nested one level inside a tool result are supported with fixed `detail:"high"`; URLs, filesystem paths, file IDs, and caller-supplied data URLs are rejected. Private reasoning in ordinary user/system history is omitted while adjacent visible text remains ordered.
|
|
151
153
|
|
|
152
|
-
Each projected image is limited to 4 MiB, 16,777,216 pixels, and 8192px per side. A request retains at most eight images and 8 MiB of projected image bytes. When a limit is exceeded, the globally oldest images are offloaded to Harness text placeholders; the final JSON remains capped at 16 MiB.
|
|
154
|
+
Each projected image is limited to 4 MiB, 16,777,216 pixels, and 8192px per side. A request retains at most eight images and 8 MiB of projected image bytes. When a limit is exceeded, the globally oldest images are offloaded to Harness text placeholders; the final JSON remains capped at 16 MiB.
|
|
155
|
+
|
|
156
|
+
Published `0.1.9` included the Search protocol and settings page but omitted the Host-side `llm-grok` namespace registration, leaving both controls unavailable. The `0.1.10` candidate registers and persists both settings through the canonical Harness settings module; each new call reads the latest value once before model discovery, while prepared and in-flight calls keep their original snapshot. Search remains default-off and limited to exact `grok-4.6`. Once enabled, ordinary conversation content and model-derived queries are sent to xAI and may incur additional usage. Web/X activity is already executed server-side and is not projected as a Harness-local tool call. Citation Markdown remains ordinary assistant text; bounded structured URL metadata is discarded, and the plugin never opens or downloads a citation. Search results are untrusted remote data, so verify sources before commands or file changes. Image generation, arbitrary downloads, API-key mode, multiple accounts, enterprise OIDC, ACP, and Headless agent wrapping remain out of scope; see the [capability roadmap](docs/11-capability-roadmap.md).
|
|
153
157
|
|
|
154
158
|
## How it works
|
|
155
159
|
|
|
@@ -175,7 +179,7 @@ Model IDs come from the runtime catalog rather than a hardcoded list. Image moda
|
|
|
175
179
|
- The Host must perform a bounded read of the official `auth.json`, whose raw file may contain a refresh token. The parser does not use, cache, or persist that refresh token; it retains only validation metadata and a short-lived access-token lease.
|
|
176
180
|
- The provider does not implement a refresh grant. Near expiry it may invoke one bounded official `grok models`, then reread and revalidate the official credential file.
|
|
177
181
|
- Login subprocesses use fixed argv, a scrubbed environment, output limits, deadlines, cancellation, and no shell.
|
|
178
|
-
- Prompts, tool results,
|
|
182
|
+
- Prompts, tool results, image projections selected for a request, and Search queries when enabled are sent to the xAI Grok Build service; the provider itself does not log that content, source images, projected bytes, or citation URLs.
|
|
179
183
|
|
|
180
184
|
See the full [threat model](docs/03-security-threat-model.md). For vulnerabilities, read the [security policy](SECURITY.md) and never post tokens, `auth.json`, personal data, or full diagnostic logs in a public issue.
|
|
181
185
|
|
|
@@ -199,7 +203,7 @@ Run the official CLI directly first:
|
|
|
199
203
|
|
|
200
204
|
If it times out at `auth.x.ai/.well-known/openid-configuration`, the failure occurs before a sign-in URL is generated; it is not a broken Provider browser button. Check Windows DNS, outbound HTTPS, firewall, VPN, and proxy settings—especially when the browser uses PAC/system proxy but the CLI process has no `HTTPS_PROXY`. Do not disable TLS verification or post proxy credentials, sign-in URLs, authorization codes, or tokens in an issue.
|
|
201
205
|
|
|
202
|
-
The
|
|
206
|
+
The settings page promptly settles this known discovery timeout and says that browser sign-in has not started. An authentication flow that is still running within the five-minute deadline remains cancellable, while unknown CLI output is reduced to a redacted generic error. This is accurate diagnosis of the failure boundary: the Provider does not open the browser itself and does not repair Windows DNS, proxy, firewall, VPN, or official-CLI behavior.
|
|
203
207
|
|
|
204
208
|
### A model is missing
|
|
205
209
|
|
|
@@ -215,7 +219,7 @@ Versions through `0.1.2` could not convert some third-party tool-call histories
|
|
|
215
219
|
|
|
216
220
|
### Does Windows work?
|
|
217
221
|
|
|
218
|
-
Windows x64 is covered by code
|
|
222
|
+
Windows x64 is covered by code, slow fakes, and passing `0.1.9` Windows 2022 CI. The official CLI still generates the sign-in URL and launches the external browser. Network-reachable browser launch has not yet been confirmed on a real Windows device, so it must not be described as fixed or verified.
|
|
219
223
|
|
|
220
224
|
## Development
|
|
221
225
|
|
|
@@ -250,8 +254,9 @@ Read the [contributing guide](CONTRIBUTING.md) before filing an issue or PR. Cha
|
|
|
250
254
|
- [x] Publish `0.1.4`: image input only for exact `grok-4.6`; red/blue user/tool-result Proxy gates and final Harness attachment revalidation passed, while `grok-4.5` fails closed as text-only
|
|
251
255
|
- [x] Publish `0.1.5`: maintenance for release binding, dashboard capability badges, and transactional Provider Runtime installation; the unique artifact, dual-platform CI, signatures, and SLSA provenance are verified
|
|
252
256
|
- [x] Publish `0.1.6`: image-history reasoning compatibility and per-stage official-CLI deadline repair for Windows; image sending is confirmed in a real Harness conversation
|
|
253
|
-
- [
|
|
254
|
-
- [
|
|
257
|
+
- [x] Publish `0.1.7`: Provider/CLI version diagnostics, CLI installation recovery, redacted OIDC discovery-timeout settlement, and the `IconThinkOutline16` settings-navigation compatibility layer
|
|
258
|
+
- [x] Publish `0.1.9`: added the Web/X Search protocol and settings page; the unique artifact, dual-platform CI, signatures, and SLSA provenance are verified; post-release verification found the missing Host settings namespace and unusable controls
|
|
259
|
+
- [ ] Publish `0.1.10`: `llm-grok` registration, per-call capture, isolated install, the code PR, and main dual-platform CI are complete; merging release evidence, freezing the unique artifact, and exact release authorization remain
|
|
255
260
|
- [ ] A subsequent slice: opt-in image generation (inline results only, committed through Harness attachments)
|
|
256
261
|
- [ ] Complete independent Windows x64 acceptance and publish a later stable fix if needed
|
|
257
262
|
|
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md) | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
让 DeepSeek Harness 使用你已登录的官方 Grok Build
|
|
5
|
+
让 DeepSeek Harness 使用你已登录的官方 Grok Build 账号:动态模型发现、流式推理、图片输入、可选 Web/X Search、工具调用,以及账号额度与模型能力面板。
|
|
6
6
|
|
|
7
|
-
> 非官方社区项目,与 xAI 或 DeepSeek Harness 官方无隶属关系。当前源码候选版本为 `0.1.
|
|
7
|
+
> 非官方社区项目,与 xAI 或 DeepSeek Harness 官方无隶属关系。当前源码候选版本为 `0.1.10`;当前稳定版及 npm Registry 的 `latest` 均为 `0.1.9`。已发布的 `0.1.9` 完成了唯一制品、双平台 CI、签名与 provenance 验证,但遗漏 Host 设置注册,因此 Web/X Search 开关会显示暂时不可用;尚未发布的 `0.1.10` 专门修复这条链路。`0.1.8` 曾发布后撤回且版本号不可复用。项目不再发行预发行版;正式版缺陷通过新的递增稳定版本修复。
|
|
8
8
|
|
|
9
9
|
## 它解决什么问题
|
|
10
10
|
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
| 模型 | 运行时读取账号可见的全部 Grok Build 模型,不维护静态模型白名单 |
|
|
16
16
|
| 对话 | Responses 流式文本、reasoning、加密 reasoning replay、usage 与 finish reason |
|
|
17
17
|
| 图片 | 仅精确 `grok-4.6` 接收 Harness attachment 中有界的 JPEG/PNG 图片;`grok-4.5` 与其他模型保持 text-only |
|
|
18
|
+
| 搜索 | `0.1.9` 已包含协议与设置页,但开关因缺少 `llm-grok` Host 注册而不可用;`0.1.10` 候选修复注册,使精确 `grok-4.6` 的 Web Search / X Search 可默认关闭、分别开启,远端 lifecycle 不伪装成本地工具 |
|
|
18
19
|
| 工具 | 将 function call 交回 Harness 权限层;Provider 本身不执行工具 |
|
|
19
20
|
| 账户面板 | 登录状态、每周/月额度、重置时间、动态模型能力与 reasoning 档位 |
|
|
20
21
|
| 界面 | Web 设置页中英文切换;TUI 提供闭合的 `/grok` 命令 |
|
|
@@ -35,14 +36,14 @@ grok --version
|
|
|
35
36
|
grok models
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
当网络可达且 OIDC discovery 成功时,首次运行 Grok CLI 会打开浏览器登录。插件只支持官方默认的 `~/.grok`(Windows 为 `%USERPROFILE%\.grok`)目录。
|
|
39
40
|
|
|
40
41
|
### 2. 安装 Provider
|
|
41
42
|
|
|
42
|
-
`0.1.
|
|
43
|
+
`0.1.10` 尚未发布;待它发布并完成 Registry 回读后,从 npm 安装该精确版本:
|
|
43
44
|
|
|
44
45
|
```sh
|
|
45
|
-
dsh plugin --profile web add dsh-grok-provider@0.1.
|
|
46
|
+
dsh plugin --profile web add dsh-grok-provider@0.1.10
|
|
46
47
|
dsh web
|
|
47
48
|
```
|
|
48
49
|
|
|
@@ -65,6 +66,7 @@ Web 设置页展示:
|
|
|
65
66
|
- CLI 缺失或无效时的官方安装入口与“重新检测”操作;
|
|
66
67
|
- 已使用/剩余额度和真实周期重置时间;
|
|
67
68
|
- 当前账号可见模型、上下文窗口、reasoning 档位,以及图片输入、streaming 与 tool capability。
|
|
69
|
+
- 默认关闭且相互独立的 Web Search / X Search 开关,以及远端检索、额外用量、citation 和 prompt injection 风险提示。
|
|
68
70
|
|
|
69
71
|
当 protobuf-backed billing 返回完整的 weekly/monthly 周期但省略零值百分比时,页面会恢复为“已使用 0% / 剩余 100%”;其他不完整响应保持未知,不伪造额度。
|
|
70
72
|
|
|
@@ -128,8 +130,8 @@ dsh web
|
|
|
128
130
|
|
|
129
131
|
## 项目来源与发现
|
|
130
132
|
|
|
131
|
-
- npm 当前稳定版:[dsh-grok-provider@0.1.
|
|
132
|
-
- GitHub 最近发行版与校验值:[v0.1.
|
|
133
|
+
- npm 当前稳定版:[dsh-grok-provider@0.1.9](https://www.npmjs.com/package/dsh-grok-provider/v/0.1.9)(发行制品已验证;Search 开关存在已知设置注册缺陷)
|
|
134
|
+
- GitHub 最近发行版与校验值:[v0.1.9](https://github.com/yoshino-xiao7/dsh-grok-provider/releases/tag/v0.1.9)
|
|
133
135
|
- GitHub 社区发现:仓库已添加 DeepSeek Harness 官方推荐的 `dsh-plugin` 与 `dsh` Topics
|
|
134
136
|
- YukiRyou 受管来源:[deepseek-yukiryou-plugin-catalog](https://github.com/yoshino-xiao7/deepseek-yukiryou-plugin-catalog),当前仍锁定已完成真机验收的 `dsh-grok-provider@0.1.0`,且只标记 `darwin-arm64`
|
|
135
137
|
|
|
@@ -137,19 +139,21 @@ dsh web
|
|
|
137
139
|
|
|
138
140
|
## 兼容性与范围
|
|
139
141
|
|
|
140
|
-
| 项目 | `0.1.
|
|
142
|
+
| 项目 | `0.1.9` 稳定版 / `0.1.10` 候选状态 |
|
|
141
143
|
| --- | --- |
|
|
142
144
|
| DeepSeek Harness | 精确支持 `0.1.1-rc.2` |
|
|
143
145
|
| Node.js | `>=24.19.0` |
|
|
144
|
-
| macOS arm64 |
|
|
145
|
-
| Windows x64 |
|
|
146
|
+
| macOS arm64 | 图片发送已完成真实 Harness 验证;`0.1.10` Search 修复已通过真实 SettingsProvider/LLM 回归、候选 tarball 隔离安装、设置 API、浏览器开关写入与候选 macOS 14 CI |
|
|
147
|
+
| Windows x64 | 代码、slow-fake 与 `0.1.10` 候选 Windows 2022 CI 已通过。网络可达时由官方 CLI 生成 URL 并打开浏览器,该路径仍未完成 Windows 真机验收 |
|
|
146
148
|
| macOS x64 / Linux | 不支持 |
|
|
147
149
|
| Grok CLI | 不锁完整版本;严格校验官方路径、`login --oauth` 能力与生产 OIDC 凭据契约 |
|
|
148
150
|
| 模型 | 当前账号目录中 backend 已被严格 codec 支持的全部模型 |
|
|
149
151
|
|
|
150
|
-
`0.1.
|
|
152
|
+
`0.1.10` 沿用已发布版本的图片边界:只为精确的 `grok-4.6` 开启图片输入;`grok-4.5` 与其他动态发现的模型继续按 text-only 处理。图片发送已在真实 Harness 对话中确认可用。图片只能来自 Harness attachment service 的已验证 JPEG/PNG 投影,支持普通用户内容和一层工具结果中的图片,并固定使用 `detail:"high"`;不接受 URL、文件路径、file ID 或调用方预制的 data URL。普通 user/system 历史中的私有 reasoning 会被省略并保留相邻可见文本。
|
|
151
153
|
|
|
152
|
-
每张投影图片最多 4 MiB、16,777,216 像素且任一边不超过 8192px;每次请求最多保留 8 张、投影字节合计最多 8 MiB。超限时按全局最旧优先移除图片并保留 Harness 的文本占位,最终 JSON 仍受 16 MiB 上限约束。
|
|
154
|
+
每张投影图片最多 4 MiB、16,777,216 像素且任一边不超过 8192px;每次请求最多保留 8 张、投影字节合计最多 8 MiB。超限时按全局最旧优先移除图片并保留 Harness 的文本占位,最终 JSON 仍受 16 MiB 上限约束。
|
|
155
|
+
|
|
156
|
+
已发布的 `0.1.9` 包含 Search 协议实现和设置页面,但漏掉了 Host 侧 `llm-grok` namespace 注册,两个开关因此永久处于不可用状态。`0.1.10` 候选使用 Harness 官方 settings 模块注册并持久化这两个设置;每个新调用在模型发现前读取一次最新值,已准备和在途调用保持原快照。Search 仍只对精确 `grok-4.6` 开放并默认关闭。开启后,普通对话内容以及模型据此生成的检索词会交给 xAI,并可能产生额外用量。Web/X 是服务端已执行的检索过程,不会变成 Harness 本地工具调用;回答中的 citation Markdown 保留为普通文本,结构化 URL 元数据有界校验后丢弃,插件不会打开或下载引用。搜索结果属于不可信远端数据,执行命令或修改文件前应核实来源。图片生成、任意文件下载、API Key 模式、多账号、企业 OIDC、ACP 与 Headless agent 封装仍不在本版本范围内;后续切片见[能力路线图](docs/11-capability-roadmap.md)。
|
|
153
157
|
|
|
154
158
|
## 工作原理
|
|
155
159
|
|
|
@@ -175,7 +179,7 @@ dsh-grok-provider Host
|
|
|
175
179
|
- Host 必须有界读取官方 `auth.json`,其原始文件可能包含 refresh token;解析器不使用、不缓存、不持久化 refresh token,只保留闭合校验所需元数据与短期 access-token lease。
|
|
176
180
|
- 插件不实现 refresh grant;凭据临近过期时,只能有界调用一次官方 `grok models`,再重新读取并验证官方文件。
|
|
177
181
|
- 登录子进程使用固定 argv、过滤后的环境、输出上限、deadline 与取消处理,不通过 shell 启动。
|
|
178
|
-
-
|
|
182
|
+
- 提示词、工具结果、用户选择发送的图片投影,以及启用 Search 后的检索词会发往 xAI Grok Build 服务;插件本身不记录这些内容、原图、投影字节或 citation URL。
|
|
179
183
|
|
|
180
184
|
完整边界见[威胁模型](docs/03-security-threat-model.md)。发现安全问题时,请阅读[安全策略](SECURITY.md),不要在公开 Issue 中提交 token、`auth.json`、个人信息或完整诊断日志。
|
|
181
185
|
|
|
@@ -199,7 +203,7 @@ dsh-grok-provider Host
|
|
|
199
203
|
|
|
200
204
|
如果它在 `auth.x.ai/.well-known/openid-configuration` 超时,失败发生在生成登录链接之前,不是 Provider 的浏览器按钮失效。请检查 Windows 的 DNS、HTTPS 出站、防火墙、VPN 与代理;尤其是浏览器使用 PAC/系统代理、CLI 进程却没有 `HTTPS_PROXY` 的情况。不要关闭 TLS 校验,也不要把代理凭据、登录 URL、授权码或 token 提交到 Issue。
|
|
201
205
|
|
|
202
|
-
|
|
206
|
+
设置页会及时结算这个已知 discovery 超时并显示“浏览器登录尚未开始”;实际仍在运行的五分钟登录流程可以取消,未知 CLI 输出只显示脱敏的通用错误。这是对失败边界的准确诊断,不是插件自行打开浏览器,也不修复 Windows 的 DNS、代理、防火墙、VPN 或官方 CLI 行为。
|
|
203
207
|
|
|
204
208
|
### 没有看到某个模型
|
|
205
209
|
|
|
@@ -215,7 +219,7 @@ dsh-grok-provider Host
|
|
|
215
219
|
|
|
216
220
|
### Windows 能用吗
|
|
217
221
|
|
|
218
|
-
|
|
222
|
+
代码、slow-fake 与 `0.1.9` Windows 2022 CI 已覆盖 Windows x64。官方 CLI 仍负责生成登录 URL 与打开外部浏览器;网络可达的 Windows 真机浏览器弹出尚未确认,因此不能表述为该问题已经修复或验证。
|
|
219
223
|
|
|
220
224
|
## 开发
|
|
221
225
|
|
|
@@ -250,8 +254,9 @@ npm run pack:check
|
|
|
250
254
|
- [x] 发布 `0.1.4`:仅精确 `grok-4.6` 图片输入;user/tool-result 红蓝语义 Proxy 门禁与最终 Harness attachment 复验通过,`grok-4.5` 失败关闭为 text-only
|
|
251
255
|
- [x] 发布 `0.1.5`:发布链路、账户面板能力标签与 Provider Runtime 安装回滚维护版;唯一制品、双平台 CI、签名与 SLSA provenance 均已验证
|
|
252
256
|
- [x] 发布 `0.1.6`:图片历史 reasoning 兼容与 Windows 官方 CLI 分阶段 deadline 修复版;图片发送已完成真实 Harness 验证
|
|
253
|
-
- [
|
|
254
|
-
- [
|
|
257
|
+
- [x] 发布 `0.1.7`:Provider/CLI 双版本诊断、CLI 安装恢复、OIDC discovery 超时脱敏结算与 `IconThinkOutline16` 设置导航兼容层
|
|
258
|
+
- [x] 发布 `0.1.9`:加入 Web/X Search 协议与设置页,唯一制品、双平台 CI、签名与 SLSA provenance 均已验证;发布后确认 Host 设置 namespace 遗漏,开关不可用
|
|
259
|
+
- [ ] 发布 `0.1.10`:`llm-grok` 注册、按调用读取设置、隔离安装、代码 PR 与 main 双平台 CI 已完成;仍需合并发布证据、冻结唯一制品和精确发布授权
|
|
255
260
|
- [ ] 再后续独立切片:默认关闭的图片生成(只收内联结果,提交 Harness attachment)
|
|
256
261
|
- [ ] 完成 Windows x64 独立真机验收并按需发布后续稳定修复版
|
|
257
262
|
|
package/SECURITY.md
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## 支持范围
|
|
6
6
|
|
|
7
|
-
本安全策略对应源码候选版本 `0.1.
|
|
7
|
+
本安全策略对应源码候选版本 `0.1.10`;当前稳定版及 npm Registry 的 `latest` 均为 `0.1.9`。`0.1.8` 曾发布后撤回且版本号不可复用。已发布的 `0.1.9` 完成了失败关闭 fixture 下的隔离 Web Harness `ctx.llm` 四场景验收以及 macOS 14 / Windows 2022 CI,但遗漏 `llm-grok` Host settings namespace,导致 Web/X Search 开关失败关闭为不可用。尚未发布的 `0.1.10` 只修复设置注册和调用快照链路;该链路已通过真实 SettingsProvider/LLM 回归、候选 tarball 隔离安装、设置 API 与浏览器开关写入验收,候选双平台 CI 仍待完成。DeepSeek Harness、Node.js 与操作系统按发布线明确维护;Grok CLI 不使用完整版本字符串作为信任门禁,而是严格校验官方默认路径、命令能力、生产 OIDC 凭据契约和固定服务端协议。图片发送已在真实 Harness 对话中确认可用;Search 协议仍只有失败关闭 fixture 及隔离自动化证据,不覆盖浏览器手工对话、OAuth、真实账号、真实 xAI Search 请求或网络可达 Windows 真机外部浏览器弹出。
|
|
8
8
|
|
|
9
|
-
`0.1.
|
|
9
|
+
`0.1.10` 沿用已发布版本的图片边界:只为精确 `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 都会被拒绝。
|
|
10
10
|
|
|
11
|
-
`0.1.7`
|
|
11
|
+
`0.1.7` 的闭合运行时诊断、CLI 安装恢复、OIDC timeout 脱敏结算和 `IconThinkOutline16` 兼容层在本版保持不变。官方 CLI 仍负责生成登录 URL 与打开外部浏览器;插件不修复系统 DNS、代理、防火墙、VPN 或 CLI 行为。
|
|
12
|
+
|
|
13
|
+
`0.1.10` 通过 Harness 官方 settings module 注册 `llm-grok`,按 schema 默认值、组合配置、持久化用户层的顺序解析两个 Search 开关。设置提交只影响之后创建的调用;每个调用在模型发现前冻结一次策略,在途请求不会被后续设置写入改变。Search 仍只为精确 `grok-4.6` 默认关闭地开放。启用后,普通对话内容与模型生成的检索词会交给 xAI,并可能产生额外用量;结果和 citation 属于可能错误或含提示注入的不可信远端数据。Provider 只允许固定 Proxy 实测的 Web lifecycle 与四项 X custom-tool 名称,不把它们映射为 Harness 本地工具,不跟随或下载 citation URL,并在观察到 Search 后放弃该响应的 encrypted reasoning replay。后台 purpose、未验证模型、未启用类别、未知事件和未闭合 lifecycle 均失败关闭。固定路径/argv、最小环境、无 shell、输出上限、凭据、固定 origin 与 URL 拒绝边界不变;本版不新增生成、认证模式或 endpoint。
|
|
12
14
|
|
|
13
15
|
## 私下报告漏洞
|
|
14
16
|
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
|
|
26
28
|
## 不属于漏洞的情况
|
|
27
29
|
|
|
28
|
-
-
|
|
30
|
+
- 网络可达 Windows 真机外部浏览器弹出尚未完成验收这一已披露状态;
|
|
29
31
|
- 上游未提供额度字段时 UI 显示 unknown;
|
|
30
32
|
- 不受支持的 CLI/Harness/平台版本被明确拒绝;
|
|
31
33
|
- 官方 CLI 或 xAI 服务自身的行为,且无法由本插件边界缓解的问题。
|
|
@@ -36,4 +38,4 @@
|
|
|
36
38
|
|
|
37
39
|
---
|
|
38
40
|
|
|
39
|
-
English summary: GitHub Private vulnerability reporting is enabled and
|
|
41
|
+
English summary: GitHub Private vulnerability reporting is enabled and preferred. The current source candidate is `0.1.10`; the current stable release and npm Registry `latest` are both `0.1.9`. Version `0.1.8` was published and then withdrawn, and npm version numbers cannot be reused. Published `0.1.9` passed four isolated Web Harness `ctx.llm` cases and macOS 14 / Windows 2022 CI under fail-closed fixtures, but omitted the `llm-grok` Host settings namespace and therefore left both Search controls unavailable. The unpublished `0.1.10` repair registers that namespace through the canonical Harness settings module and snapshots the current policy once per call before model discovery, so committed changes affect only later calls. Its settings path has passed real SettingsProvider/LLM tests, candidate-tarball isolated install, settings API, and browser switch-write acceptance; candidate dual-platform CI remains pending. Bounded JPEG/PNG input, browser-sign-in diagnostics, credentials, endpoints, fixed-Proxy Search allowlists, citation handling, and platform support remain unchanged. Search stays default-off and limited to exact `grok-4.6`; prompts and model-derived queries reach xAI only when enabled and may incur additional usage. Results and citations are untrusted remote data. Automated fixtures do not cover manual browser conversations, OAuth, a real account, real xAI Search requests, or network-reachable Windows browser launch. Never send credentials, identity data, prompts, tool arguments, cookies, image bytes, Search contents, or unreviewed diagnostics.
|
package/dist/client/client.js
CHANGED
|
@@ -28,6 +28,13 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
weekly: "每周额度", monthly: "每月额度", currentPeriod: "当前额度周期",
|
|
29
29
|
remaining: "剩余", used: "已使用", resetTime: "重置时间", resetUnknown: "上游未提供重置时间",
|
|
30
30
|
usageUnknown: "上游未提供使用比例", quotaUnavailable: "暂时无法读取 Grok Build 额度。",
|
|
31
|
+
searchTitle: "在线搜索", searchDescription: "默认关闭,并分别控制普通 Grok 请求是否可调用 xAI 的远端搜索;当前仅精确 grok-4.6 支持,其他模型会失败关闭;后台摘要与会话标题不会启用搜索。",
|
|
32
|
+
webSearch: "Web Search", webSearchDescription: "允许 xAI 根据对话和生成的搜索词远端查询公开网页,可能产生额外用量。",
|
|
33
|
+
xSearch: "X Search", xSearchDescription: "允许 xAI 根据对话和生成的搜索词远端查询 X 帖子、用户与线程,可能产生额外用量。",
|
|
34
|
+
searchRisk: "搜索结果和 citation 是不可信的远端内容,可能包含错误或 prompt injection。执行敏感操作前请核实来源;插件不会打开或下载引用链接。",
|
|
35
|
+
searchEnabled: "已开启", searchDisabled: "已关闭", searchLoading: "正在读取搜索设置…",
|
|
36
|
+
searchUnavailable: "搜索设置暂时不可用;开关不可操作,也不会写入未知值。", searchReadOnly: "当前搜索设置不可写。",
|
|
37
|
+
searchSaveFailed: "搜索设置保存失败,已保留 Host 当前值。",
|
|
31
38
|
modelsTitle: "当前账号可用的模型", modelsDescription: "模型来自 Grok Build 动态目录;Harness 模型选择器会显示这里列出的全部模型。",
|
|
32
39
|
modelsUnavailable: "暂时无法读取模型目录。", noModels: "当前账号没有返回可用模型。",
|
|
33
40
|
context: "上下文", reasoning: "推理档位", defaultEffort: "默认", text: "文本输入", image: "图片输入", streaming: "流式输出", tools: "工具调用",
|
|
@@ -54,6 +61,13 @@ window.__ModuleLoader__.load({
|
|
|
54
61
|
weekly: "Weekly quota", monthly: "Monthly quota", currentPeriod: "Current quota period",
|
|
55
62
|
remaining: "remaining", used: "Used", resetTime: "Resets", resetUnknown: "Reset time was not provided",
|
|
56
63
|
usageUnknown: "Usage percentage was not provided", quotaUnavailable: "Grok Build quota is temporarily unavailable.",
|
|
64
|
+
searchTitle: "Online Search", searchDescription: "Off by default. These settings independently allow regular Grok requests to use xAI remote search. Only exact grok-4.6 is supported; other models fail closed. Background summaries and conversation titles do not use Search.",
|
|
65
|
+
webSearch: "Web Search", webSearchDescription: "Allows xAI to remotely query public web pages from the conversation and generated search terms, which may incur additional usage.",
|
|
66
|
+
xSearch: "X Search", xSearchDescription: "Allows xAI to remotely query X posts, users, and threads from the conversation and generated search terms, which may incur additional usage.",
|
|
67
|
+
searchRisk: "Search results and citations are untrusted remote content and may contain errors or prompt injection. Verify sources before sensitive actions; the plugin does not open or download citation links.",
|
|
68
|
+
searchEnabled: "On", searchDisabled: "Off", searchLoading: "Reading Search settings…",
|
|
69
|
+
searchUnavailable: "Search settings are temporarily unavailable. Controls are disabled and no unknown value will be written.", searchReadOnly: "Search settings are currently read-only.",
|
|
70
|
+
searchSaveFailed: "Search settings could not be saved. The current Host value was preserved.",
|
|
57
71
|
modelsTitle: "Models available to this account", modelsDescription: "Models come from the live Grok Build catalog; every model listed here remains visible in the Harness model selector.",
|
|
58
72
|
modelsUnavailable: "The model catalog is temporarily unavailable.", noModels: "This account returned no available models.",
|
|
59
73
|
context: "Context", reasoning: "Reasoning", defaultEffort: "default", text: "Text input", image: "Image input", streaming: "Streaming", tools: "Tool calling",
|
|
@@ -61,6 +75,17 @@ window.__ModuleLoader__.load({
|
|
|
61
75
|
},
|
|
62
76
|
}
|
|
63
77
|
|
|
78
|
+
function decodeSearchConfig(value) {
|
|
79
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return undefined
|
|
80
|
+
const webSearch = Object.getOwnPropertyDescriptor(value, "webSearch")
|
|
81
|
+
const xSearch = Object.getOwnPropertyDescriptor(value, "xSearch")
|
|
82
|
+
if (
|
|
83
|
+
!webSearch || !("value" in webSearch) || typeof webSearch.value !== "boolean"
|
|
84
|
+
|| !xSearch || !("value" in xSearch) || typeof xSearch.value !== "boolean"
|
|
85
|
+
) return undefined
|
|
86
|
+
return Object.freeze({ webSearch: webSearch.value, xSearch: xSearch.value })
|
|
87
|
+
}
|
|
88
|
+
|
|
64
89
|
const navIconMarker = "data-dsh-grok-provider-nav-icon"
|
|
65
90
|
const navIconStyleSelector = 'style[data-plugin-nav-icon="dsh-grok-provider"]'
|
|
66
91
|
const navIconStateKey = Symbol.for("dsh-grok-provider.settings-nav-icon.v1")
|
|
@@ -178,6 +203,7 @@ window.__ModuleLoader__.load({
|
|
|
178
203
|
.dsh-grok-runtime{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:10px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:11px;line-height:18px}.dsh-grok-runtime strong{color:var(--dsw-alias-label-secondary);font-weight:600}.dsh-grok-install{margin-top:13px;padding:12px 13px;border:1px solid rgb(217 155 43 / 30%);border-radius:11px;background:rgb(217 155 43 / 8%)}.dsh-grok-install strong{display:block;font-size:12px}.dsh-grok-install p{margin:4px 0 10px;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:18px}.dsh-grok-link{display:inline-flex;align-items:center;height:32px;border-radius:999px;padding:0 12px;color:var(--dsw-static-deepseek-500,#4d6bfe);text-decoration:none;background:rgb(77 107 254 / 8%);font-size:11px}.dsh-grok-link:hover{text-decoration:underline}
|
|
179
204
|
.dsh-grok-divider{height:1px;margin:18px 0;background:rgb(190 93 138 / 20%)}.dsh-grok-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.dsh-grok-section-head h3{margin:0;font-size:15px;line-height:23px}.dsh-grok-section-head .dsh-grok-button{height:30px;padding:0 11px}
|
|
180
205
|
.dsh-grok-quota{margin-top:15px}.dsh-grok-quota-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px;color:var(--dsw-alias-label-secondary);font-size:13px}.dsh-grok-quota-name{color:var(--dsw-alias-label-primary);font-weight:600}.dsh-grok-progress{height:9px;overflow:hidden;border-radius:999px;background:rgb(190 93 138 / 13%)}.dsh-grok-progress-fill{height:100%;border-radius:inherit;background:linear-gradient(90deg,#d7448a,#ea1768);transition:width .25s ease}.dsh-grok-quota-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:7px;margin-top:9px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.dsh-grok-muted{margin:12px 0 0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:19px}
|
|
206
|
+
.dsh-grok-search-head h3{margin:0;font-size:16px;line-height:24px}.dsh-grok-search-head p{margin:5px 0 0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:19px}.dsh-grok-search-list{margin-top:14px;border-top:1px solid rgb(190 93 138 / 18%)}.dsh-grok-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;padding:14px 0;border-bottom:1px solid rgb(190 93 138 / 18%)}.dsh-grok-search-copy strong{display:block;font-size:13px;line-height:20px}.dsh-grok-search-copy p{margin:3px 0 0;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:18px}.dsh-grok-switch{position:relative;width:44px;height:25px;flex:none;border:0;border-radius:999px;padding:0;background:var(--dsw-alias-interactive-bg-hover);cursor:pointer;transition:background .18s ease}.dsh-grok-switch::after{content:"";position:absolute;top:3px;left:3px;width:19px;height:19px;border-radius:50%;background:var(--dsw-alias-bg-layer-1);box-shadow:0 1px 3px rgb(0 0 0 / 18%);transition:transform .18s ease}.dsh-grok-switch[data-checked="true"]{background:var(--dsw-static-deepseek-500,#4d6bfe)}.dsh-grok-switch[data-checked="true"]::after{transform:translateX(19px)}.dsh-grok-switch:disabled{cursor:default;opacity:.48}.dsh-grok-search-risk{margin:13px 0 0;padding:11px 12px;border-radius:10px;color:var(--dsw-alias-label-secondary);background:rgb(217 155 43 / 8%);font-size:11px;line-height:18px}.dsh-grok-search-status{margin:11px 0 0;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:18px}.dsh-grok-visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;clip-path:inset(50%)}
|
|
181
207
|
.dsh-grok-models-head{padding:20px 20px 0}.dsh-grok-models-head h3{margin:0;font-size:16px;line-height:24px}.dsh-grok-models-head p{margin:5px 0 0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:19px}.dsh-grok-model-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:16px 20px 20px}.dsh-grok-model{min-width:0;border:1px solid var(--dsw-alias-border-l2);border-radius:13px;padding:14px;background:var(--dsw-alias-bg-layer-1)}.dsh-grok-model-title{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.dsh-grok-model-title strong{overflow-wrap:anywhere;font-size:14px}.dsh-grok-model-id{overflow-wrap:anywhere;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px}.dsh-grok-model-description{margin:5px 0 10px;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:17px}.dsh-grok-badges{display:flex;flex-wrap:wrap;gap:5px}.dsh-grok-badge{border-radius:999px;padding:2px 8px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover);font-size:10px;line-height:18px}.dsh-grok-badge[data-accent="true"]{color:#a9326b;background:rgb(215 68 138 / 11%)}.dsh-grok-efforts{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:10px;line-height:17px}.dsh-grok-footer{padding:0 20px 16px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:10px}
|
|
182
208
|
.dsh-grok-notice{padding:13px 14px;border:1px solid rgb(229 72 77 / 28%);border-radius:11px;color:var(--dsw-alias-label-secondary);background:rgb(229 72 77 / 7%);font-size:12px;line-height:19px}.dsh-grok-error{margin:10px 0 0;color:var(--dsw-static-red-500,#e5484d);font-size:12px;line-height:19px}
|
|
183
209
|
@media(max-width:680px){.dsh-grok-panel-inner,.dsh-grok-models-head{padding:16px}.dsh-grok-model-grid{grid-template-columns:1fr;padding:14px 16px 16px}.dsh-grok-account-head{align-items:flex-start;flex-direction:column}.dsh-grok-quota-row{align-items:flex-start;flex-direction:column;gap:3px}}
|
|
@@ -189,7 +215,7 @@ window.__ModuleLoader__.load({
|
|
|
189
215
|
document.head.appendChild(style)
|
|
190
216
|
}
|
|
191
217
|
|
|
192
|
-
function GrokSettings({ connection, t }) {
|
|
218
|
+
function GrokSettings({ connection, t, searchSettings }) {
|
|
193
219
|
const [status, setStatus] = React.useState()
|
|
194
220
|
const [dashboard, setDashboard] = React.useState()
|
|
195
221
|
const [busy, setBusy] = React.useState(false)
|
|
@@ -200,6 +226,22 @@ window.__ModuleLoader__.load({
|
|
|
200
226
|
const [diagnosticsError, setDiagnosticsError] = React.useState(false)
|
|
201
227
|
const [statusEpoch] = React.useState(() => ({ value: 0 }))
|
|
202
228
|
const [diagnosticsEpoch] = React.useState(() => ({ value: 0 }))
|
|
229
|
+
const [searchSnapshot, setSearchSnapshot] = React.useState(() => searchSettings.getSnapshot())
|
|
230
|
+
const [searchSaving, setSearchSaving] = React.useState()
|
|
231
|
+
const [searchSaveError, setSearchSaveError] = React.useState(false)
|
|
232
|
+
const [searchWrite] = React.useState(() => ({ field: undefined }))
|
|
233
|
+
React.useEffect(() => {
|
|
234
|
+
let active = true
|
|
235
|
+
const publish = () => {
|
|
236
|
+
if (active) setSearchSnapshot(searchSettings.getSnapshot())
|
|
237
|
+
}
|
|
238
|
+
const unsubscribe = searchSettings.subscribe(publish)
|
|
239
|
+
publish()
|
|
240
|
+
return () => {
|
|
241
|
+
active = false
|
|
242
|
+
unsubscribe()
|
|
243
|
+
}
|
|
244
|
+
}, [searchSettings])
|
|
203
245
|
const call = React.useCallback(async (endpoint, payload = {}) => {
|
|
204
246
|
const result = await connection.rpc.call("/grok-auth", endpoint, payload)
|
|
205
247
|
if (!result || result.ok !== true) throw new Error("Grok account RPC failed")
|
|
@@ -314,6 +356,31 @@ window.__ModuleLoader__.load({
|
|
|
314
356
|
statusEpoch.value += 1
|
|
315
357
|
await Promise.all([refreshStatus({ includeDashboard: true }), refreshDiagnostics()])
|
|
316
358
|
})
|
|
359
|
+
const updateSearchSetting = async (field, enabled) => {
|
|
360
|
+
const current = searchSettings.getSnapshot()
|
|
361
|
+
if (
|
|
362
|
+
current.status !== "ready" || current.writable !== true
|
|
363
|
+
|| typeof current.value?.[field] !== "boolean" || current.value[field] === enabled
|
|
364
|
+
|| searchWrite.field !== undefined
|
|
365
|
+
) return
|
|
366
|
+
searchWrite.field = field
|
|
367
|
+
setSearchSaving(field)
|
|
368
|
+
setSearchSaveError(false)
|
|
369
|
+
try {
|
|
370
|
+
await searchSettings.set(field, enabled)
|
|
371
|
+
const settled = searchSettings.getSnapshot()
|
|
372
|
+
if (
|
|
373
|
+
settled.status !== "ready"
|
|
374
|
+
|| typeof settled.value?.[field] !== "boolean"
|
|
375
|
+
|| settled.value[field] !== enabled
|
|
376
|
+
) setSearchSaveError(true)
|
|
377
|
+
} catch {
|
|
378
|
+
setSearchSaveError(true)
|
|
379
|
+
} finally {
|
|
380
|
+
searchWrite.field = undefined
|
|
381
|
+
setSearchSaving(undefined)
|
|
382
|
+
}
|
|
383
|
+
}
|
|
317
384
|
|
|
318
385
|
if (!connection.isLoopback) return React.createElement("section", { className: "dsh-grok-page" },
|
|
319
386
|
React.createElement("h2", null, t("title")), React.createElement("p", { className: "dsh-grok-notice" }, t("loopback")))
|
|
@@ -380,6 +447,25 @@ window.__ModuleLoader__.load({
|
|
|
380
447
|
effortText && React.createElement("div", { className: "dsh-grok-efforts" }, `${t("reasoning")}:${effortText}`))
|
|
381
448
|
}
|
|
382
449
|
|
|
450
|
+
const searchReady = searchSnapshot.status === "ready"
|
|
451
|
+
const searchWritable = searchReady && searchSnapshot.writable === true
|
|
452
|
+
const searchStatus = searchSnapshot.status === "loading" ? t("searchLoading")
|
|
453
|
+
: searchSnapshot.status !== "ready" ? t("searchUnavailable")
|
|
454
|
+
: !searchWritable ? t("searchReadOnly") : undefined
|
|
455
|
+
const renderSearchSetting = (field, labelKey, descriptionKey) => {
|
|
456
|
+
const enabled = searchReady && searchSnapshot.value?.[field] === true
|
|
457
|
+
const disabled = !searchWritable || searchSaving !== undefined
|
|
458
|
+
return React.createElement("div", { className: "dsh-grok-search-row", key: field },
|
|
459
|
+
React.createElement("div", { className: "dsh-grok-search-copy" },
|
|
460
|
+
React.createElement("strong", null, t(labelKey)),
|
|
461
|
+
React.createElement("p", null, t(descriptionKey))),
|
|
462
|
+
React.createElement("button", {
|
|
463
|
+
className: "dsh-grok-switch", type: "button", role: "switch",
|
|
464
|
+
"aria-checked": enabled, "aria-label": `${t(labelKey)}:${t(enabled ? "searchEnabled" : "searchDisabled")}`,
|
|
465
|
+
"data-checked": enabled, disabled, onClick: () => updateSearchSetting(field, !enabled),
|
|
466
|
+
}, React.createElement("span", { className: "dsh-grok-visually-hidden" }, t(enabled ? "searchEnabled" : "searchDisabled"))))
|
|
467
|
+
}
|
|
468
|
+
|
|
383
469
|
const models = dashboard?.models
|
|
384
470
|
return React.createElement("section", { className: "dsh-grok-page" },
|
|
385
471
|
React.createElement("h2", null, t("title")), React.createElement("p", { className: "dsh-grok-description" }, t("description")),
|
|
@@ -413,6 +499,15 @@ window.__ModuleLoader__.load({
|
|
|
413
499
|
React.createElement("div", { className: "dsh-grok-section-head" }, React.createElement("h3", null, t("usage")),
|
|
414
500
|
React.createElement("button", { className: "dsh-grok-button", type: "button", disabled: busy || !available, onClick: manualRefresh }, busy ? t("refreshing") : t("refresh"))),
|
|
415
501
|
renderQuota(), error && React.createElement("p", { className: "dsh-grok-error" }, t("unavailable")))),
|
|
502
|
+
React.createElement("article", { className: "dsh-grok-panel" }, React.createElement("div", { className: "dsh-grok-panel-inner" },
|
|
503
|
+
React.createElement("div", { className: "dsh-grok-search-head" },
|
|
504
|
+
React.createElement("h3", null, t("searchTitle")), React.createElement("p", null, t("searchDescription"))),
|
|
505
|
+
React.createElement("div", { className: "dsh-grok-search-list" },
|
|
506
|
+
renderSearchSetting("webSearch", "webSearch", "webSearchDescription"),
|
|
507
|
+
renderSearchSetting("xSearch", "xSearch", "xSearchDescription")),
|
|
508
|
+
React.createElement("p", { className: "dsh-grok-search-risk" }, t("searchRisk")),
|
|
509
|
+
searchStatus && React.createElement("p", { className: "dsh-grok-search-status", role: "status", "aria-live": "polite" }, searchStatus),
|
|
510
|
+
searchSaveError && React.createElement("p", { className: "dsh-grok-error", role: "alert" }, t("searchSaveFailed")))),
|
|
416
511
|
React.createElement("article", { className: "dsh-grok-panel" },
|
|
417
512
|
React.createElement("div", { className: "dsh-grok-models-head" }, React.createElement("h3", null, t("modelsTitle")), React.createElement("p", null, t("modelsDescription"))),
|
|
418
513
|
React.createElement("div", { className: "dsh-grok-model-grid" },
|
|
@@ -432,14 +527,15 @@ window.__ModuleLoader__.load({
|
|
|
432
527
|
return new Intl.NumberFormat().format(value)
|
|
433
528
|
}
|
|
434
529
|
|
|
435
|
-
const inject = ["slots", "locale", "connection"]
|
|
530
|
+
const inject = ["slots", "locale", "connection", "settingsScope"]
|
|
436
531
|
function apply(ctx) {
|
|
437
532
|
ctx.effect(() => ctx.locale.register(namespace, dictionaries), "dsh-grok: dictionaries")
|
|
438
533
|
ctx.effect(() => installSettingsNavIcon(), "dsh-grok: settings nav icon")
|
|
439
534
|
const t = ctx.locale.bind(namespace)
|
|
535
|
+
const searchSettings = ctx.settingsScope.bind({ namespace: "llm-grok", decode: decodeSearchConfig })
|
|
440
536
|
ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
441
537
|
name: "settings.section", id: "grok-auth", order: 45, label: () => t("nav"), locale: namespace,
|
|
442
|
-
inject: () => ({ connection: ctx.connection, t }),
|
|
538
|
+
inject: () => ({ connection: ctx.connection, t, searchSettings }),
|
|
443
539
|
}, GrokSettings))
|
|
444
540
|
}
|
|
445
541
|
module.exports.inject = inject
|
package/dist/host/index.mjs
CHANGED
|
@@ -4,6 +4,10 @@ import { randomUUID } from "node:crypto"
|
|
|
4
4
|
import packageJson from "../../package.json" with { type: "json" }
|
|
5
5
|
|
|
6
6
|
import { attributionHeaders } from "@deepseek-ai/dsh-llm"
|
|
7
|
+
import {
|
|
8
|
+
installSettingsSection,
|
|
9
|
+
settingsNamespace,
|
|
10
|
+
} from "@deepseek-ai/dsh-settings"
|
|
7
11
|
import Schema from "@deepseek-ai/schemastery"
|
|
8
12
|
|
|
9
13
|
import {
|
|
@@ -27,15 +31,21 @@ import { createRuntimeDiagnostics } from "../internal/runtime-diagnostics.mjs"
|
|
|
27
31
|
|
|
28
32
|
export const name = "llm-grok"
|
|
29
33
|
export const inject = ["llm"]
|
|
34
|
+
const SETTINGS_NAMESPACE = settingsNamespace(name)
|
|
30
35
|
|
|
31
|
-
export const Config = Schema.object({
|
|
36
|
+
export const Config = Schema.object({
|
|
37
|
+
webSearch: Schema.boolean().default(false).description("Allow xAI Web Search for regular Grok requests"),
|
|
38
|
+
xSearch: Schema.boolean().default(false).description("Allow xAI X Search for regular Grok requests"),
|
|
39
|
+
})
|
|
32
40
|
|
|
33
|
-
export function apply(ctx) {
|
|
41
|
+
export function apply(ctx, config) {
|
|
34
42
|
const platform = process.platform
|
|
35
43
|
if (platform !== "darwin" && platform !== "win32") {
|
|
36
44
|
throw new TypeError("dsh-grok-provider supports macOS and Windows")
|
|
37
45
|
}
|
|
38
46
|
|
|
47
|
+
let currentConfig = () => config
|
|
48
|
+
|
|
39
49
|
const homeDir = os.homedir()
|
|
40
50
|
let refreshOfficialCredential
|
|
41
51
|
let inspectOfficialCli
|
|
@@ -64,9 +74,22 @@ export function apply(ctx) {
|
|
|
64
74
|
createAdapter: ({ getGeneration }) => createGrokAdapter({
|
|
65
75
|
getGeneration,
|
|
66
76
|
getAttachmentStore: () => ctx.get("attachments"),
|
|
77
|
+
getSearchPolicy: () => {
|
|
78
|
+
const current = currentConfig()
|
|
79
|
+
return {
|
|
80
|
+
webSearch: current.webSearch,
|
|
81
|
+
xSearch: current.xSearch,
|
|
82
|
+
}
|
|
83
|
+
},
|
|
67
84
|
mapError: mapLlmError,
|
|
68
85
|
}),
|
|
69
86
|
})
|
|
87
|
+
installSettingsSection(ctx, SETTINGS_NAMESPACE, Config, config, {
|
|
88
|
+
setSource(source) {
|
|
89
|
+
currentConfig = source
|
|
90
|
+
},
|
|
91
|
+
onChange() {},
|
|
92
|
+
})
|
|
70
93
|
const authController = createAuthController({
|
|
71
94
|
registry: runtime.auth,
|
|
72
95
|
randomUUID,
|