@oomol-lab/open-flow 0.1.0-beta.30 → 0.1.0-beta.31

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.
@@ -7288,7 +7288,10 @@ var Kd = I(R([L({
7288
7288
  }))
7289
7289
  })),
7290
7290
  defaultOutput: V.optional()
7291
- }, df = { prompt: V }, ff = {
7291
+ }, df = {
7292
+ inputDefinitions: I(Xd),
7293
+ prompt: V
7294
+ }, ff = {
7292
7295
  bodyFields: I(Xd),
7293
7296
  options: L({
7294
7297
  allowedMethods: Jd.optional(),
@@ -7370,13 +7373,11 @@ var Kd = I(R([L({
7370
7373
  dd({
7371
7374
  ...gf,
7372
7375
  kind: B("approval"),
7373
- input: Xd,
7374
7376
  ...df
7375
7377
  }).omit({ timeoutMs: !0 }),
7376
7378
  dd({
7377
7379
  ...gf,
7378
7380
  kind: B("wait"),
7379
- input: Xd,
7380
7381
  ...df
7381
7382
  }).omit({ timeoutMs: !0 }),
7382
7383
  L({
@@ -7444,16 +7445,16 @@ var Kd = I(R([L({
7444
7445
  graph: Sf,
7445
7446
  subflows: z(V, xf.extend({ graph: Sf })),
7446
7447
  tasks: z(V, lf)
7447
- }), Ef = L({
7448
+ });
7449
+ L({
7448
7450
  modelVersion: R([B(2), B(3)]),
7449
7451
  document: Tf,
7450
7452
  modules: z(V, wf)
7451
- });
7452
- Ef.extend({ modelVersion: B(3) }), Ef.extend({
7453
+ }).extend({
7453
7454
  kind: B("open-flow-flow-revision"),
7454
7455
  version: B(1)
7455
7456
  });
7456
- var Df = {
7457
+ var Ef = {
7457
7458
  "binding.create": {
7458
7459
  bindingId: V,
7459
7460
  binding: Cf
@@ -7616,13 +7617,13 @@ var Df = {
7616
7617
  value: V
7617
7618
  }
7618
7619
  };
7619
- I(R([...new Map(Object.entries(Df).map(([e, t]) => [e, t instanceof M ? t : L({
7620
+ I(R([...new Map(Object.entries(Ef).map(([e, t]) => [e, t instanceof M ? t : L({
7620
7621
  kind: B(e),
7621
7622
  ...t
7622
7623
  })])).values()])).min(1);
7623
7624
  //#endregion
7624
7625
  //#region src/flow/common/change.ts
7625
- var Of = /* @__PURE__ */ new Set([
7626
+ var Df = /* @__PURE__ */ new Set([
7626
7627
  "const",
7627
7628
  "enum",
7628
7629
  "exclusiveMaximum",
@@ -7640,16 +7641,16 @@ var Of = /* @__PURE__ */ new Set([
7640
7641
  "required",
7641
7642
  "type"
7642
7643
  ]);
7643
- function kf(e) {
7644
- return Of.has(e);
7644
+ function Of(e) {
7645
+ return Df.has(e);
7645
7646
  }
7646
- function Af(e) {
7647
+ function kf(e) {
7647
7648
  return e.length <= 256 && /^[A-Za-z_][A-Za-z0-9_]*$/.test(e) && e.slice(0, 3).toUpperCase() != "OO_";
7648
7649
  }
7649
- function jf(e) {
7650
+ function Af(e) {
7650
7651
  return Object.fromEntries(e.flatMap((e) => "handle" in e ? [[e.handle, e]] : []));
7651
7652
  }
7652
- function Mf(e) {
7653
+ function jf(e) {
7653
7654
  if (!Array.isArray(e)) throw TypeError("Connector capabilities must be an array.");
7654
7655
  let t = /* @__PURE__ */ new Set();
7655
7656
  return e.map((e) => {
@@ -7687,39 +7688,39 @@ function Mf(e) {
7687
7688
  }
7688
7689
  //#endregion
7689
7690
  //#region src/flow/common/schema.ts
7690
- function Nf(e, t) {
7691
+ function Mf(e, t) {
7691
7692
  if (e === t) return !0;
7692
7693
  if (e == null || t == null || typeof e != "object" || typeof t != "object") return !1;
7693
- if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => Nf(e, t[n]));
7694
+ if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => Mf(e, t[n]));
7694
7695
  let n = Object.entries(e), r = t;
7695
- return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) && Nf(t, r[e]));
7696
+ return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) && Mf(t, r[e]));
7696
7697
  }
7697
- function Pf(e) {
7698
+ function Nf(e) {
7698
7699
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
7699
7700
  }
7700
- function Ff(e) {
7701
+ function Pf(e) {
7701
7702
  return Array.isArray(e) ? e : void 0;
7702
7703
  }
7703
- var If = /* @__PURE__ */ new WeakMap();
7704
- function Lf(e, t) {
7704
+ var Ff = /* @__PURE__ */ new WeakMap();
7705
+ function If(e, t) {
7705
7706
  if (typeof t == "boolean") return t;
7706
- let n = Pf(t);
7707
- if (n == null || n.properties != null && Pf(n.properties) == null) return !1;
7707
+ let n = Nf(t);
7708
+ if (n == null || n.properties != null && Nf(n.properties) == null) return !1;
7708
7709
  try {
7709
- let t = If.get(n);
7710
+ let t = Ff.get(n);
7710
7711
  if (t == null) {
7711
7712
  let e = typeof n.$schema == "string" ? n.$schema : "", r = e.includes("draft-04") ? "4" : e.includes("draft-07") ? "7" : e.includes("2020-12") ? "2020-12" : "2019-09";
7712
- t = new Ce(structuredClone(n), r), If.set(n, t);
7713
+ t = new Ce(structuredClone(n), r), Ff.set(n, t);
7713
7714
  }
7714
7715
  return t.validate(e).valid;
7715
7716
  } catch {
7716
7717
  return !1;
7717
7718
  }
7718
7719
  }
7719
- function Rf(e, t, n = !1, r = !1) {
7720
+ function Lf(e, t, n = !1, r = !1) {
7720
7721
  if (t === !0) return { kind: "compatible" };
7721
7722
  if (e === !1 || t === !1) return { kind: "incompatible" };
7722
- let i = e === !0 ? {} : Pf(e), a = Pf(t);
7723
+ let i = e === !0 ? {} : Nf(e), a = Nf(t);
7723
7724
  if (i == null || a == null) return {
7724
7725
  kind: "compare-error",
7725
7726
  message: "Port schema must be an object or boolean."
@@ -7738,20 +7739,20 @@ function Rf(e, t, n = !1, r = !1) {
7738
7739
  errorPath: Br(o.errorPath, r)
7739
7740
  } : o;
7740
7741
  }
7741
- function zf(e, t) {
7742
+ function Rf(e, t) {
7742
7743
  let n = e;
7743
7744
  for (let e of t) {
7744
7745
  if (typeof n != "object" || !n) return;
7745
- n = Array.isArray(n) ? n[Number(e)] : Pf(n)?.[String(e)];
7746
+ n = Array.isArray(n) ? n[Number(e)] : Nf(n)?.[String(e)];
7746
7747
  }
7747
7748
  return n;
7748
7749
  }
7749
- function Bf(e, t, n) {
7750
+ function zf(e, t, n) {
7750
7751
  if (e.nullable && !t.nullable) return { kind: "nullable" };
7751
7752
  if (n.error == "edgeError.binDiffType") return { kind: "binary" };
7752
7753
  if (n.error == "edgeError.artifactDiffType") return { kind: "artifact" };
7753
- let r = Pf(e.jsonSchema), i = Pf(t.jsonSchema), a = n.errorPath == null && r != null && i != null ? Vf(r, i) : void 0, o = a == null ? n.errorPath : [a], s = o?.at(-1);
7754
- if (typeof s != "string" || !kf(s)) return {
7754
+ let r = Nf(e.jsonSchema), i = Nf(t.jsonSchema), a = n.errorPath == null && r != null && i != null ? Bf(r, i) : void 0, o = a == null ? n.errorPath : [a], s = o?.at(-1);
7755
+ if (typeof s != "string" || !Of(s)) return {
7755
7756
  kind: "schema",
7756
7757
  path: o
7757
7758
  };
@@ -7760,19 +7761,19 @@ function Bf(e, t, n) {
7760
7761
  kind: "keyword",
7761
7762
  keyword: s,
7762
7763
  path: c,
7763
- source: zf(e.jsonSchema, [...c, s]),
7764
- target: zf(t.jsonSchema, [...c, s])
7764
+ source: Rf(e.jsonSchema, [...c, s]),
7765
+ target: Rf(t.jsonSchema, [...c, s])
7765
7766
  };
7766
7767
  }
7767
- function Vf(e, t) {
7768
- if (!Nf(e.type, t.type)) return "type";
7769
- if (t.const !== void 0 && !Nf(e.const, t.const)) return "const";
7770
- if (t.enum !== void 0 && !Nf(e.enum, t.enum)) return "enum";
7768
+ function Bf(e, t) {
7769
+ if (!Mf(e.type, t.type)) return "type";
7770
+ if (t.const !== void 0 && !Mf(e.const, t.const)) return "const";
7771
+ if (t.enum !== void 0 && !Mf(e.enum, t.enum)) return "enum";
7771
7772
  let n = new Set(Array.isArray(e.required) ? e.required : []);
7772
7773
  if (Array.isArray(t.required) && t.required.some((e) => typeof e == "string" && !n.has(e))) return "required";
7773
- for (let n of Hf) if (t[n] !== void 0 && !Nf(e[n], t[n])) return n;
7774
+ for (let n of Vf) if (t[n] !== void 0 && !Mf(e[n], t[n])) return n;
7774
7775
  }
7775
- var Hf = [
7776
+ var Vf = [
7776
7777
  "minLength",
7777
7778
  "maxLength",
7778
7779
  "pattern",
@@ -7786,31 +7787,31 @@ var Hf = [
7786
7787
  "minProperties",
7787
7788
  "maxProperties"
7788
7789
  ];
7789
- function Uf(e, t) {
7790
- let n = Rf(e.jsonSchema, t.jsonSchema, e.nullable, t.nullable);
7790
+ function Hf(e, t) {
7791
+ let n = Lf(e.jsonSchema, t.jsonSchema, e.nullable, t.nullable);
7791
7792
  return n.kind == "incompatible" ? {
7792
7793
  kind: "incompatible",
7793
- mismatch: Bf(e, t, n)
7794
+ mismatch: zf(e, t, n)
7794
7795
  } : n;
7795
7796
  }
7796
- function Wf(e, t) {
7797
- return Uf(e, t).kind == "compatible";
7797
+ function Uf(e, t) {
7798
+ return Hf(e, t).kind == "compatible";
7798
7799
  }
7799
- function Gf(e) {
7800
- let t = Pf(e), n = Ff(t?.type);
7801
- return t != null && n?.includes("string") ? Rf({ type: "string" }, {
7800
+ function Wf(e) {
7801
+ let t = Nf(e), n = Pf(t?.type);
7802
+ return t != null && n?.includes("string") ? Lf({ type: "string" }, {
7802
7803
  ...t,
7803
7804
  type: "string"
7804
- }).kind == "compatible" : Rf({ type: "string" }, e).kind == "compatible";
7805
+ }).kind == "compatible" : Lf({ type: "string" }, e).kind == "compatible";
7805
7806
  }
7806
- function Kf(e) {
7807
+ function Gf(e) {
7807
7808
  if (typeof e != "object" || !e) return !1;
7808
7809
  let t = e;
7809
- return t.contentMediaType == "oomol/ref" || Object.values(t).some(Kf);
7810
+ return t.contentMediaType == "oomol/ref" || Object.values(t).some(Gf);
7810
7811
  }
7811
7812
  //#endregion
7812
7813
  //#region src/trigger/common/contract.ts
7813
- var qf = [
7814
+ var Kf = [
7814
7815
  {
7815
7816
  handle: "headers",
7816
7817
  jsonSchema: {
@@ -7843,7 +7844,7 @@ var qf = [
7843
7844
  jsonSchema: { type: "string" },
7844
7845
  nullable: !1
7845
7846
  }
7846
- ], Jf = [{
7847
+ ], qf = [{
7847
7848
  description: "The scheduled time that triggered this run, in ISO 8601 format.",
7848
7849
  handle: "scheduledAt",
7849
7850
  jsonSchema: {
@@ -7852,13 +7853,13 @@ var qf = [
7852
7853
  },
7853
7854
  nullable: !1
7854
7855
  }];
7855
- function Yf(e) {
7856
+ function Jf(e) {
7856
7857
  switch (e.kind) {
7857
7858
  case "manual": return [];
7858
- case "cron": return Jf;
7859
+ case "cron": return qf;
7859
7860
  case "poll":
7860
7861
  case "integration": return e.definition.outputs;
7861
- case "webhook": return qf.map((t) => t.handle === "body" ? Object.assign({}, t, { jsonSchema: {
7862
+ case "webhook": return Kf.map((t) => t.handle === "body" ? Object.assign({}, t, { jsonSchema: {
7862
7863
  type: "object",
7863
7864
  additionalProperties: !1,
7864
7865
  properties: Object.fromEntries(e.bodyFields.map((e) => [e.handle, e.jsonSchema])),
@@ -7866,24 +7867,24 @@ function Yf(e) {
7866
7867
  } }) : t);
7867
7868
  }
7868
7869
  }
7869
- function Xf(e) {
7870
- return Object.fromEntries(Yf(e).map(({ handle: e, ...t }) => [e, t]));
7870
+ function Yf(e) {
7871
+ return Object.fromEntries(Jf(e).map(({ handle: e, ...t }) => [e, t]));
7871
7872
  }
7872
- function Zf(e, n) {
7873
+ function Xf(e, n) {
7873
7874
  if (!t(n)) return !1;
7874
- let r = Yf(e);
7875
- return new Set(r.map((e) => e.handle)).size === r.length && Object.keys(n).length === r.length && r.every((e) => Object.hasOwn(n, e.handle) && (n[e.handle] === null && e.nullable || Lf(n[e.handle], e.jsonSchema)));
7875
+ let r = Jf(e);
7876
+ return new Set(r.map((e) => e.handle)).size === r.length && Object.keys(n).length === r.length && r.every((e) => Object.hasOwn(n, e.handle) && (n[e.handle] === null && e.nullable || If(n[e.handle], e.jsonSchema)));
7876
7877
  }
7877
7878
  //#endregion
7878
7879
  //#region src/execution/common/engineContract.ts
7879
- var Qf = "open-flow-engine/v5", $f = "open-flow-engine/v5/nodejs-compat-v1", ep = {
7880
+ var Zf = "open-flow-engine/v5", Qf = "open-flow-engine/v5/nodejs-compat-v1", $f = {
7880
7881
  platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
7881
7882
  platformModule: "open-flow:platform",
7882
- platformSource: `export const engineContract = ${JSON.stringify(Qf)}
7883
+ platformSource: `export const engineContract = ${JSON.stringify(Zf)}
7883
7884
  export function identity(value) { return value }
7884
7885
  `
7885
- }, tp = {
7886
- ...ep,
7886
+ }, ep = {
7887
+ ...$f,
7887
7888
  builtinModules: new Set([
7888
7889
  "assert",
7889
7890
  "assert/strict",
@@ -7910,13 +7911,13 @@ export function identity(value) { return value }
7910
7911
  "util",
7911
7912
  "zlib"
7912
7913
  ].flatMap((e) => [e, `node:${e}`])),
7913
- platformSource: `export const engineContract = ${JSON.stringify($f)}
7914
+ platformSource: `export const engineContract = ${JSON.stringify(Qf)}
7914
7915
  export function identity(value) { return value }
7915
7916
  `
7916
7917
  };
7917
- function np(e) {
7918
- if (e == "open-flow-engine/v5") return ep;
7919
- if (e == "open-flow-engine/v5/nodejs-compat-v1") return tp;
7918
+ function tp(e) {
7919
+ if (e == "open-flow-engine/v5") return $f;
7920
+ if (e == "open-flow-engine/v5/nodejs-compat-v1") return ep;
7920
7921
  }
7921
7922
  //#endregion
7922
7923
  //#region src/flow/common/agent.ts
@@ -8006,18 +8007,18 @@ var H = Bd(() => R([nd(), dd({
8006
8007
  maximum: F().optional(),
8007
8008
  exclusiveMinimum: F().optional(),
8008
8009
  exclusiveMaximum: F().optional()
8009
- }).transform(({ title: e, default: t, examples: n, readOnly: r, writeOnly: i, deprecated: a, $comment: o, ...s }) => s)])), rp = /* @__PURE__ */ new Set([
8010
+ }).transform(({ title: e, default: t, examples: n, readOnly: r, writeOnly: i, deprecated: a, $comment: o, ...s }) => s)])), np = /* @__PURE__ */ new Set([
8010
8011
  "properties",
8011
8012
  "patternProperties",
8012
8013
  "dependentSchemas",
8013
8014
  "$defs",
8014
8015
  "definitions"
8015
- ]), ip = /* @__PURE__ */ new Set([
8016
+ ]), rp = /* @__PURE__ */ new Set([
8016
8017
  "allOf",
8017
8018
  "anyOf",
8018
8019
  "oneOf",
8019
8020
  "prefixItems"
8020
- ]), ap = /* @__PURE__ */ new Set([
8021
+ ]), ip = /* @__PURE__ */ new Set([
8021
8022
  "not",
8022
8023
  "if",
8023
8024
  "then",
@@ -8030,10 +8031,10 @@ var H = Bd(() => R([nd(), dd({
8030
8031
  "unevaluatedProperties",
8031
8032
  "unevaluatedItems"
8032
8033
  ]);
8033
- function op(e, t = !0) {
8034
- let n = H.parse(e), r = Pf(n)?.$schema?.toString().includes("draft-07") == 1, i = 0, a = (e, o, s) => {
8034
+ function ap(e, t = !0) {
8035
+ let n = H.parse(e), r = Nf(n)?.$schema?.toString().includes("draft-07") == 1, i = 0, a = (e, o, s) => {
8035
8036
  if (++i > 4096 || s > 64) throw Error("Expanded schema exceeds the size or depth limit.");
8036
- let c = Pf(e);
8037
+ let c = Nf(e);
8037
8038
  if (c == null) return e;
8038
8039
  if (typeof c.$ref == "string") {
8039
8040
  let i = c.$ref;
@@ -8044,22 +8045,22 @@ function op(e, t = !0) {
8044
8045
  }
8045
8046
  let l = n;
8046
8047
  for (let e of i == "#" ? [] : i.slice(2).split("/")) {
8047
- let t = decodeURIComponent(e).replace(/~1/g, "/").replace(/~0/g, "~"), n = Array.isArray(l) ? Object.fromEntries(l.map((e, t) => [String(t), e])) : Pf(l);
8048
+ let t = decodeURIComponent(e).replace(/~1/g, "/").replace(/~0/g, "~"), n = Array.isArray(l) ? Object.fromEntries(l.map((e, t) => [String(t), e])) : Nf(l);
8048
8049
  if (n == null || !Object.hasOwn(n, t)) throw Error(`Unresolved schema reference: ${i}`);
8049
8050
  l = n[t];
8050
8051
  }
8051
- if (typeof l != "boolean" && Pf(l) == null) throw Error(`Reference does not point to a schema: ${i}`);
8052
+ if (typeof l != "boolean" && Nf(l) == null) throw Error(`Reference does not point to a schema: ${i}`);
8052
8053
  let u = a(l, [...o, i], s + 1), { $ref: d, ...f } = c;
8053
8054
  return r || Object.keys(f).length == 0 ? u : { allOf: [u, a(f, o, s + 1)] };
8054
8055
  }
8055
- return Object.fromEntries(Object.entries(c).flatMap(([e, t]) => e == "$defs" || e == "definitions" || e == "$schema" ? [] : rp.has(e) ? [[e, Object.fromEntries(Object.entries(Pf(t) ?? {}).map(([e, t]) => [e, a(t, o, s + 1)]))]] : ip.has(e) || e == "items" && Array.isArray(t) ? [[e, t.map((e) => a(e, o, s + 1))]] : ap.has(e) ? [[e, a(t, o, s + 1)]] : e == "dependencies" ? [[e, Object.fromEntries(Object.entries(Pf(t) ?? {}).map(([e, t]) => [e, Array.isArray(t) ? t : a(t, o, s + 1)]))]] : [[e, t]]));
8056
+ return Object.fromEntries(Object.entries(c).flatMap(([e, t]) => e == "$defs" || e == "definitions" || e == "$schema" ? [] : np.has(e) ? [[e, Object.fromEntries(Object.entries(Nf(t) ?? {}).map(([e, t]) => [e, a(t, o, s + 1)]))]] : rp.has(e) || e == "items" && Array.isArray(t) ? [[e, t.map((e) => a(e, o, s + 1))]] : ip.has(e) ? [[e, a(t, o, s + 1)]] : e == "dependencies" ? [[e, Object.fromEntries(Object.entries(Nf(t) ?? {}).map(([e, t]) => [e, Array.isArray(t) ? t : a(t, o, s + 1)]))]] : [[e, t]]));
8056
8057
  };
8057
8058
  return a(n, [], 0);
8058
8059
  }
8059
- function sp(e, t = !1) {
8060
+ function op(e, t = !1) {
8060
8061
  let n = H.safeParse(e);
8061
8062
  if (n.success) try {
8062
- op(e, t);
8063
+ ap(e, t);
8063
8064
  return;
8064
8065
  } catch (e) {
8065
8066
  return e instanceof Error ? e.message : String(e);
@@ -8072,26 +8073,26 @@ function sp(e, t = !1) {
8072
8073
  let i = r.find((e) => e.code == "unrecognized_keys") ?? r.at(-1), a = i.code == "unrecognized_keys" ? `unsupported keywords: ${i.keys.join(", ")}` : i.message;
8073
8074
  return `${i.path.length == 0 ? "" : `${i.path.map(String).join(".")}: `}${a}`;
8074
8075
  }
8075
- function cp(e, t) {
8076
+ function sp(e, t) {
8076
8077
  if (e.executor.kind != "agent") return [];
8077
- let n = e.executor, r = [], i = jf(e.inputs), a = (e, t) => {
8078
- if (e.kind == "value") return !(e.value === null && t.nullable) && !Lf(e.value, t.jsonSchema);
8078
+ let n = e.executor, r = [], i = Af(e.inputs), a = (e, t) => {
8079
+ if (e.kind == "value") return !(e.value === null && t.nullable) && !If(e.value, t.jsonSchema);
8079
8080
  let n = i[e.input];
8080
- return n == null || !Wf(n, t);
8081
+ return n == null || !Uf(n, t);
8081
8082
  };
8082
8083
  n.model.trim().length == 0 && r.push("Choose an Agent model."), (!Number.isSafeInteger(n.maxRounds) || n.maxRounds < 1 || n.maxRounds > 100) && r.push("Agent maxRounds must be between 1 and 100."), a(n.prompt, {
8083
8084
  jsonSchema: { type: "string" },
8084
8085
  nullable: !1
8085
8086
  }) && r.push("Agent prompt must resolve to a string input or value.");
8086
8087
  let o = e.outputs.filter((e) => "handle" in e);
8087
- (o.length != 1 || o[0]?.handle != "output" || o[0].nullable || sp(o[0].jsonSchema) != null) && r.push("Agent requires one non-nullable output named output with a supported JSON schema."), (n.tools.length == 0 && n.code != 1 || n.tools.length > 64) && r.push("Declare up to 64 Agent tools and enable at least one tool or code computation.");
8088
+ (o.length != 1 || o[0]?.handle != "output" || o[0].nullable || op(o[0].jsonSchema) != null) && r.push("Agent requires one non-nullable output named output with a supported JSON schema."), (n.tools.length == 0 && n.code != 1 || n.tools.length > 64) && r.push("Declare up to 64 Agent tools and enable at least one tool or code computation.");
8088
8089
  let s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
8089
8090
  for (let e of n.tools) {
8090
8091
  (e.id.length == 0 || s.has(e.id)) && r.push("Agent tool identities must be non-empty and unique."), (!/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e.name) || c.has(e.name)) && r.push("Agent tool names must be unique provider-compatible names."), (e.name == "read_result" || e.name == "run_code") && r.push(`Tool name ${e.name} is reserved for built-in Agent tools.`), s.add(e.id), c.add(e.name), e.description.trim().length == 0 && r.push(`Tool ${e.name} requires a description.`), (!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(e.action) || e.connectionId === "") && r.push(`Tool ${e.name} has an invalid Action or Connection.`);
8091
8092
  let t = /* @__PURE__ */ new Set();
8092
8093
  for (let n of e.inputs) {
8093
8094
  (n.handle.length == 0 || t.has(n.handle)) && r.push(`Tool ${e.name} has an empty or duplicate input.`), t.add(n.handle);
8094
- let i = sp(n.jsonSchema, n.source.kind == "model");
8095
+ let i = op(n.jsonSchema, n.source.kind == "model");
8095
8096
  i != null && r.push(`Tool ${e.name} input ${n.handle} has an invalid schema (${i}).`), Object.hasOwn(n, "value") && r.push(`Tool ${e.name} input ${n.handle} must specify its value through source.`), n.source.kind != "model" && a(n.source, n) && r.push(`Tool ${e.name} input ${n.handle} has an incompatible source.`);
8096
8097
  }
8097
8098
  }
@@ -8099,8 +8100,8 @@ function cp(e, t) {
8099
8100
  let e = n.notification, i = t[e.taskId];
8100
8101
  if (i?.executor.kind != "connector") r.push("Agent notification must reference a Connector Task.");
8101
8102
  else {
8102
- let t = jf(i.inputs), n = t[e.messageHandle];
8103
- (n == null || !Wf({
8103
+ let t = Af(i.inputs), n = t[e.messageHandle];
8104
+ (n == null || !Uf({
8104
8105
  jsonSchema: { type: "string" },
8105
8106
  nullable: !1
8106
8107
  }, n)) && r.push("Agent notification requires a string message input."), Object.hasOwn(e.inputs, e.messageHandle) && r.push("Agent notification message is supplied by the host.");
@@ -8113,18 +8114,18 @@ function cp(e, t) {
8113
8114
  }
8114
8115
  return r;
8115
8116
  }
8116
- function lp(e, t) {
8117
+ function cp(e, t) {
8117
8118
  if (e.kind == "value") return e.value;
8118
8119
  if (!Object.hasOwn(t, e.input)) throw Error(`Agent input ${e.input} is missing.`);
8119
8120
  return t[e.input];
8120
8121
  }
8121
- function up(e) {
8122
+ function lp(e) {
8122
8123
  let t = e.inputs.filter((e) => e.source.kind == "model");
8123
8124
  return {
8124
8125
  type: "object",
8125
8126
  additionalProperties: !1,
8126
8127
  properties: Object.fromEntries(t.map((e) => {
8127
- let t = op(e.jsonSchema);
8128
+ let t = ap(e.jsonSchema);
8128
8129
  return [e.handle, {
8129
8130
  ...e.nullable ? { anyOf: [t, { type: "null" }] } : typeof t == "object" && t ? t : { allOf: [t] },
8130
8131
  ...e.description == null ? {} : { description: e.description }
@@ -8133,36 +8134,36 @@ function up(e) {
8133
8134
  required: t.map((e) => e.handle)
8134
8135
  };
8135
8136
  }
8136
- function dp(e, t, n) {
8137
+ function up(e, t, n) {
8137
8138
  Gd(n);
8138
8139
  let r = z(N(), Wd()).parse(n);
8139
- if (!Lf(r, up(e))) throw Error(`Tool ${e.name} arguments do not match the model input schema.`);
8140
+ if (!If(r, lp(e))) throw Error(`Tool ${e.name} arguments do not match the model input schema.`);
8140
8141
  return Object.fromEntries(e.inputs.map((n) => {
8141
- let i = n.source.kind == "model" ? r[n.handle] : lp(n.source, t);
8142
- if (i === void 0 || !(i === null && n.nullable) && !Lf(i, n.jsonSchema)) throw Error(`Tool ${e.name} input ${n.handle} is invalid.`);
8142
+ let i = n.source.kind == "model" ? r[n.handle] : cp(n.source, t);
8143
+ if (i === void 0 || !(i === null && n.nullable) && !If(i, n.jsonSchema)) throw Error(`Tool ${e.name} input ${n.handle} is invalid.`);
8143
8144
  return [n.handle, i];
8144
8145
  }));
8145
8146
  }
8146
8147
  //#endregion
8147
8148
  //#region src/flow/common/encoding.ts
8148
- var fp = new TextEncoder();
8149
- function pp(e) {
8149
+ var dp = new TextEncoder();
8150
+ function fp(e) {
8150
8151
  if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
8151
- if (Array.isArray(e)) return `[${e.map(pp).join(",")}]`;
8152
+ if (Array.isArray(e)) return `[${e.map(fp).join(",")}]`;
8152
8153
  let t = e;
8153
- return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${pp(t[e])}`).join(",")}}`;
8154
+ return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${fp(t[e])}`).join(",")}}`;
8154
8155
  }
8155
- function mp(e) {
8156
- return fp.encode(pp(e));
8156
+ function pp(e) {
8157
+ return dp.encode(fp(e));
8157
8158
  }
8158
- async function hp(e) {
8159
+ async function mp(e) {
8159
8160
  let t = new Uint8Array(e.byteLength);
8160
8161
  return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
8161
8162
  }
8162
- function gp(e) {
8163
+ function hp(e) {
8163
8164
  return Object.keys(e).toSorted().map((t) => [t, e[t]]);
8164
8165
  }
8165
- function _p(e) {
8166
+ function gp(e) {
8166
8167
  return "handle" in e ? {
8167
8168
  ...e.description == null ? {} : { description: e.description },
8168
8169
  handle: e.handle,
@@ -8174,10 +8175,10 @@ function _p(e) {
8174
8175
  group: e.group
8175
8176
  };
8176
8177
  }
8177
- function vp(e) {
8178
- return e.map(_p);
8178
+ function _p(e) {
8179
+ return e.map(gp);
8179
8180
  }
8180
- function yp(e) {
8181
+ function vp(e) {
8181
8182
  switch (e.kind) {
8182
8183
  case "sources": return {
8183
8184
  kind: e.kind,
@@ -8189,10 +8190,10 @@ function yp(e) {
8189
8190
  };
8190
8191
  }
8191
8192
  }
8192
- function bp(e) {
8193
- return Object.fromEntries(gp(e).map(([e, t]) => [e, yp(t)]));
8193
+ function yp(e) {
8194
+ return Object.fromEntries(hp(e).map(([e, t]) => [e, vp(t)]));
8194
8195
  }
8195
- function xp(e) {
8196
+ function bp(e) {
8196
8197
  return e.map((e) => ({
8197
8198
  ...e.description == null ? {} : { description: e.description },
8198
8199
  handle: e.handle,
@@ -8201,12 +8202,12 @@ function xp(e) {
8201
8202
  sources: e.sources.map((e) => ({ ...e }))
8202
8203
  }));
8203
8204
  }
8204
- function Sp(e) {
8205
- if (!("inputs" in e)) return Ip(e);
8205
+ function xp(e) {
8206
+ if (!("inputs" in e)) return Fp(e);
8206
8207
  let t = {
8207
8208
  ...e.description == null ? {} : { description: e.description },
8208
8209
  ...e.icon == null ? {} : { icon: e.icon },
8209
- inputs: bp(e.inputs),
8210
+ inputs: yp(e.inputs),
8210
8211
  ...e.name == null ? {} : { name: e.name },
8211
8212
  ...e.maxExecutions == null ? {} : { maxExecutions: e.maxExecutions },
8212
8213
  ...e.timeoutMs == null ? {} : { timeoutMs: e.timeoutMs }
@@ -8226,7 +8227,7 @@ function Sp(e) {
8226
8227
  ...e.defaultOutput == null ? {} : { defaultOutput: e.defaultOutput },
8227
8228
  input: {
8228
8229
  handle: e.input.handle,
8229
- ..._p(e.input)
8230
+ ...gp(e.input)
8230
8231
  },
8231
8232
  kind: e.kind
8232
8233
  };
@@ -8241,114 +8242,117 @@ function Sp(e) {
8241
8242
  taskId: e.taskId
8242
8243
  }) : Object.assign({}, t, {
8243
8244
  kind: e.kind,
8244
- task: Mp(e.task)
8245
+ task: jp(e.task)
8245
8246
  });
8246
- return e.additionalInputs != null && (n.additionalInputs = vp(e.additionalInputs)), n;
8247
+ return e.additionalInputs != null && (n.additionalInputs = _p(e.additionalInputs)), n;
8247
8248
  }
8248
8249
  case "value": return {
8249
8250
  ...t,
8250
8251
  kind: e.kind,
8251
- values: vp(e.values)
8252
+ values: _p(e.values)
8252
8253
  };
8253
8254
  case "approval":
8254
8255
  case "wait": return {
8255
8256
  ...t,
8256
- input: {
8257
- handle: e.input.handle,
8258
- ..._p(e.input)
8259
- },
8257
+ inputDefinitions: _p(e.inputDefinitions),
8260
8258
  kind: e.kind,
8261
8259
  prompt: e.prompt
8262
8260
  };
8263
8261
  }
8264
8262
  }
8265
- function Cp(e) {
8263
+ function Sp(e) {
8266
8264
  return {
8267
8265
  edges: e.edges.map((e) => ({ ...e })).toSorted((e, t) => {
8268
- let n = pp(e), r = pp(t);
8266
+ let n = fp(e), r = fp(t);
8269
8267
  return n < r ? -1 : +(n > r);
8270
8268
  }),
8271
- nodes: Object.fromEntries(gp(e.nodes).map(([e, t]) => [e, Sp(t)]))
8269
+ nodes: Object.fromEntries(hp(e.nodes).map(([e, t]) => [e, xp(t)]))
8272
8270
  };
8273
8271
  }
8274
- function wp(e) {
8272
+ function Cp(e) {
8275
8273
  return new Set(Object.entries(e.nodes).flatMap(([e, t]) => t.kind == "approval" || t.kind == "wait" ? [e] : []));
8276
8274
  }
8277
- function Tp(e, t) {
8275
+ function wp(e, t) {
8278
8276
  let n = typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
8279
8277
  return n?.kind == "node" && typeof n.nodeId == "string" && t.has(n.nodeId) && n.output == "pending" ? {
8280
8278
  ...n,
8281
8279
  output: "notification"
8282
8280
  } : e;
8283
8281
  }
8284
- function Ep(e, t) {
8285
- let n = bp(e);
8286
- return Object.fromEntries(gp(n).map(([e, n]) => {
8282
+ function Tp(e, t) {
8283
+ let n = yp(e);
8284
+ return Object.fromEntries(hp(n).map(([e, n]) => {
8287
8285
  let r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
8288
8286
  return r?.kind != "sources" || !Array.isArray(r.sources) ? [e, n] : [e, {
8289
8287
  ...r,
8290
- sources: r.sources.map((e) => Tp(e, t))
8288
+ sources: r.sources.map((e) => wp(e, t))
8291
8289
  }];
8292
8290
  }));
8293
8291
  }
8294
- function Dp(e) {
8295
- let t = wp(e);
8292
+ function Ep(e) {
8293
+ let t = Cp(e);
8296
8294
  return {
8297
8295
  edges: e.edges.map((e) => t.has(e.source) && e.sourceHandle == "pending" ? {
8298
8296
  ...e,
8299
8297
  sourceHandle: "notification"
8300
8298
  } : { ...e }).toSorted((e, t) => {
8301
- let n = pp(e), r = pp(t);
8299
+ let n = fp(e), r = fp(t);
8302
8300
  return n < r ? -1 : +(n > r);
8303
8301
  }),
8304
- nodes: Object.fromEntries(gp(e.nodes).map(([e, n]) => {
8305
- let r = Sp(n);
8306
- return n.kind != "approval" && n.kind != "wait" ? [e, "inputs" in n ? {
8307
- ...r,
8308
- inputs: Ep(n.inputs, t)
8309
- } : r] : [e, {
8302
+ nodes: Object.fromEntries(hp(e.nodes).map(([e, n]) => {
8303
+ let r = xp(n);
8304
+ if (n.kind != "approval" && n.kind != "wait") return [e, "inputs" in n ? {
8310
8305
  ...r,
8306
+ inputs: Tp(n.inputs, t)
8307
+ } : r];
8308
+ let { inputDefinitions: i, ...a } = r, o = n.inputDefinitions[0];
8309
+ return [e, {
8310
+ ...a,
8311
8311
  actions: n.kind == "wait" ? ["continue"] : ["approve", "reject"],
8312
- inputs: Ep(n.inputs, t),
8312
+ input: {
8313
+ handle: o.handle,
8314
+ ...gp(o)
8315
+ },
8316
+ inputs: Tp(n.inputs, t),
8313
8317
  kind: "wait"
8314
8318
  }];
8315
8319
  }))
8316
8320
  };
8317
8321
  }
8318
- function Op(e, t) {
8319
- let n = wp(t);
8322
+ function Dp(e, t) {
8323
+ let n = Cp(t);
8320
8324
  return e.map((e) => ({
8321
8325
  ...e.description == null ? {} : { description: e.description },
8322
8326
  handle: e.handle,
8323
8327
  jsonSchema: e.jsonSchema,
8324
8328
  nullable: e.nullable,
8325
- sources: e.sources.map((e) => Tp(e, n))
8329
+ sources: e.sources.map((e) => wp(e, n))
8326
8330
  }));
8327
8331
  }
8328
- function kp(e, t) {
8329
- return e.modelVersion == 2 ? Dp(t) : Cp(t);
8332
+ function Op(e, t) {
8333
+ return e.modelVersion == 2 ? Ep(t) : Sp(t);
8330
8334
  }
8331
- function Ap(e, t, n) {
8332
- return e.modelVersion == 2 ? Op(t, n) : xp(t);
8335
+ function kp(e, t, n) {
8336
+ return e.modelVersion == 2 ? Dp(t, n) : bp(t);
8333
8337
  }
8334
- function jp(e) {
8338
+ function Ap(e) {
8335
8339
  return {
8336
8340
  executor: e.executor,
8337
- inputs: vp(e.inputs),
8341
+ inputs: _p(e.inputs),
8338
8342
  name: e.name,
8339
- outputs: vp(e.outputs)
8343
+ outputs: _p(e.outputs)
8340
8344
  };
8341
8345
  }
8342
- function Mp(e) {
8346
+ function jp(e) {
8343
8347
  return {
8344
8348
  ...e.capabilities == null ? {} : { capabilities: e.capabilities },
8345
- inputs: vp(e.inputs),
8349
+ inputs: _p(e.inputs),
8346
8350
  moduleId: e.moduleId,
8347
8351
  name: e.name,
8348
- outputs: vp(e.outputs)
8352
+ outputs: _p(e.outputs)
8349
8353
  };
8350
8354
  }
8351
- function Np(e) {
8355
+ function Mp(e) {
8352
8356
  return {
8353
8357
  configSchema: e.configSchema,
8354
8358
  definitionVersion: e.definitionVersion,
@@ -8365,12 +8369,12 @@ function Np(e) {
8365
8369
  } } : {},
8366
8370
  key: e.key,
8367
8371
  name: e.name,
8368
- outputs: vp(e.outputs),
8372
+ outputs: _p(e.outputs),
8369
8373
  provider: e.provider,
8370
8374
  type: e.type
8371
8375
  };
8372
8376
  }
8373
- function Pp(e) {
8377
+ function Np(e) {
8374
8378
  return {
8375
8379
  ...e.allowedMethods == null ? {} : { allowedMethods: e.allowedMethods },
8376
8380
  ...e.allowedOrigins == null ? {} : { allowedOrigins: e.allowedOrigins },
@@ -8380,7 +8384,7 @@ function Pp(e) {
8380
8384
  ...e.responseStatusCode == null ? {} : { responseStatusCode: e.responseStatusCode }
8381
8385
  };
8382
8386
  }
8383
- function Fp(e) {
8387
+ function Pp(e) {
8384
8388
  switch (e.type) {
8385
8389
  case "cron": return {
8386
8390
  expression: e.expression,
@@ -8394,7 +8398,7 @@ function Fp(e) {
8394
8398
  };
8395
8399
  }
8396
8400
  }
8397
- function Ip(e) {
8401
+ function Fp(e) {
8398
8402
  let t = (t) => ({
8399
8403
  ...e.description == null ? {} : { description: e.description },
8400
8404
  ...e.icon == null ? {} : { icon: e.icon },
@@ -8407,42 +8411,42 @@ function Ip(e) {
8407
8411
  ...t(e.kind),
8408
8412
  bodyFields: e.bodyFields.map((e) => ({
8409
8413
  handle: e.handle,
8410
- ..._p(e)
8414
+ ...gp(e)
8411
8415
  })),
8412
- ...e.options == null ? {} : { options: Pp(e.options) }
8416
+ ...e.options == null ? {} : { options: Np(e.options) }
8413
8417
  };
8414
8418
  case "cron": return {
8415
8419
  ...t(e.kind),
8416
- cronTimes: e.cronTimes.map(Fp)
8420
+ cronTimes: e.cronTimes.map(Pp)
8417
8421
  };
8418
8422
  case "poll": return {
8419
8423
  ...t(e.kind),
8420
8424
  bindingId: e.bindingId,
8421
8425
  config: e.config,
8422
- definition: Np(e.definition),
8423
- pollTimes: e.pollTimes.map(Fp)
8426
+ definition: Mp(e.definition),
8427
+ pollTimes: e.pollTimes.map(Pp)
8424
8428
  };
8425
8429
  case "integration": return {
8426
8430
  ...t(e.kind),
8427
8431
  bindingId: e.bindingId,
8428
8432
  config: e.config,
8429
- definition: Np(e.definition)
8433
+ definition: Mp(e.definition)
8430
8434
  };
8431
8435
  }
8432
8436
  }
8433
- function Lp(e) {
8437
+ function Ip(e) {
8434
8438
  return {
8435
8439
  imports: e.imports.toSorted(),
8436
8440
  name: e.name,
8437
8441
  source: e.source
8438
8442
  };
8439
8443
  }
8440
- var Rp = z(N(), od()), zp = L({
8444
+ var Lp = z(N(), od()), Rp = L({
8441
8445
  jsonSchema: od(),
8442
8446
  nullable: nd(),
8443
8447
  value: od().optional(),
8444
8448
  description: N().optional()
8445
- }).strict(), Bp = z(N(), zp), Vp = R([L({
8449
+ }).strict(), zp = z(N(), Rp), Bp = R([L({
8446
8450
  kind: B("value"),
8447
8451
  value: od()
8448
8452
  }).strict(), L({
@@ -8452,36 +8456,36 @@ var Rp = z(N(), od()), zp = L({
8452
8456
  nodeId: N(),
8453
8457
  output: N()
8454
8458
  }).strict())
8455
- }).strict()]), Hp = {
8459
+ }).strict()]), Vp = {
8456
8460
  name: N().optional(),
8457
8461
  description: N().optional(),
8458
8462
  icon: N().optional()
8459
- }, Up = R([
8463
+ }, Hp = R([
8460
8464
  L({
8461
- ...Hp,
8465
+ ...Vp,
8462
8466
  kind: B("cron"),
8463
8467
  cronTimes: I(od())
8464
8468
  }).strict(),
8465
8469
  L({
8466
- ...Hp,
8470
+ ...Vp,
8467
8471
  kind: B("manual")
8468
8472
  }).strict(),
8469
8473
  L({
8470
- ...Hp,
8474
+ ...Vp,
8471
8475
  kind: B("task"),
8472
8476
  concurrency: B(1).optional(),
8473
- inputs: z(N(), Vp),
8477
+ inputs: z(N(), Bp),
8474
8478
  task: L({
8475
8479
  name: N(),
8476
8480
  moduleId: N(),
8477
- inputs: Bp,
8478
- outputs: z(N(), zp.omit({ value: !0 }))
8481
+ inputs: zp,
8482
+ outputs: z(N(), Rp.omit({ value: !0 }))
8479
8483
  }).strict()
8480
8484
  }).strict()
8481
8485
  ]);
8482
8486
  L({
8483
8487
  name: N(),
8484
- graph: L({ nodes: z(N(), Up) }).strict()
8488
+ graph: L({ nodes: z(N(), Hp) }).strict()
8485
8489
  }).strict(), L({
8486
8490
  kind: B("open-flow-project-revision"),
8487
8491
  version: B(1),
@@ -8492,15 +8496,15 @@ L({
8492
8496
  imports: I(N())
8493
8497
  }).strict()),
8494
8498
  document: L({
8495
- bindings: Rp,
8496
- flows: Rp,
8497
- subflows: Rp,
8498
- tasks: Rp
8499
+ bindings: Lp,
8500
+ flows: Lp,
8501
+ subflows: Lp,
8502
+ tasks: Lp
8499
8503
  }).strict()
8500
8504
  }).strict();
8501
8505
  //#endregion
8502
8506
  //#region src/flow/common/graph.ts
8503
- function Wp(e) {
8507
+ function Up(e) {
8504
8508
  return e?.kind == "approval" || e?.kind == "wait";
8505
8509
  }
8506
8510
  function U(e, t, n, r, i) {
@@ -8514,8 +8518,8 @@ function U(e, t, n, r, i) {
8514
8518
  ...r == null ? {} : { values: r }
8515
8519
  };
8516
8520
  }
8517
- function Gp(e, t, n, r, i) {
8518
- let a = Yf(t).map((e) => e.handle);
8521
+ function Wp(e, t, n, r, i) {
8522
+ let a = Jf(t).map((e) => e.handle);
8519
8523
  if (new Set(a).size !== a.length && i.push(U("graph.port-duplicate", "Trigger output handles must be unique.", `${r}/definition/outputs`)), t.kind == "webhook") {
8520
8524
  let e = /* @__PURE__ */ new Set();
8521
8525
  for (let [n, a] of t.bodyFields.entries()) e.has(a.handle) && i.push(U("trigger.input-duplicate", `Webhook Trigger input "${a.handle}" is declared more than once.`, `${r}/bodyFields/${n}/handle`, { input: a.handle })), e.add(a.handle);
@@ -8524,17 +8528,17 @@ function Gp(e, t, n, r, i) {
8524
8528
  if (t.kind == "cron" || t.kind == "manual") return;
8525
8529
  let o = n.bindings[t.bindingId];
8526
8530
  o == null ? i.push(U("trigger.connection-missing", `Trigger Connection binding "${t.bindingId}" does not exist.`, `${r}/bindingId`, { bindingId: t.bindingId })) : o.kind != "connection" && i.push(U("trigger.connection-invalid", `Trigger binding "${t.bindingId}" must be a Connection.`, `${r}/bindingId`, { bindingId: t.bindingId }));
8527
- let s = Ff(Pf(t.definition.configSchema)?.required)?.filter((e) => typeof e == "string" && !Object.hasOwn(t.config, e)) ?? [];
8528
- s.length > 0 ? i.push(U("trigger.config-incomplete", `Complete the required Trigger config fields: ${s.join(", ")}.`, `${r}/config`, { fields: s.join(", ") })) : Lf(t.config, t.definition.configSchema) || i.push(U("trigger.config-invalid", `Trigger "${e}" config does not match its fixed definition.`, `${r}/config`, { triggerId: e }));
8531
+ let s = Pf(Nf(t.definition.configSchema)?.required)?.filter((e) => typeof e == "string" && !Object.hasOwn(t.config, e)) ?? [];
8532
+ s.length > 0 ? i.push(U("trigger.config-incomplete", `Complete the required Trigger config fields: ${s.join(", ")}.`, `${r}/config`, { fields: s.join(", ") })) : If(t.config, t.definition.configSchema) || i.push(U("trigger.config-invalid", `Trigger "${e}" config does not match its fixed definition.`, `${r}/config`, { triggerId: e }));
8529
8533
  }
8530
- function Kp(e, t) {
8534
+ function Gp(e, t) {
8531
8535
  switch (t.kind) {
8532
8536
  case "condition": return { [t.input.handle]: t.input };
8533
8537
  case "value": return {};
8534
- case "subflow": return jf(e.subflows[t.subflowId]?.inputs ?? []);
8535
- case "task": return jf([...t.task == null ? e.tasks[t.taskId]?.inputs ?? [] : t.task.inputs, ...t.additionalInputs ?? []]);
8538
+ case "subflow": return Af(e.subflows[t.subflowId]?.inputs ?? []);
8539
+ case "task": return Af([...t.task == null ? e.tasks[t.taskId]?.inputs ?? [] : t.task.inputs, ...t.additionalInputs ?? []]);
8536
8540
  case "approval":
8537
- case "wait": return { [t.input.handle]: t.input };
8541
+ case "wait": return Af(t.inputDefinitions);
8538
8542
  case "cron":
8539
8543
  case "integration":
8540
8544
  case "poll":
@@ -8542,47 +8546,38 @@ function Kp(e, t) {
8542
8546
  case "webhook": return {};
8543
8547
  }
8544
8548
  }
8545
- function qp(e) {
8549
+ function Kp(e) {
8546
8550
  return e.kind == "wait" ? ["continue"] : ["approve", "reject"];
8547
8551
  }
8552
+ var qp = (e) => ({
8553
+ nullable: !1,
8554
+ jsonSchema: {
8555
+ type: "object",
8556
+ properties: e,
8557
+ required: Object.keys(e),
8558
+ additionalProperties: !1
8559
+ }
8560
+ });
8548
8561
  function Jp(e) {
8549
- let t = qp(e);
8562
+ let t = Kp(e), n = {
8563
+ type: "object",
8564
+ properties: Object.fromEntries(e.inputDefinitions.map((e) => [e.handle, {}])),
8565
+ required: e.inputDefinitions.map((e) => e.handle),
8566
+ additionalProperties: !1
8567
+ };
8550
8568
  return {
8551
- pending: {
8552
- nullable: !1,
8553
- jsonSchema: {
8554
- type: "object",
8555
- properties: {
8556
- value: e.input.nullable ? { anyOf: [e.input.jsonSchema, { type: "null" }] } : e.input.jsonSchema,
8557
- prompt: { type: "string" },
8558
- actions: {
8559
- type: "array",
8560
- items: {
8561
- type: "object",
8562
- properties: {
8563
- action: { enum: t },
8564
- url: { type: "string" }
8565
- },
8566
- required: ["action", "url"],
8567
- additionalProperties: !1
8568
- }
8569
- },
8570
- expiresAt: { type: "string" }
8571
- },
8572
- required: [
8573
- "value",
8574
- "prompt",
8575
- "actions",
8576
- "expiresAt"
8577
- ],
8578
- additionalProperties: !1
8579
- }
8580
- },
8581
- ...Object.fromEntries(t.map((t) => [t, {
8582
- jsonSchema: e.input.jsonSchema,
8583
- nullable: e.input.nullable,
8584
- ...e.input.description == null ? {} : { description: e.input.description }
8585
- }]))
8569
+ pending: qp({
8570
+ inputs: n,
8571
+ prompt: { type: "string" },
8572
+ ...Object.fromEntries(t.map((e) => [`${e}Url`, { type: "string" }])),
8573
+ expiresAt: { type: "string" }
8574
+ }),
8575
+ ...Object.fromEntries(t.map((e) => [e, qp({
8576
+ inputs: n,
8577
+ action: { const: e },
8578
+ resolvedAt: { type: "string" },
8579
+ comment: { type: ["string", "null"] }
8580
+ })]))
8586
8581
  };
8587
8582
  }
8588
8583
  function Yp(e, t) {
@@ -8591,22 +8586,22 @@ function Yp(e, t) {
8591
8586
  let e = [...t.cases.map((e) => e.output), ...t.defaultOutput == null ? [] : [t.defaultOutput]];
8592
8587
  return Object.fromEntries(e.map((e) => [e, t.input]));
8593
8588
  }
8594
- case "value": return jf(t.values);
8595
- case "subflow": return jf(e.subflows[t.subflowId]?.outputs ?? []);
8596
- case "task": return jf(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
8589
+ case "value": return Af(t.values);
8590
+ case "subflow": return Af(e.subflows[t.subflowId]?.outputs ?? []);
8591
+ case "task": return Af(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
8597
8592
  case "approval":
8598
8593
  case "wait": return Jp(t);
8599
8594
  case "cron":
8600
8595
  case "integration":
8601
8596
  case "poll":
8602
8597
  case "manual":
8603
- case "webhook": return Xf(t);
8598
+ case "webhook": return Yf(t);
8604
8599
  }
8605
8600
  }
8606
8601
  function Xp(e, t, n, r, i, a, o) {
8607
8602
  switch (e.kind) {
8608
8603
  case "binding":
8609
- n.bindings[e.bindingId] == null ? o.push(U("graph.binding-missing", `Binding "${e.bindingId}" does not exist.`, a, { bindingId: e.bindingId })) : n.bindings[e.bindingId].kind == "variable" ? i != null && !Gf(i.jsonSchema) && o.push(U("graph.variable-incompatible", `Variable binding "${e.bindingId}" is not compatible with this input.`, a, { bindingId: e.bindingId })) : o.push(U("graph.binding-invalid", `Binding "${e.bindingId}" must be a Variable.`, a, { bindingId: e.bindingId }));
8604
+ n.bindings[e.bindingId] == null ? o.push(U("graph.binding-missing", `Binding "${e.bindingId}" does not exist.`, a, { bindingId: e.bindingId })) : n.bindings[e.bindingId].kind == "variable" ? i != null && !Wf(i.jsonSchema) && o.push(U("graph.variable-incompatible", `Variable binding "${e.bindingId}" is not compatible with this input.`, a, { bindingId: e.bindingId })) : o.push(U("graph.binding-invalid", `Binding "${e.bindingId}" must be a Variable.`, a, { bindingId: e.bindingId }));
8610
8605
  return;
8611
8606
  case "flow": {
8612
8607
  let t = r != null && Object.hasOwn(r, e.input) ? r[e.input] : void 0;
@@ -8615,7 +8610,7 @@ function Xp(e, t, n, r, i, a, o) {
8615
8610
  variant: "flow-input"
8616
8611
  }));
8617
8612
  else if (i != null) {
8618
- let n = Uf(t, i);
8613
+ let n = Hf(t, i);
8619
8614
  n.kind != "compatible" && o.push(U("graph.flow-input-incompatible", `Flow input "${e.input}" is not compatible with this input.`, a, { input: e.input }, n.kind == "incompatible" ? n.mismatch : void 0));
8620
8615
  }
8621
8616
  return t;
@@ -8636,7 +8631,7 @@ function Xp(e, t, n, r, i, a, o) {
8636
8631
  variant: "output"
8637
8632
  }));
8638
8633
  else if (i != null) {
8639
- let t = Uf(s, i);
8634
+ let t = Hf(s, i);
8640
8635
  t.kind != "compatible" && o.push(U("graph.node-output-incompatible", `Upstream node "${e.nodeId}" output "${e.output}" is not compatible with this input.`, a, {
8641
8636
  nodeId: e.nodeId,
8642
8637
  output: e.output
@@ -8691,10 +8686,10 @@ function nm(e) {
8691
8686
  for (let t of c) {
8692
8687
  l.add(t.source);
8693
8688
  for (let e of i.get(t.source) ?? []) u.add(e);
8694
- Wp(e.nodes[t.source]) && t.sourceHandle != null && u.add(tm(t.source, t.sourceHandle));
8689
+ Up(e.nodes[t.source]) && t.sourceHandle != null && u.add(tm(t.source, t.sourceHandle));
8695
8690
  for (let e of r.get(t.source) ?? []) l.add(e);
8696
8691
  for (let r of n.get(t.source) ?? []) {
8697
- let n = t.sourceHandle == null || Wp(e.nodes[t.source]) && t.sourceHandle == "pending" ? r : {
8692
+ let n = t.sourceHandle == null || Up(e.nodes[t.source]) && t.sourceHandle == "pending" ? r : {
8698
8693
  ...r,
8699
8694
  [t.source]: t.sourceHandle
8700
8695
  };
@@ -8718,7 +8713,7 @@ function nm(e) {
8718
8713
  function rm(e, t, n) {
8719
8714
  if (n.kind != "node") return [{}];
8720
8715
  let r = e.nodes[n.nodeId], i = t.get(n.nodeId) ?? [];
8721
- return r?.kind == "condition" || Wp(r) && n.output != "pending" ? i.map((e) => ({
8716
+ return r?.kind == "condition" || Up(r) && n.output != "pending" ? i.map((e) => ({
8722
8717
  ...e,
8723
8718
  [n.nodeId]: n.output
8724
8719
  })) : i;
@@ -8726,7 +8721,7 @@ function rm(e, t, n) {
8726
8721
  function im(e, t, n, r) {
8727
8722
  if (n.kind == "value") return !0;
8728
8723
  let { ancestors: i, paths: a } = r;
8729
- if (t != null && n.sources.some((e) => e.kind == "node" && !i.get(t)?.has(e.nodeId)) || t != null && n.sources.some((n) => n.kind == "node" && Wp(e.nodes[n.nodeId]) && !r.resolutionOutputs.get(t)?.has(tm(n.nodeId, n.output)))) return !1;
8724
+ if (t != null && n.sources.some((e) => e.kind == "node" && !i.get(t)?.has(e.nodeId)) || t != null && n.sources.some((n) => n.kind == "node" && Up(e.nodes[n.nodeId]) && !r.resolutionOutputs.get(t)?.has(tm(n.nodeId, n.output)))) return !1;
8730
8725
  let o = n.sources.map((t) => rm(e, a, t)), s = t == null ? [{}] : a.get(t) ?? [];
8731
8726
  for (let [e, r] of o.entries()) for (let [a, c] of o.slice(e + 1).entries()) {
8732
8727
  let o = n.sources[e], l = n.sources[e + a + 1];
@@ -8753,7 +8748,7 @@ function am(e, t, n, r) {
8753
8748
  nodeId: a,
8754
8749
  output: s
8755
8750
  }]
8756
- }, i) && (r == null || Wf(Yp(e, o)[s], Kp(e, t.nodes[n])[r])));
8751
+ }, i) && (r == null || Uf(Yp(e, o)[s], Gp(e, t.nodes[n])[r])));
8757
8752
  return s.length == 0 ? [] : [[a, s]];
8758
8753
  }));
8759
8754
  }
@@ -8761,7 +8756,7 @@ function om(e, t, n, r, i) {
8761
8756
  let a = /* @__PURE__ */ new Set([
8762
8757
  "description",
8763
8758
  "icon",
8764
- "input",
8759
+ "inputDefinitions",
8765
8760
  "inputs",
8766
8761
  "kind",
8767
8762
  "maxExecutions",
@@ -8771,7 +8766,9 @@ function om(e, t, n, r, i) {
8771
8766
  s.length > 0 && i.push(U(`${t.kind}.field-unsupported`, `${o} node "${e}" contains unsupported fields: ${s.join(", ")}.`, r, {
8772
8767
  fields: s.join(", "),
8773
8768
  nodeId: e
8774
- })), n || i.push(U(`${t.kind}.not-allowed`, `${o} nodes are only allowed in Flows.`, r)), t.input.handle != "value" && i.push(U(`${t.kind}.input-invalid`, `${o} input handle must be "value".`, `${r}/input/handle`)), (typeof t.prompt != "string" || t.prompt.trim().length == 0 || [...t.prompt].length > 1e3) && i.push(U(`${t.kind}.prompt-invalid`, `${o} prompt must contain between 1 and 1,000 Unicode code points.`, `${r}/prompt`));
8769
+ })), n || i.push(U(`${t.kind}.not-allowed`, `${o} nodes are only allowed in Flows.`, r));
8770
+ let c = t.inputDefinitions.map((e) => e.handle);
8771
+ new Set(c).size != c.length && i.push(U(`${t.kind}.input-invalid`, `${o} input names must be unique.`, `${r}/inputDefinitions`)), (typeof t.prompt != "string" || t.prompt.trim().length == 0 || [...t.prompt].length > 1e3) && i.push(U(`${t.kind}.prompt-invalid`, `${o} prompt must contain between 1 and 1,000 Unicode code points.`, `${r}/prompt`));
8775
8772
  }
8776
8773
  function sm(e, t, n, r, i, a) {
8777
8774
  let o = nm(e), s = Object.entries(e.nodes).filter(([, e]) => e.kind == "manual");
@@ -8780,8 +8777,8 @@ function sm(e, t, n, r, i, a) {
8780
8777
  for (let [t, n] of e.edges.entries()) {
8781
8778
  let r = `${i}/edges/${t}`, o = e.nodes[n.source], s = e.nodes[n.target];
8782
8779
  if (o == null || s == null || !("inputs" in s)) a.push(U("graph.edge-invalid", "Execution edges require an existing source and an executable target.", r));
8783
- else if (o.kind == "condition" || Wp(o)) {
8784
- let e = Wp(o) ? Object.keys(Jp(o)) : [...o.cases.map((e) => e.output), ...o.defaultOutput == null ? [] : [o.defaultOutput]];
8780
+ else if (o.kind == "condition" || Up(o)) {
8781
+ let e = Up(o) ? Object.keys(Jp(o)) : [...o.cases.map((e) => e.output), ...o.defaultOutput == null ? [] : [o.defaultOutput]];
8785
8782
  (n.sourceHandle == null || !e.some((e) => e == n.sourceHandle)) && a.push(U("graph.edge-invalid", "Choose a declared execution branch.", r));
8786
8783
  } else n.sourceHandle != null && a.push(U("graph.edge-invalid", "Ordinary execution edges do not select a data output.", r));
8787
8784
  let l = JSON.stringify([
@@ -8794,7 +8791,7 @@ function sm(e, t, n, r, i, a) {
8794
8791
  for (let [s, c] of Object.entries(e.nodes)) {
8795
8792
  let l = `${i}/nodes/${s}`;
8796
8793
  if ("inputs" in c && c.maxExecutions != null && (!Number.isSafeInteger(c.maxExecutions) || c.maxExecutions < 1) && a.push(U("node.max-executions-invalid", "Maximum executions must be a positive safe integer.", `${l}/maxExecutions`)), !("inputs" in c)) {
8797
- Yf(c).some((e) => Kf(e.jsonSchema)) && a.push(U("graph.schema-unsupported", "Runtime Ref schemas are not supported.", l)), r ? Gp(s, c, t, l, a) : a.push(U("graph.trigger-not-allowed", "Trigger nodes are only allowed in Flows.", l));
8794
+ Jf(c).some((e) => Gf(e.jsonSchema)) && a.push(U("graph.schema-unsupported", "Runtime Ref schemas are not supported.", l)), r ? Wp(s, c, t, l, a) : a.push(U("graph.trigger-not-allowed", "Trigger nodes are only allowed in Flows.", l));
8798
8795
  continue;
8799
8796
  }
8800
8797
  c.kind == "task" && c.task == null && t.tasks[c.taskId] == null ? a.push(U("graph.target-missing", `Task "${c.taskId}" does not exist.`, `${l}/taskId`, {
@@ -8805,7 +8802,7 @@ function sm(e, t, n, r, i, a) {
8805
8802
  variant: "subflow"
8806
8803
  }));
8807
8804
  for (let [t, n] of Object.entries(c.inputs)) im(e, s, n, o) || a.push(U("graph.source-unavailable", "Input sources must reference execution ancestors, respect pending Wait decisions, and never provide multiple values on the same path.", `${l}/inputs/${t}`));
8808
- let u = Kp(t, c);
8805
+ let u = Gp(t, c);
8809
8806
  if (c.kind == "task") {
8810
8807
  let e = [...c.task == null ? t.tasks[c.taskId]?.inputs ?? [] : c.task.inputs, ...c.additionalInputs ?? []], n = /* @__PURE__ */ new Set();
8811
8808
  for (let t of e) "handle" in t && (n.has(t.handle) && a.push(U("graph.input-duplicate", `Node "${s}" declares input "${t.handle}" more than once.`, l, {
@@ -8813,7 +8810,7 @@ function sm(e, t, n, r, i, a) {
8813
8810
  nodeId: s
8814
8811
  })), n.add(t.handle));
8815
8812
  }
8816
- [...Object.values(u), ...Object.values(Yp(t, c))].some((e) => Kf(e.jsonSchema)) && a.push(U("graph.schema-unsupported", "Runtime Ref schemas are not supported.", l));
8813
+ [...Object.values(u), ...Object.values(Yp(t, c))].some((e) => Gf(e.jsonSchema)) && a.push(U("graph.schema-unsupported", "Runtime Ref schemas are not supported.", l));
8817
8814
  let d = new Set(Object.keys(u));
8818
8815
  for (let [r, i] of Object.entries(c.inputs)) {
8819
8816
  let o = `${l}/inputs/${r}`;
@@ -8826,7 +8823,7 @@ function sm(e, t, n, r, i, a) {
8826
8823
  for (let s of i.sources) Xp(s, e, t, n, u[r], o, a);
8827
8824
  }
8828
8825
  }
8829
- if (Wp(c) && om(s, c, r, l, a), c.kind != "condition") continue;
8826
+ if (Up(c) && om(s, c, r, l, a), c.kind != "condition") continue;
8830
8827
  let f = /* @__PURE__ */ new Set();
8831
8828
  for (let [e, t] of c.cases.entries()) {
8832
8829
  f.has(t.output) && a.push(U("condition.output-duplicate", `Condition output "${t.output}" is declared more than once.`, `${l}/cases/${e}/output`, { output: t.output })), f.add(t.output);
@@ -8852,12 +8849,12 @@ function cm(e, t) {
8852
8849
  }
8853
8850
  function lm(e, t) {
8854
8851
  let n = [];
8855
- for (let [t, r] of Object.entries(e.document.bindings)) r.kind == "variable" && !Af(r.target) && n.push(U("binding.variable-invalid", `Variable binding "${t}" has an invalid target.`, `/document/bindings/${t}/target`, { bindingId: t }));
8852
+ for (let [t, r] of Object.entries(e.document.bindings)) r.kind == "variable" && !kf(r.target) && n.push(U("binding.variable-invalid", `Variable binding "${t}" has an invalid target.`, `/document/bindings/${t}/target`, { bindingId: t }));
8856
8853
  sm(e.document.graph, e.document, void 0, !0, "/document/graph", n);
8857
8854
  for (let r of [...t.dependencies.subflows].toSorted()) {
8858
8855
  let t = e.document.subflows[r];
8859
8856
  if (t == null) continue;
8860
- let i = `/document/subflows/${r}`, a = jf(t.inputs);
8857
+ let i = `/document/subflows/${r}`, a = Af(t.inputs);
8861
8858
  sm(t.graph, e.document, a, !1, `${i}/graph`, n);
8862
8859
  for (let r of t.outputs) {
8863
8860
  im(t.graph, void 0, {
@@ -8865,7 +8862,7 @@ function lm(e, t) {
8865
8862
  sources: r.sources
8866
8863
  }, nm(t.graph)) || n.push(U("graph.source-unavailable", "Subflow output sources must not provide multiple final values.", `${i}/outputs/${r.handle}/sources`));
8867
8864
  for (let o of r.sources) {
8868
- let s = Xp(o, t.graph, e.document, a, void 0, `${i}/outputs/${r.handle}/sources`, n), c = s == null ? void 0 : Uf(s, r);
8865
+ let s = Xp(o, t.graph, e.document, a, void 0, `${i}/outputs/${r.handle}/sources`, n), c = s == null ? void 0 : Hf(s, r);
8869
8866
  c != null && c.kind != "compatible" && n.push(U("graph.subflow-output-incompatible", `A source is not compatible with Subflow output "${r.handle}".`, `${i}/outputs/${r.handle}/sources`, { output: r.handle }, c.kind == "incompatible" ? c.mismatch : void 0));
8870
8867
  }
8871
8868
  }
@@ -17023,20 +17020,20 @@ async function j_(e) {
17023
17020
  let t = A_(e), { bindings: n, modules: r, subflows: i, tasks: a } = t;
17024
17021
  return {
17025
17022
  dependencies: t,
17026
- digest: await hp(mp({
17023
+ digest: await mp(pp({
17027
17024
  bindings: Object.fromEntries([...n].toSorted().map((t) => [t, e.document.bindings[t] ?? null])),
17028
- graph: kp(e, e.document.graph),
17025
+ graph: Op(e, e.document.graph),
17029
17026
  kind: "open-flow-semantic-closure",
17030
17027
  modelVersion: e.modelVersion,
17031
- modules: Object.fromEntries([...r].toSorted().map((t) => [t, e.modules[t] == null ? null : Lp(e.modules[t])])),
17032
- tasks: Object.fromEntries([...a].toSorted().map((t) => [t, e.document.tasks[t] == null ? null : jp(e.document.tasks[t])])),
17028
+ modules: Object.fromEntries([...r].toSorted().map((t) => [t, e.modules[t] == null ? null : Ip(e.modules[t])])),
17029
+ tasks: Object.fromEntries([...a].toSorted().map((t) => [t, e.document.tasks[t] == null ? null : Ap(e.document.tasks[t])])),
17033
17030
  subflows: Object.fromEntries([...i].toSorted().map((t) => {
17034
17031
  let n = e.document.subflows[t];
17035
17032
  return n == null ? [t, null] : [t, {
17036
- graph: kp(e, n.graph),
17037
- inputs: vp(n.inputs),
17033
+ graph: Op(e, n.graph),
17034
+ inputs: _p(n.inputs),
17038
17035
  name: n.name,
17039
- outputs: Ap(e, n.outputs, n.graph)
17036
+ outputs: kp(e, n.outputs, n.graph)
17040
17037
  }];
17041
17038
  })),
17042
17039
  version: 2
@@ -17054,7 +17051,7 @@ function N_(e, t) {
17054
17051
  let n = t;
17055
17052
  if (Object.keys(n).some((e) => e != "nodeId" && e != "outputs") || typeof n.nodeId != "string" || !Object.hasOwn(n, "outputs")) return !1;
17056
17053
  let r = e.document.graph.nodes[n.nodeId];
17057
- return r != null && !("inputs" in r) && Zf(r, n.outputs);
17054
+ return r != null && !("inputs" in r) && Xf(r, n.outputs);
17058
17055
  }
17059
17056
  function P_(e, t) {
17060
17057
  if (typeof t != "object" || !t || Array.isArray(t)) return "invalid";
@@ -17062,10 +17059,10 @@ function P_(e, t) {
17062
17059
  for (let [r, i] of Object.entries(t)) {
17063
17060
  let t = n.nodes[r];
17064
17061
  if (t == null || !("inputs" in t) || typeof i != "object" || !i || Array.isArray(i)) return "invalid";
17065
- let a = Kp(e.document, t);
17062
+ let a = Gp(e.document, t);
17066
17063
  for (let e of Object.keys(i)) {
17067
17064
  let n = a[e];
17068
- if (n == null || Kf(n.jsonSchema) || t.inputs[e] != null || Object.hasOwn(n, "value")) return "invalid";
17065
+ if (n == null || Gf(n.jsonSchema) || t.inputs[e] != null || Object.hasOwn(n, "value")) return "invalid";
17069
17066
  }
17070
17067
  }
17071
17068
  return "valid";
@@ -17097,7 +17094,7 @@ async function F_(e, t) {
17097
17094
  values: { moduleId: o.task.moduleId }
17098
17095
  }));
17099
17096
  try {
17100
- Mf(o.task.capabilities === void 0 ? [] : o.task.capabilities);
17097
+ jf(o.task.capabilities === void 0 ? [] : o.task.capabilities);
17101
17098
  } catch {
17102
17099
  r.diagnostics.push({
17103
17100
  code: "task.capability-incomplete",
@@ -17112,7 +17109,7 @@ async function F_(e, t) {
17112
17109
  for (let t of [...n.dependencies.tasks].toSorted()) {
17113
17110
  let i = e.document.tasks[t];
17114
17111
  if (i != null) {
17115
- for (let n of cp(i, e.document.tasks)) r.diagnostics.push({
17112
+ for (let n of sp(i, e.document.tasks)) r.diagnostics.push({
17116
17113
  code: "agent.config-invalid",
17117
17114
  column: 0,
17118
17115
  line: 1,
@@ -17182,7 +17179,7 @@ function I_(e, t) {
17182
17179
  };
17183
17180
  }
17184
17181
  async function L_(e, t, n) {
17185
- let r = np(t);
17182
+ let r = tp(t);
17186
17183
  if (r == null) return { kind: "engine-unsupported" };
17187
17184
  if (n != null) {
17188
17185
  let t = e.document.graph.nodes[n];
@@ -17245,4 +17242,4 @@ function B_(e) {
17245
17242
  return [e.graph, ...Object.values(e.subflows).map((e) => e.graph)].flatMap((e) => Object.values(e.nodes).flatMap((e) => e.kind == "task" && e.task != null ? e.task.capabilities ?? [] : []));
17246
17243
  }
17247
17244
  //#endregion
17248
- export { z_ as agentActions, lp as agentInput, dp as agentToolInput, up as agentToolSchema, am as availableOutputs, B_ as codeActions, R_ as createRuntimeProgram, j_ as flowClosure, A_ as flowDependencies, Zp as graphOrder, Lf as matchesSchema, Zf as matchesTriggerOutputs, Kp as nodeInputPorts, L_ as prepareFlow, Yf as triggerOutputDefinitions, Xf as triggerOutputPorts, N_ as validRunTrigger, F_ as validateFlow, P_ as validateFlowInputs, O_ as validateModules, M_ as variableBindings, Gf as variableInputCompatible };
17245
+ export { z_ as agentActions, cp as agentInput, up as agentToolInput, lp as agentToolSchema, am as availableOutputs, B_ as codeActions, R_ as createRuntimeProgram, j_ as flowClosure, A_ as flowDependencies, Zp as graphOrder, If as matchesSchema, Xf as matchesTriggerOutputs, Gp as nodeInputPorts, L_ as prepareFlow, Jf as triggerOutputDefinitions, Yf as triggerOutputPorts, N_ as validRunTrigger, F_ as validateFlow, P_ as validateFlowInputs, O_ as validateModules, M_ as variableBindings, Wf as variableInputCompatible };