@oomol-lab/open-flow 0.1.0-beta.5 → 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.
- package/dist/browser/{esm-xWDFFpGd.js → esm-CTcBY7hh.js} +1 -1
- package/dist/browser/flow-authoring.js +6 -0
- package/dist/browser/flow-change.d.ts +2 -0
- package/dist/browser/{flowChanges-CeMiiZIO.js → flowChanges-BDqD_Q4G.js} +68 -32
- package/dist/browser/{flowWorkspace-VnS8nLMT.js → flowWorkspace-CPBHm14t.js} +7735 -7706
- package/dist/browser/{typeScriptSession-Bj2HDFRd.js → typeScriptSession-_TgJ_7Oq.js} +1 -1
- package/dist/browser/{waitNotificationInputs-ClCAEIAM.js → waitNotificationInputs-lPrLDTOd.js} +1 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +354 -295
- package/dist/common/control-api-conformance.js +6 -0
- package/dist/common/flow-encoding.js +4 -0
- package/dist/common/flow-semantics.js +8 -10
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +27 -0
- package/dist/common/scheduler.d.ts +1 -1
- package/dist/common/scheduler.js +17 -18
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I as e, j as t, t as n } from "./dist-DxahK_I8.js";
|
|
2
2
|
import { r } from "./dist-BKuSVKCC.js";
|
|
3
|
-
import { r as i } from "./flowWorkspace-
|
|
3
|
+
import { r as i } from "./flowWorkspace-CPBHm14t.js";
|
|
4
4
|
//#region ../../node_modules/.bun/@uiw+codemirror-themes@4.25.11/node_modules/@uiw/codemirror-themes/esm/index.js
|
|
5
5
|
var a = (e) => {
|
|
6
6
|
var i = e.theme, a = e.settings, o = a === void 0 ? {} : a, s = e.styles, c = s === void 0 ? [] : s, l = { ".cm-gutters": {} }, u = {};
|
|
@@ -66,6 +66,7 @@ export interface ValueNode extends GraphNodeBase {
|
|
|
66
66
|
export type WaitAction = 'approve' | 'continue' | 'reject';
|
|
67
67
|
export interface WaitNode extends GraphNodeBase {
|
|
68
68
|
readonly actions: readonly ['continue'] | readonly ['approve', 'reject'];
|
|
69
|
+
readonly input: InputPort;
|
|
69
70
|
readonly kind: 'wait';
|
|
70
71
|
readonly notification?: {
|
|
71
72
|
readonly inputs: Readonly<Record<string, InputMapping>>;
|
|
@@ -73,6 +74,7 @@ export interface WaitNode extends GraphNodeBase {
|
|
|
73
74
|
readonly taskId: string;
|
|
74
75
|
};
|
|
75
76
|
readonly prompt: string;
|
|
77
|
+
readonly timeoutMs?: never;
|
|
76
78
|
}
|
|
77
79
|
export type ConditionOperator = '!=' | '<' | '<=' | '==' | '>' | '>=' | 'contains' | 'endsWith' | 'hasKey' | 'hasValue' | 'isEmpty' | 'isFalse' | 'isNotEmpty' | 'isNotNull' | 'isNull' | 'isTrue' | 'notContains' | 'notHasKey' | 'notHasValue' | 'startsWith';
|
|
78
80
|
export interface ConditionExpression {
|
|
@@ -1657,7 +1657,7 @@ var tt = class {
|
|
|
1657
1657
|
value: "值",
|
|
1658
1658
|
valueDescription: "为下游节点提供可复用的字面量。",
|
|
1659
1659
|
wait: "等待",
|
|
1660
|
-
waitDescription: "暂停 Run,直到 Operator
|
|
1660
|
+
waitDescription: "暂停 Run,直到 Operator 继续、审批或拒绝。",
|
|
1661
1661
|
webhook: "Webhook",
|
|
1662
1662
|
webhookDescription: "通过专属 HTTP 入口接收外部事件。"
|
|
1663
1663
|
},
|
|
@@ -4089,7 +4089,7 @@ var tt = class {
|
|
|
4089
4089
|
value: "Значение",
|
|
4090
4090
|
valueDescription: "Передавать нижестоящим узлам переиспользуемые литеральные значения.",
|
|
4091
4091
|
wait: "Ожидание",
|
|
4092
|
-
waitDescription: "Приостановить Run, пока оператор не
|
|
4092
|
+
waitDescription: "Приостановить Run, пока оператор не продолжит, не одобрит или не отклонит его.",
|
|
4093
4093
|
webhook: "Webhook",
|
|
4094
4094
|
webhookDescription: "Получать внешние события через выделенный HTTP-адрес."
|
|
4095
4095
|
},
|
|
@@ -5610,6 +5610,12 @@ function At(e, t, n) {
|
|
|
5610
5610
|
node: {
|
|
5611
5611
|
actions: ["continue"],
|
|
5612
5612
|
concurrency: 1,
|
|
5613
|
+
input: {
|
|
5614
|
+
handle: "value",
|
|
5615
|
+
jsonSchema: {},
|
|
5616
|
+
nullable: !0,
|
|
5617
|
+
value: null
|
|
5618
|
+
},
|
|
5613
5619
|
inputs: { value: {
|
|
5614
5620
|
kind: "value",
|
|
5615
5621
|
value: null
|
|
@@ -6351,7 +6357,7 @@ var mn = class {
|
|
|
6351
6357
|
}
|
|
6352
6358
|
async cancel() {
|
|
6353
6359
|
let e = this.#o.value.run;
|
|
6354
|
-
if (!pn(e) || this.#o.value.cancelingRunId != null) return;
|
|
6360
|
+
if (!pn(e) || this.#o.value.cancelingRunId != null || this.#o.value.resolvingAction != null) return;
|
|
6355
6361
|
let t = this.#e.begin();
|
|
6356
6362
|
this.#a(void 0), this.#p({ cancelingRunId: e.runId });
|
|
6357
6363
|
try {
|
|
@@ -6375,7 +6381,7 @@ var mn = class {
|
|
|
6375
6381
|
}
|
|
6376
6382
|
async resolve(e) {
|
|
6377
6383
|
let t = this.#o.value.run, n = t?.status == "waiting" && "waiting" in t ? t.waiting : void 0;
|
|
6378
|
-
if (!(t == null || n == null || this.#o.value.resolvingAction != null || !n.actions.some((t) => t == e))) {
|
|
6384
|
+
if (!(t == null || n == null || this.#o.value.cancelingRunId != null || this.#o.value.resolvingAction != null || !n.actions.some((t) => t == e))) {
|
|
6379
6385
|
this.#a(void 0), this.#p({ resolvingAction: e });
|
|
6380
6386
|
try {
|
|
6381
6387
|
let r = await this.#t.resolveRunWait(t.runId, n.waitId, e), i = this.#o.value.run;
|
|
@@ -10498,17 +10504,21 @@ function Ga(e) {
|
|
|
10498
10504
|
nullable: t.nullable
|
|
10499
10505
|
});
|
|
10500
10506
|
break;
|
|
10501
|
-
case "wait":
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10507
|
+
case "wait": {
|
|
10508
|
+
let r = e.node.input;
|
|
10509
|
+
t.set(r.handle, {
|
|
10510
|
+
defaultValue: r.value,
|
|
10511
|
+
description: r.description,
|
|
10512
|
+
jsonSchema: r.jsonSchema,
|
|
10513
|
+
nullable: r.nullable
|
|
10506
10514
|
});
|
|
10507
10515
|
for (let t of e.node.actions) n.set(t, {
|
|
10508
|
-
|
|
10509
|
-
|
|
10516
|
+
description: r.description,
|
|
10517
|
+
jsonSchema: r.jsonSchema,
|
|
10518
|
+
nullable: r.nullable
|
|
10510
10519
|
});
|
|
10511
10520
|
break;
|
|
10521
|
+
}
|
|
10512
10522
|
case "subflow": {
|
|
10513
10523
|
let r = e.definition;
|
|
10514
10524
|
for (let e of r?.inputs ?? []) t.set(e.handle, {
|
|
@@ -10588,7 +10598,9 @@ function qa(e, t, n) {
|
|
|
10588
10598
|
}
|
|
10589
10599
|
function Ja(e, t, n, r) {
|
|
10590
10600
|
if (t.kind != "flow" || n?.flowId != e.revision.flowId || n.revisionId != e.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
|
|
10591
|
-
let i = n.status == "queued" || n.status == "starting" || n.status == "running" || n.status == "waiting", a = /* @__PURE__ */ new Map()
|
|
10601
|
+
let i = n.status == "queued" || n.status == "starting" || n.status == "running" || n.status == "waiting", a = /* @__PURE__ */ new Map();
|
|
10602
|
+
n.status == "waiting" && "waiting" in n && n.waiting != null && a.set(n.waiting.nodeId, { status: "waiting" });
|
|
10603
|
+
let o = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.revision.flowId)?.payload.scopeId;
|
|
10592
10604
|
if (typeof o != "string") return {
|
|
10593
10605
|
nodes: a,
|
|
10594
10606
|
status: i ? "running" : "idle"
|
|
@@ -10628,13 +10640,6 @@ function Ja(e, t, n, r) {
|
|
|
10628
10640
|
});
|
|
10629
10641
|
}
|
|
10630
10642
|
}
|
|
10631
|
-
if (n.status == "waiting" && "waiting" in n && n.waiting != null) {
|
|
10632
|
-
let e = a.get(n.waiting.nodeId);
|
|
10633
|
-
a.set(n.waiting.nodeId, {
|
|
10634
|
-
...e,
|
|
10635
|
-
status: "waiting"
|
|
10636
|
-
});
|
|
10637
|
-
}
|
|
10638
10643
|
if (!i) for (let [e, t] of a) (t.status == "running" || t.status == "waiting") && a.set(e, {
|
|
10639
10644
|
...t,
|
|
10640
10645
|
status: "idle"
|
|
@@ -11504,7 +11509,7 @@ function Ro(e, t, n, r, i) {
|
|
|
11504
11509
|
case "code": return Tt(t, {
|
|
11505
11510
|
moduleId: n,
|
|
11506
11511
|
nodeId: n
|
|
11507
|
-
}, r.name);
|
|
11512
|
+
}, r.name, void 0, r.ports);
|
|
11508
11513
|
case "llm": return Dt(t, {
|
|
11509
11514
|
nodeId: n,
|
|
11510
11515
|
taskId: i()
|
|
@@ -11760,7 +11765,7 @@ function Jo(e, t, n, i) {
|
|
|
11760
11765
|
defaultOutput: o.defaultOutput,
|
|
11761
11766
|
input: o.input
|
|
11762
11767
|
};
|
|
11763
|
-
r(
|
|
11768
|
+
(!r(o.cases, i.cases) || o.defaultOutput != i.defaultOutput || !r(o.input, i.input)) && f.push({
|
|
11764
11769
|
before: e,
|
|
11765
11770
|
kind: "graph.node.condition.set",
|
|
11766
11771
|
nodeId: n,
|
|
@@ -11817,22 +11822,53 @@ function Xo(e, t, n, i) {
|
|
|
11817
11822
|
target: t,
|
|
11818
11823
|
value: c
|
|
11819
11824
|
});
|
|
11820
|
-
for (let [e,
|
|
11821
|
-
if (
|
|
11822
|
-
let r
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11825
|
+
for (let [e, i] of Object.entries(a.nodes)) {
|
|
11826
|
+
if (e == n || !("inputs" in i)) continue;
|
|
11827
|
+
for (let [r, a] of Object.entries(i.inputs)) {
|
|
11828
|
+
if (a.kind != "sources") continue;
|
|
11829
|
+
let i = a.sources.filter((e) => e.kind != "node" || e.nodeId != n || l.has(e.output));
|
|
11830
|
+
i.length != a.sources.length && u.push({
|
|
11831
|
+
before: a,
|
|
11832
|
+
handle: r,
|
|
11833
|
+
kind: "graph.node.input.set",
|
|
11834
|
+
nodeId: e,
|
|
11835
|
+
target: t,
|
|
11836
|
+
value: i.length == 0 ? void 0 : {
|
|
11837
|
+
kind: "sources",
|
|
11838
|
+
sources: i
|
|
11839
|
+
}
|
|
11840
|
+
});
|
|
11841
|
+
}
|
|
11842
|
+
if (i.kind != "wait" || i.notification == null) continue;
|
|
11843
|
+
let a = { ...i.notification.inputs };
|
|
11844
|
+
for (let [e, t] of Object.entries(a)) {
|
|
11845
|
+
if (t.kind != "sources") continue;
|
|
11846
|
+
let r = t.sources.filter((e) => e.kind != "node" || e.nodeId != n || l.has(e.output));
|
|
11847
|
+
r.length != t.sources.length && (r.length == 0 ? delete a[e] : a[e] = {
|
|
11830
11848
|
kind: "sources",
|
|
11831
11849
|
sources: r
|
|
11850
|
+
});
|
|
11851
|
+
}
|
|
11852
|
+
r(a, i.notification.inputs) || u.push({
|
|
11853
|
+
before: {
|
|
11854
|
+
actions: i.actions,
|
|
11855
|
+
notification: i.notification,
|
|
11856
|
+
prompt: i.prompt
|
|
11857
|
+
},
|
|
11858
|
+
kind: "graph.node.wait.set",
|
|
11859
|
+
nodeId: e,
|
|
11860
|
+
target: t,
|
|
11861
|
+
value: {
|
|
11862
|
+
actions: i.actions,
|
|
11863
|
+
notification: {
|
|
11864
|
+
...i.notification,
|
|
11865
|
+
inputs: a
|
|
11866
|
+
},
|
|
11867
|
+
prompt: i.prompt
|
|
11832
11868
|
}
|
|
11833
11869
|
});
|
|
11834
11870
|
}
|
|
11835
|
-
|
|
11871
|
+
return u.length == 0 ? [] : Io(e, D(e.revision.content, u), o.notification?.taskId == i.notification?.taskId ? void 0 : o.notification?.taskId);
|
|
11836
11872
|
}
|
|
11837
11873
|
function Zo(e, t, n, r) {
|
|
11838
11874
|
let i = e.graph({ kind: "flow" })?.nodes[t], a = Fo(n);
|