@devflow-tools/workflow-engine 0.17.4 → 0.17.6
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 +22 -33
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,55 +1,44 @@
|
|
|
1
1
|
# @devflow-tools/workflow-engine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> DAG 工作流编排、审批门禁、worker 协调和 SSE 进度事件。(v0.17.6)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@devflow-tools/workflow-engine)
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
npm install @devflow-tools/workflow-engine
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## 快速开始
|
|
12
14
|
|
|
13
15
|
```typescript
|
|
14
16
|
import { WorkflowEngine } from '@devflow-tools/workflow-engine';
|
|
15
17
|
|
|
16
18
|
const engine = new WorkflowEngine();
|
|
17
|
-
|
|
18
|
-
// 注册工作流定义
|
|
19
|
-
engine.register({
|
|
20
|
-
name: 'bugfix',
|
|
21
|
-
description: '标准 Bug 修复流程',
|
|
22
|
-
steps: [
|
|
23
|
-
{ id: 'analyze', needs: [] },
|
|
24
|
-
{ id: 'fix', needs: ['analyze'] },
|
|
25
|
-
{ id: 'verify', needs: ['fix'] },
|
|
26
|
-
],
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// 启动工作流
|
|
19
|
+
engine.register({ name: 'bugfix', steps: [{ id: 'analyze', needs: [] }, { id: 'verify', needs: ['analyze'] }] });
|
|
30
20
|
const run = await engine.run('bugfix', { issue: 'login broken' });
|
|
31
|
-
|
|
32
|
-
// 审批门禁
|
|
33
|
-
await engine.approve(run.id, 'analyze');
|
|
34
21
|
```
|
|
35
22
|
|
|
36
|
-
##
|
|
23
|
+
## 公共 API / 命令
|
|
24
|
+
|
|
25
|
+
`WorkflowEngine`、`topologicalSort`、`executeLevels`、`StepResolver` 以及 `failure-classifier` 子路径。
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 配置与运行时
|
|
29
|
+
|
|
30
|
+
工作流通过 SDK 的定义和 telemetry 记录执行状态;需要审批的步骤必须显式调用引擎的审批接口。
|
|
31
|
+
|
|
32
|
+
## 版本与兼容性
|
|
37
33
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- **步骤处理器** — 可插拔的 handler 模式
|
|
34
|
+
- 当前包版本:`0.17.6`
|
|
35
|
+
- Node.js:未在 package manifest 声明更高版本时,使用 Node.js 18+;原生 SQLite/Playwright 能力请按对应依赖安装
|
|
36
|
+
- workspace 内部包应使用同一 DevFlow minor/patch 版本,避免类型和数据库 schema 不一致
|
|
42
37
|
|
|
43
|
-
##
|
|
38
|
+
## 相关链接
|
|
44
39
|
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
- `.run(name, input)` — 启动工作流运行
|
|
48
|
-
- `.status(runId)` — 获取运行状态
|
|
49
|
-
- `.approve(runId, stepId)` — 审批通过某步骤
|
|
50
|
-
- `.reject(runId, stepId, reason?)` — 审批拒绝某步骤
|
|
51
|
-
- `.stream(runId)` — 获取 SSE 事件流
|
|
52
|
-
- `.listRuns()` — 列出运行历史
|
|
40
|
+
- [DevFlow 仓库](https://github.com/shilongfeicool/dev-flow)
|
|
41
|
+
- [问题反馈](https://github.com/shilongfeicool/dev-flow/issues)
|
|
53
42
|
|
|
54
43
|
## License
|
|
55
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devflow-tools/workflow-engine",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"clean": "rm -rf dist"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@devflow-tools/sdk": "0.17.
|
|
25
|
-
"@devflow-tools/telemetry": "0.17.
|
|
24
|
+
"@devflow-tools/sdk": "0.17.6",
|
|
25
|
+
"@devflow-tools/telemetry": "0.17.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "^5.5.0",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "669fea3aa72aa3fde14ed50d24c1fec4dfac088f"
|
|
35
35
|
}
|