@oomol-lab/open-flow 0.1.0-alpha.13 → 0.1.0-alpha.15
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/browser/{createResourceDialog-CWD62rU0.js → createResourceDialog-DjNiIu_v.js} +169 -169
- package/dist/browser/{esm-C04lx1pd.js → esm-DNDXFYy8.js} +1 -1
- package/dist/browser/flow-authoring.js +103 -185
- package/dist/browser/{addNodeOptions-JRHMwVOl.js → flowChanges-B-JaKseF.js} +2697 -1725
- package/dist/browser/{flowWorkspace-_qaqIyDi.js → flowWorkspace-nnM1b6Wz.js} +10501 -10485
- package/dist/browser/{typeScriptSession-D5neIpug.js → typeScriptSession-mPCiA9sV.js} +241 -222
- package/dist/browser/{useOpenInteractionType-CRgOHg5M.js → useOpenInteractionType-BmBaSEl4.js} +1255 -1028
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +1086 -2034
- package/package.json +1 -1
- package/dist/browser/change-BATEvjif.js +0 -229
|
@@ -21,96 +21,22 @@ var e = (e) => crypto.getRandomValues(new Uint8Array(e)), t = (e, t, n) => {
|
|
|
21
21
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
}, n = (n, r = 21) => t(n, r | 0, e), r =
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
if (n < 0) return e;
|
|
28
|
-
let a = e.indexOf(`\n${i}`, n);
|
|
29
|
-
if (a < 0) return e;
|
|
30
|
-
let o = e.indexOf("\n", a + 1);
|
|
31
|
-
return o < 0 && (o = e.length), `${e.slice(0, n)}${r}\n${t}${i}${e.slice(o)}`;
|
|
32
|
-
}
|
|
33
|
-
function o(e, t, n) {
|
|
34
|
-
return e === "typescript" ? d(t, n) + "\n" : f(t, n) + "\n";
|
|
35
|
-
}
|
|
36
|
-
var s = /* @__PURE__ */ new Set(["color", "text"]), c = (e) => e.includes(" | ") ? `(${e})` : e;
|
|
37
|
-
function l(e) {
|
|
38
|
-
return !e || typeof e != "object" ? !1 : e.contentMediaType === "oomol/artifact" ? !0 : Array.isArray(e.anyOf) ? e.anyOf.some(l) : e.type === "object" ? Object.values(e.properties || {}).some(l) : e.type === "array" && l(e.items);
|
|
39
|
-
}
|
|
40
|
-
function u(e, t) {
|
|
41
|
-
return [...e, ...t].some((e) => l(e.json_schema));
|
|
42
|
-
}
|
|
43
|
-
function d(e = [], t = []) {
|
|
44
|
-
let n = ["type Inputs = {"];
|
|
45
|
-
for (let t of e) n.push(` ${t.handle}: ${p(t.json_schema, t.nullable)};`);
|
|
46
|
-
n.push("};"), n.push("type Outputs = {");
|
|
47
|
-
for (let e of t) n.push(` ${e.handle}: ${p(e.json_schema, e.nullable)};`);
|
|
48
|
-
return n.push("};"), u(e, t) && n.unshift("import type { ArtifactRef } from '@oomol-lab/open-flow'", ""), n.join("\n");
|
|
24
|
+
}, n = (n, r = 21) => t(n, r | 0, e), r = class extends Error {};
|
|
25
|
+
function i() {
|
|
26
|
+
throw new r();
|
|
49
27
|
}
|
|
50
|
-
function
|
|
51
|
-
let n = ["@typedef {{"];
|
|
52
|
-
for (let t of e) n.push(` ${t.handle}: ${p(t.json_schema, t.nullable)};`);
|
|
53
|
-
n.push("}} Inputs;"), n.push("@typedef {{");
|
|
54
|
-
for (let e of t) n.push(` ${e.handle}: ${p(e.json_schema, e.nullable)};`);
|
|
55
|
-
n.push("}} Outputs;"), u(e, t) && n.unshift("@import { ArtifactRef } from \"@oomol-lab/open-flow\"");
|
|
56
|
-
let r = n.map((e) => ` * ${e}`);
|
|
57
|
-
return r.unshift("/**"), r.push(" */"), r.join("\n");
|
|
58
|
-
}
|
|
59
|
-
function p(e, t) {
|
|
60
|
-
if (!e) return "any";
|
|
61
|
-
switch (e.contentMediaType) {
|
|
62
|
-
case "oomol/bin": return t ? "Uint8Array | null" : "Uint8Array";
|
|
63
|
-
case "oomol/artifact": return t ? "ArtifactRef | null" : "ArtifactRef";
|
|
64
|
-
}
|
|
65
|
-
if (s.has(e["ui:widget"])) return t ? "string | null" : "string";
|
|
66
|
-
if (Array.isArray(e.anyOf)) return m((t ? e.anyOf.concat({ type: "null" }) : e.anyOf).map((e) => c(p(e, !1)))) || "any";
|
|
67
|
-
if (Array.isArray(e.enum)) return m((t ? e.enum.concat(null) : e.enum).map((e) => JSON.stringify(e))) || "any";
|
|
68
|
-
switch (e.type) {
|
|
69
|
-
case "null": return "null";
|
|
70
|
-
case "boolean": return t ? "boolean | null" : "boolean";
|
|
71
|
-
case "integer":
|
|
72
|
-
case "number": return t ? "number | null" : "number";
|
|
73
|
-
case "string": return t ? "string | null" : "string";
|
|
74
|
-
case "object": {
|
|
75
|
-
let n = Object.keys(e.properties || {});
|
|
76
|
-
if (n.length === 0) return "Record<string, any>";
|
|
77
|
-
let r = Array.isArray(e?.required) ? new Set(e.required) : void 0, i = `{ ${n.map((t) => `${t}${r && !r.has(t) ? "?" : ""}: ${p(e.properties[t], !1)}`).join("; ")} }`;
|
|
78
|
-
return t ? `${i} | null` : i;
|
|
79
|
-
}
|
|
80
|
-
case "array":
|
|
81
|
-
if (e.uniqueItems && Array.isArray(e.items?.enum)) {
|
|
82
|
-
let n = `${c(p(e.items, !1))}[]`;
|
|
83
|
-
return t ? `${n} | null` : n;
|
|
84
|
-
}
|
|
85
|
-
{
|
|
86
|
-
let n = `${c(p(e.items, !1))}[]`;
|
|
87
|
-
return t ? `${n} | null` : n;
|
|
88
|
-
}
|
|
89
|
-
default: return "any";
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function m(e) {
|
|
93
|
-
let t = Array.from(new Set(e.filter((e) => !!e)));
|
|
94
|
-
return t.length === 0 || t.includes("any") ? "any" : t.join(" | ");
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/flow/common/change.ts
|
|
98
|
-
var h = class extends Error {};
|
|
99
|
-
function g() {
|
|
100
|
-
throw new h();
|
|
101
|
-
}
|
|
102
|
-
function _(e, t) {
|
|
28
|
+
function a(e, t) {
|
|
103
29
|
if (t.kind == "flow") return e.graph;
|
|
104
30
|
let n = e.subflows[t.id];
|
|
105
|
-
return n ??
|
|
31
|
+
return n ?? i(), n.graph;
|
|
106
32
|
}
|
|
107
|
-
function
|
|
33
|
+
function o(e, t, n) {
|
|
108
34
|
if (t.kind == "flow") return {
|
|
109
35
|
...e,
|
|
110
36
|
graph: n
|
|
111
37
|
};
|
|
112
38
|
let r = e.subflows[t.id];
|
|
113
|
-
return r ??
|
|
39
|
+
return r ?? i(), {
|
|
114
40
|
...e,
|
|
115
41
|
subflows: {
|
|
116
42
|
...e.subflows,
|
|
@@ -121,7 +47,7 @@ function v(e, t, n) {
|
|
|
121
47
|
}
|
|
122
48
|
};
|
|
123
49
|
}
|
|
124
|
-
function
|
|
50
|
+
function s(e, t) {
|
|
125
51
|
if (!("inputs" in e)) return e;
|
|
126
52
|
let n = { ...e.inputs };
|
|
127
53
|
for (let [e, r] of Object.entries(n)) {
|
|
@@ -137,87 +63,87 @@ function y(e, t) {
|
|
|
137
63
|
inputs: n
|
|
138
64
|
};
|
|
139
65
|
}
|
|
140
|
-
function
|
|
66
|
+
function c(e, t) {
|
|
141
67
|
let n = { ...e.document }, r = { ...e.modules };
|
|
142
68
|
for (let e of t) switch (e.kind) {
|
|
143
69
|
case "binding.create":
|
|
144
|
-
n.bindings[e.bindingId] != null &&
|
|
70
|
+
n.bindings[e.bindingId] != null && i(), n.bindings = {
|
|
145
71
|
...n.bindings,
|
|
146
72
|
[e.bindingId]: e.binding
|
|
147
73
|
};
|
|
148
74
|
break;
|
|
149
75
|
case "binding.replace":
|
|
150
|
-
n.bindings[e.bindingId] ??
|
|
76
|
+
n.bindings[e.bindingId] ?? i(), n.bindings = {
|
|
151
77
|
...n.bindings,
|
|
152
78
|
[e.bindingId]: e.binding
|
|
153
79
|
};
|
|
154
80
|
break;
|
|
155
81
|
case "binding.delete": {
|
|
156
|
-
n.bindings[e.bindingId] ??
|
|
82
|
+
n.bindings[e.bindingId] ?? i();
|
|
157
83
|
let t = { ...n.bindings };
|
|
158
84
|
delete t[e.bindingId], n.bindings = t;
|
|
159
85
|
break;
|
|
160
86
|
}
|
|
161
87
|
case "graph.edge.connect": {
|
|
162
|
-
let t =
|
|
163
|
-
t.nodes[e.edge.source] ??
|
|
88
|
+
let t = a(n, e.target);
|
|
89
|
+
t.nodes[e.edge.source] ?? i();
|
|
164
90
|
let r = t.nodes[e.edge.target];
|
|
165
|
-
(r == null || !("inputs" in r)) &&
|
|
166
|
-
let
|
|
91
|
+
(r == null || !("inputs" in r)) && i();
|
|
92
|
+
let s = r.inputs[e.edge.targetHandle], c = {
|
|
167
93
|
kind: "node",
|
|
168
94
|
nodeId: e.edge.source,
|
|
169
95
|
output: e.edge.sourceHandle
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
let
|
|
96
|
+
}, l = s?.kind == "sources" ? s.sources.filter((e) => e.kind != "binding" || n.bindings[e.bindingId]?.kind != "variable") : [];
|
|
97
|
+
l.some((e) => e.kind == "node" && e.nodeId == c.nodeId && e.output == c.output) && i();
|
|
98
|
+
let u = {
|
|
173
99
|
...r,
|
|
174
100
|
inputs: {
|
|
175
101
|
...r.inputs,
|
|
176
102
|
[e.edge.targetHandle]: {
|
|
177
103
|
kind: "sources",
|
|
178
|
-
sources: [...
|
|
104
|
+
sources: [...l, c]
|
|
179
105
|
}
|
|
180
106
|
}
|
|
181
107
|
};
|
|
182
|
-
Object.assign(n,
|
|
108
|
+
Object.assign(n, o(n, e.target, { nodes: {
|
|
183
109
|
...t.nodes,
|
|
184
|
-
[e.edge.target]:
|
|
110
|
+
[e.edge.target]: u
|
|
185
111
|
} }));
|
|
186
112
|
break;
|
|
187
113
|
}
|
|
188
114
|
case "graph.edge.disconnect": {
|
|
189
|
-
let t =
|
|
190
|
-
(r == null || !("inputs" in r)) &&
|
|
191
|
-
let
|
|
192
|
-
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
let
|
|
196
|
-
|
|
115
|
+
let t = a(n, e.target), r = t.nodes[e.edge.target];
|
|
116
|
+
(r == null || !("inputs" in r)) && i();
|
|
117
|
+
let s = r.inputs[e.edge.targetHandle];
|
|
118
|
+
s?.kind != "sources" && i();
|
|
119
|
+
let c = s.sources.filter((t) => t.kind != "node" || t.nodeId != e.edge.source || t.output != e.edge.sourceHandle);
|
|
120
|
+
c.length == s.sources.length && i();
|
|
121
|
+
let l = { ...r.inputs };
|
|
122
|
+
c.length == 0 ? delete l[e.edge.targetHandle] : l[e.edge.targetHandle] = {
|
|
197
123
|
kind: "sources",
|
|
198
|
-
sources:
|
|
199
|
-
}, Object.assign(n,
|
|
124
|
+
sources: c
|
|
125
|
+
}, Object.assign(n, o(n, e.target, { nodes: {
|
|
200
126
|
...t.nodes,
|
|
201
127
|
[e.edge.target]: {
|
|
202
128
|
...r,
|
|
203
|
-
inputs:
|
|
129
|
+
inputs: l
|
|
204
130
|
}
|
|
205
131
|
} }));
|
|
206
132
|
break;
|
|
207
133
|
}
|
|
208
134
|
case "graph.node.create": {
|
|
209
|
-
let t =
|
|
210
|
-
(t.nodes[e.nodeId] != null || e.target.kind == "subflow" && !("inputs" in e.node)) &&
|
|
135
|
+
let t = a(n, e.target);
|
|
136
|
+
(t.nodes[e.nodeId] != null || e.target.kind == "subflow" && !("inputs" in e.node)) && i(), Object.assign(n, o(n, e.target, { nodes: {
|
|
211
137
|
...t.nodes,
|
|
212
138
|
[e.nodeId]: e.node
|
|
213
139
|
} }));
|
|
214
140
|
break;
|
|
215
141
|
}
|
|
216
142
|
case "graph.node.delete": {
|
|
217
|
-
let t =
|
|
218
|
-
t.nodes[e.nodeId] ??
|
|
219
|
-
let r = /* @__PURE__ */ new Set([e.nodeId]),
|
|
220
|
-
if (Object.assign(n,
|
|
143
|
+
let t = a(n, e.target);
|
|
144
|
+
t.nodes[e.nodeId] ?? i();
|
|
145
|
+
let r = /* @__PURE__ */ new Set([e.nodeId]), c = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => r.has(e) ? [] : [[e, s(t, r)]]));
|
|
146
|
+
if (Object.assign(n, o(n, e.target, { nodes: c })), e.target.kind == "subflow") {
|
|
221
147
|
let t = n.subflows[e.target.id], i = t.outputs.map((e) => ({
|
|
222
148
|
...e,
|
|
223
149
|
sources: e.sources.filter((e) => e.kind != "node" || !r.has(e.nodeId))
|
|
@@ -233,22 +159,22 @@ function b(e, t) {
|
|
|
233
159
|
break;
|
|
234
160
|
}
|
|
235
161
|
case "graph.node.replace": {
|
|
236
|
-
let t =
|
|
237
|
-
(t.nodes[e.nodeId] == null || e.target.kind == "subflow" && !("inputs" in e.node)) &&
|
|
162
|
+
let t = a(n, e.target);
|
|
163
|
+
(t.nodes[e.nodeId] == null || e.target.kind == "subflow" && !("inputs" in e.node)) && i(), Object.assign(n, o(n, e.target, { nodes: {
|
|
238
164
|
...t.nodes,
|
|
239
165
|
[e.nodeId]: e.node
|
|
240
166
|
} }));
|
|
241
167
|
break;
|
|
242
168
|
}
|
|
243
169
|
case "module.create":
|
|
244
|
-
r[e.moduleId] != null &&
|
|
170
|
+
r[e.moduleId] != null && i(), r[e.moduleId] = e.module;
|
|
245
171
|
break;
|
|
246
172
|
case "module.delete":
|
|
247
|
-
r[e.moduleId] ??
|
|
173
|
+
r[e.moduleId] ?? i(), delete r[e.moduleId];
|
|
248
174
|
break;
|
|
249
175
|
case "module.rename": {
|
|
250
176
|
let t = r[e.moduleId];
|
|
251
|
-
t ??
|
|
177
|
+
t ?? i(), r[e.moduleId] = {
|
|
252
178
|
...t,
|
|
253
179
|
name: e.name
|
|
254
180
|
};
|
|
@@ -256,7 +182,7 @@ function b(e, t) {
|
|
|
256
182
|
}
|
|
257
183
|
case "module.source.replace": {
|
|
258
184
|
let t = r[e.moduleId];
|
|
259
|
-
t ??
|
|
185
|
+
t ?? i(), r[e.moduleId] = {
|
|
260
186
|
...t,
|
|
261
187
|
imports: e.imports,
|
|
262
188
|
source: e.source
|
|
@@ -264,14 +190,14 @@ function b(e, t) {
|
|
|
264
190
|
break;
|
|
265
191
|
}
|
|
266
192
|
case "subflow.create":
|
|
267
|
-
n.subflows[e.subflowId] != null &&
|
|
193
|
+
n.subflows[e.subflowId] != null && i(), n.subflows = {
|
|
268
194
|
...n.subflows,
|
|
269
195
|
[e.subflowId]: e.subflow
|
|
270
196
|
};
|
|
271
197
|
break;
|
|
272
198
|
case "subflow.definition.replace": {
|
|
273
199
|
let t = n.subflows[e.subflowId];
|
|
274
|
-
t ??
|
|
200
|
+
t ?? i(), n.subflows = {
|
|
275
201
|
...n.subflows,
|
|
276
202
|
[e.subflowId]: {
|
|
277
203
|
...e.definition,
|
|
@@ -281,24 +207,24 @@ function b(e, t) {
|
|
|
281
207
|
break;
|
|
282
208
|
}
|
|
283
209
|
case "subflow.delete": {
|
|
284
|
-
n.subflows[e.subflowId] ??
|
|
210
|
+
n.subflows[e.subflowId] ?? i();
|
|
285
211
|
let t = { ...n.subflows };
|
|
286
212
|
delete t[e.subflowId], n.subflows = t;
|
|
287
213
|
break;
|
|
288
214
|
}
|
|
289
215
|
case "task.create":
|
|
290
|
-
n.tasks[e.taskId] != null &&
|
|
216
|
+
n.tasks[e.taskId] != null && i(), n.tasks = {
|
|
291
217
|
...n.tasks,
|
|
292
218
|
[e.taskId]: e.task
|
|
293
219
|
};
|
|
294
220
|
break;
|
|
295
221
|
case "task.delete": {
|
|
296
|
-
n.tasks[e.taskId] ??
|
|
222
|
+
n.tasks[e.taskId] ?? i();
|
|
297
223
|
let t = { ...n.tasks };
|
|
298
224
|
delete t[e.taskId], n.tasks = t;
|
|
299
225
|
break;
|
|
300
226
|
}
|
|
301
|
-
case "task.replace": n.tasks[e.taskId] ??
|
|
227
|
+
case "task.replace": n.tasks[e.taskId] ?? i(), n.tasks = {
|
|
302
228
|
...n.tasks,
|
|
303
229
|
[e.taskId]: e.task
|
|
304
230
|
};
|
|
@@ -311,8 +237,8 @@ function b(e, t) {
|
|
|
311
237
|
}
|
|
312
238
|
//#endregion
|
|
313
239
|
//#region src/flow/common/nodeChanges.ts
|
|
314
|
-
var
|
|
315
|
-
function
|
|
240
|
+
var l = "export default async function (input, context) {\n return { result: input.value }\n}\n";
|
|
241
|
+
function u(e, t, n, r = void 0, i = {
|
|
316
242
|
inputs: [{
|
|
317
243
|
handle: "value",
|
|
318
244
|
jsonSchema: {},
|
|
@@ -330,15 +256,7 @@ function S(e, t, n, r = void 0, i = {
|
|
|
330
256
|
module: {
|
|
331
257
|
...r ?? {
|
|
332
258
|
imports: [],
|
|
333
|
-
source:
|
|
334
|
-
handle: e.handle,
|
|
335
|
-
json_schema: e.jsonSchema,
|
|
336
|
-
nullable: e.nullable
|
|
337
|
-
}] : []), i.outputs.flatMap((e) => "handle" in e ? [{
|
|
338
|
-
handle: e.handle,
|
|
339
|
-
json_schema: e.jsonSchema,
|
|
340
|
-
nullable: e.nullable
|
|
341
|
-
}] : [])))
|
|
259
|
+
source: l
|
|
342
260
|
},
|
|
343
261
|
name: n
|
|
344
262
|
},
|
|
@@ -347,7 +265,7 @@ function S(e, t, n, r = void 0, i = {
|
|
|
347
265
|
kind: "graph.node.create",
|
|
348
266
|
node: {
|
|
349
267
|
concurrency: 1,
|
|
350
|
-
inputs:
|
|
268
|
+
inputs: D(i.inputs),
|
|
351
269
|
kind: "task",
|
|
352
270
|
name: n,
|
|
353
271
|
task: {
|
|
@@ -361,7 +279,7 @@ function S(e, t, n, r = void 0, i = {
|
|
|
361
279
|
target: e
|
|
362
280
|
}];
|
|
363
281
|
}
|
|
364
|
-
function
|
|
282
|
+
function d(e, t, n) {
|
|
365
283
|
return [{
|
|
366
284
|
kind: "task.create",
|
|
367
285
|
task: n,
|
|
@@ -370,7 +288,7 @@ function C(e, t, n) {
|
|
|
370
288
|
kind: "graph.node.create",
|
|
371
289
|
node: {
|
|
372
290
|
concurrency: 1,
|
|
373
|
-
inputs:
|
|
291
|
+
inputs: D(n.inputs),
|
|
374
292
|
kind: "task",
|
|
375
293
|
name: n.name,
|
|
376
294
|
taskId: t.taskId
|
|
@@ -379,9 +297,9 @@ function C(e, t, n) {
|
|
|
379
297
|
target: e
|
|
380
298
|
}];
|
|
381
299
|
}
|
|
382
|
-
function
|
|
300
|
+
function f(e, t, n, r, i, a = {}) {
|
|
383
301
|
let o = a.inputs ?? {};
|
|
384
|
-
return
|
|
302
|
+
return d(e, t, {
|
|
385
303
|
executor: {
|
|
386
304
|
kind: "llm",
|
|
387
305
|
mode: r
|
|
@@ -394,13 +312,13 @@ function w(e, t, n, r, i, a = {}) {
|
|
|
394
312
|
type: "array"
|
|
395
313
|
},
|
|
396
314
|
nullable: !0,
|
|
397
|
-
value:
|
|
315
|
+
value: O(o, "messages", null)
|
|
398
316
|
},
|
|
399
317
|
{
|
|
400
318
|
handle: "input",
|
|
401
319
|
jsonSchema: { type: "string" },
|
|
402
320
|
nullable: !1,
|
|
403
|
-
value:
|
|
321
|
+
value: O(o, "input", "Alex")
|
|
404
322
|
},
|
|
405
323
|
{
|
|
406
324
|
handle: "template",
|
|
@@ -410,7 +328,7 @@ function w(e, t, n, r, i, a = {}) {
|
|
|
410
328
|
type: "array"
|
|
411
329
|
},
|
|
412
330
|
nullable: !1,
|
|
413
|
-
value:
|
|
331
|
+
value: O(o, "template", [{
|
|
414
332
|
content: "Hello, I'm {{input}}",
|
|
415
333
|
role: "user"
|
|
416
334
|
}])
|
|
@@ -419,7 +337,7 @@ function w(e, t, n, r, i, a = {}) {
|
|
|
419
337
|
handle: "model",
|
|
420
338
|
jsonSchema: { type: "object" },
|
|
421
339
|
nullable: !1,
|
|
422
|
-
value:
|
|
340
|
+
value: O(o, "model", { model: "deepseek-v4-flash" })
|
|
423
341
|
}
|
|
424
342
|
],
|
|
425
343
|
name: n,
|
|
@@ -432,7 +350,7 @@ function w(e, t, n, r, i, a = {}) {
|
|
|
432
350
|
}]
|
|
433
351
|
});
|
|
434
352
|
}
|
|
435
|
-
function
|
|
353
|
+
function p(e, t, n) {
|
|
436
354
|
return [{
|
|
437
355
|
kind: "graph.node.create",
|
|
438
356
|
node: {
|
|
@@ -463,7 +381,7 @@ function T(e, t, n) {
|
|
|
463
381
|
target: e
|
|
464
382
|
}];
|
|
465
383
|
}
|
|
466
|
-
function
|
|
384
|
+
function m(e, t, n) {
|
|
467
385
|
return [{
|
|
468
386
|
kind: "graph.node.create",
|
|
469
387
|
node: {
|
|
@@ -482,7 +400,7 @@ function E(e, t, n) {
|
|
|
482
400
|
target: e
|
|
483
401
|
}];
|
|
484
402
|
}
|
|
485
|
-
function
|
|
403
|
+
function h(e, t, n) {
|
|
486
404
|
return [{
|
|
487
405
|
kind: "graph.node.create",
|
|
488
406
|
node: n,
|
|
@@ -490,7 +408,7 @@ function D(e, t, n) {
|
|
|
490
408
|
target: e
|
|
491
409
|
}];
|
|
492
410
|
}
|
|
493
|
-
function
|
|
411
|
+
function g(e, t, n, r) {
|
|
494
412
|
let i = r.name ?? n.displayName, a = n.type == "poll" ? {
|
|
495
413
|
bindingId: t.bindingId,
|
|
496
414
|
config: r.config,
|
|
@@ -523,8 +441,8 @@ function O(e, t, n, r) {
|
|
|
523
441
|
target: e
|
|
524
442
|
}];
|
|
525
443
|
}
|
|
526
|
-
function
|
|
527
|
-
let r =
|
|
444
|
+
function _(e, t, n) {
|
|
445
|
+
let r = E(e, t)?.nodes;
|
|
528
446
|
if (r == null) return [];
|
|
529
447
|
let i = new Set(n), a = n.flatMap((e) => {
|
|
530
448
|
let n = r[e];
|
|
@@ -537,7 +455,7 @@ function k(e, t, n) {
|
|
|
537
455
|
moduleId: n.task.moduleId
|
|
538
456
|
}] : []];
|
|
539
457
|
});
|
|
540
|
-
if (t.kind == "subflow") return
|
|
458
|
+
if (t.kind == "subflow") return x(e, a);
|
|
541
459
|
let o = new Set(n.flatMap((e) => {
|
|
542
460
|
let t = r[e];
|
|
543
461
|
return t?.kind == "poll" || t?.kind == "integration" ? [t.bindingId] : [];
|
|
@@ -546,34 +464,34 @@ function k(e, t, n) {
|
|
|
546
464
|
bindingId: t,
|
|
547
465
|
kind: "binding.delete"
|
|
548
466
|
});
|
|
549
|
-
return
|
|
467
|
+
return x(e, a);
|
|
550
468
|
}
|
|
551
|
-
function
|
|
552
|
-
let i =
|
|
469
|
+
function v(e, t, n, r) {
|
|
470
|
+
let i = E(e, t)?.nodes[n];
|
|
553
471
|
if (i == null || !("inputs" in i)) return;
|
|
554
472
|
let { concurrency: a, name: o, timeoutMs: s, ...c } = i;
|
|
555
|
-
return
|
|
473
|
+
return k(t, n, {
|
|
556
474
|
...c,
|
|
557
475
|
...r
|
|
558
476
|
});
|
|
559
477
|
}
|
|
560
|
-
function
|
|
561
|
-
let i =
|
|
478
|
+
function y(e, t, n, r) {
|
|
479
|
+
let i = E(e, t)?.nodes[n];
|
|
562
480
|
if (i == null || !("inputs" in i)) return;
|
|
563
481
|
let a = { ...i.inputs };
|
|
564
482
|
for (let [e, t] of Object.entries(r)) t === void 0 ? delete a[e] : a[e] = {
|
|
565
483
|
kind: "value",
|
|
566
484
|
value: t
|
|
567
485
|
};
|
|
568
|
-
return
|
|
486
|
+
return x(e, k(t, n, {
|
|
569
487
|
...i,
|
|
570
488
|
inputs: a
|
|
571
489
|
}));
|
|
572
490
|
}
|
|
573
|
-
function
|
|
574
|
-
let o =
|
|
491
|
+
function b(e, t, n, r, i, a) {
|
|
492
|
+
let o = E(e, t)?.nodes[n];
|
|
575
493
|
if (o == null || !("inputs" in o)) return;
|
|
576
|
-
let s = o.inputs[r], c = s?.kind == "sources" && s.sources.length == 1 && s.sources[0]?.kind == "binding" ? s.sources[0].bindingId : void 0, l = c == null ? void 0 : e.document.bindings[c], u =
|
|
494
|
+
let s = o.inputs[r], c = s?.kind == "sources" && s.sources.length == 1 && s.sources[0]?.kind == "binding" ? s.sources[0].bindingId : void 0, l = c == null ? void 0 : e.document.bindings[c], u = S(e.document);
|
|
577
495
|
if (c != null && l?.kind == "variable" && (u.get(c) ?? 0) == 1) return l.target == i ? [] : [{
|
|
578
496
|
binding: {
|
|
579
497
|
kind: "variable",
|
|
@@ -599,19 +517,19 @@ function M(e, t, n, r, i, a) {
|
|
|
599
517
|
},
|
|
600
518
|
bindingId: a,
|
|
601
519
|
kind: "binding.create"
|
|
602
|
-
}, ...
|
|
520
|
+
}, ...x(e, k(t, n, {
|
|
603
521
|
...o,
|
|
604
522
|
inputs: d
|
|
605
523
|
}))];
|
|
606
524
|
}
|
|
607
|
-
function
|
|
608
|
-
let n =
|
|
525
|
+
function x(e, t) {
|
|
526
|
+
let n = S(e.document), r = c(e, t), i = S(r.document);
|
|
609
527
|
return [...t, ...[...n.keys()].flatMap((e) => i.has(e) || r.document.bindings[e]?.kind != "variable" ? [] : [{
|
|
610
528
|
bindingId: e,
|
|
611
529
|
kind: "binding.delete"
|
|
612
530
|
}])];
|
|
613
531
|
}
|
|
614
|
-
function
|
|
532
|
+
function S(e) {
|
|
615
533
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
616
534
|
t.set(e, (t.get(e) ?? 0) + 1);
|
|
617
535
|
};
|
|
@@ -620,7 +538,7 @@ function P(e) {
|
|
|
620
538
|
}
|
|
621
539
|
return t;
|
|
622
540
|
}
|
|
623
|
-
function
|
|
541
|
+
function C(e, t, n) {
|
|
624
542
|
let r = e.document.tasks[t];
|
|
625
543
|
if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return [{
|
|
626
544
|
kind: "task.replace",
|
|
@@ -634,7 +552,7 @@ function F(e, t, n) {
|
|
|
634
552
|
taskId: t
|
|
635
553
|
}];
|
|
636
554
|
}
|
|
637
|
-
function
|
|
555
|
+
function w(e, t, n, r) {
|
|
638
556
|
let i = e.document.graph.nodes[n];
|
|
639
557
|
if (i == null) return;
|
|
640
558
|
let a = {
|
|
@@ -681,9 +599,9 @@ function I(e, t, n, r) {
|
|
|
681
599
|
config: r.config
|
|
682
600
|
};
|
|
683
601
|
}
|
|
684
|
-
return
|
|
602
|
+
return k(t, n, o);
|
|
685
603
|
}
|
|
686
|
-
function
|
|
604
|
+
function T(e, t, n, r) {
|
|
687
605
|
let i = e.document.graph.nodes[n];
|
|
688
606
|
if (!(i == null || i.kind != "poll" && i.kind != "integration") && e.document.bindings[i.bindingId]?.kind == "connection") return [{
|
|
689
607
|
binding: {
|
|
@@ -694,19 +612,19 @@ function L(e, t, n, r) {
|
|
|
694
612
|
kind: "binding.replace"
|
|
695
613
|
}];
|
|
696
614
|
}
|
|
697
|
-
function
|
|
615
|
+
function E(e, t) {
|
|
698
616
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
699
617
|
}
|
|
700
|
-
function
|
|
618
|
+
function D(e) {
|
|
701
619
|
return Object.fromEntries(e.flatMap((e) => "handle" in e && Object.hasOwn(e, "value") ? [[e.handle, {
|
|
702
620
|
kind: "value",
|
|
703
621
|
value: e.value
|
|
704
622
|
}]] : []));
|
|
705
623
|
}
|
|
706
|
-
function
|
|
624
|
+
function O(e, t, n) {
|
|
707
625
|
return e != null && Object.hasOwn(e, t) ? e[t] : n;
|
|
708
626
|
}
|
|
709
|
-
function
|
|
627
|
+
function k(e, t, n) {
|
|
710
628
|
return [{
|
|
711
629
|
kind: "graph.node.replace",
|
|
712
630
|
node: n,
|
|
@@ -716,38 +634,38 @@ function V(e, t, n) {
|
|
|
716
634
|
}
|
|
717
635
|
//#endregion
|
|
718
636
|
//#region src/flow/common/edgeChanges.ts
|
|
719
|
-
function
|
|
637
|
+
function A(e, t, n) {
|
|
720
638
|
let r = {
|
|
721
639
|
source: n.source,
|
|
722
640
|
sourceHandle: n.sourceHandle,
|
|
723
641
|
target: n.target,
|
|
724
642
|
targetHandle: n.targetHandle
|
|
725
|
-
}, i =
|
|
726
|
-
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] :
|
|
643
|
+
}, i = M(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
644
|
+
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : x(e, [{
|
|
727
645
|
edge: r,
|
|
728
646
|
kind: "graph.edge.connect",
|
|
729
647
|
target: t
|
|
730
648
|
}]);
|
|
731
649
|
}
|
|
732
|
-
function
|
|
650
|
+
function j(e, t, n) {
|
|
733
651
|
let r = {
|
|
734
652
|
source: n.source,
|
|
735
653
|
sourceHandle: n.sourceHandle,
|
|
736
654
|
target: n.target,
|
|
737
655
|
targetHandle: n.targetHandle
|
|
738
|
-
}, i =
|
|
656
|
+
}, i = M(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
739
657
|
return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
740
658
|
edge: r,
|
|
741
659
|
kind: "graph.edge.disconnect",
|
|
742
660
|
target: t
|
|
743
661
|
}];
|
|
744
662
|
}
|
|
745
|
-
function
|
|
663
|
+
function M(e, t) {
|
|
746
664
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
747
665
|
}
|
|
748
666
|
//#endregion
|
|
749
667
|
//#region src/flow/common/moduleChanges.ts
|
|
750
|
-
async function
|
|
668
|
+
async function N(e) {
|
|
751
669
|
try {
|
|
752
670
|
let { parse: t } = await import("./lib-GrGxYjsJ.js"), n = t(e, {
|
|
753
671
|
errorRecovery: !0,
|
|
@@ -763,7 +681,7 @@ async function G(e) {
|
|
|
763
681
|
return [];
|
|
764
682
|
}
|
|
765
683
|
}
|
|
766
|
-
function
|
|
684
|
+
function P(e, t, n) {
|
|
767
685
|
return [{
|
|
768
686
|
imports: n,
|
|
769
687
|
kind: "module.source.replace",
|
|
@@ -771,13 +689,13 @@ function K(e, t, n) {
|
|
|
771
689
|
source: t
|
|
772
690
|
}];
|
|
773
691
|
}
|
|
774
|
-
function
|
|
692
|
+
function F(e, t) {
|
|
775
693
|
return [{
|
|
776
694
|
kind: "module.rename",
|
|
777
695
|
moduleId: e,
|
|
778
696
|
name: t
|
|
779
697
|
}];
|
|
780
698
|
}
|
|
781
|
-
var
|
|
699
|
+
var I = n("23456789abcdefghjkmnpqrstuvwxyz", 10);
|
|
782
700
|
//#endregion
|
|
783
|
-
export {
|
|
701
|
+
export { x as cleanVariableBindings, A as connect, I as createAuthoringId, h as createBuiltinTrigger, u as createCodeTask, p as createCondition, f as createLlmTask, d as createManagedTask, g as createProviderTrigger, m as createValue, _ as deleteNodes, j as disconnect, N as moduleImports, F as renameModule, P as replaceModuleSource, C as setConnectorConnection, y as setInputValues, b as setInputVariable, T as setTriggerConnection, v as updateSettings, w as updateTrigger };
|