@oomol-lab/open-flow 0.1.0-beta.4 → 0.1.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/browser/{DesignerIcon-DdfuH2jW.js → DesignerIcon-XKBRy_0Q.js} +640 -640
  2. package/dist/browser/createResourceDialog-Cf7QpXp6.js +505 -0
  3. package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
  4. package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
  5. package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
  6. package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
  7. package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
  8. package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
  9. package/dist/browser/dist-DxahK_I8.js +2688 -0
  10. package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
  11. package/dist/browser/{esm-C9jQK70n.js → esm-CTcBY7hh.js} +5 -6
  12. package/dist/browser/flow-authoring-module.d.ts +2 -2
  13. package/dist/browser/flow-authoring-node.d.ts +2 -2
  14. package/dist/browser/flow-authoring.js +475 -209
  15. package/dist/browser/flow-change.d.ts +98 -8
  16. package/dist/browser/flow-change.js +319 -96
  17. package/dist/browser/{flowChanges-Bs-ZcJV8.js → flowChanges-BDqD_Q4G.js} +1628 -1555
  18. package/dist/browser/{flowRunInputEditorStore-BYa8zFLC.js → flowRunInputEditorStore-DDidwd8h.js} +9 -1
  19. package/dist/browser/{flowWorkspace-BewofPeU.js → flowWorkspace-CPBHm14t.js} +9803 -9769
  20. package/dist/browser/{getPseudoElementBounds-qDxSDwzN.js → getPseudoElementBounds-5LArT6Xc.js} +494 -474
  21. package/dist/browser/icons-CRxvozBE.js +726 -0
  22. package/dist/browser/{typeScriptSession-CwMPjseS.js → typeScriptSession-_TgJ_7Oq.js} +256 -257
  23. package/dist/browser/{waitNotificationInputs-DtrPBwA1.js → waitNotificationInputs-lPrLDTOd.js} +2 -2
  24. package/dist/browser/workbench.css +1 -1
  25. package/dist/browser/workbench.js +573 -578
  26. package/dist/browser/{workbenchSelect-CX8KtT7L.js → workbenchSelect-Cf1zlVm9.js} +398 -398
  27. package/dist/common/control-api-conformance.js +27 -19
  28. package/dist/common/control-api.d.ts +4 -11
  29. package/dist/common/control-api.js +6 -18
  30. package/dist/common/flow-encoding.js +4 -0
  31. package/dist/common/flow-semantics.js +8 -10
  32. package/dist/common/runtime-contract.d.ts +1 -1
  33. package/dist/common/runtime-contract.js +27 -0
  34. package/dist/common/scheduler.d.ts +1 -1
  35. package/dist/common/scheduler.js +17 -18
  36. package/dist/index.d.ts +1 -1
  37. package/package.json +1 -1
  38. package/dist/browser/createResourceDialog-4YQKl8lG.js +0 -505
  39. package/dist/browser/dist-BpopSHwP.js +0 -1543
  40. package/dist/browser/dist-CUSrALSX.js +0 -1620
  41. package/dist/browser/icons-DRoMXL5h.js +0 -521
@@ -1,6 +1,26 @@
1
+ //#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/lite/index.mjs
2
+ var e = Object.prototype.hasOwnProperty;
3
+ function t(n, r) {
4
+ var i, a;
5
+ if (n === r) return !0;
6
+ if (n && r && (i = n.constructor) === r.constructor) {
7
+ if (i === Date) return n.getTime() === r.getTime();
8
+ if (i === RegExp) return n.toString() === r.toString();
9
+ if (i === Array) {
10
+ if ((a = n.length) === r.length) for (; a-- && t(n[a], r[a]););
11
+ return a === -1;
12
+ }
13
+ if (!i || typeof n == "object") {
14
+ for (i in a = 0, n) if (e.call(n, i) && ++a && !e.call(r, i) || !(i in r) || !t(n[i], r[i])) return !1;
15
+ return Object.keys(r).length === a;
16
+ }
17
+ }
18
+ return n !== n && r !== r;
19
+ }
20
+ //#endregion
1
21
  //#region src/flow/common/change.ts
2
- var e = 80;
3
- function t(e) {
22
+ var n = 80;
23
+ function r(e) {
4
24
  let t = e.trim();
5
25
  if (t.length == 0) return "empty";
6
26
  if (t.length > 80) return "tooLong";
@@ -10,28 +30,28 @@ function t(e) {
10
30
  }
11
31
  if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(t)) return "specialCharacter";
12
32
  }
13
- function n(e) {
33
+ function i(e) {
14
34
  return e.length <= 256 && /^[A-Za-z_][A-Za-z0-9_]*$/.test(e) && e.slice(0, 3).toUpperCase() != "OO_";
15
35
  }
16
- function r(e) {
36
+ function a(e) {
17
37
  return Object.fromEntries(e.flatMap((e) => "handle" in e ? [[e.handle, e]] : []));
18
38
  }
19
- var i = class extends Error {};
20
- function a() {
21
- throw new i();
39
+ var o = class extends Error {};
40
+ function s() {
41
+ throw new o();
22
42
  }
23
- function o(e, t) {
43
+ function c(e, t) {
24
44
  if (t.kind == "flow") return e.graph;
25
45
  let n = e.subflows[t.id];
26
- return n ?? a(), n.graph;
46
+ return n ?? s(), n.graph;
27
47
  }
28
- function s(e, t, n) {
48
+ function l(e, t, n) {
29
49
  if (t.kind == "flow") return {
30
50
  ...e,
31
51
  graph: n
32
52
  };
33
53
  let r = e.subflows[t.id];
34
- return r ?? a(), {
54
+ return r ?? s(), {
35
55
  ...e,
36
56
  subflows: {
37
57
  ...e.subflows,
@@ -42,7 +62,7 @@ function s(e, t, n) {
42
62
  }
43
63
  };
44
64
  }
45
- function c(e, t) {
65
+ function u(e, t) {
46
66
  if (!("inputs" in e)) return e;
47
67
  let n = { ...e.inputs };
48
68
  for (let [e, r] of Object.entries(n)) {
@@ -58,93 +78,129 @@ function c(e, t) {
58
78
  inputs: n
59
79
  };
60
80
  }
61
- function l(e, t) {
62
- let n = { ...e.document }, r = { ...e.modules };
63
- for (let e of t) switch (e.kind) {
81
+ function d(e, n) {
82
+ let r = { ...e.document }, i = { ...e.modules };
83
+ for (let e of n) switch (e.kind) {
64
84
  case "binding.create":
65
- n.bindings[e.bindingId] != null && a(), n.bindings = {
66
- ...n.bindings,
67
- [e.bindingId]: e.binding
68
- };
69
- break;
70
- case "binding.replace":
71
- n.bindings[e.bindingId] ?? a(), n.bindings = {
72
- ...n.bindings,
85
+ r.bindings[e.bindingId] != null && s(), r.bindings = {
86
+ ...r.bindings,
73
87
  [e.bindingId]: e.binding
74
88
  };
75
89
  break;
76
90
  case "binding.delete": {
77
- n.bindings[e.bindingId] ?? a();
78
- let t = { ...n.bindings };
79
- delete t[e.bindingId], n.bindings = t;
91
+ r.bindings[e.bindingId] ?? s();
92
+ let t = { ...r.bindings };
93
+ delete t[e.bindingId], r.bindings = t;
94
+ break;
95
+ }
96
+ case "binding.target.set": {
97
+ let t = r.bindings[e.bindingId];
98
+ (t == null || t.target != e.before) && s(), r.bindings = {
99
+ ...r.bindings,
100
+ [e.bindingId]: {
101
+ ...t,
102
+ target: e.value
103
+ }
104
+ };
80
105
  break;
81
106
  }
82
107
  case "graph.edge.connect": {
83
- let t = o(n, e.target);
84
- t.nodes[e.edge.source] ?? a();
85
- let r = t.nodes[e.edge.target];
86
- (r == null || !("inputs" in r)) && a();
87
- let i = r.inputs[e.edge.targetHandle], c = {
108
+ let n = c(r, e.target);
109
+ n.nodes[e.edge.source] ?? s();
110
+ let i = n.nodes[e.edge.target];
111
+ (i == null || !("inputs" in i)) && s();
112
+ let a = i.inputs[e.edge.targetHandle];
113
+ t(a, e.before) || s();
114
+ let o = {
88
115
  kind: "node",
89
116
  nodeId: e.edge.source,
90
117
  output: e.edge.sourceHandle
91
- }, l = i?.kind == "sources" ? i.sources.filter((e) => e.kind != "binding" || n.bindings[e.bindingId]?.kind != "variable") : [];
92
- l.some((e) => e.kind == "node" && e.nodeId == c.nodeId && e.output == c.output) && a();
93
- let u = {
94
- ...r,
118
+ }, u = a?.kind == "sources" ? a.sources.filter((e) => e.kind != "binding" || r.bindings[e.bindingId]?.kind != "variable") : [];
119
+ u.some((e) => e.kind == "node" && e.nodeId == o.nodeId && e.output == o.output) && s();
120
+ let d = {
121
+ ...i,
95
122
  inputs: {
96
- ...r.inputs,
123
+ ...i.inputs,
97
124
  [e.edge.targetHandle]: {
98
125
  kind: "sources",
99
- sources: [...l, c]
126
+ sources: [...u, o]
100
127
  }
101
128
  }
102
129
  };
103
- Object.assign(n, s(n, e.target, { nodes: {
104
- ...t.nodes,
105
- [e.edge.target]: u
130
+ Object.assign(r, l(r, e.target, { nodes: {
131
+ ...n.nodes,
132
+ [e.edge.target]: d
106
133
  } }));
107
134
  break;
108
135
  }
109
136
  case "graph.edge.disconnect": {
110
- let t = o(n, e.target), r = t.nodes[e.edge.target];
111
- (r == null || !("inputs" in r)) && a();
112
- let i = r.inputs[e.edge.targetHandle];
113
- i?.kind != "sources" && a();
114
- let c = i.sources.filter((t) => t.kind != "node" || t.nodeId != e.edge.source || t.output != e.edge.sourceHandle);
115
- c.length == i.sources.length && a();
116
- let l = { ...r.inputs };
117
- c.length == 0 ? delete l[e.edge.targetHandle] : l[e.edge.targetHandle] = {
137
+ let n = c(r, e.target), i = n.nodes[e.edge.target];
138
+ (i == null || !("inputs" in i)) && s();
139
+ let a = i.inputs[e.edge.targetHandle];
140
+ (a?.kind != "sources" || !t(a, e.before)) && s();
141
+ let o = a.sources.filter((t) => t.kind != "node" || t.nodeId != e.edge.source || t.output != e.edge.sourceHandle);
142
+ o.length == a.sources.length && s();
143
+ let u = { ...i.inputs };
144
+ o.length == 0 ? delete u[e.edge.targetHandle] : u[e.edge.targetHandle] = {
118
145
  kind: "sources",
119
- sources: c
120
- }, Object.assign(n, s(n, e.target, { nodes: {
121
- ...t.nodes,
146
+ sources: o
147
+ }, Object.assign(r, l(r, e.target, { nodes: {
148
+ ...n.nodes,
122
149
  [e.edge.target]: {
123
- ...r,
124
- inputs: l
150
+ ...i,
151
+ inputs: u
125
152
  }
126
153
  } }));
127
154
  break;
128
155
  }
156
+ case "graph.node.additional-inputs.set": {
157
+ let n = c(r, e.target), i = n.nodes[e.nodeId];
158
+ (i?.kind != "task" || !t(i.additionalInputs, e.before)) && s();
159
+ let { additionalInputs: a, ...o } = i, u = e.value == null ? o : {
160
+ ...o,
161
+ additionalInputs: e.value
162
+ };
163
+ Object.assign(r, l(r, e.target, { nodes: {
164
+ ...n.nodes,
165
+ [e.nodeId]: u
166
+ } }));
167
+ break;
168
+ }
169
+ case "graph.node.condition.set": {
170
+ let n = c(r, e.target), i = n.nodes[e.nodeId];
171
+ i?.kind != "condition" && s(), (!t(i.cases, e.before.cases) || i.defaultOutput != e.before.defaultOutput || !t(i.input, e.before.input)) && s();
172
+ let { defaultOutput: a, ...o } = i, u = e.value.defaultOutput == null ? {
173
+ ...o,
174
+ ...e.value
175
+ } : {
176
+ ...i,
177
+ ...e.value
178
+ };
179
+ Object.assign(r, l(r, e.target, { nodes: {
180
+ ...n.nodes,
181
+ [e.nodeId]: u
182
+ } }));
183
+ break;
184
+ }
129
185
  case "graph.node.create": {
130
- let t = o(n, e.target);
131
- (t.nodes[e.nodeId] != null || e.target.kind == "subflow" && !("inputs" in e.node)) && a(), Object.assign(n, s(n, e.target, { nodes: {
186
+ let t = c(r, e.target);
187
+ (t.nodes[e.nodeId] != null || e.target.kind == "subflow" && !("inputs" in e.node)) && s(), Object.assign(r, l(r, e.target, { nodes: {
132
188
  ...t.nodes,
133
189
  [e.nodeId]: e.node
134
190
  } }));
135
191
  break;
136
192
  }
137
193
  case "graph.node.delete": {
138
- let t = o(n, e.target);
139
- t.nodes[e.nodeId] ?? a();
140
- let r = /* @__PURE__ */ new Set([e.nodeId]), i = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => r.has(e) ? [] : [[e, c(t, r)]]));
141
- if (Object.assign(n, s(n, e.target, { nodes: i })), e.target.kind == "subflow") {
142
- let t = n.subflows[e.target.id], i = t.outputs.map((e) => ({
194
+ let t = c(r, e.target);
195
+ t.nodes[e.nodeId] ?? s();
196
+ let n = /* @__PURE__ */ new Set([e.nodeId]), i = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => n.has(e) ? [] : [[e, u(t, n)]]));
197
+ if (Object.assign(r, l(r, e.target, { nodes: i })), e.target.kind == "subflow") {
198
+ let t = r.subflows[e.target.id], i = t.outputs.map((e) => ({
143
199
  ...e,
144
- sources: e.sources.filter((e) => e.kind != "node" || !r.has(e.nodeId))
200
+ sources: e.sources.filter((e) => e.kind != "node" || !n.has(e.nodeId))
145
201
  }));
146
- n.subflows = {
147
- ...n.subflows,
202
+ r.subflows = {
203
+ ...r.subflows,
148
204
  [e.target.id]: {
149
205
  ...t,
150
206
  outputs: i
@@ -153,82 +209,249 @@ function l(e, t) {
153
209
  }
154
210
  break;
155
211
  }
156
- case "graph.node.replace": {
157
- let t = o(n, e.target);
158
- (t.nodes[e.nodeId] == null || e.target.kind == "subflow" && !("inputs" in e.node)) && a(), Object.assign(n, s(n, e.target, { nodes: {
212
+ case "graph.node.field.set": {
213
+ let n = c(r, e.target), i = n.nodes[e.nodeId];
214
+ (i == null || !t(Reflect.get(i, e.field), e.before)) && s(), e.field == "concurrency" && e.value == null && s();
215
+ let a = { ...i };
216
+ e.value == null ? Reflect.deleteProperty(a, e.field) : Object.assign(a, { [e.field]: e.value }), Object.assign(r, l(r, e.target, { nodes: {
217
+ ...n.nodes,
218
+ [e.nodeId]: a
219
+ } }));
220
+ break;
221
+ }
222
+ case "graph.node.input.set": {
223
+ let n = c(r, e.target), i = n.nodes[e.nodeId];
224
+ (i == null || !("inputs" in i) || !t(i.inputs[e.handle], e.before)) && s();
225
+ let a = { ...i.inputs };
226
+ e.value == null ? delete a[e.handle] : a[e.handle] = e.value, Object.assign(r, l(r, e.target, { nodes: {
227
+ ...n.nodes,
228
+ [e.nodeId]: {
229
+ ...i,
230
+ inputs: a
231
+ }
232
+ } }));
233
+ break;
234
+ }
235
+ case "graph.node.task.name.set": {
236
+ let t = c(r, e.target), n = t.nodes[e.nodeId];
237
+ (n?.kind != "task" || n.task == null || n.task.name != e.before) && s();
238
+ let i = {
239
+ ...n,
240
+ task: {
241
+ ...n.task,
242
+ name: e.value
243
+ }
244
+ };
245
+ Object.assign(r, l(r, e.target, { nodes: {
159
246
  ...t.nodes,
160
- [e.nodeId]: e.node
247
+ [e.nodeId]: i
161
248
  } }));
162
249
  break;
163
250
  }
251
+ case "graph.node.task.ports.set": {
252
+ let n = c(r, e.target), i = n.nodes[e.nodeId];
253
+ (i?.kind != "task" || i.task == null || !t({
254
+ inputs: i.task.inputs,
255
+ outputs: i.task.outputs
256
+ }, e.before)) && s();
257
+ let a = {
258
+ ...i,
259
+ task: {
260
+ ...i.task,
261
+ ...e.value
262
+ }
263
+ };
264
+ Object.assign(r, l(r, e.target, { nodes: {
265
+ ...n.nodes,
266
+ [e.nodeId]: a
267
+ } }));
268
+ break;
269
+ }
270
+ case "graph.node.values.set": {
271
+ let n = c(r, e.target), i = n.nodes[e.nodeId];
272
+ (i?.kind != "value" || !t(i.values, e.before)) && s(), Object.assign(r, l(r, e.target, { nodes: {
273
+ ...n.nodes,
274
+ [e.nodeId]: {
275
+ ...i,
276
+ values: e.value
277
+ }
278
+ } }));
279
+ break;
280
+ }
281
+ case "graph.node.wait.set": {
282
+ let n = r.graph, i = n.nodes[e.nodeId];
283
+ (i?.kind != "wait" || !t({
284
+ actions: i.actions,
285
+ ...i.notification == null ? {} : { notification: i.notification },
286
+ prompt: i.prompt
287
+ }, e.before)) && s();
288
+ let { notification: a, ...o } = i, c = e.value.notification == null ? {
289
+ ...o,
290
+ ...e.value
291
+ } : {
292
+ ...i,
293
+ ...e.value
294
+ };
295
+ r.graph = { nodes: {
296
+ ...n.nodes,
297
+ [e.nodeId]: c
298
+ } };
299
+ break;
300
+ }
301
+ case "graph.node.webhook.set": {
302
+ let n = c(r, e.target), i = n.nodes[e.nodeId];
303
+ (i?.kind != "webhook" || !t(i.inputsDef, e.before.inputsDef) || !t(i.options, e.before.options)) && s();
304
+ let { options: a, ...o } = i, u = e.value.options == null ? {
305
+ ...o,
306
+ inputsDef: e.value.inputsDef
307
+ } : {
308
+ ...i,
309
+ ...e.value
310
+ };
311
+ Object.assign(r, l(r, e.target, { nodes: {
312
+ ...n.nodes,
313
+ [e.nodeId]: u
314
+ } }));
315
+ break;
316
+ }
317
+ case "graph.trigger.config.set": {
318
+ let n = r.graph, i = n.nodes[e.nodeId];
319
+ (i == null || i.kind != "integration" && i.kind != "poll" || !t(i.config[e.name], e.before)) && s();
320
+ let a = { ...i.config };
321
+ e.value === void 0 ? delete a[e.name] : a[e.name] = e.value, r.graph = { nodes: {
322
+ ...n.nodes,
323
+ [e.nodeId]: {
324
+ ...i,
325
+ config: a
326
+ }
327
+ } };
328
+ break;
329
+ }
330
+ case "graph.trigger.schedule.set": {
331
+ let n = r.graph, i = n.nodes[e.nodeId];
332
+ (i == null || i.kind != "cron" && i.kind != "poll") && s(), t(i.kind == "cron" ? i.cronTimes : i.pollTimes, e.before) || s();
333
+ let a = i.kind == "cron" ? {
334
+ ...i,
335
+ cronTimes: e.value
336
+ } : {
337
+ ...i,
338
+ pollTimes: e.value
339
+ };
340
+ r.graph = { nodes: {
341
+ ...n.nodes,
342
+ [e.nodeId]: a
343
+ } };
344
+ break;
345
+ }
164
346
  case "module.create":
165
- r[e.moduleId] != null && a(), r[e.moduleId] = e.module;
347
+ i[e.moduleId] != null && s(), i[e.moduleId] = e.module;
166
348
  break;
167
349
  case "module.delete":
168
- r[e.moduleId] ?? a(), delete r[e.moduleId];
350
+ i[e.moduleId] ?? s(), delete i[e.moduleId];
169
351
  break;
170
352
  case "module.rename": {
171
- let t = r[e.moduleId];
172
- t ?? a(), r[e.moduleId] = {
353
+ let t = i[e.moduleId];
354
+ (t == null || t.name != e.before) && s(), i[e.moduleId] = {
173
355
  ...t,
174
356
  name: e.name
175
357
  };
176
358
  break;
177
359
  }
178
360
  case "module.source.replace": {
179
- let t = r[e.moduleId];
180
- t ?? a(), r[e.moduleId] = {
181
- ...t,
361
+ let n = i[e.moduleId];
362
+ (n == null || n.source != e.beforeSource || !t(n.imports, e.beforeImports)) && s(), i[e.moduleId] = {
363
+ ...n,
182
364
  imports: e.imports,
183
365
  source: e.source
184
366
  };
185
367
  break;
186
368
  }
187
369
  case "subflow.create":
188
- n.subflows[e.subflowId] != null && a(), n.subflows = {
189
- ...n.subflows,
370
+ r.subflows[e.subflowId] != null && s(), r.subflows = {
371
+ ...r.subflows,
190
372
  [e.subflowId]: e.subflow
191
373
  };
192
374
  break;
193
- case "subflow.definition.replace": {
194
- let t = n.subflows[e.subflowId];
195
- t ?? a(), n.subflows = {
196
- ...n.subflows,
375
+ case "subflow.definition.set": {
376
+ let n = r.subflows[e.subflowId];
377
+ (n == null || !t({
378
+ inputs: n.inputs,
379
+ name: n.name,
380
+ outputs: n.outputs
381
+ }, e.before)) && s(), r.subflows = {
382
+ ...r.subflows,
197
383
  [e.subflowId]: {
198
384
  ...e.definition,
199
- graph: t.graph
385
+ graph: n.graph
200
386
  }
201
387
  };
202
388
  break;
203
389
  }
204
390
  case "subflow.delete": {
205
- n.subflows[e.subflowId] ?? a();
206
- let t = { ...n.subflows };
207
- delete t[e.subflowId], n.subflows = t;
391
+ r.subflows[e.subflowId] ?? s();
392
+ let t = { ...r.subflows };
393
+ delete t[e.subflowId], r.subflows = t;
208
394
  break;
209
395
  }
210
396
  case "task.create":
211
- n.tasks[e.taskId] != null && a(), n.tasks = {
212
- ...n.tasks,
397
+ r.tasks[e.taskId] != null && s(), r.tasks = {
398
+ ...r.tasks,
213
399
  [e.taskId]: e.task
214
400
  };
215
401
  break;
402
+ case "task.connector.connection.set": {
403
+ let t = r.tasks[e.taskId];
404
+ (t == null || !("executor" in t) || t.executor.kind != "connector" || t.executor.connectionId != e.before) && s();
405
+ let { connectionId: n, ...i } = t.executor, a = e.value == null ? i : {
406
+ ...i,
407
+ connectionId: e.value
408
+ };
409
+ r.tasks = {
410
+ ...r.tasks,
411
+ [e.taskId]: {
412
+ ...t,
413
+ executor: a
414
+ }
415
+ };
416
+ break;
417
+ }
216
418
  case "task.delete": {
217
- n.tasks[e.taskId] ?? a();
218
- let t = { ...n.tasks };
219
- delete t[e.taskId], n.tasks = t;
419
+ r.tasks[e.taskId] ?? s();
420
+ let t = { ...r.tasks };
421
+ delete t[e.taskId], r.tasks = t;
422
+ break;
423
+ }
424
+ case "task.llm.mode.set": {
425
+ let t = r.tasks[e.taskId];
426
+ (t == null || !("executor" in t) || t.executor.kind != "llm" || t.executor.mode != e.before) && s(), r.tasks = {
427
+ ...r.tasks,
428
+ [e.taskId]: {
429
+ ...t,
430
+ executor: {
431
+ ...t.executor,
432
+ mode: e.value
433
+ }
434
+ }
435
+ };
436
+ break;
437
+ }
438
+ case "task.name.set": {
439
+ let t = r.tasks[e.taskId];
440
+ (t == null || t.name != e.before) && s(), r.tasks = {
441
+ ...r.tasks,
442
+ [e.taskId]: {
443
+ ...t,
444
+ name: e.value
445
+ }
446
+ };
220
447
  break;
221
448
  }
222
- case "task.replace": n.tasks[e.taskId] ?? a(), n.tasks = {
223
- ...n.tasks,
224
- [e.taskId]: e.task
225
- };
226
449
  }
227
450
  return {
228
- document: n,
451
+ document: r,
229
452
  modelVersion: e.modelVersion,
230
- modules: r
453
+ modules: i
231
454
  };
232
455
  }
233
456
  //#endregion
234
- export { i as FlowChangeError, l as applyFlowChanges, r as portsByHandle, t as resourceNameIssue, e as resourceNameMaxLength, n as validVariableName };
457
+ export { o as FlowChangeError, d as applyFlowChanges, a as portsByHandle, r as resourceNameIssue, n as resourceNameMaxLength, i as validVariableName };