or3-workflow-vue 0.1.0
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/index.d.ts +883 -0
- package/dist/index.js +4388 -0
- package/dist/index.umd.cjs +15 -0
- package/dist/style.css +1 -0
- package/package.json +63 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4388 @@
|
|
|
1
|
+
import { shallowRef as at, markRaw as Qt, triggerRef as Zt, onBeforeUnmount as it, readonly as rt, ref as H, defineComponent as te, computed as $, createElementBlock as l, openBlock as s, normalizeClass as P, createElementVNode as e, createVNode as A, toDisplayString as y, unref as O, renderSlot as eo, createBlock as ue, withCtx as le, createCommentVNode as M, Fragment as K, renderList as Q, normalizeStyle as He, createTextVNode as Y, watch as de, onMounted as Re, nextTick as Pe, onUnmounted as Ae, mergeProps as $e, createStaticVNode as be, resolveDynamicComponent as to, onScopeDispose as dt, watchEffect as oo, withModifiers as Ve, withDirectives as ut, vModelText as ct, Transition as so } from "vue";
|
|
2
|
+
import { createWorkflowEditor as no, modelRegistry as lt, registerDefaultModels as lo, migrateOutputNodeData as ao, validateWorkflow as io } from "or3-workflow-core";
|
|
3
|
+
import { isAgentNodeData as vd, isOutputNodeData as pd, isParallelNodeData as fd, isRouterNodeData as md, isStartNodeData as gd } from "or3-workflow-core";
|
|
4
|
+
import { Handle as se, Position as ne, useVueFlow as ro, VueFlow as uo } from "@vue-flow/core";
|
|
5
|
+
import { Background as co } from "@vue-flow/background";
|
|
6
|
+
import { Controls as vt } from "@vue-flow/controls";
|
|
7
|
+
import { MiniMap as vo } from "@vue-flow/minimap";
|
|
8
|
+
function po(a = {}) {
|
|
9
|
+
const d = at(null), r = no(a);
|
|
10
|
+
d.value = Qt(r);
|
|
11
|
+
const u = r.on("update", () => {
|
|
12
|
+
Zt(d);
|
|
13
|
+
});
|
|
14
|
+
return it(() => {
|
|
15
|
+
var i;
|
|
16
|
+
u(), (i = d.value) == null || i.destroy(), d.value = null;
|
|
17
|
+
}), d;
|
|
18
|
+
}
|
|
19
|
+
const Qr = po, Le = H(/* @__PURE__ */ new Map());
|
|
20
|
+
function pt() {
|
|
21
|
+
const a = (u, i) => {
|
|
22
|
+
Le.value.set(u, i);
|
|
23
|
+
}, d = (u) => Le.value.get(u), r = () => {
|
|
24
|
+
Le.value.clear();
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
outputs: rt(Le),
|
|
28
|
+
setOutput: a,
|
|
29
|
+
getOutput: d,
|
|
30
|
+
clear: r
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function Zr() {
|
|
34
|
+
const { setOutput: a, clear: d } = pt(), r = H(!1), u = H(null), i = H({}), x = H({}), n = H(null), v = H(null), D = () => {
|
|
35
|
+
r.value = !1, u.value = null, i.value = {}, x.value = {}, n.value = null, v.value = null, d();
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
isRunning: r,
|
|
39
|
+
currentNodeId: u,
|
|
40
|
+
nodeStatuses: i,
|
|
41
|
+
nodeOutputs: x,
|
|
42
|
+
error: n,
|
|
43
|
+
result: v,
|
|
44
|
+
execute: async (f, k, L, m) => {
|
|
45
|
+
D(), r.value = !0;
|
|
46
|
+
const U = {
|
|
47
|
+
onNodeStart: (g) => {
|
|
48
|
+
var S;
|
|
49
|
+
u.value = g, i.value[g] = "active", (S = m == null ? void 0 : m.onNodeStart) == null || S.call(m, g);
|
|
50
|
+
},
|
|
51
|
+
onNodeFinish: (g, S) => {
|
|
52
|
+
var b;
|
|
53
|
+
i.value[g] = "completed", x.value[g] = S, a(g, S), u.value === g && (u.value = null), (b = m == null ? void 0 : m.onNodeFinish) == null || b.call(m, g, S);
|
|
54
|
+
},
|
|
55
|
+
onNodeError: (g, S) => {
|
|
56
|
+
var b;
|
|
57
|
+
i.value[g] = "error", n.value = S, (b = m == null ? void 0 : m.onNodeError) == null || b.call(m, g, S);
|
|
58
|
+
},
|
|
59
|
+
onToken: (g, S) => {
|
|
60
|
+
var b;
|
|
61
|
+
(b = m == null ? void 0 : m.onToken) == null || b.call(m, g, S);
|
|
62
|
+
},
|
|
63
|
+
onReasoning: (g, S) => {
|
|
64
|
+
var b;
|
|
65
|
+
(b = m == null ? void 0 : m.onReasoning) == null || b.call(m, g, S);
|
|
66
|
+
},
|
|
67
|
+
onRouteSelected: (g, S) => {
|
|
68
|
+
var b;
|
|
69
|
+
(b = m == null ? void 0 : m.onRouteSelected) == null || b.call(m, g, S);
|
|
70
|
+
},
|
|
71
|
+
onTokenUsage: (g, S) => {
|
|
72
|
+
var b;
|
|
73
|
+
(b = m == null ? void 0 : m.onTokenUsage) == null || b.call(m, g, S);
|
|
74
|
+
},
|
|
75
|
+
onContextCompacted: (g) => {
|
|
76
|
+
var S;
|
|
77
|
+
(S = m == null ? void 0 : m.onContextCompacted) == null || S.call(m, g);
|
|
78
|
+
},
|
|
79
|
+
// Branch streaming callbacks for parallel nodes
|
|
80
|
+
onBranchStart: (g, S, b) => {
|
|
81
|
+
var h;
|
|
82
|
+
(h = m == null ? void 0 : m.onBranchStart) == null || h.call(
|
|
83
|
+
m,
|
|
84
|
+
g,
|
|
85
|
+
S,
|
|
86
|
+
b
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
onBranchToken: (g, S, b, h) => {
|
|
90
|
+
var c;
|
|
91
|
+
(c = m == null ? void 0 : m.onBranchToken) == null || c.call(
|
|
92
|
+
m,
|
|
93
|
+
g,
|
|
94
|
+
S,
|
|
95
|
+
b,
|
|
96
|
+
h
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
onBranchReasoning: (g, S, b, h) => {
|
|
100
|
+
var c;
|
|
101
|
+
(c = m == null ? void 0 : m.onBranchReasoning) == null || c.call(
|
|
102
|
+
m,
|
|
103
|
+
g,
|
|
104
|
+
S,
|
|
105
|
+
b,
|
|
106
|
+
h
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
onBranchComplete: (g, S, b, h) => {
|
|
110
|
+
var c;
|
|
111
|
+
(c = m == null ? void 0 : m.onBranchComplete) == null || c.call(
|
|
112
|
+
m,
|
|
113
|
+
g,
|
|
114
|
+
S,
|
|
115
|
+
b,
|
|
116
|
+
h
|
|
117
|
+
), a(`${g}:${S}`, h);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
try {
|
|
121
|
+
const g = await f.execute(
|
|
122
|
+
k,
|
|
123
|
+
L,
|
|
124
|
+
U
|
|
125
|
+
);
|
|
126
|
+
return v.value = g, g;
|
|
127
|
+
} catch (g) {
|
|
128
|
+
const S = g instanceof Error ? g : new Error(String(g));
|
|
129
|
+
throw n.value = S, S;
|
|
130
|
+
} finally {
|
|
131
|
+
r.value = !1, u.value = null;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
stop: (f) => {
|
|
135
|
+
r.value && (f.stop(), r.value = !1);
|
|
136
|
+
},
|
|
137
|
+
reset: D
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function ed(a) {
|
|
141
|
+
const d = H(!1), r = H(null), u = H([]), i = H(null), x = async () => {
|
|
142
|
+
d.value = !0, r.value = null;
|
|
143
|
+
try {
|
|
144
|
+
const _ = await a.list();
|
|
145
|
+
return u.value = _, _;
|
|
146
|
+
} catch (_) {
|
|
147
|
+
const I = _ instanceof Error ? _ : new Error(String(_));
|
|
148
|
+
throw r.value = I, I;
|
|
149
|
+
} finally {
|
|
150
|
+
d.value = !1;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
isLoading: d,
|
|
155
|
+
error: r,
|
|
156
|
+
workflows: u,
|
|
157
|
+
currentWorkflow: i,
|
|
158
|
+
loadList: x,
|
|
159
|
+
load: async (_) => {
|
|
160
|
+
d.value = !0, r.value = null;
|
|
161
|
+
try {
|
|
162
|
+
const I = await a.load(_);
|
|
163
|
+
return i.value = I, I;
|
|
164
|
+
} catch (I) {
|
|
165
|
+
const f = I instanceof Error ? I : new Error(String(I));
|
|
166
|
+
throw r.value = f, f;
|
|
167
|
+
} finally {
|
|
168
|
+
d.value = !1;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
save: async (_) => {
|
|
172
|
+
d.value = !0, r.value = null;
|
|
173
|
+
try {
|
|
174
|
+
const I = JSON.parse(JSON.stringify(_)), f = await a.save(I);
|
|
175
|
+
return await x(), f;
|
|
176
|
+
} catch (I) {
|
|
177
|
+
const f = I instanceof Error ? I : new Error(String(I));
|
|
178
|
+
throw r.value = f, f;
|
|
179
|
+
} finally {
|
|
180
|
+
d.value = !1;
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
remove: async (_) => {
|
|
184
|
+
d.value = !0, r.value = null;
|
|
185
|
+
try {
|
|
186
|
+
await a.delete(_), await x(), i.value = null;
|
|
187
|
+
} catch (I) {
|
|
188
|
+
const f = I instanceof Error ? I : new Error(String(I));
|
|
189
|
+
throw r.value = f, f;
|
|
190
|
+
} finally {
|
|
191
|
+
d.value = !1;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function fo() {
|
|
197
|
+
const a = H({
|
|
198
|
+
isRunning: !1,
|
|
199
|
+
streamingContent: "",
|
|
200
|
+
nodeStatuses: {},
|
|
201
|
+
currentNodeId: null,
|
|
202
|
+
error: null
|
|
203
|
+
}), d = (D) => {
|
|
204
|
+
a.value.isRunning = D;
|
|
205
|
+
}, r = (D) => {
|
|
206
|
+
a.value.streamingContent = D;
|
|
207
|
+
}, u = (D) => {
|
|
208
|
+
a.value.streamingContent += D;
|
|
209
|
+
}, i = (D, _) => {
|
|
210
|
+
a.value.nodeStatuses[D] = _;
|
|
211
|
+
}, x = (D) => {
|
|
212
|
+
a.value.currentNodeId = D;
|
|
213
|
+
}, n = (D) => {
|
|
214
|
+
a.value.error = D;
|
|
215
|
+
}, v = () => {
|
|
216
|
+
a.value = {
|
|
217
|
+
isRunning: !1,
|
|
218
|
+
streamingContent: "",
|
|
219
|
+
nodeStatuses: {},
|
|
220
|
+
currentNodeId: null,
|
|
221
|
+
error: null
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
return {
|
|
225
|
+
state: rt(a),
|
|
226
|
+
setRunning: d,
|
|
227
|
+
setStreamingContent: r,
|
|
228
|
+
appendStreamingContent: u,
|
|
229
|
+
setNodeStatus: i,
|
|
230
|
+
setCurrentNodeId: x,
|
|
231
|
+
setError: n,
|
|
232
|
+
reset: v
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function mo() {
|
|
236
|
+
return fo();
|
|
237
|
+
}
|
|
238
|
+
function td(a, d) {
|
|
239
|
+
const r = H(
|
|
240
|
+
a.getNodes().find((v) => v.id === d)
|
|
241
|
+
), u = () => {
|
|
242
|
+
r.value = a.getNodes().find((v) => v.id === d);
|
|
243
|
+
}, i = a.on("update", u), x = a.on("nodeUpdate", u);
|
|
244
|
+
return it(() => {
|
|
245
|
+
i(), x();
|
|
246
|
+
}), {
|
|
247
|
+
node: r,
|
|
248
|
+
updateData: (v) => {
|
|
249
|
+
r.value && a.commands.updateNodeData(r.value.id, v);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function go() {
|
|
254
|
+
const a = at(/* @__PURE__ */ new Map());
|
|
255
|
+
return {
|
|
256
|
+
components: a,
|
|
257
|
+
register(d, r) {
|
|
258
|
+
if (!d || typeof d != "string") {
|
|
259
|
+
console.warn("Node type must be a non-empty string");
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const u = new Map(a.value);
|
|
263
|
+
u.set(d, r), a.value = u;
|
|
264
|
+
},
|
|
265
|
+
unregister(d) {
|
|
266
|
+
if (!a.value.has(d))
|
|
267
|
+
return;
|
|
268
|
+
const r = new Map(a.value);
|
|
269
|
+
r.delete(d), a.value = r;
|
|
270
|
+
},
|
|
271
|
+
get(d) {
|
|
272
|
+
return a.value.get(d);
|
|
273
|
+
},
|
|
274
|
+
has(d) {
|
|
275
|
+
return a.value.has(d);
|
|
276
|
+
},
|
|
277
|
+
getTypes() {
|
|
278
|
+
return Array.from(a.value.keys());
|
|
279
|
+
},
|
|
280
|
+
clear() {
|
|
281
|
+
a.value = /* @__PURE__ */ new Map();
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
const ho = go();
|
|
286
|
+
function yo(a) {
|
|
287
|
+
Promise.resolve().then(() => _o).then(
|
|
288
|
+
(d) => a.register("start", d.default)
|
|
289
|
+
), Promise.resolve().then(() => Ho).then(
|
|
290
|
+
(d) => a.register("agent", d.default)
|
|
291
|
+
), Promise.resolve().then(() => Jo).then(
|
|
292
|
+
(d) => a.register("router", d.default)
|
|
293
|
+
), Promise.resolve().then(() => rs).then(
|
|
294
|
+
(d) => a.register("parallel", d.default)
|
|
295
|
+
), Promise.resolve().then(() => _s).then(
|
|
296
|
+
(d) => a.register("whileLoop", d.default)
|
|
297
|
+
), Promise.resolve().then(() => Os).then(
|
|
298
|
+
(d) => a.register("subflow", d.default)
|
|
299
|
+
), Promise.resolve().then(() => Ys).then(
|
|
300
|
+
(d) => a.register("output", d.default)
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
yo(ho);
|
|
304
|
+
const wo = { class: "start-content" }, bo = /* @__PURE__ */ te({
|
|
305
|
+
__name: "StartNode",
|
|
306
|
+
props: {
|
|
307
|
+
id: {},
|
|
308
|
+
data: {},
|
|
309
|
+
selected: { type: Boolean }
|
|
310
|
+
},
|
|
311
|
+
setup(a) {
|
|
312
|
+
const d = a, r = $(() => d.data.label || "Start"), u = $(() => d.data.status || "idle");
|
|
313
|
+
return (i, x) => (s(), l("div", {
|
|
314
|
+
class: P(["start-node", [`status-${u.value}`, { selected: a.selected }]])
|
|
315
|
+
}, [
|
|
316
|
+
e("div", wo, [
|
|
317
|
+
x[0] || (x[0] = e("svg", {
|
|
318
|
+
class: "play-icon",
|
|
319
|
+
viewBox: "0 0 24 24",
|
|
320
|
+
fill: "none",
|
|
321
|
+
stroke: "currentColor",
|
|
322
|
+
"stroke-width": "2"
|
|
323
|
+
}, [
|
|
324
|
+
e("polygon", { points: "5 3 19 12 5 21 5 3" })
|
|
325
|
+
], -1)),
|
|
326
|
+
e("span", null, y(r.value), 1)
|
|
327
|
+
]),
|
|
328
|
+
A(O(se), {
|
|
329
|
+
type: "source",
|
|
330
|
+
position: O(ne).Bottom,
|
|
331
|
+
class: "handle"
|
|
332
|
+
}, null, 8, ["position"])
|
|
333
|
+
], 2));
|
|
334
|
+
}
|
|
335
|
+
}), G = (a, d) => {
|
|
336
|
+
const r = a.__vccOpts || a;
|
|
337
|
+
for (const [u, i] of d)
|
|
338
|
+
r[u] = i;
|
|
339
|
+
return r;
|
|
340
|
+
}, ft = /* @__PURE__ */ G(bo, [["__scopeId", "data-v-740a3c44"]]), _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
341
|
+
__proto__: null,
|
|
342
|
+
default: ft
|
|
343
|
+
}, Symbol.toStringTag, { value: "Module" })), ko = {}, xo = {
|
|
344
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
345
|
+
width: "14",
|
|
346
|
+
height: "14",
|
|
347
|
+
viewBox: "0 0 24 24"
|
|
348
|
+
};
|
|
349
|
+
function $o(a, d) {
|
|
350
|
+
return s(), l("svg", xo, [...d[0] || (d[0] = [
|
|
351
|
+
e("g", {
|
|
352
|
+
fill: "none",
|
|
353
|
+
stroke: "currentColor",
|
|
354
|
+
"stroke-linecap": "round",
|
|
355
|
+
"stroke-linejoin": "round",
|
|
356
|
+
"stroke-width": "2"
|
|
357
|
+
}, [
|
|
358
|
+
e("path", { d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065" }),
|
|
359
|
+
e("path", { d: "M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0" })
|
|
360
|
+
], -1)
|
|
361
|
+
])]);
|
|
362
|
+
}
|
|
363
|
+
const Io = /* @__PURE__ */ G(ko, [["render", $o]]), Mo = { class: "node-meta-container" }, Do = { class: "node-id" }, So = /* @__PURE__ */ te({
|
|
364
|
+
__name: "NodeWrapper",
|
|
365
|
+
props: {
|
|
366
|
+
id: {},
|
|
367
|
+
selected: { type: Boolean },
|
|
368
|
+
status: { default: "idle" },
|
|
369
|
+
variant: { default: "default" }
|
|
370
|
+
},
|
|
371
|
+
emits: ["inspect"],
|
|
372
|
+
setup(a, { emit: d }) {
|
|
373
|
+
const r = a, u = d, i = $(() => [
|
|
374
|
+
"node-wrapper",
|
|
375
|
+
`status-${r.status}`,
|
|
376
|
+
`variant-${r.variant}`,
|
|
377
|
+
{ selected: r.selected }
|
|
378
|
+
]);
|
|
379
|
+
function x(n) {
|
|
380
|
+
n.stopPropagation(), u("inspect");
|
|
381
|
+
}
|
|
382
|
+
return (n, v) => (s(), l("div", {
|
|
383
|
+
class: P(i.value)
|
|
384
|
+
}, [
|
|
385
|
+
e("div", Mo, [
|
|
386
|
+
e("div", Do, y(a.id.slice(0, 6)), 1),
|
|
387
|
+
e("button", {
|
|
388
|
+
class: "inspect-btn",
|
|
389
|
+
title: "Open inspector",
|
|
390
|
+
"aria-label": "Open node inspector",
|
|
391
|
+
onClick: x
|
|
392
|
+
}, [
|
|
393
|
+
A(Io)
|
|
394
|
+
])
|
|
395
|
+
]),
|
|
396
|
+
eo(n.$slots, "default", {}, void 0, !0)
|
|
397
|
+
], 2));
|
|
398
|
+
}
|
|
399
|
+
}), Ie = /* @__PURE__ */ G(So, [["__scopeId", "data-v-aac8cd21"]]), No = {}, To = {
|
|
400
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
401
|
+
viewBox: "0 0 24 24"
|
|
402
|
+
};
|
|
403
|
+
function Co(a, d) {
|
|
404
|
+
return s(), l("svg", To, [...d[0] || (d[0] = [
|
|
405
|
+
e("path", {
|
|
406
|
+
fill: "none",
|
|
407
|
+
stroke: "currentColor",
|
|
408
|
+
"stroke-linecap": "round",
|
|
409
|
+
"stroke-linejoin": "round",
|
|
410
|
+
"stroke-width": "2",
|
|
411
|
+
d: "M6 6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2zm6-4v2m-3 8v9m6-9v9M5 16l4-2m6 0l4 2M9 18h6M10 8v.01M14 8v.01"
|
|
412
|
+
}, null, -1)
|
|
413
|
+
])]);
|
|
414
|
+
}
|
|
415
|
+
const mt = /* @__PURE__ */ G(No, [["render", Co]]), Eo = { class: "agent-node" }, Bo = { class: "node-header" }, Oo = { class: "icon-wrapper" }, Lo = { class: "node-label" }, Ro = {
|
|
416
|
+
key: 0,
|
|
417
|
+
class: "status-spinner"
|
|
418
|
+
}, Po = { class: "model-badge" }, Ao = { class: "model-name" }, Vo = /* @__PURE__ */ te({
|
|
419
|
+
__name: "AgentNode",
|
|
420
|
+
props: {
|
|
421
|
+
id: {},
|
|
422
|
+
data: {},
|
|
423
|
+
selected: { type: Boolean }
|
|
424
|
+
},
|
|
425
|
+
emits: ["inspect"],
|
|
426
|
+
setup(a, { emit: d }) {
|
|
427
|
+
const r = a, u = $(() => r.data.label || "Agent"), i = $(() => r.data.model || "z-ai/glm-4.6:exacto"), x = $(() => r.data.status || "idle"), n = $(() => {
|
|
428
|
+
const D = i.value.split("/");
|
|
429
|
+
return D[D.length - 1];
|
|
430
|
+
}), v = d;
|
|
431
|
+
return (D, _) => (s(), ue(Ie, {
|
|
432
|
+
id: a.id,
|
|
433
|
+
selected: a.selected,
|
|
434
|
+
status: x.value,
|
|
435
|
+
variant: "accent",
|
|
436
|
+
onInspect: _[0] || (_[0] = (I) => v("inspect"))
|
|
437
|
+
}, {
|
|
438
|
+
default: le(() => [
|
|
439
|
+
A(O(se), {
|
|
440
|
+
type: "target",
|
|
441
|
+
position: O(ne).Top,
|
|
442
|
+
class: "handle"
|
|
443
|
+
}, null, 8, ["position"]),
|
|
444
|
+
e("div", Eo, [
|
|
445
|
+
e("div", Bo, [
|
|
446
|
+
e("div", Oo, [
|
|
447
|
+
A(mt, { class: "bot-icon" })
|
|
448
|
+
]),
|
|
449
|
+
e("span", Lo, y(u.value), 1),
|
|
450
|
+
x.value === "active" ? (s(), l("div", Ro)) : M("", !0)
|
|
451
|
+
]),
|
|
452
|
+
e("div", Po, [
|
|
453
|
+
e("span", Ao, y(n.value), 1)
|
|
454
|
+
])
|
|
455
|
+
]),
|
|
456
|
+
A(O(se), {
|
|
457
|
+
type: "source",
|
|
458
|
+
position: O(ne).Bottom,
|
|
459
|
+
class: "handle"
|
|
460
|
+
}, null, 8, ["position"]),
|
|
461
|
+
A(O(se), {
|
|
462
|
+
type: "source",
|
|
463
|
+
position: O(ne).Right,
|
|
464
|
+
id: "error",
|
|
465
|
+
class: "handle error-handle"
|
|
466
|
+
}, null, 8, ["position"])
|
|
467
|
+
]),
|
|
468
|
+
_: 1
|
|
469
|
+
}, 8, ["id", "selected", "status"]));
|
|
470
|
+
}
|
|
471
|
+
}), gt = /* @__PURE__ */ G(Vo, [["__scopeId", "data-v-47d0bb13"]]), Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
472
|
+
__proto__: null,
|
|
473
|
+
default: gt
|
|
474
|
+
}, Symbol.toStringTag, { value: "Module" })), jo = {}, zo = {
|
|
475
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
476
|
+
viewBox: "0 0 24 24"
|
|
477
|
+
};
|
|
478
|
+
function Uo(a, d) {
|
|
479
|
+
return s(), l("svg", zo, [...d[0] || (d[0] = [
|
|
480
|
+
e("path", {
|
|
481
|
+
fill: "none",
|
|
482
|
+
stroke: "currentColor",
|
|
483
|
+
"stroke-linecap": "round",
|
|
484
|
+
"stroke-linejoin": "round",
|
|
485
|
+
"stroke-width": "2",
|
|
486
|
+
d: "M3 17a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm12 0a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM6 15v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1m-6-6v3"
|
|
487
|
+
}, null, -1)
|
|
488
|
+
])]);
|
|
489
|
+
}
|
|
490
|
+
const ht = /* @__PURE__ */ G(jo, [["render", Uo]]), Wo = { class: "router-node" }, Fo = { class: "node-header" }, Ko = { class: "icon-wrapper" }, qo = { class: "node-label" }, Go = {
|
|
491
|
+
key: 0,
|
|
492
|
+
class: "status-spinner"
|
|
493
|
+
}, Yo = { class: "router-badge" }, Xo = /* @__PURE__ */ te({
|
|
494
|
+
__name: "RouterNode",
|
|
495
|
+
props: {
|
|
496
|
+
id: {},
|
|
497
|
+
data: {},
|
|
498
|
+
selected: { type: Boolean }
|
|
499
|
+
},
|
|
500
|
+
emits: ["inspect"],
|
|
501
|
+
setup(a, { emit: d }) {
|
|
502
|
+
const r = a, u = $(() => r.data.label || "Router"), i = $(() => r.data.status || "idle"), x = [
|
|
503
|
+
{ id: "route-1", label: "Route 1" },
|
|
504
|
+
{ id: "route-2", label: "Route 2" }
|
|
505
|
+
], n = $(() => {
|
|
506
|
+
const _ = r.data.routes || x;
|
|
507
|
+
return _.length > 0 ? _ : x;
|
|
508
|
+
}), v = $(() => {
|
|
509
|
+
const _ = n.value.length;
|
|
510
|
+
return _ === 1 ? [50] : n.value.map((I, f) => (f + 1) / (_ + 1) * 100);
|
|
511
|
+
}), D = d;
|
|
512
|
+
return (_, I) => (s(), ue(Ie, {
|
|
513
|
+
id: a.id,
|
|
514
|
+
selected: a.selected,
|
|
515
|
+
status: i.value,
|
|
516
|
+
variant: "warning",
|
|
517
|
+
onInspect: I[0] || (I[0] = (f) => D("inspect"))
|
|
518
|
+
}, {
|
|
519
|
+
default: le(() => [
|
|
520
|
+
A(O(se), {
|
|
521
|
+
type: "target",
|
|
522
|
+
position: O(ne).Top,
|
|
523
|
+
class: "handle"
|
|
524
|
+
}, null, 8, ["position"]),
|
|
525
|
+
e("div", Wo, [
|
|
526
|
+
e("div", Fo, [
|
|
527
|
+
e("div", Ko, [
|
|
528
|
+
A(ht, { class: "branch-icon" })
|
|
529
|
+
]),
|
|
530
|
+
e("span", qo, y(u.value), 1),
|
|
531
|
+
i.value === "active" ? (s(), l("div", Go)) : M("", !0)
|
|
532
|
+
]),
|
|
533
|
+
e("div", Yo, [
|
|
534
|
+
e("span", null, "Router · " + y(n.value.length) + " routes", 1)
|
|
535
|
+
])
|
|
536
|
+
]),
|
|
537
|
+
(s(!0), l(K, null, Q(n.value, (f, k) => (s(), ue(O(se), {
|
|
538
|
+
key: f.id,
|
|
539
|
+
type: "source",
|
|
540
|
+
position: O(ne).Bottom,
|
|
541
|
+
id: f.id,
|
|
542
|
+
class: "handle route-handle",
|
|
543
|
+
"data-route-label": f.label || f.id,
|
|
544
|
+
title: f.label || f.id,
|
|
545
|
+
style: He({ left: `${v.value[k]}%` })
|
|
546
|
+
}, null, 8, ["position", "id", "data-route-label", "title", "style"]))), 128)),
|
|
547
|
+
A(O(se), {
|
|
548
|
+
type: "source",
|
|
549
|
+
position: O(ne).Right,
|
|
550
|
+
id: "error",
|
|
551
|
+
class: "handle error-handle"
|
|
552
|
+
}, null, 8, ["position"])
|
|
553
|
+
]),
|
|
554
|
+
_: 1
|
|
555
|
+
}, 8, ["id", "selected", "status"]));
|
|
556
|
+
}
|
|
557
|
+
}), yt = /* @__PURE__ */ G(Xo, [["__scopeId", "data-v-36dffe57"]]), Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
558
|
+
__proto__: null,
|
|
559
|
+
default: yt
|
|
560
|
+
}, Symbol.toStringTag, { value: "Module" })), Qo = {}, Zo = {
|
|
561
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
562
|
+
viewBox: "0 0 24 24"
|
|
563
|
+
};
|
|
564
|
+
function es(a, d) {
|
|
565
|
+
return s(), l("svg", Zo, [...d[0] || (d[0] = [
|
|
566
|
+
e("g", {
|
|
567
|
+
fill: "none",
|
|
568
|
+
stroke: "currentColor",
|
|
569
|
+
"stroke-linecap": "round",
|
|
570
|
+
"stroke-linejoin": "round",
|
|
571
|
+
"stroke-width": "2"
|
|
572
|
+
}, [
|
|
573
|
+
e("path", { d: "M21 17h-5.397a5 5 0 0 1-4.096-2.133l-.514-.734A5 5 0 0 0 6.897 12H3m18-5h-5.395a5 5 0 0 0-4.098 2.135l-.51.73A5 5 0 0 1 6.9 12H3" }),
|
|
574
|
+
e("path", { d: "m18 10l3-3l-3-3m0 16l3-3l-3-3" })
|
|
575
|
+
], -1)
|
|
576
|
+
])]);
|
|
577
|
+
}
|
|
578
|
+
const wt = /* @__PURE__ */ G(Qo, [["render", es]]), ts = { class: "parallel-node" }, os = { class: "node-header" }, ss = { class: "icon-wrapper" }, ns = { class: "node-label" }, ls = {
|
|
579
|
+
key: 0,
|
|
580
|
+
class: "status-spinner"
|
|
581
|
+
}, as = { class: "parallel-badge" }, is = /* @__PURE__ */ te({
|
|
582
|
+
__name: "ParallelNode",
|
|
583
|
+
props: {
|
|
584
|
+
id: {},
|
|
585
|
+
data: {},
|
|
586
|
+
selected: { type: Boolean }
|
|
587
|
+
},
|
|
588
|
+
emits: ["inspect"],
|
|
589
|
+
setup(a, { emit: d }) {
|
|
590
|
+
const r = a, u = $(() => r.data.label || "Parallel"), i = $(() => r.data.status || "idle"), x = $(() => r.data.mergeEnabled !== !1), n = $(() => r.data.branches || []), v = $(() => {
|
|
591
|
+
const _ = n.value.length;
|
|
592
|
+
return _ === 0 ? [] : _ === 1 ? [50] : n.value.map((I, f) => (f + 1) / (_ + 1) * 100);
|
|
593
|
+
}), D = d;
|
|
594
|
+
return (_, I) => (s(), ue(Ie, {
|
|
595
|
+
id: a.id,
|
|
596
|
+
selected: a.selected,
|
|
597
|
+
status: i.value,
|
|
598
|
+
variant: "info",
|
|
599
|
+
onInspect: I[0] || (I[0] = (f) => D("inspect"))
|
|
600
|
+
}, {
|
|
601
|
+
default: le(() => [
|
|
602
|
+
A(O(se), {
|
|
603
|
+
type: "target",
|
|
604
|
+
position: O(ne).Top,
|
|
605
|
+
class: "handle"
|
|
606
|
+
}, null, 8, ["position"]),
|
|
607
|
+
e("div", ts, [
|
|
608
|
+
e("div", os, [
|
|
609
|
+
e("div", ss, [
|
|
610
|
+
A(wt, { class: "merge-icon" })
|
|
611
|
+
]),
|
|
612
|
+
e("span", ns, y(u.value), 1),
|
|
613
|
+
i.value === "active" ? (s(), l("div", ls)) : M("", !0)
|
|
614
|
+
]),
|
|
615
|
+
e("div", as, [
|
|
616
|
+
e("span", null, y(x.value ? "Parallel Merge" : "Parallel Split") + " · " + y(n.value.length) + " branches", 1)
|
|
617
|
+
])
|
|
618
|
+
]),
|
|
619
|
+
x.value ? (s(), ue(O(se), {
|
|
620
|
+
key: 0,
|
|
621
|
+
type: "source",
|
|
622
|
+
position: O(ne).Bottom,
|
|
623
|
+
id: "merged",
|
|
624
|
+
class: "handle merged-output"
|
|
625
|
+
}, null, 8, ["position"])) : (s(!0), l(K, { key: 1 }, Q(n.value, (f, k) => (s(), ue(O(se), {
|
|
626
|
+
key: f.id,
|
|
627
|
+
type: "source",
|
|
628
|
+
position: O(ne).Bottom,
|
|
629
|
+
id: f.id,
|
|
630
|
+
class: "handle branch-handle",
|
|
631
|
+
style: He({ left: `${v.value[k]}%` })
|
|
632
|
+
}, null, 8, ["position", "id", "style"]))), 128))
|
|
633
|
+
]),
|
|
634
|
+
_: 1
|
|
635
|
+
}, 8, ["id", "selected", "status"]));
|
|
636
|
+
}
|
|
637
|
+
}), bt = /* @__PURE__ */ G(is, [["__scopeId", "data-v-fe2a1cc4"]]), rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
638
|
+
__proto__: null,
|
|
639
|
+
default: bt
|
|
640
|
+
}, Symbol.toStringTag, { value: "Module" })), ds = {}, us = {
|
|
641
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
642
|
+
viewBox: "0 0 24 24"
|
|
643
|
+
};
|
|
644
|
+
function cs(a, d) {
|
|
645
|
+
return s(), l("svg", us, [...d[0] || (d[0] = [
|
|
646
|
+
e("path", {
|
|
647
|
+
fill: "none",
|
|
648
|
+
stroke: "currentColor",
|
|
649
|
+
"stroke-linecap": "round",
|
|
650
|
+
"stroke-linejoin": "round",
|
|
651
|
+
"stroke-width": "2",
|
|
652
|
+
d: "M3 6a3 3 0 1 0 6 0a3 3 0 0 0-6 0m18 5V8a2 2 0 0 0-2-2h-6l3 3m0-6l-3 3M3 13v3a2 2 0 0 0 2 2h6l-3-3m0 6l3-3m4 0a3 3 0 1 0 6 0a3 3 0 0 0-6 0"
|
|
653
|
+
}, null, -1)
|
|
654
|
+
])]);
|
|
655
|
+
}
|
|
656
|
+
const _t = /* @__PURE__ */ G(ds, [["render", cs]]), vs = { class: "while-node" }, ps = { class: "node-header" }, fs = { class: "icon-wrapper" }, ms = { class: "node-label" }, gs = { class: "meta" }, hs = { class: "meta-item" }, ys = { class: "meta-item" }, ws = {
|
|
657
|
+
key: 0,
|
|
658
|
+
class: "meta-item accumulate-badge",
|
|
659
|
+
title: "Collects all outputs"
|
|
660
|
+
}, bs = /* @__PURE__ */ te({
|
|
661
|
+
__name: "WhileLoopNode",
|
|
662
|
+
props: {
|
|
663
|
+
id: {},
|
|
664
|
+
data: {},
|
|
665
|
+
selected: { type: Boolean }
|
|
666
|
+
},
|
|
667
|
+
emits: ["inspect"],
|
|
668
|
+
setup(a, { emit: d }) {
|
|
669
|
+
const r = a, u = $(() => r.data.label || "While Loop"), i = $(() => r.data.status || "idle"), x = $(() => r.data.maxIterations ?? 10), n = $(() => r.data.loopMode ?? "condition"), v = $(() => r.data.outputMode ?? "last"), D = $(
|
|
670
|
+
() => typeof r.data.iteration == "number" ? r.data.iteration : null
|
|
671
|
+
), _ = $(
|
|
672
|
+
() => n.value === "fixed" ? "Fixed" : "While"
|
|
673
|
+
), I = d;
|
|
674
|
+
return (f, k) => (s(), ue(Ie, {
|
|
675
|
+
id: a.id,
|
|
676
|
+
selected: a.selected,
|
|
677
|
+
status: i.value,
|
|
678
|
+
variant: "info",
|
|
679
|
+
onInspect: k[0] || (k[0] = (L) => I("inspect"))
|
|
680
|
+
}, {
|
|
681
|
+
default: le(() => [
|
|
682
|
+
A(O(se), {
|
|
683
|
+
type: "target",
|
|
684
|
+
position: O(ne).Top,
|
|
685
|
+
class: "handle"
|
|
686
|
+
}, null, 8, ["position"]),
|
|
687
|
+
e("div", vs, [
|
|
688
|
+
e("div", ps, [
|
|
689
|
+
e("div", fs, [
|
|
690
|
+
A(_t, { class: "loop-icon" })
|
|
691
|
+
]),
|
|
692
|
+
e("span", ms, y(u.value), 1),
|
|
693
|
+
e("span", {
|
|
694
|
+
class: P(["pill", { fixed: n.value === "fixed" }])
|
|
695
|
+
}, y(_.value), 3)
|
|
696
|
+
]),
|
|
697
|
+
e("div", gs, [
|
|
698
|
+
e("span", hs, [
|
|
699
|
+
k[1] || (k[1] = e("strong", null, "Max:", -1)),
|
|
700
|
+
Y(" " + y(x.value), 1)
|
|
701
|
+
]),
|
|
702
|
+
e("span", ys, [
|
|
703
|
+
k[2] || (k[2] = e("strong", null, "Iter:", -1)),
|
|
704
|
+
Y(" " + y(D.value ?? "—"), 1)
|
|
705
|
+
]),
|
|
706
|
+
v.value === "accumulate" ? (s(), l("span", ws, " 📦 ")) : M("", !0)
|
|
707
|
+
])
|
|
708
|
+
]),
|
|
709
|
+
k[3] || (k[3] = e("div", { class: "port-labels" }, [
|
|
710
|
+
e("span", { class: "port-label body-label" }, "↻ Loop"),
|
|
711
|
+
e("span", { class: "port-label done-label" }, "✓ Exit")
|
|
712
|
+
], -1)),
|
|
713
|
+
A(O(se), {
|
|
714
|
+
type: "source",
|
|
715
|
+
position: O(ne).Bottom,
|
|
716
|
+
id: "body",
|
|
717
|
+
class: "handle body-handle",
|
|
718
|
+
style: { left: "30%" }
|
|
719
|
+
}, null, 8, ["position"]),
|
|
720
|
+
A(O(se), {
|
|
721
|
+
type: "source",
|
|
722
|
+
position: O(ne).Bottom,
|
|
723
|
+
id: "done",
|
|
724
|
+
class: "handle done-handle",
|
|
725
|
+
style: { left: "70%" }
|
|
726
|
+
}, null, 8, ["position"])
|
|
727
|
+
]),
|
|
728
|
+
_: 1
|
|
729
|
+
}, 8, ["id", "selected", "status"]));
|
|
730
|
+
}
|
|
731
|
+
}), kt = /* @__PURE__ */ G(bs, [["__scopeId", "data-v-e439cd33"]]), _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
732
|
+
__proto__: null,
|
|
733
|
+
default: kt
|
|
734
|
+
}, Symbol.toStringTag, { value: "Module" })), ks = {}, xs = {
|
|
735
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
736
|
+
viewBox: "0 0 24 24"
|
|
737
|
+
};
|
|
738
|
+
function $s(a, d) {
|
|
739
|
+
return s(), l("svg", xs, [...d[0] || (d[0] = [
|
|
740
|
+
e("g", {
|
|
741
|
+
fill: "none",
|
|
742
|
+
stroke: "currentColor",
|
|
743
|
+
"stroke-linecap": "round",
|
|
744
|
+
"stroke-linejoin": "round",
|
|
745
|
+
"stroke-width": "2"
|
|
746
|
+
}, [
|
|
747
|
+
e("path", { d: "m14 12l6-3l-8-4l-8 4l6 3" }),
|
|
748
|
+
e("path", {
|
|
749
|
+
fill: "currentColor",
|
|
750
|
+
d: "m10 12l-6 3l8 4l8-4l-6-3l-2 1z"
|
|
751
|
+
})
|
|
752
|
+
], -1)
|
|
753
|
+
])]);
|
|
754
|
+
}
|
|
755
|
+
const xt = /* @__PURE__ */ G(ks, [["render", $s]]), Is = { class: "subflow-node" }, Ms = { class: "node-header" }, Ds = { class: "icon-wrapper" }, Ss = { class: "node-label" }, Ns = {
|
|
756
|
+
key: 0,
|
|
757
|
+
class: "status-spinner"
|
|
758
|
+
}, Ts = { class: "subflow-info" }, Cs = { class: "meta-row" }, Es = {
|
|
759
|
+
key: 0,
|
|
760
|
+
class: "meta-item"
|
|
761
|
+
}, Bs = /* @__PURE__ */ te({
|
|
762
|
+
__name: "SubflowNode",
|
|
763
|
+
props: {
|
|
764
|
+
id: {},
|
|
765
|
+
data: {},
|
|
766
|
+
selected: { type: Boolean }
|
|
767
|
+
},
|
|
768
|
+
emits: ["inspect"],
|
|
769
|
+
setup(a, { emit: d }) {
|
|
770
|
+
const r = a, u = $(() => r.data.label || "Subflow"), i = $(() => r.data.subflowId || ""), x = $(() => r.data.shareSession !== !1), n = $(() => r.data.status || "idle"), v = $(() => i.value ? i.value : "No subflow selected"), D = $(() => {
|
|
771
|
+
const I = r.data.inputMappings || {};
|
|
772
|
+
return Object.keys(I).length;
|
|
773
|
+
}), _ = d;
|
|
774
|
+
return (I, f) => (s(), ue(Ie, {
|
|
775
|
+
id: a.id,
|
|
776
|
+
selected: a.selected,
|
|
777
|
+
status: n.value,
|
|
778
|
+
variant: "secondary",
|
|
779
|
+
onInspect: f[0] || (f[0] = (k) => _("inspect"))
|
|
780
|
+
}, {
|
|
781
|
+
default: le(() => [
|
|
782
|
+
A(O(se), {
|
|
783
|
+
type: "target",
|
|
784
|
+
position: O(ne).Top,
|
|
785
|
+
class: "handle"
|
|
786
|
+
}, null, 8, ["position"]),
|
|
787
|
+
e("div", Is, [
|
|
788
|
+
e("div", Ms, [
|
|
789
|
+
e("div", Ds, [
|
|
790
|
+
A(xt, { class: "subflow-icon" })
|
|
791
|
+
]),
|
|
792
|
+
e("span", Ss, y(u.value), 1),
|
|
793
|
+
n.value === "active" ? (s(), l("div", Ns)) : M("", !0)
|
|
794
|
+
]),
|
|
795
|
+
e("div", Ts, [
|
|
796
|
+
e("div", {
|
|
797
|
+
class: P(["subflow-badge", { empty: !i.value }])
|
|
798
|
+
}, [
|
|
799
|
+
f[1] || (f[1] = e("svg", {
|
|
800
|
+
class: "link-icon",
|
|
801
|
+
viewBox: "0 0 24 24",
|
|
802
|
+
fill: "none",
|
|
803
|
+
stroke: "currentColor",
|
|
804
|
+
"stroke-width": "2"
|
|
805
|
+
}, [
|
|
806
|
+
e("path", { d: "M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" }),
|
|
807
|
+
e("path", { d: "M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" })
|
|
808
|
+
], -1)),
|
|
809
|
+
e("span", null, y(v.value), 1)
|
|
810
|
+
], 2),
|
|
811
|
+
e("div", Cs, [
|
|
812
|
+
D.value > 0 ? (s(), l("span", Es, [
|
|
813
|
+
f[2] || (f[2] = e("svg", {
|
|
814
|
+
class: "meta-icon",
|
|
815
|
+
viewBox: "0 0 24 24",
|
|
816
|
+
fill: "none",
|
|
817
|
+
stroke: "currentColor",
|
|
818
|
+
"stroke-width": "2"
|
|
819
|
+
}, [
|
|
820
|
+
e("path", { d: "M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4" }),
|
|
821
|
+
e("polyline", { points: "16 17 21 12 16 7" }),
|
|
822
|
+
e("line", {
|
|
823
|
+
x1: "21",
|
|
824
|
+
y1: "12",
|
|
825
|
+
x2: "9",
|
|
826
|
+
y2: "12"
|
|
827
|
+
})
|
|
828
|
+
], -1)),
|
|
829
|
+
Y(" " + y(D.value) + " input" + y(D.value !== 1 ? "s" : ""), 1)
|
|
830
|
+
])) : M("", !0),
|
|
831
|
+
e("span", {
|
|
832
|
+
class: P(["meta-item", { muted: !x.value }])
|
|
833
|
+
}, [
|
|
834
|
+
f[3] || (f[3] = e("svg", {
|
|
835
|
+
class: "meta-icon",
|
|
836
|
+
viewBox: "0 0 24 24",
|
|
837
|
+
fill: "none",
|
|
838
|
+
stroke: "currentColor",
|
|
839
|
+
"stroke-width": "2"
|
|
840
|
+
}, [
|
|
841
|
+
e("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }),
|
|
842
|
+
e("circle", {
|
|
843
|
+
cx: "9",
|
|
844
|
+
cy: "7",
|
|
845
|
+
r: "4"
|
|
846
|
+
}),
|
|
847
|
+
e("path", { d: "M23 21v-2a4 4 0 00-3-3.87" }),
|
|
848
|
+
e("path", { d: "M16 3.13a4 4 0 010 7.75" })
|
|
849
|
+
], -1)),
|
|
850
|
+
Y(" " + y(x.value ? "Shared" : "Isolated"), 1)
|
|
851
|
+
], 2)
|
|
852
|
+
])
|
|
853
|
+
])
|
|
854
|
+
]),
|
|
855
|
+
A(O(se), {
|
|
856
|
+
type: "source",
|
|
857
|
+
position: O(ne).Bottom,
|
|
858
|
+
class: "handle"
|
|
859
|
+
}, null, 8, ["position"]),
|
|
860
|
+
A(O(se), {
|
|
861
|
+
type: "source",
|
|
862
|
+
position: O(ne).Right,
|
|
863
|
+
id: "error",
|
|
864
|
+
class: "handle error-handle"
|
|
865
|
+
}, null, 8, ["position"])
|
|
866
|
+
]),
|
|
867
|
+
_: 1
|
|
868
|
+
}, 8, ["id", "selected", "status"]));
|
|
869
|
+
}
|
|
870
|
+
}), $t = /* @__PURE__ */ G(Bs, [["__scopeId", "data-v-d5994547"]]), Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
871
|
+
__proto__: null,
|
|
872
|
+
default: $t
|
|
873
|
+
}, Symbol.toStringTag, { value: "Module" })), Ls = {}, Rs = {
|
|
874
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
875
|
+
viewBox: "0 0 24 24"
|
|
876
|
+
};
|
|
877
|
+
function Ps(a, d) {
|
|
878
|
+
return s(), l("svg", Rs, [...d[0] || (d[0] = [
|
|
879
|
+
e("path", {
|
|
880
|
+
fill: "none",
|
|
881
|
+
stroke: "currentColor",
|
|
882
|
+
"stroke-linecap": "round",
|
|
883
|
+
"stroke-linejoin": "round",
|
|
884
|
+
"stroke-width": "2",
|
|
885
|
+
d: "M11.042 19.933A9.8 9.8 0 0 1 7.7 19L3 20l1.3-3.9C1.976 12.663 2.874 8.228 6.4 5.726c3.526-2.501 8.59-2.296 11.845.48c2.127 1.814 3.052 4.36 2.694 6.808M15 19l2 2l4-4"
|
|
886
|
+
}, null, -1)
|
|
887
|
+
])]);
|
|
888
|
+
}
|
|
889
|
+
const It = /* @__PURE__ */ G(Ls, [["render", Ps]]), As = { class: "output-node" }, Vs = { class: "node-header" }, Hs = { class: "icon-wrapper" }, js = { class: "node-label" }, zs = {
|
|
890
|
+
key: 0,
|
|
891
|
+
class: "status-spinner"
|
|
892
|
+
}, Us = { class: "output-info" }, Ws = { class: "format-badge" }, Fs = { class: "meta-row" }, Ks = {
|
|
893
|
+
key: 0,
|
|
894
|
+
class: "meta-item"
|
|
895
|
+
}, qs = {
|
|
896
|
+
key: 1,
|
|
897
|
+
class: "meta-item"
|
|
898
|
+
}, Gs = /* @__PURE__ */ te({
|
|
899
|
+
__name: "OutputNode",
|
|
900
|
+
props: {
|
|
901
|
+
id: {},
|
|
902
|
+
data: {},
|
|
903
|
+
selected: { type: Boolean }
|
|
904
|
+
},
|
|
905
|
+
emits: ["inspect"],
|
|
906
|
+
setup(a, { emit: d }) {
|
|
907
|
+
const r = a, u = $(() => r.data.label || "Output"), i = $(() => r.data.format || "text"), x = $(() => !!r.data.template), n = $(() => r.data.includeMetadata ?? !1), v = $(() => r.data.status || "idle"), D = $(() => {
|
|
908
|
+
switch (i.value) {
|
|
909
|
+
case "json":
|
|
910
|
+
return "JSON";
|
|
911
|
+
case "markdown":
|
|
912
|
+
return "MD";
|
|
913
|
+
case "text":
|
|
914
|
+
default:
|
|
915
|
+
return "TXT";
|
|
916
|
+
}
|
|
917
|
+
}), _ = d;
|
|
918
|
+
return (I, f) => (s(), ue(Ie, {
|
|
919
|
+
id: a.id,
|
|
920
|
+
selected: a.selected,
|
|
921
|
+
status: v.value,
|
|
922
|
+
variant: "info",
|
|
923
|
+
onInspect: f[0] || (f[0] = (k) => _("inspect"))
|
|
924
|
+
}, {
|
|
925
|
+
default: le(() => [
|
|
926
|
+
A(O(se), {
|
|
927
|
+
type: "target",
|
|
928
|
+
position: O(ne).Top,
|
|
929
|
+
class: "handle"
|
|
930
|
+
}, null, 8, ["position"]),
|
|
931
|
+
e("div", As, [
|
|
932
|
+
e("div", Vs, [
|
|
933
|
+
e("div", Hs, [
|
|
934
|
+
A(It, { class: "output-icon" })
|
|
935
|
+
]),
|
|
936
|
+
e("span", js, y(u.value), 1),
|
|
937
|
+
v.value === "active" ? (s(), l("div", zs)) : M("", !0)
|
|
938
|
+
]),
|
|
939
|
+
e("div", Us, [
|
|
940
|
+
e("div", Ws, [
|
|
941
|
+
f[1] || (f[1] = e("svg", {
|
|
942
|
+
class: "format-icon",
|
|
943
|
+
viewBox: "0 0 24 24",
|
|
944
|
+
fill: "none",
|
|
945
|
+
stroke: "currentColor",
|
|
946
|
+
"stroke-width": "2"
|
|
947
|
+
}, [
|
|
948
|
+
e("path", { d: "M4 7V4h16v3" }),
|
|
949
|
+
e("path", { d: "M9 20h6" }),
|
|
950
|
+
e("path", { d: "M12 4v16" })
|
|
951
|
+
], -1)),
|
|
952
|
+
e("span", null, y(D.value), 1)
|
|
953
|
+
]),
|
|
954
|
+
e("div", Fs, [
|
|
955
|
+
x.value ? (s(), l("span", Ks, [...f[2] || (f[2] = [
|
|
956
|
+
e("svg", {
|
|
957
|
+
class: "meta-icon",
|
|
958
|
+
viewBox: "0 0 24 24",
|
|
959
|
+
fill: "none",
|
|
960
|
+
stroke: "currentColor",
|
|
961
|
+
"stroke-width": "2"
|
|
962
|
+
}, [
|
|
963
|
+
e("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" })
|
|
964
|
+
], -1),
|
|
965
|
+
Y(" Template ", -1)
|
|
966
|
+
])])) : M("", !0),
|
|
967
|
+
n.value ? (s(), l("span", qs, [...f[3] || (f[3] = [
|
|
968
|
+
e("svg", {
|
|
969
|
+
class: "meta-icon",
|
|
970
|
+
viewBox: "0 0 24 24",
|
|
971
|
+
fill: "none",
|
|
972
|
+
stroke: "currentColor",
|
|
973
|
+
"stroke-width": "2"
|
|
974
|
+
}, [
|
|
975
|
+
e("circle", {
|
|
976
|
+
cx: "12",
|
|
977
|
+
cy: "12",
|
|
978
|
+
r: "10"
|
|
979
|
+
}),
|
|
980
|
+
e("line", {
|
|
981
|
+
x1: "12",
|
|
982
|
+
y1: "16",
|
|
983
|
+
x2: "12",
|
|
984
|
+
y2: "12"
|
|
985
|
+
}),
|
|
986
|
+
e("line", {
|
|
987
|
+
x1: "12",
|
|
988
|
+
y1: "8",
|
|
989
|
+
x2: "12.01",
|
|
990
|
+
y2: "8"
|
|
991
|
+
})
|
|
992
|
+
], -1),
|
|
993
|
+
Y(" Metadata ", -1)
|
|
994
|
+
])])) : M("", !0)
|
|
995
|
+
])
|
|
996
|
+
]),
|
|
997
|
+
f[4] || (f[4] = e("div", { class: "terminal-indicator" }, [
|
|
998
|
+
e("svg", {
|
|
999
|
+
viewBox: "0 0 24 24",
|
|
1000
|
+
fill: "none",
|
|
1001
|
+
stroke: "currentColor",
|
|
1002
|
+
"stroke-width": "2"
|
|
1003
|
+
}, [
|
|
1004
|
+
e("rect", {
|
|
1005
|
+
x: "3",
|
|
1006
|
+
y: "3",
|
|
1007
|
+
width: "18",
|
|
1008
|
+
height: "18",
|
|
1009
|
+
rx: "2",
|
|
1010
|
+
ry: "2"
|
|
1011
|
+
}),
|
|
1012
|
+
e("line", {
|
|
1013
|
+
x1: "9",
|
|
1014
|
+
y1: "9",
|
|
1015
|
+
x2: "15",
|
|
1016
|
+
y2: "15"
|
|
1017
|
+
}),
|
|
1018
|
+
e("line", {
|
|
1019
|
+
x1: "15",
|
|
1020
|
+
y1: "9",
|
|
1021
|
+
x2: "9",
|
|
1022
|
+
y2: "15"
|
|
1023
|
+
})
|
|
1024
|
+
]),
|
|
1025
|
+
e("span", null, "Terminal")
|
|
1026
|
+
], -1))
|
|
1027
|
+
])
|
|
1028
|
+
]),
|
|
1029
|
+
_: 1
|
|
1030
|
+
}, 8, ["id", "selected", "status"]));
|
|
1031
|
+
}
|
|
1032
|
+
}), Mt = /* @__PURE__ */ G(Gs, [["__scopeId", "data-v-94e60a57"]]), Ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1033
|
+
__proto__: null,
|
|
1034
|
+
default: Mt
|
|
1035
|
+
}, Symbol.toStringTag, { value: "Module" })), Xs = ["data-workflow-canvas"], Js = {
|
|
1036
|
+
key: 0,
|
|
1037
|
+
class: "edge-label"
|
|
1038
|
+
}, Qs = /* @__PURE__ */ te({
|
|
1039
|
+
__name: "WorkflowCanvas",
|
|
1040
|
+
props: {
|
|
1041
|
+
editor: {},
|
|
1042
|
+
nodeStatuses: {},
|
|
1043
|
+
panOnDrag: { type: [Boolean, Array] },
|
|
1044
|
+
selectionKeyCode: { type: [Boolean, String, Array, Function, null] },
|
|
1045
|
+
selectionMode: {},
|
|
1046
|
+
canvasId: {}
|
|
1047
|
+
},
|
|
1048
|
+
emits: ["nodeClick", "edgeClick", "paneClick", "drop", "nodeInspect"],
|
|
1049
|
+
setup(a, { expose: d, emit: r }) {
|
|
1050
|
+
const u = a, i = r;
|
|
1051
|
+
function x(w) {
|
|
1052
|
+
if (!c()) return;
|
|
1053
|
+
u.editor.commands.selectNode(w.id);
|
|
1054
|
+
const B = b.value.find((C) => C.id === w.id);
|
|
1055
|
+
B && i("nodeInspect", B);
|
|
1056
|
+
}
|
|
1057
|
+
const {
|
|
1058
|
+
onConnect: n,
|
|
1059
|
+
onNodeDragStop: v,
|
|
1060
|
+
screenToFlowCoordinate: D,
|
|
1061
|
+
fitView: _,
|
|
1062
|
+
nodes: I,
|
|
1063
|
+
edges: f,
|
|
1064
|
+
panOnDrag: k,
|
|
1065
|
+
selectionKeyCode: L,
|
|
1066
|
+
selectionMode: m
|
|
1067
|
+
} = ro(), U = k.value, g = L.value, S = m.value;
|
|
1068
|
+
de(
|
|
1069
|
+
() => u.panOnDrag,
|
|
1070
|
+
(w) => {
|
|
1071
|
+
k.value = w ?? U;
|
|
1072
|
+
},
|
|
1073
|
+
{ immediate: !0 }
|
|
1074
|
+
), de(
|
|
1075
|
+
() => u.selectionKeyCode,
|
|
1076
|
+
(w) => {
|
|
1077
|
+
L.value = w ?? g;
|
|
1078
|
+
},
|
|
1079
|
+
{ immediate: !0 }
|
|
1080
|
+
), de(
|
|
1081
|
+
() => u.selectionMode,
|
|
1082
|
+
(w) => {
|
|
1083
|
+
m.value = w ?? S;
|
|
1084
|
+
},
|
|
1085
|
+
{ immediate: !0 }
|
|
1086
|
+
);
|
|
1087
|
+
const b = H([]), h = H([]), c = () => !u.editor.isDestroyed();
|
|
1088
|
+
let T = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), V = -1;
|
|
1089
|
+
const z = (w, B) => `${u.editor.getNodeVersion(w)}:${B}`, q = (w, B) => `${u.editor.getEdgeVersion(w)}:${B}`, W = () => {
|
|
1090
|
+
var Te, Ce, Ee, ye, Be, Oe;
|
|
1091
|
+
const w = u.editor.getNodes(), B = u.editor.getEdges(), C = u.editor.getGlobalVersion();
|
|
1092
|
+
if (V === C && !u.nodeStatuses)
|
|
1093
|
+
return;
|
|
1094
|
+
const oe = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map();
|
|
1095
|
+
let ae = !1;
|
|
1096
|
+
const ee = new Set(b.value.map((E) => E.id)), we = new Set(w.map((E) => E.id));
|
|
1097
|
+
if (ee.size !== we.size)
|
|
1098
|
+
ae = !0;
|
|
1099
|
+
else
|
|
1100
|
+
for (const E of we)
|
|
1101
|
+
if (!ee.has(E)) {
|
|
1102
|
+
ae = !0;
|
|
1103
|
+
break;
|
|
1104
|
+
}
|
|
1105
|
+
if (!ae)
|
|
1106
|
+
for (const E of w) {
|
|
1107
|
+
const ie = ((Te = u.nodeStatuses) == null ? void 0 : Te[E.id]) || "idle", re = z(E.id, ie);
|
|
1108
|
+
oe.set(E.id, re), T.get(E.id) !== re && (ae = !0);
|
|
1109
|
+
}
|
|
1110
|
+
if (ae) {
|
|
1111
|
+
b.value = w.map((E) => {
|
|
1112
|
+
var ie;
|
|
1113
|
+
return {
|
|
1114
|
+
id: E.id,
|
|
1115
|
+
type: E.type,
|
|
1116
|
+
position: E.position,
|
|
1117
|
+
data: {
|
|
1118
|
+
...E.data,
|
|
1119
|
+
status: ((ie = u.nodeStatuses) == null ? void 0 : ie[E.id]) || "idle"
|
|
1120
|
+
},
|
|
1121
|
+
// Use editor's selection state as the source of truth
|
|
1122
|
+
selected: E.selected
|
|
1123
|
+
};
|
|
1124
|
+
}), T = /* @__PURE__ */ new Map();
|
|
1125
|
+
for (const E of w) {
|
|
1126
|
+
const ie = ((Ce = u.nodeStatuses) == null ? void 0 : Ce[E.id]) || "idle";
|
|
1127
|
+
T.set(E.id, z(E.id, ie));
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
let fe = !1;
|
|
1131
|
+
const ve = new Set(h.value.map((E) => E.id)), Ne = new Set(B.map((E) => E.id));
|
|
1132
|
+
if (ve.size !== Ne.size)
|
|
1133
|
+
fe = !0;
|
|
1134
|
+
else
|
|
1135
|
+
for (const E of Ne)
|
|
1136
|
+
if (!ve.has(E)) {
|
|
1137
|
+
fe = !0;
|
|
1138
|
+
break;
|
|
1139
|
+
}
|
|
1140
|
+
if (!fe)
|
|
1141
|
+
for (const E of B) {
|
|
1142
|
+
const ie = ((Ee = u.nodeStatuses) == null ? void 0 : Ee[E.source]) === "active" || ((ye = u.nodeStatuses) == null ? void 0 : ye[E.target]) === "active", re = q(E.id, ie);
|
|
1143
|
+
J.set(E.id, re), N.get(E.id) !== re && (fe = !0);
|
|
1144
|
+
}
|
|
1145
|
+
if (fe) {
|
|
1146
|
+
h.value = B.map((E) => {
|
|
1147
|
+
var ie, re;
|
|
1148
|
+
return {
|
|
1149
|
+
id: E.id,
|
|
1150
|
+
source: E.source,
|
|
1151
|
+
target: E.target,
|
|
1152
|
+
sourceHandle: E.sourceHandle,
|
|
1153
|
+
targetHandle: E.targetHandle,
|
|
1154
|
+
label: E.label,
|
|
1155
|
+
data: E.data,
|
|
1156
|
+
animated: ((ie = u.nodeStatuses) == null ? void 0 : ie[E.source]) === "active" || ((re = u.nodeStatuses) == null ? void 0 : re[E.target]) === "active"
|
|
1157
|
+
};
|
|
1158
|
+
}), N = /* @__PURE__ */ new Map();
|
|
1159
|
+
for (const E of B) {
|
|
1160
|
+
const ie = ((Be = u.nodeStatuses) == null ? void 0 : Be[E.source]) === "active" || ((Oe = u.nodeStatuses) == null ? void 0 : Oe[E.target]) === "active";
|
|
1161
|
+
N.set(E.id, q(E.id, ie));
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
V = C;
|
|
1165
|
+
};
|
|
1166
|
+
de(
|
|
1167
|
+
() => u.nodeStatuses,
|
|
1168
|
+
() => {
|
|
1169
|
+
W();
|
|
1170
|
+
},
|
|
1171
|
+
{ deep: !0 }
|
|
1172
|
+
);
|
|
1173
|
+
let ce = null, X = null, he = !1;
|
|
1174
|
+
const je = $(
|
|
1175
|
+
() => I.value.filter((w) => w.selected).map((w) => w.id).sort().join(",")
|
|
1176
|
+
);
|
|
1177
|
+
de(
|
|
1178
|
+
je,
|
|
1179
|
+
(w, B) => {
|
|
1180
|
+
if (!c() || he || w === B) return;
|
|
1181
|
+
const C = w ? w.split(",") : [];
|
|
1182
|
+
u.editor.commands.setSelection(C);
|
|
1183
|
+
}
|
|
1184
|
+
), Re(() => {
|
|
1185
|
+
c() && (W(), ce = u.editor.on("update", W), X = u.editor.on("selectionUpdate", () => {
|
|
1186
|
+
he = !0, W(), Pe(() => {
|
|
1187
|
+
he = !1;
|
|
1188
|
+
});
|
|
1189
|
+
}), setTimeout(() => _({ padding: 0.2 }), 100));
|
|
1190
|
+
}), Ae(() => {
|
|
1191
|
+
ce == null || ce(), X == null || X();
|
|
1192
|
+
}), n((w) => {
|
|
1193
|
+
c() && u.editor.commands.createEdge(
|
|
1194
|
+
w.source,
|
|
1195
|
+
w.target,
|
|
1196
|
+
w.sourceHandle ?? void 0,
|
|
1197
|
+
w.targetHandle ?? void 0
|
|
1198
|
+
);
|
|
1199
|
+
}), v(() => {
|
|
1200
|
+
if (!c()) return;
|
|
1201
|
+
const w = I.value.filter((B) => B.selected);
|
|
1202
|
+
for (const B of w)
|
|
1203
|
+
u.editor.commands.setNodePosition(B.id, B.position);
|
|
1204
|
+
});
|
|
1205
|
+
const ze = (w) => {
|
|
1206
|
+
c() && (u.editor.commands.selectNode(w.node.id), i("nodeClick", w.node));
|
|
1207
|
+
}, Ue = (w) => {
|
|
1208
|
+
c() && u.editor.commands.deselectAll(), i("edgeClick", w.edge);
|
|
1209
|
+
}, We = () => {
|
|
1210
|
+
c() && (u.editor.commands.deselectAll(), i("paneClick"));
|
|
1211
|
+
}, Fe = (w) => {
|
|
1212
|
+
var we, fe;
|
|
1213
|
+
if (!c()) return;
|
|
1214
|
+
const B = (we = w.dataTransfer) == null ? void 0 : we.getData("application/vueflow"), C = (fe = w.dataTransfer) == null ? void 0 : fe.getData("application/json");
|
|
1215
|
+
if (!B || !C) return;
|
|
1216
|
+
let oe;
|
|
1217
|
+
try {
|
|
1218
|
+
oe = JSON.parse(C);
|
|
1219
|
+
} catch (ve) {
|
|
1220
|
+
console.warn("Failed to parse dropped node data", ve);
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
if (!((ve) => typeof ve == "object" && ve !== null && "label" in ve && typeof ve.label == "string")(oe)) {
|
|
1224
|
+
console.warn('Dropped node data is missing required "label" field');
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
const ae = oe, ee = D({
|
|
1228
|
+
x: w.clientX,
|
|
1229
|
+
y: w.clientY
|
|
1230
|
+
});
|
|
1231
|
+
u.editor.commands.createNode(B, ae, ee), i("drop", w);
|
|
1232
|
+
}, Ke = (w) => {
|
|
1233
|
+
w.preventDefault(), w.dataTransfer && (w.dataTransfer.dropEffect = "move");
|
|
1234
|
+
}, qe = (w) => {
|
|
1235
|
+
var B;
|
|
1236
|
+
(B = w.currentTarget) == null || B.focus();
|
|
1237
|
+
}, De = (w) => {
|
|
1238
|
+
if (!c()) return;
|
|
1239
|
+
const B = w, { nodeType: C, defaultData: oe, x: J, y: ae } = B.detail, ee = D({ x: J, y: ae });
|
|
1240
|
+
u.editor.commands.createNode(C, oe, ee);
|
|
1241
|
+
}, Se = () => {
|
|
1242
|
+
const w = u.canvasId ? `[data-workflow-canvas="${u.canvasId}"] .vue-flow` : ".vue-flow";
|
|
1243
|
+
return document.querySelector(w);
|
|
1244
|
+
};
|
|
1245
|
+
Re(() => {
|
|
1246
|
+
const w = Se();
|
|
1247
|
+
w && w.addEventListener(
|
|
1248
|
+
"mobileNodeDrop",
|
|
1249
|
+
De
|
|
1250
|
+
);
|
|
1251
|
+
}), Ae(() => {
|
|
1252
|
+
const w = Se();
|
|
1253
|
+
w && w.removeEventListener(
|
|
1254
|
+
"mobileNodeDrop",
|
|
1255
|
+
De
|
|
1256
|
+
);
|
|
1257
|
+
});
|
|
1258
|
+
const Ge = (w) => {
|
|
1259
|
+
if (!c()) return;
|
|
1260
|
+
const B = w.target;
|
|
1261
|
+
if (!(B.tagName === "INPUT" || B.tagName === "TEXTAREA")) {
|
|
1262
|
+
if (w.key === "Delete" || w.key === "Backspace") {
|
|
1263
|
+
w.preventDefault();
|
|
1264
|
+
const C = f.value.filter((J) => J.selected).map((J) => J.id), oe = I.value.filter((J) => J.selected && J.type !== "start").map((J) => J.id);
|
|
1265
|
+
if (C.length) {
|
|
1266
|
+
C.forEach(
|
|
1267
|
+
(J) => u.editor.commands.deleteEdge(J)
|
|
1268
|
+
);
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
oe.forEach((J) => u.editor.commands.deleteNode(J));
|
|
1272
|
+
}
|
|
1273
|
+
(w.metaKey || w.ctrlKey) && w.key === "z" && !w.shiftKey && (w.preventDefault(), u.editor.commands.undo()), (w.metaKey || w.ctrlKey) && (w.key === "y" || w.key === "z" && w.shiftKey) && (w.preventDefault(), u.editor.commands.redo()), (w.metaKey || w.ctrlKey) && w.key === "d" && (w.preventDefault(), u.editor.getSelected().nodes.forEach((C) => u.editor.commands.duplicateNode(C)));
|
|
1274
|
+
}
|
|
1275
|
+
};
|
|
1276
|
+
return d({
|
|
1277
|
+
fitView: () => _({ padding: 0.2 })
|
|
1278
|
+
}), (w, B) => (s(), l("div", {
|
|
1279
|
+
class: P([
|
|
1280
|
+
"workflow-canvas",
|
|
1281
|
+
{ "workflow-canvas-select": a.selectionKeyCode === !0 }
|
|
1282
|
+
]),
|
|
1283
|
+
"data-workflow-canvas": a.canvasId || void 0,
|
|
1284
|
+
onDrop: Fe,
|
|
1285
|
+
onDragover: Ke,
|
|
1286
|
+
onKeydown: Ge,
|
|
1287
|
+
onMousedown: qe,
|
|
1288
|
+
tabindex: "0"
|
|
1289
|
+
}, [
|
|
1290
|
+
A(O(uo), {
|
|
1291
|
+
nodes: b.value,
|
|
1292
|
+
"onUpdate:nodes": B[0] || (B[0] = (C) => b.value = C),
|
|
1293
|
+
edges: h.value,
|
|
1294
|
+
"onUpdate:edges": B[1] || (B[1] = (C) => h.value = C),
|
|
1295
|
+
"default-viewport": { x: 50, y: 50, zoom: 1 },
|
|
1296
|
+
"min-zoom": 0.5,
|
|
1297
|
+
"max-zoom": 2,
|
|
1298
|
+
"fit-view-on-init": "",
|
|
1299
|
+
"pan-on-drag": a.panOnDrag,
|
|
1300
|
+
"selection-key-code": a.selectionKeyCode,
|
|
1301
|
+
"selection-mode": a.selectionMode,
|
|
1302
|
+
"delete-key-code": null,
|
|
1303
|
+
onNodeClick: ze,
|
|
1304
|
+
onEdgeClick: Ue,
|
|
1305
|
+
onPaneClick: We
|
|
1306
|
+
}, {
|
|
1307
|
+
"node-start": le((C) => [
|
|
1308
|
+
A(ft, {
|
|
1309
|
+
id: C.id,
|
|
1310
|
+
data: C.data,
|
|
1311
|
+
selected: C.selected
|
|
1312
|
+
}, null, 8, ["id", "data", "selected"])
|
|
1313
|
+
]),
|
|
1314
|
+
"node-agent": le((C) => [
|
|
1315
|
+
A(gt, $e(C, {
|
|
1316
|
+
onInspect: (oe) => x(C)
|
|
1317
|
+
}), null, 16, ["onInspect"])
|
|
1318
|
+
]),
|
|
1319
|
+
"node-router": le((C) => [
|
|
1320
|
+
A(yt, $e(C, {
|
|
1321
|
+
onInspect: (oe) => x(C)
|
|
1322
|
+
}), null, 16, ["onInspect"])
|
|
1323
|
+
]),
|
|
1324
|
+
"node-parallel": le((C) => [
|
|
1325
|
+
A(bt, $e(C, {
|
|
1326
|
+
onInspect: (oe) => x(C)
|
|
1327
|
+
}), null, 16, ["onInspect"])
|
|
1328
|
+
]),
|
|
1329
|
+
"node-whileLoop": le((C) => [
|
|
1330
|
+
A(kt, $e(C, {
|
|
1331
|
+
onInspect: (oe) => x(C)
|
|
1332
|
+
}), null, 16, ["onInspect"])
|
|
1333
|
+
]),
|
|
1334
|
+
"node-subflow": le((C) => [
|
|
1335
|
+
A($t, $e(C, {
|
|
1336
|
+
onInspect: (oe) => x(C)
|
|
1337
|
+
}), null, 16, ["onInspect"])
|
|
1338
|
+
]),
|
|
1339
|
+
"node-output": le((C) => [
|
|
1340
|
+
A(Mt, $e(C, {
|
|
1341
|
+
onInspect: (oe) => x(C)
|
|
1342
|
+
}), null, 16, ["onInspect"])
|
|
1343
|
+
]),
|
|
1344
|
+
"edge-label": le(({ label: C }) => [
|
|
1345
|
+
C ? (s(), l("div", Js, y(C), 1)) : M("", !0)
|
|
1346
|
+
]),
|
|
1347
|
+
default: le(() => [
|
|
1348
|
+
A(O(co), {
|
|
1349
|
+
gap: 20,
|
|
1350
|
+
size: 1,
|
|
1351
|
+
"pattern-color": "rgba(255, 255, 255, 0.03)"
|
|
1352
|
+
}),
|
|
1353
|
+
A(O(vt), { position: "bottom-left" })
|
|
1354
|
+
]),
|
|
1355
|
+
_: 1
|
|
1356
|
+
}, 8, ["nodes", "edges", "pan-on-drag", "selection-key-code", "selection-mode"])
|
|
1357
|
+
], 42, Xs));
|
|
1358
|
+
}
|
|
1359
|
+
}), od = /* @__PURE__ */ G(Qs, [["__scopeId", "data-v-149e9faf"]]), Zs = {}, en = {
|
|
1360
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1361
|
+
viewBox: "0 0 24 24"
|
|
1362
|
+
};
|
|
1363
|
+
function tn(a, d) {
|
|
1364
|
+
return s(), l("svg", en, [...d[0] || (d[0] = [
|
|
1365
|
+
e("g", {
|
|
1366
|
+
fill: "none",
|
|
1367
|
+
stroke: "currentColor",
|
|
1368
|
+
"stroke-width": "2"
|
|
1369
|
+
}, [
|
|
1370
|
+
e("line", {
|
|
1371
|
+
x1: "12",
|
|
1372
|
+
y1: "5",
|
|
1373
|
+
x2: "12",
|
|
1374
|
+
y2: "19"
|
|
1375
|
+
}),
|
|
1376
|
+
e("line", {
|
|
1377
|
+
x1: "5",
|
|
1378
|
+
y1: "12",
|
|
1379
|
+
x2: "19",
|
|
1380
|
+
y2: "12"
|
|
1381
|
+
})
|
|
1382
|
+
], -1)
|
|
1383
|
+
])]);
|
|
1384
|
+
}
|
|
1385
|
+
const on = /* @__PURE__ */ G(Zs, [["render", tn]]), sn = {}, nn = {
|
|
1386
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1387
|
+
viewBox: "0 0 24 24",
|
|
1388
|
+
fill: "none",
|
|
1389
|
+
stroke: "currentColor",
|
|
1390
|
+
"stroke-width": "2"
|
|
1391
|
+
};
|
|
1392
|
+
function ln(a, d) {
|
|
1393
|
+
return s(), l("svg", nn, [...d[0] || (d[0] = [
|
|
1394
|
+
be('<circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
|
|
1395
|
+
])]);
|
|
1396
|
+
}
|
|
1397
|
+
const an = /* @__PURE__ */ G(sn, [["render", ln]]), rn = {}, dn = {
|
|
1398
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1399
|
+
viewBox: "0 0 24 24"
|
|
1400
|
+
};
|
|
1401
|
+
function un(a, d) {
|
|
1402
|
+
return s(), l("svg", dn, [...d[0] || (d[0] = [
|
|
1403
|
+
e("g", {
|
|
1404
|
+
fill: "none",
|
|
1405
|
+
stroke: "currentColor",
|
|
1406
|
+
"stroke-linecap": "round",
|
|
1407
|
+
"stroke-linejoin": "round",
|
|
1408
|
+
"stroke-width": "2"
|
|
1409
|
+
}, [
|
|
1410
|
+
e("path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01" }),
|
|
1411
|
+
e("path", { d: "M11 12h1v4h1" })
|
|
1412
|
+
], -1)
|
|
1413
|
+
])]);
|
|
1414
|
+
}
|
|
1415
|
+
const cn = /* @__PURE__ */ G(rn, [["render", un]]), vn = { class: "node-palette" }, pn = { class: "palette-header" }, fn = { class: "palette-nodes" }, mn = ["onDragstart", "onTouchstart", "onClick"], gn = { class: "node-info" }, hn = { class: "node-name" }, yn = { class: "node-desc" }, wn = { class: "palette-hint" }, bn = 6, _n = /* @__PURE__ */ te({
|
|
1416
|
+
__name: "NodePalette",
|
|
1417
|
+
props: {
|
|
1418
|
+
editor: {},
|
|
1419
|
+
canvasId: {}
|
|
1420
|
+
},
|
|
1421
|
+
emits: ["quick-add"],
|
|
1422
|
+
setup(a, { emit: d }) {
|
|
1423
|
+
const r = a, u = d, i = H(!1), x = () => {
|
|
1424
|
+
i.value = window.innerWidth <= 768;
|
|
1425
|
+
};
|
|
1426
|
+
Re(() => {
|
|
1427
|
+
x(), window.addEventListener("resize", x);
|
|
1428
|
+
}), Ae(() => {
|
|
1429
|
+
window.removeEventListener("resize", x);
|
|
1430
|
+
});
|
|
1431
|
+
const n = [
|
|
1432
|
+
{
|
|
1433
|
+
type: "agent",
|
|
1434
|
+
label: "AI Agent",
|
|
1435
|
+
description: "Connect to an AI model to process and respond to messages",
|
|
1436
|
+
colorVar: "--or3-color-accent",
|
|
1437
|
+
icon: mt,
|
|
1438
|
+
defaultData: {
|
|
1439
|
+
label: "New Agent",
|
|
1440
|
+
model: "z-ai/glm-4.6:exacto",
|
|
1441
|
+
prompt: ""
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
type: "router",
|
|
1446
|
+
label: "Decision",
|
|
1447
|
+
description: "Route messages to different paths based on intent",
|
|
1448
|
+
colorVar: "--or3-color-warning",
|
|
1449
|
+
icon: ht,
|
|
1450
|
+
defaultData: {
|
|
1451
|
+
label: "Decision"
|
|
1452
|
+
// Routes are derived from connected edges
|
|
1453
|
+
}
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
type: "parallel",
|
|
1457
|
+
label: "Parallel",
|
|
1458
|
+
description: "Run multiple tasks at once and combine results",
|
|
1459
|
+
colorVar: "--or3-color-info",
|
|
1460
|
+
icon: wt,
|
|
1461
|
+
defaultData: {
|
|
1462
|
+
label: "Parallel",
|
|
1463
|
+
model: "z-ai/glm-4.6:exacto",
|
|
1464
|
+
prompt: "Combine the outputs into a coherent response.",
|
|
1465
|
+
branches: []
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
type: "whileLoop",
|
|
1470
|
+
label: "Loop",
|
|
1471
|
+
description: "Repeat a sequence until a condition is met",
|
|
1472
|
+
colorVar: "--or3-color-info",
|
|
1473
|
+
icon: _t,
|
|
1474
|
+
defaultData: {
|
|
1475
|
+
label: "Loop",
|
|
1476
|
+
conditionPrompt: 'Should we continue iterating? Respond with "continue" or "done".',
|
|
1477
|
+
maxIterations: 10,
|
|
1478
|
+
onMaxIterations: "warning"
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
{
|
|
1482
|
+
type: "subflow",
|
|
1483
|
+
label: "Sub-workflow",
|
|
1484
|
+
description: "Embed another workflow as a single node",
|
|
1485
|
+
colorVar: "--or3-color-secondary",
|
|
1486
|
+
icon: xt,
|
|
1487
|
+
defaultData: {
|
|
1488
|
+
label: "Sub-workflow",
|
|
1489
|
+
subflowId: "",
|
|
1490
|
+
inputMappings: {},
|
|
1491
|
+
shareSession: !0
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
type: "output",
|
|
1496
|
+
label: "Output",
|
|
1497
|
+
description: "Define the final output format",
|
|
1498
|
+
colorVar: "--or3-color-success",
|
|
1499
|
+
icon: It,
|
|
1500
|
+
defaultData: {
|
|
1501
|
+
label: "Output",
|
|
1502
|
+
format: "text",
|
|
1503
|
+
template: "",
|
|
1504
|
+
includeMetadata: !1
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
], v = () => {
|
|
1508
|
+
const h = r.canvasId ? `[data-workflow-canvas="${r.canvasId}"] .vue-flow` : ".vue-flow";
|
|
1509
|
+
return document.querySelector(h);
|
|
1510
|
+
}, D = (h, c, T) => {
|
|
1511
|
+
h.dataTransfer && (h.dataTransfer.setData("application/vueflow", c), h.dataTransfer.setData(
|
|
1512
|
+
"application/json",
|
|
1513
|
+
JSON.stringify(T)
|
|
1514
|
+
), h.dataTransfer.effectAllowed = "move");
|
|
1515
|
+
};
|
|
1516
|
+
let _ = null, I = !1, f = !1, k = 0, L = 0;
|
|
1517
|
+
const m = (h, c, T) => {
|
|
1518
|
+
_ = { nodeType: c, defaultData: T }, f = !1;
|
|
1519
|
+
const N = h.touches[0];
|
|
1520
|
+
N && (k = N.clientX, L = N.clientY);
|
|
1521
|
+
}, U = (h) => {
|
|
1522
|
+
if (!_ || f) return;
|
|
1523
|
+
const c = h.touches[0];
|
|
1524
|
+
if (!c) return;
|
|
1525
|
+
const T = Math.abs(c.clientX - k), N = Math.abs(c.clientY - L);
|
|
1526
|
+
if (T + N < bn) return;
|
|
1527
|
+
f = !0, h.currentTarget.classList.add("dragging-touch");
|
|
1528
|
+
}, g = (h) => {
|
|
1529
|
+
if (h.currentTarget.classList.remove("dragging-touch"), !_) return;
|
|
1530
|
+
const T = h.changedTouches[0], N = document.elementFromPoint(T.clientX, T.clientY), V = v();
|
|
1531
|
+
if (V && (V === N || V.contains(N))) {
|
|
1532
|
+
const z = new CustomEvent("mobileNodeDrop", {
|
|
1533
|
+
detail: {
|
|
1534
|
+
nodeType: _.nodeType,
|
|
1535
|
+
defaultData: _.defaultData,
|
|
1536
|
+
x: T.clientX,
|
|
1537
|
+
y: T.clientY
|
|
1538
|
+
}
|
|
1539
|
+
});
|
|
1540
|
+
V.dispatchEvent(z), I = !0, setTimeout(() => {
|
|
1541
|
+
I = !1;
|
|
1542
|
+
}, 0);
|
|
1543
|
+
}
|
|
1544
|
+
_ = null, f = !1;
|
|
1545
|
+
}, S = (h, c) => {
|
|
1546
|
+
const T = v();
|
|
1547
|
+
if (!T) return;
|
|
1548
|
+
const N = T.getBoundingClientRect(), V = N.left + N.width / 2, z = N.top + N.height / 2, q = new CustomEvent("mobileNodeDrop", {
|
|
1549
|
+
detail: {
|
|
1550
|
+
nodeType: h,
|
|
1551
|
+
defaultData: c,
|
|
1552
|
+
x: V,
|
|
1553
|
+
y: z
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
T.dispatchEvent(q);
|
|
1557
|
+
}, b = (h, c, T) => {
|
|
1558
|
+
if (I) {
|
|
1559
|
+
I = !1;
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1562
|
+
i.value && (h.preventDefault(), S(c, T), u("quick-add"));
|
|
1563
|
+
};
|
|
1564
|
+
return (h, c) => (s(), l("div", vn, [
|
|
1565
|
+
e("div", pn, [
|
|
1566
|
+
A(on, { class: "plus-icon" }),
|
|
1567
|
+
c[1] || (c[1] = e("span", null, "Add Nodes", -1))
|
|
1568
|
+
]),
|
|
1569
|
+
e("div", fn, [
|
|
1570
|
+
(s(), l(K, null, Q(n, (T) => e("div", {
|
|
1571
|
+
key: T.type,
|
|
1572
|
+
class: "palette-node",
|
|
1573
|
+
draggable: "true",
|
|
1574
|
+
onDragstart: (N) => D(N, T.type, T.defaultData),
|
|
1575
|
+
onTouchstart: (N) => m(N, T.type, T.defaultData),
|
|
1576
|
+
onTouchmove: U,
|
|
1577
|
+
onTouchend: c[0] || (c[0] = (N) => g(N)),
|
|
1578
|
+
onClick: (N) => b(N, T.type, T.defaultData)
|
|
1579
|
+
}, [
|
|
1580
|
+
e("div", {
|
|
1581
|
+
class: "node-icon",
|
|
1582
|
+
style: He({
|
|
1583
|
+
"--node-color": `var(${T.colorVar}, #8b5cf6)`
|
|
1584
|
+
})
|
|
1585
|
+
}, [
|
|
1586
|
+
(s(), ue(to(T.icon)))
|
|
1587
|
+
], 4),
|
|
1588
|
+
e("div", gn, [
|
|
1589
|
+
e("span", hn, y(T.label), 1),
|
|
1590
|
+
e("span", yn, y(T.description), 1)
|
|
1591
|
+
]),
|
|
1592
|
+
A(an, { class: "drag-handle" })
|
|
1593
|
+
], 40, mn)), 64))
|
|
1594
|
+
]),
|
|
1595
|
+
e("div", wn, [
|
|
1596
|
+
A(cn, { class: "hint-icon" }),
|
|
1597
|
+
c[2] || (c[2] = e("p", null, " Drag nodes onto the canvas to build your workflow. Connect nodes by dragging from output to input handles. ", -1))
|
|
1598
|
+
])
|
|
1599
|
+
]));
|
|
1600
|
+
}
|
|
1601
|
+
}), sd = /* @__PURE__ */ G(_n, [["__scopeId", "data-v-958e336f"]]), kn = { class: "mode-selector" }, xn = ["onClick", "title"], $n = ["innerHTML"], In = /* @__PURE__ */ te({
|
|
1602
|
+
__name: "OutputModeSelector",
|
|
1603
|
+
props: {
|
|
1604
|
+
modelValue: {}
|
|
1605
|
+
},
|
|
1606
|
+
emits: ["update:modelValue"],
|
|
1607
|
+
setup(a, { emit: d }) {
|
|
1608
|
+
const r = d, u = [
|
|
1609
|
+
{
|
|
1610
|
+
value: "combine",
|
|
1611
|
+
label: "Combine",
|
|
1612
|
+
description: "Concatenate outputs without AI processing",
|
|
1613
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>'
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
value: "synthesis",
|
|
1617
|
+
label: "AI Synthesis",
|
|
1618
|
+
description: "Use AI to synthesize a new output",
|
|
1619
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"/><path d="M2 12h20"/><path d="M12 12v10"/><path d="M8 17h8"/></svg>'
|
|
1620
|
+
}
|
|
1621
|
+
];
|
|
1622
|
+
return (i, x) => (s(), l("div", kn, [
|
|
1623
|
+
(s(), l(K, null, Q(u, (n) => e("button", {
|
|
1624
|
+
key: n.value,
|
|
1625
|
+
onClick: (v) => r("update:modelValue", n.value),
|
|
1626
|
+
class: P(["mode-btn", { active: a.modelValue === n.value }]),
|
|
1627
|
+
title: n.description
|
|
1628
|
+
}, [
|
|
1629
|
+
e("span", {
|
|
1630
|
+
innerHTML: n.icon,
|
|
1631
|
+
class: "mode-icon"
|
|
1632
|
+
}, null, 8, $n),
|
|
1633
|
+
Y(" " + y(n.label), 1)
|
|
1634
|
+
], 10, xn)), 64))
|
|
1635
|
+
]));
|
|
1636
|
+
}
|
|
1637
|
+
}), Mn = /* @__PURE__ */ G(In, [["__scopeId", "data-v-080a00d4"]]), Dn = { class: "space-y-3 source-picker" }, Sn = { class: "flex items-center justify-between" }, Nn = { class: "relative" }, Tn = ["disabled"], Cn = {
|
|
1638
|
+
key: 0,
|
|
1639
|
+
class: "absolute right-0 top-full mt-1 w-64 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50 max-h-60 overflow-y-auto"
|
|
1640
|
+
}, En = {
|
|
1641
|
+
key: 0,
|
|
1642
|
+
class: "p-3 text-xs text-gray-500 text-center"
|
|
1643
|
+
}, Bn = {
|
|
1644
|
+
key: 1,
|
|
1645
|
+
class: "py-1"
|
|
1646
|
+
}, On = {
|
|
1647
|
+
key: 0,
|
|
1648
|
+
class: "px-3 py-1 text-xs font-semibold text-gray-500 bg-gray-50 dark:bg-gray-700/50"
|
|
1649
|
+
}, Ln = ["onClick"], Rn = { class: "truncate" }, Pn = { class: "text-xs text-gray-400" }, An = ["onDragstart", "onDragover"], Vn = {
|
|
1650
|
+
key: 0,
|
|
1651
|
+
class: "drop-indicator before"
|
|
1652
|
+
}, Hn = {
|
|
1653
|
+
key: 1,
|
|
1654
|
+
class: "drop-indicator after"
|
|
1655
|
+
}, jn = { class: "flex-1 min-w-0 pointer-events-none" }, zn = { class: "text-sm font-semibold truncate" }, Un = {
|
|
1656
|
+
key: 0,
|
|
1657
|
+
class: "text-xs source-subtext truncate"
|
|
1658
|
+
}, Wn = ["onClick"], Fn = {
|
|
1659
|
+
key: 1,
|
|
1660
|
+
class: "empty-state"
|
|
1661
|
+
}, Kn = /* @__PURE__ */ te({
|
|
1662
|
+
__name: "OutputSourcePicker",
|
|
1663
|
+
props: {
|
|
1664
|
+
modelValue: {},
|
|
1665
|
+
availableGroups: {},
|
|
1666
|
+
disabled: { type: Boolean }
|
|
1667
|
+
},
|
|
1668
|
+
emits: ["update:modelValue"],
|
|
1669
|
+
setup(a, { emit: d }) {
|
|
1670
|
+
const r = a, u = d, i = $(() => r.availableGroups.flatMap((h) => h.sources)), x = $(() => r.modelValue.map((h) => i.value.find((c) => c.id === h)).filter((h) => !!h)), n = $(() => r.availableGroups.map((h) => ({
|
|
1671
|
+
...h,
|
|
1672
|
+
sources: h.sources.filter(
|
|
1673
|
+
(c) => !r.modelValue.includes(c.id)
|
|
1674
|
+
)
|
|
1675
|
+
})).filter((h) => h.sources.length > 0)), v = H(!1);
|
|
1676
|
+
function D(h) {
|
|
1677
|
+
u("update:modelValue", [...r.modelValue, h]), v.value = !1;
|
|
1678
|
+
}
|
|
1679
|
+
function _(h) {
|
|
1680
|
+
u(
|
|
1681
|
+
"update:modelValue",
|
|
1682
|
+
r.modelValue.filter((c) => c !== h)
|
|
1683
|
+
);
|
|
1684
|
+
}
|
|
1685
|
+
const I = H(null), f = H(
|
|
1686
|
+
null
|
|
1687
|
+
);
|
|
1688
|
+
function k(h, c) {
|
|
1689
|
+
I.value = c, h.dataTransfer && (h.dataTransfer.effectAllowed = "move", h.dataTransfer.dropEffect = "move");
|
|
1690
|
+
}
|
|
1691
|
+
function L(h, c) {
|
|
1692
|
+
var q, W;
|
|
1693
|
+
if (h.preventDefault(), I.value === null) return;
|
|
1694
|
+
if (I.value === c) {
|
|
1695
|
+
f.value = null;
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
const N = h.currentTarget.getBoundingClientRect(), V = N.top + N.height / 2, z = h.clientY < V ? "before" : "after";
|
|
1699
|
+
(((q = f.value) == null ? void 0 : q.index) !== c || ((W = f.value) == null ? void 0 : W.position) !== z) && (f.value = { index: c, position: z });
|
|
1700
|
+
}
|
|
1701
|
+
function m(h) {
|
|
1702
|
+
const c = h.relatedTarget;
|
|
1703
|
+
h.currentTarget.contains(c);
|
|
1704
|
+
}
|
|
1705
|
+
function U(h) {
|
|
1706
|
+
const c = h.relatedTarget;
|
|
1707
|
+
h.currentTarget.contains(c) || (f.value = null);
|
|
1708
|
+
}
|
|
1709
|
+
function g(h) {
|
|
1710
|
+
if (h.preventDefault(), I.value === null || !f.value) {
|
|
1711
|
+
b();
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1714
|
+
const c = x.value[I.value], T = x.value[f.value.index];
|
|
1715
|
+
if (!c || !T || c.id === T.id) {
|
|
1716
|
+
b();
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
const N = [...r.modelValue], V = N.indexOf(c.id);
|
|
1720
|
+
if (V === -1) {
|
|
1721
|
+
b();
|
|
1722
|
+
return;
|
|
1723
|
+
}
|
|
1724
|
+
const [z] = N.splice(V, 1);
|
|
1725
|
+
let q = N.indexOf(T.id);
|
|
1726
|
+
if (q === -1) {
|
|
1727
|
+
b();
|
|
1728
|
+
return;
|
|
1729
|
+
}
|
|
1730
|
+
f.value.position === "after" && q++, N.splice(q, 0, z), u("update:modelValue", N), b();
|
|
1731
|
+
}
|
|
1732
|
+
function S() {
|
|
1733
|
+
b();
|
|
1734
|
+
}
|
|
1735
|
+
function b() {
|
|
1736
|
+
I.value = null, f.value = null;
|
|
1737
|
+
}
|
|
1738
|
+
return (h, c) => (s(), l("div", Dn, [
|
|
1739
|
+
e("div", Sn, [
|
|
1740
|
+
c[3] || (c[3] = e("label", { class: "sources-label" }, "Sources", -1)),
|
|
1741
|
+
e("div", Nn, [
|
|
1742
|
+
e("button", {
|
|
1743
|
+
onClick: c[0] || (c[0] = (T) => v.value = !v.value),
|
|
1744
|
+
disabled: a.disabled || n.value.length === 0,
|
|
1745
|
+
class: "add-source-btn"
|
|
1746
|
+
}, [...c[2] || (c[2] = [
|
|
1747
|
+
e("svg", {
|
|
1748
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1749
|
+
width: "12",
|
|
1750
|
+
height: "12",
|
|
1751
|
+
viewBox: "0 0 24 24",
|
|
1752
|
+
fill: "none",
|
|
1753
|
+
stroke: "currentColor",
|
|
1754
|
+
"stroke-width": "2",
|
|
1755
|
+
"stroke-linecap": "round",
|
|
1756
|
+
"stroke-linejoin": "round"
|
|
1757
|
+
}, [
|
|
1758
|
+
e("line", {
|
|
1759
|
+
x1: "12",
|
|
1760
|
+
y1: "5",
|
|
1761
|
+
x2: "12",
|
|
1762
|
+
y2: "19"
|
|
1763
|
+
}),
|
|
1764
|
+
e("line", {
|
|
1765
|
+
x1: "5",
|
|
1766
|
+
y1: "12",
|
|
1767
|
+
x2: "19",
|
|
1768
|
+
y2: "12"
|
|
1769
|
+
})
|
|
1770
|
+
], -1),
|
|
1771
|
+
Y(" Add Source ", -1)
|
|
1772
|
+
])], 8, Tn),
|
|
1773
|
+
v.value ? (s(), l("div", Cn, [
|
|
1774
|
+
n.value.length === 0 ? (s(), l("div", En, " No more sources available ")) : (s(), l("div", Bn, [
|
|
1775
|
+
(s(!0), l(K, null, Q(n.value, (T, N) => (s(), l("div", { key: N }, [
|
|
1776
|
+
T.type === "parallel" ? (s(), l("div", On, y(T.label), 1)) : M("", !0),
|
|
1777
|
+
(s(!0), l(K, null, Q(T.sources, (V) => (s(), l("button", {
|
|
1778
|
+
key: V.id,
|
|
1779
|
+
onClick: (z) => D(V.id),
|
|
1780
|
+
class: "w-full text-left px-3 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center justify-between group"
|
|
1781
|
+
}, [
|
|
1782
|
+
e("span", Rn, y(V.branchLabel || V.label), 1),
|
|
1783
|
+
e("span", Pn, y(V.type), 1)
|
|
1784
|
+
], 8, Ln))), 128))
|
|
1785
|
+
]))), 128))
|
|
1786
|
+
]))
|
|
1787
|
+
])) : M("", !0),
|
|
1788
|
+
v.value ? (s(), l("div", {
|
|
1789
|
+
key: 1,
|
|
1790
|
+
onClick: c[1] || (c[1] = (T) => v.value = !1),
|
|
1791
|
+
class: "fixed inset-0 z-40"
|
|
1792
|
+
})) : M("", !0)
|
|
1793
|
+
])
|
|
1794
|
+
]),
|
|
1795
|
+
x.value.length > 0 ? (s(), l("div", {
|
|
1796
|
+
key: 0,
|
|
1797
|
+
class: "space-y-2 relative",
|
|
1798
|
+
onDragleave: U
|
|
1799
|
+
}, [
|
|
1800
|
+
(s(!0), l(K, null, Q(x.value, (T, N) => {
|
|
1801
|
+
var V, z;
|
|
1802
|
+
return s(), l("div", {
|
|
1803
|
+
key: T.id,
|
|
1804
|
+
draggable: "true",
|
|
1805
|
+
onDragstart: (q) => k(q, N),
|
|
1806
|
+
onDragover: (q) => L(q, N),
|
|
1807
|
+
onDragleave: m,
|
|
1808
|
+
onDrop: g,
|
|
1809
|
+
onDragend: S,
|
|
1810
|
+
class: P(["source-card group", {
|
|
1811
|
+
"is-dragging": I.value === N
|
|
1812
|
+
}])
|
|
1813
|
+
}, [
|
|
1814
|
+
((V = f.value) == null ? void 0 : V.index) === N && f.value.position === "before" ? (s(), l("div", Vn)) : M("", !0),
|
|
1815
|
+
((z = f.value) == null ? void 0 : z.index) === N && f.value.position === "after" ? (s(), l("div", Hn)) : M("", !0),
|
|
1816
|
+
c[5] || (c[5] = be('<div class="drag-handle" title="Drag to reorder" data-v-82c6b2ea><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-82c6b2ea><line x1="8" y1="6" x2="21" y2="6" data-v-82c6b2ea></line><line x1="8" y1="12" x2="21" y2="12" data-v-82c6b2ea></line><line x1="8" y1="18" x2="21" y2="18" data-v-82c6b2ea></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-82c6b2ea></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-82c6b2ea></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-82c6b2ea></line></svg></div>', 1)),
|
|
1817
|
+
e("div", jn, [
|
|
1818
|
+
e("div", zn, y(T.branchLabel || T.label), 1),
|
|
1819
|
+
T.parallelParentId ? (s(), l("div", Un, " from " + y(T.label), 1)) : M("", !0)
|
|
1820
|
+
]),
|
|
1821
|
+
e("button", {
|
|
1822
|
+
onClick: (q) => _(T.id),
|
|
1823
|
+
class: "remove-btn",
|
|
1824
|
+
title: "Remove source"
|
|
1825
|
+
}, [...c[4] || (c[4] = [
|
|
1826
|
+
e("svg", {
|
|
1827
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1828
|
+
width: "14",
|
|
1829
|
+
height: "14",
|
|
1830
|
+
viewBox: "0 0 24 24",
|
|
1831
|
+
fill: "none",
|
|
1832
|
+
stroke: "currentColor",
|
|
1833
|
+
"stroke-width": "2",
|
|
1834
|
+
"stroke-linecap": "round",
|
|
1835
|
+
"stroke-linejoin": "round"
|
|
1836
|
+
}, [
|
|
1837
|
+
e("line", {
|
|
1838
|
+
x1: "18",
|
|
1839
|
+
y1: "6",
|
|
1840
|
+
x2: "6",
|
|
1841
|
+
y2: "18"
|
|
1842
|
+
}),
|
|
1843
|
+
e("line", {
|
|
1844
|
+
x1: "6",
|
|
1845
|
+
y1: "6",
|
|
1846
|
+
x2: "18",
|
|
1847
|
+
y2: "18"
|
|
1848
|
+
})
|
|
1849
|
+
], -1)
|
|
1850
|
+
])], 8, Wn)
|
|
1851
|
+
], 42, An);
|
|
1852
|
+
}), 128))
|
|
1853
|
+
], 32)) : (s(), l("div", Fn, [...c[6] || (c[6] = [
|
|
1854
|
+
Y(" No sources selected. ", -1),
|
|
1855
|
+
e("br", null, null, -1),
|
|
1856
|
+
e("span", { class: "text-xs" }, "Output will be empty.", -1)
|
|
1857
|
+
])]))
|
|
1858
|
+
]));
|
|
1859
|
+
}
|
|
1860
|
+
}), qn = /* @__PURE__ */ G(Kn, [["__scopeId", "data-v-82c6b2ea"]]), Gn = { class: "preview-card" }, Yn = { class: "preview-header" }, Xn = {
|
|
1861
|
+
key: 0,
|
|
1862
|
+
class: "preview-status"
|
|
1863
|
+
}, Jn = {
|
|
1864
|
+
key: 1,
|
|
1865
|
+
class: "preview-empty"
|
|
1866
|
+
}, Qn = {
|
|
1867
|
+
key: 0,
|
|
1868
|
+
class: "preview-footer"
|
|
1869
|
+
}, Zn = /* @__PURE__ */ te({
|
|
1870
|
+
__name: "OutputPreview",
|
|
1871
|
+
props: {
|
|
1872
|
+
previewData: {},
|
|
1873
|
+
maxHeight: {}
|
|
1874
|
+
},
|
|
1875
|
+
setup(a) {
|
|
1876
|
+
const d = a, r = $(() => ({
|
|
1877
|
+
maxHeight: d.maxHeight ? `${d.maxHeight}px` : "200px"
|
|
1878
|
+
}));
|
|
1879
|
+
return (u, i) => (s(), l("div", Gn, [
|
|
1880
|
+
e("div", Yn, [
|
|
1881
|
+
i[1] || (i[1] = e("span", { class: "preview-label" }, "Preview", -1)),
|
|
1882
|
+
a.previewData.isComplete ? M("", !0) : (s(), l("span", Xn, [...i[0] || (i[0] = [
|
|
1883
|
+
e("svg", {
|
|
1884
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1885
|
+
width: "12",
|
|
1886
|
+
height: "12",
|
|
1887
|
+
viewBox: "0 0 24 24",
|
|
1888
|
+
fill: "none",
|
|
1889
|
+
stroke: "currentColor",
|
|
1890
|
+
"stroke-width": "2",
|
|
1891
|
+
"stroke-linecap": "round",
|
|
1892
|
+
"stroke-linejoin": "round"
|
|
1893
|
+
}, [
|
|
1894
|
+
e("circle", {
|
|
1895
|
+
cx: "12",
|
|
1896
|
+
cy: "12",
|
|
1897
|
+
r: "10"
|
|
1898
|
+
}),
|
|
1899
|
+
e("line", {
|
|
1900
|
+
x1: "12",
|
|
1901
|
+
y1: "8",
|
|
1902
|
+
x2: "12",
|
|
1903
|
+
y2: "12"
|
|
1904
|
+
}),
|
|
1905
|
+
e("line", {
|
|
1906
|
+
x1: "12",
|
|
1907
|
+
y1: "16",
|
|
1908
|
+
x2: "12.01",
|
|
1909
|
+
y2: "16"
|
|
1910
|
+
})
|
|
1911
|
+
], -1),
|
|
1912
|
+
Y(" Incomplete ", -1)
|
|
1913
|
+
])]))
|
|
1914
|
+
]),
|
|
1915
|
+
e("div", {
|
|
1916
|
+
class: "preview-body",
|
|
1917
|
+
style: He(r.value)
|
|
1918
|
+
}, [
|
|
1919
|
+
a.previewData.assembledPreview ? (s(), l(K, { key: 0 }, [
|
|
1920
|
+
Y(y(a.previewData.assembledPreview), 1)
|
|
1921
|
+
], 64)) : (s(), l("div", Jn, "(Empty output)"))
|
|
1922
|
+
], 4),
|
|
1923
|
+
a.previewData.modeHint ? (s(), l("div", Qn, [
|
|
1924
|
+
i[2] || (i[2] = e("svg", {
|
|
1925
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1926
|
+
width: "12",
|
|
1927
|
+
height: "12",
|
|
1928
|
+
viewBox: "0 0 24 24",
|
|
1929
|
+
fill: "none",
|
|
1930
|
+
stroke: "currentColor",
|
|
1931
|
+
"stroke-width": "2",
|
|
1932
|
+
"stroke-linecap": "round",
|
|
1933
|
+
"stroke-linejoin": "round"
|
|
1934
|
+
}, [
|
|
1935
|
+
e("circle", {
|
|
1936
|
+
cx: "12",
|
|
1937
|
+
cy: "12",
|
|
1938
|
+
r: "10"
|
|
1939
|
+
}),
|
|
1940
|
+
e("line", {
|
|
1941
|
+
x1: "12",
|
|
1942
|
+
y1: "16",
|
|
1943
|
+
x2: "12",
|
|
1944
|
+
y2: "12"
|
|
1945
|
+
}),
|
|
1946
|
+
e("line", {
|
|
1947
|
+
x1: "12",
|
|
1948
|
+
y1: "8",
|
|
1949
|
+
x2: "12.01",
|
|
1950
|
+
y2: "8"
|
|
1951
|
+
})
|
|
1952
|
+
], -1)),
|
|
1953
|
+
Y(" " + y(a.previewData.modeHint), 1)
|
|
1954
|
+
])) : M("", !0)
|
|
1955
|
+
]));
|
|
1956
|
+
}
|
|
1957
|
+
}), el = /* @__PURE__ */ G(Zn, [["__scopeId", "data-v-a248a951"]]);
|
|
1958
|
+
function Dt(a, d) {
|
|
1959
|
+
const r = () => typeof d == "string" ? d : d.value, u = H(0);
|
|
1960
|
+
let i = null;
|
|
1961
|
+
const x = (n) => {
|
|
1962
|
+
if (i && (i(), i = null), n) {
|
|
1963
|
+
const v = n.on;
|
|
1964
|
+
if (typeof v == "function") {
|
|
1965
|
+
const D = v.call(n, "update", () => {
|
|
1966
|
+
u.value++;
|
|
1967
|
+
});
|
|
1968
|
+
i = typeof D == "function" ? D : null;
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
};
|
|
1972
|
+
return de(
|
|
1973
|
+
() => a.value,
|
|
1974
|
+
(n) => {
|
|
1975
|
+
x(n), u.value++;
|
|
1976
|
+
},
|
|
1977
|
+
{ immediate: !0 }
|
|
1978
|
+
), dt(() => {
|
|
1979
|
+
i && (i(), i = null);
|
|
1980
|
+
}), $(() => {
|
|
1981
|
+
var U, g, S;
|
|
1982
|
+
if (u.value, !a.value) return [];
|
|
1983
|
+
const n = r();
|
|
1984
|
+
if (!n) return [];
|
|
1985
|
+
const v = a.value.nodes, D = a.value.edges;
|
|
1986
|
+
if (!v.find((b) => b.id === n)) return [];
|
|
1987
|
+
const f = [...D.filter((b) => b.target === n)].sort((b, h) => {
|
|
1988
|
+
const c = v.find((N) => N.id === b.source), T = v.find((N) => N.id === h.source);
|
|
1989
|
+
return ((c == null ? void 0 : c.position.y) || 0) - ((T == null ? void 0 : T.position.y) || 0);
|
|
1990
|
+
}), k = [];
|
|
1991
|
+
for (let b = 0; b < f.length; b++) {
|
|
1992
|
+
const h = f[b], c = v.find((N) => N.id === h.source);
|
|
1993
|
+
if (!c) continue;
|
|
1994
|
+
if (c.type === "parallel" && c.data.mergeEnabled === !1 && h.sourceHandle) {
|
|
1995
|
+
const V = (U = c.data.branches) == null ? void 0 : U.find(
|
|
1996
|
+
(z) => z.id === h.sourceHandle
|
|
1997
|
+
);
|
|
1998
|
+
k.push({
|
|
1999
|
+
// Use composite ID to distinguish branches from same parallel node
|
|
2000
|
+
id: `${c.id}:${h.sourceHandle}`,
|
|
2001
|
+
label: c.data.label || c.id,
|
|
2002
|
+
type: "parallel-branch",
|
|
2003
|
+
parallelParentId: c.id,
|
|
2004
|
+
branchLabel: (V == null ? void 0 : V.label) || h.sourceHandle,
|
|
2005
|
+
executionIndex: b
|
|
2006
|
+
});
|
|
2007
|
+
} else {
|
|
2008
|
+
const N = tl(
|
|
2009
|
+
c,
|
|
2010
|
+
v,
|
|
2011
|
+
D
|
|
2012
|
+
);
|
|
2013
|
+
k.push({
|
|
2014
|
+
id: c.id,
|
|
2015
|
+
label: c.data.label || c.id,
|
|
2016
|
+
type: c.type,
|
|
2017
|
+
parallelParentId: N == null ? void 0 : N.parentId,
|
|
2018
|
+
branchLabel: N == null ? void 0 : N.branchLabel,
|
|
2019
|
+
executionIndex: b
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
const L = [], m = /* @__PURE__ */ new Set();
|
|
2024
|
+
for (const b of k)
|
|
2025
|
+
if (!m.has(b.id))
|
|
2026
|
+
if (b.parallelParentId) {
|
|
2027
|
+
const h = k.filter(
|
|
2028
|
+
(z) => z.parallelParentId === b.parallelParentId
|
|
2029
|
+
), c = v.find(
|
|
2030
|
+
(z) => z.id === b.parallelParentId
|
|
2031
|
+
), T = (c == null ? void 0 : c.data.label) || "Parallel Group", N = ((S = (g = c == null ? void 0 : c.data) == null ? void 0 : g.branches) == null ? void 0 : S.map(
|
|
2032
|
+
(z) => z.id
|
|
2033
|
+
)) || [], V = [...h].sort((z, q) => {
|
|
2034
|
+
const W = z.id.includes(":") ? z.id.split(":")[1] : z.id, ce = q.id.includes(":") ? q.id.split(":")[1] : q.id, X = N.indexOf(W), he = N.indexOf(ce);
|
|
2035
|
+
return (X === -1 ? 1 / 0 : X) - (he === -1 ? 1 / 0 : he);
|
|
2036
|
+
});
|
|
2037
|
+
L.push({
|
|
2038
|
+
type: "parallel",
|
|
2039
|
+
label: T,
|
|
2040
|
+
sources: V
|
|
2041
|
+
}), h.forEach((z) => m.add(z.id));
|
|
2042
|
+
} else
|
|
2043
|
+
L.push({
|
|
2044
|
+
type: "single",
|
|
2045
|
+
sources: [b]
|
|
2046
|
+
}), m.add(b.id);
|
|
2047
|
+
return L;
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
function tl(a, d, r) {
|
|
2051
|
+
var x;
|
|
2052
|
+
const u = [a.id], i = /* @__PURE__ */ new Set();
|
|
2053
|
+
for (; u.length > 0; ) {
|
|
2054
|
+
const n = u.shift();
|
|
2055
|
+
if (i.has(n)) continue;
|
|
2056
|
+
i.add(n);
|
|
2057
|
+
const v = d.find((_) => _.id === n);
|
|
2058
|
+
if (!v) continue;
|
|
2059
|
+
if (v.type === "parallel") {
|
|
2060
|
+
const _ = r.filter(
|
|
2061
|
+
(f) => f.source === v.id
|
|
2062
|
+
), I = v.data;
|
|
2063
|
+
for (const f of _)
|
|
2064
|
+
if (ol(f.target, a.id, r)) {
|
|
2065
|
+
const k = f.sourceHandle, L = (x = I.branches) == null ? void 0 : x.find(
|
|
2066
|
+
(m) => m.id === k
|
|
2067
|
+
);
|
|
2068
|
+
return {
|
|
2069
|
+
parentId: v.id,
|
|
2070
|
+
branchLabel: (L == null ? void 0 : L.label) || k || "Unknown Branch"
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
const D = r.filter((_) => _.target === n);
|
|
2075
|
+
for (const _ of D)
|
|
2076
|
+
u.push(_.source);
|
|
2077
|
+
}
|
|
2078
|
+
return null;
|
|
2079
|
+
}
|
|
2080
|
+
function ol(a, d, r) {
|
|
2081
|
+
if (a === d) return !0;
|
|
2082
|
+
const u = [a], i = /* @__PURE__ */ new Set();
|
|
2083
|
+
for (; u.length > 0; ) {
|
|
2084
|
+
const x = u.shift();
|
|
2085
|
+
if (i.has(x)) continue;
|
|
2086
|
+
if (i.add(x), x === d) return !0;
|
|
2087
|
+
const n = r.filter((v) => v.source === x);
|
|
2088
|
+
for (const v of n)
|
|
2089
|
+
u.push(v.target);
|
|
2090
|
+
}
|
|
2091
|
+
return !1;
|
|
2092
|
+
}
|
|
2093
|
+
function sl(a, d, r) {
|
|
2094
|
+
const { getOutput: u } = pt(), i = Dt(a, r), x = $(() => {
|
|
2095
|
+
const D = O(d), I = O(i).flatMap((g) => g.sources);
|
|
2096
|
+
let f = I;
|
|
2097
|
+
D.sources && D.sources.length > 0 && (f = D.sources.map((g) => I.find((S) => S.id === g)).filter((g) => !!g));
|
|
2098
|
+
const k = /* @__PURE__ */ new Map();
|
|
2099
|
+
let L = !0;
|
|
2100
|
+
for (const g of f) {
|
|
2101
|
+
const S = u(g.id);
|
|
2102
|
+
k.set(g.id, S || null), S || (L = !1);
|
|
2103
|
+
}
|
|
2104
|
+
let m = "", U = "";
|
|
2105
|
+
if (D.mode === "synthesis") {
|
|
2106
|
+
U = "AI will synthesize these inputs into a final document";
|
|
2107
|
+
const g = f.map((S) => {
|
|
2108
|
+
const b = k.get(S.id), h = S.branchLabel || S.label, c = b ? b.length > 100 ? b.slice(0, 100) + "..." : b : "(Waiting for output...)";
|
|
2109
|
+
return `• ${h}: ${c}`;
|
|
2110
|
+
});
|
|
2111
|
+
g.length > 0 ? m = `Inputs to AI:
|
|
2112
|
+
|
|
2113
|
+
` + g.join(`
|
|
2114
|
+
`) : m = "(No inputs selected)";
|
|
2115
|
+
} else {
|
|
2116
|
+
const g = [];
|
|
2117
|
+
if (D.introText && g.push(D.introText), f.length > 0)
|
|
2118
|
+
for (const S of f) {
|
|
2119
|
+
const b = k.get(S.id);
|
|
2120
|
+
b ? g.push(b) : g.push(
|
|
2121
|
+
`[Output from ${S.branchLabel || S.label} will appear here]`
|
|
2122
|
+
);
|
|
2123
|
+
}
|
|
2124
|
+
else
|
|
2125
|
+
g.push("[No sources selected]");
|
|
2126
|
+
D.outroText && g.push(D.outroText), m = g.join(`
|
|
2127
|
+
|
|
2128
|
+
`);
|
|
2129
|
+
}
|
|
2130
|
+
return {
|
|
2131
|
+
assembledPreview: m,
|
|
2132
|
+
isComplete: L,
|
|
2133
|
+
modeHint: U
|
|
2134
|
+
};
|
|
2135
|
+
}), n = H(x.value);
|
|
2136
|
+
let v = null;
|
|
2137
|
+
return de(
|
|
2138
|
+
x,
|
|
2139
|
+
(D) => {
|
|
2140
|
+
v && clearTimeout(v), v = setTimeout(() => {
|
|
2141
|
+
n.value = D;
|
|
2142
|
+
}, 50);
|
|
2143
|
+
},
|
|
2144
|
+
{ immediate: !0 }
|
|
2145
|
+
), dt(() => {
|
|
2146
|
+
v && clearTimeout(v);
|
|
2147
|
+
}), $(() => n.value);
|
|
2148
|
+
}
|
|
2149
|
+
const nl = {
|
|
2150
|
+
key: 0,
|
|
2151
|
+
class: "node-inspector"
|
|
2152
|
+
}, ll = { class: "inspector-header" }, al = {
|
|
2153
|
+
key: 0,
|
|
2154
|
+
viewBox: "0 0 24 24",
|
|
2155
|
+
fill: "none",
|
|
2156
|
+
stroke: "currentColor",
|
|
2157
|
+
"stroke-width": "2"
|
|
2158
|
+
}, il = {
|
|
2159
|
+
key: 1,
|
|
2160
|
+
viewBox: "0 0 24 24",
|
|
2161
|
+
fill: "none",
|
|
2162
|
+
stroke: "currentColor",
|
|
2163
|
+
"stroke-width": "2"
|
|
2164
|
+
}, rl = {
|
|
2165
|
+
key: 2,
|
|
2166
|
+
viewBox: "0 0 24 24",
|
|
2167
|
+
fill: "none",
|
|
2168
|
+
stroke: "currentColor",
|
|
2169
|
+
"stroke-width": "2"
|
|
2170
|
+
}, dl = {
|
|
2171
|
+
key: 3,
|
|
2172
|
+
viewBox: "0 0 24 24",
|
|
2173
|
+
fill: "none",
|
|
2174
|
+
stroke: "currentColor",
|
|
2175
|
+
"stroke-width": "2"
|
|
2176
|
+
}, ul = ["value"], cl = {
|
|
2177
|
+
key: 0,
|
|
2178
|
+
class: "description-section"
|
|
2179
|
+
}, vl = ["value"], pl = {
|
|
2180
|
+
key: 1,
|
|
2181
|
+
class: "tabs"
|
|
2182
|
+
}, fl = { class: "tool-count" }, ml = { class: "tool-count" }, gl = {
|
|
2183
|
+
key: 0,
|
|
2184
|
+
class: "tool-count"
|
|
2185
|
+
}, hl = {
|
|
2186
|
+
key: 0,
|
|
2187
|
+
class: "hitl-badge"
|
|
2188
|
+
}, yl = {
|
|
2189
|
+
key: 2,
|
|
2190
|
+
class: "tab-content"
|
|
2191
|
+
}, wl = {
|
|
2192
|
+
key: 0,
|
|
2193
|
+
class: "prompt-tab"
|
|
2194
|
+
}, bl = { class: "field-group" }, _l = { class: "mode-buttons" }, kl = { class: "field-hint" }, xl = {
|
|
2195
|
+
key: 0,
|
|
2196
|
+
class: "field-group"
|
|
2197
|
+
}, $l = ["value"], Il = { class: "grid loop-grid" }, Ml = { class: "field-group" }, Dl = { class: "field-label" }, Sl = ["value"], Nl = { class: "field-group" }, Tl = ["value"], Cl = {
|
|
2198
|
+
class: "field-group",
|
|
2199
|
+
style: { "margin-top": "var(--or3-spacing-md)" }
|
|
2200
|
+
}, El = ["value"], Bl = {
|
|
2201
|
+
class: "field-group",
|
|
2202
|
+
style: { "margin-top": "var(--or3-spacing-lg)" }
|
|
2203
|
+
}, Ol = { class: "mode-buttons" }, Ll = { class: "toggle-group" }, Rl = ["checked"], Pl = ["checked"], Al = { class: "advanced-section" }, Vl = { class: "advanced-content" }, Hl = { class: "field-group" }, jl = ["value"], zl = { class: "field-label" }, Ul = ["value", "placeholder"], Wl = { class: "field-hint" }, Fl = {
|
|
2204
|
+
key: 1,
|
|
2205
|
+
class: "model-tab"
|
|
2206
|
+
}, Kl = { class: "field-label" }, ql = ["value"], Gl = ["value"], Yl = { class: "model-id" }, Xl = {
|
|
2207
|
+
key: 2,
|
|
2208
|
+
class: "routes-tab"
|
|
2209
|
+
}, Jl = { class: "routes-list" }, Ql = { class: "route-inputs" }, Zl = ["value", "onInput"], ea = { class: "route-id" }, ta = ["onClick"], oa = {
|
|
2210
|
+
key: 3,
|
|
2211
|
+
class: "branches-tab"
|
|
2212
|
+
}, sa = { class: "branches-list" }, na = ["onClick"], la = { class: "branch-inputs" }, aa = ["value", "onInput"], ia = { class: "branch-badges" }, ra = {
|
|
2213
|
+
key: 0,
|
|
2214
|
+
class: "branch-badge model"
|
|
2215
|
+
}, da = { class: "branch-actions" }, ua = ["onClick"], ca = {
|
|
2216
|
+
key: 0,
|
|
2217
|
+
class: "branch-config"
|
|
2218
|
+
}, va = { class: "branch-field" }, pa = ["value", "onChange"], fa = ["value"], ma = { class: "branch-field" }, ga = ["value", "onInput"], ha = {
|
|
2219
|
+
key: 0,
|
|
2220
|
+
class: "branch-field"
|
|
2221
|
+
}, ya = { class: "branch-tools" }, wa = ["checked", "onChange"], ba = { class: "tool-name-sm" }, _a = { class: "merge-section" }, ka = { class: "merge-header" }, xa = { class: "toggle-label" }, $a = ["checked"], Ia = { class: "merge-field" }, Ma = ["value"], Da = ["value"], Sa = { class: "merge-field" }, Na = ["value"], Ta = {
|
|
2222
|
+
key: 4,
|
|
2223
|
+
class: "tools-tab"
|
|
2224
|
+
}, Ca = { class: "tools-list" }, Ea = ["checked", "onChange"], Ba = { class: "tool-info" }, Oa = { class: "tool-name" }, La = { class: "tool-description" }, Ra = {
|
|
2225
|
+
key: 0,
|
|
2226
|
+
class: "selected-tools"
|
|
2227
|
+
}, Pa = { class: "field-label" }, Aa = { class: "tool-chips" }, Va = ["onClick"], Ha = {
|
|
2228
|
+
key: 1,
|
|
2229
|
+
class: "tools-empty"
|
|
2230
|
+
}, ja = {
|
|
2231
|
+
key: 5,
|
|
2232
|
+
class: "errors-tab"
|
|
2233
|
+
}, za = { class: "mode-buttons" }, Ua = { class: "retry-grid" }, Wa = { class: "field-group" }, Fa = ["value"], Ka = { class: "field-group" }, qa = ["value"], Ga = { class: "field-group" }, Ya = ["value"], Xa = { class: "checkbox-group" }, Ja = { class: "checkboxes" }, Qa = ["checked", "onChange"], Za = {
|
|
2234
|
+
key: 6,
|
|
2235
|
+
class: "hitl-tab"
|
|
2236
|
+
}, ei = { class: "hitl-toggle" }, ti = { class: "toggle-label" }, oi = ["checked"], si = { class: "hitl-section" }, ni = { class: "mode-buttons" }, li = ["onClick", "title"], ai = { class: "field-hint" }, ii = { class: "hitl-section" }, ri = ["value"], di = { class: "hitl-grid" }, ui = { class: "field-group" }, ci = ["value"], vi = { class: "field-group" }, pi = ["value"], fi = ["value"], mi = {
|
|
2237
|
+
key: 7,
|
|
2238
|
+
class: "subflow-tab"
|
|
2239
|
+
}, gi = { class: "field-group" }, hi = ["value", "disabled"], yi = { value: "" }, wi = ["value"], bi = {
|
|
2240
|
+
key: 0,
|
|
2241
|
+
class: "field-hint"
|
|
2242
|
+
}, _i = {
|
|
2243
|
+
key: 1,
|
|
2244
|
+
class: "field-hint"
|
|
2245
|
+
}, ki = {
|
|
2246
|
+
key: 2,
|
|
2247
|
+
class: "field-hint"
|
|
2248
|
+
}, xi = {
|
|
2249
|
+
key: 3,
|
|
2250
|
+
class: "field-hint"
|
|
2251
|
+
}, $i = {
|
|
2252
|
+
key: 4,
|
|
2253
|
+
class: "model-id"
|
|
2254
|
+
}, Ii = {
|
|
2255
|
+
key: 0,
|
|
2256
|
+
class: "field-group"
|
|
2257
|
+
}, Mi = ["value"], Di = { class: "subflow-toggle" }, Si = { class: "toggle-label" }, Ni = ["checked"], Ti = {
|
|
2258
|
+
key: 1,
|
|
2259
|
+
class: "input-mappings-section"
|
|
2260
|
+
}, Ci = { class: "mappings-list" }, Ei = { class: "mapping-key" }, Bi = ["value", "onInput"], Oi = ["onClick"], Li = {
|
|
2261
|
+
key: 8,
|
|
2262
|
+
class: "output-tab"
|
|
2263
|
+
}, Ri = {
|
|
2264
|
+
key: 0,
|
|
2265
|
+
class: "synthesis-config"
|
|
2266
|
+
}, Pi = { class: "field-group" }, Ai = ["value"], Vi = ["value"], Hi = { class: "field-group" }, ji = ["value"], zi = { class: "field-group" }, Ui = ["value"], Wi = { class: "field-group" }, Fi = ["value"], Ki = { class: "advanced-settings" }, qi = {
|
|
2267
|
+
key: 0,
|
|
2268
|
+
class: "advanced-content"
|
|
2269
|
+
}, Gi = { class: "toggle-group" }, Yi = { class: "tool-item" }, Xi = ["checked"], Ji = { class: "tool-item" }, Qi = ["checked"], Zi = {
|
|
2270
|
+
key: 0,
|
|
2271
|
+
class: "field-group"
|
|
2272
|
+
}, er = ["value"], tr = {
|
|
2273
|
+
key: 3,
|
|
2274
|
+
class: "inspector-content"
|
|
2275
|
+
}, or = {
|
|
2276
|
+
key: 1,
|
|
2277
|
+
class: "node-inspector empty"
|
|
2278
|
+
}, sr = /* @__PURE__ */ te({
|
|
2279
|
+
__name: "NodeInspector",
|
|
2280
|
+
props: {
|
|
2281
|
+
editor: {},
|
|
2282
|
+
availableTools: {},
|
|
2283
|
+
availableSubflows: {},
|
|
2284
|
+
subflowListLoading: { type: Boolean },
|
|
2285
|
+
subflowListError: {}
|
|
2286
|
+
},
|
|
2287
|
+
emits: ["delete", "close"],
|
|
2288
|
+
setup(a, { emit: d }) {
|
|
2289
|
+
function r(o) {
|
|
2290
|
+
return typeof o == "object" && o !== null && "label" in o && typeof o.label == "string";
|
|
2291
|
+
}
|
|
2292
|
+
function u(o) {
|
|
2293
|
+
return r(o) ? Array.isArray(o.tools) ? o.tools : [] : [];
|
|
2294
|
+
}
|
|
2295
|
+
const i = a, x = d, n = H(null), v = H("prompt"), D = $(() => i.availableTools ?? f), _ = $(() => i.availableSubflows ?? []);
|
|
2296
|
+
lt.size === 0 && lo();
|
|
2297
|
+
const I = $(() => lt.getAllInfo().map((o) => ({
|
|
2298
|
+
id: o.id,
|
|
2299
|
+
name: o.name,
|
|
2300
|
+
provider: o.provider
|
|
2301
|
+
}))), f = [
|
|
2302
|
+
{
|
|
2303
|
+
id: "web_search",
|
|
2304
|
+
name: "Web Search",
|
|
2305
|
+
description: "Search the web for information"
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
id: "calculator",
|
|
2309
|
+
name: "Calculator",
|
|
2310
|
+
description: "Perform mathematical calculations"
|
|
2311
|
+
},
|
|
2312
|
+
{
|
|
2313
|
+
id: "code_interpreter",
|
|
2314
|
+
name: "Code Interpreter",
|
|
2315
|
+
description: "Execute Python code"
|
|
2316
|
+
},
|
|
2317
|
+
{
|
|
2318
|
+
id: "file_reader",
|
|
2319
|
+
name: "File Reader",
|
|
2320
|
+
description: "Read file contents"
|
|
2321
|
+
},
|
|
2322
|
+
{ id: "api_call", name: "API Call", description: "Make HTTP API requests" },
|
|
2323
|
+
{
|
|
2324
|
+
id: "database_query",
|
|
2325
|
+
name: "Database Query",
|
|
2326
|
+
description: "Query a database"
|
|
2327
|
+
}
|
|
2328
|
+
], k = H([]), L = () => {
|
|
2329
|
+
var t;
|
|
2330
|
+
const o = i.editor.getSelected().nodes;
|
|
2331
|
+
if (o.length === 1) {
|
|
2332
|
+
const R = i.editor.getNodes().find((pe) => pe.id === o[0]) || null, j = (t = n.value) == null ? void 0 : t.id;
|
|
2333
|
+
n.value = R, R && (k.value = u(R.data), j !== R.id && (v.value = R.type === "output" ? "output" : R.type === "parallel" ? "branches" : "prompt"));
|
|
2334
|
+
} else
|
|
2335
|
+
n.value = null, k.value = [];
|
|
2336
|
+
};
|
|
2337
|
+
de(
|
|
2338
|
+
() => {
|
|
2339
|
+
var o;
|
|
2340
|
+
return (o = n.value) == null ? void 0 : o.data;
|
|
2341
|
+
},
|
|
2342
|
+
(o) => {
|
|
2343
|
+
o && (k.value = u(o));
|
|
2344
|
+
},
|
|
2345
|
+
{ deep: !0 }
|
|
2346
|
+
), oo((o) => {
|
|
2347
|
+
if (i.editor.isDestroyed()) {
|
|
2348
|
+
n.value = null, k.value = [];
|
|
2349
|
+
return;
|
|
2350
|
+
}
|
|
2351
|
+
L();
|
|
2352
|
+
const t = i.editor.on("selectionUpdate", L), R = i.editor.on("update", L);
|
|
2353
|
+
o(() => {
|
|
2354
|
+
t(), R();
|
|
2355
|
+
});
|
|
2356
|
+
});
|
|
2357
|
+
const m = $(() => {
|
|
2358
|
+
var o;
|
|
2359
|
+
return ((o = n.value) == null ? void 0 : o.type) === "agent";
|
|
2360
|
+
}), U = $(() => {
|
|
2361
|
+
var o;
|
|
2362
|
+
return ((o = n.value) == null ? void 0 : o.type) === "router";
|
|
2363
|
+
}), g = $(() => {
|
|
2364
|
+
var o;
|
|
2365
|
+
return ((o = n.value) == null ? void 0 : o.type) === "parallel";
|
|
2366
|
+
}), S = $(() => {
|
|
2367
|
+
var o;
|
|
2368
|
+
return ((o = n.value) == null ? void 0 : o.type) === "whileLoop";
|
|
2369
|
+
}), b = $(() => {
|
|
2370
|
+
var o;
|
|
2371
|
+
return ((o = n.value) == null ? void 0 : o.type) === "start";
|
|
2372
|
+
}), h = $(() => {
|
|
2373
|
+
var o;
|
|
2374
|
+
return ((o = n.value) == null ? void 0 : o.type) === "subflow";
|
|
2375
|
+
}), c = $(() => {
|
|
2376
|
+
var o;
|
|
2377
|
+
return ((o = n.value) == null ? void 0 : o.type) === "output";
|
|
2378
|
+
}), T = $(
|
|
2379
|
+
() => n.value && n.value.type !== "start"
|
|
2380
|
+
), N = $(
|
|
2381
|
+
() => m.value || U.value || g.value || S.value || h.value || c.value
|
|
2382
|
+
), V = $(
|
|
2383
|
+
() => m.value || U.value
|
|
2384
|
+
), z = $(() => m.value || U.value), q = $(() => {
|
|
2385
|
+
var t;
|
|
2386
|
+
const o = (t = n.value) == null ? void 0 : t.data;
|
|
2387
|
+
return r(o) ? o : { label: "Unknown" };
|
|
2388
|
+
}), W = $(() => {
|
|
2389
|
+
var t;
|
|
2390
|
+
return ((t = n.value) == null ? void 0 : t.data) || {};
|
|
2391
|
+
}), ce = H(!1), X = $(() => {
|
|
2392
|
+
var t;
|
|
2393
|
+
const o = (t = n.value) == null ? void 0 : t.data;
|
|
2394
|
+
return o ? ao(o) : {};
|
|
2395
|
+
}), he = $(() => {
|
|
2396
|
+
var o;
|
|
2397
|
+
return ((o = n.value) == null ? void 0 : o.id) || "";
|
|
2398
|
+
}), je = Dt(
|
|
2399
|
+
$(() => i.editor),
|
|
2400
|
+
he
|
|
2401
|
+
), ze = sl(
|
|
2402
|
+
$(() => i.editor),
|
|
2403
|
+
X,
|
|
2404
|
+
he
|
|
2405
|
+
), Ue = (o) => {
|
|
2406
|
+
n.value && i.editor.commands.updateNodeData(n.value.id, { mode: o });
|
|
2407
|
+
}, We = (o) => {
|
|
2408
|
+
n.value && i.editor.commands.updateNodeData(n.value.id, { sources: o });
|
|
2409
|
+
}, Fe = (o) => {
|
|
2410
|
+
if (!n.value) return;
|
|
2411
|
+
const t = o.target.value;
|
|
2412
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2413
|
+
introText: t
|
|
2414
|
+
});
|
|
2415
|
+
}, Ke = (o) => {
|
|
2416
|
+
if (!n.value) return;
|
|
2417
|
+
const t = o.target.value;
|
|
2418
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2419
|
+
outroText: t
|
|
2420
|
+
});
|
|
2421
|
+
}, qe = (o) => {
|
|
2422
|
+
if (!n.value) return;
|
|
2423
|
+
const t = o.target.value;
|
|
2424
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2425
|
+
synthesis: { ...X.value.synthesis, prompt: t }
|
|
2426
|
+
});
|
|
2427
|
+
}, De = (o) => {
|
|
2428
|
+
if (!n.value) return;
|
|
2429
|
+
const t = o.target.value;
|
|
2430
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2431
|
+
synthesis: { ...X.value.synthesis, model: t }
|
|
2432
|
+
});
|
|
2433
|
+
}, Se = () => {
|
|
2434
|
+
n.value && i.editor.commands.updateNodeData(n.value.id, {
|
|
2435
|
+
useRawTemplate: !X.value.useRawTemplate
|
|
2436
|
+
});
|
|
2437
|
+
}, Ge = () => {
|
|
2438
|
+
n.value && i.editor.commands.updateNodeData(n.value.id, {
|
|
2439
|
+
includeMetadata: !X.value.includeMetadata
|
|
2440
|
+
});
|
|
2441
|
+
}, w = (o) => {
|
|
2442
|
+
if (!n.value) return;
|
|
2443
|
+
const t = o.target.value;
|
|
2444
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2445
|
+
template: t
|
|
2446
|
+
});
|
|
2447
|
+
};
|
|
2448
|
+
de(
|
|
2449
|
+
() => {
|
|
2450
|
+
var o;
|
|
2451
|
+
return {
|
|
2452
|
+
fmt: X.value.format,
|
|
2453
|
+
nodeId: (o = n.value) == null ? void 0 : o.id
|
|
2454
|
+
};
|
|
2455
|
+
},
|
|
2456
|
+
({ fmt: o, nodeId: t }) => {
|
|
2457
|
+
t && o && o !== "markdown" && i.editor.commands.updateNodeData(t, {
|
|
2458
|
+
format: "markdown",
|
|
2459
|
+
schema: void 0
|
|
2460
|
+
});
|
|
2461
|
+
},
|
|
2462
|
+
{ immediate: !0 }
|
|
2463
|
+
);
|
|
2464
|
+
const B = $(() => {
|
|
2465
|
+
var t;
|
|
2466
|
+
const o = (t = n.value) == null ? void 0 : t.data;
|
|
2467
|
+
return {
|
|
2468
|
+
subflowId: (o == null ? void 0 : o.subflowId) ?? "",
|
|
2469
|
+
inputMappings: (o == null ? void 0 : o.inputMappings) ?? {},
|
|
2470
|
+
shareSession: (o == null ? void 0 : o.shareSession) ?? !0
|
|
2471
|
+
};
|
|
2472
|
+
}), C = $(() => {
|
|
2473
|
+
const o = [..._.value], t = B.value.subflowId;
|
|
2474
|
+
return t && !o.some((R) => R.id === t) && o.unshift({
|
|
2475
|
+
id: t,
|
|
2476
|
+
name: "Custom ID",
|
|
2477
|
+
description: "Not in your workflow list."
|
|
2478
|
+
}), o;
|
|
2479
|
+
}), oe = $(() => {
|
|
2480
|
+
const o = B.value.subflowId;
|
|
2481
|
+
return o && C.value.find((t) => t.id === o) || null;
|
|
2482
|
+
}), J = H(!1);
|
|
2483
|
+
de(
|
|
2484
|
+
() => [B.value.subflowId, _.value.length],
|
|
2485
|
+
([o]) => {
|
|
2486
|
+
o && (_.value.some((t) => t.id === o) || (J.value = !0));
|
|
2487
|
+
},
|
|
2488
|
+
{ immediate: !0 }
|
|
2489
|
+
);
|
|
2490
|
+
const ae = $(() => {
|
|
2491
|
+
var t;
|
|
2492
|
+
const o = (t = n.value) == null ? void 0 : t.data;
|
|
2493
|
+
return {
|
|
2494
|
+
routes: Array.isArray(o == null ? void 0 : o.routes) ? o.routes : []
|
|
2495
|
+
};
|
|
2496
|
+
}), ee = $(() => {
|
|
2497
|
+
var t;
|
|
2498
|
+
const o = (t = n.value) == null ? void 0 : t.data;
|
|
2499
|
+
return {
|
|
2500
|
+
branches: Array.isArray(o == null ? void 0 : o.branches) ? o.branches : [],
|
|
2501
|
+
mergeModel: (o == null ? void 0 : o.model) || "",
|
|
2502
|
+
mergePrompt: (o == null ? void 0 : o.prompt) || "",
|
|
2503
|
+
mergeEnabled: o == null ? void 0 : o.mergeEnabled
|
|
2504
|
+
};
|
|
2505
|
+
}), we = () => {
|
|
2506
|
+
if (!n.value) return;
|
|
2507
|
+
const o = [...ee.value.branches], t = `branch-${Date.now()}`;
|
|
2508
|
+
o.push({ id: t, label: `Branch ${o.length + 1}` }), i.editor.commands.updateNodeData(n.value.id, { branches: o });
|
|
2509
|
+
}, fe = (o) => {
|
|
2510
|
+
if (!n.value) return;
|
|
2511
|
+
const t = n.value.id, j = i.editor.getEdges().filter(
|
|
2512
|
+
(Z) => Z.source === t && Z.sourceHandle === o
|
|
2513
|
+
);
|
|
2514
|
+
for (const Z of j)
|
|
2515
|
+
i.editor.commands.deleteEdge(Z.id);
|
|
2516
|
+
const pe = ee.value.branches.filter(
|
|
2517
|
+
(Z) => Z.id !== o
|
|
2518
|
+
);
|
|
2519
|
+
i.editor.commands.updateNodeData(t, { branches: pe });
|
|
2520
|
+
}, ve = (o, t) => {
|
|
2521
|
+
if (!n.value) return;
|
|
2522
|
+
const R = ee.value.branches.map(
|
|
2523
|
+
(j) => j.id === o ? { ...j, label: t } : j
|
|
2524
|
+
);
|
|
2525
|
+
i.editor.commands.updateNodeData(n.value.id, { branches: R });
|
|
2526
|
+
}, Ne = (o, t) => {
|
|
2527
|
+
if (!n.value) return;
|
|
2528
|
+
const R = ee.value.branches.map(
|
|
2529
|
+
(j) => j.id === o ? { ...j, model: t || void 0 } : j
|
|
2530
|
+
);
|
|
2531
|
+
i.editor.commands.updateNodeData(n.value.id, { branches: R });
|
|
2532
|
+
}, Te = (o, t) => {
|
|
2533
|
+
if (!n.value) return;
|
|
2534
|
+
const R = ee.value.branches.map(
|
|
2535
|
+
(j) => j.id === o ? { ...j, prompt: t || void 0 } : j
|
|
2536
|
+
);
|
|
2537
|
+
i.editor.commands.updateNodeData(n.value.id, { branches: R });
|
|
2538
|
+
}, Ce = (o, t) => {
|
|
2539
|
+
if (!n.value) return;
|
|
2540
|
+
const R = ee.value.branches.map(
|
|
2541
|
+
(j) => j.id === o ? { ...j, tools: t } : j
|
|
2542
|
+
);
|
|
2543
|
+
i.editor.commands.updateNodeData(n.value.id, { branches: R });
|
|
2544
|
+
}, Ee = (o, t) => {
|
|
2545
|
+
const R = ee.value.branches.find(
|
|
2546
|
+
(p) => p.id === o
|
|
2547
|
+
);
|
|
2548
|
+
if (!R) return;
|
|
2549
|
+
const j = R.tools || [], pe = j.indexOf(t);
|
|
2550
|
+
let Z;
|
|
2551
|
+
pe === -1 ? Z = [...j, t] : (Z = [...j], Z.splice(pe, 1)), Ce(o, Z);
|
|
2552
|
+
}, ye = H(null), Be = (o) => {
|
|
2553
|
+
ye.value = ye.value === o ? null : o;
|
|
2554
|
+
}, Oe = () => {
|
|
2555
|
+
if (!n.value) return;
|
|
2556
|
+
const o = [...ae.value.routes], t = `route-${Date.now()}`;
|
|
2557
|
+
o.push({ id: t, label: `Route ${o.length + 1}` }), i.editor.commands.updateNodeData(n.value.id, { routes: o });
|
|
2558
|
+
}, E = (o) => {
|
|
2559
|
+
if (!n.value) return;
|
|
2560
|
+
const t = n.value.id, j = i.editor.getEdges().filter(
|
|
2561
|
+
(Z) => Z.source === t && Z.sourceHandle === o
|
|
2562
|
+
);
|
|
2563
|
+
for (const Z of j)
|
|
2564
|
+
i.editor.commands.deleteEdge(Z.id);
|
|
2565
|
+
const pe = ae.value.routes.filter((Z) => Z.id !== o);
|
|
2566
|
+
i.editor.commands.updateNodeData(t, { routes: pe });
|
|
2567
|
+
}, ie = (o, t) => {
|
|
2568
|
+
if (!n.value) return;
|
|
2569
|
+
const R = ae.value.routes.map(
|
|
2570
|
+
(j) => j.id === o ? { ...j, label: t } : j
|
|
2571
|
+
);
|
|
2572
|
+
i.editor.commands.updateNodeData(n.value.id, { routes: R });
|
|
2573
|
+
}, re = $(() => {
|
|
2574
|
+
var t;
|
|
2575
|
+
const o = (t = n.value) == null ? void 0 : t.data;
|
|
2576
|
+
return (o == null ? void 0 : o.errorHandling) ?? { mode: "stop" };
|
|
2577
|
+
}), _e = $(() => {
|
|
2578
|
+
const o = re.value.retry;
|
|
2579
|
+
return {
|
|
2580
|
+
maxRetries: (o == null ? void 0 : o.maxRetries) ?? 0,
|
|
2581
|
+
baseDelay: (o == null ? void 0 : o.baseDelay) ?? 1e3,
|
|
2582
|
+
maxDelay: o == null ? void 0 : o.maxDelay,
|
|
2583
|
+
retryOn: (o == null ? void 0 : o.retryOn) ?? [],
|
|
2584
|
+
skipOn: o == null ? void 0 : o.skipOn
|
|
2585
|
+
};
|
|
2586
|
+
}), me = $(() => {
|
|
2587
|
+
var t;
|
|
2588
|
+
const o = (t = n.value) == null ? void 0 : t.data;
|
|
2589
|
+
return (o == null ? void 0 : o.hitl) ?? { enabled: !1, mode: "approval" };
|
|
2590
|
+
}), Je = [
|
|
2591
|
+
{
|
|
2592
|
+
id: "approval",
|
|
2593
|
+
label: "Approval",
|
|
2594
|
+
description: "Pause before execution for approve/reject"
|
|
2595
|
+
},
|
|
2596
|
+
{
|
|
2597
|
+
id: "input",
|
|
2598
|
+
label: "Input",
|
|
2599
|
+
description: "Collect human input before execution"
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
id: "review",
|
|
2603
|
+
label: "Review",
|
|
2604
|
+
description: "Pause after execution to review output"
|
|
2605
|
+
}
|
|
2606
|
+
], St = [
|
|
2607
|
+
{ id: "approve", label: "Approve" },
|
|
2608
|
+
{ id: "reject", label: "Reject" },
|
|
2609
|
+
{ id: "skip", label: "Skip" }
|
|
2610
|
+
], Nt = [
|
|
2611
|
+
{ id: "RATE_LIMIT", label: "Rate Limit" },
|
|
2612
|
+
{ id: "TIMEOUT", label: "Timeout" },
|
|
2613
|
+
{ id: "NETWORK", label: "Network" },
|
|
2614
|
+
{ id: "LLM_ERROR", label: "LLM Error" },
|
|
2615
|
+
{ id: "VALIDATION", label: "Validation" }
|
|
2616
|
+
];
|
|
2617
|
+
let ke = null;
|
|
2618
|
+
const ge = (o, t) => {
|
|
2619
|
+
n.value && (ke && clearTimeout(ke), ke = setTimeout(() => {
|
|
2620
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2621
|
+
[o]: t
|
|
2622
|
+
});
|
|
2623
|
+
}, 200));
|
|
2624
|
+
}, Tt = (o) => {
|
|
2625
|
+
ge("label", o.target.value);
|
|
2626
|
+
}, Ct = (o) => {
|
|
2627
|
+
ge("description", o.target.value);
|
|
2628
|
+
}, Et = (o) => {
|
|
2629
|
+
const t = o.target.value;
|
|
2630
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2631
|
+
...S.value ? { conditionModel: t } : { model: t }
|
|
2632
|
+
});
|
|
2633
|
+
}, Qe = (o) => {
|
|
2634
|
+
const t = o.target.value, R = S.value ? "conditionPrompt" : "prompt";
|
|
2635
|
+
ge(R, t);
|
|
2636
|
+
}, Ze = (o) => {
|
|
2637
|
+
if (!n.value) return;
|
|
2638
|
+
const t = k.value.indexOf(o);
|
|
2639
|
+
t === -1 ? k.value.push(o) : k.value.splice(t, 1), i.editor.commands.updateNodeData(n.value.id, {
|
|
2640
|
+
tools: [...k.value]
|
|
2641
|
+
});
|
|
2642
|
+
}, et = (o) => {
|
|
2643
|
+
if (!n.value) return;
|
|
2644
|
+
const t = re.value;
|
|
2645
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2646
|
+
errorHandling: {
|
|
2647
|
+
...t,
|
|
2648
|
+
...o
|
|
2649
|
+
}
|
|
2650
|
+
});
|
|
2651
|
+
}, tt = (o) => {
|
|
2652
|
+
et({
|
|
2653
|
+
retry: {
|
|
2654
|
+
..._e.value,
|
|
2655
|
+
...o
|
|
2656
|
+
}
|
|
2657
|
+
});
|
|
2658
|
+
}, Ye = (o) => {
|
|
2659
|
+
et({ mode: o });
|
|
2660
|
+
}, Bt = (o) => {
|
|
2661
|
+
const t = _e.value.retryOn || [], R = t.includes(o) ? t.filter((j) => j !== o) : [...t, o];
|
|
2662
|
+
tt({ retryOn: R });
|
|
2663
|
+
}, Xe = (o, t) => {
|
|
2664
|
+
const R = Number(t.target.value);
|
|
2665
|
+
tt({
|
|
2666
|
+
[o]: Number.isFinite(R) ? R : void 0
|
|
2667
|
+
});
|
|
2668
|
+
}, Ot = (o) => {
|
|
2669
|
+
const t = Number(o.target.value);
|
|
2670
|
+
ge("maxIterations", Number.isFinite(t) ? t : 1);
|
|
2671
|
+
}, Lt = (o) => {
|
|
2672
|
+
ge(
|
|
2673
|
+
"onMaxIterations",
|
|
2674
|
+
o.target.value
|
|
2675
|
+
);
|
|
2676
|
+
}, Rt = (o) => {
|
|
2677
|
+
ge(
|
|
2678
|
+
"customEvaluator",
|
|
2679
|
+
o.target.value
|
|
2680
|
+
);
|
|
2681
|
+
}, ot = (o) => {
|
|
2682
|
+
ge("loopMode", o.target.value);
|
|
2683
|
+
}, st = (o) => {
|
|
2684
|
+
n.value && i.editor.commands.updateNodeData(n.value.id, {
|
|
2685
|
+
outputMode: o
|
|
2686
|
+
});
|
|
2687
|
+
}, Pt = () => {
|
|
2688
|
+
if (!n.value) return;
|
|
2689
|
+
const o = W.value.includePreviousOutputs !== !1;
|
|
2690
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2691
|
+
includePreviousOutputs: !o
|
|
2692
|
+
});
|
|
2693
|
+
}, At = () => {
|
|
2694
|
+
if (!n.value) return;
|
|
2695
|
+
const o = W.value.includeIterationContext !== !1;
|
|
2696
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2697
|
+
includeIterationContext: !o
|
|
2698
|
+
});
|
|
2699
|
+
}, Vt = (o) => {
|
|
2700
|
+
ge("loopPrompt", o.target.value);
|
|
2701
|
+
}, Me = (o) => {
|
|
2702
|
+
if (!n.value) return;
|
|
2703
|
+
const t = me.value;
|
|
2704
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2705
|
+
hitl: {
|
|
2706
|
+
...t,
|
|
2707
|
+
...o
|
|
2708
|
+
}
|
|
2709
|
+
});
|
|
2710
|
+
}, Ht = () => {
|
|
2711
|
+
Me({ enabled: !me.value.enabled });
|
|
2712
|
+
}, jt = (o) => {
|
|
2713
|
+
Me({ mode: o });
|
|
2714
|
+
}, zt = (o) => {
|
|
2715
|
+
if (!n.value) return;
|
|
2716
|
+
const t = o.target.value;
|
|
2717
|
+
ke && clearTimeout(ke), ke = setTimeout(() => {
|
|
2718
|
+
Me({ prompt: t });
|
|
2719
|
+
}, 200);
|
|
2720
|
+
}, Ut = (o) => {
|
|
2721
|
+
const t = Number(o.target.value);
|
|
2722
|
+
Me({
|
|
2723
|
+
timeout: Number.isFinite(t) && t > 0 ? t : void 0
|
|
2724
|
+
});
|
|
2725
|
+
}, Wt = (o) => {
|
|
2726
|
+
const t = o.target.value;
|
|
2727
|
+
Me({ defaultAction: t });
|
|
2728
|
+
}, nt = (o) => {
|
|
2729
|
+
ge("subflowId", o);
|
|
2730
|
+
}, Ft = (o) => {
|
|
2731
|
+
nt(o.target.value);
|
|
2732
|
+
}, Kt = (o) => {
|
|
2733
|
+
const t = o.target.value;
|
|
2734
|
+
nt(t), t && _.value.some((R) => R.id === t) && (J.value = !1);
|
|
2735
|
+
}, qt = () => {
|
|
2736
|
+
J.value = !J.value;
|
|
2737
|
+
}, Gt = () => {
|
|
2738
|
+
n.value && i.editor.commands.updateNodeData(n.value.id, {
|
|
2739
|
+
shareSession: !B.value.shareSession
|
|
2740
|
+
});
|
|
2741
|
+
}, Yt = (o, t) => {
|
|
2742
|
+
if (!n.value) return;
|
|
2743
|
+
const R = B.value.inputMappings || {};
|
|
2744
|
+
i.editor.commands.updateNodeData(n.value.id, {
|
|
2745
|
+
inputMappings: {
|
|
2746
|
+
...R,
|
|
2747
|
+
[o]: t
|
|
2748
|
+
}
|
|
2749
|
+
});
|
|
2750
|
+
}, Xt = (o) => {
|
|
2751
|
+
if (!n.value) return;
|
|
2752
|
+
const t = { ...B.value.inputMappings };
|
|
2753
|
+
delete t[o], i.editor.commands.updateNodeData(n.value.id, {
|
|
2754
|
+
inputMappings: t
|
|
2755
|
+
});
|
|
2756
|
+
}, Jt = () => {
|
|
2757
|
+
if (!n.value || !T.value) return;
|
|
2758
|
+
const o = n.value.id, t = q.value.label;
|
|
2759
|
+
confirm(`Delete "${t}"?`) && (n.value = null, i.editor.commands.deleteNode(o), x("delete", o));
|
|
2760
|
+
};
|
|
2761
|
+
return (o, t) => {
|
|
2762
|
+
var R, j, pe, Z;
|
|
2763
|
+
return n.value ? (s(), l("div", nl, [
|
|
2764
|
+
e("div", ll, [
|
|
2765
|
+
e("div", {
|
|
2766
|
+
class: P(["header-icon", n.value.type])
|
|
2767
|
+
}, [
|
|
2768
|
+
m.value ? (s(), l("svg", al, [...t[25] || (t[25] = [
|
|
2769
|
+
e("rect", {
|
|
2770
|
+
x: "3",
|
|
2771
|
+
y: "11",
|
|
2772
|
+
width: "18",
|
|
2773
|
+
height: "10",
|
|
2774
|
+
rx: "2"
|
|
2775
|
+
}, null, -1),
|
|
2776
|
+
e("circle", {
|
|
2777
|
+
cx: "12",
|
|
2778
|
+
cy: "5",
|
|
2779
|
+
r: "2"
|
|
2780
|
+
}, null, -1),
|
|
2781
|
+
e("path", { d: "M12 7v4" }, null, -1)
|
|
2782
|
+
])])) : U.value ? (s(), l("svg", il, [...t[26] || (t[26] = [
|
|
2783
|
+
e("line", {
|
|
2784
|
+
x1: "6",
|
|
2785
|
+
y1: "3",
|
|
2786
|
+
x2: "6",
|
|
2787
|
+
y2: "15"
|
|
2788
|
+
}, null, -1),
|
|
2789
|
+
e("circle", {
|
|
2790
|
+
cx: "18",
|
|
2791
|
+
cy: "6",
|
|
2792
|
+
r: "3"
|
|
2793
|
+
}, null, -1),
|
|
2794
|
+
e("circle", {
|
|
2795
|
+
cx: "6",
|
|
2796
|
+
cy: "18",
|
|
2797
|
+
r: "3"
|
|
2798
|
+
}, null, -1),
|
|
2799
|
+
e("path", { d: "M18 9a9 9 0 0 1-9 9" }, null, -1)
|
|
2800
|
+
])])) : g.value ? (s(), l("svg", rl, [...t[27] || (t[27] = [
|
|
2801
|
+
e("circle", {
|
|
2802
|
+
cx: "18",
|
|
2803
|
+
cy: "18",
|
|
2804
|
+
r: "3"
|
|
2805
|
+
}, null, -1),
|
|
2806
|
+
e("circle", {
|
|
2807
|
+
cx: "6",
|
|
2808
|
+
cy: "6",
|
|
2809
|
+
r: "3"
|
|
2810
|
+
}, null, -1),
|
|
2811
|
+
e("path", { d: "M6 21V9a9 9 0 0 0 9 9" }, null, -1)
|
|
2812
|
+
])])) : (s(), l("svg", dl, [...t[28] || (t[28] = [
|
|
2813
|
+
e("polygon", { points: "5 3 19 12 5 21 5 3" }, null, -1)
|
|
2814
|
+
])]))
|
|
2815
|
+
], 2),
|
|
2816
|
+
e("input", {
|
|
2817
|
+
class: "label-input",
|
|
2818
|
+
value: q.value.label,
|
|
2819
|
+
onInput: Tt,
|
|
2820
|
+
placeholder: "Node name"
|
|
2821
|
+
}, null, 40, ul),
|
|
2822
|
+
T.value ? (s(), l("button", {
|
|
2823
|
+
key: 0,
|
|
2824
|
+
class: "delete-btn",
|
|
2825
|
+
onClick: Jt,
|
|
2826
|
+
title: "Delete node"
|
|
2827
|
+
}, [...t[29] || (t[29] = [
|
|
2828
|
+
e("svg", {
|
|
2829
|
+
viewBox: "0 0 24 24",
|
|
2830
|
+
fill: "none",
|
|
2831
|
+
stroke: "currentColor",
|
|
2832
|
+
"stroke-width": "2"
|
|
2833
|
+
}, [
|
|
2834
|
+
e("polyline", { points: "3 6 5 6 21 6" }),
|
|
2835
|
+
e("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
2836
|
+
], -1)
|
|
2837
|
+
])])) : M("", !0),
|
|
2838
|
+
e("button", {
|
|
2839
|
+
class: "close-btn",
|
|
2840
|
+
onClick: t[0] || (t[0] = (p) => x("close")),
|
|
2841
|
+
title: "Close inspector"
|
|
2842
|
+
}, [...t[30] || (t[30] = [
|
|
2843
|
+
e("svg", {
|
|
2844
|
+
viewBox: "0 0 24 24",
|
|
2845
|
+
fill: "none",
|
|
2846
|
+
stroke: "currentColor",
|
|
2847
|
+
"stroke-width": "2"
|
|
2848
|
+
}, [
|
|
2849
|
+
e("line", {
|
|
2850
|
+
x1: "18",
|
|
2851
|
+
y1: "6",
|
|
2852
|
+
x2: "6",
|
|
2853
|
+
y2: "18"
|
|
2854
|
+
}),
|
|
2855
|
+
e("line", {
|
|
2856
|
+
x1: "6",
|
|
2857
|
+
y1: "6",
|
|
2858
|
+
x2: "18",
|
|
2859
|
+
y2: "18"
|
|
2860
|
+
})
|
|
2861
|
+
], -1)
|
|
2862
|
+
])])
|
|
2863
|
+
]),
|
|
2864
|
+
N.value ? (s(), l("div", cl, [
|
|
2865
|
+
t[31] || (t[31] = be('<label class="description-label" data-v-2de5c749><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-2de5c749></path><polyline points="14 2 14 8 20 8" data-v-2de5c749></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-2de5c749></line><line x1="16" y1="17" x2="8" y2="17" data-v-2de5c749></line><polyline points="10 9 9 9 8 9" data-v-2de5c749></polyline></svg> Description <span class="description-hint" data-v-2de5c749>(used by router for decisions)</span></label>', 1)),
|
|
2866
|
+
e("textarea", {
|
|
2867
|
+
class: "description-textarea",
|
|
2868
|
+
value: q.value.description || "",
|
|
2869
|
+
placeholder: "Describe what this node does... e.g., 'Handles complex math problems and coding questions'",
|
|
2870
|
+
onInput: Ct
|
|
2871
|
+
}, null, 40, vl)
|
|
2872
|
+
])) : M("", !0),
|
|
2873
|
+
N.value || V.value ? (s(), l("div", pl, [
|
|
2874
|
+
N.value && !c.value && !g.value ? (s(), l("button", {
|
|
2875
|
+
key: 0,
|
|
2876
|
+
class: P(["tab", { active: v.value === "prompt" }]),
|
|
2877
|
+
onClick: t[1] || (t[1] = (p) => v.value = "prompt")
|
|
2878
|
+
}, [
|
|
2879
|
+
t[32] || (t[32] = e("svg", {
|
|
2880
|
+
viewBox: "0 0 24 24",
|
|
2881
|
+
fill: "none",
|
|
2882
|
+
stroke: "currentColor",
|
|
2883
|
+
"stroke-width": "2"
|
|
2884
|
+
}, [
|
|
2885
|
+
e("rect", {
|
|
2886
|
+
x: "3",
|
|
2887
|
+
y: "11",
|
|
2888
|
+
width: "18",
|
|
2889
|
+
height: "10",
|
|
2890
|
+
rx: "2"
|
|
2891
|
+
}),
|
|
2892
|
+
e("circle", {
|
|
2893
|
+
cx: "12",
|
|
2894
|
+
cy: "5",
|
|
2895
|
+
r: "2"
|
|
2896
|
+
}),
|
|
2897
|
+
e("path", { d: "M12 7v4" })
|
|
2898
|
+
], -1)),
|
|
2899
|
+
Y(" " + y(U.value ? "Instructions" : S.value ? "Condition" : "Instructions"), 1)
|
|
2900
|
+
], 2)) : M("", !0),
|
|
2901
|
+
N.value && !c.value && !g.value ? (s(), l("button", {
|
|
2902
|
+
key: 1,
|
|
2903
|
+
class: P(["tab", { active: v.value === "model" }]),
|
|
2904
|
+
onClick: t[2] || (t[2] = (p) => v.value = "model")
|
|
2905
|
+
}, [...t[33] || (t[33] = [
|
|
2906
|
+
be('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><rect x="4" y="4" width="16" height="16" rx="2" ry="2" data-v-2de5c749></rect><rect x="9" y="9" width="6" height="6" data-v-2de5c749></rect><line x1="9" y1="1" x2="9" y2="4" data-v-2de5c749></line><line x1="15" y1="1" x2="15" y2="4" data-v-2de5c749></line><line x1="9" y1="20" x2="9" y2="23" data-v-2de5c749></line><line x1="15" y1="20" x2="15" y2="23" data-v-2de5c749></line><line x1="20" y1="9" x2="23" y2="9" data-v-2de5c749></line><line x1="20" y1="14" x2="23" y2="14" data-v-2de5c749></line><line x1="1" y1="9" x2="4" y2="9" data-v-2de5c749></line><line x1="1" y1="14" x2="4" y2="14" data-v-2de5c749></line></svg> Model ', 2)
|
|
2907
|
+
])], 2)) : M("", !0),
|
|
2908
|
+
U.value ? (s(), l("button", {
|
|
2909
|
+
key: 2,
|
|
2910
|
+
class: P(["tab", { active: v.value === "routes" }]),
|
|
2911
|
+
onClick: t[3] || (t[3] = (p) => v.value = "routes")
|
|
2912
|
+
}, [
|
|
2913
|
+
t[34] || (t[34] = e("svg", {
|
|
2914
|
+
viewBox: "0 0 24 24",
|
|
2915
|
+
fill: "none",
|
|
2916
|
+
stroke: "currentColor",
|
|
2917
|
+
"stroke-width": "2"
|
|
2918
|
+
}, [
|
|
2919
|
+
e("path", { d: "M9 18l6-6-6-6" })
|
|
2920
|
+
], -1)),
|
|
2921
|
+
t[35] || (t[35] = Y(" Routes ", -1)),
|
|
2922
|
+
e("span", fl, y(ae.value.routes.length), 1)
|
|
2923
|
+
], 2)) : M("", !0),
|
|
2924
|
+
g.value ? (s(), l("button", {
|
|
2925
|
+
key: 3,
|
|
2926
|
+
class: P(["tab", { active: v.value === "branches" }]),
|
|
2927
|
+
onClick: t[4] || (t[4] = (p) => v.value = "branches")
|
|
2928
|
+
}, [
|
|
2929
|
+
t[36] || (t[36] = be('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><circle cx="18" cy="18" r="3" data-v-2de5c749></circle><circle cx="6" cy="6" r="3" data-v-2de5c749></circle><circle cx="18" cy="6" r="3" data-v-2de5c749></circle><path d="M6 9v12" data-v-2de5c749></path><path d="M18 9v6" data-v-2de5c749></path></svg> Branches ', 2)),
|
|
2930
|
+
e("span", ml, y(ee.value.branches.length), 1)
|
|
2931
|
+
], 2)) : M("", !0),
|
|
2932
|
+
m.value ? (s(), l("button", {
|
|
2933
|
+
key: 4,
|
|
2934
|
+
class: P(["tab", { active: v.value === "tools" }]),
|
|
2935
|
+
onClick: t[5] || (t[5] = (p) => v.value = "tools")
|
|
2936
|
+
}, [
|
|
2937
|
+
t[37] || (t[37] = e("svg", {
|
|
2938
|
+
viewBox: "0 0 24 24",
|
|
2939
|
+
fill: "none",
|
|
2940
|
+
stroke: "currentColor",
|
|
2941
|
+
"stroke-width": "2"
|
|
2942
|
+
}, [
|
|
2943
|
+
e("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" })
|
|
2944
|
+
], -1)),
|
|
2945
|
+
t[38] || (t[38] = Y(" Tools ", -1)),
|
|
2946
|
+
k.value.length ? (s(), l("span", gl, y(k.value.length), 1)) : M("", !0)
|
|
2947
|
+
], 2)) : M("", !0),
|
|
2948
|
+
V.value ? (s(), l("button", {
|
|
2949
|
+
key: 5,
|
|
2950
|
+
class: P(["tab", { active: v.value === "errors" }]),
|
|
2951
|
+
onClick: t[6] || (t[6] = (p) => v.value = "errors")
|
|
2952
|
+
}, [...t[39] || (t[39] = [
|
|
2953
|
+
e("svg", {
|
|
2954
|
+
viewBox: "0 0 24 24",
|
|
2955
|
+
fill: "none",
|
|
2956
|
+
stroke: "currentColor",
|
|
2957
|
+
"stroke-width": "2"
|
|
2958
|
+
}, [
|
|
2959
|
+
e("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
2960
|
+
e("line", {
|
|
2961
|
+
x1: "12",
|
|
2962
|
+
y1: "9",
|
|
2963
|
+
x2: "12",
|
|
2964
|
+
y2: "13"
|
|
2965
|
+
}),
|
|
2966
|
+
e("line", {
|
|
2967
|
+
x1: "12",
|
|
2968
|
+
y1: "17",
|
|
2969
|
+
x2: "12.01",
|
|
2970
|
+
y2: "17"
|
|
2971
|
+
})
|
|
2972
|
+
], -1),
|
|
2973
|
+
Y(" Errors ", -1)
|
|
2974
|
+
])], 2)) : M("", !0),
|
|
2975
|
+
z.value ? (s(), l("button", {
|
|
2976
|
+
key: 6,
|
|
2977
|
+
class: P(["tab", { active: v.value === "hitl" }]),
|
|
2978
|
+
onClick: t[7] || (t[7] = (p) => v.value = "hitl")
|
|
2979
|
+
}, [
|
|
2980
|
+
t[40] || (t[40] = e("svg", {
|
|
2981
|
+
viewBox: "0 0 24 24",
|
|
2982
|
+
fill: "none",
|
|
2983
|
+
stroke: "currentColor",
|
|
2984
|
+
"stroke-width": "2"
|
|
2985
|
+
}, [
|
|
2986
|
+
e("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
|
|
2987
|
+
e("circle", {
|
|
2988
|
+
cx: "12",
|
|
2989
|
+
cy: "7",
|
|
2990
|
+
r: "4"
|
|
2991
|
+
})
|
|
2992
|
+
], -1)),
|
|
2993
|
+
t[41] || (t[41] = Y(" HITL ", -1)),
|
|
2994
|
+
me.value.enabled ? (s(), l("span", hl, "ON")) : M("", !0)
|
|
2995
|
+
], 2)) : M("", !0),
|
|
2996
|
+
h.value ? (s(), l("button", {
|
|
2997
|
+
key: 7,
|
|
2998
|
+
class: P(["tab", { active: v.value === "subflow" }]),
|
|
2999
|
+
onClick: t[8] || (t[8] = (p) => v.value = "subflow")
|
|
3000
|
+
}, [...t[42] || (t[42] = [
|
|
3001
|
+
be('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><rect x="3" y="3" width="7" height="7" rx="1" data-v-2de5c749></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-2de5c749></rect><rect x="8.5" y="14" width="7" height="7" rx="1" data-v-2de5c749></rect><path d="M6.5 10v2a2 2 0 002 2h1" data-v-2de5c749></path><path d="M17.5 10v2a2 2 0 01-2 2h-1" data-v-2de5c749></path></svg> Subflow ', 2)
|
|
3002
|
+
])], 2)) : M("", !0),
|
|
3003
|
+
c.value ? (s(), l("button", {
|
|
3004
|
+
key: 8,
|
|
3005
|
+
class: P(["tab", { active: v.value === "output" }]),
|
|
3006
|
+
onClick: t[9] || (t[9] = (p) => v.value = "output")
|
|
3007
|
+
}, [...t[43] || (t[43] = [
|
|
3008
|
+
e("svg", {
|
|
3009
|
+
viewBox: "0 0 24 24",
|
|
3010
|
+
fill: "none",
|
|
3011
|
+
stroke: "currentColor",
|
|
3012
|
+
"stroke-width": "2"
|
|
3013
|
+
}, [
|
|
3014
|
+
e("path", { d: "M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z" }),
|
|
3015
|
+
e("line", {
|
|
3016
|
+
x1: "4",
|
|
3017
|
+
y1: "22",
|
|
3018
|
+
x2: "4",
|
|
3019
|
+
y2: "15"
|
|
3020
|
+
})
|
|
3021
|
+
], -1),
|
|
3022
|
+
Y(" Output ", -1)
|
|
3023
|
+
])], 2)) : M("", !0)
|
|
3024
|
+
])) : M("", !0),
|
|
3025
|
+
N.value || V.value || z.value || h.value || c.value ? (s(), l("div", yl, [
|
|
3026
|
+
v.value === "prompt" && N.value && !c.value && !g.value ? (s(), l("div", wl, [
|
|
3027
|
+
S.value ? (s(), l(K, { key: 0 }, [
|
|
3028
|
+
e("div", bl, [
|
|
3029
|
+
t[44] || (t[44] = e("label", { class: "field-label" }, "Loop Strategy", -1)),
|
|
3030
|
+
e("div", _l, [
|
|
3031
|
+
e("button", {
|
|
3032
|
+
class: P(["mode-button", {
|
|
3033
|
+
active: W.value.loopMode !== "fixed"
|
|
3034
|
+
}]),
|
|
3035
|
+
onClick: t[10] || (t[10] = (p) => ot({
|
|
3036
|
+
target: { value: "while" }
|
|
3037
|
+
}))
|
|
3038
|
+
}, " Smart Loop (AI) ", 2),
|
|
3039
|
+
e("button", {
|
|
3040
|
+
class: P(["mode-button", {
|
|
3041
|
+
active: W.value.loopMode === "fixed"
|
|
3042
|
+
}]),
|
|
3043
|
+
onClick: t[11] || (t[11] = (p) => ot({
|
|
3044
|
+
target: { value: "fixed" }
|
|
3045
|
+
}))
|
|
3046
|
+
}, " Fixed Count ", 2)
|
|
3047
|
+
]),
|
|
3048
|
+
e("p", kl, y(W.value.loopMode === "fixed" ? "Runs exactly N times. Good for batch processing." : "AI evaluates results to decide when to stop."), 1)
|
|
3049
|
+
]),
|
|
3050
|
+
W.value.loopMode !== "fixed" ? (s(), l("div", xl, [
|
|
3051
|
+
t[45] || (t[45] = e("label", { class: "field-label" }, "Stop Condition", -1)),
|
|
3052
|
+
e("textarea", {
|
|
3053
|
+
value: W.value.conditionPrompt || "",
|
|
3054
|
+
class: "prompt-textarea condition-prompt",
|
|
3055
|
+
placeholder: 'Example: "If the summary is concise and covers all points, respond DONE. Otherwise respond CONTINUE."',
|
|
3056
|
+
onInput: Qe,
|
|
3057
|
+
rows: "4"
|
|
3058
|
+
}, null, 40, $l)
|
|
3059
|
+
])) : M("", !0),
|
|
3060
|
+
e("div", Il, [
|
|
3061
|
+
e("div", Ml, [
|
|
3062
|
+
e("label", Dl, y(W.value.loopMode === "fixed" ? "Run Count" : "Max Limit"), 1),
|
|
3063
|
+
e("input", {
|
|
3064
|
+
type: "number",
|
|
3065
|
+
min: "1",
|
|
3066
|
+
class: "text-input",
|
|
3067
|
+
value: W.value.maxIterations ?? 10,
|
|
3068
|
+
onInput: Ot
|
|
3069
|
+
}, null, 40, Sl)
|
|
3070
|
+
]),
|
|
3071
|
+
e("div", Nl, [
|
|
3072
|
+
t[47] || (t[47] = e("label", { class: "field-label" }, "On Limit Reached", -1)),
|
|
3073
|
+
e("select", {
|
|
3074
|
+
class: "model-select",
|
|
3075
|
+
value: W.value.onMaxIterations || "warning",
|
|
3076
|
+
onChange: Lt
|
|
3077
|
+
}, [...t[46] || (t[46] = [
|
|
3078
|
+
e("option", { value: "warning" }, " Warn & Continue ", -1),
|
|
3079
|
+
e("option", { value: "continue" }, " Silent Continue ", -1),
|
|
3080
|
+
e("option", { value: "error" }, "Stop with Error", -1)
|
|
3081
|
+
])], 40, Tl)
|
|
3082
|
+
])
|
|
3083
|
+
]),
|
|
3084
|
+
e("div", Cl, [
|
|
3085
|
+
t[48] || (t[48] = e("label", { class: "field-label" }, "Loop Instructions", -1)),
|
|
3086
|
+
e("textarea", {
|
|
3087
|
+
value: W.value.loopPrompt || "",
|
|
3088
|
+
class: "prompt-textarea loop-prompt",
|
|
3089
|
+
placeholder: `Tell the AI what to do each time.
|
|
3090
|
+
|
|
3091
|
+
Example: "Improve this text, making it clearer and more engaging."`,
|
|
3092
|
+
onInput: Vt,
|
|
3093
|
+
rows: "3"
|
|
3094
|
+
}, null, 40, El),
|
|
3095
|
+
t[49] || (t[49] = e("p", { class: "field-hint" }, " These instructions are added to the input at the start of each run. ", -1))
|
|
3096
|
+
]),
|
|
3097
|
+
e("div", Bl, [
|
|
3098
|
+
t[50] || (t[50] = e("label", { class: "field-label" }, "Output Handling", -1)),
|
|
3099
|
+
e("div", Ol, [
|
|
3100
|
+
e("button", {
|
|
3101
|
+
class: P(["mode-button", {
|
|
3102
|
+
active: (W.value.outputMode || "last") === "last"
|
|
3103
|
+
}]),
|
|
3104
|
+
onClick: t[12] || (t[12] = (p) => st("last"))
|
|
3105
|
+
}, " Last Result Only ", 2),
|
|
3106
|
+
e("button", {
|
|
3107
|
+
class: P(["mode-button", {
|
|
3108
|
+
active: W.value.outputMode === "accumulate"
|
|
3109
|
+
}]),
|
|
3110
|
+
onClick: t[13] || (t[13] = (p) => st("accumulate"))
|
|
3111
|
+
}, " Collect All ", 2)
|
|
3112
|
+
])
|
|
3113
|
+
]),
|
|
3114
|
+
t[57] || (t[57] = e("div", { class: "section-divider" }, null, -1)),
|
|
3115
|
+
t[58] || (t[58] = e("label", { class: "field-label section-title" }, "Context Visibility", -1)),
|
|
3116
|
+
t[59] || (t[59] = e("p", { class: "section-subtitle" }, " Choose what information is available to nodes inside the loop. ", -1)),
|
|
3117
|
+
e("div", Ll, [
|
|
3118
|
+
e("label", {
|
|
3119
|
+
class: P(["tool-item", {
|
|
3120
|
+
enabled: W.value.includePreviousOutputs !== !1
|
|
3121
|
+
}])
|
|
3122
|
+
}, [
|
|
3123
|
+
e("input", {
|
|
3124
|
+
type: "checkbox",
|
|
3125
|
+
checked: W.value.includePreviousOutputs !== !1,
|
|
3126
|
+
onChange: Pt
|
|
3127
|
+
}, null, 40, Rl),
|
|
3128
|
+
t[51] || (t[51] = e("div", { class: "tool-info" }, [
|
|
3129
|
+
e("span", { class: "tool-name" }, "Previous Iterations"),
|
|
3130
|
+
e("span", { class: "tool-description" }, "Let the AI see results from earlier runs")
|
|
3131
|
+
], -1))
|
|
3132
|
+
], 2),
|
|
3133
|
+
e("label", {
|
|
3134
|
+
class: P(["tool-item", {
|
|
3135
|
+
enabled: W.value.includeIterationContext !== !1
|
|
3136
|
+
}])
|
|
3137
|
+
}, [
|
|
3138
|
+
e("input", {
|
|
3139
|
+
type: "checkbox",
|
|
3140
|
+
checked: W.value.includeIterationContext !== !1,
|
|
3141
|
+
onChange: At
|
|
3142
|
+
}, null, 40, Pl),
|
|
3143
|
+
t[52] || (t[52] = e("div", { class: "tool-info" }, [
|
|
3144
|
+
e("span", { class: "tool-name" }, "Loop Counter"),
|
|
3145
|
+
e("span", { class: "tool-description" }, "Show current iteration number (1/10)")
|
|
3146
|
+
], -1))
|
|
3147
|
+
], 2)
|
|
3148
|
+
]),
|
|
3149
|
+
W.value.loopMode !== "fixed" ? (s(), l(K, { key: 1 }, [
|
|
3150
|
+
t[56] || (t[56] = e("div", { class: "section-divider" }, null, -1)),
|
|
3151
|
+
e("details", Al, [
|
|
3152
|
+
t[55] || (t[55] = e("summary", { class: "advanced-toggle" }, " Advanced: Custom Evaluator ", -1)),
|
|
3153
|
+
e("div", Vl, [
|
|
3154
|
+
e("div", Hl, [
|
|
3155
|
+
t[53] || (t[53] = e("label", { class: "field-label" }, "Function Name", -1)),
|
|
3156
|
+
e("input", {
|
|
3157
|
+
type: "text",
|
|
3158
|
+
class: "text-input",
|
|
3159
|
+
value: W.value.customEvaluator || "",
|
|
3160
|
+
placeholder: "e.g. checkQualityScore",
|
|
3161
|
+
onInput: Rt
|
|
3162
|
+
}, null, 40, jl),
|
|
3163
|
+
t[54] || (t[54] = e("p", { class: "field-hint" }, " Bypass AI evaluation and use a registered function to decide when to stop. ", -1))
|
|
3164
|
+
])
|
|
3165
|
+
])
|
|
3166
|
+
])
|
|
3167
|
+
], 64)) : M("", !0)
|
|
3168
|
+
], 64)) : (s(), l(K, { key: 1 }, [
|
|
3169
|
+
e("label", zl, y(U.value ? "Routing Instructions" : g.value ? "Merge Instructions" : "Instructions"), 1),
|
|
3170
|
+
e("textarea", {
|
|
3171
|
+
value: q.value.prompt || "",
|
|
3172
|
+
class: "prompt-textarea",
|
|
3173
|
+
placeholder: U.value ? `Instructions for routing decisions...
|
|
3174
|
+
|
|
3175
|
+
Example:
|
|
3176
|
+
Route to Technical if the user mentions bugs, errors, or technical issues.
|
|
3177
|
+
Route to Sales for pricing or product inquiries.` : g.value ? "Instructions for merging parallel outputs..." : `Enter the system prompt for this agent...
|
|
3178
|
+
|
|
3179
|
+
Example:
|
|
3180
|
+
You are a helpful technical support specialist. Help users troubleshoot issues with their software.`,
|
|
3181
|
+
onInput: Qe
|
|
3182
|
+
}, null, 40, Ul),
|
|
3183
|
+
e("p", Wl, y(U.value ? "These instructions help the router decide which branch to take. Edge labels are used to make decisions." : g.value ? "This prompt is used to merge/summarize outputs from all parallel branches." : "This prompt defines the agent's behavior and personality."), 1)
|
|
3184
|
+
], 64))
|
|
3185
|
+
])) : M("", !0),
|
|
3186
|
+
v.value === "model" && !g.value ? (s(), l("div", Fl, [
|
|
3187
|
+
e("label", Kl, y(S.value ? "Condition Model" : "Select Model"), 1),
|
|
3188
|
+
e("select", {
|
|
3189
|
+
class: "model-select",
|
|
3190
|
+
value: S.value ? W.value.conditionModel || "z-ai/glm-4.6:exacto" : q.value.model || "z-ai/glm-4.6:exacto",
|
|
3191
|
+
onChange: Et
|
|
3192
|
+
}, [
|
|
3193
|
+
(s(!0), l(K, null, Q(I.value, (p) => (s(), l("option", {
|
|
3194
|
+
key: p.id,
|
|
3195
|
+
value: p.id
|
|
3196
|
+
}, y(p.name) + " (" + y(p.provider) + ") ", 9, Gl))), 128))
|
|
3197
|
+
], 40, ql),
|
|
3198
|
+
e("div", Yl, [
|
|
3199
|
+
t[60] || (t[60] = e("span", { class: "model-id-label" }, "Model ID:", -1)),
|
|
3200
|
+
e("code", null, y(S.value ? W.value.conditionModel || "z-ai/glm-4.6:exacto" : q.value.model || "z-ai/glm-4.6:exacto"), 1)
|
|
3201
|
+
])
|
|
3202
|
+
])) : M("", !0),
|
|
3203
|
+
v.value === "routes" && U.value ? (s(), l("div", Xl, [
|
|
3204
|
+
e("div", { class: "routes-header" }, [
|
|
3205
|
+
t[62] || (t[62] = e("label", { class: "field-label" }, "Defined Routes", -1)),
|
|
3206
|
+
e("button", {
|
|
3207
|
+
class: "add-btn with-label",
|
|
3208
|
+
onClick: Oe
|
|
3209
|
+
}, [...t[61] || (t[61] = [
|
|
3210
|
+
e("svg", {
|
|
3211
|
+
viewBox: "0 0 24 24",
|
|
3212
|
+
fill: "none",
|
|
3213
|
+
stroke: "currentColor",
|
|
3214
|
+
"stroke-width": "2"
|
|
3215
|
+
}, [
|
|
3216
|
+
e("line", {
|
|
3217
|
+
x1: "12",
|
|
3218
|
+
y1: "5",
|
|
3219
|
+
x2: "12",
|
|
3220
|
+
y2: "19"
|
|
3221
|
+
}),
|
|
3222
|
+
e("line", {
|
|
3223
|
+
x1: "5",
|
|
3224
|
+
y1: "12",
|
|
3225
|
+
x2: "19",
|
|
3226
|
+
y2: "12"
|
|
3227
|
+
})
|
|
3228
|
+
], -1),
|
|
3229
|
+
Y(" Add Route ", -1)
|
|
3230
|
+
])])
|
|
3231
|
+
]),
|
|
3232
|
+
t[64] || (t[64] = e("p", { class: "field-hint" }, " Define the possible routes for this node. Each route creates an output handle. ", -1)),
|
|
3233
|
+
e("div", Jl, [
|
|
3234
|
+
(s(!0), l(K, null, Q(ae.value.routes, (p) => (s(), l("div", {
|
|
3235
|
+
key: p.id,
|
|
3236
|
+
class: "route-item"
|
|
3237
|
+
}, [
|
|
3238
|
+
e("div", Ql, [
|
|
3239
|
+
e("input", {
|
|
3240
|
+
type: "text",
|
|
3241
|
+
class: "text-input route-label",
|
|
3242
|
+
value: p.label,
|
|
3243
|
+
onInput: (F) => ie(p.id, F.target.value),
|
|
3244
|
+
placeholder: "Route Label"
|
|
3245
|
+
}, null, 40, Zl),
|
|
3246
|
+
e("code", ea, y(p.id), 1)
|
|
3247
|
+
]),
|
|
3248
|
+
e("button", {
|
|
3249
|
+
class: "delete-btn",
|
|
3250
|
+
onClick: (F) => E(p.id),
|
|
3251
|
+
title: "Remove route"
|
|
3252
|
+
}, [...t[63] || (t[63] = [
|
|
3253
|
+
e("svg", {
|
|
3254
|
+
viewBox: "0 0 24 24",
|
|
3255
|
+
fill: "none",
|
|
3256
|
+
stroke: "currentColor",
|
|
3257
|
+
"stroke-width": "2"
|
|
3258
|
+
}, [
|
|
3259
|
+
e("line", {
|
|
3260
|
+
x1: "18",
|
|
3261
|
+
y1: "6",
|
|
3262
|
+
x2: "6",
|
|
3263
|
+
y2: "18"
|
|
3264
|
+
}),
|
|
3265
|
+
e("line", {
|
|
3266
|
+
x1: "6",
|
|
3267
|
+
y1: "6",
|
|
3268
|
+
x2: "18",
|
|
3269
|
+
y2: "18"
|
|
3270
|
+
})
|
|
3271
|
+
], -1)
|
|
3272
|
+
])], 8, ta)
|
|
3273
|
+
]))), 128))
|
|
3274
|
+
])
|
|
3275
|
+
])) : M("", !0),
|
|
3276
|
+
v.value === "branches" && g.value ? (s(), l("div", oa, [
|
|
3277
|
+
e("div", { class: "branches-header" }, [
|
|
3278
|
+
t[66] || (t[66] = e("label", { class: "field-label" }, "Parallel Branches", -1)),
|
|
3279
|
+
e("button", {
|
|
3280
|
+
class: "add-btn",
|
|
3281
|
+
onClick: we,
|
|
3282
|
+
"aria-label": "Add Branch"
|
|
3283
|
+
}, [...t[65] || (t[65] = [
|
|
3284
|
+
e("svg", {
|
|
3285
|
+
viewBox: "0 0 24 24",
|
|
3286
|
+
fill: "none",
|
|
3287
|
+
stroke: "currentColor",
|
|
3288
|
+
"stroke-width": "2"
|
|
3289
|
+
}, [
|
|
3290
|
+
e("line", {
|
|
3291
|
+
x1: "12",
|
|
3292
|
+
y1: "5",
|
|
3293
|
+
x2: "12",
|
|
3294
|
+
y2: "19"
|
|
3295
|
+
}),
|
|
3296
|
+
e("line", {
|
|
3297
|
+
x1: "5",
|
|
3298
|
+
y1: "12",
|
|
3299
|
+
x2: "19",
|
|
3300
|
+
y2: "12"
|
|
3301
|
+
})
|
|
3302
|
+
], -1)
|
|
3303
|
+
])])
|
|
3304
|
+
]),
|
|
3305
|
+
t[78] || (t[78] = e("p", { class: "field-hint" }, " Each branch runs in parallel. Connect nodes to each branch's output handle. Optionally set a model and system prompt per branch. ", -1)),
|
|
3306
|
+
e("div", sa, [
|
|
3307
|
+
(s(!0), l(K, null, Q(ee.value.branches, (p) => (s(), l("div", {
|
|
3308
|
+
key: p.id,
|
|
3309
|
+
class: P(["branch-item", { expanded: ye.value === p.id }])
|
|
3310
|
+
}, [
|
|
3311
|
+
e("div", {
|
|
3312
|
+
class: "branch-header",
|
|
3313
|
+
onClick: (F) => Be(p.id)
|
|
3314
|
+
}, [
|
|
3315
|
+
e("div", la, [
|
|
3316
|
+
e("input", {
|
|
3317
|
+
type: "text",
|
|
3318
|
+
class: "text-input branch-label",
|
|
3319
|
+
value: p.label,
|
|
3320
|
+
onInput: (F) => ve(p.id, F.target.value),
|
|
3321
|
+
onClick: t[14] || (t[14] = Ve(() => {
|
|
3322
|
+
}, ["stop"])),
|
|
3323
|
+
placeholder: "Branch Label"
|
|
3324
|
+
}, null, 40, aa),
|
|
3325
|
+
e("div", ia, [
|
|
3326
|
+
p.model ? (s(), l("span", ra, y(p.model.split("/").pop()), 1)) : M("", !0)
|
|
3327
|
+
])
|
|
3328
|
+
]),
|
|
3329
|
+
e("div", da, [
|
|
3330
|
+
(s(), l("svg", {
|
|
3331
|
+
class: P(["expand-icon", {
|
|
3332
|
+
rotated: ye.value === p.id
|
|
3333
|
+
}]),
|
|
3334
|
+
viewBox: "0 0 24 24",
|
|
3335
|
+
fill: "none",
|
|
3336
|
+
stroke: "currentColor",
|
|
3337
|
+
"stroke-width": "2"
|
|
3338
|
+
}, [...t[67] || (t[67] = [
|
|
3339
|
+
e("polyline", { points: "6 9 12 15 18 9" }, null, -1)
|
|
3340
|
+
])], 2)),
|
|
3341
|
+
e("button", {
|
|
3342
|
+
class: "delete-btn",
|
|
3343
|
+
onClick: Ve((F) => fe(p.id), ["stop"]),
|
|
3344
|
+
title: "Remove branch"
|
|
3345
|
+
}, [...t[68] || (t[68] = [
|
|
3346
|
+
e("svg", {
|
|
3347
|
+
viewBox: "0 0 24 24",
|
|
3348
|
+
fill: "none",
|
|
3349
|
+
stroke: "currentColor",
|
|
3350
|
+
"stroke-width": "2"
|
|
3351
|
+
}, [
|
|
3352
|
+
e("line", {
|
|
3353
|
+
x1: "18",
|
|
3354
|
+
y1: "6",
|
|
3355
|
+
x2: "6",
|
|
3356
|
+
y2: "18"
|
|
3357
|
+
}),
|
|
3358
|
+
e("line", {
|
|
3359
|
+
x1: "6",
|
|
3360
|
+
y1: "6",
|
|
3361
|
+
x2: "18",
|
|
3362
|
+
y2: "18"
|
|
3363
|
+
})
|
|
3364
|
+
], -1)
|
|
3365
|
+
])], 8, ua)
|
|
3366
|
+
])
|
|
3367
|
+
], 8, na),
|
|
3368
|
+
ye.value === p.id ? (s(), l("div", ca, [
|
|
3369
|
+
e("div", va, [
|
|
3370
|
+
t[70] || (t[70] = e("label", { class: "field-label-sm" }, "Model (optional)", -1)),
|
|
3371
|
+
e("select", {
|
|
3372
|
+
class: "model-select-sm",
|
|
3373
|
+
value: p.model || "",
|
|
3374
|
+
onChange: (F) => Ne(p.id, F.target.value)
|
|
3375
|
+
}, [
|
|
3376
|
+
t[69] || (t[69] = e("option", { value: "" }, "Use default", -1)),
|
|
3377
|
+
(s(!0), l(K, null, Q(I.value, (F) => (s(), l("option", {
|
|
3378
|
+
key: F.id,
|
|
3379
|
+
value: F.id
|
|
3380
|
+
}, y(F.name), 9, fa))), 128))
|
|
3381
|
+
], 40, pa)
|
|
3382
|
+
]),
|
|
3383
|
+
e("div", ma, [
|
|
3384
|
+
t[71] || (t[71] = e("label", { class: "field-label-sm" }, "System Prompt (optional)", -1)),
|
|
3385
|
+
e("textarea", {
|
|
3386
|
+
class: "prompt-textarea-sm",
|
|
3387
|
+
value: p.prompt || "",
|
|
3388
|
+
onInput: (F) => Te(p.id, F.target.value),
|
|
3389
|
+
placeholder: "Override system prompt for this branch...",
|
|
3390
|
+
rows: "3"
|
|
3391
|
+
}, null, 40, ga)
|
|
3392
|
+
]),
|
|
3393
|
+
D.value.length > 0 ? (s(), l("div", ha, [
|
|
3394
|
+
t[72] || (t[72] = e("label", { class: "field-label-sm" }, "Tools (optional)", -1)),
|
|
3395
|
+
e("div", ya, [
|
|
3396
|
+
(s(!0), l(K, null, Q(D.value, (F) => (s(), l("label", {
|
|
3397
|
+
key: F.id,
|
|
3398
|
+
class: P(["branch-tool-item", {
|
|
3399
|
+
enabled: (p.tools || []).includes(F.id)
|
|
3400
|
+
}])
|
|
3401
|
+
}, [
|
|
3402
|
+
e("input", {
|
|
3403
|
+
type: "checkbox",
|
|
3404
|
+
checked: (p.tools || []).includes(
|
|
3405
|
+
F.id
|
|
3406
|
+
),
|
|
3407
|
+
onChange: (xe) => Ee(
|
|
3408
|
+
p.id,
|
|
3409
|
+
F.id
|
|
3410
|
+
)
|
|
3411
|
+
}, null, 40, wa),
|
|
3412
|
+
e("span", ba, y(F.name), 1)
|
|
3413
|
+
], 2))), 128))
|
|
3414
|
+
])
|
|
3415
|
+
])) : M("", !0)
|
|
3416
|
+
])) : M("", !0)
|
|
3417
|
+
], 2))), 128))
|
|
3418
|
+
]),
|
|
3419
|
+
e("div", _a, [
|
|
3420
|
+
e("div", ka, [
|
|
3421
|
+
t[74] || (t[74] = e("label", { class: "field-label" }, "Merge Configuration", -1)),
|
|
3422
|
+
e("div", xa, [
|
|
3423
|
+
e("input", {
|
|
3424
|
+
type: "checkbox",
|
|
3425
|
+
checked: ee.value.mergeEnabled !== !1,
|
|
3426
|
+
onChange: t[15] || (t[15] = (p) => i.editor.commands.updateNodeData(n.value.id, { mergeEnabled: p.target.checked }))
|
|
3427
|
+
}, null, 40, $a),
|
|
3428
|
+
t[73] || (t[73] = e("span", { class: "toggle-text" }, "Enable Merge", -1))
|
|
3429
|
+
])
|
|
3430
|
+
]),
|
|
3431
|
+
ee.value.mergeEnabled !== !1 ? (s(), l(K, { key: 0 }, [
|
|
3432
|
+
t[77] || (t[77] = e("p", { class: "field-hint" }, " After all branches complete, results are merged using this prompt. ", -1)),
|
|
3433
|
+
e("div", Ia, [
|
|
3434
|
+
t[75] || (t[75] = e("label", { class: "field-label-sm" }, "Merge Model", -1)),
|
|
3435
|
+
e("select", {
|
|
3436
|
+
class: "model-select",
|
|
3437
|
+
value: ee.value.mergeModel || "z-ai/glm-4.6:exacto",
|
|
3438
|
+
onChange: t[16] || (t[16] = (p) => i.editor.commands.updateNodeData(n.value.id, { model: p.target.value }))
|
|
3439
|
+
}, [
|
|
3440
|
+
(s(!0), l(K, null, Q(I.value, (p) => (s(), l("option", {
|
|
3441
|
+
key: p.id,
|
|
3442
|
+
value: p.id
|
|
3443
|
+
}, y(p.name) + " (" + y(p.provider) + ") ", 9, Da))), 128))
|
|
3444
|
+
], 40, Ma)
|
|
3445
|
+
]),
|
|
3446
|
+
e("div", Sa, [
|
|
3447
|
+
t[76] || (t[76] = e("label", { class: "field-label-sm" }, "Merge Prompt", -1)),
|
|
3448
|
+
e("textarea", {
|
|
3449
|
+
class: "prompt-textarea",
|
|
3450
|
+
value: ee.value.mergePrompt,
|
|
3451
|
+
onInput: t[17] || (t[17] = (p) => ge("prompt", p.target.value)),
|
|
3452
|
+
placeholder: "Instructions for merging branch outputs...",
|
|
3453
|
+
rows: "4"
|
|
3454
|
+
}, null, 40, Na)
|
|
3455
|
+
])
|
|
3456
|
+
], 64)) : M("", !0)
|
|
3457
|
+
])
|
|
3458
|
+
])) : M("", !0),
|
|
3459
|
+
v.value === "tools" && m.value ? (s(), l("div", Ta, [
|
|
3460
|
+
D.value.length > 0 ? (s(), l(K, { key: 0 }, [
|
|
3461
|
+
t[80] || (t[80] = e("label", { class: "field-label" }, "Available Tools", -1)),
|
|
3462
|
+
t[81] || (t[81] = e("p", { class: "field-hint" }, " Select which tools this agent can use during execution. ", -1)),
|
|
3463
|
+
e("div", Ca, [
|
|
3464
|
+
(s(!0), l(K, null, Q(D.value, (p) => (s(), l("label", {
|
|
3465
|
+
key: p.id,
|
|
3466
|
+
class: P(["tool-item", {
|
|
3467
|
+
enabled: k.value.includes(p.id)
|
|
3468
|
+
}])
|
|
3469
|
+
}, [
|
|
3470
|
+
e("input", {
|
|
3471
|
+
type: "checkbox",
|
|
3472
|
+
checked: k.value.includes(p.id),
|
|
3473
|
+
onChange: (F) => Ze(p.id)
|
|
3474
|
+
}, null, 40, Ea),
|
|
3475
|
+
e("div", Ba, [
|
|
3476
|
+
e("span", Oa, y(p.name), 1),
|
|
3477
|
+
e("span", La, y(p.description), 1)
|
|
3478
|
+
])
|
|
3479
|
+
], 2))), 128))
|
|
3480
|
+
]),
|
|
3481
|
+
k.value.length > 0 ? (s(), l("div", Ra, [
|
|
3482
|
+
e("label", Pa, "Enabled Tools (" + y(k.value.length) + ")", 1),
|
|
3483
|
+
e("div", Aa, [
|
|
3484
|
+
(s(!0), l(K, null, Q(k.value, (p) => {
|
|
3485
|
+
var F;
|
|
3486
|
+
return s(), l("span", {
|
|
3487
|
+
key: p,
|
|
3488
|
+
class: "tool-chip"
|
|
3489
|
+
}, [
|
|
3490
|
+
Y(y((F = D.value.find((xe) => xe.id === p)) == null ? void 0 : F.name) + " ", 1),
|
|
3491
|
+
e("button", {
|
|
3492
|
+
class: "chip-remove",
|
|
3493
|
+
onClick: (xe) => Ze(p)
|
|
3494
|
+
}, [...t[79] || (t[79] = [
|
|
3495
|
+
e("svg", {
|
|
3496
|
+
viewBox: "0 0 24 24",
|
|
3497
|
+
fill: "none",
|
|
3498
|
+
stroke: "currentColor",
|
|
3499
|
+
"stroke-width": "2"
|
|
3500
|
+
}, [
|
|
3501
|
+
e("line", {
|
|
3502
|
+
x1: "18",
|
|
3503
|
+
y1: "6",
|
|
3504
|
+
x2: "6",
|
|
3505
|
+
y2: "18"
|
|
3506
|
+
}),
|
|
3507
|
+
e("line", {
|
|
3508
|
+
x1: "6",
|
|
3509
|
+
y1: "6",
|
|
3510
|
+
x2: "18",
|
|
3511
|
+
y2: "18"
|
|
3512
|
+
})
|
|
3513
|
+
], -1)
|
|
3514
|
+
])], 8, Va)
|
|
3515
|
+
]);
|
|
3516
|
+
}), 128))
|
|
3517
|
+
])
|
|
3518
|
+
])) : M("", !0)
|
|
3519
|
+
], 64)) : (s(), l("div", Ha, [...t[82] || (t[82] = [
|
|
3520
|
+
e("label", { class: "field-label" }, "Available Tools", -1),
|
|
3521
|
+
e("p", { class: "field-hint" }, " No tools are registered. Add tools in or3-chat to enable selections here. ", -1)
|
|
3522
|
+
])]))
|
|
3523
|
+
])) : M("", !0),
|
|
3524
|
+
v.value === "errors" && V.value ? (s(), l("div", ja, [
|
|
3525
|
+
t[87] || (t[87] = e("label", { class: "field-label" }, "Error handling mode", -1)),
|
|
3526
|
+
e("div", za, [
|
|
3527
|
+
e("button", {
|
|
3528
|
+
class: P(["mode-button", { active: re.value.mode === "stop" }]),
|
|
3529
|
+
onClick: t[18] || (t[18] = (p) => Ye("stop"))
|
|
3530
|
+
}, " Stop on error ", 2),
|
|
3531
|
+
e("button", {
|
|
3532
|
+
class: P(["mode-button", { active: re.value.mode === "continue" }]),
|
|
3533
|
+
onClick: t[19] || (t[19] = (p) => Ye("continue"))
|
|
3534
|
+
}, " Continue ", 2),
|
|
3535
|
+
e("button", {
|
|
3536
|
+
class: P(["mode-button", { active: re.value.mode === "branch" }]),
|
|
3537
|
+
onClick: t[20] || (t[20] = (p) => Ye("branch"))
|
|
3538
|
+
}, " Branch to error ", 2)
|
|
3539
|
+
]),
|
|
3540
|
+
e("div", Ua, [
|
|
3541
|
+
e("div", Wa, [
|
|
3542
|
+
t[83] || (t[83] = e("label", { class: "field-label" }, "Max retries", -1)),
|
|
3543
|
+
e("input", {
|
|
3544
|
+
type: "number",
|
|
3545
|
+
min: "0",
|
|
3546
|
+
class: "text-input",
|
|
3547
|
+
value: _e.value.maxRetries,
|
|
3548
|
+
onInput: t[21] || (t[21] = (p) => Xe("maxRetries", p))
|
|
3549
|
+
}, null, 40, Fa)
|
|
3550
|
+
]),
|
|
3551
|
+
e("div", Ka, [
|
|
3552
|
+
t[84] || (t[84] = e("label", { class: "field-label" }, "Base delay (ms)", -1)),
|
|
3553
|
+
e("input", {
|
|
3554
|
+
type: "number",
|
|
3555
|
+
min: "0",
|
|
3556
|
+
class: "text-input",
|
|
3557
|
+
value: _e.value.baseDelay,
|
|
3558
|
+
onInput: t[22] || (t[22] = (p) => Xe("baseDelay", p))
|
|
3559
|
+
}, null, 40, qa)
|
|
3560
|
+
]),
|
|
3561
|
+
e("div", Ga, [
|
|
3562
|
+
t[85] || (t[85] = e("label", { class: "field-label" }, "Max delay (ms)", -1)),
|
|
3563
|
+
e("input", {
|
|
3564
|
+
type: "number",
|
|
3565
|
+
min: "0",
|
|
3566
|
+
class: "text-input",
|
|
3567
|
+
value: _e.value.maxDelay ?? "",
|
|
3568
|
+
onInput: t[23] || (t[23] = (p) => Xe("maxDelay", p))
|
|
3569
|
+
}, null, 40, Ya)
|
|
3570
|
+
])
|
|
3571
|
+
]),
|
|
3572
|
+
e("div", Xa, [
|
|
3573
|
+
t[86] || (t[86] = e("label", { class: "field-label" }, "Retry on codes", -1)),
|
|
3574
|
+
e("div", Ja, [
|
|
3575
|
+
(s(), l(K, null, Q(Nt, (p) => e("label", {
|
|
3576
|
+
key: p.id,
|
|
3577
|
+
class: "checkbox-item"
|
|
3578
|
+
}, [
|
|
3579
|
+
e("input", {
|
|
3580
|
+
type: "checkbox",
|
|
3581
|
+
checked: (_e.value.retryOn || []).includes(
|
|
3582
|
+
p.id
|
|
3583
|
+
),
|
|
3584
|
+
onChange: (F) => Bt(p.id)
|
|
3585
|
+
}, null, 40, Qa),
|
|
3586
|
+
e("span", null, y(p.label), 1)
|
|
3587
|
+
])), 64))
|
|
3588
|
+
])
|
|
3589
|
+
]),
|
|
3590
|
+
t[88] || (t[88] = e("p", { class: "field-hint" }, ' Branch mode sends errors to the "error" handle if connected. Continue mode logs the error and moves forward. ', -1))
|
|
3591
|
+
])) : M("", !0),
|
|
3592
|
+
v.value === "hitl" && z.value ? (s(), l("div", Za, [
|
|
3593
|
+
e("div", ei, [
|
|
3594
|
+
e("label", ti, [
|
|
3595
|
+
e("input", {
|
|
3596
|
+
type: "checkbox",
|
|
3597
|
+
checked: me.value.enabled,
|
|
3598
|
+
onChange: Ht
|
|
3599
|
+
}, null, 40, oi),
|
|
3600
|
+
t[89] || (t[89] = e("span", { class: "toggle-text" }, "Enable Human Review", -1))
|
|
3601
|
+
]),
|
|
3602
|
+
t[90] || (t[90] = e("p", {
|
|
3603
|
+
class: "field-hint",
|
|
3604
|
+
style: { "margin-top": "4px" }
|
|
3605
|
+
}, " Pause execution for human approval, input, or review. ", -1))
|
|
3606
|
+
]),
|
|
3607
|
+
me.value.enabled ? (s(), l(K, { key: 0 }, [
|
|
3608
|
+
e("div", si, [
|
|
3609
|
+
t[91] || (t[91] = e("label", { class: "field-label" }, "Review Mode", -1)),
|
|
3610
|
+
e("div", ni, [
|
|
3611
|
+
(s(), l(K, null, Q(Je, (p) => e("button", {
|
|
3612
|
+
key: p.id,
|
|
3613
|
+
class: P(["mode-button hitl-mode", { active: me.value.mode === p.id }]),
|
|
3614
|
+
onClick: (F) => jt(p.id),
|
|
3615
|
+
title: p.description
|
|
3616
|
+
}, y(p.label), 11, li)), 64))
|
|
3617
|
+
]),
|
|
3618
|
+
e("p", ai, y((R = Je.find((p) => p.id === me.value.mode)) == null ? void 0 : R.description), 1)
|
|
3619
|
+
]),
|
|
3620
|
+
e("div", ii, [
|
|
3621
|
+
t[92] || (t[92] = e("label", { class: "field-label" }, "Prompt", -1)),
|
|
3622
|
+
e("textarea", {
|
|
3623
|
+
value: me.value.prompt || "",
|
|
3624
|
+
class: "prompt-textarea hitl-prompt",
|
|
3625
|
+
placeholder: "Message to show the reviewer...",
|
|
3626
|
+
onInput: zt
|
|
3627
|
+
}, null, 40, ri)
|
|
3628
|
+
]),
|
|
3629
|
+
e("div", di, [
|
|
3630
|
+
e("div", ui, [
|
|
3631
|
+
t[93] || (t[93] = e("label", { class: "field-label" }, "Timeout (ms)", -1)),
|
|
3632
|
+
e("input", {
|
|
3633
|
+
type: "number",
|
|
3634
|
+
min: "0",
|
|
3635
|
+
class: "text-input",
|
|
3636
|
+
value: me.value.timeout || "",
|
|
3637
|
+
placeholder: "No timeout",
|
|
3638
|
+
onInput: Ut
|
|
3639
|
+
}, null, 40, ci)
|
|
3640
|
+
]),
|
|
3641
|
+
e("div", vi, [
|
|
3642
|
+
t[94] || (t[94] = e("label", { class: "field-label" }, "Default Action", -1)),
|
|
3643
|
+
e("select", {
|
|
3644
|
+
class: "model-select",
|
|
3645
|
+
value: me.value.defaultAction || "reject",
|
|
3646
|
+
onChange: Wt
|
|
3647
|
+
}, [
|
|
3648
|
+
(s(), l(K, null, Q(St, (p) => e("option", {
|
|
3649
|
+
key: p.id,
|
|
3650
|
+
value: p.id
|
|
3651
|
+
}, y(p.label), 9, fi)), 64))
|
|
3652
|
+
], 40, pi)
|
|
3653
|
+
])
|
|
3654
|
+
]),
|
|
3655
|
+
t[95] || (t[95] = e("p", { class: "field-hint" }, ' When timeout is set, the default action is taken automatically. Connect the "Rejected" handle to route rejected items. ', -1))
|
|
3656
|
+
], 64)) : M("", !0)
|
|
3657
|
+
])) : M("", !0),
|
|
3658
|
+
v.value === "subflow" && h.value ? (s(), l("div", mi, [
|
|
3659
|
+
e("div", gi, [
|
|
3660
|
+
t[97] || (t[97] = e("label", { class: "field-label" }, "Subflow", -1)),
|
|
3661
|
+
e("select", {
|
|
3662
|
+
class: "model-select",
|
|
3663
|
+
value: B.value.subflowId,
|
|
3664
|
+
disabled: a.subflowListLoading,
|
|
3665
|
+
onChange: Kt
|
|
3666
|
+
}, [
|
|
3667
|
+
e("option", yi, y(a.subflowListLoading ? "Loading workflows..." : "Select a workflow..."), 1),
|
|
3668
|
+
(s(!0), l(K, null, Q(C.value, (p) => (s(), l("option", {
|
|
3669
|
+
key: p.id,
|
|
3670
|
+
value: p.id
|
|
3671
|
+
}, y(p.name) + " (" + y(p.id) + ") ", 9, wi))), 128))
|
|
3672
|
+
], 40, hi),
|
|
3673
|
+
a.subflowListLoading ? (s(), l("p", bi, " Loading available workflows... ")) : a.subflowListError ? (s(), l("p", _i, " Unable to load workflows. You can still enter a subflow ID manually. ")) : _.value.length === 0 ? (s(), l("p", ki, " No workflows found yet. Create one in the Workflows tab or enter an ID manually. ")) : (s(), l("p", xi, y(((j = oe.value) == null ? void 0 : j.description) || "Choose a workflow to run inside this node."), 1)),
|
|
3674
|
+
B.value.subflowId ? (s(), l("div", $i, [
|
|
3675
|
+
t[96] || (t[96] = e("span", { class: "model-id-label" }, "Workflow ID:", -1)),
|
|
3676
|
+
e("code", null, y(B.value.subflowId), 1)
|
|
3677
|
+
])) : M("", !0),
|
|
3678
|
+
e("button", {
|
|
3679
|
+
class: "subflow-manual-toggle",
|
|
3680
|
+
type: "button",
|
|
3681
|
+
onClick: qt
|
|
3682
|
+
}, y(J.value ? "Hide manual entry" : "Enter ID manually"), 1)
|
|
3683
|
+
]),
|
|
3684
|
+
J.value ? (s(), l("div", Ii, [
|
|
3685
|
+
t[98] || (t[98] = e("label", { class: "field-label" }, "Subflow ID", -1)),
|
|
3686
|
+
e("input", {
|
|
3687
|
+
type: "text",
|
|
3688
|
+
class: "text-input",
|
|
3689
|
+
value: B.value.subflowId,
|
|
3690
|
+
placeholder: "e.g., email-composer",
|
|
3691
|
+
onInput: Ft
|
|
3692
|
+
}, null, 40, Mi),
|
|
3693
|
+
t[99] || (t[99] = e("p", { class: "field-hint" }, " Use this only if the workflow isn't listed. ", -1))
|
|
3694
|
+
])) : M("", !0),
|
|
3695
|
+
e("div", Di, [
|
|
3696
|
+
e("label", Si, [
|
|
3697
|
+
e("input", {
|
|
3698
|
+
type: "checkbox",
|
|
3699
|
+
checked: B.value.shareSession,
|
|
3700
|
+
onChange: Gt
|
|
3701
|
+
}, null, 40, Ni),
|
|
3702
|
+
t[100] || (t[100] = e("span", { class: "toggle-text" }, "Share Session", -1))
|
|
3703
|
+
]),
|
|
3704
|
+
t[101] || (t[101] = e("p", {
|
|
3705
|
+
class: "field-hint",
|
|
3706
|
+
style: { "margin-top": "4px" }
|
|
3707
|
+
}, " When enabled, the subflow shares conversation history with the parent workflow. ", -1))
|
|
3708
|
+
]),
|
|
3709
|
+
Object.keys(B.value.inputMappings).length > 0 ? (s(), l("div", Ti, [
|
|
3710
|
+
t[102] || (t[102] = e("label", { class: "field-label" }, "Input Mappings", -1)),
|
|
3711
|
+
e("div", Ci, [
|
|
3712
|
+
(s(!0), l(K, null, Q(B.value.inputMappings, (p, F) => (s(), l("div", {
|
|
3713
|
+
key: F,
|
|
3714
|
+
class: "mapping-item"
|
|
3715
|
+
}, [
|
|
3716
|
+
e("span", Ei, y(F), 1),
|
|
3717
|
+
e("input", {
|
|
3718
|
+
type: "text",
|
|
3719
|
+
class: "text-input mapping-value",
|
|
3720
|
+
value: String(p),
|
|
3721
|
+
onInput: (xe) => Yt(String(F), xe.target.value)
|
|
3722
|
+
}, null, 40, Bi),
|
|
3723
|
+
e("button", {
|
|
3724
|
+
class: "remove-mapping-btn",
|
|
3725
|
+
onClick: (xe) => Xt(String(F)),
|
|
3726
|
+
title: "Remove mapping"
|
|
3727
|
+
}, " × ", 8, Oi)
|
|
3728
|
+
]))), 128))
|
|
3729
|
+
])
|
|
3730
|
+
])) : M("", !0),
|
|
3731
|
+
t[103] || (t[103] = e("div", { class: "info-box" }, [
|
|
3732
|
+
e("p", null, [
|
|
3733
|
+
e("strong", null, "Expressions:")
|
|
3734
|
+
]),
|
|
3735
|
+
e("ul", { class: "expression-hints" }, [
|
|
3736
|
+
e("li", null, [
|
|
3737
|
+
e("code", null, "{{ output }}"),
|
|
3738
|
+
Y(" - Current input/output ")
|
|
3739
|
+
]),
|
|
3740
|
+
e("li", null, [
|
|
3741
|
+
e("code", null, "{{ outputs.nodeId }}"),
|
|
3742
|
+
Y(" - Output from a specific node ")
|
|
3743
|
+
]),
|
|
3744
|
+
e("li", null, [
|
|
3745
|
+
e("code", null, '"literal"'),
|
|
3746
|
+
Y(" - Static value")
|
|
3747
|
+
])
|
|
3748
|
+
])
|
|
3749
|
+
], -1))
|
|
3750
|
+
])) : M("", !0),
|
|
3751
|
+
v.value === "output" && c.value ? (s(), l("div", Li, [
|
|
3752
|
+
A(Mn, {
|
|
3753
|
+
modelValue: X.value.mode || "combine",
|
|
3754
|
+
"onUpdate:modelValue": Ue
|
|
3755
|
+
}, null, 8, ["modelValue"]),
|
|
3756
|
+
A(qn, {
|
|
3757
|
+
modelValue: X.value.sources || [],
|
|
3758
|
+
availableGroups: O(je),
|
|
3759
|
+
"onUpdate:modelValue": We
|
|
3760
|
+
}, null, 8, ["modelValue", "availableGroups"]),
|
|
3761
|
+
X.value.mode === "synthesis" ? (s(), l("div", Ri, [
|
|
3762
|
+
e("div", Pi, [
|
|
3763
|
+
t[104] || (t[104] = e("label", { class: "field-label" }, "Synthesis Model", -1)),
|
|
3764
|
+
e("select", {
|
|
3765
|
+
class: "model-select",
|
|
3766
|
+
value: ((pe = X.value.synthesis) == null ? void 0 : pe.model) || "z-ai/glm-4.6:exacto",
|
|
3767
|
+
onChange: De
|
|
3768
|
+
}, [
|
|
3769
|
+
(s(!0), l(K, null, Q(I.value, (p) => (s(), l("option", {
|
|
3770
|
+
key: p.id,
|
|
3771
|
+
value: p.id
|
|
3772
|
+
}, y(p.name) + " (" + y(p.provider) + ") ", 9, Vi))), 128))
|
|
3773
|
+
], 40, Ai)
|
|
3774
|
+
]),
|
|
3775
|
+
e("div", Hi, [
|
|
3776
|
+
t[105] || (t[105] = e("label", { class: "field-label" }, "Synthesis Prompt", -1)),
|
|
3777
|
+
e("textarea", {
|
|
3778
|
+
class: "prompt-textarea",
|
|
3779
|
+
value: ((Z = X.value.synthesis) == null ? void 0 : Z.prompt) || "",
|
|
3780
|
+
placeholder: "Instructions for synthesizing the final output...",
|
|
3781
|
+
rows: "4",
|
|
3782
|
+
onInput: qe
|
|
3783
|
+
}, null, 40, ji)
|
|
3784
|
+
])
|
|
3785
|
+
])) : M("", !0),
|
|
3786
|
+
e("div", zi, [
|
|
3787
|
+
t[106] || (t[106] = e("label", { class: "field-label" }, "Introduction", -1)),
|
|
3788
|
+
e("textarea", {
|
|
3789
|
+
class: "text-input",
|
|
3790
|
+
value: X.value.introText || "",
|
|
3791
|
+
placeholder: "Optional text to prepend...",
|
|
3792
|
+
rows: "2",
|
|
3793
|
+
onInput: Fe
|
|
3794
|
+
}, null, 40, Ui)
|
|
3795
|
+
]),
|
|
3796
|
+
e("div", Wi, [
|
|
3797
|
+
t[107] || (t[107] = e("label", { class: "field-label" }, "Conclusion", -1)),
|
|
3798
|
+
e("textarea", {
|
|
3799
|
+
class: "text-input",
|
|
3800
|
+
value: X.value.outroText || "",
|
|
3801
|
+
placeholder: "Optional text to append...",
|
|
3802
|
+
rows: "2",
|
|
3803
|
+
onInput: Ke
|
|
3804
|
+
}, null, 40, Fi)
|
|
3805
|
+
]),
|
|
3806
|
+
A(el, { previewData: O(ze) }, null, 8, ["previewData"]),
|
|
3807
|
+
e("div", Ki, [
|
|
3808
|
+
e("button", {
|
|
3809
|
+
class: "advanced-toggle",
|
|
3810
|
+
onClick: t[24] || (t[24] = (p) => ce.value = !ce.value)
|
|
3811
|
+
}, [
|
|
3812
|
+
(s(), l("svg", {
|
|
3813
|
+
class: P(["expand-icon", { rotated: ce.value }]),
|
|
3814
|
+
viewBox: "0 0 24 24",
|
|
3815
|
+
fill: "none",
|
|
3816
|
+
stroke: "currentColor",
|
|
3817
|
+
"stroke-width": "2"
|
|
3818
|
+
}, [...t[108] || (t[108] = [
|
|
3819
|
+
e("polyline", { points: "6 9 12 15 18 9" }, null, -1)
|
|
3820
|
+
])], 2)),
|
|
3821
|
+
t[109] || (t[109] = Y(" Advanced Settings ", -1))
|
|
3822
|
+
]),
|
|
3823
|
+
ce.value ? (s(), l("div", qi, [
|
|
3824
|
+
e("div", Gi, [
|
|
3825
|
+
e("label", Yi, [
|
|
3826
|
+
e("input", {
|
|
3827
|
+
type: "checkbox",
|
|
3828
|
+
checked: X.value.useRawTemplate,
|
|
3829
|
+
onChange: Se
|
|
3830
|
+
}, null, 40, Xi),
|
|
3831
|
+
t[110] || (t[110] = e("div", { class: "tool-info" }, [
|
|
3832
|
+
e("span", { class: "tool-name" }, "Use Raw Template"),
|
|
3833
|
+
e("span", { class: "tool-description" }, "Override all settings with a custom template")
|
|
3834
|
+
], -1))
|
|
3835
|
+
]),
|
|
3836
|
+
e("label", Ji, [
|
|
3837
|
+
e("input", {
|
|
3838
|
+
type: "checkbox",
|
|
3839
|
+
checked: X.value.includeMetadata,
|
|
3840
|
+
onChange: Ge
|
|
3841
|
+
}, null, 40, Qi),
|
|
3842
|
+
t[111] || (t[111] = e("div", { class: "tool-info" }, [
|
|
3843
|
+
e("span", { class: "tool-name" }, "Include Metadata"),
|
|
3844
|
+
e("span", { class: "tool-description" }, "Add execution stats to output")
|
|
3845
|
+
], -1))
|
|
3846
|
+
])
|
|
3847
|
+
]),
|
|
3848
|
+
X.value.useRawTemplate ? (s(), l("div", Zi, [
|
|
3849
|
+
t[112] || (t[112] = e("label", { class: "field-label" }, "Raw Template", -1)),
|
|
3850
|
+
e("textarea", {
|
|
3851
|
+
class: "textarea-input",
|
|
3852
|
+
value: X.value.template,
|
|
3853
|
+
placeholder: "e.g., Final result: {{outputs.nodeId}}",
|
|
3854
|
+
onInput: w,
|
|
3855
|
+
rows: "4"
|
|
3856
|
+
}, null, 40, er)
|
|
3857
|
+
])) : M("", !0)
|
|
3858
|
+
])) : M("", !0)
|
|
3859
|
+
])
|
|
3860
|
+
])) : M("", !0)
|
|
3861
|
+
])) : M("", !0),
|
|
3862
|
+
b.value ? (s(), l("div", tr, [...t[113] || (t[113] = [
|
|
3863
|
+
e("div", { class: "info-box" }, " The Start node is the entry point for workflow execution. Connect it to other nodes to define your workflow. ", -1)
|
|
3864
|
+
])])) : M("", !0)
|
|
3865
|
+
])) : (s(), l("div", or, [...t[114] || (t[114] = [
|
|
3866
|
+
e("div", { class: "empty-icon" }, [
|
|
3867
|
+
e("svg", {
|
|
3868
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3869
|
+
width: "32",
|
|
3870
|
+
height: "32",
|
|
3871
|
+
viewBox: "0 0 24 24"
|
|
3872
|
+
}, [
|
|
3873
|
+
e("path", {
|
|
3874
|
+
fill: "none",
|
|
3875
|
+
stroke: "currentColor",
|
|
3876
|
+
"stroke-linecap": "round",
|
|
3877
|
+
"stroke-linejoin": "round",
|
|
3878
|
+
"stroke-width": "2",
|
|
3879
|
+
d: "m12 18l-2-4l-7-3.5a.55.55 0 0 1 0-1L21 3l-3.14 8.697M17.001 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m2-3.5V17m0 4v1.5m3.031-5.25l-1.299.75m-3.463 2l-1.3.75m0-3.5l1.3.75m3.463 2l1.3.75"
|
|
3880
|
+
})
|
|
3881
|
+
])
|
|
3882
|
+
], -1),
|
|
3883
|
+
e("p", null, "Select a node to edit its properties", -1)
|
|
3884
|
+
])]));
|
|
3885
|
+
};
|
|
3886
|
+
}
|
|
3887
|
+
}), nd = /* @__PURE__ */ G(sr, [["__scopeId", "data-v-2de5c749"]]), nr = { class: "chat-panel" }, lr = {
|
|
3888
|
+
key: 0,
|
|
3889
|
+
class: "empty-state"
|
|
3890
|
+
}, ar = { class: "message-avatar" }, ir = {
|
|
3891
|
+
key: 0,
|
|
3892
|
+
viewBox: "0 0 24 24",
|
|
3893
|
+
fill: "none",
|
|
3894
|
+
stroke: "currentColor",
|
|
3895
|
+
"stroke-width": "2"
|
|
3896
|
+
}, rr = {
|
|
3897
|
+
key: 1,
|
|
3898
|
+
viewBox: "0 0 24 24",
|
|
3899
|
+
fill: "none",
|
|
3900
|
+
stroke: "currentColor",
|
|
3901
|
+
"stroke-width": "2"
|
|
3902
|
+
}, dr = { class: "message-body" }, ur = {
|
|
3903
|
+
key: 0,
|
|
3904
|
+
class: "tool-calls"
|
|
3905
|
+
}, cr = { class: "tool-name" }, vr = {
|
|
3906
|
+
key: 1,
|
|
3907
|
+
class: "message-content"
|
|
3908
|
+
}, pr = {
|
|
3909
|
+
key: 2,
|
|
3910
|
+
class: "message-meta"
|
|
3911
|
+
}, fr = {
|
|
3912
|
+
key: 1,
|
|
3913
|
+
class: "message assistant streaming"
|
|
3914
|
+
}, mr = { class: "message-body" }, gr = { class: "message-content" }, hr = { class: "input-area" }, yr = ["disabled"], wr = ["disabled"], br = {
|
|
3915
|
+
key: 0,
|
|
3916
|
+
class: "spinner",
|
|
3917
|
+
viewBox: "0 0 24 24",
|
|
3918
|
+
fill: "none",
|
|
3919
|
+
stroke: "currentColor",
|
|
3920
|
+
"stroke-width": "2"
|
|
3921
|
+
}, _r = {
|
|
3922
|
+
key: 1,
|
|
3923
|
+
viewBox: "0 0 24 24",
|
|
3924
|
+
fill: "none",
|
|
3925
|
+
stroke: "currentColor",
|
|
3926
|
+
"stroke-width": "2"
|
|
3927
|
+
}, kr = /* @__PURE__ */ te({
|
|
3928
|
+
__name: "ChatPanel",
|
|
3929
|
+
props: {
|
|
3930
|
+
messages: {},
|
|
3931
|
+
streamingContent: {},
|
|
3932
|
+
executionState: {}
|
|
3933
|
+
},
|
|
3934
|
+
emits: ["send", "clear"],
|
|
3935
|
+
setup(a, { emit: d }) {
|
|
3936
|
+
const r = a, u = d;
|
|
3937
|
+
let i = null;
|
|
3938
|
+
const x = () => r.executionState ? r.executionState : (i || (i = mo()), i), n = $(() => x()), v = $(() => n.value.state), D = () => n.value.reset(), _ = H(""), I = H(null);
|
|
3939
|
+
de(() => {
|
|
3940
|
+
var U;
|
|
3941
|
+
return (U = r.messages) == null ? void 0 : U.length;
|
|
3942
|
+
}, async () => {
|
|
3943
|
+
await Pe(), f();
|
|
3944
|
+
}), de(() => r.streamingContent, async () => {
|
|
3945
|
+
await Pe(), f();
|
|
3946
|
+
});
|
|
3947
|
+
const f = () => {
|
|
3948
|
+
I.value && (I.value.scrollTop = I.value.scrollHeight);
|
|
3949
|
+
}, k = () => {
|
|
3950
|
+
!_.value.trim() || v.value.value.isRunning || (u("send", _.value.trim()), _.value = "");
|
|
3951
|
+
}, L = () => {
|
|
3952
|
+
D(), u("clear");
|
|
3953
|
+
}, m = (U) => {
|
|
3954
|
+
U.key === "Enter" && !U.shiftKey && (U.preventDefault(), k());
|
|
3955
|
+
};
|
|
3956
|
+
return (U, g) => {
|
|
3957
|
+
var S;
|
|
3958
|
+
return s(), l("div", nr, [
|
|
3959
|
+
e("div", { class: "chat-header" }, [
|
|
3960
|
+
g[1] || (g[1] = e("div", { class: "header-title" }, [
|
|
3961
|
+
e("svg", {
|
|
3962
|
+
class: "sparkle-icon",
|
|
3963
|
+
viewBox: "0 0 24 24",
|
|
3964
|
+
fill: "none",
|
|
3965
|
+
stroke: "currentColor",
|
|
3966
|
+
"stroke-width": "2"
|
|
3967
|
+
}, [
|
|
3968
|
+
e("path", { d: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707" }),
|
|
3969
|
+
e("circle", {
|
|
3970
|
+
cx: "12",
|
|
3971
|
+
cy: "12",
|
|
3972
|
+
r: "4"
|
|
3973
|
+
})
|
|
3974
|
+
]),
|
|
3975
|
+
e("span", null, "Workflow Chat")
|
|
3976
|
+
], -1)),
|
|
3977
|
+
e("button", {
|
|
3978
|
+
onClick: L,
|
|
3979
|
+
class: "clear-btn"
|
|
3980
|
+
}, "Clear")
|
|
3981
|
+
]),
|
|
3982
|
+
e("div", {
|
|
3983
|
+
class: "messages",
|
|
3984
|
+
ref_key: "messagesContainer",
|
|
3985
|
+
ref: I
|
|
3986
|
+
}, [
|
|
3987
|
+
(S = a.messages) != null && S.length ? M("", !0) : (s(), l("div", lr, [...g[2] || (g[2] = [
|
|
3988
|
+
e("svg", {
|
|
3989
|
+
viewBox: "0 0 24 24",
|
|
3990
|
+
fill: "none",
|
|
3991
|
+
stroke: "currentColor",
|
|
3992
|
+
"stroke-width": "1.5"
|
|
3993
|
+
}, [
|
|
3994
|
+
e("rect", {
|
|
3995
|
+
x: "3",
|
|
3996
|
+
y: "11",
|
|
3997
|
+
width: "18",
|
|
3998
|
+
height: "10",
|
|
3999
|
+
rx: "2"
|
|
4000
|
+
}),
|
|
4001
|
+
e("circle", {
|
|
4002
|
+
cx: "12",
|
|
4003
|
+
cy: "5",
|
|
4004
|
+
r: "2"
|
|
4005
|
+
}),
|
|
4006
|
+
e("path", { d: "M12 7v4" })
|
|
4007
|
+
], -1),
|
|
4008
|
+
e("p", null, "Send a message to start the workflow", -1)
|
|
4009
|
+
])])),
|
|
4010
|
+
(s(!0), l(K, null, Q(a.messages, (b, h) => (s(), l("div", {
|
|
4011
|
+
key: h,
|
|
4012
|
+
class: P(["message", b.role])
|
|
4013
|
+
}, [
|
|
4014
|
+
e("div", ar, [
|
|
4015
|
+
b.role === "user" ? (s(), l("svg", ir, [...g[3] || (g[3] = [
|
|
4016
|
+
e("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }, null, -1),
|
|
4017
|
+
e("circle", {
|
|
4018
|
+
cx: "12",
|
|
4019
|
+
cy: "7",
|
|
4020
|
+
r: "4"
|
|
4021
|
+
}, null, -1)
|
|
4022
|
+
])])) : (s(), l("svg", rr, [...g[4] || (g[4] = [
|
|
4023
|
+
e("rect", {
|
|
4024
|
+
x: "3",
|
|
4025
|
+
y: "11",
|
|
4026
|
+
width: "18",
|
|
4027
|
+
height: "10",
|
|
4028
|
+
rx: "2"
|
|
4029
|
+
}, null, -1),
|
|
4030
|
+
e("circle", {
|
|
4031
|
+
cx: "12",
|
|
4032
|
+
cy: "5",
|
|
4033
|
+
r: "2"
|
|
4034
|
+
}, null, -1),
|
|
4035
|
+
e("path", { d: "M12 7v4" }, null, -1)
|
|
4036
|
+
])]))
|
|
4037
|
+
]),
|
|
4038
|
+
e("div", dr, [
|
|
4039
|
+
b.toolCalls && b.toolCalls.length > 0 ? (s(), l("div", ur, [
|
|
4040
|
+
(s(!0), l(K, null, Q(b.toolCalls, (c, T) => (s(), l("div", {
|
|
4041
|
+
key: T,
|
|
4042
|
+
class: "tool-call"
|
|
4043
|
+
}, [
|
|
4044
|
+
g[5] || (g[5] = e("span", { class: "tool-icon" }, "🛠️", -1)),
|
|
4045
|
+
e("span", cr, "Used " + y(c.function.name), 1)
|
|
4046
|
+
]))), 128))
|
|
4047
|
+
])) : M("", !0),
|
|
4048
|
+
b.content ? (s(), l("div", vr, y(b.content), 1)) : M("", !0),
|
|
4049
|
+
b.nodeId ? (s(), l("div", pr, "via " + y(b.nodeId), 1)) : M("", !0)
|
|
4050
|
+
])
|
|
4051
|
+
], 2))), 128)),
|
|
4052
|
+
a.streamingContent || v.value.value.streamingContent ? (s(), l("div", fr, [
|
|
4053
|
+
g[7] || (g[7] = be('<div class="message-avatar" data-v-c2838e84><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c2838e84><rect x="3" y="11" width="18" height="10" rx="2" data-v-c2838e84></rect><circle cx="12" cy="5" r="2" data-v-c2838e84></circle><path d="M12 7v4" data-v-c2838e84></path></svg></div>', 1)),
|
|
4054
|
+
e("div", mr, [
|
|
4055
|
+
e("div", gr, [
|
|
4056
|
+
Y(y(a.streamingContent || v.value.value.streamingContent), 1),
|
|
4057
|
+
g[6] || (g[6] = e("span", { class: "cursor" }, "|", -1))
|
|
4058
|
+
])
|
|
4059
|
+
])
|
|
4060
|
+
])) : M("", !0)
|
|
4061
|
+
], 512),
|
|
4062
|
+
e("div", hr, [
|
|
4063
|
+
ut(e("textarea", {
|
|
4064
|
+
"onUpdate:modelValue": g[0] || (g[0] = (b) => _.value = b),
|
|
4065
|
+
onKeydown: m,
|
|
4066
|
+
placeholder: "Type a message...",
|
|
4067
|
+
disabled: v.value.value.isRunning,
|
|
4068
|
+
rows: "1"
|
|
4069
|
+
}, null, 40, yr), [
|
|
4070
|
+
[ct, _.value]
|
|
4071
|
+
]),
|
|
4072
|
+
e("button", {
|
|
4073
|
+
class: "send-btn",
|
|
4074
|
+
onClick: k,
|
|
4075
|
+
disabled: !_.value.trim() || v.value.value.isRunning
|
|
4076
|
+
}, [
|
|
4077
|
+
v.value.value.isRunning ? (s(), l("svg", br, [...g[8] || (g[8] = [
|
|
4078
|
+
e("path", { d: "M21 12a9 9 0 11-6.219-8.56" }, null, -1)
|
|
4079
|
+
])])) : (s(), l("svg", _r, [...g[9] || (g[9] = [
|
|
4080
|
+
e("line", {
|
|
4081
|
+
x1: "22",
|
|
4082
|
+
y1: "2",
|
|
4083
|
+
x2: "11",
|
|
4084
|
+
y2: "13"
|
|
4085
|
+
}, null, -1),
|
|
4086
|
+
e("polygon", { points: "22 2 15 22 11 13 2 9 22 2" }, null, -1)
|
|
4087
|
+
])]))
|
|
4088
|
+
], 8, wr)
|
|
4089
|
+
])
|
|
4090
|
+
]);
|
|
4091
|
+
};
|
|
4092
|
+
}
|
|
4093
|
+
}), ld = /* @__PURE__ */ G(kr, [["__scopeId", "data-v-c2838e84"]]), ad = /* @__PURE__ */ te({
|
|
4094
|
+
__name: "Controls",
|
|
4095
|
+
setup(a) {
|
|
4096
|
+
return (d, r) => (s(), ue(O(vt)));
|
|
4097
|
+
}
|
|
4098
|
+
}), id = /* @__PURE__ */ te({
|
|
4099
|
+
__name: "MiniMap",
|
|
4100
|
+
setup(a) {
|
|
4101
|
+
return (d, r) => (s(), ue(O(vo)));
|
|
4102
|
+
}
|
|
4103
|
+
}), xr = { class: "edge-editor" }, $r = { class: "editor-header" }, Ir = { class: "editor-content" }, Mr = {
|
|
4104
|
+
key: 0,
|
|
4105
|
+
class: "delete-confirm"
|
|
4106
|
+
}, Dr = /* @__PURE__ */ te({
|
|
4107
|
+
__name: "EdgeLabelEditor",
|
|
4108
|
+
props: {
|
|
4109
|
+
edge: {},
|
|
4110
|
+
show: { type: Boolean }
|
|
4111
|
+
},
|
|
4112
|
+
emits: ["close", "update", "delete"],
|
|
4113
|
+
setup(a, { emit: d }) {
|
|
4114
|
+
const r = a, u = d, i = H(""), x = H(null), n = H(!1);
|
|
4115
|
+
de(
|
|
4116
|
+
() => r.edge,
|
|
4117
|
+
(f) => {
|
|
4118
|
+
f && (i.value = f.label || "");
|
|
4119
|
+
},
|
|
4120
|
+
{ immediate: !0 }
|
|
4121
|
+
), de(
|
|
4122
|
+
() => r.show,
|
|
4123
|
+
(f) => {
|
|
4124
|
+
f && (n.value = !1, Pe(() => {
|
|
4125
|
+
var k, L;
|
|
4126
|
+
(k = x.value) == null || k.focus(), (L = x.value) == null || L.select();
|
|
4127
|
+
}));
|
|
4128
|
+
}
|
|
4129
|
+
);
|
|
4130
|
+
function v() {
|
|
4131
|
+
r.edge && u("update", r.edge.id, i.value);
|
|
4132
|
+
}
|
|
4133
|
+
function D(f) {
|
|
4134
|
+
f.key === "Enter" ? (v(), u("close")) : f.key === "Escape" && u("close");
|
|
4135
|
+
}
|
|
4136
|
+
function _() {
|
|
4137
|
+
r.edge && (n.value ? (u("delete", r.edge.id), n.value = !1) : n.value = !0);
|
|
4138
|
+
}
|
|
4139
|
+
function I() {
|
|
4140
|
+
n.value = !1;
|
|
4141
|
+
}
|
|
4142
|
+
return (f, k) => (s(), ue(so, { name: "modal" }, {
|
|
4143
|
+
default: le(() => [
|
|
4144
|
+
a.show && a.edge ? (s(), l("div", {
|
|
4145
|
+
key: 0,
|
|
4146
|
+
class: "edge-editor-overlay",
|
|
4147
|
+
onClick: k[2] || (k[2] = Ve((L) => u("close"), ["self"]))
|
|
4148
|
+
}, [
|
|
4149
|
+
e("div", xr, [
|
|
4150
|
+
e("div", $r, [
|
|
4151
|
+
k[4] || (k[4] = e("svg", {
|
|
4152
|
+
viewBox: "0 0 24 24",
|
|
4153
|
+
fill: "none",
|
|
4154
|
+
stroke: "currentColor",
|
|
4155
|
+
"stroke-width": "2",
|
|
4156
|
+
class: "header-icon"
|
|
4157
|
+
}, [
|
|
4158
|
+
e("path", { d: "M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z" }),
|
|
4159
|
+
e("path", { d: "M7 7h.01" })
|
|
4160
|
+
], -1)),
|
|
4161
|
+
k[5] || (k[5] = e("span", null, "Edge Label", -1)),
|
|
4162
|
+
e("button", {
|
|
4163
|
+
class: "close-btn",
|
|
4164
|
+
onClick: k[0] || (k[0] = (L) => u("close"))
|
|
4165
|
+
}, [...k[3] || (k[3] = [
|
|
4166
|
+
e("svg", {
|
|
4167
|
+
viewBox: "0 0 24 24",
|
|
4168
|
+
fill: "none",
|
|
4169
|
+
stroke: "currentColor",
|
|
4170
|
+
"stroke-width": "2"
|
|
4171
|
+
}, [
|
|
4172
|
+
e("line", {
|
|
4173
|
+
x1: "18",
|
|
4174
|
+
y1: "6",
|
|
4175
|
+
x2: "6",
|
|
4176
|
+
y2: "18"
|
|
4177
|
+
}),
|
|
4178
|
+
e("line", {
|
|
4179
|
+
x1: "6",
|
|
4180
|
+
y1: "6",
|
|
4181
|
+
x2: "18",
|
|
4182
|
+
y2: "18"
|
|
4183
|
+
})
|
|
4184
|
+
], -1)
|
|
4185
|
+
])])
|
|
4186
|
+
]),
|
|
4187
|
+
e("div", Ir, [
|
|
4188
|
+
ut(e("input", {
|
|
4189
|
+
ref_key: "inputRef",
|
|
4190
|
+
ref: x,
|
|
4191
|
+
"onUpdate:modelValue": k[1] || (k[1] = (L) => i.value = L),
|
|
4192
|
+
type: "text",
|
|
4193
|
+
class: "label-input",
|
|
4194
|
+
placeholder: "Enter edge label (e.g., 'Technical', 'Sales')",
|
|
4195
|
+
onInput: v,
|
|
4196
|
+
onKeydown: D
|
|
4197
|
+
}, null, 544), [
|
|
4198
|
+
[ct, i.value]
|
|
4199
|
+
]),
|
|
4200
|
+
k[8] || (k[8] = e("p", { class: "hint" }, " This label is shown on the connection line and helps the router make decisions. ", -1)),
|
|
4201
|
+
n.value ? (s(), l("div", Mr, [
|
|
4202
|
+
k[6] || (k[6] = e("span", null, "Delete this connection?", -1)),
|
|
4203
|
+
e("div", { class: "confirm-actions" }, [
|
|
4204
|
+
e("button", {
|
|
4205
|
+
class: "confirm-btn confirm-yes",
|
|
4206
|
+
onClick: _
|
|
4207
|
+
}, " Yes, delete "),
|
|
4208
|
+
e("button", {
|
|
4209
|
+
class: "confirm-btn confirm-no",
|
|
4210
|
+
onClick: I
|
|
4211
|
+
}, " Cancel ")
|
|
4212
|
+
])
|
|
4213
|
+
])) : (s(), l("button", {
|
|
4214
|
+
key: 1,
|
|
4215
|
+
class: "delete-btn",
|
|
4216
|
+
onClick: _
|
|
4217
|
+
}, [...k[7] || (k[7] = [
|
|
4218
|
+
e("svg", {
|
|
4219
|
+
viewBox: "0 0 24 24",
|
|
4220
|
+
fill: "none",
|
|
4221
|
+
stroke: "currentColor",
|
|
4222
|
+
"stroke-width": "2"
|
|
4223
|
+
}, [
|
|
4224
|
+
e("polyline", { points: "3 6 5 6 21 6" }),
|
|
4225
|
+
e("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
4226
|
+
], -1),
|
|
4227
|
+
Y(" Delete Connection ", -1)
|
|
4228
|
+
])]))
|
|
4229
|
+
])
|
|
4230
|
+
])
|
|
4231
|
+
])) : M("", !0)
|
|
4232
|
+
]),
|
|
4233
|
+
_: 1
|
|
4234
|
+
}));
|
|
4235
|
+
}
|
|
4236
|
+
}), rd = /* @__PURE__ */ G(Dr, [["__scopeId", "data-v-ad20c837"]]), Sr = { class: "title" }, Nr = { class: "header-actions" }, Tr = {
|
|
4237
|
+
key: 1,
|
|
4238
|
+
class: "header-count error"
|
|
4239
|
+
}, Cr = {
|
|
4240
|
+
key: 2,
|
|
4241
|
+
class: "header-count warning"
|
|
4242
|
+
}, Er = {
|
|
4243
|
+
key: 3,
|
|
4244
|
+
class: "header-count ok"
|
|
4245
|
+
}, Br = { class: "collapsible-inner" }, Or = { class: "summary" }, Lr = {
|
|
4246
|
+
key: 0,
|
|
4247
|
+
class: "count error"
|
|
4248
|
+
}, Rr = {
|
|
4249
|
+
key: 1,
|
|
4250
|
+
class: "count warning"
|
|
4251
|
+
}, Pr = {
|
|
4252
|
+
key: 2,
|
|
4253
|
+
class: "count ok"
|
|
4254
|
+
}, Ar = {
|
|
4255
|
+
key: 3,
|
|
4256
|
+
class: "timestamp"
|
|
4257
|
+
}, Vr = {
|
|
4258
|
+
key: 0,
|
|
4259
|
+
class: "issue-list"
|
|
4260
|
+
}, Hr = { class: "badge" }, jr = { class: "details" }, zr = { class: "message" }, Ur = {
|
|
4261
|
+
key: 0,
|
|
4262
|
+
class: "meta"
|
|
4263
|
+
}, Wr = {
|
|
4264
|
+
key: 1,
|
|
4265
|
+
class: "meta"
|
|
4266
|
+
}, Fr = /* @__PURE__ */ te({
|
|
4267
|
+
__name: "ValidationOverlay",
|
|
4268
|
+
props: {
|
|
4269
|
+
editor: {}
|
|
4270
|
+
},
|
|
4271
|
+
setup(a) {
|
|
4272
|
+
const d = a, r = H({
|
|
4273
|
+
isValid: !0,
|
|
4274
|
+
errors: [],
|
|
4275
|
+
warnings: []
|
|
4276
|
+
}), u = H(null), i = H(!0);
|
|
4277
|
+
let x = null, n = null;
|
|
4278
|
+
const v = () => {
|
|
4279
|
+
r.value = io(
|
|
4280
|
+
[...d.editor.getNodes()],
|
|
4281
|
+
[...d.editor.getEdges()]
|
|
4282
|
+
), u.value = Date.now();
|
|
4283
|
+
}, D = () => {
|
|
4284
|
+
n && clearTimeout(n), n = setTimeout(v, 120);
|
|
4285
|
+
};
|
|
4286
|
+
Re(() => {
|
|
4287
|
+
v(), x = d.editor.on("update", D);
|
|
4288
|
+
}), Ae(() => {
|
|
4289
|
+
x == null || x(), n && clearTimeout(n);
|
|
4290
|
+
});
|
|
4291
|
+
const _ = $(() => [
|
|
4292
|
+
...r.value.errors,
|
|
4293
|
+
...r.value.warnings
|
|
4294
|
+
]), I = $(() => _.value.length === 0), f = $(
|
|
4295
|
+
() => u.value ? new Date(u.value).toLocaleTimeString() : ""
|
|
4296
|
+
);
|
|
4297
|
+
return (k, L) => (s(), l("div", {
|
|
4298
|
+
class: P(["validation-overlay", { "has-issues": !I.value }])
|
|
4299
|
+
}, [
|
|
4300
|
+
e("div", {
|
|
4301
|
+
class: "overlay-header",
|
|
4302
|
+
onClick: L[0] || (L[0] = (m) => i.value = !i.value)
|
|
4303
|
+
}, [
|
|
4304
|
+
e("div", Sr, [
|
|
4305
|
+
e("span", {
|
|
4306
|
+
class: P(["status-dot", I.value ? "ok" : "warn"])
|
|
4307
|
+
}, null, 2),
|
|
4308
|
+
L[1] || (L[1] = e("span", null, "Validation", -1))
|
|
4309
|
+
]),
|
|
4310
|
+
e("div", Nr, [
|
|
4311
|
+
i.value ? M("", !0) : (s(), l("button", {
|
|
4312
|
+
key: 0,
|
|
4313
|
+
type: "button",
|
|
4314
|
+
class: "refresh",
|
|
4315
|
+
onClick: Ve(v, ["stop"])
|
|
4316
|
+
}, " Re-run ")),
|
|
4317
|
+
i.value && r.value.errors.length ? (s(), l("span", Tr, y(r.value.errors.length) + " error" + y(r.value.errors.length === 1 ? "" : "s"), 1)) : M("", !0),
|
|
4318
|
+
i.value && r.value.warnings.length ? (s(), l("span", Cr, y(r.value.warnings.length) + " warning" + y(r.value.warnings.length === 1 ? "" : "s"), 1)) : M("", !0),
|
|
4319
|
+
i.value && I.value ? (s(), l("span", Er, "All clear")) : M("", !0),
|
|
4320
|
+
(s(), l("svg", {
|
|
4321
|
+
class: P(["collapse-chevron", { expanded: !i.value }]),
|
|
4322
|
+
width: "12",
|
|
4323
|
+
height: "12",
|
|
4324
|
+
viewBox: "0 0 12 12",
|
|
4325
|
+
fill: "none"
|
|
4326
|
+
}, [...L[2] || (L[2] = [
|
|
4327
|
+
e("path", {
|
|
4328
|
+
d: "M3 4.5L6 7.5L9 4.5",
|
|
4329
|
+
stroke: "currentColor",
|
|
4330
|
+
"stroke-width": "1.5",
|
|
4331
|
+
"stroke-linecap": "round",
|
|
4332
|
+
"stroke-linejoin": "round"
|
|
4333
|
+
}, null, -1)
|
|
4334
|
+
])], 2))
|
|
4335
|
+
])
|
|
4336
|
+
]),
|
|
4337
|
+
e("div", {
|
|
4338
|
+
class: P(["collapsible-content", { collapsed: i.value }])
|
|
4339
|
+
}, [
|
|
4340
|
+
e("div", Br, [
|
|
4341
|
+
e("div", Or, [
|
|
4342
|
+
r.value.errors.length ? (s(), l("span", Lr, y(r.value.errors.length) + " error" + y(r.value.errors.length === 1 ? "" : "s"), 1)) : M("", !0),
|
|
4343
|
+
r.value.warnings.length ? (s(), l("span", Rr, y(r.value.warnings.length) + " warning" + y(r.value.warnings.length === 1 ? "" : "s"), 1)) : M("", !0),
|
|
4344
|
+
I.value ? (s(), l("span", Pr, "All clear")) : M("", !0),
|
|
4345
|
+
f.value ? (s(), l("span", Ar, " Updated " + y(f.value), 1)) : M("", !0)
|
|
4346
|
+
]),
|
|
4347
|
+
_.value.length ? (s(), l("div", Vr, [
|
|
4348
|
+
(s(!0), l(K, null, Q(_.value, (m) => (s(), l("div", {
|
|
4349
|
+
key: m.code + (m.nodeId || "") + (m.edgeId || "") + m.message,
|
|
4350
|
+
class: P(["issue", m.type])
|
|
4351
|
+
}, [
|
|
4352
|
+
e("span", Hr, y(m.type === "error" ? "Error" : "Warning"), 1),
|
|
4353
|
+
e("div", jr, [
|
|
4354
|
+
e("div", zr, y(m.message), 1),
|
|
4355
|
+
m.nodeId ? (s(), l("div", Ur, " Node: " + y(m.nodeId), 1)) : m.edgeId ? (s(), l("div", Wr, " Edge: " + y(m.edgeId), 1)) : M("", !0)
|
|
4356
|
+
])
|
|
4357
|
+
], 2))), 128))
|
|
4358
|
+
])) : M("", !0)
|
|
4359
|
+
])
|
|
4360
|
+
], 2)
|
|
4361
|
+
], 2));
|
|
4362
|
+
}
|
|
4363
|
+
}), dd = /* @__PURE__ */ G(Fr, [["__scopeId", "data-v-849827fb"]]);
|
|
4364
|
+
export {
|
|
4365
|
+
ld as ChatPanel,
|
|
4366
|
+
ad as Controls,
|
|
4367
|
+
rd as EdgeLabelEditor,
|
|
4368
|
+
id as MiniMap,
|
|
4369
|
+
nd as NodeInspector,
|
|
4370
|
+
sd as NodePalette,
|
|
4371
|
+
Ie as NodeWrapper,
|
|
4372
|
+
dd as ValidationOverlay,
|
|
4373
|
+
od as WorkflowCanvas,
|
|
4374
|
+
fo as createExecutionState,
|
|
4375
|
+
go as createNodeRegistry,
|
|
4376
|
+
ho as defaultNodeRegistry,
|
|
4377
|
+
vd as isAgentNodeData,
|
|
4378
|
+
pd as isOutputNodeData,
|
|
4379
|
+
fd as isParallelNodeData,
|
|
4380
|
+
md as isRouterNodeData,
|
|
4381
|
+
gd as isStartNodeData,
|
|
4382
|
+
Qr as useEditor,
|
|
4383
|
+
mo as useExecutionState,
|
|
4384
|
+
td as useNodeState,
|
|
4385
|
+
po as useWorkflowEditor,
|
|
4386
|
+
Zr as useWorkflowExecution,
|
|
4387
|
+
ed as useWorkflowStorage
|
|
4388
|
+
};
|