dsh-plugin-marketplace 0.3.1 → 0.3.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/LICENSE +21 -21
- package/README.zh.md +10 -0
- package/client.js +11 -3
- package/package.json +6 -3
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.zh.md
CHANGED
|
@@ -61,6 +61,16 @@ DSH `0.1.2-rc.1` 移除了客户端的 `connection.api`(旧 settings RPC 入
|
|
|
61
61
|
|
|
62
62
|
浏览器端不需要任何 `dsh.client.inject` 依赖包:只用 `react`(web 运行时自带)和 `slots` / `locale` 客户端服务。
|
|
63
63
|
|
|
64
|
+
## v0.3.3:写入改为校验而非假定
|
|
65
|
+
|
|
66
|
+
`writeField` 在走 settings scope 时只检查了 `snapshot.status === "ready"` 就返回成功。
|
|
67
|
+
但 scope 的契约是「完成写入与恢复读取后结算」,**被宿主以 `settings/conflict` 拒绝的
|
|
68
|
+
写入同样会 resolve**——而拒绝之后命名空间依然注册着,恢复读取也会把它重新渲染成
|
|
69
|
+
`ready`,所以这个检查恒真,被拒的写入会被报成成功。
|
|
70
|
+
|
|
71
|
+
现在改为比对 section 自身的值(`settings-not-applied`),调用方拿到的 `{ok:false}` 才
|
|
72
|
+
真的代表写入没生效。
|
|
73
|
+
|
|
64
74
|
## 备注
|
|
65
75
|
|
|
66
76
|
- GitHub 搜索 API 最多返回 1000 条;该主题目前有 280+ 仓库,翻页可以覆盖全部。
|
package/client.js
CHANGED
|
@@ -197,10 +197,18 @@ window.__ModuleLoader__.load({
|
|
|
197
197
|
function writeField(scope, api, field, value) {
|
|
198
198
|
if (scope && typeof scope.mutate === "function") {
|
|
199
199
|
return scope.mutate([{ op: "set", path: [field], value: value }]).then(function () {
|
|
200
|
-
// A
|
|
201
|
-
//
|
|
200
|
+
// A settled write is not an applied write: one the Host refused
|
|
201
|
+
// (settings/conflict) still resolves. Compare the section itself —
|
|
202
|
+
// checking only `status === "ready"` passes after a refusal, because
|
|
203
|
+
// the namespace stays registered and the recovery read re-renders it
|
|
204
|
+
// as ready.
|
|
202
205
|
var snap = scope.getSnapshot();
|
|
203
|
-
if (!snap || snap.status !== "ready"
|
|
206
|
+
if (!snap || snap.status !== "ready" || snap.value === void 0) {
|
|
207
|
+
return { ok: false, error: { code: "settings-not-exposed" } };
|
|
208
|
+
}
|
|
209
|
+
if (JSON.stringify(snap.value[field]) !== JSON.stringify(value)) {
|
|
210
|
+
return { ok: false, error: { code: "settings-not-applied" } };
|
|
211
|
+
}
|
|
204
212
|
return { ok: true };
|
|
205
213
|
}, function (e) {
|
|
206
214
|
return { ok: false, error: { message: String(e && e.message || e) } };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-marketplace",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "DeepSeek Harness Web UI 内置插件市场:在设置页直接浏览 github.com/topics/dsh-plugin,支持搜索、按 Star 排序、查看安装方式。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
"platform": "web"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "node --test tests/settings-write-verify.test.mjs"
|
|
22
|
+
},
|
|
20
23
|
"files": [
|
|
21
24
|
"index.js",
|
|
22
25
|
"client.js",
|
|
@@ -47,8 +50,8 @@
|
|
|
47
50
|
},
|
|
48
51
|
"peerDependencies": {
|
|
49
52
|
"react": "^18.2.0",
|
|
50
|
-
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1",
|
|
51
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1"
|
|
53
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1 || ^0.1.5-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1 || ^0.1.5-rc.1"
|
|
52
55
|
},
|
|
53
56
|
"dependencies": {
|
|
54
57
|
"@deepseek-ai/schemastery": "^3.18.1"
|