@synergenius/flow-weaver-pack-weaver 0.9.138 → 0.9.142
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/bot/assistant-tools.d.ts.map +1 -1
- package/dist/bot/assistant-tools.js +5 -11
- package/dist/bot/assistant-tools.js.map +1 -1
- package/dist/bot/capability-registry.d.ts.map +1 -1
- package/dist/bot/capability-registry.js +185 -15
- package/dist/bot/capability-registry.js.map +1 -1
- package/dist/bot/dashboard.js +3 -3
- package/dist/bot/dashboard.js.map +1 -1
- package/dist/bot/hierarchy-event-log.d.ts +37 -0
- package/dist/bot/hierarchy-event-log.d.ts.map +1 -0
- package/dist/bot/hierarchy-event-log.js +58 -0
- package/dist/bot/hierarchy-event-log.js.map +1 -0
- package/dist/bot/operations.d.ts +2 -0
- package/dist/bot/operations.d.ts.map +1 -1
- package/dist/bot/operations.js +5 -0
- package/dist/bot/operations.js.map +1 -1
- package/dist/bot/profile-store.d.ts.map +1 -1
- package/dist/bot/profile-store.js +39 -0
- package/dist/bot/profile-store.js.map +1 -1
- package/dist/bot/runner.d.ts.map +1 -1
- package/dist/bot/runner.js +7 -2
- package/dist/bot/runner.js.map +1 -1
- package/dist/bot/step-executor.d.ts.map +1 -1
- package/dist/bot/step-executor.js +33 -1
- package/dist/bot/step-executor.js.map +1 -1
- package/dist/bot/swarm-controller.d.ts +1 -0
- package/dist/bot/swarm-controller.d.ts.map +1 -1
- package/dist/bot/swarm-controller.js +59 -5
- package/dist/bot/swarm-controller.js.map +1 -1
- package/dist/bot/task-store.d.ts +1 -1
- package/dist/bot/task-store.d.ts.map +1 -1
- package/dist/bot/task-store.js +25 -37
- package/dist/bot/task-store.js.map +1 -1
- package/dist/bot/task-types.d.ts +5 -1
- package/dist/bot/task-types.d.ts.map +1 -1
- package/dist/node-types/bot-report.d.ts +2 -1
- package/dist/node-types/bot-report.d.ts.map +1 -1
- package/dist/node-types/bot-report.js +9 -4
- package/dist/node-types/bot-report.js.map +1 -1
- package/dist/node-types/build-context.d.ts.map +1 -1
- package/dist/node-types/build-context.js +32 -0
- package/dist/node-types/build-context.js.map +1 -1
- package/dist/node-types/plan-task.d.ts.map +1 -1
- package/dist/node-types/plan-task.js +5 -1
- package/dist/node-types/plan-task.js.map +1 -1
- package/dist/node-types/report.d.ts +1 -1
- package/dist/node-types/report.d.ts.map +1 -1
- package/dist/node-types/report.js +58 -8
- package/dist/node-types/report.js.map +1 -1
- package/dist/ui/capability-editor.js +184 -15
- package/dist/ui/profile-editor.js +184 -15
- package/dist/ui/swarm-dashboard.js +244 -44
- package/dist/ui/task-detail-view.js +60 -29
- package/dist/ui/use-stream-timeline.d.ts.map +1 -1
- package/dist/ui/use-stream-timeline.js +69 -29
- package/dist/ui/use-stream-timeline.js.map +1 -1
- package/dist/workflows/weaver-bot.d.ts +1 -0
- package/dist/workflows/weaver-bot.d.ts.map +1 -1
- package/dist/workflows/weaver-bot.js +239 -4
- package/dist/workflows/weaver-bot.js.map +1 -1
- package/flowweaver.manifest.json +1 -1
- package/package.json +1 -1
- package/src/bot/assistant-tools.ts +5 -11
- package/src/bot/capability-registry.ts +196 -18
- package/src/bot/dashboard.ts +3 -3
- package/src/bot/hierarchy-event-log.ts +64 -0
- package/src/bot/operations.ts +7 -0
- package/src/bot/profile-store.ts +39 -0
- package/src/bot/runner.ts +8 -4
- package/src/bot/step-executor.ts +29 -1
- package/src/bot/swarm-controller.ts +62 -5
- package/src/bot/task-store.ts +26 -39
- package/src/bot/task-types.ts +7 -1
- package/src/node-types/bot-report.ts +8 -3
- package/src/node-types/build-context.ts +32 -0
- package/src/node-types/plan-task.ts +5 -1
- package/src/node-types/report.ts +56 -8
- package/src/ui/use-stream-timeline.ts +73 -33
- package/src/workflows/weaver-bot.ts +398 -3
|
@@ -50,6 +50,7 @@ function useStreamTimeline(events, isDone) {
|
|
|
50
50
|
const entries = [];
|
|
51
51
|
const nodeEntryIndex = /* @__PURE__ */ new Map();
|
|
52
52
|
const nodeStarts = /* @__PURE__ */ new Map();
|
|
53
|
+
const completedNodes = /* @__PURE__ */ new Set();
|
|
53
54
|
let idCounter = 0;
|
|
54
55
|
for (const event of events) {
|
|
55
56
|
const d = event.data ?? {};
|
|
@@ -66,6 +67,11 @@ function useStreamTimeline(events, isDone) {
|
|
|
66
67
|
case "node-start": {
|
|
67
68
|
const nodeId = d.nodeId;
|
|
68
69
|
if (nodeId) nodeStarts.set(nodeId, event.timestamp);
|
|
70
|
+
const existingStartIdx = nodeEntryIndex.get(nodeId);
|
|
71
|
+
if (existingStartIdx != null && entries[existingStartIdx]?.type === "node-started") {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
completedNodes.delete(nodeId);
|
|
69
75
|
const idx = entries.length;
|
|
70
76
|
nodeEntryIndex.set(nodeId, idx);
|
|
71
77
|
entries.push({
|
|
@@ -81,54 +87,79 @@ function useStreamTimeline(events, isDone) {
|
|
|
81
87
|
}
|
|
82
88
|
case "node-complete": {
|
|
83
89
|
const nodeId = d.nodeId;
|
|
90
|
+
if (completedNodes.has(nodeId)) break;
|
|
84
91
|
const startTs = nodeStarts.get(nodeId);
|
|
85
92
|
const duration = d.durationMs ?? (startTs ? event.timestamp - startTs : void 0);
|
|
86
93
|
if (nodeId) nodeStarts.delete(nodeId);
|
|
87
|
-
|
|
88
|
-
const completed = {
|
|
89
|
-
id: `s-${idCounter++}`,
|
|
90
|
-
timestamp: new Date(startTs ?? event.timestamp),
|
|
91
|
-
type: "node-completed",
|
|
92
|
-
nodeId,
|
|
93
|
-
label: d.label ?? d.nodeType ?? nodeId ?? "Node",
|
|
94
|
-
duration,
|
|
95
|
-
color: d.color,
|
|
96
|
-
icon: d.icon,
|
|
97
|
-
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : void 0
|
|
98
|
-
};
|
|
94
|
+
completedNodes.add(nodeId);
|
|
99
95
|
const existingIdx = nodeEntryIndex.get(nodeId);
|
|
100
96
|
if (existingIdx != null && entries[existingIdx]) {
|
|
101
|
-
|
|
97
|
+
const rawOutputs = d.outputs;
|
|
98
|
+
entries[existingIdx] = {
|
|
99
|
+
id: entries[existingIdx].id,
|
|
100
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
101
|
+
type: "node-completed",
|
|
102
|
+
nodeId,
|
|
103
|
+
label: d.label ?? d.nodeType ?? nodeId ?? "Node",
|
|
104
|
+
duration,
|
|
105
|
+
color: d.color,
|
|
106
|
+
icon: d.icon,
|
|
107
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : void 0
|
|
108
|
+
};
|
|
102
109
|
nodeEntryIndex.delete(nodeId);
|
|
103
110
|
} else {
|
|
104
|
-
|
|
111
|
+
const rawOutputs = d.outputs;
|
|
112
|
+
entries.push({
|
|
113
|
+
id: `s-${idCounter++}`,
|
|
114
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
115
|
+
type: "node-completed",
|
|
116
|
+
nodeId,
|
|
117
|
+
label: d.label ?? d.nodeType ?? nodeId ?? "Node",
|
|
118
|
+
duration,
|
|
119
|
+
color: d.color,
|
|
120
|
+
icon: d.icon,
|
|
121
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : void 0
|
|
122
|
+
});
|
|
105
123
|
}
|
|
106
124
|
break;
|
|
107
125
|
}
|
|
108
126
|
case "node-error": {
|
|
109
127
|
const nodeId = d.nodeId;
|
|
128
|
+
if (completedNodes.has(nodeId)) break;
|
|
110
129
|
const startTs = nodeStarts.get(nodeId);
|
|
111
130
|
const duration = d.durationMs ?? (startTs ? event.timestamp - startTs : void 0);
|
|
112
131
|
if (nodeId) nodeStarts.delete(nodeId);
|
|
113
|
-
|
|
114
|
-
const failed = {
|
|
115
|
-
id: `s-${idCounter++}`,
|
|
116
|
-
timestamp: new Date(startTs ?? event.timestamp),
|
|
117
|
-
type: "node-failed",
|
|
118
|
-
nodeId,
|
|
119
|
-
label: d.label ?? d.nodeType ?? nodeId ?? "Node",
|
|
120
|
-
detail: d.error,
|
|
121
|
-
duration,
|
|
122
|
-
color: d.color,
|
|
123
|
-
icon: d.icon,
|
|
124
|
-
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : void 0
|
|
125
|
-
};
|
|
132
|
+
completedNodes.add(nodeId);
|
|
126
133
|
const existingIdx = nodeEntryIndex.get(nodeId);
|
|
127
134
|
if (existingIdx != null && entries[existingIdx]) {
|
|
128
|
-
|
|
135
|
+
const rawOutputs = d.outputs;
|
|
136
|
+
entries[existingIdx] = {
|
|
137
|
+
id: entries[existingIdx].id,
|
|
138
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
139
|
+
type: "node-failed",
|
|
140
|
+
nodeId,
|
|
141
|
+
label: d.label ?? d.nodeType ?? nodeId ?? "Node",
|
|
142
|
+
detail: d.error,
|
|
143
|
+
duration,
|
|
144
|
+
color: d.color,
|
|
145
|
+
icon: d.icon,
|
|
146
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : void 0
|
|
147
|
+
};
|
|
129
148
|
nodeEntryIndex.delete(nodeId);
|
|
130
149
|
} else {
|
|
131
|
-
|
|
150
|
+
const rawOutputs = d.outputs;
|
|
151
|
+
entries.push({
|
|
152
|
+
id: `s-${idCounter++}`,
|
|
153
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
154
|
+
type: "node-failed",
|
|
155
|
+
nodeId,
|
|
156
|
+
label: d.label ?? d.nodeType ?? nodeId ?? "Node",
|
|
157
|
+
detail: d.error,
|
|
158
|
+
duration,
|
|
159
|
+
color: d.color,
|
|
160
|
+
icon: d.icon,
|
|
161
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : void 0
|
|
162
|
+
});
|
|
132
163
|
}
|
|
133
164
|
break;
|
|
134
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-stream-timeline.d.ts","sourceRoot":"","sources":["../../src/ui/use-stream-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,UAAU,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,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACtE,GAAG,IAAI,CAAC;IACT,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,mBAAmB,CAqP7F"}
|
|
@@ -38,6 +38,9 @@ export function useStreamTimeline(events, isDone) {
|
|
|
38
38
|
// Map nodeId → index in entries[] so we can replace start with complete
|
|
39
39
|
const nodeEntryIndex = new Map();
|
|
40
40
|
const nodeStarts = new Map();
|
|
41
|
+
// Track completed/failed nodes to skip duplicate completion events
|
|
42
|
+
// (FW runtime emits 2x STATUS_CHANGED per node transition)
|
|
43
|
+
const completedNodes = new Set();
|
|
41
44
|
let idCounter = 0;
|
|
42
45
|
for (const event of events) {
|
|
43
46
|
const d = event.data ?? {};
|
|
@@ -55,6 +58,14 @@ export function useStreamTimeline(events, isDone) {
|
|
|
55
58
|
const nodeId = d.nodeId;
|
|
56
59
|
if (nodeId)
|
|
57
60
|
nodeStarts.set(nodeId, event.timestamp);
|
|
61
|
+
// If we already have an in-flight entry for this node (duplicate
|
|
62
|
+
// STATUS_CHANGED from the FW runtime), skip the duplicate.
|
|
63
|
+
const existingStartIdx = nodeEntryIndex.get(nodeId);
|
|
64
|
+
if (existingStartIdx != null && entries[existingStartIdx]?.type === 'node-started') {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
// Clear completed tracking so retry loops work (node can re-enter)
|
|
68
|
+
completedNodes.delete(nodeId);
|
|
58
69
|
const idx = entries.length;
|
|
59
70
|
nodeEntryIndex.set(nodeId, idx);
|
|
60
71
|
entries.push({
|
|
@@ -70,60 +81,89 @@ export function useStreamTimeline(events, isDone) {
|
|
|
70
81
|
}
|
|
71
82
|
case 'node-complete': {
|
|
72
83
|
const nodeId = d.nodeId;
|
|
84
|
+
// Skip duplicate completion events for the same node
|
|
85
|
+
if (completedNodes.has(nodeId))
|
|
86
|
+
break;
|
|
73
87
|
const startTs = nodeStarts.get(nodeId);
|
|
74
88
|
const duration = d.durationMs ?? (startTs ? event.timestamp - startTs : undefined);
|
|
75
89
|
if (nodeId)
|
|
76
90
|
nodeStarts.delete(nodeId);
|
|
77
|
-
|
|
78
|
-
const completed = {
|
|
79
|
-
id: `s-${idCounter++}`,
|
|
80
|
-
timestamp: new Date(startTs ?? event.timestamp),
|
|
81
|
-
type: 'node-completed',
|
|
82
|
-
nodeId,
|
|
83
|
-
label: d.label ?? d.nodeType ?? nodeId ?? 'Node',
|
|
84
|
-
duration,
|
|
85
|
-
color: d.color,
|
|
86
|
-
icon: d.icon,
|
|
87
|
-
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : undefined,
|
|
88
|
-
};
|
|
91
|
+
completedNodes.add(nodeId);
|
|
89
92
|
// Replace the node-started entry in-place
|
|
90
93
|
const existingIdx = nodeEntryIndex.get(nodeId);
|
|
91
94
|
if (existingIdx != null && entries[existingIdx]) {
|
|
92
|
-
|
|
95
|
+
const rawOutputs = d.outputs;
|
|
96
|
+
entries[existingIdx] = {
|
|
97
|
+
id: entries[existingIdx].id,
|
|
98
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
99
|
+
type: 'node-completed',
|
|
100
|
+
nodeId,
|
|
101
|
+
label: d.label ?? d.nodeType ?? nodeId ?? 'Node',
|
|
102
|
+
duration,
|
|
103
|
+
color: d.color,
|
|
104
|
+
icon: d.icon,
|
|
105
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : undefined,
|
|
106
|
+
};
|
|
93
107
|
nodeEntryIndex.delete(nodeId);
|
|
94
108
|
}
|
|
95
109
|
else {
|
|
96
|
-
|
|
110
|
+
// No matching start entry — standalone complete (e.g. Start node)
|
|
111
|
+
const rawOutputs = d.outputs;
|
|
112
|
+
entries.push({
|
|
113
|
+
id: `s-${idCounter++}`,
|
|
114
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
115
|
+
type: 'node-completed',
|
|
116
|
+
nodeId,
|
|
117
|
+
label: d.label ?? d.nodeType ?? nodeId ?? 'Node',
|
|
118
|
+
duration,
|
|
119
|
+
color: d.color,
|
|
120
|
+
icon: d.icon,
|
|
121
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : undefined,
|
|
122
|
+
});
|
|
97
123
|
}
|
|
98
124
|
break;
|
|
99
125
|
}
|
|
100
126
|
case 'node-error': {
|
|
101
127
|
const nodeId = d.nodeId;
|
|
128
|
+
if (completedNodes.has(nodeId))
|
|
129
|
+
break; // skip duplicate
|
|
102
130
|
const startTs = nodeStarts.get(nodeId);
|
|
103
131
|
const duration = d.durationMs ?? (startTs ? event.timestamp - startTs : undefined);
|
|
104
132
|
if (nodeId)
|
|
105
133
|
nodeStarts.delete(nodeId);
|
|
106
|
-
|
|
107
|
-
const failed = {
|
|
108
|
-
id: `s-${idCounter++}`,
|
|
109
|
-
timestamp: new Date(startTs ?? event.timestamp),
|
|
110
|
-
type: 'node-failed',
|
|
111
|
-
nodeId,
|
|
112
|
-
label: d.label ?? d.nodeType ?? nodeId ?? 'Node',
|
|
113
|
-
detail: d.error,
|
|
114
|
-
duration,
|
|
115
|
-
color: d.color,
|
|
116
|
-
icon: d.icon,
|
|
117
|
-
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : undefined,
|
|
118
|
-
};
|
|
134
|
+
completedNodes.add(nodeId);
|
|
119
135
|
// Replace the node-started entry in-place
|
|
120
136
|
const existingIdx = nodeEntryIndex.get(nodeId);
|
|
121
137
|
if (existingIdx != null && entries[existingIdx]) {
|
|
122
|
-
|
|
138
|
+
const rawOutputs = d.outputs;
|
|
139
|
+
entries[existingIdx] = {
|
|
140
|
+
id: entries[existingIdx].id,
|
|
141
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
142
|
+
type: 'node-failed',
|
|
143
|
+
nodeId,
|
|
144
|
+
label: d.label ?? d.nodeType ?? nodeId ?? 'Node',
|
|
145
|
+
detail: d.error,
|
|
146
|
+
duration,
|
|
147
|
+
color: d.color,
|
|
148
|
+
icon: d.icon,
|
|
149
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : undefined,
|
|
150
|
+
};
|
|
123
151
|
nodeEntryIndex.delete(nodeId);
|
|
124
152
|
}
|
|
125
153
|
else {
|
|
126
|
-
|
|
154
|
+
const rawOutputs = d.outputs;
|
|
155
|
+
entries.push({
|
|
156
|
+
id: `s-${idCounter++}`,
|
|
157
|
+
timestamp: new Date(startTs ?? event.timestamp),
|
|
158
|
+
type: 'node-failed',
|
|
159
|
+
nodeId,
|
|
160
|
+
label: d.label ?? d.nodeType ?? nodeId ?? 'Node',
|
|
161
|
+
detail: d.error,
|
|
162
|
+
duration,
|
|
163
|
+
color: d.color,
|
|
164
|
+
icon: d.icon,
|
|
165
|
+
outputs: rawOutputs && rawOutputs.length > 0 ? rawOutputs : undefined,
|
|
166
|
+
});
|
|
127
167
|
}
|
|
128
168
|
break;
|
|
129
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-stream-timeline.js","sourceRoot":"","sources":["../../src/ui/use-stream-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AAqCvD,MAAM,UAAU,iBAAiB,CAAC,MAAqB,EAAE,MAAe;IACtE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,IAAqB,CAAC,CAAC;IAEnD,6EAA6E;IAC7E,SAAS,CAAC,GAAG,EAAE;Q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MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAErB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
* @connect gitOps.ctx -> report.mainCtx
|
|
46
46
|
* @connect readWf.ctx -> report.readCtx
|
|
47
47
|
* @connect abort.ctx -> report.abortCtx
|
|
48
|
+
* @connect execRetry.ctx -> report.failCtx
|
|
48
49
|
* @connect report.summary -> Exit.summary
|
|
49
50
|
* @param execute [order:-1] - Execute
|
|
50
51
|
* @param taskJson [order:0] - TaskJson
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weaver-bot.d.ts","sourceRoot":"","sources":["../../src/workflows/weaver-bot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"weaver-bot.d.ts","sourceRoot":"","sources":["../../src/workflows/weaver-bot.ts"],"names":[],"mappings":"AAuaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACzE,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAwqD7E"}
|
|
@@ -17,11 +17,243 @@ import { weaverBotReport } from '../node-types/bot-report.js';
|
|
|
17
17
|
import { weaverPhaseGate } from '../node-types/phase-gate.js';
|
|
18
18
|
import { weaverResolveModel } from '../node-types/resolve-model.js';
|
|
19
19
|
import { weaverCtxMerge } from '../node-types/ctx-merge.js';
|
|
20
|
-
// @flow-weaver-runtime-start
|
|
21
20
|
// ============================================================================
|
|
22
|
-
//
|
|
21
|
+
// Cancellation Error
|
|
23
22
|
// ============================================================================
|
|
24
|
-
|
|
23
|
+
class CancellationError extends Error {
|
|
24
|
+
executionIndex;
|
|
25
|
+
nodeId;
|
|
26
|
+
timestamp;
|
|
27
|
+
constructor(message = 'Workflow execution cancelled', executionIndex = 0, nodeId, timestamp = Date.now()) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = 'CancellationError';
|
|
30
|
+
this.executionIndex = executionIndex;
|
|
31
|
+
this.nodeId = nodeId;
|
|
32
|
+
this.timestamp = timestamp;
|
|
33
|
+
}
|
|
34
|
+
static isCancellationError(error) {
|
|
35
|
+
return (error instanceof CancellationError ||
|
|
36
|
+
(error instanceof Error && error.name === 'CancellationError'));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Execution Context
|
|
41
|
+
// ============================================================================
|
|
42
|
+
class GeneratedExecutionContext {
|
|
43
|
+
variables = new Map();
|
|
44
|
+
executions = new Map();
|
|
45
|
+
executionCounter = 0;
|
|
46
|
+
nodeExecutionCounts = new Map();
|
|
47
|
+
isAsync;
|
|
48
|
+
flowWeaverDebugger;
|
|
49
|
+
pullExecutors = new Map();
|
|
50
|
+
nodeExecutionIndices = new Map();
|
|
51
|
+
abortSignal;
|
|
52
|
+
constructor(isAsync = true, flowWeaverDebugger, abortSignal) {
|
|
53
|
+
this.isAsync = isAsync;
|
|
54
|
+
this.flowWeaverDebugger = flowWeaverDebugger;
|
|
55
|
+
this.abortSignal = abortSignal;
|
|
56
|
+
}
|
|
57
|
+
registerPullExecutor(id, executor) {
|
|
58
|
+
this.pullExecutors.set(id, executor);
|
|
59
|
+
}
|
|
60
|
+
addExecution(id, parentIndex, scopeName) {
|
|
61
|
+
// Use per-node execution counter (each node starts at 0)
|
|
62
|
+
const currentCount = this.nodeExecutionCounts.get(id) || 0;
|
|
63
|
+
const index = currentCount;
|
|
64
|
+
this.nodeExecutionCounts.set(id, currentCount + 1);
|
|
65
|
+
this.executionCounter++;
|
|
66
|
+
this.executions.set(this.getExecutionKey(id, index), {
|
|
67
|
+
id,
|
|
68
|
+
index,
|
|
69
|
+
parentIndex,
|
|
70
|
+
scopeName,
|
|
71
|
+
});
|
|
72
|
+
this.nodeExecutionIndices.set(id, index);
|
|
73
|
+
return index;
|
|
74
|
+
}
|
|
75
|
+
setVariable(address, value) {
|
|
76
|
+
const key = this.getVariableKey(address);
|
|
77
|
+
this.variables.set(key, value);
|
|
78
|
+
if (this.flowWeaverDebugger) {
|
|
79
|
+
const actualValue = typeof value === "function" ? value() : value;
|
|
80
|
+
this.sendVariableSetEvent({
|
|
81
|
+
identifier: {
|
|
82
|
+
nodeTypeName: address.nodeTypeName || "unknown",
|
|
83
|
+
id: address.id,
|
|
84
|
+
portName: address.portName,
|
|
85
|
+
executionIndex: address.executionIndex,
|
|
86
|
+
key: "default",
|
|
87
|
+
...(address.scope && { scope: address.scope }),
|
|
88
|
+
...(address.side && { side: address.side }),
|
|
89
|
+
},
|
|
90
|
+
value: actualValue,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return this.isAsync ? Promise.resolve() : undefined;
|
|
94
|
+
}
|
|
95
|
+
getVariable(address) {
|
|
96
|
+
const executor = this.pullExecutors.get(address.id);
|
|
97
|
+
if (executor) {
|
|
98
|
+
if (!this.hasVariable(address)) {
|
|
99
|
+
const result = executor();
|
|
100
|
+
// Handle async executor (returns Promise)
|
|
101
|
+
if (result instanceof Promise) {
|
|
102
|
+
return result.then(() => {
|
|
103
|
+
const trackedIndex = this.nodeExecutionIndices.get(address.id);
|
|
104
|
+
const finalAddress = trackedIndex !== undefined
|
|
105
|
+
? { ...address, executionIndex: trackedIndex }
|
|
106
|
+
: address;
|
|
107
|
+
return this.retrieveVariable(finalAddress);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// Handle sync executor (returns void)
|
|
111
|
+
const trackedIndex = this.nodeExecutionIndices.get(address.id);
|
|
112
|
+
const finalAddress = trackedIndex !== undefined
|
|
113
|
+
? { ...address, executionIndex: trackedIndex }
|
|
114
|
+
: address;
|
|
115
|
+
return this.retrieveVariable(finalAddress);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return this.retrieveVariable(address);
|
|
119
|
+
}
|
|
120
|
+
retrieveVariable(address) {
|
|
121
|
+
const key = this.getVariableKey(address);
|
|
122
|
+
if (!this.variables.has(key)) {
|
|
123
|
+
throw new Error(`Variable not found: ${address.id}.${address.portName}[${address.executionIndex}]`);
|
|
124
|
+
}
|
|
125
|
+
const value = this.variables.get(key);
|
|
126
|
+
if (typeof value === "function") {
|
|
127
|
+
const result = value();
|
|
128
|
+
if (result instanceof Promise) {
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
return this.isAsync ? Promise.resolve(result) : result;
|
|
132
|
+
}
|
|
133
|
+
return this.isAsync ? Promise.resolve(value) : value;
|
|
134
|
+
}
|
|
135
|
+
hasVariable(address) {
|
|
136
|
+
const key = this.getVariableKey(address);
|
|
137
|
+
return this.variables.has(key);
|
|
138
|
+
}
|
|
139
|
+
getExecution(id, index) {
|
|
140
|
+
return this.executions.get(this.getExecutionKey(id, index));
|
|
141
|
+
}
|
|
142
|
+
createScope(_parentNodeName, _parentIndex, _scopeName, cleanScope = false, isAsyncOverride) {
|
|
143
|
+
const effectiveIsAsync = isAsyncOverride !== undefined ? isAsyncOverride : this.isAsync;
|
|
144
|
+
const scopedContext = new GeneratedExecutionContext(effectiveIsAsync, this.flowWeaverDebugger, this.abortSignal);
|
|
145
|
+
// For per-port function scopes (cleanScope=true), start with empty variables
|
|
146
|
+
// For node-level scopes (cleanScope=false), inherit parent variables
|
|
147
|
+
scopedContext.variables = cleanScope ? new Map() : new Map(this.variables);
|
|
148
|
+
scopedContext.executions = new Map(this.executions);
|
|
149
|
+
scopedContext.executionCounter = this.executionCounter;
|
|
150
|
+
scopedContext.nodeExecutionCounts = new Map(this.nodeExecutionCounts);
|
|
151
|
+
return scopedContext;
|
|
152
|
+
}
|
|
153
|
+
mergeScope(scopedContext) {
|
|
154
|
+
scopedContext.executions.forEach((info, key) => {
|
|
155
|
+
this.executions.set(key, info);
|
|
156
|
+
});
|
|
157
|
+
scopedContext.variables.forEach((value, key) => {
|
|
158
|
+
this.variables.set(key, value);
|
|
159
|
+
});
|
|
160
|
+
this.executionCounter = Math.max(this.executionCounter, scopedContext.executionCounter);
|
|
161
|
+
scopedContext.nodeExecutionCounts.forEach((count, id) => {
|
|
162
|
+
const currentCount = this.nodeExecutionCounts.get(id) || 0;
|
|
163
|
+
this.nodeExecutionCounts.set(id, Math.max(currentCount, count));
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
getVariableKey(address) {
|
|
167
|
+
return `${address.id}:${address.portName}:${address.executionIndex}`;
|
|
168
|
+
}
|
|
169
|
+
getExecutionKey(id, index) {
|
|
170
|
+
return `${id}:${index}`;
|
|
171
|
+
}
|
|
172
|
+
getExecutionCount() {
|
|
173
|
+
return this.executionCounter;
|
|
174
|
+
}
|
|
175
|
+
reset() {
|
|
176
|
+
this.variables.clear();
|
|
177
|
+
this.executions.clear();
|
|
178
|
+
this.executionCounter = 0;
|
|
179
|
+
this.nodeExecutionCounts.clear();
|
|
180
|
+
}
|
|
181
|
+
isAborted() {
|
|
182
|
+
return this.abortSignal?.aborted ?? false;
|
|
183
|
+
}
|
|
184
|
+
checkAborted(nodeId) {
|
|
185
|
+
if (this.abortSignal?.aborted) {
|
|
186
|
+
throw new CancellationError(`Workflow execution cancelled${nodeId ? ` at ${nodeId}` : ''}`, this.executionCounter, nodeId);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async sendStatusChangedEvent(args) {
|
|
190
|
+
if (this.flowWeaverDebugger) {
|
|
191
|
+
await this.flowWeaverDebugger.sendEvent({
|
|
192
|
+
type: "STATUS_CHANGED",
|
|
193
|
+
...args,
|
|
194
|
+
innerFlowInvocation: this.flowWeaverDebugger.innerFlowInvocation,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async sendVariableSetEvent(args) {
|
|
199
|
+
if (this.flowWeaverDebugger) {
|
|
200
|
+
await this.flowWeaverDebugger.sendEvent({
|
|
201
|
+
type: "VARIABLE_SET",
|
|
202
|
+
...args,
|
|
203
|
+
innerFlowInvocation: this.flowWeaverDebugger.innerFlowInvocation,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async sendLogErrorEvent(args) {
|
|
208
|
+
if (this.flowWeaverDebugger) {
|
|
209
|
+
await this.flowWeaverDebugger.sendEvent({
|
|
210
|
+
type: "LOG_ERROR",
|
|
211
|
+
...args,
|
|
212
|
+
innerFlowInvocation: this.flowWeaverDebugger.innerFlowInvocation,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
async sendWorkflowCompletedEvent(args) {
|
|
217
|
+
if (this.flowWeaverDebugger) {
|
|
218
|
+
await this.flowWeaverDebugger.sendEvent({
|
|
219
|
+
type: "WORKFLOW_COMPLETED",
|
|
220
|
+
...args,
|
|
221
|
+
innerFlowInvocation: this.flowWeaverDebugger.innerFlowInvocation,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
serialize() {
|
|
226
|
+
const vars = {};
|
|
227
|
+
for (const [key, value] of this.variables) {
|
|
228
|
+
if (typeof value === "function") {
|
|
229
|
+
try {
|
|
230
|
+
vars[key] = value();
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
vars[key] = value;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
vars[key] = value;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const execs = {};
|
|
241
|
+
for (const [key, info] of this.executions) {
|
|
242
|
+
execs[key] = { ...info };
|
|
243
|
+
}
|
|
244
|
+
const nodeCounts = {};
|
|
245
|
+
for (const [key, count] of this.nodeExecutionIndices) {
|
|
246
|
+
nodeCounts[key] = count;
|
|
247
|
+
}
|
|
248
|
+
return { variables: vars, executions: execs, executionCounter: this.executionCounter, nodeExecutionCounts: nodeCounts };
|
|
249
|
+
}
|
|
250
|
+
restore(data) {
|
|
251
|
+
this.variables = new Map(Object.entries(data.variables));
|
|
252
|
+
this.executions = new Map(Object.entries(data.executions));
|
|
253
|
+
this.executionCounter = data.executionCounter;
|
|
254
|
+
this.nodeExecutionIndices = new Map(Object.entries(data.nodeExecutionCounts));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
25
257
|
// @flow-weaver-runtime-end
|
|
26
258
|
/**
|
|
27
259
|
* @flowWeaver workflow
|
|
@@ -70,6 +302,7 @@ import { GeneratedExecutionContext, CancellationError } from '@synergenius/flow-
|
|
|
70
302
|
* @connect gitOps.ctx -> report.mainCtx
|
|
71
303
|
* @connect readWf.ctx -> report.readCtx
|
|
72
304
|
* @connect abort.ctx -> report.abortCtx
|
|
305
|
+
* @connect execRetry.ctx -> report.failCtx
|
|
73
306
|
* @connect report.summary -> Exit.summary
|
|
74
307
|
* @param execute [order:-1] - Execute
|
|
75
308
|
* @param taskJson [order:0] - TaskJson
|
|
@@ -1699,7 +1932,9 @@ export async function weaverBot(execute, params, __abortSignal__) {
|
|
|
1699
1932
|
await ctx.setVariable({ id: 'report', portName: 'readCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_readCtx);
|
|
1700
1933
|
const report_abortCtx = abortIdx !== undefined ? await ctx.getVariable({ id: 'abort', portName: 'ctx', executionIndex: abortIdx }) : undefined;
|
|
1701
1934
|
await ctx.setVariable({ id: 'report', portName: 'abortCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_abortCtx);
|
|
1702
|
-
const
|
|
1935
|
+
const report_failCtx = execRetryIdx !== undefined ? await ctx.getVariable({ id: 'execRetry', portName: 'ctx', executionIndex: execRetryIdx }) : undefined;
|
|
1936
|
+
await ctx.setVariable({ id: 'report', portName: 'failCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_failCtx);
|
|
1937
|
+
const reportResult = await weaverBotReport(report_execute, report_mainCtx, report_readCtx, report_abortCtx, report_failCtx);
|
|
1703
1938
|
await ctx.setVariable({ id: 'report', portName: 'summary', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.summary);
|
|
1704
1939
|
await ctx.setVariable({ id: 'report', portName: 'reportJson', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.reportJson);
|
|
1705
1940
|
await ctx.setVariable({ id: 'report', portName: 'onFailure', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.onFailure);
|