@deepseek-ai/dsh-tool-workflow 0.1.5-rc.2 → 0.1.6-alpha.2

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.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/workflow/tool-workflow/README.md
5
- README.md: 8c93fa2658703f2252b3300a4c55cec4ae5fa0cf
6
- README.zh.md: 9c607d64dadda909f5c00581f33273d35301a3c9
5
+ README.md: 4cf16a233637da3fb2384ba80cdba8adb0298e5a
6
+ README.zh.md: cfbbdd74f14c1c6f8c8c97b2bb84366ff61bb4d1
package/README.md CHANGED
@@ -58,7 +58,7 @@ This section explains how the consumer is split from the engine and how the run
58
58
 
59
59
  ### Design concept
60
60
 
61
- The consumer owns the model-facing schema, the `tool:<toolName>` system-prompt guidance, and the result envelope; script parsing, execution, caps, and cancellation live behind `ctx.workflowEngine`, so a hardened engine swaps in without changing what the model sees. Usage guidance ships with the tool plugin as a prompt section, never in the deployment persona.
61
+ The consumer owns the model-facing schema, the `tool:<toolName>` system-prompt guidance, and the result envelope; script parsing, execution, caps, and cancellation live behind `ctx.workflowEngine`, while the PTC engine shares Node process confinement with `run_code`. Usage guidance ships with the tool plugin as a prompt section, never in the deployment persona.
62
62
 
63
63
  ### Run lifecycle
64
64
 
@@ -91,7 +91,7 @@ Read these pages when the tool-level contract is not enough. They move from the
91
91
 
92
92
  - [Workflow subsystem](../../../docs/subsystems/workflow.md) — the seam contract, start request, and event payloads.
93
93
  - [Workflow seam](../workflow/README.md) — the run and result vocabulary behind the tool.
94
- - [Worker-thread engine](../workflow-worker-thread/README.md) — the engine that executes the scripts.
94
+ - [PTC workflow engine](../workflow-ptc/README.md) — the engine that executes the scripts.
95
95
  - [subagent tool](../../subagent/tool-subagent/README.md) — the plain-delegation alternative for one or two children.
96
96
  - [Group map](../README.md) — the workflow capability family and its packages.
97
97
  - [Dynamic workflows Agent Note](../../../.agents/notes/implemented/feature/2026-07-05-dynamic-workflows.md) — the seam design and its decisions.
package/README.zh.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "面向模型的 workflow 工具:运行扇出 subagent 的 JavaScript 编排脚本,供选择或配置模型驱动编排的用户与维护者阅读。"
2
+ description: "面向模型的工作流工具:运行扇出 subagent 的 JavaScript 编排脚本,供选择或配置模型驱动编排的用户与维护者阅读。"
3
3
  kind: "package-reference"
4
4
  ---
5
5
 
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- `dsh-tool-workflow` 让模型运行 JavaScript 编排脚本,把工作委派给多个 subagent,并返回脚本的最终 JSON 值。仅当用户明确要求工作流或大型多 agent 编排时使用;一两项委派应使用普通 subagent 调用。父级轮次会等待所有委派任务结束;取消或异常完成会返回错误,而不是部分成功。部署方可以通过 `toolName` 重命名工具,并通过 `maxResultChars` 限制渲染结果文本。
12
+ `dsh-tool-workflow` 让模型运行 JavaScript 编排脚本,把工作委派给多个 subagent,并返回脚本的最终 JSON 值。仅当用户明确要求工作流或大型多 agent(智能体)编排时使用;一两项委派应使用普通 subagent 调用。父级轮次会等待所有委派任务结束;取消或异常完成会返回错误,而不是部分成功。部署方可以通过 `toolName` 重命名工具,并通过 `maxResultChars` 限制渲染结果文本。
13
13
 
14
14
  ## 目录
15
15
 
@@ -35,7 +35,7 @@ kind: "package-reference"
35
35
 
36
36
  ### 运行期间的预期
37
37
 
38
- 脚本运行期间,父级轮次会等待:工具启动运行、等待其结果,并始终 dispose(资源释放)它,因此脚本及其子 agent 在每条路径上完全停稳——包括从父级步骤中止信号桥接而来的取消。模型只看到最终结果,永远不会看到中间子 agent 消息;子 agent 自己的工作不会进入父级对话。
38
+ 脚本运行期间,父级轮次会等待:工具启动运行、等待其结果,并始终对该运行执行 dispose(资源释放),因此脚本及其子 agent 在每条路径上完全停稳——包括从父级步骤中止信号桥接而来的取消。模型只看到最终结果,永远不会看到中间子 agent 消息;子 agent 自己的工作不会进入父级对话。
39
39
 
40
40
  ### 配置
41
41
 
@@ -58,15 +58,15 @@ kind: "package-reference"
58
58
 
59
59
  ### 设计理念
60
60
 
61
- 消费方拥有模型侧 schema、`tool:<toolName>` 系统提示词指导与结果包络;脚本解析、执行、上限与取消位于 `ctx.workflowEngine` 之后,因此更坚固的引擎可以无缝替换,而不改变模型看到的内容。使用指导以提示词段的形式随工具插件交付,绝不放入部署 persona。
61
+ 消费方拥有模型侧 schema、`tool:<toolName>` 系统提示词指导与结果包络;脚本解析、执行、上限与取消位于 `ctx.workflowEngine` 之后,PTC 引擎与 `run_code` 共享 Node 进程约束。使用指导以提示词段的形式随工具插件交付,绝不放入部署 persona。
62
62
 
63
63
  ### 运行生命周期
64
64
 
65
- `execute` 启动运行,并在 `try/finally` 内等待 `run.result`;该结构总会 dispose 运行。`exec.signal` 会桥接到 `run.cancel()`,包括启动前已经中止的情况。非 `completed` 结束原因会映射为报告原因的 `isError` 结果;完成时渲染 `{ runId, agentsStarted, result }`,Native 渲染器只会在 `maxResultChars` 处截断该投影。
65
+ `execute` 启动运行,并在 `try/finally` 内等待 `run.result`;该结构总会对运行执行 dispose。`exec.signal` 会桥接到 `run.cancel()`,包括启动前已经中止的情况。非 `completed` 结束原因会映射为报告原因的 `isError` 结果;完成时渲染 `{ runId, agentsStarted, result }`,Native 渲染器只会在 `maxResultChars` 处截断该投影。
66
66
 
67
67
  ### 持久会话记录
68
68
 
69
- 对于根 transport 执行(`exec.parent` 缺省),工具会用四个 log-only 事件把运行投影到调用 Agent 的 Session:`start()` 返回后写 run-start,只记录 `run.id` 匹配的成员开始与结束,并且只在结果可用且 dispose 完全停稳后写 run-end。嵌套 transport 调用照常执行,但不写任何记录。任一次 Session append 首次失败后,本运行会停止后续记录并只告警一次,留下空记录或合法连续前缀,同时不改变工具结果和清理。包 invariant 会在冷加载与实时追加时拒绝重复 start、未配对成员、仍有开放成员的终点与 run-end 后更新,同时允许缺失终态后缀的连续前缀。
69
+ 对于根 transport 执行(`exec.parent` 缺省),工具会用四个 log-only 事件把运行投影到调用方 agent 的会话:`start()` 返回后写 run-start,只记录 `run.id` 匹配的成员开始与结束,并且只在结果可用且 dispose 完全停稳后写 run-end。嵌套 transport 调用照常执行,但不写任何记录。会话追加操作首次失败后,本运行会停止后续记录并只告警一次,留下空记录或合法连续前缀,同时不改变工具结果和清理。包 invariant 会在冷加载与实时追加时拒绝重复 start、未配对成员、仍有开放成员的终点与 run-end 后更新,同时允许缺失终态后缀的连续前缀。
70
70
 
71
71
  ### 渲染意图
72
72
 
@@ -78,7 +78,7 @@ kind: "package-reference"
78
78
  |---|---|
79
79
  | [`src/index.ts`](src/index.ts) | 插件入口:工具注册、运行生命周期、记录器接线 |
80
80
  | [`src/types.ts`](src/types.ts) | 四个 log-only 记录事件 payload 及其 `SessionEventMap` 声明 |
81
- | [`src/invariant.ts`](src/invariant.ts) | 不变式伴生插件:持久工作流记录协议校验 |
81
+ | [`src/invariant.ts`](src/invariant.ts) | 不变式配套入口:持久工作流记录协议校验 |
82
82
 
83
83
  </details>
84
84
 
@@ -87,11 +87,11 @@ kind: "package-reference"
87
87
  <a id="further-exploration"></a>
88
88
  ## 进一步探索
89
89
 
90
- 当工具级契约不够用时阅读以下页面。它们从共享工作流模型逐步进入引擎与可比的委派工具。
90
+ 当工具级约定不够用时阅读以下页面。这些页面依次介绍共享工作流模型、引擎,以及可供比较的委派工具。
91
91
 
92
- - [工作流子系统](../../../docs/subsystems/workflow.zh.md)——seam 契约、启动请求与事件载荷。
92
+ - [工作流子系统](../../../docs/subsystems/workflow.zh.md)——seam 约定、启动请求与事件载荷。
93
93
  - [工作流 seam](../workflow/README.zh.md)——工具背后的运行与结果词汇。
94
- - [worker-thread 引擎](../workflow-worker-thread/README.zh.md)——执行脚本的引擎。
94
+ - [PTC 工作流引擎](../workflow-ptc/README.zh.md)——执行脚本的引擎。
95
95
  - [subagent 工具](../../subagent/tool-subagent/README.zh.md)——一两项委派时的普通委派替代方案。
96
96
  - [组地图](../README.zh.md)——工作流能力家族及其包。
97
97
  - [动态工作流 Agent Note](../../../.agents/notes/implemented/feature/2026-07-05-dynamic-workflows.zh.md)——seam 设计及其决策。
@@ -119,7 +119,7 @@ Use the <toolName> tool ONLY when the user explicitly asks for a workflow or for
119
119
 
120
120
  #### KV Cache 影响
121
121
 
122
- 只要插件作用域与指导文本不变,前缀就保持稳定。启用或 dispose(资源释放)可能会使从该提示词段起的缓存复用失效。
122
+ 只要插件作用域与指导文本不变,前缀就保持稳定。启用或 dispose 可能会使从该提示词段起的缓存复用失效。
123
123
 
124
124
  ### 工具 schema
125
125
 
@@ -228,8 +228,7 @@ export function apply(ctx, config) {
228
228
  signal: exec.signal,
229
229
  });
230
230
  const recordsRun = exec.parent === undefined;
231
- // The shipped worker-thread engine publishes member events from later
232
- // worker messages, after start() returns and this run record is active.
231
+ // The engine publishes member events after start() returns and this run record is active.
233
232
  if (recordsRun)
234
233
  recorder.start(parent.session, run);
235
234
  // Bridge the tool's abort signal to the run: if the parent step is aborted while the
@@ -116,6 +116,7 @@ const install = Object.assign((ctx, fail) => {
116
116
  const staged = new WeakMap();
117
117
  const seed = (session) => {
118
118
  const trace = new Map();
119
+ // oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
119
120
  for (const event of session.snapshotEvents().filter(isWorkflowRecordEvent))
120
121
  applyEvent(trace, event, fail);
121
122
  traces.set(session, trace);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tool-workflow",
3
3
  "description": "Model-facing workflow tool: run a JavaScript orchestration script over ctx.workflowEngine",
4
- "version": "0.1.5-rc.2",
4
+ "version": "0.1.6-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,29 +37,29 @@
37
37
  ],
38
38
  "license": "MIT",
39
39
  "peerDependencies": {
40
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.2",
41
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
42
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
43
- "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
44
- "@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
45
- "@deepseek-ai/dsh-workflow": "^0.1.5-rc.2",
46
- "@deepseek-ai/cordis": "^4.0.2",
47
- "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2"
40
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
41
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
42
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
43
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
44
+ "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
45
+ "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
46
+ "@deepseek-ai/dsh-workflow": "^0.1.6-alpha.2",
47
+ "@deepseek-ai/cordis": "^4.0.2"
48
48
  },
49
49
  "dependencies": {
50
50
  "@deepseek-ai/schemastery": "^3.18.2"
51
51
  },
52
52
  "devDependencies": {
53
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.2",
54
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
55
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
56
- "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
57
- "@deepseek-ai/dsh-subagent": "^0.1.5-rc.2",
58
- "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
59
- "@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
60
- "@deepseek-ai/dsh-workflow": "^0.1.5-rc.2",
61
- "@deepseek-ai/dsh-workflow-worker-thread": "^0.1.5-rc.2",
53
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
54
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
55
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
56
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
57
+ "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
58
+ "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
59
+ "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
60
+ "@deepseek-ai/dsh-workflow-ptc": "^0.1.6-alpha.2",
62
61
  "@deepseek-ai/cordis": "^4.0.2",
63
- "@deepseek-ai/dsh-session-projection": "^0.1.5-rc.2"
62
+ "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
63
+ "@deepseek-ai/dsh-workflow": "^0.1.6-alpha.2"
64
64
  }
65
65
  }