dsh-plugin-marketplace 0.3.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +99 -87
  3. package/README.zh.md +101 -88
  4. package/client.js +463 -465
  5. package/index.js +20 -20
  6. package/package.json +78 -76
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Scorp1o117
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Scorp1o117
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,87 +1,99 @@
1
- # dsh-plugin-marketplace
2
-
3
- [![中文文档](https://img.shields.io/badge/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3-blue)](README.zh.md)
4
-
5
- **GitHub**: [Scorp1o117/dsh-plugin-marketplace](https://github.com/Scorp1o117/dsh-plugin-marketplace) · **npm**: [dsh-plugin-marketplace](https://www.npmjs.com/package/dsh-plugin-marketplace)
6
-
7
- [![Enhancement Suite](https://img.shields.io/badge/part%20of-Enhancement%20Suite-3964fe)](https://github.com/Scorp1o117/dsh-enhancement-suite) [![npm](https://img.shields.io/npm/v/dsh-enhancement-suite)](https://www.npmjs.com/package/dsh-enhancement-suite)
8
-
9
- Part of the [DeepSeek Harness Enhancement Suite](https://github.com/Scorp1o117/dsh-enhancement-suite) — Vision · Soul/Persona · Long-term Memory · Plugin Marketplace.
10
-
11
- A **plugin marketplace** inside the DeepSeek Harness Web UI: browse
12
- [github.com/topics/dsh-plugin](https://github.com/topics/dsh-plugin) right
13
- from the settings page — no terminal needed.
14
-
15
- - **Search** the topic by keyword, **sort** by stars or last update
16
- - **Plugin cards** with description, stars, language, and update date
17
- - **Detail panel**: GitHub README summary, install command, repo/npm links
18
- - **AI explain**: one click asks the configured default model what a plugin
19
- roughly does, answered in the UI — no need to read the README yourself
20
- - Powered by the public GitHub search API (CORS-enabled, no key needed;
21
- unauthenticated rate limit 60 req/h)
22
- - Zero client dependencies (React only), no build step — hand-written
23
- ModuleLoader bundle
24
-
25
- ## Compatibility (v0.3.6)
26
-
27
- Tested with DSH `0.1.7-rc.1` and `0.1.7-rc.2` (`next`); npm `latest` is `0.1.5-rc.3`.
28
- The host now stores live plugin settings in the Profile patch and the browser
29
- uses `configForms`. This version was checked in a disposable Web profile.
30
- Older hosts require an older plugin release; alpha releases remain `unknown`.
31
-
32
- ## Install
33
-
34
- As a profile bundle (recommended):
35
-
36
- ```
37
- dsh plugin --profile web add dsh-plugin-marketplace
38
- ```
39
-
40
- or via the package's `dsh.bundle.patch` layer — add `dsh-plugin-marketplace`
41
- to `dsh.profile.bundles` in `$DSH_HOME/profiles/web/package.json`.
42
-
43
- Manual mount in `$DSH_HOME/profiles/web/cordis.patch.yml`:
44
-
45
- ```yaml
46
- - insert:
47
- - id: plugin-marketplace
48
- name: 'dsh-plugin-marketplace'
49
- ```
50
-
51
- > **Upgrading from ≤ 0.2.2?** If you previously mounted the plugin manually,
52
- > **remove that row from `cordis.patch.yml`** before switching to the bundle
53
- > install — the bundle layer already inserts the entry, and two entries with
54
- > the same id abort boot with `duplicate loader entry id: plugin-marketplace`.
55
- > The two ways are alternatives, not both.
56
-
57
- Then restart `dsh web` (new client plugins require a process restart to be
58
- scanned into the browser roster) and open **Settings → Plugin Marketplace**.
59
-
60
- Version 0.3.6 uses DSH's `configForms` client service and Profile patch
61
- settings. Use an older plugin release with older DSH hosts.
62
- Note: when dsh web is opened from a non-loopback origin (a LAN IP, say), DSH
63
- keeps settings writes process-local, so install / AI-explain requests never
64
- reach the host.
65
-
66
- ## How it works
67
-
68
- | Layer | File | Role |
69
- |---|---|---|
70
- | host shell | `index.js` | settings-backed install + AI-explain flows; `dsh.bundle.patch` makes the package a proper profile bundle |
71
- | browser half | `client.js` | registers the `settings.section` "marketplace" tab; fetches GitHub search API; renders cards + detail; "AI explain" button |
72
- | manifest | `package.json` | `dsh.bundle: { patch: "./cordis.patch.yml" }` + `dsh.client: { platform: "web" }` + `exports["./client"]` — discovered by `dsh-client-modules` |
73
-
74
- The browser half needs no `dsh.client.inject` packages: it only uses `react`
75
- (provided by the web runtime) and the `slots` / `locale` client services.
76
-
77
- ## Notes
78
-
79
- - The GitHub search API returns at most 1000 results; the topic currently has
80
- 280+ repos, so paging covers everything.
81
- - READMEs are fetched per plugin on demand and truncated to ~1200 chars.
82
- - If you see "rate-limited", wait an hour or run the web through a proxy that
83
- adds a GitHub token.
84
-
85
- ## License
86
-
87
- MIT
1
+ # dsh-plugin-marketplace
2
+
3
+ ## Configuration page (DSH 0.2.0-rc.2 and later)
4
+
5
+ Open **Plugins → Installed → dsh-plugin-marketplace** from the homepage sidebar to configure and save this plugin. The page uses the official `plugins.bundle.config` interface, without a duplicate entry in global Settings. Web and Desktop share the page. This version requires DSH 0.2.0-rc.2 or a later 0.2.x host; existing configuration is retained.
6
+
7
+ [![中文文档](https://img.shields.io/badge/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3-blue)](README.zh.md)
8
+
9
+ **GitHub**: [Scorp1o117/dsh-plugin-marketplace](https://github.com/Scorp1o117/dsh-plugin-marketplace) · **npm**: [dsh-plugin-marketplace](https://www.npmjs.com/package/dsh-plugin-marketplace)
10
+
11
+ [![Enhancement Suite](https://img.shields.io/badge/part%20of-Enhancement%20Suite-3964fe)](https://github.com/Scorp1o117/dsh-enhancement-suite) [![npm](https://img.shields.io/npm/v/dsh-enhancement-suite)](https://www.npmjs.com/package/dsh-enhancement-suite)
12
+
13
+ Part of the [DeepSeek Harness Enhancement Suite](https://github.com/Scorp1o117/dsh-enhancement-suite) — Vision · Soul/Persona · Long-term Memory · Plugin Marketplace.
14
+
15
+ A **plugin marketplace** inside the DeepSeek Harness Web UI: browse
16
+ [github.com/topics/dsh-plugin](https://github.com/topics/dsh-plugin) right
17
+ from the settings page — no terminal needed.
18
+
19
+ - **Search** the topic by keyword, **sort** by stars or last update
20
+ - **Plugin cards** with description, stars, language, and update date
21
+ - **Detail panel**: GitHub README summary, install command, repo/npm links
22
+ - **AI explain**: one click asks the configured default model what a plugin
23
+ roughly does, answered in the UI — no need to read the README yourself
24
+ - Powered by the public GitHub search API (CORS-enabled, no key needed;
25
+ unauthenticated rate limit 60 req/h)
26
+ - Zero client dependencies (React only), no build step — hand-written
27
+ ModuleLoader bundle
28
+
29
+ ## Compatibility (v0.3.7)
30
+
31
+ Verified with DSH `0.1.7-rc.2` (Web) and `0.2.0-rc.2` (Desktop runtime) in isolated profiles. The Desktop app uses its own `desktop` profile. Other DSH prereleases remain unverified.
32
+
33
+ ## Desktop install
34
+
35
+ Use the Desktop-installed `dsh` command (Application → Manage dsh Command), or the app’s Plugins page. Then install into the Desktop profile:
36
+
37
+ ```powershell
38
+ dsh plugin --profile desktop add dsh-plugin-marketplace@0.3.7
39
+ ```
40
+
41
+ Restart the Desktop app to load the client bundle. Desktop keeps its profile under `$DSH_HOME/profiles/desktop`.
42
+
43
+
44
+ ## Install
45
+
46
+ As a profile bundle (recommended):
47
+
48
+ ```
49
+ dsh plugin --profile web add dsh-plugin-marketplace
50
+ ```
51
+
52
+ or via the package's `dsh.bundle.patch` layer — add `dsh-plugin-marketplace`
53
+ to `dsh.profile.bundles` in `$DSH_HOME/profiles/web/package.json`.
54
+
55
+ Manual mount in `$DSH_HOME/profiles/web/cordis.patch.yml`:
56
+
57
+ ```yaml
58
+ - insert:
59
+ - id: plugin-marketplace
60
+ name: 'dsh-plugin-marketplace'
61
+ ```
62
+
63
+ > **Upgrading from ≤ 0.2.2?** If you previously mounted the plugin manually,
64
+ > **remove that row from `cordis.patch.yml`** before switching to the bundle
65
+ > install — the bundle layer already inserts the entry, and two entries with
66
+ > the same id abort boot with `duplicate loader entry id: plugin-marketplace`.
67
+ > The two ways are alternatives, not both.
68
+
69
+ Then restart `dsh web` (new client plugins require a process restart to be
70
+ scanned into the browser roster) and open **Settings → Plugin Marketplace**.
71
+
72
+ Version 0.3.7 uses DSH's `configForms` client service and Profile patch
73
+ settings. Use an older plugin release with older DSH hosts.
74
+ Note: when dsh web is opened from a non-loopback origin (a LAN IP, say), DSH
75
+ keeps settings writes process-local, so install / AI-explain requests never
76
+ reach the host.
77
+
78
+ ## How it works
79
+
80
+ | Layer | File | Role |
81
+ |---|---|---|
82
+ | host shell | `index.js` | settings-backed install + AI-explain flows; `dsh.bundle.patch` makes the package a proper profile bundle |
83
+ | browser half | `client.js` | registers the `settings.section` "marketplace" tab; fetches GitHub search API; renders cards + detail; "AI explain" button |
84
+ | manifest | `package.json` | `dsh.bundle: { patch: "./cordis.patch.yml" }` + `dsh.client: { platform: "web" }` + `exports["./client"]` — discovered by `dsh-client-modules` |
85
+
86
+ The browser half needs no `dsh.client.inject` packages: it only uses `react`
87
+ (provided by the web runtime) and the `slots` / `locale` client services.
88
+
89
+ ## Notes
90
+
91
+ - The GitHub search API returns at most 1000 results; the topic currently has
92
+ 280+ repos, so paging covers everything.
93
+ - READMEs are fetched per plugin on demand and truncated to ~1200 chars.
94
+ - If you see "rate-limited", wait an hour or run the web through a proxy that
95
+ adds a GitHub token.
96
+
97
+ ## License
98
+
99
+ MIT
package/README.zh.md CHANGED
@@ -1,88 +1,101 @@
1
- # dsh-plugin-marketplace
2
-
3
- **GitHub**: [Scorp1o117/dsh-plugin-marketplace](https://github.com/Scorp1o117/dsh-plugin-marketplace) · **npm**: [dsh-plugin-marketplace](https://www.npmjs.com/package/dsh-plugin-marketplace) · [English](README.md)
4
-
5
- [![Enhancement Suite](https://img.shields.io/badge/part%20of-Enhancement%20Suite-3964fe)](https://github.com/Scorp1o117/dsh-enhancement-suite) [![npm](https://img.shields.io/npm/v/dsh-enhancement-suite)](https://www.npmjs.com/package/dsh-enhancement-suite)
6
-
7
- 属于 [DeepSeek Harness Enhancement Suite](https://github.com/Scorp1o117/dsh-enhancement-suite) —— Vision · Soul/Persona · 长期记忆 · 插件市场。
8
-
9
- 在 DeepSeek Harness **Web UI 里内置的插件市场**:直接在设置页浏览
10
- [github.com/topics/dsh-plugin](https://github.com/topics/dsh-plugin),无需打开终端。
11
-
12
- - **搜索**:按关键词搜索主题下的插件,按 Star 或更新时间**排序**
13
- - **插件卡片**:名称、简介、Star 数、语言、更新时间一目了然
14
- - **详情面板**:GitHub README 摘要、安装命令、仓库 / npm 链接
15
- - **AI 解释**:一键调用已配置的默认模型,用中文直接告诉你这个插件大概是干嘛的,不用自己啃 README
16
- - 基于 GitHub 公开搜索 API(浏览器 CORS 直连,无需密钥;未认证限流 60 次/小时)
17
- - 零客户端依赖(只用 React),无构建步骤 —— 手写 ModuleLoader bundle
18
-
19
- ## 兼容性(v0.3.6)
20
-
21
- 已验证 DSH `0.1.7-rc.1` 与 `0.1.7-rc.2`(npm `next`);npm `latest` 是 `0.1.5-rc.3`。
22
- 新版使用 Profile patch 配置与客户端 `configForms`,已在一次性 Web Profile 验证。
23
- 旧宿主请使用插件旧版;alpha 版本继续标记 `unknown`。
24
-
25
- ## 安装
26
-
27
- 作为 profile bundle 安装(推荐):
28
-
29
- ```
30
- dsh plugin --profile web add dsh-plugin-marketplace
31
- ```
32
-
33
- 或通过包的 `dsh.bundle.patch` 层:把 `dsh-plugin-marketplace` 加进
34
- `$DSH_HOME/profiles/web/package.json` 的 `dsh.profile.bundles`。
35
-
36
- 手动挂载(`$DSH_HOME/profiles/web/cordis.patch.yml`):
37
-
38
- ```yaml
39
- - insert:
40
- - id: plugin-marketplace
41
- name: 'dsh-plugin-marketplace'
42
- ```
43
-
44
- > **从 ≤ 0.2.2 升级?** 如果你之前是手动挂载的,切到 bundle 安装前**先删掉
45
- > `cordis.patch.yml` 里那一行**——bundle 层自己会插入条目,两行同 id 会让启动
46
- > 直接报 `duplicate loader entry id: plugin-marketplace`。两种方式二选一,别同时用。
47
-
48
- 然后重启 `dsh web`(新客户端插件需要重启进程才会被扫描进浏览器清单),打开 **设置 → 插件市场**。
49
-
50
- DSH `0.1.0-rc.7` 起会公开全部已注册的 settings 命名空间,插件市场无需再修改官方文件。
51
- 因此从 `0.2.8` 起最低支持 DSH `0.1.0-rc.7`。仍使用 DSH `0.1.0-rc.6` 的用户
52
- 请锁定 `dsh-plugin-marketplace@0.2.6`;这是最后一个包含旧 settings 白名单兼容
53
- 补丁的版本。
54
-
55
- DSH `0.1.2-rc.1` 移除了客户端的 `connection.api`(旧 settings RPC 入口),
56
- `0.3.1` 起改用 `settingsScope` 自带的 `mutate` 写入(`0.1.2-rc.1` 之前的主机仍走
57
- 旧通道)。注意:非本机回环(如局域网 IP)访问 dsh web 时,DSH 的设置写入是
58
- 进程本地的,安装 / AI 解释请求不会到达宿主。
59
-
60
- ## 实现方式
61
-
62
- | 层 | 文件 | 作用 |
63
- |---|---|---|
64
- | 服务端壳 | `index.js` | settings 通道的安装 + AI 解释流程;`dsh.bundle.patch` 让包成为标准 profile bundle |
65
- | 浏览器端 | `client.js` | 注册 `settings.section` 的 "marketplace" 分区;调用 GitHub 搜索 API;渲染卡片 + 详情;"AI 解释"按钮 |
66
- | 清单 | `package.json` | `dsh.bundle: { patch: "./cordis.patch.yml" }` + `dsh.client: { platform: "web" }` + `exports["./client"]` —— 被 `dsh-client-modules` 扫描发现 |
67
-
68
- 浏览器端不需要任何 `dsh.client.inject` 依赖包:只用 `react`(web 运行时自带)和 `slots` / `locale` 客户端服务。
69
-
70
- ## v0.3.3:写入改为校验而非假定
71
-
72
- `writeField` 在走 settings scope 时只检查了 `snapshot.status === "ready"` 就返回成功。
73
- 但 scope 的契约是「完成写入与恢复读取后结算」,**被宿主以 `settings/conflict` 拒绝的
74
- 写入同样会 resolve**——而拒绝之后命名空间依然注册着,恢复读取也会把它重新渲染成
75
- `ready`,所以这个检查恒真,被拒的写入会被报成成功。
76
-
77
- 现在改为比对 section 自身的值(`settings-not-applied`),调用方拿到的 `{ok:false}` 才
78
- 真的代表写入没生效。
79
-
80
- ## 备注
81
-
82
- - GitHub 搜索 API 最多返回 1000 条;该主题目前有 280+ 仓库,翻页可以覆盖全部。
83
- - README 按需按插件拉取,截断到约 1200 字符。
84
- - 遇到 "rate-limited":等一小时,或让 web 走带 GitHub token 的代理。
85
-
86
- ## License
87
-
88
- MIT
1
+ # dsh-plugin-marketplace
2
+
3
+ ## 配置入口(DSH 0.2.0-rc.2 起)
4
+
5
+ 在首页侧边栏打开 **插件 → 已安装 → dsh-plugin-marketplace**,直接在插件详情页配置并保存。配置页注册到官方的 `plugins.bundle.config` 接口;全局设置页不再重复显示配置入口。Web 与桌面版使用相同界面,本版要求 DSH 0.2.0-rc.2 或更新的 0.2.x 版本。现有配置无需迁移。
6
+
7
+ **GitHub**: [Scorp1o117/dsh-plugin-marketplace](https://github.com/Scorp1o117/dsh-plugin-marketplace) · **npm**: [dsh-plugin-marketplace](https://www.npmjs.com/package/dsh-plugin-marketplace) · [English](README.md)
8
+
9
+ [![Enhancement Suite](https://img.shields.io/badge/part%20of-Enhancement%20Suite-3964fe)](https://github.com/Scorp1o117/dsh-enhancement-suite) [![npm](https://img.shields.io/npm/v/dsh-enhancement-suite)](https://www.npmjs.com/package/dsh-enhancement-suite)
10
+
11
+ 属于 [DeepSeek Harness Enhancement Suite](https://github.com/Scorp1o117/dsh-enhancement-suite) —— Vision · Soul/Persona · 长期记忆 · 插件市场。
12
+
13
+ 在 DeepSeek Harness **Web UI 里内置的插件市场**:直接在设置页浏览
14
+ [github.com/topics/dsh-plugin](https://github.com/topics/dsh-plugin),无需打开终端。
15
+
16
+ - **搜索**:按关键词搜索主题下的插件,按 Star 或更新时间**排序**
17
+ - **插件卡片**:名称、简介、Star 数、语言、更新时间一目了然
18
+ - **详情面板**:GitHub README 摘要、安装命令、仓库 / npm 链接
19
+ - **AI 解释**:一键调用已配置的默认模型,用中文直接告诉你这个插件大概是干嘛的,不用自己啃 README
20
+ - 基于 GitHub 公开搜索 API(浏览器 CORS 直连,无需密钥;未认证限流 60 次/小时)
21
+ - 零客户端依赖(只用 React),无构建步骤 —— 手写 ModuleLoader bundle
22
+
23
+ ## 兼容性(v0.3.7)
24
+
25
+ 已在 DSH `0.1.7-rc.2`(Web)与 `0.2.0-rc.2`(桌面端运行时)的一次性 Profile 验证。桌面端使用独立的 `desktop` Profile;其他预发布版本暂未验证。
26
+
27
+ ## 桌面端安装
28
+
29
+ 在桌面端的“插件”页面安装,或使用桌面端“应用 → 管理 dsh 命令”注册的命令:
30
+
31
+ ```powershell
32
+ dsh plugin --profile desktop add dsh-plugin-marketplace@0.3.7
33
+ ```
34
+
35
+ 重启桌面端以加载客户端插件。配置位于 `$DSH_HOME/profiles/desktop`。
36
+
37
+
38
+ ## 安装
39
+
40
+ 作为 profile bundle 安装(推荐):
41
+
42
+ ```
43
+ dsh plugin --profile web add dsh-plugin-marketplace
44
+ ```
45
+
46
+ 或通过包的 `dsh.bundle.patch` 层:把 `dsh-plugin-marketplace` 加进
47
+ `$DSH_HOME/profiles/web/package.json` 的 `dsh.profile.bundles`。
48
+
49
+ 手动挂载(`$DSH_HOME/profiles/web/cordis.patch.yml`):
50
+
51
+ ```yaml
52
+ - insert:
53
+ - id: plugin-marketplace
54
+ name: 'dsh-plugin-marketplace'
55
+ ```
56
+
57
+ > **从 ≤ 0.2.2 升级?** 如果你之前是手动挂载的,切到 bundle 安装前**先删掉
58
+ > `cordis.patch.yml` 里那一行**——bundle 层自己会插入条目,两行同 id 会让启动
59
+ > 直接报 `duplicate loader entry id: plugin-marketplace`。两种方式二选一,别同时用。
60
+
61
+ 然后重启 `dsh web`(新客户端插件需要重启进程才会被扫描进浏览器清单),打开 **插件 → dsh-plugin-marketplace**。
62
+
63
+ DSH `0.1.0-rc.7` 起会公开全部已注册的 settings 命名空间,插件市场无需再修改官方文件。
64
+ 因此从 `0.2.8` 起最低支持 DSH `0.1.0-rc.7`。仍使用 DSH `0.1.0-rc.6` 的用户
65
+ 请锁定 `dsh-plugin-marketplace@0.2.6`;这是最后一个包含旧 settings 白名单兼容
66
+ 补丁的版本。
67
+
68
+ DSH `0.1.2-rc.1` 移除了客户端的 `connection.api`(旧 settings RPC 入口),
69
+ `0.3.1` 起改用 `settingsScope` 自带的 `mutate` 写入(`0.1.2-rc.1` 之前的主机仍走
70
+ 旧通道)。注意:非本机回环(如局域网 IP)访问 dsh web 时,DSH 的设置写入是
71
+ 进程本地的,安装 / AI 解释请求不会到达宿主。
72
+
73
+ ## 实现方式
74
+
75
+ | 层 | 文件 | 作用 |
76
+ |---|---|---|
77
+ | 服务端壳 | `index.js` | settings 通道的安装 + AI 解释流程;`dsh.bundle.patch` 让包成为标准 profile bundle |
78
+ | 浏览器端 | `client.js` | 注册 `settings.section` 的 "marketplace" 分区;调用 GitHub 搜索 API;渲染卡片 + 详情;"AI 解释"按钮 |
79
+ | 清单 | `package.json` | `dsh.bundle: { patch: "./cordis.patch.yml" }` + `dsh.client: { platform: "web" }` + `exports["./client"]` —— 被 `dsh-client-modules` 扫描发现 |
80
+
81
+ 浏览器端不需要任何 `dsh.client.inject` 依赖包:只用 `react`(web 运行时自带)和 `slots` / `locale` 客户端服务。
82
+
83
+ ## v0.3.3:写入改为校验而非假定
84
+
85
+ `writeField` 在走 settings scope 时只检查了 `snapshot.status === "ready"` 就返回成功。
86
+ 但 scope 的契约是「完成写入与恢复读取后结算」,**被宿主以 `settings/conflict` 拒绝的
87
+ 写入同样会 resolve**——而拒绝之后命名空间依然注册着,恢复读取也会把它重新渲染成
88
+ `ready`,所以这个检查恒真,被拒的写入会被报成成功。
89
+
90
+ 现在改为比对 section 自身的值(`settings-not-applied`),调用方拿到的 `{ok:false}` 才
91
+ 真的代表写入没生效。
92
+
93
+ ## 备注
94
+
95
+ - GitHub 搜索 API 最多返回 1000 条;该主题目前有 280+ 仓库,翻页可以覆盖全部。
96
+ - README 按需按插件拉取,截断到约 1200 字符。
97
+ - 遇到 "rate-limited":等一小时,或让 web 走带 GitHub token 的代理。
98
+
99
+ ## License
100
+
101
+ MIT