@deepseek-ai/dsh-tool-workflow 0.0.1-rc.2 → 0.0.1-rc.3

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: 349184a6e56e64cc3775990b9031ffecba7fcbb0
6
- README.zh.md: 2af8f5f8b8db2d5edf530d79dd81319846cfeeea
5
+ README.md: 918fe5b9aff74b3b959107ec1eebfd7966afe6d1
6
+ README.zh.md: f7e62560a1b581cf64d78dc379b821d17f29b3aa
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
- The model-facing **`workflow` tool**: run a JavaScript orchestration script that fans out subagents, and return the script's final value. This package owns the model-facing schema and run lifecycle over [`ctx.workflows`](../workflow/README.md); script parsing, execution, caps, and cancellation live behind the seam, while the consumer retains ownership of the parent-facing schema and result envelope.
5
+ The model-facing **`workflow` tool**: run a JavaScript orchestration script that fans out subagents, and return the script's final value. This package owns the model-facing schema and run lifecycle over [`ctx.workflowEngine`](../workflow/README.md); script parsing, execution, caps, and cancellation live behind the seam, while the consumer retains ownership of the parent-facing schema and result envelope.
6
6
 
7
7
  ## What the model sees
8
8
 
package/README.zh.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- 面向模型的 **`workflow` 工具**:运行一段扇出 subagent 的 JavaScript 编排脚本,并返回脚本的最终值。本包负责基于 [`ctx.workflows`](../workflow/README.md) 定义面向模型的 schema 和运行生命周期;脚本解析、执行、上限与取消位于 seam 之后,消费方仍负责面向父级的 schema 和结果包络。
5
+ 面向模型的 **`workflow` 工具**:运行一段扇出 subagent 的 JavaScript 编排脚本,并返回脚本的最终值。本包负责基于 [`ctx.workflowEngine`](../workflow/README.md) 定义面向模型的 schema 和运行生命周期;脚本解析、执行、上限与取消位于 seam 之后,消费方仍负责面向父级的 schema 和结果包络。
6
6
 
7
7
  ## 模型看到的内容
8
8
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  ## 生命周期
12
12
 
13
- 收集是同步的(类似 [`dsh-tool-subagent`](../../subagent/tool-subagent/README.md)):`execute` 启动运行并等待 `run.result`;这些操作位于 `try/finally` 中,该结构总会 dispose(资源释放)运行,使脚本及其子 agent(智能体)在每条路径上完全停稳。`exec.signal` 会桥接到 `run.cancel()`,包括启动前已经中止的情况。非 `completed` 结束原因会映射为报告原因的 `isError` 结果,绝不会把局部输出当作成功;`start()` 同步抛出的解析/meta 失败会变成模型可据以修正的 `isError`。完成时返回规范值 `{ runId, agentsStarted, result }`;Native 渲染器保留 meta 名称、agent 数量和 JSON 值,只会在 `maxResultChars` 处截断该投影。
13
+ 收集是同步的(类似 [`dsh-tool-subagent`](../../subagent/tool-subagent/README.md)):`execute` 启动运行并等待 `run.result`;这些操作位于 `try/finally` 中,该结构总会 dispose(资源释放)运行,使脚本及其子 agent(智能体)在每条路径上完全停稳。`exec.signal` 会桥接到 `run.cancel()`,包括启动前已经中止的情况。非 `completed` 结束原因会映射为报告原因的 `isError` 结果,绝不会把局部输出当作成功;`start()` 同步抛出的解析/meta 失败会变成模型可据以修正的 `isError`。完成时返回规范值 `{ runId, agentsStarted, result }`;Native 渲染器保留 meta 名称、agent 数量和 JSON 值,只会在 `maxResultChars` 处截断该投影。
14
14
 
15
15
  对于根 transport 执行(`exec.parent` 缺省),工具还会把运行投影到调用 Agent 的 Session:`start()` 返回后写 run-start,只记录 `run.id` 匹配的成员开始与结束,并且只在 `run.result` 已取得且 `dispose()` 完全停稳后写 run-end。嵌套 transport 调用照常执行,但不写工作流记录。任一次 Session append 首次失败后,本运行会停止后续记录并只告警一次,留下空记录或合法连续前缀,同时不改变工具结果和清理。
16
16
 
@@ -79,7 +79,7 @@ Use the <toolName> tool ONLY when the user explicitly asks for a workflow or for
79
79
 
80
80
  ## 已知限制与暂缓事项
81
81
 
82
- - **父级轮次会阻塞到整个工作流结算**:没有后台启动/轮询接口,取消会把局部输出作为错误丢弃。
83
- - **`args` 必须是对象,Native 结果文本有界**:调用方把顶层数组/标量包装到字段中;规范工作流结果保持完整,超过 `maxResultChars` 的 JSON 会在面向模型的投影中截断,而不是存储在检索句柄背后。
82
+ - **父级轮次会阻塞到整个工作流结算**:没有后台启动/轮询接口,取消会丢弃局部输出并返回错误。
83
+ - **`args` 必须是对象,Native 结果文本有界**:调用方把顶层数组/标量包装到字段中;规范工作流结果保持完整,超过 `maxResultChars` 的 JSON 会在面向模型的投影中截断,而不是存储在检索句柄背后。
84
84
  - **每次工具注册的工作流策略固定**:提供方选择、上限和工具名称属于部署配置,不是模型调用参数。
85
85
  - **持久记录只覆盖顶层且只供观察**:嵌套 Code Mode dispatch 不记录;记录故障会刻意退化为不完整前缀,而不改变执行。
package/lib/index.js CHANGED
@@ -4,7 +4,7 @@ import { defineTool } from "@deepseek-ai/dsh-tools";
4
4
  /**
5
5
  * The model-facing `workflow` tool: run a JavaScript orchestration script that fans out
6
6
  * subagents, and return the script's final value. It owns the model-facing schema and run lifecycle; script
7
- * parsing, execution, caps, and cancellation live behind `ctx.workflows`
7
+ * parsing, execution, caps, and cancellation live behind `ctx.workflowEngine`
8
8
  * (`@deepseek-ai/dsh-workflow`), so a hardened engine swaps in without touching what the model
9
9
  * sees. Execution awaits `run.result` and always disposes the run; non-completed reasons become tool
10
10
  * errors, and background collection remains deferred. Presentation is an args-only generic card
@@ -15,7 +15,7 @@ import { defineTool } from "@deepseek-ai/dsh-tools";
15
15
  const name = "tool-workflow";
16
16
  const inject = [
17
17
  "tools",
18
- "workflows",
18
+ "workflowEngine",
19
19
  "systemPrompt"
20
20
  ];
21
21
  const Config = z.object({
@@ -231,7 +231,7 @@ function apply(ctx, config) {
231
231
  async execute(args, exec) {
232
232
  const parent = exec.agent;
233
233
  if (!parent) throw new Error("workflow tool requires a calling agent (exec.agent was undefined)");
234
- const run = ctx.workflows.start({
234
+ const run = ctx.workflowEngine.start({
235
235
  script: args.script,
236
236
  meta: args.meta,
237
237
  ...args.args !== void 0 ? { args: args.args } : {},
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The model-facing `workflow` tool: run a JavaScript orchestration script that fans out
3
3
  * subagents, and return the script's final value. It owns the model-facing schema and run lifecycle; script
4
- * parsing, execution, caps, and cancellation live behind `ctx.workflows`
4
+ * parsing, execution, caps, and cancellation live behind `ctx.workflowEngine`
5
5
  * (`@deepseek-ai/dsh-workflow`), so a hardened engine swaps in without touching what the model
6
6
  * sees. Execution awaits `run.result` and always disposes the run; non-completed reasons become tool
7
7
  * errors, and background collection remains deferred. Presentation is an args-only generic card
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The model-facing `workflow` tool: run a JavaScript orchestration script that fans out
3
3
  * subagents, and return the script's final value. It owns the model-facing schema and run lifecycle; script
4
- * parsing, execution, caps, and cancellation live behind `ctx.workflows`
4
+ * parsing, execution, caps, and cancellation live behind `ctx.workflowEngine`
5
5
  * (`@deepseek-ai/dsh-workflow`), so a hardened engine swaps in without touching what the model
6
6
  * sees. Execution awaits `run.result` and always disposes the run; non-completed reasons become tool
7
7
  * errors, and background collection remains deferred. Presentation is an args-only generic card
@@ -12,7 +12,7 @@
12
12
  import z from '@deepseek-ai/schemastery';
13
13
  import { defineTool } from '@deepseek-ai/dsh-tools';
14
14
  export const name = 'tool-workflow';
15
- export const inject = ['tools', 'workflows', 'systemPrompt'];
15
+ export const inject = ['tools', 'workflowEngine', 'systemPrompt'];
16
16
  export const Config = z.object({
17
17
  toolName: z.string().default('workflow'),
18
18
  maxResultChars: z.natural().min(1).default(50_000),
@@ -220,7 +220,7 @@ export function apply(ctx, config) {
220
220
  // Meta/body validation failures (META_INVALID/SCRIPT_PARSE) throw
221
221
  // synchronously here and become isError results via the registry — the
222
222
  // model sees the violation list and can correct the call.
223
- const run = ctx.workflows.start({
223
+ const run = ctx.workflowEngine.start({
224
224
  script: args.script,
225
225
  meta: args.meta,
226
226
  ...args.args !== undefined ? { args: args.args } : {},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tool-workflow",
3
- "description": "Model-facing workflow tool: run a JavaScript orchestration script over ctx.workflows",
4
- "version": "0.0.1-rc.2",
3
+ "description": "Model-facing workflow tool: run a JavaScript orchestration script over ctx.workflowEngine",
4
+ "version": "0.0.1-rc.3",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -37,28 +37,28 @@
37
37
  ],
38
38
  "license": "BSD-3-Clause",
39
39
  "peerDependencies": {
40
- "@deepseek-ai/dsh-agent": "^0.0.1-rc.2",
41
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.2",
42
- "@deepseek-ai/dsh-session": "^0.0.1-rc.2",
43
- "@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.2",
44
- "@deepseek-ai/dsh-tools": "^0.0.1-rc.2",
45
- "@deepseek-ai/dsh-workflow": "^0.0.1-rc.2",
40
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
41
+ "@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
42
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
43
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.3",
44
+ "@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.3",
45
+ "@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
46
46
  "@deepseek-ai/cordis": "^4.0.1-rc.1",
47
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2"
47
+ "@deepseek-ai/dsh-workflow": "^0.0.1-rc.3"
48
48
  },
49
49
  "dependencies": {
50
50
  "@deepseek-ai/schemastery": "^3.18.1-rc.1"
51
51
  },
52
52
  "devDependencies": {
53
- "@deepseek-ai/dsh-agent": "^0.0.1-rc.2",
54
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
55
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.2",
56
- "@deepseek-ai/dsh-subagent": "^0.0.1-rc.2",
57
- "@deepseek-ai/dsh-session": "^0.0.1-rc.2",
58
- "@deepseek-ai/dsh-tools": "^0.0.1-rc.2",
59
- "@deepseek-ai/dsh-workflow": "^0.0.1-rc.2",
60
- "@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.2",
61
- "@deepseek-ai/cordis": "^4.0.1-rc.1",
62
- "@deepseek-ai/dsh-workflow-workerthread": "^0.0.1-rc.2"
53
+ "@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
54
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
55
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.3",
56
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
57
+ "@deepseek-ai/dsh-subagent": "^0.0.1-rc.3",
58
+ "@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.3",
59
+ "@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
60
+ "@deepseek-ai/dsh-workflow": "^0.0.1-rc.3",
61
+ "@deepseek-ai/dsh-workflow-worker-thread": "^0.0.1-rc.3",
62
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
63
63
  }
64
64
  }