@oomol-lab/open-flow 0.1.0-beta.3 → 0.1.0-beta.4
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/DesignerIcon-DdfuH2jW.js +2066 -0
- package/dist/browser/createResourceDialog-4YQKl8lG.js +505 -0
- package/dist/browser/{esm-C2UUqIUP.js → esm-C9jQK70n.js} +1 -1
- package/dist/browser/flow-authoring-node.d.ts +3 -0
- package/dist/browser/flow-authoring.d.ts +1 -1
- package/dist/browser/flow-authoring.js +66 -46
- package/dist/browser/flow-change.d.ts +14 -1
- package/dist/browser/flow-notifications.d.ts +5 -0
- package/dist/browser/{diagnostics-SDCyFuxm.js → flowChanges-Bs-ZcJV8.js} +3963 -3591
- package/dist/browser/{flowRunInputEditorStore-CwvOiIiU.js → flowRunInputEditorStore-BYa8zFLC.js} +1 -1
- package/dist/browser/{flowWorkspace-BZ_eiQNR.js → flowWorkspace-BewofPeU.js} +35223 -35041
- package/dist/browser/{getPseudoElementBounds-ESJExRFX.js → getPseudoElementBounds-qDxSDwzN.js} +1813 -2328
- package/dist/browser/icons-DRoMXL5h.js +521 -0
- package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-CwMPjseS.js} +1 -1
- package/dist/browser/waitNotificationInputs-DtrPBwA1.js +26 -0
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +611 -536
- package/dist/browser/{workbenchSelect-B2s1HV-Y.js → workbenchSelect-CX8KtT7L.js} +483 -482
- package/dist/common/control-api-conformance.d.ts +1 -0
- package/dist/common/control-api-conformance.js +59 -0
- package/dist/common/control-api-errors.d.ts +4 -0
- package/dist/common/control-api.d.ts +22 -3
- package/dist/common/control-api.js +134 -73
- package/dist/common/flow-encoding.js +20 -8
- package/dist/common/flow-notifications.d.ts +5 -0
- package/dist/common/flow-semantics.d.ts +1 -0
- package/dist/common/flow-semantics.js +467 -381
- package/dist/common/run-events.js +2 -1
- package/dist/common/run-lifecycle.d.ts +17 -2
- package/dist/common/run-lifecycle.js +53 -2
- package/dist/common/scheduler.d.ts +64 -3
- package/dist/common/scheduler.js +417 -142
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/browser/createResourceDialog-BkZns-oZ.js +0 -504
|
@@ -237,7 +237,7 @@ function c(e, t) {
|
|
|
237
237
|
}
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region src/flow/common/nodeChanges.ts
|
|
240
|
-
var l = "export default async function (
|
|
240
|
+
var l = "export default async function (inputs, context) {\n return { result: inputs.value }\n}\n";
|
|
241
241
|
function u(e, t, n, r = void 0, i = {
|
|
242
242
|
inputs: [{
|
|
243
243
|
handle: "value",
|
|
@@ -265,7 +265,7 @@ function u(e, t, n, r = void 0, i = {
|
|
|
265
265
|
kind: "graph.node.create",
|
|
266
266
|
node: {
|
|
267
267
|
concurrency: 1,
|
|
268
|
-
inputs:
|
|
268
|
+
inputs: O(i.inputs),
|
|
269
269
|
kind: "task",
|
|
270
270
|
name: n,
|
|
271
271
|
task: {
|
|
@@ -288,7 +288,7 @@ function d(e, t, n) {
|
|
|
288
288
|
kind: "graph.node.create",
|
|
289
289
|
node: {
|
|
290
290
|
concurrency: 1,
|
|
291
|
-
inputs:
|
|
291
|
+
inputs: O(n.inputs),
|
|
292
292
|
kind: "task",
|
|
293
293
|
name: n.name,
|
|
294
294
|
taskId: t.taskId
|
|
@@ -312,13 +312,13 @@ function f(e, t, n, r, i, a = {}) {
|
|
|
312
312
|
type: "array"
|
|
313
313
|
},
|
|
314
314
|
nullable: !0,
|
|
315
|
-
value:
|
|
315
|
+
value: k(o, "messages", null)
|
|
316
316
|
},
|
|
317
317
|
{
|
|
318
318
|
handle: "input",
|
|
319
319
|
jsonSchema: { type: "string" },
|
|
320
320
|
nullable: !1,
|
|
321
|
-
value:
|
|
321
|
+
value: k(o, "input", "Alex")
|
|
322
322
|
},
|
|
323
323
|
{
|
|
324
324
|
handle: "template",
|
|
@@ -328,7 +328,7 @@ function f(e, t, n, r, i, a = {}) {
|
|
|
328
328
|
type: "array"
|
|
329
329
|
},
|
|
330
330
|
nullable: !1,
|
|
331
|
-
value:
|
|
331
|
+
value: k(o, "template", [{
|
|
332
332
|
content: "Hello, I'm {{input}}",
|
|
333
333
|
role: "user"
|
|
334
334
|
}])
|
|
@@ -337,7 +337,7 @@ function f(e, t, n, r, i, a = {}) {
|
|
|
337
337
|
handle: "model",
|
|
338
338
|
jsonSchema: { type: "object" },
|
|
339
339
|
nullable: !1,
|
|
340
|
-
value:
|
|
340
|
+
value: k(o, "model", { model: "deepseek-v4-flash" })
|
|
341
341
|
}
|
|
342
342
|
],
|
|
343
343
|
name: n,
|
|
@@ -401,6 +401,24 @@ function m(e, t, n) {
|
|
|
401
401
|
}];
|
|
402
402
|
}
|
|
403
403
|
function h(e, t, n) {
|
|
404
|
+
return [{
|
|
405
|
+
kind: "graph.node.create",
|
|
406
|
+
node: {
|
|
407
|
+
actions: ["continue"],
|
|
408
|
+
concurrency: 1,
|
|
409
|
+
inputs: { value: {
|
|
410
|
+
kind: "value",
|
|
411
|
+
value: null
|
|
412
|
+
} },
|
|
413
|
+
kind: "wait",
|
|
414
|
+
name: n,
|
|
415
|
+
prompt: n
|
|
416
|
+
},
|
|
417
|
+
nodeId: t,
|
|
418
|
+
target: e
|
|
419
|
+
}];
|
|
420
|
+
}
|
|
421
|
+
function g(e, t, n) {
|
|
404
422
|
return [{
|
|
405
423
|
kind: "graph.node.create",
|
|
406
424
|
node: n,
|
|
@@ -408,7 +426,7 @@ function h(e, t, n) {
|
|
|
408
426
|
target: e
|
|
409
427
|
}];
|
|
410
428
|
}
|
|
411
|
-
function
|
|
429
|
+
function _(e, t, n, r) {
|
|
412
430
|
let i = r.name ?? n.displayName, a = n.type == "poll" ? {
|
|
413
431
|
bindingId: t.bindingId,
|
|
414
432
|
config: r.config,
|
|
@@ -441,8 +459,8 @@ function g(e, t, n, r) {
|
|
|
441
459
|
target: e
|
|
442
460
|
}];
|
|
443
461
|
}
|
|
444
|
-
function
|
|
445
|
-
let r =
|
|
462
|
+
function v(e, t, n) {
|
|
463
|
+
let r = D(e, t)?.nodes;
|
|
446
464
|
if (r == null) return [];
|
|
447
465
|
let i = new Set(n), a = n.flatMap((e) => {
|
|
448
466
|
let n = r[e];
|
|
@@ -455,7 +473,7 @@ function _(e, t, n) {
|
|
|
455
473
|
moduleId: n.task.moduleId
|
|
456
474
|
}] : []];
|
|
457
475
|
});
|
|
458
|
-
if (t.kind == "subflow") return
|
|
476
|
+
if (t.kind == "subflow") return S(e, a);
|
|
459
477
|
let o = new Set(n.flatMap((e) => {
|
|
460
478
|
let t = r[e];
|
|
461
479
|
return t?.kind == "poll" || t?.kind == "integration" ? [t.bindingId] : [];
|
|
@@ -464,34 +482,34 @@ function _(e, t, n) {
|
|
|
464
482
|
bindingId: t,
|
|
465
483
|
kind: "binding.delete"
|
|
466
484
|
});
|
|
467
|
-
return
|
|
485
|
+
return S(e, a);
|
|
468
486
|
}
|
|
469
|
-
function
|
|
470
|
-
let i =
|
|
487
|
+
function y(e, t, n, r) {
|
|
488
|
+
let i = D(e, t)?.nodes[n];
|
|
471
489
|
if (i == null || !("inputs" in i)) return;
|
|
472
490
|
let { concurrency: a, name: o, timeoutMs: s, ...c } = i;
|
|
473
|
-
return
|
|
491
|
+
return A(t, n, {
|
|
474
492
|
...c,
|
|
475
493
|
...r
|
|
476
494
|
});
|
|
477
495
|
}
|
|
478
|
-
function
|
|
479
|
-
let i =
|
|
496
|
+
function b(e, t, n, r) {
|
|
497
|
+
let i = D(e, t)?.nodes[n];
|
|
480
498
|
if (i == null || !("inputs" in i)) return;
|
|
481
499
|
let a = { ...i.inputs };
|
|
482
500
|
for (let [e, t] of Object.entries(r)) t === void 0 ? delete a[e] : a[e] = {
|
|
483
501
|
kind: "value",
|
|
484
502
|
value: t
|
|
485
503
|
};
|
|
486
|
-
return
|
|
504
|
+
return S(e, A(t, n, {
|
|
487
505
|
...i,
|
|
488
506
|
inputs: a
|
|
489
507
|
}));
|
|
490
508
|
}
|
|
491
|
-
function
|
|
492
|
-
let o =
|
|
509
|
+
function x(e, t, n, r, i, a) {
|
|
510
|
+
let o = D(e, t)?.nodes[n];
|
|
493
511
|
if (o == null || !("inputs" in o)) return;
|
|
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 =
|
|
512
|
+
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 = C(e.document);
|
|
495
513
|
if (c != null && l?.kind == "variable" && (u.get(c) ?? 0) == 1) return l.target == i ? [] : [{
|
|
496
514
|
binding: {
|
|
497
515
|
kind: "variable",
|
|
@@ -517,28 +535,30 @@ function b(e, t, n, r, i, a) {
|
|
|
517
535
|
},
|
|
518
536
|
bindingId: a,
|
|
519
537
|
kind: "binding.create"
|
|
520
|
-
}, ...
|
|
538
|
+
}, ...S(e, A(t, n, {
|
|
521
539
|
...o,
|
|
522
540
|
inputs: d
|
|
523
541
|
}))];
|
|
524
542
|
}
|
|
525
|
-
function
|
|
526
|
-
let n =
|
|
543
|
+
function S(e, t) {
|
|
544
|
+
let n = C(e.document), r = c(e, t), i = C(r.document);
|
|
527
545
|
return [...t, ...[...n.keys()].flatMap((e) => i.has(e) || r.document.bindings[e]?.kind != "variable" ? [] : [{
|
|
528
546
|
bindingId: e,
|
|
529
547
|
kind: "binding.delete"
|
|
530
548
|
}])];
|
|
531
549
|
}
|
|
532
|
-
function
|
|
550
|
+
function C(e) {
|
|
533
551
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
534
552
|
t.set(e, (t.get(e) ?? 0) + 1);
|
|
535
553
|
};
|
|
536
|
-
for (let t of [e.graph, ...Object.values(e.subflows).map((e) => e.graph)]) for (let e of Object.values(t.nodes))
|
|
537
|
-
|
|
554
|
+
for (let t of [e.graph, ...Object.values(e.subflows).map((e) => e.graph)]) for (let e of Object.values(t.nodes)) {
|
|
555
|
+
if ((e.kind == "poll" || e.kind == "integration") && n(e.bindingId), !("inputs" in e)) continue;
|
|
556
|
+
let t = [...Object.values(e.inputs), ...e.kind == "wait" && e.notification != null ? Object.values(e.notification.inputs) : []];
|
|
557
|
+
for (let e of t) if (e.kind == "sources") for (let t of e.sources) t.kind == "binding" && n(t.bindingId);
|
|
538
558
|
}
|
|
539
559
|
return t;
|
|
540
560
|
}
|
|
541
|
-
function
|
|
561
|
+
function w(e, t, n) {
|
|
542
562
|
let r = e.document.tasks[t];
|
|
543
563
|
if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return [{
|
|
544
564
|
kind: "task.replace",
|
|
@@ -552,7 +572,7 @@ function C(e, t, n) {
|
|
|
552
572
|
taskId: t
|
|
553
573
|
}];
|
|
554
574
|
}
|
|
555
|
-
function
|
|
575
|
+
function T(e, t, n, r) {
|
|
556
576
|
let i = e.document.graph.nodes[n];
|
|
557
577
|
if (i == null) return;
|
|
558
578
|
let a = {
|
|
@@ -599,9 +619,9 @@ function w(e, t, n, r) {
|
|
|
599
619
|
config: r.config
|
|
600
620
|
};
|
|
601
621
|
}
|
|
602
|
-
return
|
|
622
|
+
return A(t, n, o);
|
|
603
623
|
}
|
|
604
|
-
function
|
|
624
|
+
function E(e, t, n, r) {
|
|
605
625
|
let i = e.document.graph.nodes[n];
|
|
606
626
|
if (i == null || i.kind != "poll" && i.kind != "integration") return;
|
|
607
627
|
let a = e.document.bindings[i.bindingId];
|
|
@@ -622,19 +642,19 @@ function T(e, t, n, r) {
|
|
|
622
642
|
kind: "binding.replace"
|
|
623
643
|
}];
|
|
624
644
|
}
|
|
625
|
-
function
|
|
645
|
+
function D(e, t) {
|
|
626
646
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
627
647
|
}
|
|
628
|
-
function
|
|
648
|
+
function O(e) {
|
|
629
649
|
return Object.fromEntries(e.flatMap((e) => "handle" in e && Object.hasOwn(e, "value") ? [[e.handle, {
|
|
630
650
|
kind: "value",
|
|
631
651
|
value: e.value
|
|
632
652
|
}]] : []));
|
|
633
653
|
}
|
|
634
|
-
function
|
|
654
|
+
function k(e, t, n) {
|
|
635
655
|
return e != null && Object.hasOwn(e, t) ? e[t] : n;
|
|
636
656
|
}
|
|
637
|
-
function
|
|
657
|
+
function A(e, t, n) {
|
|
638
658
|
return [{
|
|
639
659
|
kind: "graph.node.replace",
|
|
640
660
|
node: n,
|
|
@@ -644,38 +664,38 @@ function k(e, t, n) {
|
|
|
644
664
|
}
|
|
645
665
|
//#endregion
|
|
646
666
|
//#region src/flow/common/edgeChanges.ts
|
|
647
|
-
function
|
|
667
|
+
function j(e, t, n) {
|
|
648
668
|
let r = {
|
|
649
669
|
source: n.source,
|
|
650
670
|
sourceHandle: n.sourceHandle,
|
|
651
671
|
target: n.target,
|
|
652
672
|
targetHandle: n.targetHandle
|
|
653
|
-
}, i =
|
|
654
|
-
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] :
|
|
673
|
+
}, i = N(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
674
|
+
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : S(e, [{
|
|
655
675
|
edge: r,
|
|
656
676
|
kind: "graph.edge.connect",
|
|
657
677
|
target: t
|
|
658
678
|
}]);
|
|
659
679
|
}
|
|
660
|
-
function
|
|
680
|
+
function M(e, t, n) {
|
|
661
681
|
let r = {
|
|
662
682
|
source: n.source,
|
|
663
683
|
sourceHandle: n.sourceHandle,
|
|
664
684
|
target: n.target,
|
|
665
685
|
targetHandle: n.targetHandle
|
|
666
|
-
}, i =
|
|
686
|
+
}, i = N(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
667
687
|
return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
668
688
|
edge: r,
|
|
669
689
|
kind: "graph.edge.disconnect",
|
|
670
690
|
target: t
|
|
671
691
|
}];
|
|
672
692
|
}
|
|
673
|
-
function
|
|
693
|
+
function N(e, t) {
|
|
674
694
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
675
695
|
}
|
|
676
696
|
//#endregion
|
|
677
697
|
//#region src/flow/common/moduleChanges.ts
|
|
678
|
-
async function
|
|
698
|
+
async function P(e) {
|
|
679
699
|
try {
|
|
680
700
|
let { parse: t } = await import("./lib-GrGxYjsJ.js"), n = t(e, {
|
|
681
701
|
errorRecovery: !0,
|
|
@@ -691,7 +711,7 @@ async function N(e) {
|
|
|
691
711
|
return [];
|
|
692
712
|
}
|
|
693
713
|
}
|
|
694
|
-
function
|
|
714
|
+
function F(e, t, n) {
|
|
695
715
|
return [{
|
|
696
716
|
imports: n,
|
|
697
717
|
kind: "module.source.replace",
|
|
@@ -699,13 +719,13 @@ function P(e, t, n) {
|
|
|
699
719
|
source: t
|
|
700
720
|
}];
|
|
701
721
|
}
|
|
702
|
-
function
|
|
722
|
+
function I(e, t) {
|
|
703
723
|
return [{
|
|
704
724
|
kind: "module.rename",
|
|
705
725
|
moduleId: e,
|
|
706
726
|
name: t
|
|
707
727
|
}];
|
|
708
728
|
}
|
|
709
|
-
var
|
|
729
|
+
var L = n("23456789abcdefghjkmnpqrstuvwxyz", 10);
|
|
710
730
|
//#endregion
|
|
711
|
-
export {
|
|
731
|
+
export { S as cleanVariableBindings, j as connect, L as createAuthoringId, g as createBuiltinTrigger, u as createCodeTask, p as createCondition, f as createLlmTask, d as createManagedTask, _ as createProviderTrigger, m as createValue, h as createWait, v as deleteNodes, M as disconnect, P as moduleImports, I as renameModule, F as replaceModuleSource, w as setConnectorConnection, b as setInputValues, x as setInputVariable, E as setTriggerConnection, y as updateSettings, T as updateTrigger };
|
|
@@ -63,6 +63,17 @@ export interface ValueNode extends GraphNodeBase {
|
|
|
63
63
|
readonly kind: 'value';
|
|
64
64
|
readonly values: readonly InputPort[];
|
|
65
65
|
}
|
|
66
|
+
export type WaitAction = 'approve' | 'continue' | 'reject';
|
|
67
|
+
export interface WaitNode extends GraphNodeBase {
|
|
68
|
+
readonly actions: readonly ['continue'] | readonly ['approve', 'reject'];
|
|
69
|
+
readonly kind: 'wait';
|
|
70
|
+
readonly notification?: {
|
|
71
|
+
readonly inputs: Readonly<Record<string, InputMapping>>;
|
|
72
|
+
readonly messageHandle: string;
|
|
73
|
+
readonly taskId: string;
|
|
74
|
+
};
|
|
75
|
+
readonly prompt: string;
|
|
76
|
+
}
|
|
66
77
|
export type ConditionOperator = '!=' | '<' | '<=' | '==' | '>' | '>=' | 'contains' | 'endsWith' | 'hasKey' | 'hasValue' | 'isEmpty' | 'isFalse' | 'isNotEmpty' | 'isNotNull' | 'isNull' | 'isTrue' | 'notContains' | 'notHasKey' | 'notHasValue' | 'startsWith';
|
|
67
78
|
export interface ConditionExpression {
|
|
68
79
|
readonly input: string;
|
|
@@ -109,9 +120,11 @@ export type TaskDefinition = InlineTaskDefinition | ManagedTaskDefinition;
|
|
|
109
120
|
export type TaskNode = GraphNodeBase & {
|
|
110
121
|
readonly kind: 'task';
|
|
111
122
|
} & ({
|
|
123
|
+
readonly additionalInputs?: readonly InputPort[];
|
|
112
124
|
readonly task: InlineTaskDefinition;
|
|
113
125
|
readonly taskId?: never;
|
|
114
126
|
} | {
|
|
127
|
+
readonly additionalInputs?: readonly InputPort[];
|
|
115
128
|
readonly task?: never;
|
|
116
129
|
readonly taskId: string;
|
|
117
130
|
});
|
|
@@ -192,7 +205,7 @@ export type TriggerNode = (TriggerNodeBase & {
|
|
|
192
205
|
};
|
|
193
206
|
readonly kind: 'integration';
|
|
194
207
|
});
|
|
195
|
-
export type GraphNode = ConditionNode | SubflowNode | TaskNode | TriggerNode | ValueNode;
|
|
208
|
+
export type GraphNode = ConditionNode | SubflowNode | TaskNode | TriggerNode | ValueNode | WaitNode;
|
|
196
209
|
export interface FlowDocument {
|
|
197
210
|
readonly bindings: Readonly<Record<string, {
|
|
198
211
|
readonly kind: 'connection' | 'variable';
|