@devflow-tools/workflow-engine 0.8.9 → 0.8.11

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.
Files changed (2) hide show
  1. package/README.md +22 -16
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @devflow-tools/workflow-engine
2
2
 
3
- Workflow engine for DevFlow — DAG-based execution engine for standardized AI development workflows.
3
+ DevFlow 工作流引擎 — DAG 步骤编排,支持审批门禁和 SSE 实时流式推送。
4
4
 
5
5
  ## Installation
6
6
 
@@ -15,35 +15,41 @@ import { WorkflowEngine } from '@devflow-tools/workflow-engine';
15
15
 
16
16
  const engine = new WorkflowEngine();
17
17
 
18
- // Register a workflow definition
18
+ // 注册工作流定义
19
19
  engine.register({
20
20
  name: 'bugfix',
21
- description: 'Standard bug fix workflow',
21
+ description: '标准 Bug 修复流程',
22
22
  steps: [
23
- { id: 'analyze', command: 'context', needs: [] },
24
- { id: 'fix', command: 'edit', needs: ['analyze'] },
25
- { id: 'test', command: 'verify', needs: ['fix'] },
23
+ { id: 'analyze', needs: [] },
24
+ { id: 'fix', needs: ['analyze'] },
25
+ { id: 'verify', needs: ['fix'] },
26
26
  ],
27
27
  });
28
28
 
29
- // Run a workflow
29
+ // 启动工作流
30
30
  const run = await engine.run('bugfix', { issue: 'login broken' });
31
+
32
+ // 审批门禁
33
+ await engine.approve(run.id, 'analyze');
31
34
  ```
32
35
 
33
36
  ## Features
34
37
 
35
- - **DAG execution** — topological sort with parallel branch support
36
- - **Step resolution** — pluggable step handlers
37
- - **SSE streaming** — real-time status updates
38
- - **Approval gates** — approve/reject steps for human-in-the-loop
38
+ - **DAG 编排** — 拓扑排序,支持分支并发执行
39
+ - **审批门禁** — 步骤级 approve/reject,支持人工介入
40
+ - **SSE 流式推送** — 实时推送步骤状态变化
41
+ - **步骤处理器** — 可插拔的 handler 模式
39
42
 
40
43
  ## API
41
44
 
42
- - `WorkflowEngine` — main class
43
- - `.register(definition)` — register a workflow definition
44
- - `.run(name, input)` — start a workflow run
45
- - `.status(runId)` — get run status
46
- - `topologicalSort(steps)` — sort steps by dependency order
45
+ - `new WorkflowEngine()` — 构造函数
46
+ - `.register(definition)` — 注册工作流定义
47
+ - `.run(name, input)` — 启动工作流运行
48
+ - `.status(runId)` — 获取运行状态
49
+ - `.approve(runId, stepId)` — 审批通过某步骤
50
+ - `.reject(runId, stepId, reason?)` — 审批拒绝某步骤
51
+ - `.stream(runId)` — 获取 SSE 事件流
52
+ - `.listRuns()` — 列出运行历史
47
53
 
48
54
  ## License
49
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/workflow-engine",
3
- "version": "0.8.9",
3
+ "version": "0.8.11",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "clean": "rm -rf dist"
18
18
  },
19
19
  "dependencies": {
20
- "@devflow-tools/sdk": "^0.8.9"
20
+ "@devflow-tools/sdk": "^0.8.11"
21
21
  },
22
22
  "devDependencies": {
23
23
  "typescript": "^5.5.0",
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "5c9a804d3c2e6e6822b516fde67d5b789dbdb5b3"
29
+ "gitHead": "a0a0b61377aa88ebbd380f50a5d532f63175ef45"
30
30
  }