@liangjiehappy/dsh-deepseekbase 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,134 +2,108 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
- **DeepSeek prices, plugin discovery and model specs inside DeepSeek Harness.**
5
+ **DeepSeek prices, plugin search and sandbox test results — inside DeepSeek Harness.**
6
6
 
7
7
  ```bash
8
- dsh plugin --profile web add github:moldkey/dsh-deepseekbase
8
+ dsh plugin --profile web add @liangjiehappy/dsh-deepseekbase
9
9
  ```
10
10
 
11
11
  ---
12
12
 
13
- ## The part that matters: we test plugins for free
13
+ ## What you can do from inside DSH
14
14
 
15
- Most plugin directories tell you a plugin **exists**.
16
-
17
- None tell you whether it **installs on your version of Harness**.
18
-
19
- So we run real sandbox installs on every DSH plugin we index — **for free, forever**:
20
-
21
- | Stage | What we do |
15
+ | Ask | Tool it calls |
22
16
  |---|---|
23
- | 1 | Install it in a clean container (`dsh plugin add`) |
24
- | 2 | Confirm it shows up in `dsh plugin list` |
25
- | 3 | Confirm it mounts in the composed profile tree |
26
- | 4 | Boot the profile and check it stays alive |
17
+ | "What does DeepSeek cost?" | `deepseekbase_price` |
18
+ | "Find me a memory plugin" | `deepseekbase_plugin` |
19
+ | "How big is V4-Flash?" | `deepseekbase_specs` |
20
+ | "How much DeepSeek is actually used?" | `deepseekbase_trend` |
21
+ | **"Test whether my plugin dsh-foo installs"** | **`deepseekbase_test_plugin`** |
22
+ | **"Did it pass?"** | **`deepseekbase_test_result`** |
23
+ | **"How many free tests do I have left?"** | **`deepseekbase_quota`** |
27
24
 
28
- Stages 2–4 run with **`--network none`**, so even a malicious plugin has nowhere to send data.
29
- Containers are destroyed after each run.
30
-
31
- **Results so far: of the top 120 plugins, 13% cannot be installed at all on DSH 0.2.2-rc.1.**
32
- Eight fail on `engines.dsh` version ranges, five are not on npm anymore.
33
-
34
- Full results, updated as we test more:
35
-
36
- **→ [deepseekbase.com/ecosystem/plugin-tests](https://deepseekbase.com/ecosystem/plugin-tests/)**
37
-
38
- No sign-up. No API key. No rate limit on reading the results.
25
+ Seven tools, one file, zero runtime dependencies. Outbound HTTPS to `deepseekbase.com` only.
39
26
 
40
27
  ---
41
28
 
42
- ## What the plugin gives you
43
-
44
- | Tool | What it answers |
45
- |---|---|
46
- | `deepseekbase_price` | What does DeepSeek cost, and which provider is cheapest? |
47
- | `deepseekbase_plugin` | Which plugin does X, how popular, how risky? |
48
- | `deepseekbase_specs` | How big is the model, what context length, does it fit? |
49
- | `deepseekbase_trend` | How much is DeepSeek actually used? |
50
-
51
- ### Example
52
-
53
- > **You:** compare DeepSeek V4.1 Flash prices across providers
54
- >
55
- > **Tool returns:**
56
- > ```
57
- > Official: off-peak in $0.15 / out $0.60 per 1M tokens
58
- > Cheapest third party: Particle AI — in $0.025 / out $0.25
59
- > ```
60
- > That is a 6x spread on the same model.
29
+ ## Test your own plugin without leaving DSH
61
30
 
62
- ---
31
+ Most plugin directories tell you a plugin **exists**. None tell you whether it **installs on your
32
+ version of Harness**.
63
33
 
64
- ## Install
34
+ So we run real sandbox installs — and the plugin lets you submit yours directly:
65
35
 
66
- ```bash
67
- dsh plugin --profile web add github:moldkey/dsh-deepseekbase
68
36
  ```
37
+ You: test whether dsh-foo installs on 0.2.2-rc.1
69
38
 
70
- Restart Harness. Four tools become available.
39
+ DSH: [deepseekbase_test_plugin]
40
+ Queued.
41
+ id: 1793979912-48671
42
+ free tier left today: 2/3
43
+ It usually runs within a few minutes.
71
44
 
72
- From npm (once published):
45
+ You: did it pass?
73
46
 
74
- ```bash
75
- dsh plugin --profile web add dsh-deepseekbase
47
+ DSH: [deepseekbase_test_result]
48
+ plugin: dsh-foo
49
+ verdict: tested: pass
50
+ install_ok: True
51
+ node_modules: 12.4 MB
76
52
  ```
77
53
 
78
- ---
79
-
80
- ## Permissions
54
+ **Free tier: 3 tests per IP per day.** No sign-up, no API key.
55
+ Higher quotas are planned but not open yet — see
56
+ [pricing](https://deepseekbase.com/plugin-pricing/#test-service).
81
57
 
82
- This plugin:
58
+ ### What the four stages check
83
59
 
84
- - makes **outbound HTTPS requests** to `deepseekbase.com` only
85
- - does **not** read or write your files
86
- - does **not** read credentials or environment variables
87
- - does **not** execute shell commands
60
+ | Stage | Network | Check |
61
+ |---|---|---|
62
+ | 1 install | on | `dsh plugin add` in a clean profile |
63
+ | 2 list | **off** | `dsh plugin list` shows it |
64
+ | 3 mount | **off** | `--dump-config` contains it |
65
+ | 4 boot | **off** | profile boots and stays alive for 12 s |
88
66
 
89
- The whole implementation is `lib/index.js` — one file, zero runtime dependencies.
90
- You can audit it in five minutes.
67
+ Stages 2–4 run with `--network none`, so even a malicious plugin has nowhere to send data.
68
+ Containers are destroyed after each run.
91
69
 
92
70
  ---
93
71
 
94
- ## Data sources
72
+ ## Results so far
95
73
 
96
- | Endpoint | Used for |
97
- |---|---|
98
- | `POST https://deepseekbase.com/mcp` | prices, plugins, specs |
99
- | `GET https://deepseekbase.com/data/openrouter-tokens.json` | token trend |
100
-
101
- Everything is also browsable at <https://deepseekbase.com>.
74
+ **3,500+ plugins actually installed and mounted** in our sandbox, across the top 2,000 by downloads.
102
75
 
103
- ---
104
-
105
- ## What is deepseekbase
76
+ | Verdict | Count |
77
+ |---|---|
78
+ | pass | 2,822 |
79
+ | install fails | 654 |
80
+ | mounts but not registered | 35 |
81
+ | boot fails | 10 |
106
82
 
107
- A third-party index of the DeepSeek ecosystem. Not affiliated with DeepSeek.
83
+ Browse all of them, searchable, with per-plugin pages:
108
84
 
109
- | | |
110
- |---|---|
111
- | **283 pages** | pricing, providers, 7,164 derived models, 8,559 plugins, industry kits |
112
- | **21 open datasets** | every figure carries its source and verification date |
113
- | **Free plugin testing** | real sandbox installs, results published |
114
- | **MCP server** | `https://deepseekbase.com/mcp` for any MCP client |
85
+ **→ [deepseekbase.com/plugins](https://deepseekbase.com/plugins/)**
86
+ **→ [deepseekbase.com/ecosystem/plugin-tests](https://deepseekbase.com/ecosystem/plugin-tests/)**
115
87
 
116
- We label measurement bases explicitly. Where sources disagree, we say so instead of picking
117
- the flattering number.
88
+ No sign-up. No API key. No rate limit on **reading** the results.
118
89
 
119
90
  ---
120
91
 
121
- ## Contributing
122
-
123
- Found a bug? [Open an issue](https://github.com/moldkey/dsh-deepseekbase/issues).
92
+ ## What it does not do
124
93
 
125
- Maintain a plugin that failed our test? The error message tells you exactly why —
126
- take it and fix it. We are recording a fact, not judging your code.
94
+ - No file reads or writes
95
+ - No shell access
96
+ - No credential access
97
+ - No telemetry
127
98
 
128
- Want your plugin tested? It is free:
129
- <https://deepseekbase.com/ecosystem/plugin-tests/>
99
+ The whole implementation is one file — five minutes to audit.
130
100
 
131
101
  ---
132
102
 
133
- ## Licence
103
+ ## Data attribution
104
+
105
+ Prices come from DeepSeek's official API docs. Plugin data comes from the public npm registry and
106
+ GitHub. Test verdicts are our own sandbox runs, not official DeepSeek output.
107
+ This is a third-party index — cite it as such.
134
108
 
135
- MIT. Compiled data is attributed per entry on the website.
109
+ MIT licensed. Source: [github.com/moldkey/dsh-deepseekbase](https://github.com/moldkey/dsh-deepseekbase)
package/README.zh.md CHANGED
@@ -2,134 +2,104 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- **把 DeepSeek 的價格、插件、模型參數和三調用量接進 DeepSeek Harness。**
5
+ **在 DeepSeek Harness 裡查 DeepSeek 價格、搜索插件、看沙箱測試結果。**
6
6
 
7
7
  ```bash
8
- dsh plugin --profile web add github:moldkey/dsh-deepseekbase
8
+ dsh plugin --profile web add @liangjiehappy/dsh-deepseekbase
9
9
  ```
10
10
 
11
11
  ---
12
12
 
13
- ## 最重要的一點:我們免費測插件
13
+ ## 裝了之後能做什麼
14
14
 
15
- 大部分插件目錄只告訴你「這個插件存在」。
16
-
17
- **沒有人告訴你「它在你這個版本上裝得上嗎」。**
18
-
19
- 所以我們對索引的每個 DSH 插件做真實沙箱安裝測試 —— **免費,永久**:
20
-
21
- | 階段 | 做什麼 |
15
+ | 你說 | 調用的工具 |
22
16
  |---|---|
23
- | 1 | 在乾淨容器裡安裝(`dsh plugin add`)|
24
- | 2 | 確認它出現在 `dsh plugin list` |
25
- | 3 | 確認它掛載進組合後的配置樹 |
26
- | 4 | 啟動 profile,確認進程存活 |
27
-
28
- 第 2-4 階段完全無網絡(`--network none`),所以即使插件有惡意行為也無處可去。
29
- 容器跑完即毀。
30
-
31
- **目前的結果:頭部 120 個插件裡,13% 在 DSH 0.2.2-rc.1 上根本裝不上。**
32
- 8 個栽在 `engines.dsh` 版本範圍,5 個在 npm 上已經不存在了。
33
-
34
- 完整結果,隨測試持續更新:
17
+ | 「DeepSeek 多少錢?」 | `deepseekbase_price` |
18
+ | 「找個記憶類插件」 | `deepseekbase_plugin` |
19
+ | 「V4-Flash 多大?」 | `deepseekbase_specs` |
20
+ | 「DeepSeek 實際用了多少?」 | `deepseekbase_trend` |
21
+ | **「幫我測 dsh-foo 能不能裝」** | **`deepseekbase_test_plugin`** |
22
+ | **「過了嗎?」** | **`deepseekbase_test_result`** |
23
+ | **「我還剩幾次免費測試?」** | **`deepseekbase_quota`** |
35
24
 
36
- **→ [deepseekbase.com/ecosystem/plugin-tests](https://deepseekbase.com/ecosystem/plugin-tests/)**
37
-
38
- 不用註冊、不需要 API Key、讀結果不限次數。
25
+ 七個工具、單文件、零運行時依賴,只對 `deepseekbase.com` 發出 HTTPS 請求。
39
26
 
40
27
  ---
41
28
 
42
- ## 這個插件給你什麼
29
+ ## 不用離開 DSH 就能測自己的插件
43
30
 
44
- | 工具 | 回答什麼 |
45
- |---|---|
46
- | `deepseekbase_price` | DeepSeek 多少錢?哪家服務商最便宜? |
47
- | `deepseekbase_plugin` | 哪個插件能做 X?多少人用?風險多大? |
48
- | `deepseekbase_specs` | 模型多大?上下文多長?裝得下嗎? |
49
- | `deepseekbase_trend` | DeepSeek 到底被用了多少? |
50
-
51
- ### 例子
52
-
53
- > **你:** 比較一下 DeepSeek V4.1 Flash 各家服務商的價格
54
- >
55
- > **工具返回:**
56
- > ```
57
- > 官方:離峰 輸入 $0.15 / 輸出 $0.60 每百萬 token
58
- > 最便宜第三方:Particle AI —— 輸入 $0.025 / 輸出 $0.25
59
- > ```
60
- > 同一個模型,價差 6 倍。
31
+ 大部分插件目錄只告訴你插件**存在**。沒人告訴你它在**你這個版本的 Harness 上裝不裝得上**。
61
32
 
62
- ---
33
+ 所以我們做真實沙箱安裝 —— 而且插件讓你直接在對話裡提交:
63
34
 
64
- ## 安裝
65
-
66
- ```bash
67
- dsh plugin --profile web add github:moldkey/dsh-deepseekbase
68
35
  ```
36
+ 你:测一下 dsh-foo 在 0.2.2-rc.1 上能不能装
69
37
 
70
- 重啟 Harness,四個工具就可用。
38
+ DSH: [deepseekbase_test_plugin]
39
+ 已排队。
40
+ 编号: 1793979912-48671
41
+ 今天还剩 2/3 次免费额度
42
+ 通常几分钟内跑完。
71
43
 
72
- 從 npm 安裝(發布後):
44
+ 你:过了吗?
73
45
 
74
- ```bash
75
- dsh plugin --profile web add dsh-deepseekbase
46
+ DSH: [deepseekbase_test_result]
47
+ plugin: dsh-foo
48
+ verdict: 已测通过
49
+ install_ok: True
50
+ node_modules: 12.4 MB
76
51
  ```
77
52
 
78
- ---
79
-
80
- ## 權限
53
+ **免費額度:每 IP 每天 3 次。** 不用註冊、不用 API key。
54
+ 更高額度在計劃中但還沒開放 —— 見[定價說明](https://deepseekbase.com/zh/plugin-pricing/#test-service)。
81
55
 
82
- 這個插件:
56
+ ### 四階段測什麼
83
57
 
84
- - 只對 `deepseekbase.com` 發出 **HTTPS 請求**
85
- - **不**讀寫你的文件
86
- - **不**讀憑證或環境變量
87
- - **不**執行 shell 命令
58
+ | 階段 | 網絡 | 檢查 |
59
+ |---|---|---|
60
+ | 1 安裝 | 有網 | `dsh plugin add` 在乾淨 profile |
61
+ | 2 列裝 | **斷網** | `dsh plugin list` 能看到 |
62
+ | 3 掛載 | **斷網** | `--dump-config` 出現在配置樹 |
63
+ | 4 啟動 | **斷網** | profile 啟動 12 秒不死 |
88
64
 
89
- 整個實現就是 `lib/index.js` —— 一個文件、零運行時依賴。
90
- 五分鐘可以審完。
65
+ 後三步用 `--network none`,插件即使有惡意行為也無處可去。每個容器跑完就銷毀。
91
66
 
92
67
  ---
93
68
 
94
- ## 數據來源
69
+ ## 目前的成果
95
70
 
96
- | 端點 | 用於 |
97
- |---|---|
98
- | `POST https://deepseekbase.com/mcp` | 價格、插件、模型參數 |
99
- | `GET https://deepseekbase.com/data/openrouter-tokens.json` | token 走勢 |
100
-
101
- 全部也可以在 <https://deepseekbase.com> 瀏覽。
71
+ **3,500+ 個插件真的裝上並掛載了**,覆蓋下載量前 2,000 名。
102
72
 
103
- ---
104
-
105
- ## deepseekbase 是什麼
73
+ | 判定 | 數量 |
74
+ |---|---|
75
+ | 通過 | 2,822 |
76
+ | 裝不上 | 654 |
77
+ | 裝了沒註冊 | 35 |
78
+ | 啟動失敗 | 10 |
106
79
 
107
- 一個 DeepSeek 生態的第三方索引站。不隸屬於 DeepSeek 官方。
80
+ 全部可搜、每個插件有獨立頁面:
108
81
 
109
- | | |
110
- |---|---|
111
- | **287 頁** | 價格、服務商、7,164 個衍生模型、8,559 個插件、行業套件 |
112
- | **21 份開放數據集** | 每個數字都帶來源和驗證日期 |
113
- | **免費插件測試** | 真實沙箱安裝,結果公開 |
114
- | **MCP Server** | `https://deepseekbase.com/mcp`,任何 MCP 客戶端可用 |
115
- | **插件開發指南** | 十章,含我們自己踩的坑 |
82
+ **→ [deepseekbase.com/zh/plugins/](https://deepseekbase.com/zh/plugins/)**
83
+ **→ [deepseekbase.com/zh/ecosystem/plugin-tests/](https://deepseekbase.com/zh/ecosystem/plugin-tests/)**
116
84
 
117
- 我們會明確標註統計口徑。來源互相矛盾時,我們說出來,而不是挑好看的那個數字。
85
+ **看結果**不用註冊、不用 API key、不限次數。
118
86
 
119
87
  ---
120
88
 
121
- ## 貢獻
89
+ ## 它不做什麼
122
90
 
123
- 發現 bug?[提 issue](https://github.com/moldkey/dsh-deepseekbase/issues)。
91
+ - 不讀寫文件
92
+ - 不執行 shell
93
+ - 不碰憑證
94
+ - 不上報遙測
124
95
 
125
- 你的插件沒通過我們的測試?錯誤信息會告訴你具體原因 —— 拿去修就行。
126
- 我們記錄的是一個事實,不是評價你的代碼質量。
127
-
128
- 想讓你的插件被測試?免費:
129
- <https://deepseekbase.com/zh/ecosystem/plugin-tests/>
96
+ 整個實現就一個文件 —— 五分鐘能審完。
130
97
 
131
98
  ---
132
99
 
133
- ## 許可
100
+ ## 數據來源說明
101
+
102
+ 價格來自 DeepSeek 官方 API 文檔。插件數據來自公開的 npm registry 與 GitHub。
103
+ 測試判定是我們自己沙箱跑的,不是 DeepSeek 官方輸出。這是第三方索引 —— 引用時請標明。
134
104
 
135
- MIT。匯編的數據在網站上逐條標註來源。
105
+ MIT 許可。源碼:[github.com/moldkey/dsh-deepseekbase](https://github.com/moldkey/dsh-deepseekbase)
package/lib/index.js CHANGED
@@ -4,16 +4,27 @@
4
4
  * Brings deepseekbase.com data into DeepSeek Harness.
5
5
  *
6
6
  * Tools:
7
- * deepseekbase_price — official + third-party provider prices
8
- * deepseekbase_plugin — plugin search WITH sandbox test results
9
- * deepseekbase_specs — model technical specs
10
- * deepseekbase_trend — weekly token volume trend
7
+ * deepseekbase_price — official + third-party provider prices
8
+ * deepseekbase_plugin — plugin search WITH sandbox test results
9
+ * deepseekbase_specs — model technical specs
10
+ * deepseekbase_trend — weekly token volume trend
11
+ * deepseekbase_test_plugin — submit a plugin for a real sandbox install test
12
+ * deepseekbase_test_result — read an existing verdict
13
+ * deepseekbase_quota — remaining free test quota
14
+ * deepseekbase_check — static DSHIO/T 10 conformance check
15
+ *
16
+ * Skills:
17
+ * dshio-standards — the DSHIO standard text
18
+ * dshio-check — the conformance-checking workflow
11
19
  *
12
20
  * Data comes from the public MCP endpoint at https://deepseekbase.com/mcp
13
21
  * (JSON-RPC 2.0 over HTTP). Read-only, no API key required.
14
22
  */
15
23
 
16
24
  import { defineTool } from "@deepseek-ai/dsh-tools";
25
+ import { STANDARDS_SKILL, CHECK_SKILL } from "./skills.js";
26
+
27
+ const SKILLS = [STANDARDS_SKILL, CHECK_SKILL];
17
28
 
18
29
  const MCP_ENDPOINT = "https://deepseekbase.com/mcp";
19
30
  const TIMEOUT_MS = 15000;
@@ -75,7 +86,7 @@ const TEXT_OUTPUT = {
75
86
 
76
87
  export const name = "dsh-deepseekbase";
77
88
 
78
- export const inject = ["tools", "systemPrompt"];
89
+ export const inject = ["tools", "systemPrompt", "skills"];
79
90
 
80
91
  export function apply(ctx) {
81
92
  ctx.systemPrompt.section({
@@ -85,10 +96,36 @@ export function apply(ctx) {
85
96
  "Use the deepseekbase_* tools for DeepSeek pricing, plugin discovery with sandbox " +
86
97
  "test results, model specs and token-volume trends. Also use " +
87
98
  "deepseekbase_test_plugin to submit a plugin for a real sandbox install test and " +
88
- "deepseekbase_test_result to read the verdict. Data is a third-party index " +
89
- "(deepseekbase.com), not official DeepSeek output — cite it as such.",
99
+ "deepseekbase_test_result to read the verdict. deepseekbase_check runs a static " +
100
+ "DSHIO/T 10 conformance check on any plugin. Two skills are registered: " +
101
+ "dshio-standards (the standard text) and dshio-check (the checking workflow). " +
102
+ "Data is a third-party index (deepseekbase.com), not official DeepSeek output — " +
103
+ "cite it as such.",
90
104
  });
91
105
 
106
+ // ── SKILLS ───────────────────────────────────────────────────────────────
107
+ // 装本插件即获得 DSHIO 标准内容,不需要额外下载。
108
+ try {
109
+ if (ctx.skills && typeof ctx.skills.register === "function") {
110
+ for (const sk of SKILLS) {
111
+ ctx.skills.register({
112
+ name: sk.name,
113
+ description: sk.description,
114
+ content: sk.content,
115
+ metadata: {
116
+ source: "deepseekbase",
117
+ standard: sk.name === "dshio-standards" ? "DSHIO/T 00,10,21" : "DSHIO/T 10",
118
+ lang: "zh-Hans",
119
+ homepage: "https://deepseekbase.com/standards/",
120
+ },
121
+ ...(sk.whenToUse ? { whenToUse: sk.whenToUse } : {}),
122
+ });
123
+ }
124
+ }
125
+ } catch (e) {
126
+ // skills 服务不可用时不影响工具功能
127
+ }
128
+
92
129
  // ── TESTING HELPERS ──────────────────────────────────────────────────────
93
130
  const BASE = "https://deepseekbase.com";
94
131
  const VERSIONS = ["0.2.2-rc.1", "0.2.2-alpha.3", "0.2.1-rc.5", "0.2.1-rc.4", "0.1.1-rc.2"];
@@ -176,13 +213,54 @@ export function apply(ctx) {
176
213
  `Unsupported dsh_version "${ver}". Allowed: ${VERSIONS.join(", ")}.`,
177
214
  };
178
215
  }
216
+ const plugin = (args.plugin || "").trim();
217
+ if (!plugin) return { text: "plugin is required." };
218
+
219
+ // ── 提交前先确认包存在,避免浪费免费额度 ──
220
+ if (!plugin.startsWith("github:")) {
221
+ const regUrl =
222
+ "https://registry.npmjs.org/" +
223
+ plugin.replace("/", "%2F");
224
+ const chk = await jfetch(regUrl, {}, exec && exec.signal);
225
+ if (chk.status === 404) {
226
+ const near = await jfetch(
227
+ BASE + "/data/search-zh.json",
228
+ {},
229
+ exec && exec.signal,
230
+ );
231
+ let hint = "";
232
+ if (near.body && Array.isArray(near.body.items)) {
233
+ const base = plugin.replace(/^@[^/]+\//, "").toLowerCase();
234
+ const cands = near.body.items
235
+ .filter((x) => String(x[0] || "").toLowerCase().includes(base.slice(0, 5)))
236
+ .slice(0, 3)
237
+ .map((x) => x[0]);
238
+ if (cands.length) hint = `\nDichtbij namen: ${cands.join(", ")}`;
239
+ }
240
+ return {
241
+ text:
242
+ `"${plugin}" bestaat niet op npm (HTTP 404).\n` +
243
+ `Er is niets ingediend — je gratis quotum is NIET gebruikt.\n` +
244
+ `Controleer de pakketnaam. Volledige naam nodig, bijvoorbeeld dsh-pet of @scope/name.` +
245
+ hint,
246
+ };
247
+ }
248
+ if (chk.status !== 200) {
249
+ return {
250
+ text:
251
+ `Kon "${plugin}" niet verifiëren op npm (HTTP ${chk.status}).\n` +
252
+ `Niets ingediend. Probeer het later opnieuw of gebruik github:owner/repo.`,
253
+ };
254
+ }
255
+ }
256
+
179
257
  const r = await jfetch(
180
258
  BASE + "/test/submit",
181
259
  {
182
260
  method: "POST",
183
261
  headers: { "Content-Type": "application/json" },
184
262
  body: JSON.stringify({
185
- plugin: (args.plugin || "").trim(),
263
+ plugin,
186
264
  dsh_version: ver,
187
265
  note: (args.note || "").slice(0, 300),
188
266
  }),
@@ -306,6 +384,78 @@ export function apply(ctx) {
306
384
  }),
307
385
  );
308
386
 
387
+ // ── 8. DSHIO static conformance check ────────────────────────────────────
388
+ ctx.tools.register(
389
+ defineTool({
390
+ name: "deepseekbase_check",
391
+ description:
392
+ "Run a static DSHIO/T 10 conformance check on a DSH plugin. Returns per-clause " +
393
+ "results (clause id, pass/fail/skip/manual, evidence, fix). Static checks cover " +
394
+ "the manifest, the patch file and the profile entry structure — no sandbox needed. " +
395
+ "Clauses marked 'manual' require human judgement and are returned as a checklist, " +
396
+ "not as a verdict. Use when asked whether a plugin conforms to the DSHIO standard.",
397
+ parameters: {
398
+ plugin: {
399
+ type: "string",
400
+ required: true,
401
+ description: "npm package name or github:owner/repo to check.",
402
+ },
403
+ },
404
+ output: TEXT_OUTPUT,
405
+ isConcurrencySafe: () => true,
406
+ async execute(args, exec) {
407
+ const plugin = (args.plugin || "").trim();
408
+ if (!plugin) return { text: "plugin is required." };
409
+ const r = await jfetch(
410
+ BASE + "/api/dshio/check?plugin=" + encodeURIComponent(plugin),
411
+ {},
412
+ exec && exec.signal,
413
+ );
414
+ if (r.status === 429) {
415
+ return { text: "Rate limited (20 checks/min). Try again shortly." };
416
+ }
417
+ if (r.status !== 200 || !r.body) {
418
+ return { text: `Check failed (HTTP ${r.status}). ${String(r.text).slice(0, 200)}` };
419
+ }
420
+ const d = r.body;
421
+ if (d.error) {
422
+ return { text: `Check failed: ${d.error}` };
423
+ }
424
+ const lines = [];
425
+ lines.push(`plugin: ${d.plugin}`);
426
+ if (d.resolved) lines.push(`version: ${d.resolved.version}`);
427
+ lines.push(`baseline dsh: ${d.baseline_dsh}`);
428
+ lines.push(`standard: DSHIO/T 10 (static layer)`);
429
+ lines.push("");
430
+ const icon = { pass: "[PASS]", fail: "[FAIL]", skip: "[SKIP]", manual: "[MANUAL]" };
431
+ for (const x of d.results || []) {
432
+ lines.push(`${icon[x.status] || x.status} ${x.clause} ${x.title}`);
433
+ if (x.status === "fail") {
434
+ if (x.evidence) lines.push(` evidence: ${x.evidence}`);
435
+ if (x.fix) lines.push(` fix: ${String(x.fix).split("\n")[0]}`);
436
+ }
437
+ if (x.status === "manual" && x.guidance) {
438
+ lines.push(` check yourself: ${x.guidance}`);
439
+ }
440
+ }
441
+ const s = d.summary || {};
442
+ lines.push("");
443
+ lines.push(
444
+ `summary: pass ${s.pass || 0} / fail ${s.fail || 0} / ` +
445
+ `skip ${s.skip || 0} / manual ${s.manual || 0}`,
446
+ );
447
+ lines.push(`static conformance: ${d.conforming_static ? "YES" : "NO"}`);
448
+ if (!d.conforming_static) {
449
+ lines.push("");
450
+ lines.push("Fix the critical failures first; a sandbox test would fail anyway.");
451
+ }
452
+ lines.push("");
453
+ lines.push(`Full report: ${BASE}/plugins/${""} · standard: ${BASE}/standards/`);
454
+ return { text: lines.join("\n") };
455
+ },
456
+ }),
457
+ );
458
+
309
459
  // ── 1. Prices ────────────────────────────────────────────────────────────
310
460
  ctx.tools.register(
311
461
  defineTool({
package/lib/skills.js ADDED
@@ -0,0 +1,224 @@
1
+ // DSHIO 标准技能内容
2
+ // 装我们的插件后,模型可以直接载入这些技能来查阅标准和执行检查。
3
+
4
+ export const STANDARDS_SKILL = {
5
+ name: "dshio-standards",
6
+ description:
7
+ "DSHIO 标准体系(DSHIO/T 00 术语、DSHIO/T 10 插件标准、DSHIO/T 21 测试条件)。" +
8
+ "当用户问「符不符合 DSHIO 标准」「插件标准要求什么」「测试条件是什么」时载入本技能。" +
9
+ "本技能包含条款编号与判定规则,可直接引用条款号。",
10
+ whenToUse:
11
+ "用户询问 DSH 插件是否合规、插件应满足哪些要求、沙箱测试在什么条件下进行、" +
12
+ "或需要引用 DSHIO 标准条款号时使用。",
13
+ content: `# DSHIO 标准速查
14
+
15
+ DSHIO = DeepSeek Harness Input/Output,第三方标准体系,不是官方机构。
16
+ 标准号格式:\`DSHIO/T <序号>—<年份>\`,参照 GB/T 体例。
17
+
18
+ ## 体系结构
19
+
20
+ | 区段 | 类型 | 内容 |
21
+ |---|---|---|
22
+ | 00–09 | 基础标准 | 术语、编写规则、分类编码、评定通则 |
23
+ | 10–19 | 产品标准 | 插件、套件、工具、数据接口、主题、模型接入 |
24
+ | 20–29 | 方法标准 | 测试方法、测试条件、抽样、分级 |
25
+ | 30–39 | 管理标准 | 收录、推荐、认证、标志、申诉、修订 |
26
+
27
+ 引用单向:上层可引下层,下层不得引上层。
28
+
29
+ ## 关键原则:实施独立性
30
+
31
+ **标准不要求使用任何特定的开发工具、编程语言、构建流程或辅助库。**
32
+ 凡满足全部技术要求者即为符合,不论其如何实现。
33
+ 判定以可观测的运行时行为为准,不以源码结构为准。
34
+
35
+ 含义:
36
+ - 不强制 \`@deepseek-ai/dsh-tools\`(\`defineTool()\` 只是便捷方式,手写契约对象同样合法)
37
+ - 不强制 TypeScript
38
+ - 不强制 pnpm
39
+ - 不读源码判定
40
+
41
+ ## 术语(DSHIO/T 00)
42
+
43
+ | 术语 | 定义 | 判别条件 |
44
+ |---|---|---|
45
+ | 插件 plugin | 向 DSH 提供能力的软件单元 | 三条全满足:① \`package.json\` 有 \`dsh.bundle.patch\` ② 该字段指向的文件存在 ③ 该文件 \`insert\` 列表至少一个 entry |
46
+ | 套件 bundle | 一组插件的集合 | 作为 \`dsh.profile.bundles\` 成员出现,本身不提供能力 |
47
+ | 工具 tool | 向模型暴露的可调用函数 | \`name\`/\`description\`/\`parameters\`/\`execute\` 四字段齐全 |
48
+ | 服务 service | 向其他插件提供的可注入能力 | 以 \`inject\` 声明依赖 |
49
+ | entry | 配置树中的一个条目 | \`cordis.patch.yml\` 的 \`insert\` 列表中的一项 |
50
+ | 挂载 mount | entry 出现在合成后的配置树 | \`dsh --dump-config\` 可见 |
51
+ | 判定 verdict | 对一次测试的结论 | 五值:pass / install_failed / config_failed / installs_but_not_registered / boot_failed |
52
+
53
+ **模型无关性**:DSH 的安装、挂载、启动不依赖具体模型,因为模型接入是独立插件(\`dsh-llm-*\`)。
54
+ 所以 T0–T4 的判定在任何模型下都成立;只有 T5 依賴模型。
55
+
56
+ ## 插件标准要点(DSHIO/T 10)
57
+
58
+ ### 必须做到(critical)
59
+
60
+ | 条款 | 要求 |
61
+ |---|---|
62
+ | 5.1.1 | \`package.json\` 含 \`dsh.bundle.patch\` 字段 |
63
+ | 5.1.2 | 该字段指向的文件在包内存在 |
64
+ | 5.1.3 | patch 文件是合法 YAML(**\`@\` 开头的值必须加引号**,这是最常见错误)|
65
+ | 5.1.4 | patch 顶层是数组,至少含一个带 \`insert\` 的项 |
66
+ | 5.1.5 | 每个 entry 含非空 \`id\` 与 \`name\` |
67
+ | 5.2.2 | \`engines.dsh\` 范围包含基准版本 0.2.2-rc.1 |
68
+ | 5.2.3 | 有 \`main\` 或 \`exports\` 入口 |
69
+ | 5.3.2 | 不依赖本地绝对路径或 \`file:\` 协议 |
70
+
71
+ ### 应该做到(major)
72
+
73
+ | 条款 | 要求 |
74
+ |---|---|
75
+ | 5.2.1 | 声明 \`engines.dsh\`;缺失时按 DSH peerDependencies 判定 |
76
+ | 5.3.1 | 若声明 \`files\`,必须包含 \`lib\` 与 patch 文件 |
77
+ | 6.1.1 | 每个工具的 description 必须让人判断出「什么情况下调用它」 |
78
+ | 6.1.2 | 声明的权限与实际行为一致(不高报、不低报) |
79
+ | 6.2.1 | 不得出现红线权限组合 |
80
+
81
+ ### 红线
82
+
83
+ 同时声明 \`network\` 与(\`shell\` 或 \`filesystem\` 写权限)= 数据外泄路径 = 高风险。
84
+
85
+ ### 测试阶段(需沙箱)
86
+
87
+ | 阶段 | 网络 | 检查 |
88
+ |---|---|---|
89
+ | T1 安装 | 有网 | \`dsh plugin --profile web add <pkg>\` |
90
+ | T2 列装 | **断网** | \`dsh plugin --profile web list\` |
91
+ | T3 挂载 | **断网** | \`dsh --profile web --dump-config\` |
92
+ | T4 启动 | **断网** | profile 启动后存活 12 秒 |
93
+
94
+ T2–T4 必须 \`--network none\`:既防恶意行为外发数据,也让残留网络请求失败暴露。
95
+
96
+ ## 测试条件要点(DSHIO/T 21)
97
+
98
+ **没有固定条件的测试报告只是一人在某台机器上的印象。** 报告必须记录环境指纹:
99
+
100
+ \`\`\`
101
+ dsh=0.2.2-rc.1;img=dsh-sandbox:5.0@sha256:...;node=24.11.1;pnpm=9.15.9;mem=768m;cpu=1
102
+ \`\`\`
103
+
104
+ 固定项:DSH 版本(精确到 rc)、容器镜像 + digest、Node/pnpm 版本、内存 768MB、CPU 1 核、
105
+ 网络状态、超时(安装 180s / 验证 90s / 启动观察 12s)。
106
+
107
+ **重复次数**:对外判定至少 2 次,结果必须一致;不一致记「不稳定」,不得用于认证。
108
+
109
+ T5(模型相关)额外必须记录:模型 ID + 版本、temperature、max_tokens、
110
+ 系统提示词全文、测试提示词全文、**同一轮可用工具总数**(工具越多选错概率越高)。
111
+ T5 重复 3 次,认证用「全过」判据。
112
+
113
+ ## 判定规则
114
+
115
+ - 任何 \`critical\` 条款不符合 → 不符合标准
116
+ - 只引用有编号的条款,不要自创条款号
117
+ - 无法自动判定的条款(描述质量、权限合理性)必须标为「需人工判断」,不要替用户下结论
118
+
119
+ ## 引用格式
120
+
121
+ 引用时写:\`DSHIO/T 10—2026 第 5.2.2 条\`
122
+ 不要写:\`DSHIO-DEV\`、\`DSHIO-TEST\`(旧缩写已废止)
123
+
124
+ 标准来源:https://deepseekbase.com/standards/ · 官网 dshio.org(建设中)
125
+ 标准为第三方归纳,不是 DeepSeek 官方规范,引用时须注明。
126
+ `,
127
+ };
128
+
129
+ export const CHECK_SKILL = {
130
+ name: "dshio-check",
131
+ description:
132
+ "对某个 DSH 插件执行 DSHIO/T 10 静态符合性检查。" +
133
+ "当用户问「这个插件符不符合标准」「帮我检查我的插件」「哪里不合规」时载入本技能。" +
134
+ "检查分三层:静态(可自动)、沙箱测试(需提交)、人工判断(只能给清单)。",
135
+ whenToUse:
136
+ "用户要求检查某个插件是否符合 DSHIO 标准、想知道自己的插件哪里不合规、" +
137
+ "或要求生成合规报告时使用。",
138
+ content: `# DSHIO 插件合规检查流程
139
+
140
+ ## 三层检查,不要混为一谈
141
+
142
+ | 层 | 能判定 | 怎么得到结论 |
143
+ |---|---|---|
144
+ | **静态** | 结构合法性 | \`deepseekbase_check\` 工具,即时返回 |
145
+ | **沙箱** | 能否装/挂/启动 | \`deepseekbase_test_plugin\` 提交,几分钟出结果 |
146
+ | **人工** | 描述质量、权限合理性 | 只给清单和引导问题,**不要替用户下结论** |
147
+
148
+ ## 执行顺序
149
+
150
+ 1. 先调 \`deepseekbase_check(plugin)\` 拿静态结果
151
+ 2. 有 critical 不符合 → 直接报,不要提交沙箱测试(省额度)
152
+ 3. 静态通过 → 问用户要不要跑沙箱测试(会消耗免费额度 3 次/天)
153
+ 4. manual 类条款:列出清单,让用户自己判断
154
+
155
+ ## 怎么报告结果
156
+
157
+ **必须**:
158
+ - 引用条款号(如 \`5.2.2\`)
159
+ - 给出证据(实际值 vs 要求值)
160
+ - 给出修法(可复制粘贴的写法)
161
+ - 区分「不符合」和「需人工判断」
162
+
163
+ **禁止**:
164
+ - 说「看起来没问题」(必须有条款依据)
165
+ - 把 manual 条款判成通过或失败
166
+ - 自创条款号
167
+
168
+ ## 常见错误与修法
169
+
170
+ ### 1. \`@\` 开头未加引号(最常见)
171
+
172
+ \`\`\`yaml
173
+ # ✗ 错
174
+ - insert:
175
+ - id: foo
176
+ name: @scope/foo
177
+
178
+ # ✓ 对
179
+ - insert:
180
+ - id: foo
181
+ name: "@scope/foo"
182
+ \`\`\`
183
+
184
+ YAML 里 \`@\` 是保留指示符,不加引号会解析失败。
185
+
186
+ ### 2. \`engines.dsh\` 上界写死
187
+
188
+ \`\`\`json
189
+ // ✗ 错:排除 0.2.2-rc.1
190
+ "engines": { "dsh": ">=0.2.0-rc.2 <0.2.2-0" }
191
+
192
+ // ✓ 对:只写下界
193
+ "engines": { "dsh": ">=0.2.0-rc.2" }
194
+ \`\`\`
195
+
196
+ ### 3. files 数组漏了 patch
197
+
198
+ \`\`\`json
199
+ "files": ["lib/index.js", "cordis.patch.yml"]
200
+ \`\`\`
201
+
202
+ 只写 \`lib/index.js\` 会漏掉整个目录。
203
+
204
+ ### 4. 红线权限组合
205
+
206
+ \`\`\`json
207
+ "dsh": { "permissions": ["network", "fs-write"] } // 高危
208
+ \`\`\`
209
+
210
+ 如果确实需要,在 README 写清为什么需要 + 数据流向。
211
+
212
+ ## 示例对话
213
+
214
+ 用户:「帮我看看 dsh-pet 符不符合标准」
215
+
216
+ 正确做法:
217
+ 1. 调 \`deepseekbase_check("dsh-pet")\`
218
+ 2. 报告:「静态检查 10/10 通过。还有 2 条需人工判断:description 是否说清场景、权限是否与实际一致。要不要跑沙箱测试?(消耗 1 次免费额度,每天 3 次)」
219
+
220
+ 错误做法:
221
+ - 「dsh-pet 符合标准」← 没给条款依据,而且 manual 条款没判
222
+ - 直接跑沙箱测试 ← 没问用户,浪费额度
223
+ `,
224
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liangjiehappy/dsh-deepseekbase",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "DeepSeek prices, plugins with sandbox test results, model specs and token trends inside DeepSeek Harness — powered by deepseekbase.com",
5
5
  "keywords": [
6
6
  "deepseek-harness",