@oomol-lab/open-flow 0.1.0-beta.11 → 0.1.0-beta.12

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 (27) hide show
  1. package/dist/browser/{createResourceDialog-DhIU-HYW.js → createResourceDialog-2pESP2wA.js} +11 -11
  2. package/dist/browser/{esm-C64_h7HF.js → esm-BPZ0P6x4.js} +1 -1
  3. package/dist/browser/flow-authoring.js +88 -74
  4. package/dist/browser/flow-change-schema.d.ts +4 -1
  5. package/dist/browser/flow-change.js +1408 -1390
  6. package/dist/browser/{flowChanges-BINNGoug.js → flowChanges-CHPdBmZb.js} +953 -937
  7. package/dist/browser/{flowWorkspace-Dp_b8KXF.js → flowWorkspace-BLGcgnHj.js} +25733 -25724
  8. package/dist/browser/host-conformance.d.ts +7 -0
  9. package/dist/browser/host-conformance.js +33 -0
  10. package/dist/browser/{select-CbQHq-GM.js → select-Dn3vpjGC.js} +506 -485
  11. package/dist/browser/{waitNotificationInputs-fzyKN6mk.js → waitNotificationInputs-BFbQUOyp.js} +1 -1
  12. package/dist/browser/workbench.js +67 -61
  13. package/dist/browser/{workbenchSelect-BjbJjlNd.js → workbenchSelect-DzF8oik9.js} +7 -7
  14. package/dist/common/control-api-conformance.d.ts +6 -0
  15. package/dist/common/control-api-conformance.js +67 -1
  16. package/dist/common/control-api.js +5117 -434
  17. package/dist/common/control-requests.d.ts +68 -0
  18. package/dist/common/control-requests.js +4913 -0
  19. package/dist/common/flow-encoding.d.ts +3 -1
  20. package/dist/common/flow-encoding.js +4755 -59
  21. package/dist/common/flow-json.d.ts +2 -0
  22. package/dist/common/flow-semantics.js +1121 -1107
  23. package/dist/common/mcp-conformance.d.ts +2 -0
  24. package/dist/common/mcp.d.ts +545 -0
  25. package/dist/common/mcp.js +4964 -0
  26. package/dist/common/scheduler.js +513 -499
  27. package/package.json +13 -1
@@ -1,7 +1,7 @@
1
1
  import { a as e } from "./main-DmjVyuWr.js";
2
2
  import { Vn as t, jt as n } from "./getPseudoElementBounds-Dfqo78k7.js";
3
- import { C as r, S as i, b as a, c as o, g as s, x as c, y as l } from "./select-CbQHq-GM.js";
4
- import { c as u, i as d, n as f, o as p, r as m, s as h, t as g } from "./workbenchSelect-BjbJjlNd.js";
3
+ import { C as r, S as i, _ as a, b as o, c as s, w as c, x as l } from "./select-Dn3vpjGC.js";
4
+ import { c as u, i as d, n as f, o as p, r as m, s as h, t as g } from "./workbenchSelect-DzF8oik9.js";
5
5
  import { useEffect as _, useRef as v, useState as y } from "react";
6
6
  import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
7
7
  //#region src/workbench/browser/runtime/shell/createResourceDialog.tsx
@@ -30,15 +30,15 @@ function C({ disabled: C, field: w, id: T, issue: E, label: D, name: O, onNameCh
30
30
  variant: "ghost"
31
31
  }),
32
32
  type: "button",
33
- children: /* @__PURE__ */ x(o, { name: "close" })
33
+ children: /* @__PURE__ */ x(s, { name: "close" })
34
34
  })]
35
35
  }),
36
- /* @__PURE__ */ S(i, {
36
+ /* @__PURE__ */ S(r, {
37
37
  className: "gap-4",
38
- children: [/* @__PURE__ */ S(l, {
38
+ children: [/* @__PURE__ */ S(o, {
39
39
  "data-invalid": z,
40
40
  children: [
41
- /* @__PURE__ */ x(r, {
41
+ /* @__PURE__ */ x(c, {
42
42
  htmlFor: T,
43
43
  children: D
44
44
  }),
@@ -53,13 +53,13 @@ function C({ disabled: C, field: w, id: T, issue: E, label: D, name: O, onNameCh
53
53
  required: !0,
54
54
  value: O
55
55
  }),
56
- x(z ? c : a, {
56
+ x(z ? i : l, {
57
57
  id: V,
58
58
  children: B
59
59
  })
60
60
  ]
61
- }), w != null && /* @__PURE__ */ S(l, { children: [
62
- /* @__PURE__ */ x(r, {
61
+ }), w != null && /* @__PURE__ */ S(o, { children: [
62
+ /* @__PURE__ */ x(c, {
63
63
  htmlFor: w.state == "ready" ? H : void 0,
64
64
  children: w.label
65
65
  }),
@@ -75,7 +75,7 @@ function C({ disabled: C, field: w, id: T, issue: E, label: D, name: O, onNameCh
75
75
  className: "flex min-h-9 items-center gap-2 rounded-lg border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",
76
76
  role: w.state == "error" ? "alert" : "status",
77
77
  children: [
78
- w.state == "loading" && /* @__PURE__ */ x(s, { "aria-hidden": "true" }),
78
+ w.state == "loading" && /* @__PURE__ */ x(a, { "aria-hidden": "true" }),
79
79
  /* @__PURE__ */ x("span", { children: w.status }),
80
80
  w.state == "error" && /* @__PURE__ */ x(t, {
81
81
  className: "ml-auto bg-background",
@@ -87,7 +87,7 @@ function C({ disabled: C, field: w, id: T, issue: E, label: D, name: O, onNameCh
87
87
  })
88
88
  ]
89
89
  }),
90
- /* @__PURE__ */ x(a, { children: w.description })
90
+ /* @__PURE__ */ x(l, { children: w.description })
91
91
  ] })]
92
92
  }),
93
93
  /* @__PURE__ */ S(p, {
@@ -1,6 +1,6 @@
1
1
  import { r as e } from "./dist-BKuSVKCC.js";
2
2
  import { I as t, j as n, t as r } from "./dist-DxahK_I8.js";
3
- import { r as i } from "./flowWorkspace-Dp_b8KXF.js";
3
+ import { r as i } from "./flowWorkspace-BLGcgnHj.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 = (t) => {
6
6
  var i = t.theme, a = t.settings, o = a === void 0 ? {} : a, s = t.styles, c = s === void 0 ? [] : s, l = { ".cm-gutters": {} }, u = {};
@@ -4590,13 +4590,34 @@ var q = Co(), J = Rs(), zs = V(q), Bs = H({
4590
4590
  name: q,
4591
4591
  inputs: V(Y),
4592
4592
  outputs: V(Bs.extend({ sources: V(U([Hs, Us])) }))
4593
- }), lc = {
4593
+ }), lc = H({
4594
+ nodes: W(q, ac),
4595
+ edges: V(sc)
4596
+ }), uc = H({
4597
+ kind: G(["connection", "variable"]),
4598
+ target: q
4599
+ }), dc = H({
4600
+ name: q,
4601
+ imports: zs,
4602
+ source: q
4603
+ }), fc = H({
4604
+ bindings: W(q, uc),
4605
+ graph: lc,
4606
+ subflows: W(q, cc.extend({ graph: lc })),
4607
+ tasks: W(q, Xs)
4608
+ });
4609
+ H({
4610
+ modelVersion: K(1),
4611
+ document: fc,
4612
+ modules: W(q, dc)
4613
+ }).extend({
4614
+ kind: K("open-flow-flow-revision"),
4615
+ version: K(1)
4616
+ });
4617
+ var pc = {
4594
4618
  "binding.create": {
4595
4619
  bindingId: q,
4596
- binding: H({
4597
- kind: G(["connection", "variable"]),
4598
- target: q
4599
- })
4620
+ binding: uc
4600
4621
  },
4601
4622
  "binding.delete": { bindingId: q },
4602
4623
  "binding.target.set": {
@@ -4695,11 +4716,7 @@ var q = Co(), J = Rs(), zs = V(q), Bs = H({
4695
4716
  },
4696
4717
  "module.create": {
4697
4718
  moduleId: q,
4698
- module: H({
4699
- name: q,
4700
- imports: zs,
4701
- source: q
4702
- })
4719
+ module: dc
4703
4720
  },
4704
4721
  "module.delete": { moduleId: q },
4705
4722
  "module.rename": {
@@ -4716,10 +4733,7 @@ var q = Co(), J = Rs(), zs = V(q), Bs = H({
4716
4733
  },
4717
4734
  "subflow.create": {
4718
4735
  subflowId: q,
4719
- subflow: cc.extend({ graph: H({
4720
- nodes: W(q, ac),
4721
- edges: V(sc)
4722
- }) })
4736
+ subflow: cc.extend({ graph: lc })
4723
4737
  },
4724
4738
  "subflow.definition.set": {
4725
4739
  subflowId: q,
@@ -4748,13 +4762,13 @@ var q = Co(), J = Rs(), zs = V(q), Bs = H({
4748
4762
  value: q
4749
4763
  }
4750
4764
  };
4751
- V(U([...new Map(Object.entries(lc).map(([e, t]) => [e, t instanceof L ? t : H({
4765
+ V(U([...new Map(Object.entries(pc).map(([e, t]) => [e, t instanceof L ? t : H({
4752
4766
  kind: K(e),
4753
4767
  ...t
4754
4768
  })])).values()])).min(1);
4755
4769
  //#endregion
4756
4770
  //#region src/flow/common/change.ts
4757
- function uc(e) {
4771
+ function mc(e) {
4758
4772
  if (!Array.isArray(e)) throw TypeError("Connector capabilities must be an array.");
4759
4773
  let t = /* @__PURE__ */ new Set();
4760
4774
  return e.map((e) => {
@@ -4790,20 +4804,20 @@ function uc(e) {
4790
4804
  };
4791
4805
  });
4792
4806
  }
4793
- function dc(e) {
4807
+ function hc(e) {
4794
4808
  return e.trim().normalize("NFC");
4795
4809
  }
4796
- function fc(e, t, n) {
4797
- let r = dc(n);
4798
- return r.length == 0 ? "empty" : Object.entries(e.nodes).some(([e, n]) => e != t && n.name != null && dc(n.name) == r) ? "duplicate" : void 0;
4810
+ function gc(e, t, n) {
4811
+ let r = hc(n);
4812
+ return r.length == 0 ? "empty" : Object.entries(e.nodes).some(([e, n]) => e != t && n.name != null && hc(n.name) == r) ? "duplicate" : void 0;
4799
4813
  }
4800
- var pc = class extends Error {
4814
+ var _c = class extends Error {
4801
4815
  constructor(e) {
4802
4816
  super(e), this.name = "FlowChangeError";
4803
4817
  }
4804
4818
  };
4805
4819
  function Z(e) {
4806
- throw new pc(e);
4820
+ throw new _c(e);
4807
4821
  }
4808
4822
  function Q(e, t) {
4809
4823
  if (t.kind == "flow") return e.graph;
@@ -4827,7 +4841,7 @@ function $(e, t, n) {
4827
4841
  }
4828
4842
  };
4829
4843
  }
4830
- function mc(e, t) {
4844
+ function vc(e, t) {
4831
4845
  if (!("inputs" in e)) return e;
4832
4846
  let n = { ...e.inputs };
4833
4847
  for (let [e, r] of Object.entries(n)) {
@@ -4843,7 +4857,7 @@ function mc(e, t) {
4843
4857
  inputs: n
4844
4858
  };
4845
4859
  }
4846
- function hc(e, t) {
4860
+ function yc(e, t) {
4847
4861
  let n = { ...e.document }, r = { ...e.modules };
4848
4862
  for (let e of t) switch (e.kind) {
4849
4863
  case "binding.create":
@@ -4924,8 +4938,8 @@ function hc(e, t) {
4924
4938
  }
4925
4939
  case "graph.node.create": {
4926
4940
  let t = Q(n, e.target);
4927
- t.nodes[e.nodeId] != null && Z("A Node with this ID already exists in the target graph."), e.target.kind == "subflow" && !("inputs" in e.node) && Z("Trigger Nodes cannot be created inside a Subflow."), e.node.kind == "manual" && Object.values(t.nodes).some((e) => e.kind == "manual") && Z("A graph can contain only one manual Trigger."), e.node.kind == "task" && e.node.task?.capabilities !== void 0 && uc(e.node.task.capabilities), e.node.name ?? Z("A Node name cannot be empty.");
4928
- let r = dc(e.node.name), i = fc(t, e.nodeId, r);
4941
+ t.nodes[e.nodeId] != null && Z("A Node with this ID already exists in the target graph."), e.target.kind == "subflow" && !("inputs" in e.node) && Z("Trigger Nodes cannot be created inside a Subflow."), e.node.kind == "manual" && Object.values(t.nodes).some((e) => e.kind == "manual") && Z("A graph can contain only one manual Trigger."), e.node.kind == "task" && e.node.task?.capabilities !== void 0 && mc(e.node.task.capabilities), e.node.name ?? Z("A Node name cannot be empty.");
4942
+ let r = hc(e.node.name), i = gc(t, e.nodeId, r);
4929
4943
  i == "empty" && Z("A Node name cannot be empty."), i == "duplicate" && Z("A Node with this name already exists in the target graph.");
4930
4944
  let a = r == e.node.name ? e.node : {
4931
4945
  ...e.node,
@@ -4943,7 +4957,7 @@ function hc(e, t) {
4943
4957
  case "graph.node.delete": {
4944
4958
  let t = Q(n, e.target);
4945
4959
  t.nodes[e.nodeId] ?? Z("The Node does not exist in the target graph.");
4946
- let r = /* @__PURE__ */ new Set([e.nodeId]), i = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => r.has(e) ? [] : [[e, mc(t, r)]]));
4960
+ let r = /* @__PURE__ */ new Set([e.nodeId]), i = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => r.has(e) ? [] : [[e, vc(t, r)]]));
4947
4961
  if (Object.assign(n, $(n, e.target, {
4948
4962
  ...t,
4949
4963
  edges: t.edges.filter((e) => !r.has(e.source) && !r.has(e.target)),
@@ -4969,7 +4983,7 @@ function hc(e, t) {
4969
4983
  let a = { ...r };
4970
4984
  if (e.field == "name") {
4971
4985
  typeof e.value != "string" && Z("A Node name cannot be empty.");
4972
- let n = dc(e.value), r = fc(t, e.nodeId, n);
4986
+ let n = hc(e.value), r = gc(t, e.nodeId, n);
4973
4987
  r == "empty" && Z("A Node name cannot be empty."), r == "duplicate" && Z("A Node with this name already exists in the target graph."), Object.assign(a, { name: n });
4974
4988
  } else e.value == null ? Reflect.deleteProperty(a, e.field) : Object.assign(a, { [e.field]: e.value });
4975
4989
  Object.assign(n, $(n, e.target, {
@@ -5001,7 +5015,7 @@ function hc(e, t) {
5001
5015
  let t = Q(n, e.target), r = t.nodes[e.nodeId];
5002
5016
  (r?.kind != "task" || r.task == null) && Z("The inline Task Node does not exist."), i(r.task.capabilities, e.before) || Z("The inline Task capabilities changed before this operation was applied.");
5003
5017
  let a = { ...r.task };
5004
- e.value === void 0 ? delete a.capabilities : a.capabilities = uc(e.value), Object.assign(n, $(n, e.target, {
5018
+ e.value === void 0 ? delete a.capabilities : a.capabilities = mc(e.value), Object.assign(n, $(n, e.target, {
5005
5019
  ...t,
5006
5020
  nodes: {
5007
5021
  ...t.nodes,
@@ -5171,7 +5185,7 @@ function hc(e, t) {
5171
5185
  }
5172
5186
  case "subflow.create":
5173
5187
  n.subflows[e.subflowId] != null && Z("A Subflow with this ID already exists.");
5174
- for (let t of Object.values(e.subflow.graph.nodes)) t.kind == "task" && t.task?.capabilities !== void 0 && uc(t.task.capabilities);
5188
+ for (let t of Object.values(e.subflow.graph.nodes)) t.kind == "task" && t.task?.capabilities !== void 0 && mc(t.task.capabilities);
5175
5189
  n.subflows = {
5176
5190
  ...n.subflows,
5177
5191
  [e.subflowId]: e.subflow
@@ -5260,8 +5274,8 @@ function hc(e, t) {
5260
5274
  }
5261
5275
  //#endregion
5262
5276
  //#region src/flow/common/nodeChanges.ts
5263
- var gc = "export default async function (inputs, context) {\n return { result: inputs.value }\n}\n";
5264
- function _c(e, t, n, r = void 0, i = {
5277
+ var bc = "export default async function (inputs, context) {\n return { result: inputs.value }\n}\n";
5278
+ function xc(e, t, n, r = void 0, i = {
5265
5279
  inputs: [{
5266
5280
  handle: "value",
5267
5281
  jsonSchema: {},
@@ -5279,7 +5293,7 @@ function _c(e, t, n, r = void 0, i = {
5279
5293
  module: {
5280
5294
  ...r ?? {
5281
5295
  imports: [],
5282
- source: gc
5296
+ source: bc
5283
5297
  },
5284
5298
  name: n
5285
5299
  },
@@ -5287,7 +5301,7 @@ function _c(e, t, n, r = void 0, i = {
5287
5301
  }, {
5288
5302
  kind: "graph.node.create",
5289
5303
  node: {
5290
- inputs: Ic(i.inputs),
5304
+ inputs: Bc(i.inputs),
5291
5305
  kind: "task",
5292
5306
  name: n,
5293
5307
  task: {
@@ -5302,7 +5316,7 @@ function _c(e, t, n, r = void 0, i = {
5302
5316
  target: e
5303
5317
  }];
5304
5318
  }
5305
- function vc(e, t, n) {
5319
+ function Sc(e, t, n) {
5306
5320
  return [{
5307
5321
  kind: "task.create",
5308
5322
  task: n,
@@ -5310,7 +5324,7 @@ function vc(e, t, n) {
5310
5324
  }, {
5311
5325
  kind: "graph.node.create",
5312
5326
  node: {
5313
- inputs: Ic(n.inputs),
5327
+ inputs: Bc(n.inputs),
5314
5328
  kind: "task",
5315
5329
  name: n.name,
5316
5330
  taskId: t.taskId
@@ -5319,9 +5333,9 @@ function vc(e, t, n) {
5319
5333
  target: e
5320
5334
  }];
5321
5335
  }
5322
- function yc(e, t, n, r, i, a = {}) {
5336
+ function Cc(e, t, n, r, i, a = {}) {
5323
5337
  let o = a.inputs ?? {};
5324
- return vc(e, t, {
5338
+ return Sc(e, t, {
5325
5339
  executor: {
5326
5340
  kind: "llm",
5327
5341
  mode: r
@@ -5334,13 +5348,13 @@ function yc(e, t, n, r, i, a = {}) {
5334
5348
  type: "array"
5335
5349
  },
5336
5350
  nullable: !0,
5337
- value: Lc(o, "messages", null)
5351
+ value: Vc(o, "messages", null)
5338
5352
  },
5339
5353
  {
5340
5354
  handle: "input",
5341
5355
  jsonSchema: { type: "string" },
5342
5356
  nullable: !1,
5343
- value: Lc(o, "input", "Alex")
5357
+ value: Vc(o, "input", "Alex")
5344
5358
  },
5345
5359
  {
5346
5360
  handle: "template",
@@ -5350,7 +5364,7 @@ function yc(e, t, n, r, i, a = {}) {
5350
5364
  type: "array"
5351
5365
  },
5352
5366
  nullable: !1,
5353
- value: Lc(o, "template", [{
5367
+ value: Vc(o, "template", [{
5354
5368
  content: "Hello, I'm {{input}}",
5355
5369
  role: "user"
5356
5370
  }])
@@ -5359,7 +5373,7 @@ function yc(e, t, n, r, i, a = {}) {
5359
5373
  handle: "model",
5360
5374
  jsonSchema: { type: "object" },
5361
5375
  nullable: !1,
5362
- value: Lc(o, "model", { model: "deepseek-v4-flash" })
5376
+ value: Vc(o, "model", { model: "deepseek-v4-flash" })
5363
5377
  }
5364
5378
  ],
5365
5379
  name: n,
@@ -5372,7 +5386,7 @@ function yc(e, t, n, r, i, a = {}) {
5372
5386
  }]
5373
5387
  });
5374
5388
  }
5375
- function bc(e, t, n) {
5389
+ function wc(e, t, n) {
5376
5390
  return [{
5377
5391
  kind: "graph.node.create",
5378
5392
  node: {
@@ -5402,7 +5416,7 @@ function bc(e, t, n) {
5402
5416
  target: e
5403
5417
  }];
5404
5418
  }
5405
- function xc(e, t, n) {
5419
+ function Tc(e, t, n) {
5406
5420
  return [{
5407
5421
  kind: "graph.node.create",
5408
5422
  node: {
@@ -5420,7 +5434,7 @@ function xc(e, t, n) {
5420
5434
  target: e
5421
5435
  }];
5422
5436
  }
5423
- function Sc(e, t, n) {
5437
+ function Ec(e, t, n) {
5424
5438
  return [{
5425
5439
  kind: "graph.node.create",
5426
5440
  node: {
@@ -5443,7 +5457,7 @@ function Sc(e, t, n) {
5443
5457
  target: e
5444
5458
  }];
5445
5459
  }
5446
- function Cc(e, t, n) {
5460
+ function Dc(e, t, n) {
5447
5461
  return [{
5448
5462
  kind: "graph.node.create",
5449
5463
  node: n,
@@ -5451,7 +5465,7 @@ function Cc(e, t, n) {
5451
5465
  target: e
5452
5466
  }];
5453
5467
  }
5454
- function wc(e, t, n, r) {
5468
+ function Oc(e, t, n, r) {
5455
5469
  let i = r.name ?? n.displayName, a = n.type == "poll" ? {
5456
5470
  bindingId: t.bindingId,
5457
5471
  config: r.config,
@@ -5484,8 +5498,8 @@ function wc(e, t, n, r) {
5484
5498
  target: e
5485
5499
  }];
5486
5500
  }
5487
- function Tc(e, t, n) {
5488
- let r = Fc(e, t)?.nodes;
5501
+ function kc(e, t, n) {
5502
+ let r = zc(e, t)?.nodes;
5489
5503
  if (r == null) return [];
5490
5504
  let i = new Set(n), a = n.flatMap((e) => {
5491
5505
  let n = r[e];
@@ -5498,7 +5512,7 @@ function Tc(e, t, n) {
5498
5512
  moduleId: n.task.moduleId
5499
5513
  }] : []];
5500
5514
  });
5501
- if (t.kind == "subflow") return Ac(e, a);
5515
+ if (t.kind == "subflow") return Pc(e, a);
5502
5516
  let o = new Set(n.flatMap((e) => {
5503
5517
  let t = r[e];
5504
5518
  return t?.kind == "poll" || t?.kind == "integration" ? [t.bindingId] : [];
@@ -5507,10 +5521,10 @@ function Tc(e, t, n) {
5507
5521
  bindingId: t,
5508
5522
  kind: "binding.delete"
5509
5523
  });
5510
- return Ac(e, a);
5524
+ return Pc(e, a);
5511
5525
  }
5512
- function Ec(e, t, n, r) {
5513
- let i = Fc(e, t)?.nodes[n];
5526
+ function Ac(e, t, n, r) {
5527
+ let i = zc(e, t)?.nodes[n];
5514
5528
  if (i == null || !("inputs" in i)) return;
5515
5529
  let a = [];
5516
5530
  return i.name != r.name && a.push({
@@ -5529,8 +5543,8 @@ function Ec(e, t, n, r) {
5529
5543
  value: r.timeoutMs
5530
5544
  }), a;
5531
5545
  }
5532
- function Dc(e, t, n, r) {
5533
- let a = Fc(e, t)?.nodes[n];
5546
+ function jc(e, t, n, r) {
5547
+ let a = zc(e, t)?.nodes[n];
5534
5548
  if (a == null || !("inputs" in a)) return;
5535
5549
  let o = [];
5536
5550
  for (let [e, s] of Object.entries(r)) {
@@ -5547,11 +5561,11 @@ function Dc(e, t, n, r) {
5547
5561
  value: c
5548
5562
  });
5549
5563
  }
5550
- return Ac(e, o);
5564
+ return Pc(e, o);
5551
5565
  }
5552
- function Oc(e, t, n, r, i) {
5566
+ function Mc(e, t, n, r, i) {
5553
5567
  let a = (t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph)?.nodes[n];
5554
- return a == null || !("inputs" in a) ? [] : Ac(e, [{
5568
+ return a == null || !("inputs" in a) ? [] : Pc(e, [{
5555
5569
  kind: "graph.node.input.set",
5556
5570
  nodeId: n,
5557
5571
  handle: r,
@@ -5563,10 +5577,10 @@ function Oc(e, t, n, r, i) {
5563
5577
  }
5564
5578
  }]);
5565
5579
  }
5566
- function kc(e, t, n, r, i, a) {
5567
- let o = Fc(e, t)?.nodes[n];
5580
+ function Nc(e, t, n, r, i, a) {
5581
+ let o = zc(e, t)?.nodes[n];
5568
5582
  if (o == null || !("inputs" in o)) return;
5569
- 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 = jc(e.document);
5583
+ 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 = Fc(e.document);
5570
5584
  return c != null && l?.kind == "variable" && (u.get(c) ?? 0) == 1 ? l.target == i ? [] : [{
5571
5585
  before: l.target,
5572
5586
  bindingId: c,
@@ -5579,7 +5593,7 @@ function kc(e, t, n, r, i, a) {
5579
5593
  },
5580
5594
  bindingId: a,
5581
5595
  kind: "binding.create"
5582
- }, ...Ac(e, [{
5596
+ }, ...Pc(e, [{
5583
5597
  before: s,
5584
5598
  handle: r,
5585
5599
  kind: "graph.node.input.set",
@@ -5594,14 +5608,14 @@ function kc(e, t, n, r, i, a) {
5594
5608
  }
5595
5609
  }])];
5596
5610
  }
5597
- function Ac(e, t) {
5598
- let n = jc(e.document), r = hc(e, t), i = jc(r.document);
5611
+ function Pc(e, t) {
5612
+ let n = Fc(e.document), r = yc(e, t), i = Fc(r.document);
5599
5613
  return [...t, ...[...n.keys()].flatMap((e) => i.has(e) || r.document.bindings[e]?.kind != "variable" ? [] : [{
5600
5614
  bindingId: e,
5601
5615
  kind: "binding.delete"
5602
5616
  }])];
5603
5617
  }
5604
- function jc(e) {
5618
+ function Fc(e) {
5605
5619
  let t = /* @__PURE__ */ new Map(), n = (e) => {
5606
5620
  t.set(e, (t.get(e) ?? 0) + 1);
5607
5621
  };
@@ -5612,7 +5626,7 @@ function jc(e) {
5612
5626
  }
5613
5627
  return t;
5614
5628
  }
5615
- function Mc(e, t, n) {
5629
+ function Ic(e, t, n) {
5616
5630
  let r = e.document.tasks[t];
5617
5631
  if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return r.executor.connectionId == n ? [] : [{
5618
5632
  before: r.executor.connectionId,
@@ -5621,7 +5635,7 @@ function Mc(e, t, n) {
5621
5635
  value: n
5622
5636
  }];
5623
5637
  }
5624
- function Nc(e, t, n, r) {
5638
+ function Lc(e, t, n, r) {
5625
5639
  let a = e.document.graph.nodes[n];
5626
5640
  if (a == null) return;
5627
5641
  let o = [];
@@ -5698,7 +5712,7 @@ function Nc(e, t, n, r) {
5698
5712
  }
5699
5713
  return o;
5700
5714
  }
5701
- function Pc(e, t, n, r) {
5715
+ function Rc(e, t, n, r) {
5702
5716
  let i = e.document.graph.nodes[n];
5703
5717
  if (i == null || i.kind != "poll" && i.kind != "integration") return;
5704
5718
  let a = e.document.bindings[i.bindingId];
@@ -5717,19 +5731,19 @@ function Pc(e, t, n, r) {
5717
5731
  value: r
5718
5732
  }];
5719
5733
  }
5720
- function Fc(e, t) {
5734
+ function zc(e, t) {
5721
5735
  return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
5722
5736
  }
5723
- function Ic(e) {
5737
+ function Bc(e) {
5724
5738
  return Object.fromEntries(e.flatMap((e) => "handle" in e && Object.hasOwn(e, "value") ? [[e.handle, {
5725
5739
  kind: "value",
5726
5740
  value: e.value
5727
5741
  }]] : []));
5728
5742
  }
5729
- function Lc(e, t, n) {
5743
+ function Vc(e, t, n) {
5730
5744
  return e != null && Object.hasOwn(e, t) ? e[t] : n;
5731
5745
  }
5732
- function Rc(e, t, n, r) {
5746
+ function Hc(e, t, n, r) {
5733
5747
  let a = (t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph)?.nodes[n];
5734
5748
  if (!(a?.kind != "task" || a.task == null || i(a.task.capabilities ?? [], r))) return [{
5735
5749
  kind: "graph.node.task.capabilities.set",
@@ -5739,6 +5753,6 @@ function Rc(e, t, n, r) {
5739
5753
  value: r
5740
5754
  }];
5741
5755
  }
5742
- var zc = n("23456789abcdefghjkmnpqrstuvwxyz", 10);
5756
+ var Uc = n("23456789abcdefghjkmnpqrstuvwxyz", 10);
5743
5757
  //#endregion
5744
- export { Ac as cleanVariableBindings, a as connect, zc as createAuthoringId, Cc as createBuiltinTrigger, _c as createCodeTask, bc as createCondition, yc as createLlmTask, vc as createManagedTask, wc as createProviderTrigger, xc as createValue, Sc as createWait, Tc as deleteNodes, o as disconnect, c as moduleImports, u as renameModule, l as replaceModuleSource, Rc as setCodeActions, Mc as setConnectorConnection, Oc as setInputSources, Dc as setInputValues, kc as setInputVariable, Pc as setTriggerConnection, Ec as updateSettings, Nc as updateTrigger };
5758
+ export { Pc as cleanVariableBindings, a as connect, Uc as createAuthoringId, Dc as createBuiltinTrigger, xc as createCodeTask, wc as createCondition, Cc as createLlmTask, Sc as createManagedTask, Oc as createProviderTrigger, Tc as createValue, Ec as createWait, kc as deleteNodes, o as disconnect, c as moduleImports, u as renameModule, l as replaceModuleSource, Hc as setCodeActions, Ic as setConnectorConnection, Mc as setInputSources, jc as setInputValues, Nc as setInputVariable, Rc as setTriggerConnection, Ac as updateSettings, Lc as updateTrigger };
@@ -1,3 +1,6 @@
1
- import type { ChangeOperation, JsonValue } from './flow-change.js';
1
+ import type { ChangeOperation, FlowDocument, JsonValue, RevisionContent } from './flow-change.js';
2
+ export declare function decodeFlowDocument(value: unknown): FlowDocument;
3
+ export declare function decodeRevisionContent(value: unknown): RevisionContent;
4
+ export declare function decodeRevisionEnvelope(value: unknown): RevisionContent;
2
5
  export declare function decodeChangeOperations(value: unknown): readonly ChangeOperation[];
3
6
  export declare function changeOperationsSchema(kind?: string): JsonValue;