@feng0531/dsh-execution-bus 0.1.2 → 0.2.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,7 +2,7 @@
2
2
 
3
3
  **让模型发出一次执行请求,由程序负责排队、等待和收取结果。**
4
4
 
5
- DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.1.2**
5
+ DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.2.0**
6
6
 
7
7
  > 当前是早期可运行版本,不是完整生产验收版。已验证真实 DSH 组件和脚本模型驱动的内存会话;真实模型、桌面界面和 PTC 完整链路尚未验收。**不支持重启后恢复任务。**
8
8
 
@@ -79,6 +79,14 @@ flowchart TD
79
79
 
80
80
  `host.read` 在出队时重新进入宿主工具管线,沿用宿主当前权限、会话工作目录及输出限制。插件不自行启动命令、不提供任意远程执行服务。它也不会强制将现有工具改成总线调用。
81
81
 
82
+ ## 在 Agent 预设中选择测试模式
83
+
84
+ 从 0.2.0 起,包内提供标准 DSH bundle patch。通过宿主正常加载这个 bundle 后,设置 → Agent 预设 → **自定义**区域会收到“执行总线测试 / Execution Bus Test”预设定义;选择它创建一个新测试会话。不要把它设成默认,也不要修改正在使用的普通会话。宿主一般只允许空白会话切换预设。
85
+
86
+ 该预设只在自己的作用域注册 execution_bus,使用原生工具调用,不改其他会话的 PTC 模式。它没有 shell 行;宿主文件工具套件会声明 read/write/edit 等工具,但测试模式的执行 guard 只允许总线、read 和 Job 控制,写入/编辑即使可见也会拒绝。它不是进程级沙箱,读取边界仍由宿主权限决定;同一测试预设的会话共享有界队列容量,但请求结果按会话隔离。
87
+
88
+ **不要同时把包根入口作为全局工具插件加载**:那是手工集成入口,会使 execution_bus 全局可见,失去此预设的可见性隔离。仅安装 npm 包也不保证卡片立即出现,需要加载包声明的 bundle patch。当前桌面未安装此版本,卡片实机展示尚未验证。
89
+
82
90
  ## 安装前先确认
83
91
 
84
92
  - 兼容目标:**DSH 0.2.0-rc.2 / Cordis 4.0.4**,Node.js 22 或以上。其他宿主版本未承诺兼容。
@@ -92,12 +100,12 @@ flowchart TD
92
100
  2. 在你选定的隔离 DSH 配置依赖目录安装固定版本,不要在 DSH 程序安装目录执行:
93
101
 
94
102
  ```powershell
95
- npm install --ignore-scripts @feng0531/dsh-execution-bus@0.1.2
103
+ npm install --ignore-scripts @feng0531/dsh-execution-bus@0.2.0
96
104
  ```
97
105
 
98
106
  这是 npm 目录示例。若目标配置使用 pnpm,应沿用其包管理器,不混用锁文件。遇到宿主 peer 版本冲突就停止,不用强制安装绕过。
99
107
 
100
- 3. 在该实例现有插件加载配置中加入包名,并放在具备上述服务的组合内。配置结构依宿主组合而定,本项目不提供未经验证的通用配置键。
108
+ 3. 使用宿主插件管理器的 bundle 安装机制加载本包声明的补丁。手工维护配置时,将包加入目标配置的既有 dsh.profile.bundles,并沿用该配置的包管理器;不要把包根入口加入全局工具行。其补丁只插入独立预设,不替换已有模式或默认选择。
101
109
  4. 按宿主正常方式加载,由你决定是否需要重载或重启。确认本会话出现 `execution_bus` 后再测试。
102
110
 
103
111
  **发布或本仓库测试不会替你安装、升级或重启 DSH,也不需要修改 DSH 源码或 ASAR。**
@@ -221,7 +229,7 @@ npm run test:install # 临时目录安装,不操作日常 DSH
221
229
 
222
230
  - [协议和投递语义](<docs/protocol.md>):字段、状态、重复处理与取消规则。
223
231
  - [宿主兼容性与源码调用链](<docs/host-compatibility.md>):为什么可以等待,为什么不能跨重启恢复。
224
- - [验证记录](<docs/validation.md>)、[0.1.2 发布说明](<docs/releases/0.1.2.md>):已验证与未验证范围。
232
+ - [验证记录](<docs/validation.md>)、[0.2.0 发布说明](<docs/releases/0.2.0.md>):已验证与未验证范围。
225
233
  - [维护者发布流程](<docs/RELEASING.md>):标签 CI、安装包校验与正式发布门禁。
226
234
 
227
235
  ## 许可
@@ -0,0 +1,25 @@
1
+ # Registers a selectable custom preset, not a global execution_bus tool.
2
+ - insert:
3
+ - id: preset-execution-bus-test
4
+ name: '@deepseek-ai/dsh-agent-preset'
5
+ config:
6
+ id: execution-bus-test
7
+ name: 执行总线测试 / Execution Bus Test
8
+ description: 独立可选测试模式:只读文件、延迟与失败演示、进度和取消。不修改默认模式,禁止命令和写入执行;不支持重启恢复。
9
+ order: 20
10
+ plugins:
11
+ - id: execution-bus-persona
12
+ name: '@deepseek-ai/dsh-persona'
13
+ config:
14
+ prefix: >-
15
+ 你正在执行总线测试模式中。只使用 execution_bus、只读文件和任务控制工具。
16
+ 请求只提交一次并等待结果,不循环查询进度;同一逻辑操作重发沿用 requestId。
17
+ 默认先用 test Handler 做延迟成功、失败和取消测试,读取真实文件须有用户要求。
18
+ cancelRequested 不代表已取消,unknown 不代表执行失败。禁止声称跨重启恢复或完整模型性能提升。
19
+ suffix: 'Your working directory is {{cwd}}.'
20
+ - id: execution-bus-file-tools
21
+ name: '@deepseek-ai/dsh-tool-fs'
22
+ - id: execution-bus-job-tools
23
+ name: '@deepseek-ai/dsh-tool-jobs'
24
+ - id: execution-bus-scoped-runtime
25
+ name: '@feng0531/dsh-execution-bus/test-mode'
@@ -0,0 +1,5 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ export declare const name = "execution-bus-test-mode";
3
+ export declare const inject: string[];
4
+ /** Must be mounted inside the host's preset scope, never in the global composition. */
5
+ export declare function apply(ctx: Context): void;
@@ -0,0 +1,24 @@
1
+ import { scopeOf } from "@deepseek-ai/dsh-scope";
2
+ import { apply as applyBus } from "./plugin.js";
3
+ export const name = "execution-bus-test-mode";
4
+ export const inject = ["tools", "jobs"];
5
+ /** Must be mounted inside the host's preset scope, never in the global composition. */
6
+ export function apply(ctx) {
7
+ if (scopeOf(ctx) === undefined)
8
+ throw Error("Execution Bus test mode requires an Agent preset scope");
9
+ ctx.tools.presentAs("native");
10
+ const allowed = new Set([
11
+ "execution_bus",
12
+ "read",
13
+ "job_list",
14
+ "job_output",
15
+ "job_kill",
16
+ ]);
17
+ // Scope-local file suite also declares write/edit; the execution guard denies them.
18
+ // restrict() only accepts known GLOBAL tool names, so it cannot filter sibling preset rows.
19
+ // Restriction filters inherited tools; a guard also fences tools registered by sibling preset rows.
20
+ ctx.tools.guard((exec) => allowed.has(exec.name)
21
+ ? undefined
22
+ : "Execution Bus test mode allows only bus, read and job controls");
23
+ applyBus(ctx);
24
+ }
@@ -0,0 +1,17 @@
1
+ # 执行总线 0.2.0
2
+
3
+ ## 新增功能
4
+
5
+ 新增可选 Agent 预设“执行总线测试 / Execution Bus Test”,通过标准 dsh.bundle.patch 声明,出现在宿主 Agent 预设自定义列表。无需修改宿主前端或 DSH 源码。不会改变默认模式或已有会话。
6
+
7
+ 预设使用原生工具呈现,仅在选中预设的 Agent 作用域注册 execution_bus。提供文件工具套件和 Job 控制,通过作用域 guard 拒绝除总线、read、job_list/job_output/job_kill 外的执行;文件套件声明的写入/编辑工具可能仍可见,但调用会拒绝。预设不是独立进程安全沙箱,宿主权限仍生效。
8
+
9
+ ## 使用
10
+
11
+ 固定安装 @feng0531/dsh-execution-bus@0.2.0,并经宿主正常方式加载包内 cordis.patch.yml bundle。设置 → Agent 预设 → 自定义 → 执行总线测试,创建新会话试验。不要加载包根入口为全局工具,也不要将测试模式设为默认。发布不会自动安装或重启日常 DSH。
12
+
13
+ ## 验证和限制
14
+
15
+ 真实 AgentPresetRegistry/Loader 隔离测试验证预设成功激活、默认不变、普通 Agent 不可见总线、PTC 普通 Agent 不受测试 native 模式影响、写入被拒绝。桌面实际卡片渲染与当前会话切换未验收。相同测试预设共享队列容量,请求结果仍按会话隔离;没有跨重启恢复。不承诺其他会话在进程资源层面完全不受影响。
16
+
17
+ 非商业源码公开许可,兼容宿主 0.2.0-rc.2。
package/package.json CHANGED
@@ -1,24 +1,33 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-execution-bus",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE",
7
- "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
8
- "repository": { "type": "git", "url": "git+https://github.com/f-e-n-g-0531/dsh-execution-bus.git" },
7
+ "publishConfig": {
8
+ "access": "public",
9
+ "registry": "https://registry.npmjs.org/"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/f-e-n-g-0531/dsh-execution-bus.git"
14
+ },
9
15
  "description": "执行总线 / Execution Bus: bounded DSH handler dispatch with original-call waiting",
10
16
  "main": "dist/plugin.js",
11
17
  "exports": {
12
18
  ".": "./dist/plugin.js",
13
- "./core": "./dist/bus.js"
19
+ "./core": "./dist/bus.js",
20
+ "./test-mode": "./dist/test-mode.js"
14
21
  },
15
22
  "files": [
16
23
  "dist",
24
+ "cordis.patch.yml",
17
25
  "LICENSE",
18
26
  "THIRD_PARTY_NOTICES.md",
19
27
  "README.md",
20
28
  "docs"
21
29
  ],
30
+ "dsh": { "bundle": { "patch": "./cordis.patch.yml" } },
22
31
  "engines": {
23
32
  "node": ">=22"
24
33
  },
@@ -36,14 +45,18 @@
36
45
  },
37
46
  "peerDependencies": {
38
47
  "@deepseek-ai/cordis": "~4.0.4",
48
+ "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
39
49
  "@deepseek-ai/dsh-jobs": "0.2.0-rc.2",
40
50
  "@deepseek-ai/dsh-tools": "0.2.0-rc.2"
41
51
  },
42
52
  "devDependencies": {
43
53
  "@deepseek-ai/dsh-agent-loop": "0.2.0-rc.2",
54
+ "@deepseek-ai/dsh-agent-preset": "0.2.0-rc.2",
55
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
44
56
  "@deepseek-ai/dsh-fs-local": "0.2.0-rc.2",
45
57
  "@deepseek-ai/dsh-jobs": "0.2.0-rc.2",
46
58
  "@deepseek-ai/dsh-jobs-local": "0.2.0-rc.2",
59
+ "@deepseek-ai/dsh-persona": "0.2.0-rc.2",
47
60
  "@deepseek-ai/dsh-tool-fs": "0.2.0-rc.2",
48
61
  "@deepseek-ai/dsh-tool-jobs": "0.2.0-rc.2",
49
62
  "@types/node": "^22",