agency-orchestrator 0.6.12 → 0.6.13
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/dist/core/parser.js
CHANGED
|
@@ -65,6 +65,12 @@ export function validateWorkflow(workflow) {
|
|
|
65
65
|
const stepById = new Map(workflow.steps.map(s => [s.id, s]));
|
|
66
66
|
// step.output 唯一性检查:两个 step 不能 output 到同一个变量名
|
|
67
67
|
// 否则下游引用拿到的值取决于 context Map 的写入顺序,不可预期
|
|
68
|
+
//
|
|
69
|
+
// 两类合法例外不报错:
|
|
70
|
+
// 1. any_completed 分支收敛:下游用 depends_on_mode: any_completed 引用这些
|
|
71
|
+
// 重名 step(任一分支完成即走,重名 output 是有意设计)
|
|
72
|
+
// 2. loop 迭代覆盖:重名 step 中有任一个带 loop 字段(种子 step + loop step
|
|
73
|
+
// 反复覆盖同名 output,是常见的"原地修改"迭代模式,如 write/revise/brand_review 链)
|
|
68
74
|
const outputToSteps = new Map();
|
|
69
75
|
for (const step of workflow.steps) {
|
|
70
76
|
if (!step.output)
|
|
@@ -74,9 +80,17 @@ export function validateWorkflow(workflow) {
|
|
|
74
80
|
outputToSteps.set(step.output, owners);
|
|
75
81
|
}
|
|
76
82
|
for (const [outName, owners] of outputToSteps) {
|
|
77
|
-
if (owners.length
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
if (owners.length <= 1)
|
|
84
|
+
continue;
|
|
85
|
+
const ownerSet = new Set(owners);
|
|
86
|
+
const hasAnyCompletedConsumer = workflow.steps.some(s => s.depends_on_mode === 'any_completed'
|
|
87
|
+
&& s.depends_on?.some(d => ownerSet.has(d)));
|
|
88
|
+
if (hasAnyCompletedConsumer)
|
|
89
|
+
continue;
|
|
90
|
+
const hasLoopOwner = owners.some(id => stepById.get(id)?.loop);
|
|
91
|
+
if (hasLoopOwner)
|
|
92
|
+
continue;
|
|
93
|
+
errors.push(`output 变量 "${outName}" 被多个 step 同时产出: ${owners.join(', ')}(重名会让下游引用结果不确定)`);
|
|
80
94
|
}
|
|
81
95
|
// 计算每个 step 的 DAG 上游 step ids(递归 depends_on 闭包,不含自身)。
|
|
82
96
|
// 用于校验"变量必须来自 inputs 或当前 step 的上游"——和 autoFix 的拓扑约束保持一致
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agency-orchestrator",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
4
4
|
"description": "Multi-agent YAML workflow engine — 211 AI roles, auto DAG parallelism, zero code. One sentence → multiple AI roles collaborate → complete plan in minutes. 10 LLM providers, 7 need no API key.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multi-agent",
|