@deepseek-ai/dsh-workflow 0.0.1-rc.2 → 0.1.0-rc.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/LICENSE +17 -24
- package/README.i18n.yaml +2 -2
- package/README.md +3 -3
- package/README.zh.md +8 -8
- package/lib/index.js +4 -4
- package/lib/types/index.d.ts +5 -5
- package/lib/types/index.js +4 -4
- package/package.json +15 -15
package/LICENSE
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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/workflow/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: cc2c24f62512273ea1657542d0d904b0b870e236
|
|
6
|
+
README.zh.md: 22bda1bd33bc6350c8ff51f27538258bee872fdb
|
package/README.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
The workflow seam (`ctx.
|
|
5
|
+
The workflow seam (`ctx.workflowEngine`) executes a model-written orchestration script that can fan out subagents. The seam defines the script, run, result, error, and event contracts; an engine decides how to isolate and execute the script.
|
|
6
6
|
|
|
7
|
-
`@deepseek-ai/dsh-workflow-
|
|
7
|
+
`@deepseek-ai/dsh-workflow-worker-thread` is the current engine and `@deepseek-ai/dsh-tool-workflow` is the model-facing consumer. A future process or sandbox engine can replace the implementation without changing the tool.
|
|
8
8
|
|
|
9
9
|
The package root is the Host face. The browser-safe `@deepseek-ai/dsh-workflow/types` subpath contains run identities, metadata, results, and observe-only lifecycle payloads without importing `Agent`, Cordis services, or Host context declarations; Host-only `WorkflowStartRequest` and `WorkflowRun` live behind the package root.
|
|
10
10
|
|
|
11
11
|
## Service and run contract
|
|
12
12
|
|
|
13
|
-
`
|
|
13
|
+
`WorkflowEngine.start(request): WorkflowRun` validates enough synchronously to reject a malformed meta block, unparseable script, unavailable provider route, or unsupported per-run limit before a run exists. Once returned, `WorkflowRun.result` never rejects: execution failures resolve with `stopReason: 'error'`, and cancellation resolves with `cancelled` within the engine's bounded grace.
|
|
14
14
|
|
|
15
15
|
A run is holder-owned. Engine-plugin unload prevents new starts but does not revoke accepted runs. The holder must call `dispose()` on every path; disposal cancels remaining work and reaches or abandons quiescence within the documented bound.
|
|
16
16
|
|
package/README.zh.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
工作流 seam
|
|
5
|
+
工作流 seam(扩展点,`ctx.workflowEngine`)执行由模型编写、可扇出 subagent 的编排脚本。该 seam 定义脚本、运行、结果、错误和事件契约;引擎负责决定如何隔离并执行脚本。
|
|
6
6
|
|
|
7
|
-
`@deepseek-ai/dsh-workflow-
|
|
7
|
+
`@deepseek-ai/dsh-workflow-worker-thread` 是当前引擎,`@deepseek-ai/dsh-tool-workflow` 是面向模型的消费方。未来的进程或沙箱引擎可以替换实现,而无需更改工具。
|
|
8
8
|
|
|
9
9
|
包根是 Host face。浏览器安全的 `@deepseek-ai/dsh-workflow/types` 子路径包含运行身份、元数据、结果和仅供观察的生命周期 payload,不导入 `Agent`、Cordis service 或 Host Context 声明;Host 专用的 `WorkflowStartRequest` 与 `WorkflowRun` 只从包根提供。
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 服务与运行契约
|
|
12
12
|
|
|
13
|
-
`
|
|
13
|
+
`WorkflowEngine.start(request): WorkflowRun` 会同步完成足够多的校验,在运行创建前拒绝格式错误的 meta 块、无法解析的脚本、不可用的提供方路由或不受支持的单次运行限制。返回后,`WorkflowRun.result` 绝不拒绝:执行失败以 `stopReason: 'error'` 兑现,取消则在引擎有限的宽限时间内以 `cancelled` 兑现。
|
|
14
14
|
|
|
15
15
|
运行由持有方负责。引擎插件卸载会阻止新的启动,但不会撤销已接受的运行。持有方必须在每条路径上调用 `dispose()`;dispose(资源释放)会取消剩余工作,并在文档规定的期限内达到或放弃完全停稳。
|
|
16
16
|
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
- `workflow/phase` 和 `workflow/log` 公开脚本叙述;
|
|
27
27
|
- `workflow/agent-start` / `workflow/agent-end` 按 `seq` 为每次子 agent 调用配对;提供方的异步启动调用被拒绝时,该子 agent 不会发出其中任何一个事件。
|
|
28
28
|
|
|
29
|
-
同进程事件 payload
|
|
29
|
+
同进程事件 payload 是以不可变方式借用的值。每个监听器都独立隔离:同步抛出异常或返回的 promise 被拒绝时,只会记录日志,不会阻塞同级监听器或改变执行。
|
|
30
30
|
|
|
31
31
|
## 失败纪律
|
|
32
32
|
|
|
33
33
|
`WorkflowError` 携带一个代码和 `fatal` 标志。致命错误总会逸出 `parallel()` 和 `pipeline()`,而不会变成普通的逐项 `null`:
|
|
34
34
|
|
|
35
35
|
- `SCRIPT_PARSE` / `META_INVALID`:工作流无法启动;
|
|
36
|
-
- `INVALID_ARGUMENT` / `UNSUPPORTED_OPTION` / `UNSUPPORTED_SCHEMA
|
|
36
|
+
- `INVALID_ARGUMENT` / `UNSUPPORTED_OPTION` / `UNSUPPORTED_SCHEMA`:钩子调用违反引擎契约;
|
|
37
37
|
- `AGENT_CAP` / `ITEM_CAP`:超过已配置的安全上限;
|
|
38
38
|
- `AGENT_START`:提供方的异步启动调用被拒绝;
|
|
39
39
|
- `AGENT_RESULT`:已发布子 agent 的结果因基础设施故障而被拒绝;
|
|
40
40
|
- `RESULT_UNSERIALIZABLE`:脚本/worker 值不是普通 JSON 数据;
|
|
41
|
-
- `CANCELLED
|
|
41
|
+
- `CANCELLED`:取消会接管该运行,待处理和未来的钩子都会拒绝。
|
|
42
42
|
|
|
43
43
|
子 agent 若以非完成的结束原因正常兑现,并不属于基础设施异常:`agent()` 返回 `null`,使脚本可以处理普通的子 agent 失败。
|
|
44
44
|
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
- **没有 token 预算词汇**:引擎会限制并发、条目和子 agent,但请求与结果都不会统计跨子 agent 的模型 token。
|
|
59
59
|
- **运行由持有方负责,不由服务跟踪**:卸载引擎不会发现独立的活动句柄;每个消费方都必须 dispose 自己启动的运行。
|
|
60
60
|
|
|
61
|
-
暂缓实现的工作流接口见[动态工作流 Agent Note](../../../.agents/notes/implemented/feature/2026-07-05-dynamic-workflows.md)。
|
|
61
|
+
暂缓实现的工作流接口见[动态工作流 Agent Note(agent 决策记录)](../../../.agents/notes/implemented/feature/2026-07-05-dynamic-workflows.md)。
|
package/lib/index.js
CHANGED
|
@@ -19,7 +19,7 @@ function WorkflowRunId(id) {
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region lib/types/index.js
|
|
21
21
|
/**
|
|
22
|
-
* Service Definition for the workflow capability seam. Service
|
|
22
|
+
* Service Definition for the workflow capability seam. Service Providers execute orchestration scripts;
|
|
23
23
|
* observe-only lifecycle events never expose run control.
|
|
24
24
|
* @module @deepseek-ai/dsh-workflow
|
|
25
25
|
*/
|
|
@@ -56,9 +56,9 @@ function isFatalWorkflowError(error) {
|
|
|
56
56
|
* listener failures are contained, and `workflow/end` fires exactly once as the
|
|
57
57
|
* result settles.
|
|
58
58
|
*/
|
|
59
|
-
var
|
|
59
|
+
var WorkflowEngine = class extends Service {
|
|
60
60
|
constructor(ctx) {
|
|
61
|
-
super(ctx, "
|
|
61
|
+
super(ctx, "workflowEngine");
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Emit a lifecycle event while containing and logging each listener failure.
|
|
@@ -89,4 +89,4 @@ function renderListenerError(error) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
|
-
export {
|
|
92
|
+
export { WorkflowEngine, WorkflowEngine as default, WorkflowError, WorkflowRunId, isFatalWorkflowError };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Service Definition for the workflow capability seam. Service
|
|
2
|
+
* Service Definition for the workflow capability seam. Service Providers execute orchestration scripts;
|
|
3
3
|
* observe-only lifecycle events never expose run control.
|
|
4
4
|
* @module @deepseek-ai/dsh-workflow
|
|
5
5
|
*/
|
|
@@ -12,7 +12,7 @@ export type { WorkflowAgentEndInfo, WorkflowAgentInfo, WorkflowAgentOutcome, Wor
|
|
|
12
12
|
export type { WorkflowRun, WorkflowStartRequest } from './runtime-types.ts';
|
|
13
13
|
declare module '@deepseek-ai/cordis' {
|
|
14
14
|
interface Context {
|
|
15
|
-
|
|
15
|
+
workflowEngine: WorkflowEngine;
|
|
16
16
|
}
|
|
17
17
|
interface Events {
|
|
18
18
|
/**
|
|
@@ -70,7 +70,7 @@ declare module '@deepseek-ai/cordis' {
|
|
|
70
70
|
'workflow/end'(info: WorkflowRunInfo, result: WorkflowResultInfo): void;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
/** The full set of `workflow/*` event names {@link
|
|
73
|
+
/** The full set of `workflow/*` event names {@link WorkflowEngine.emitWorkflowEvent} dispatches. */
|
|
74
74
|
export type WorkflowEventName = 'workflow/start' | 'workflow/phase' | 'workflow/log' | 'workflow/agent-start' | 'workflow/agent-end' | 'workflow/end';
|
|
75
75
|
/**
|
|
76
76
|
* Machine-routable fatal workflow failures: parse/meta/argument/schema errors,
|
|
@@ -108,7 +108,7 @@ export declare function isFatalWorkflowError(error: unknown): boolean;
|
|
|
108
108
|
* listener failures are contained, and `workflow/end` fires exactly once as the
|
|
109
109
|
* result settles.
|
|
110
110
|
*/
|
|
111
|
-
export declare abstract class
|
|
111
|
+
export declare abstract class WorkflowEngine extends Service {
|
|
112
112
|
constructor(ctx: Context);
|
|
113
113
|
/**
|
|
114
114
|
* Parse and execute a workflow script.
|
|
@@ -124,5 +124,5 @@ export declare abstract class WorkflowService extends Service {
|
|
|
124
124
|
*/
|
|
125
125
|
protected emitWorkflowEvent(name: WorkflowEventName, ...args: unknown[]): void;
|
|
126
126
|
}
|
|
127
|
-
export default
|
|
127
|
+
export default WorkflowEngine;
|
|
128
128
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Service Definition for the workflow capability seam. Service
|
|
2
|
+
* Service Definition for the workflow capability seam. Service Providers execute orchestration scripts;
|
|
3
3
|
* observe-only lifecycle events never expose run control.
|
|
4
4
|
* @module @deepseek-ai/dsh-workflow
|
|
5
5
|
*/
|
|
@@ -39,9 +39,9 @@ export function isFatalWorkflowError(error) {
|
|
|
39
39
|
* listener failures are contained, and `workflow/end` fires exactly once as the
|
|
40
40
|
* result settles.
|
|
41
41
|
*/
|
|
42
|
-
export class
|
|
42
|
+
export class WorkflowEngine extends Service {
|
|
43
43
|
constructor(ctx) {
|
|
44
|
-
super(ctx, '
|
|
44
|
+
super(ctx, 'workflowEngine');
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Emit a lifecycle event while containing and logging each listener failure.
|
|
@@ -76,5 +76,5 @@ function renderListenerError(error) {
|
|
|
76
76
|
return '[unrenderable thrown value]';
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
export default
|
|
79
|
+
export default WorkflowEngine;
|
|
80
80
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-workflow",
|
|
3
|
-
"description": "Workflow capability seam: ctx.
|
|
4
|
-
"version": "0.0
|
|
3
|
+
"description": "Workflow capability seam: ctx.workflowEngine service, run vocabulary, and workflow/* events",
|
|
4
|
+
"version": "0.1.0-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"lib/types/**/*.js",
|
|
36
36
|
"lib/types/**/*.d.ts"
|
|
37
37
|
],
|
|
38
|
-
"license": "
|
|
38
|
+
"license": "MIT",
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-agent": "^0.0
|
|
41
|
-
"@deepseek-ai/dsh-brand": "^0.0
|
|
42
|
-
"@deepseek-ai/dsh-invariants": "^0.0
|
|
43
|
-
"@deepseek-ai/dsh-llm": "^0.0
|
|
44
|
-
"@deepseek-ai/dsh-session": "^0.0
|
|
45
|
-
"@deepseek-ai/cordis": "^4.0.1
|
|
40
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.2",
|
|
41
|
+
"@deepseek-ai/dsh-brand": "^0.1.0-rc.2",
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.2",
|
|
43
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.2",
|
|
44
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.2",
|
|
45
|
+
"@deepseek-ai/cordis": "^4.0.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-invariants": "^0.0
|
|
51
|
-
"@deepseek-ai/dsh-llm": "^0.0
|
|
52
|
-
"@deepseek-ai/dsh-session": "^0.0
|
|
53
|
-
"@deepseek-ai/cordis": "^4.0.1
|
|
48
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.2",
|
|
49
|
+
"@deepseek-ai/dsh-brand": "^0.1.0-rc.2",
|
|
50
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.2",
|
|
52
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.2",
|
|
53
|
+
"@deepseek-ai/cordis": "^4.0.1"
|
|
54
54
|
}
|
|
55
55
|
}
|