@xiangyixie/dsh-superagent 0.17.1 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,22 @@ along with the next code release. A doc-only version leaves `lib/` and `bin/`
8
8
  byte-identical to the version before it, and the pinned install line in the
9
9
  README is updated to the version being released.
10
10
 
11
+ ## 0.18.0 — 2026-11-17
12
+
13
+ ### 变更
14
+
15
+ - **工具不再对每个会话常驻。** 8 个核心工具只在面板自己的会话里可见;
16
+ 普通宿主会话只保留 `superagent_help`,调用后按需展开。委派出去的 worker
17
+ 一个 `superagent_*` 工具都看不到,不会再套娃起 run。
18
+ - **定时计划如实说明归属。** 这个宿主没有给插件暴露调度 API,`superagent_schedule`
19
+ 现在会在返回里写明「计划在本插件自己的存储里,不会出现在宿主自动化列表」,
20
+ 不再让用户去错误的地方找。
21
+
22
+ ### 修复
23
+
24
+ - **守卫误杀 `node -e`。** 引号内的 `>`、`=>`、`^` 不再被当成重定向目标;
25
+ 单字符运算符也不会再被解析成 `C:\^` 这类盘符路径。真实重定向仍按原规则拦截。
26
+
11
27
  ## 0.17.1 — 2026-11-17
12
28
 
13
29
  ### 新增
package/README.en.md CHANGED
@@ -36,12 +36,12 @@ Three steps. The desktop app and the CLI install the same plugin; each step says
36
36
 
37
37
  ### 1. Install
38
38
 
39
- Desktop: **Plugins** → **Add plugin** → enter `@xiangyixie/dsh-superagent@0.17.1` → install.
39
+ Desktop: **Plugins** → **Add plugin** → enter `@xiangyixie/dsh-superagent@0.18.0` → install.
40
40
 
41
41
  CLI:
42
42
 
43
43
  ```bash
44
- dsh plugin --profile web add @xiangyixie/dsh-superagent@0.17.1
44
+ dsh plugin --profile web add @xiangyixie/dsh-superagent@0.18.0
45
45
  ```
46
46
 
47
47
  **Restart DSH** afterwards — plugins are loaded once at host startup. You can also add the [plugin index](https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json) on the **Discover** page for one-click installs; upgrades are always remove-then-add.
@@ -1666,7 +1666,7 @@ appears to "hang" until the ignored-abort child returns.
1666
1666
 
1667
1667
  | What you see | What it means | What to do |
1668
1668
  | --- | --- | --- |
1669
- | `superagent_*` tools do not exist | The bundle row is not mounted, or the host refused to load the plugin. | Run `--dump-config` and check for the `@xiangyixie/dsh-superagent` block; reinstall with `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.17.1` and read the host log for `[dsh-superagent]` lines. |
1669
+ | `superagent_*` tools do not exist | The bundle row is not mounted, or the host refused to load the plugin. | Run `--dump-config` and check for the `@xiangyixie/dsh-superagent` block; reinstall with `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.18.0` and read the host log for `[dsh-superagent]` lines. |
1670
1670
  | `Cannot find module .../lib/control.js` (or `watch.js` / `report.js` / `wizard.js`), or `[dsh-superagent] dsh-superagent failed to load because a file it imports is missing: ...` in the host log | The copy in that profile is incomplete — an `add` that was interrupted leaves a partial extraction. From 0.14.3 the entry point names the missing file itself. The published package is not the cause: every version ships all thirty-four `lib/` files. | Delete the plugin's directory under the profile's `node_modules` (scoped `@xiangyixie/dsh-superagent`, or unscoped `dsh-superagent` from an older tarball install) and run the same `add` command again, with the version number. Do not copy files in by hand. |
1671
1671
  | `[error] the model provider rejected the API key` | The key env var is missing in the process that started the host. | Export `DEEPSEEK_API_KEY` (the default route) or the variable your route names, then restart `dsh`. |
1672
1672
  | `MISSING_CREDENTIAL ... no API key for provider route "..."` | The profile's route has no credential in the environment. | Set the env var named for that route and restart. The error line names the route, so use that, not this page. |
package/README.md CHANGED
@@ -36,12 +36,12 @@ dsh-superagent 把这件事接过去:你说一句目标,它负责拆、负
36
36
 
37
37
  ### 1. 装
38
38
 
39
- 桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.17.1` → 安装。
39
+ 桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.18.0` → 安装。
40
40
 
41
41
  命令行:
42
42
 
43
43
  ```bash
44
- dsh plugin --profile web add @xiangyixie/dsh-superagent@0.17.1
44
+ dsh plugin --profile web add @xiangyixie/dsh-superagent@0.18.0
45
45
  ```
46
46
 
47
47
  装完**重启 DSH**(插件只在宿主启动时加载一次)。也可以从「发现」页添加[插件索引](https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json)一键安装;升级一律先 `remove` 再 `add`。
@@ -1090,7 +1090,7 @@ SHA-256)。`--format html` 把同样的内容写成一个自包含
1090
1090
 
1091
1091
  | 你看到的 | 含义 | 怎么办 |
1092
1092
  | --- | --- | --- |
1093
- | `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.17.1` 重装,并在宿主日志里找 `[dsh-superagent]` 行。 |
1093
+ | `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.18.0` 重装,并在宿主日志里找 `[dsh-superagent]` 行。 |
1094
1094
  | `Cannot find module .../lib/control.js`(或 `watch.js` / `report.js` / `wizard.js`),或宿主日志里的 `[dsh-superagent] dsh-superagent failed to load because a file it imports is missing: ...` | 那个 profile 里的副本不完整——被中断的 `add` 会留下残缺的解包结果。0.14.3 起的入口会直接点名缺哪个文件。已发布的包不是原因:每个版本都带全部三十四个 `lib/` 文件。 | 删掉 profile 的 `node_modules` 下该插件的目录(带 scope 的 `@xiangyixie/dsh-superagent`,或旧 tarball 安装留下的无 scope 的 `dsh-superagent`),再用同一条 `add` 命令重装,并带上版本号。不要手工拷贝文件进去。 |
1095
1095
  | `[error] the model provider rejected the API key` | 启动宿主的那个进程里缺 key 环境变量。 | 导出 `DEEPSEEK_API_KEY`(默认路由)或你那条路由声明的变量,然后重启 `dsh`。 |
1096
1096
  | `MISSING_CREDENTIAL ... no API key for provider route "..."` | profile 的路由在环境里没有凭据。 | 设置该路由对应的环境变量并重启。错误行里写了路由名,以它为准,不要照本文。 |
package/README.zh.md CHANGED
@@ -36,12 +36,12 @@ dsh-superagent 把这件事接过去:你说一句目标,它负责拆、负
36
36
 
37
37
  ### 1. 装
38
38
 
39
- 桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.17.1` → 安装。
39
+ 桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.18.0` → 安装。
40
40
 
41
41
  命令行:
42
42
 
43
43
  ```bash
44
- dsh plugin --profile web add @xiangyixie/dsh-superagent@0.17.1
44
+ dsh plugin --profile web add @xiangyixie/dsh-superagent@0.18.0
45
45
  ```
46
46
 
47
47
  装完**重启 DSH**(插件只在宿主启动时加载一次)。也可以从「发现」页添加[插件索引](https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json)一键安装;升级一律先 `remove` 再 `add`。
@@ -1090,7 +1090,7 @@ SHA-256)。`--format html` 把同样的内容写成一个自包含
1090
1090
 
1091
1091
  | 你看到的 | 含义 | 怎么办 |
1092
1092
  | --- | --- | --- |
1093
- | `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.17.1` 重装,并在宿主日志里找 `[dsh-superagent]` 行。 |
1093
+ | `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.18.0` 重装,并在宿主日志里找 `[dsh-superagent]` 行。 |
1094
1094
  | `Cannot find module .../lib/control.js`(或 `watch.js` / `report.js` / `wizard.js`),或宿主日志里的 `[dsh-superagent] dsh-superagent failed to load because a file it imports is missing: ...` | 那个 profile 里的副本不完整——被中断的 `add` 会留下残缺的解包结果。0.14.3 起的入口会直接点名缺哪个文件。已发布的包不是原因:每个版本都带全部三十四个 `lib/` 文件。 | 删掉 profile 的 `node_modules` 下该插件的目录(带 scope 的 `@xiangyixie/dsh-superagent`,或旧 tarball 安装留下的无 scope 的 `dsh-superagent`),再用同一条 `add` 命令重装,并带上版本号。不要手工拷贝文件进去。 |
1095
1095
  | `[error] the model provider rejected the API key` | 启动宿主的那个进程里缺 key 环境变量。 | 导出 `DEEPSEEK_API_KEY`(默认路由)或你那条路由声明的变量,然后重启 `dsh`。 |
1096
1096
  | `MISSING_CREDENTIAL ... no API key for provider route "..."` | profile 的路由在环境里没有凭据。 | 设置该路由对应的环境变量并重启。错误行里写了路由名,以它为准,不要照本文。 |
package/lib/doctor.js CHANGED
@@ -123,7 +123,24 @@ export function scanRelativeImports(source) {
123
123
  */
124
124
  export function readRegisteredTools(source) {
125
125
  const names = []
126
- for (const chunk of String(source).split('ctx.tools.register(').slice(1)) {
126
+ // Tools may be registered directly or through the local `registerTool`
127
+ // wrapper that applies the panel/worker gate; both count as registrations.
128
+ for (const chunk of String(source).split(/ctx\.tools\.register\(|registerTool\(/).slice(1)) {
129
+ const match = /name:\s*['"]([^'"]+)['"]/.exec(chunk)
130
+ if (match) names.push(match[1])
131
+ }
132
+ return names
133
+ }
134
+
135
+ /**
136
+ * Tools registered straight through `ctx.tools.register(defineTool(...))` carry
137
+ * no gate, so every host session pays for them on every request. Registrations
138
+ * that go through the local `registerTool` wrapper pick up the panel/worker
139
+ * gate; those are not counted as resident.
140
+ */
141
+ export function readResidentTools(source) {
142
+ const names = []
143
+ for (const chunk of String(source).split(/ctx\.tools\.register\(\s*defineTool\(/).slice(1)) {
127
144
  const match = /name:\s*['"]([^'"]+)['"]/.exec(chunk)
128
145
  if (match) names.push(match[1])
129
146
  }
@@ -701,6 +718,21 @@ async function checkTools(packageDir, expected, { profileName, version }) {
701
718
  ].join('\n'))
702
719
  }
703
720
 
721
+ async function checkResidentTools(packageDir) {
722
+ const entry = path.join(packageDir, 'lib', 'index.js')
723
+ let source
724
+ try {
725
+ source = await fsp.readFile(entry, 'utf8')
726
+ } catch {
727
+ return check('resident', 'Resident tools', 'warn', ['cannot read lib/index.js; resident tool count skipped'])
728
+ }
729
+ const resident = readResidentTools(source)
730
+ const detail = [`resident tools: ${resident.length} (threshold 0)`]
731
+ if (resident.length === 0) return check('resident', 'Resident tools', 'pass', detail)
732
+ detail.push(`ungated: ${resident.join(', ')}`)
733
+ return check('resident', 'Resident tools', 'warn', detail, 'register these through registerTool so the panel/worker gate applies')
734
+ }
735
+
704
736
  async function checkPatchFile(packageDir, pkg, { profileName }) {
705
737
  const patchRel = pkg?.dsh?.bundle?.patch
706
738
  if (typeof patchRel !== 'string' || !patchRel.trim()) {
@@ -851,6 +883,7 @@ export async function runDoctor(options = {}) {
851
883
  checks.push(check('registry', 'Registry match', registry.status, registry.detail, registry.fix ?? null))
852
884
  }
853
885
  checks.push(await checkTools(targetDir, options.expectedTools ?? TOOL_NAMES, { profileName, version: targetPkg.version }))
886
+ checks.push(await checkResidentTools(targetDir))
854
887
  checks.push(await checkPatchFile(targetDir, targetPkg, { profileName }))
855
888
  if (profileDir) {
856
889
  checks.push(await checkProfile(profileDir, profileName))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiangyixie/dsh-superagent",
3
- "version": "0.17.1",
3
+ "version": "0.18.1",
4
4
  "description": "长周期自主执行插件:一个目标拆成可并行的子任务,交付一份合并报告,重启后仍可继续。",
5
5
  "author": "Admire (LittleChenLiya)",
6
6
  "type": "module",