@feng0531/dsh-execution-bus 0.5.0 → 0.5.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  “萧何”是产品与模式显示名,执行总线是其技术功能;不新增人物 Agent,不进行角色扮演。仓库 dsh-execution-bus、npm 包名、execution_bus 工具名及 execution-bus-test 预设 ID 保持不变。历史版本发布说明保留当时名称。
6
6
 
7
- DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.5.0**
7
+ DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.5.1**
8
8
 
9
9
  > 萧何模式从宿主已声明的 PTC 组合派生,保留日常工具,再叠加可选执行总线。已验证隔离的真实 Node PTC → 原 read + 总线调用,以及脚本模型内存会话;真实模型、桌面界面与实际沙箱仍未验收。**不支持重启后恢复任务。**
10
10
 
@@ -83,13 +83,22 @@ flowchart TD
83
83
 
84
84
  | Handler 名称 | 用途 | 输入 |
85
85
  |---|---|---|
86
- | `test` | 检查延迟、进度、成功、失败和取消 | `delayMs`:0–30000;`fail`:布尔值 |
86
+ | `test`(诊断,非业务) | 仅在明确诊断时检查延迟、进度、成功、失败和取消 | `delayMs`:0–30000;`fail`:布尔值 |
87
87
  | `host.read` | 经由 DSH 现有 `read` 工具读取文本 | `file_path`;可选 `offset` 和 `limit`,最多 100 行 |
88
88
 
89
89
  `host.read` 在出队时重新进入宿主工具管线,沿用宿主当前权限、会话工作目录及输出限制。插件不自行启动命令、不提供任意远程执行服务。它也不会强制将现有工具改成总线调用。
90
90
 
91
91
  ## 选择“萧何”预设
92
92
 
93
+ 正式模式入口为 `/mode`。新生成预设在原 PTC 组合末尾追加以下行,它不是整份预设:
94
+
95
+ ```yaml
96
+ - id: xiao-he-execution-bus
97
+ name: '@feng0531/dsh-execution-bus/mode'
98
+ ```
99
+
100
+ 旧 /test-mode 保留为兼容别名,两个入口指向同一正式模块,不表示测试专用模式,也不要同时配置新旧两行。必须先安装 0.5.1 或以上才能使用 /mode;旧包没有此导出。旧预设不会自动重写,旧入口继续有效。历史预设 ID execution-bus-test 和包级配置行 ID 不改,避免已有会话失联。
101
+
93
102
  包内提供标准 DSH bundle patch(预设组合补丁)。宿主正常加载后会收到“萧何 / Xiao He”预设定义,由既有设置 → Agent 预设 → **自定义**列表展示。建议选择它新建专门会话,不改默认选择或正在使用的普通会话。已有会话的切换受宿主空白会话检查约束。**实际桌面卡片展示尚未验收**,不能把注册表测试当作界面已通过。
94
103
 
95
104
  **0.3.0 起不再是只读验证模式。** 加载时读取宿主 `ptc` 预设的组合声明快照,保留原工具、平台表达式、禁用项和配置,只追加萧何总线与说明。不再强制 native 呈现或添加只读白名单;终端、写入、搜索、技能等能力是否可用,取决于原 PTC 配置和宿主服务。其他预设和默认模式不被修改,原 PTC 会话看不到新增总线。
@@ -115,7 +124,7 @@ flowchart TD
115
124
  2. 在你选定的隔离 DSH 配置依赖目录安装固定版本,不要在 DSH 程序安装目录执行:
116
125
 
117
126
  ```powershell
118
- npm install --ignore-scripts @feng0531/dsh-execution-bus@0.5.0
127
+ npm install --ignore-scripts @feng0531/dsh-execution-bus@0.5.1
119
128
  ```
120
129
 
121
130
  这是 npm 目录示例。若目标配置使用 pnpm,应沿用其包管理器,不混用锁文件。遇到宿主 peer 版本冲突就停止,不用强制安装绕过。
@@ -254,9 +263,11 @@ npm run test:install # 临时目录安装,不操作日常 DSH
254
263
 
255
264
  ## 进一步阅读
256
265
 
266
+ - [产品结构与兼容契约](<docs/PRODUCT.md>):正式入口、模块职责及维护验收边界。
267
+
257
268
  - [协议和投递语义](<docs/protocol.md>):字段、状态、重复处理与取消规则。
258
269
  - [宿主兼容性与源码调用链](<docs/host-compatibility.md>):为什么可以等待,为什么不能跨重启恢复。
259
- - [验证记录](<docs/validation.md>)、[0.5.0 发布说明](<docs/releases/0.5.0.md>):已验证与未验证范围。
270
+ - [验证记录](<docs/validation.md>)、[0.5.1 发布说明](<docs/releases/0.5.1.md>):已验证与未验证范围。
260
271
  - [同类项目源码整合](<docs/INTEGRATION.md>):固定来源、采用范围、许可与验证边界。
261
272
  - [维护者发布流程](<docs/RELEASING.md>):标签 CI、安装包校验与正式发布门禁。
262
273
 
package/dist/bus.js CHANGED
@@ -2,6 +2,7 @@ import { randomUUID, createHash } from "node:crypto";
2
2
  import { assertJson } from "./json.js";
3
3
  import { Diagnostics } from "./diagnostics.js";
4
4
  import { performance } from "node:perf_hooks";
5
+ import { CORE_DEFAULTS } from "./product.js";
5
6
  export function object(v) {
6
7
  if (!v || typeof v !== "object" || Array.isArray(v))
7
8
  throw Error("INVALID_OBJECT");
@@ -78,13 +79,7 @@ export class ExecutionBus {
78
79
  }
79
80
  closing;
80
81
  shutdownPhase = "open";
81
- constructor(options = {
82
- concurrency: 2,
83
- queueLimit: 32,
84
- recordLimit: 256,
85
- resultBytes: 65536,
86
- retentionMs: 3600000,
87
- }, admission = {}) {
82
+ constructor(options = CORE_DEFAULTS, admission = {}) {
88
83
  this.options = options;
89
84
  this.admission = admission;
90
85
  const allowed = ["sessionQueueLimit", "maxQueueWaitMs"];
package/dist/handlers.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { setTimeout } from "node:timers/promises";
2
+ import { LIMITS } from "./product.js";
2
3
  export const testHandler = {
3
4
  validate(input) {
4
5
  if (Object.keys(input).some((k) => !["delayMs", "fail"].includes(k)) ||
5
6
  !Number.isSafeInteger(input.delayMs) ||
6
7
  Number(input.delayMs) < 0 ||
7
- Number(input.delayMs) > 30000 ||
8
+ Number(input.delayMs) > LIMITS.diagnosticDelayMs ||
8
9
  typeof input.fail !== "boolean")
9
10
  throw Error("INVALID_TEST_INPUT");
10
11
  },
@@ -25,18 +26,18 @@ export const readHandler = {
25
26
  if (Object.keys(input).some((k) => !["file_path", "offset", "limit"].includes(k)) ||
26
27
  typeof input.file_path !== "string" ||
27
28
  !input.file_path ||
28
- input.file_path.length > 2048)
29
+ input.file_path.length > LIMITS.readPathChars)
29
30
  throw Error("INVALID_READ_INPUT");
30
31
  for (const k of ["offset", "limit"])
31
32
  if (input[k] !== undefined &&
32
33
  (!Number.isSafeInteger(input[k]) || Number(input[k]) < 1))
33
34
  throw Error("INVALID_READ_INPUT");
34
- if (Number(input.limit ?? 100) > 100)
35
+ if (Number(input.limit ?? LIMITS.readLines) > LIMITS.readLines)
35
36
  throw Error("READ_LIMIT");
36
37
  },
37
38
  async run(input, ctx) {
38
39
  if (!ctx.invoke)
39
40
  throw Error("HOST_CAPABILITY_REQUIRED");
40
- return ctx.invoke({ ...input, limit: input.limit ?? 100 }, ctx.signal);
41
+ return ctx.invoke({ ...input, limit: input.limit ?? LIMITS.readLines }, ctx.signal);
41
42
  },
42
43
  };
package/dist/mode.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ export declare const name: "execution-bus-mode";
3
+ export declare const inject: string[];
4
+ /** An additive preset row: presentation, tool inventory and authority belong to the host PTC composition. */
5
+ export declare function apply(ctx: Context): void;
package/dist/mode.js ADDED
@@ -0,0 +1,16 @@
1
+ import { scopeOf } from "@deepseek-ai/dsh-scope";
2
+ import { apply as applyBus } from "./plugin.js";
3
+ import { PRODUCT, MODE_INSTRUCTIONS } from "./product.js";
4
+ export const name = PRODUCT.modePluginName;
5
+ export const inject = ["tools", "jobs", "systemPrompt"];
6
+ /** An additive preset row: presentation, tool inventory and authority belong to the host PTC composition. */
7
+ export function apply(ctx) {
8
+ if (scopeOf(ctx) === undefined)
9
+ throw Error("Xiao He mode requires an Agent preset scope");
10
+ ctx.effect(() => ctx.systemPrompt.section({
11
+ name: "XIAO_HE_EXECUTION_BUS",
12
+ order: 1700,
13
+ text: MODE_INSTRUCTIONS,
14
+ }));
15
+ applyBus(ctx);
16
+ }
package/dist/plugin.js CHANGED
@@ -1,14 +1,12 @@
1
1
  import { randomUUID } from "node:crypto";
2
+ import { ADMISSION_DEFAULTS, REQUEST_DESCRIPTION, REQUEST_PARAMETERS, STATE_PARAMETERS, } from "./product.js";
2
3
  import { ExecutionOwner } from "./execution.js";
3
4
  import { ExecutionBus, parse } from "./bus.js";
4
5
  import { testHandler, readHandler } from "./handlers.js";
5
6
  export const name = "execution-bus";
6
7
  export const inject = ["tools", "jobs"];
7
8
  export function apply(ctx) {
8
- const bus = new ExecutionBus(undefined, {
9
- sessionQueueLimit: 16,
10
- maxQueueWaitMs: 120000,
11
- });
9
+ const bus = new ExecutionBus(undefined, ADMISSION_DEFAULTS);
12
10
  bus.register("test", testHandler);
13
11
  bus.register("host.read", readHandler);
14
12
  const executions = new ExecutionOwner();
@@ -16,7 +14,7 @@ export function apply(ctx) {
16
14
  ctx.tools.register({
17
15
  name: "execution_bus_state",
18
16
  description: "Read a bounded metadata-only snapshot of this agent session’s bus tasks. No inputs/results, no cross-session access. Do not poll during an awaited request.",
19
- parameters: { type: "object", properties: {}, additionalProperties: false },
17
+ parameters: STATE_PARAMETERS,
20
18
  output: {
21
19
  schema: {},
22
20
  render: (_a, v) => [{ type: "text", text: JSON.stringify(v) }],
@@ -39,28 +37,8 @@ export function apply(ctx) {
39
37
  });
40
38
  ctx.tools.register({
41
39
  name: "execution_bus",
42
- description: "萧何 / Xiao He. Submit a version 1 request and WAIT for its terminal result in this tool call. Reuse requestId only for the same logical operation. Handlers: test {delayMs:0..30000,fail:boolean}, host.read {file_path,offset?,limit?<=100}. Control types status/result/cancel use empty payload. Acceptance is volatile, not execution success. No polling needed; no restart resume.",
43
- parameters: {
44
- type: "object",
45
- additionalProperties: false,
46
- required: [
47
- "protocolVersion",
48
- "messageId",
49
- "requestId",
50
- "type",
51
- "payload",
52
- ],
53
- properties: {
54
- protocolVersion: { type: "integer", const: 1 },
55
- messageId: { type: "string" },
56
- requestId: { type: "string" },
57
- type: {
58
- type: "string",
59
- enum: ["request", "status", "result", "cancel"],
60
- },
61
- payload: { type: "object" },
62
- },
63
- },
40
+ description: REQUEST_DESCRIPTION,
41
+ parameters: REQUEST_PARAMETERS,
64
42
  output: {
65
43
  schema: {},
66
44
  render: (_a, v) => [{ type: "text", text: JSON.stringify(v) }],
package/dist/preset.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context, Service } from "@deepseek-ai/cordis";
2
2
  import type { PresetDefinition } from "@deepseek-ai/dsh-agent-preset-registry";
3
- export declare const PRESET_ID = "execution-bus-test";
3
+ export declare const PRESET_ID: "execution-bus-test";
4
4
  /** Capture the host-declared composition without evaluating !!js or changing disabled rows. */
5
5
  export declare function derivePreset(content: string): PresetDefinition;
6
6
  /** Host-plane registrar. readDocument is a public serialized declaration, not a private registry read. */
package/dist/preset.js CHANGED
@@ -3,7 +3,8 @@ import { entryListProblem } from "@deepseek-ai/dsh-agent-preset-registry";
3
3
  import { entryListSchema } from "@deepseek-ai/cordis-plugin-include";
4
4
  import { load } from "js-yaml";
5
5
  import { setTimeout as pause } from "node:timers/promises";
6
- export const PRESET_ID = "execution-bus-test";
6
+ import { PRODUCT } from "./product.js";
7
+ export const PRESET_ID = PRODUCT.presetId;
7
8
  /** Capture the host-declared composition without evaluating !!js or changing disabled rows. */
8
9
  export function derivePreset(content) {
9
10
  if (Buffer.byteLength(content) > 1048576)
@@ -30,14 +31,14 @@ export function derivePreset(content) {
30
31
  inspect(rows);
31
32
  return {
32
33
  id: PRESET_ID,
33
- name: "萧何 / Xiao He",
34
+ name: PRODUCT.name,
34
35
  order: 20,
35
36
  description: "继承宿主 PTC 工具组合,叠加执行请求排队、等待与结果回传。普通任务使用原工具,授权和沙箱由宿主管理;不支持重启恢复。",
36
37
  plugins: [
37
38
  ...rows,
38
39
  {
39
40
  id: "xiao-he-execution-bus",
40
- name: "@feng0531/dsh-execution-bus/test-mode",
41
+ name: PRODUCT.modeEntry,
41
42
  },
42
43
  ],
43
44
  };
@@ -0,0 +1,56 @@
1
+ /** Stable product identities and policy. Historical IDs are compatibility contracts, not display names. */
2
+ export declare const PRODUCT: Readonly<{
3
+ name: "萧何 / Xiao He";
4
+ packageName: "@feng0531/dsh-execution-bus";
5
+ presetId: "execution-bus-test";
6
+ presetRowId: "preset-execution-bus-test";
7
+ modeEntry: "@feng0531/dsh-execution-bus/mode";
8
+ modePluginName: "execution-bus-mode";
9
+ }>;
10
+ export declare const CORE_DEFAULTS: Readonly<{
11
+ concurrency: 2;
12
+ queueLimit: 32;
13
+ recordLimit: 256;
14
+ resultBytes: 65536;
15
+ retentionMs: 3600000;
16
+ }>;
17
+ export declare const ADMISSION_DEFAULTS: Readonly<{
18
+ sessionQueueLimit: 16;
19
+ maxQueueWaitMs: 120000;
20
+ }>;
21
+ export declare const LIMITS: Readonly<{
22
+ readLines: 100;
23
+ readPathChars: 2048;
24
+ diagnosticDelayMs: 30000;
25
+ }>;
26
+ export declare const REQUEST_PARAMETERS: {
27
+ readonly type: "object";
28
+ readonly additionalProperties: false;
29
+ readonly required: readonly ["protocolVersion", "messageId", "requestId", "type", "payload"];
30
+ readonly properties: {
31
+ readonly protocolVersion: {
32
+ readonly type: "integer";
33
+ readonly const: 1;
34
+ };
35
+ readonly messageId: {
36
+ readonly type: "string";
37
+ };
38
+ readonly requestId: {
39
+ readonly type: "string";
40
+ };
41
+ readonly type: {
42
+ readonly type: "string";
43
+ readonly enum: readonly ["request", "status", "result", "cancel"];
44
+ };
45
+ readonly payload: {
46
+ readonly type: "object";
47
+ };
48
+ };
49
+ };
50
+ export declare const STATE_PARAMETERS: {
51
+ readonly type: "object";
52
+ readonly properties: {};
53
+ readonly additionalProperties: false;
54
+ };
55
+ export declare const REQUEST_DESCRIPTION = "\u8427\u4F55 / Xiao He. Submit a version 1 request and WAIT for its terminal result in this tool call. Reuse requestId only for the same logical operation. Business handler: host.read {file_path,offset?,limit?<=100}. Diagnostic handler only: test {delayMs:0..30000,fail:boolean}; never use it to perform real work. Control status/result/cancel use empty payload. Acceptance is volatile, not success. No polling or restart resume.";
56
+ export declare const MODE_INSTRUCTIONS: string;
@@ -0,0 +1,48 @@
1
+ /** Stable product identities and policy. Historical IDs are compatibility contracts, not display names. */
2
+ export const PRODUCT = Object.freeze({
3
+ name: "萧何 / Xiao He",
4
+ packageName: "@feng0531/dsh-execution-bus",
5
+ presetId: "execution-bus-test",
6
+ presetRowId: "preset-execution-bus-test",
7
+ modeEntry: "@feng0531/dsh-execution-bus/mode",
8
+ modePluginName: "execution-bus-mode",
9
+ });
10
+ export const CORE_DEFAULTS = Object.freeze({
11
+ concurrency: 2,
12
+ queueLimit: 32,
13
+ recordLimit: 256,
14
+ resultBytes: 65536,
15
+ retentionMs: 3600000,
16
+ });
17
+ export const ADMISSION_DEFAULTS = Object.freeze({
18
+ sessionQueueLimit: 16,
19
+ maxQueueWaitMs: 120000,
20
+ });
21
+ export const LIMITS = Object.freeze({
22
+ readLines: 100,
23
+ readPathChars: 2048,
24
+ diagnosticDelayMs: 30000,
25
+ });
26
+ export const REQUEST_PARAMETERS = {
27
+ type: "object",
28
+ additionalProperties: false,
29
+ required: ["protocolVersion", "messageId", "requestId", "type", "payload"],
30
+ properties: {
31
+ protocolVersion: { type: "integer", const: 1 },
32
+ messageId: { type: "string" },
33
+ requestId: { type: "string" },
34
+ type: { type: "string", enum: ["request", "status", "result", "cancel"] },
35
+ payload: { type: "object" },
36
+ },
37
+ };
38
+ export const STATE_PARAMETERS = {
39
+ type: "object",
40
+ properties: {},
41
+ additionalProperties: false,
42
+ };
43
+ export const REQUEST_DESCRIPTION = "萧何 / Xiao He. Submit a version 1 request and WAIT for its terminal result in this tool call. Reuse requestId only for the same logical operation. Business handler: host.read {file_path,offset?,limit?<=100}. Diagnostic handler only: test {delayMs:0..30000,fail:boolean}; never use it to perform real work. Control status/result/cancel use empty payload. Acceptance is volatile, not success. No polling or restart resume.";
44
+ export const MODE_INSTRUCTIONS = "你正在萧何模式中。这不是角色扮演。保留宿主 PTC 的日常工具能力与权限规则。普通编辑、搜索、命令、安装和其他工作使用原工具,不要声称此模式只读。execution_bus 是可选协调入口,实际业务 Handler 只有 host.read;test 仅用于用户明确要求的诊断,不做真实工作,不要强制所有任务走总线。通过 run_code 调用 await tools.execution_bus(...),受原有时间预算约束。每会话排队上限 " +
45
+ ADMISSION_DEFAULTS.sessionQueueLimit +
46
+ ",排队超过 " +
47
+ ADMISSION_DEFAULTS.maxQueueWaitMs / 1000 +
48
+ " 秒且未执行会返回 QUEUE_WAIT_TIMEOUT,不自动重试。execution_bus_state 只用于用户明确诊断本会话元数据,不循环查询。请求只提交一次并等待结果,同一逻辑操作重发沿用 requestId。cancelRequested 不等于已取消,unknown 不代表执行失败,不承诺跨重启恢复。后台命令返回 Job ID 不代表已经完成。";
@@ -1,5 +1,2 @@
1
- import type { Context } from "@deepseek-ai/cordis";
2
- export declare const name = "execution-bus-test-mode";
3
- export declare const inject: string[];
4
- /** An additive preset row: presentation, tool inventory and authority belong to the host PTC composition. */
5
- export declare function apply(ctx: Context): void;
1
+ /** @deprecated Compatibility-only forwarding entry. Use the package /mode export. */
2
+ export { name, inject, apply } from "./mode.js";
package/dist/test-mode.js CHANGED
@@ -1,15 +1,2 @@
1
- import { scopeOf } from "@deepseek-ai/dsh-scope";
2
- import { apply as applyBus } from "./plugin.js";
3
- export const name = "execution-bus-test-mode"; // legacy export identity, intentionally stable
4
- export const inject = ["tools", "jobs", "systemPrompt"];
5
- /** An additive preset row: presentation, tool inventory and authority belong to the host PTC composition. */
6
- export function apply(ctx) {
7
- if (scopeOf(ctx) === undefined)
8
- throw Error("Xiao He mode requires an Agent preset scope");
9
- ctx.effect(() => ctx.systemPrompt.section({
10
- name: "XIAO_HE_EXECUTION_BUS",
11
- order: 1700,
12
- text: "你正在萧何模式中。这不是角色扮演。保留宿主 PTC 的日常工具能力与权限规则。普通编辑、搜索、命令、安装和其他工作使用原工具,不要声称此模式只读。execution_bus 是可选协调入口,目前只支持 test 与 host.read,不支持任意命令,不要强制所有任务走总线。通过 run_code 调用 await tools.execution_bus(...),受原有时间预算约束。总线默认每会话最多排队16项,排队超过120秒且尚未开始执行会返回QUEUE_WAIT_TIMEOUT,不自动重试。execution_bus_state只用于用户明确诊断本会话的元数据状态,不在等待期间循环查询。总线请求只提交一次并等待结果,不循环查询;同一逻辑操作重发沿用 requestId。cancelRequested 不等于已取消,unknown 不代表执行失败,不承诺跨重启恢复。后台命令仅返回 Job ID 不代表命令已经完成。",
13
- }));
14
- applyBus(ctx);
15
- }
1
+ /** @deprecated Compatibility-only forwarding entry. Use the package /mode export. */
2
+ export { name, inject, apply } from "./mode.js";
@@ -0,0 +1,46 @@
1
+ # 产品结构与维护契约
2
+
3
+ ## 产品边界
4
+
5
+ 萧何是 DSH 内的可选执行协调插件,提供独立可选择的 PTC 派生预设,不是 PTC 替代传输层,也不全局接管终端、编辑或其他工具。实际业务 Handler 为 host.read;test 是兼容保留的诊断 Handler,只有明确诊断需求时使用。测试能力存在不代表其他命令已接入总线。
6
+
7
+ 0.5.1 按正式产品梳理入口和共享策略,不以更名宣称完成生产环境认证。当前真实模型、桌面 UI 和实际沙箱尚未完整验收;同进程内存状态不支持跨重启恢复。
8
+
9
+ ## 入口及配置层次
10
+
11
+ | 入口 | 谁使用 | 责任 |
12
+ |---|---|---|
13
+ | 包级 bundle /preset | 目标 DSH 配置加载器 | 读取 ptc 声明快照,注册独立萧何预设 |
14
+ | Agent 内 /mode | 萧何预设末尾插件行 | 保留原 PTC 组合,追加总线工具和说明 |
15
+ | /test-mode | 旧配置兼容 | 直接映射同一个正式 mode 模块,不维护第二份实现 |
16
+ | 包根入口 | 明确自行组装的宿主 | 注册 execution_bus、execution_bus_state,不派生 PTC |
17
+ | /core | 可信嵌入方 | 自行注册 Handler 的内存核心,不提供外部身份认证 |
18
+
19
+ 正式代码在 src/mode.ts,src/test-mode.ts 只重导出。package exports 的新旧入口均映射 dist/mode.js,避免 Cordis 因插件模块身份不同而重复激活;旧物理构建文件仍兼容重导出。不要同时配置两行别名。预设 ID execution-bus-test 和配置行 ID preset-execution-bus-test 是历史兼容身份,不继续用于推荐显示名称。
20
+
21
+ ## 模块职责
22
+
23
+ | 模块 | 负责 | 不负责 |
24
+ |---|---|---|
25
+ | product | 固定身份、容量/准入默认值、工具参数与提示契约 | 不提供用户可覆盖的运行时配置入口 |
26
+ | preset | 声明派生、兼容检查和宿主注册 | 不偷偷重写源 ptc 或持久配置 |
27
+ | mode / test-mode 兼容层 | 作用域说明与工具安装 | 不改宿主权限/沙箱/呈现,不加载第二套 PTC |
28
+ | plugin | 工具身份校验、可信执行上下文和宿主 read 派发 | 不自行文件读取或创建通用命令执行端 |
29
+ | bus / json | 请求校验、幂等冲突、调度、取消、终态与有界状态 | 不以超时推定副作用失败、不自动重跑 |
30
+ | execution | Job 投影、活跃工具交付与关闭所有权 | 不作为第二个执行状态机 |
31
+ | handlers | 实际读取适配和明确诊断 Handler | 不把测试当成通用业务执行 |
32
+ | diagnostics | 有界数值轨迹 | 不保留请求内容、错误原文或充当授权审计 |
33
+
34
+ ## 兼容和错误规则
35
+
36
+ 稳定工具名、请求协议和历史预设身份保留。协议校验/背压错误与执行快照中的固定错误码分层;宿主服务错误继续保持真实失败,不统一吞掉,也不把 error 文本写入数值诊断。完整错误词汇见协议说明,本轮不重命名既有错误码。
37
+
38
+ 单一策略定义不表示开放 YAML 调参:宿主插件目前使用固定默认值;core 构造参数仍按原契约使用。新增配置界面需单独定义校验、升级与误配置回归,不能只在文档放不存在的 config 键。
39
+
40
+ ## 交付要求
41
+
42
+ - 修改身份、默认策略或工具提示时,验证共享 product 契约与实际宿主状态工具一致。
43
+ - 新旧 mode 必须指向同一个模块,派生预设必须使用正式入口。
44
+ - 严格包白名单覆盖正式模块、兼容转发与类型文件;生产隔离安装通过包导出导入两入口核对身份。
45
+ - 继续全量 core、真实宿主生命周期及 Node PTC 回归,不用文档测试替代桌面验收。
46
+ - 完整验证后统一标签 CI 和正式发布;发布不自动安装/重启日常 DSH。
@@ -0,0 +1,18 @@
1
+ # 萧何 / Xiao He 0.5.1
2
+
3
+ ## 正式产品结构整理
4
+
5
+ 本版修正 test-mode 误导命名并梳理内部职责,保留执行能力和兼容规则,不通过更名宣称生产环境已全部验收。
6
+
7
+ - 正式实现移至 mode 模块;新增 /mode 导出,新派生预设默认使用它。/test-mode 是同模块兼容别名,旧源/构建文件只保留重导出,不维护两套插件。
8
+ - 产品身份、core/准入默认策略、读取/诊断限制、工具参数和模式提示集中到 product,减少重复定义漂移。
9
+ - 真实业务 host.read 与诊断 test 明确区分:兼容保留 test,但提示模型只在用户明确诊断时使用,不将其描述成真实业务处理能力。
10
+ - 增加正式/旧入口模块身份、默认策略与提示契约测试;真实 Loader 和生产隔离安装检查正式入口。
11
+
12
+ ## 升级说明
13
+
14
+ 先安装 0.5.1 或以上,再将 Agent 预设末尾叠加行改为 @feng0531/dsh-execution-bus/mode;旧版本没有该导出。旧配置不会自动重写且继续可用,不要同时放新旧两行。包级注册入口仍是 /preset,不能与 Agent 内入口混填。
15
+
16
+ 历史预设 execution-bus-test、配置行 preset-execution-bus-test、工具名和协议不改,避免已有会话关联失效。普通 PTC、权限/沙箱、每会话16项和排队120秒等策略不变,不新增运行依赖。
17
+
18
+ 不自动安装、重写日常配置或重启 DSH。真实模型、桌面 UI 与实际沙箱仍未完整验收;不支持跨重启恢复。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-execution-bus",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -17,7 +17,8 @@
17
17
  "exports": {
18
18
  ".": "./dist/plugin.js",
19
19
  "./core": "./dist/bus.js",
20
- "./test-mode": "./dist/test-mode.js",
20
+ "./mode": "./dist/mode.js",
21
+ "./test-mode": "./dist/mode.js",
21
22
  "./preset": "./dist/preset.js"
22
23
  },
23
24
  "files": [