@oomol-lab/open-flow 0.1.0-beta.70 → 0.1.0-beta.72

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 (37) hide show
  1. package/dist/browser/{FlowCanvas-CqtUDPGj.js → FlowCanvas-Dtf8_cQp.js} +31 -31
  2. package/dist/browser/{createResourceDialog-BAHYW9yu.js → createResourceDialog-BWJkjiOO.js} +2 -2
  3. package/dist/browser/{dialog-DcGOzUP2.js → dialog-CUy_fwx9.js} +4586 -4586
  4. package/dist/browser/{exportSvg-Dv5Qgrq7.js → exportSvg-BOoy7-Db.js} +1 -1
  5. package/dist/browser/flow-authoring.js +9467 -9467
  6. package/dist/browser/flow-change.d.ts +2 -14
  7. package/dist/browser/flow-change.js +23 -21
  8. package/dist/browser/{flowChanges-CYyehKer.js → flowChanges-CgSnSqqP.js} +5731 -5627
  9. package/dist/browser/{flowWorkspace-qYUZPJHR.js → flowWorkspace-Bf7H-r0t.js} +4 -4
  10. package/dist/browser/preview.js +5241 -5135
  11. package/dist/browser/workbench.js +1576 -1461
  12. package/dist/browser/{workbenchSelect-D8_vP2p5.js → workbenchSelect-C3e4J93X.js} +1 -1
  13. package/dist/command/index.js +22 -22
  14. package/dist/common/connector-proxy.d.ts +4 -1
  15. package/dist/common/control-api-conformance.js +23 -21
  16. package/dist/common/control-api.js +3454 -3452
  17. package/dist/common/control-requests.js +2032 -2032
  18. package/dist/common/decision.js +29 -6403
  19. package/dist/common/event-source-definition.d.ts +45 -0
  20. package/dist/common/event-source.d.ts +200 -1
  21. package/dist/common/event-source.js +22 -1
  22. package/dist/common/flow-schema.d.ts +2 -1
  23. package/dist/common/flow-schemaKeywords.d.ts +15 -0
  24. package/dist/common/flow-semantics.js +9797 -9795
  25. package/dist/common/integration-trigger.js +53 -6517
  26. package/dist/common/mcp.js +3389 -3389
  27. package/dist/common/openapi.js +29 -6493
  28. package/dist/common/poll-trigger.js +29 -6517
  29. package/dist/common/provider-triggers.js +6 -65
  30. package/dist/common/scheduler-checkpoint.d.ts +42 -0
  31. package/dist/common/scheduler-dependencies.d.ts +80 -0
  32. package/dist/common/scheduler-node-execution.d.ts +75 -0
  33. package/dist/common/scheduler.d.ts +5 -58
  34. package/dist/common/scheduler.js +575 -471
  35. package/dist/common/webhook-trigger.js +5 -6449
  36. package/dist/common/workflow.js +31 -916
  37. package/package.json +1 -1
@@ -725,7 +725,7 @@ $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
725
725
  /** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
726
726
  * ("toString", "constructor") would otherwise read through to the prototype, and assigning
727
727
  * "__proto__" would hit the setter instead of creating a key. */
728
- function node$1(obj, key, make) {
728
+ function node(obj, key, make) {
729
729
  if (!Object.prototype.hasOwnProperty.call(obj, key)) {
730
730
  if (key === "__proto__") Object.defineProperty(obj, key, {
731
731
  value: make(),
@@ -740,7 +740,7 @@ function node$1(obj, key, make) {
740
740
  function flattenError(error, mapper = (issue) => issue.message) {
741
741
  const fieldErrors = {};
742
742
  const formErrors = [];
743
- for (const sub of error.issues) if (sub.path.length > 0) node$1(fieldErrors, sub.path[0], () => []).push(mapper(sub));
743
+ for (const sub of error.issues) if (sub.path.length > 0) node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
744
744
  else formErrors.push(mapper(sub));
745
745
  return {
746
746
  formErrors,
@@ -1043,7 +1043,7 @@ function timeSource(args) {
1043
1043
  function time$1(args) {
1044
1044
  return new RegExp(`^${timeSource(args)}$`);
1045
1045
  }
1046
- function datetime$1(args) {
1046
+ function datetime(args) {
1047
1047
  const opts = ["Z"];
1048
1048
  if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
1049
1049
  const qualified = `${timeSource({
@@ -1694,7 +1694,7 @@ var $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
1694
1694
  $ZodStringFormat.init(inst, def);
1695
1695
  });
1696
1696
  var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
1697
- def.pattern ?? (def.pattern = datetime$1(def));
1697
+ def.pattern ?? (def.pattern = datetime(def));
1698
1698
  $ZodStringFormat.init(inst, def);
1699
1699
  });
1700
1700
  var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
@@ -2275,70 +2275,6 @@ var $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
2275
2275
  });
2276
2276
  };
2277
2277
  });
2278
- function discriminatorMap(def) {
2279
- const map = /* @__PURE__ */ new Map();
2280
- for (const option of def.options) {
2281
- const values = option._zod.propValues?.[def.discriminator];
2282
- if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
2283
- for (const value of values) if (map.has(value)) {
2284
- if (value !== void 0) throw new Error(`Duplicate discriminator value "${String(value)}"`);
2285
- map.set(value, null);
2286
- } else map.set(value, option);
2287
- }
2288
- return map;
2289
- }
2290
- var $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
2291
- def.inclusive = false;
2292
- $ZodUnion.init(inst, def);
2293
- const _super = inst._zod.parse;
2294
- defineLazyInternal(inst, "propValues", (zod) => {
2295
- const propValues = {};
2296
- let undefinedCount = 0;
2297
- for (const option of zod.def.options) {
2298
- const pv = option._zod.propValues;
2299
- if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
2300
- if (pv[zod.def.discriminator]?.has(void 0)) undefinedCount++;
2301
- for (const [k, v] of Object.entries(pv)) {
2302
- if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp(propValues, k, /* @__PURE__ */ new Set());
2303
- for (const val of v) propValues[k].add(val);
2304
- }
2305
- }
2306
- if (!zod.def.unionFallback && undefinedCount > 1) propValues[zod.def.discriminator]?.delete(void 0);
2307
- return propValues;
2308
- });
2309
- def.options.forEach((option, i) => {
2310
- const propShape = rawShape(option._zod.def);
2311
- if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) throw new Error(`Invalid discriminated union option at index "${i}"`);
2312
- });
2313
- const disc = cached(() => discriminatorMap(def));
2314
- inst._zod.parse = (payload, ctx) => {
2315
- const input = payload.value;
2316
- if (!isObject$1(input)) {
2317
- payload.issues.push({
2318
- code: "invalid_type",
2319
- expected: "object",
2320
- input,
2321
- inst
2322
- });
2323
- return payload;
2324
- }
2325
- const value = input?.[def.discriminator];
2326
- const opt = disc.value.get(value);
2327
- if (opt && (value !== void 0 || ctx.direction !== "backward")) return opt._zod.run(payload, ctx);
2328
- if (def.unionFallback || ctx.direction === "backward") return _super(payload, ctx);
2329
- payload.issues.push({
2330
- code: "invalid_union",
2331
- errors: [],
2332
- note: "No matching discriminator",
2333
- discriminator: def.discriminator,
2334
- options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
2335
- input,
2336
- path: [def.discriminator],
2337
- inst
2338
- });
2339
- return payload;
2340
- };
2341
- });
2342
2278
  var $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
2343
2279
  $ZodType.init(inst, def);
2344
2280
  inst._zod.parse = (payload, ctx) => {
@@ -2804,9 +2740,6 @@ function handlePipeResult(left, next, ctx) {
2804
2740
  issues: left.issues
2805
2741
  }, ctx);
2806
2742
  }
2807
- var $ZodPreprocess = /*@__PURE__*/ $constructor("$ZodPreprocess", (inst, def) => {
2808
- $ZodPipe.init(inst, def);
2809
- });
2810
2743
  var $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
2811
2744
  $ZodType.init(inst, def);
2812
2745
  defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
@@ -5390,18 +5323,6 @@ function union(options, params) {
5390
5323
  ...normalizeParams(params)
5391
5324
  });
5392
5325
  }
5393
- var ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => {
5394
- ZodUnion.init(inst, def);
5395
- $ZodDiscriminatedUnion.init(inst, def);
5396
- });
5397
- function discriminatedUnion(discriminator, options, params) {
5398
- return new ZodDiscriminatedUnion({
5399
- type: "union",
5400
- options,
5401
- discriminator,
5402
- ...normalizeParams(params)
5403
- });
5404
- }
5405
5326
  var ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
5406
5327
  $ZodIntersection.init(inst, def);
5407
5328
  ZodType.init(inst, def);
@@ -5422,7 +5343,7 @@ var ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
5422
5343
  inst.keyType = def.keyType;
5423
5344
  inst.valueType = def.valueType;
5424
5345
  });
5425
- function record$1(keyType, valueType, params) {
5346
+ function record(keyType, valueType, params) {
5426
5347
  if (!valueType || !valueType._zod) return new ZodRecord({
5427
5348
  type: "record",
5428
5349
  keyType: string(),
@@ -5631,10 +5552,6 @@ function pipe(in_, out) {
5631
5552
  out
5632
5553
  });
5633
5554
  }
5634
- var ZodPreprocess = /*@__PURE__*/ $constructor("ZodPreprocess", (inst, def) => {
5635
- ZodPipe.init(inst, def);
5636
- $ZodPreprocess.init(inst, def);
5637
- });
5638
5555
  var ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
5639
5556
  $ZodReadonly.init(inst, def);
5640
5557
  ZodType.init(inst, def);
@@ -5670,7 +5587,7 @@ function refine(fn, _params = {}) {
5670
5587
  function superRefine(fn, params) {
5671
5588
  return /* @__PURE__ */ _superRefine(fn, params);
5672
5589
  }
5673
- function json$1(params) {
5590
+ function json(params) {
5674
5591
  const jsonSchema = lazy(() => {
5675
5592
  return union([
5676
5593
  string(params),
@@ -5678,23 +5595,11 @@ function json$1(params) {
5678
5595
  boolean(),
5679
5596
  _null(),
5680
5597
  array(jsonSchema),
5681
- record$1(string(), jsonSchema)
5598
+ record(string(), jsonSchema)
5682
5599
  ]);
5683
5600
  });
5684
5601
  return jsonSchema;
5685
5602
  }
5686
- function preprocess(fn, schema) {
5687
- return new ZodPreprocess({
5688
- type: "pipe",
5689
- in: transform(fn),
5690
- out: schema
5691
- });
5692
- }
5693
- //#endregion
5694
- //#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/iso.js
5695
- function datetime(params) {
5696
- return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
5697
- }
5698
5603
  //#endregion
5699
5604
  //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
5700
5605
  function deepCompareStrict(a, b) {
@@ -6576,819 +6481,6 @@ var Validator = class {
6576
6481
  }
6577
6482
  };
6578
6483
  //#endregion
6579
- //#region src/decision/common/decision.ts
6580
- var decisionLimits = {
6581
- choice: 255,
6582
- score: 10
6583
- };
6584
- /** Ordered prefixes are shared by authoring, schemas, validation, and execution. */
6585
- function limitDecisionQuestion(question) {
6586
- if (question.type === "noul" || question.criteria.length <= decisionLimits[question.type]) return question;
6587
- if (question.type === "choice") return {
6588
- ...question,
6589
- criteria: question.criteria.slice(0, decisionLimits.choice)
6590
- };
6591
- return {
6592
- ...question,
6593
- criteria: question.criteria.slice(0, decisionLimits.score)
6594
- };
6595
- }
6596
- function limitDecisionQuestions(questions) {
6597
- const limited = questions.map(limitDecisionQuestion);
6598
- return limited.every((question, i) => question === questions[i]) ? questions : limited;
6599
- }
6600
- /** Loading an oversized task also updates its previously generated output schemas. */
6601
- function limitDecisionTask(task) {
6602
- if (task.executor.kind !== "decision") return task;
6603
- const original = task.executor.questions;
6604
- const questions = limitDecisionQuestions(original);
6605
- if (questions === original) return task;
6606
- const outputs = task.outputs.map((port) => {
6607
- if (!("handle" in port)) return port;
6608
- const index = original.findIndex((question) => question.name === port.handle);
6609
- if (index < 0 || original[index] === questions[index] || !dequal(port.jsonSchema, answerSchema(original[index]))) return port;
6610
- return {
6611
- ...port,
6612
- jsonSchema: decisionAnswerSchema(questions[index])
6613
- };
6614
- });
6615
- return {
6616
- ...task,
6617
- executor: {
6618
- ...task.executor,
6619
- questions
6620
- },
6621
- outputs
6622
- };
6623
- }
6624
- var probability = {
6625
- type: "number",
6626
- minimum: 0,
6627
- maximum: 1
6628
- };
6629
- function decisionAnswerSchema(question) {
6630
- return answerSchema(limitDecisionQuestion(question));
6631
- }
6632
- function answerSchema(question) {
6633
- const properties = { type: { const: question.type } };
6634
- if (question.type === "noul") properties.noul = probability;
6635
- else {
6636
- const keys = question.type === "choice" ? question.criteria.map((item) => item.name) : question.criteria.map((_, index) => String(index));
6637
- properties.confidence = probability;
6638
- properties.probabilities = {
6639
- type: "object",
6640
- properties: Object.fromEntries(keys.map((key) => [key, probability])),
6641
- required: keys,
6642
- additionalProperties: false
6643
- };
6644
- if (question.type === "choice") properties.choice = {
6645
- type: "string",
6646
- ...keys.length ? { enum: keys } : {}
6647
- };
6648
- else {
6649
- properties.score = {
6650
- type: "number",
6651
- minimum: 0,
6652
- maximum: Math.max(0, keys.length - 1)
6653
- };
6654
- properties.legend = {
6655
- type: "object",
6656
- properties: Object.fromEntries(keys.map((key) => [key, { type: "string" }])),
6657
- required: keys,
6658
- additionalProperties: false
6659
- };
6660
- }
6661
- }
6662
- return {
6663
- type: "object",
6664
- properties,
6665
- required: Object.keys(properties)
6666
- };
6667
- }
6668
- //#endregion
6669
- //#region src/flow/common/retry.ts
6670
- var nodeRetryLimits = {
6671
- maxRetries: 5,
6672
- minIntervalMs: 1e3,
6673
- maxIntervalMs: 6e4,
6674
- intervalStepMs: 1e3
6675
- };
6676
- var retryConfigurationSchema = strictObject({
6677
- maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
6678
- intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
6679
- });
6680
- //#endregion
6681
- //#region src/flow/common/triggerScheduleSchema.ts
6682
- var triggerScheduleSchema = array(union([object({
6683
- type: literal("cron"),
6684
- expression: string(),
6685
- timezone: string()
6686
- }), object({
6687
- type: literal("every"),
6688
- unit: _enum([
6689
- "day",
6690
- "hour",
6691
- "minute",
6692
- "month",
6693
- "week"
6694
- ]),
6695
- value: number()
6696
- })]));
6697
- //#endregion
6698
- //#region src/localization/common/timeZone.ts
6699
- /** Validate a named timezone using the same runtime data used for date conversion. */
6700
- function isTimeZone(value) {
6701
- try {
6702
- Intl.DateTimeFormat("en", { timeZone: value });
6703
- return true;
6704
- } catch {
6705
- return false;
6706
- }
6707
- }
6708
- //#endregion
6709
- //#region src/flow/common/wait.ts
6710
- /** Drafts retain incomplete values; semantic validation gates publication and execution. */
6711
- var waitAutoContinueDraftSchema = discriminatedUnion("kind", [strictObject({
6712
- kind: literal("after"),
6713
- durationMs: number().nullable()
6714
- }), strictObject({
6715
- kind: literal("at"),
6716
- at: string(),
6717
- timezone: string().optional()
6718
- })]);
6719
- discriminatedUnion("kind", [waitAutoContinueDraftSchema.options[0].extend({ durationMs: number().int().positive().max(Number.MAX_SAFE_INTEGER) }), waitAutoContinueDraftSchema.options[1].extend({
6720
- at: datetime({ offset: true }),
6721
- timezone: string().refine(isTimeZone, "Select a valid IANA timezone.").optional()
6722
- })]);
6723
- //#endregion
6724
- //#region src/flow/common/webhookMethod.ts
6725
- var webhookMethods = [
6726
- "GET",
6727
- "POST",
6728
- "PUT",
6729
- "PATCH",
6730
- "DELETE"
6731
- ];
6732
- //#endregion
6733
- //#region src/flow/common/webhookResponse.ts
6734
- var webhookResponseTimeout = {
6735
- defaultMs: 3e4,
6736
- minMs: 1e3,
6737
- maxMs: 6e4
6738
- };
6739
- ({
6740
- jsonSchema: {
6741
- type: "object",
6742
- additionalProperties: { type: [
6743
- "string",
6744
- "number",
6745
- "boolean"
6746
- ] }
6747
- },
6748
- nullable: true
6749
- }).jsonSchema;
6750
- var text = string();
6751
- var actionConnection = text.describe("Account selection: omit while unconfigured; use an account ID to select it; use \"\" to explicitly defer configuration. Deferred Actions fail if called; deferred Agent tools are excluded from the callable tool set. Not supported by Triggers.");
6752
- var json = json$1();
6753
- var strings = array(text);
6754
- var port = object({
6755
- description: text.optional(),
6756
- jsonSchema: json,
6757
- nullable: boolean(),
6758
- handle: text
6759
- });
6760
- var workflowInputDefs = array(port.strict());
6761
- var input = port.extend({ value: json.optional() });
6762
- var group = object({
6763
- collapsed: boolean().optional(),
6764
- group: text
6765
- });
6766
- var source = union([object({
6767
- kind: literal("node"),
6768
- nodeId: text,
6769
- output: text,
6770
- system: literal(true).optional(),
6771
- field: text.optional()
6772
- }), object({
6773
- kind: literal("binding"),
6774
- bindingId: text
6775
- })]);
6776
- var fixedInput = union([object({ kind: literal("unset") }), object({
6777
- kind: literal("value"),
6778
- value: json
6779
- })]);
6780
- var mapping = union([fixedInput, object({
6781
- kind: literal("sources"),
6782
- sources: array(source)
6783
- })]);
6784
- var inputs = record$1(text, mapping);
6785
- var ports = {
6786
- inputs: array(union([input, group])),
6787
- outputs: array(union([port, group]))
6788
- };
6789
- var capability = union([
6790
- strictObject({
6791
- kind: literal("connector"),
6792
- action: text,
6793
- connectionId: text.optional(),
6794
- connections: array(strictObject({
6795
- connectionId: text,
6796
- alias: text.optional()
6797
- }))
6798
- }),
6799
- strictObject({
6800
- kind: literal("connector"),
6801
- mode: literal("shared")
6802
- }),
6803
- strictObject({
6804
- kind: literal("connector"),
6805
- mode: literal("independent"),
6806
- actions: array(strictObject({
6807
- action: text,
6808
- connectionId: actionConnection.optional()
6809
- }))
6810
- }),
6811
- strictObject({
6812
- kind: literal("connector"),
6813
- actionHints: array(text).optional(),
6814
- connectionHints: array(strictObject({
6815
- action: text,
6816
- connectionId: text,
6817
- alias: text.optional()
6818
- })).optional()
6819
- })
6820
- ]);
6821
- var inline = object({
6822
- ...ports,
6823
- name: text,
6824
- moduleId: text,
6825
- capabilities: array(capability).optional()
6826
- });
6827
- var agentValue = union([object({
6828
- kind: literal("value"),
6829
- value: json
6830
- }), object({
6831
- kind: literal("input"),
6832
- input: text
6833
- })]);
6834
- var agentInput = union([agentValue, object({ kind: literal("model") })]);
6835
- var decisionQuestion = discriminatedUnion("type", [
6836
- strictObject({
6837
- name: text,
6838
- instructions: text,
6839
- type: literal("noul"),
6840
- criteria: strictObject({
6841
- true: text.optional(),
6842
- false: text.optional()
6843
- }).optional()
6844
- }),
6845
- strictObject({
6846
- name: text,
6847
- instructions: text,
6848
- type: literal("choice"),
6849
- criteria: array(strictObject({
6850
- name: text,
6851
- description: text
6852
- }))
6853
- }),
6854
- strictObject({
6855
- name: text,
6856
- instructions: text,
6857
- type: literal("score"),
6858
- criteria: strings
6859
- })
6860
- ]);
6861
- var managedFields = object({
6862
- ...ports,
6863
- name: text,
6864
- executor: union([
6865
- object({
6866
- kind: literal("connector"),
6867
- action: text,
6868
- connectionId: actionConnection.optional(),
6869
- outputMode: literal("value").optional()
6870
- }),
6871
- object({
6872
- kind: literal("openapi"),
6873
- sourceUrl: text,
6874
- method: text,
6875
- path: text,
6876
- serverUrl: text,
6877
- document: json,
6878
- auth: array(object({
6879
- id: text,
6880
- type: _enum([
6881
- "bearer",
6882
- "basic",
6883
- "apiKey"
6884
- ]),
6885
- name: text.optional(),
6886
- in: _enum(["header", "query"]).optional()
6887
- }))
6888
- }),
6889
- strictObject({
6890
- kind: literal("decision"),
6891
- questions: array(decisionQuestion)
6892
- }),
6893
- object({
6894
- kind: literal("llm"),
6895
- mode: _enum(["chat", "json"])
6896
- }),
6897
- object({
6898
- kind: literal("agent"),
6899
- code: boolean().optional(),
6900
- model: text,
6901
- prompt: text,
6902
- maxRounds: number(),
6903
- tools: array(object({
6904
- id: text,
6905
- name: text,
6906
- description: text,
6907
- action: text,
6908
- connectionId: actionConnection.optional(),
6909
- approval: boolean(),
6910
- inputs: array(input.extend({ source: agentInput }))
6911
- })),
6912
- notification: object({
6913
- action: text,
6914
- connectionId: actionConnection.optional(),
6915
- inputDefinitions: array(input),
6916
- messageHandle: text,
6917
- inputs: record$1(text, agentValue)
6918
- }).optional()
6919
- }),
6920
- strictObject({
6921
- kind: literal("workflow"),
6922
- flowId: text,
6923
- revisionId: text
6924
- })
6925
- ])
6926
- });
6927
- var managed = managedFields.transform(limitDecisionTask);
6928
- var operand = union([object({
6929
- kind: literal("value"),
6930
- value: json.optional(),
6931
- jsonSchema: json.optional()
6932
- }), object({
6933
- kind: literal("source"),
6934
- source
6935
- })]);
6936
- var condition = {
6937
- matchMode: _enum(["first", "all"]),
6938
- cases: array(object({
6939
- description: text.optional(),
6940
- output: text,
6941
- groups: array(object({ expressions: array(object({
6942
- left: operand,
6943
- operator: _enum([
6944
- "!=",
6945
- "<",
6946
- "<=",
6947
- "==",
6948
- ">",
6949
- ">=",
6950
- "contains",
6951
- "endsWith",
6952
- "hasKey",
6953
- "hasValue",
6954
- "isEmpty",
6955
- "isFalse",
6956
- "isNotEmpty",
6957
- "isNotNull",
6958
- "isNull",
6959
- "isTrue",
6960
- "notContains",
6961
- "notHasKey",
6962
- "notHasValue",
6963
- "startsWith"
6964
- ]),
6965
- right: operand.optional()
6966
- })) }))
6967
- }))
6968
- };
6969
- var wait = {
6970
- inputDefinitions: array(input),
6971
- prompt: text
6972
- };
6973
- var webhookOptions = object({
6974
- allowedMethods: never().optional(),
6975
- allowedOrigins: strings.optional(),
6976
- noResponseBody: never().optional(),
6977
- responseBody: discriminatedUnion("kind", [strictObject({
6978
- kind: literal("workflow-outputs"),
6979
- output: text.optional(),
6980
- timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
6981
- }), strictObject({
6982
- kind: literal("webhook-response"),
6983
- nodeId: text.optional(),
6984
- timeoutMs: number().int().min(webhookResponseTimeout.minMs).max(webhookResponseTimeout.maxMs).optional()
6985
- })]).optional(),
6986
- responseData: text.optional(),
6987
- responseHeaders: record$1(text, text).optional(),
6988
- responseHeadersSource: strictObject({
6989
- kind: literal("workflow-outputs"),
6990
- output: text.optional()
6991
- }).optional(),
6992
- responseHeaderOutputs: record$1(text, text).optional(),
6993
- responseStatusCode: number().int().min(200).max(599).optional(),
6994
- responseStatusCodeOutput: text.optional()
6995
- });
6996
- var webhook = {
6997
- bodyFields: array(input),
6998
- method: _enum(webhookMethods),
6999
- options: webhookOptions.optional()
7000
- };
7001
- var definition = {
7002
- configInputs: ports.inputs,
7003
- definitionVersion: literal(2),
7004
- description: text,
7005
- displayName: text,
7006
- key: text,
7007
- name: text,
7008
- outputs: array(port).refine((definitions) => new Set(definitions.map((output) => output.handle)).size === definitions.length, "Duplicate Trigger output handle."),
7009
- provider: text
7010
- };
7011
- var endpoint = object({
7012
- body: object({
7013
- allowArray: boolean(),
7014
- allowEmpty: boolean(),
7015
- formats: array(_enum([
7016
- "form",
7017
- "json",
7018
- "multipart",
7019
- "text"
7020
- ]))
7021
- }),
7022
- methods: array(_enum([
7023
- "DELETE",
7024
- "GET",
7025
- "HEAD",
7026
- "PATCH",
7027
- "POST",
7028
- "PUT"
7029
- ])),
7030
- successStatus: number()
7031
- });
7032
- var sourceFlowIds = array(text.min(1)).refine((ids) => new Set(ids).size === ids.length, "Duplicate source Flow ID.");
7033
- var trigger = {
7034
- name: text,
7035
- description: text.optional(),
7036
- icon: text.optional()
7037
- };
7038
- var base = {
7039
- maxExecutions: number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),
7040
- inputs,
7041
- name: text.optional(),
7042
- description: text.optional(),
7043
- icon: text.optional(),
7044
- timeoutMs: number().optional(),
7045
- retry: retryConfigurationSchema.optional(),
7046
- onError: _enum(["stop", "error"]).optional()
7047
- };
7048
- var node = union([
7049
- strictObject({
7050
- ...base,
7051
- kind: literal("webhook-response"),
7052
- retry: never().optional(),
7053
- onError: never().optional()
7054
- }),
7055
- strictObject({
7056
- ...base,
7057
- kind: literal("outputs"),
7058
- outputDefs: array(port.strict()),
7059
- outputMappings: inputs
7060
- }).omit({ inputs: true }),
7061
- object({
7062
- ...base,
7063
- inputs: record$1(text, never()),
7064
- kind: literal("condition"),
7065
- ...condition
7066
- }),
7067
- object({
7068
- ...base,
7069
- inputs: unknown().transform(() => ({})).default({}),
7070
- kind: literal("value"),
7071
- values: array(input)
7072
- }),
7073
- object({
7074
- ...base,
7075
- kind: literal("task"),
7076
- task: union([inline, managed]),
7077
- additionalInputs: array(input).optional()
7078
- }),
7079
- strictObject({
7080
- ...base,
7081
- kind: literal("approval"),
7082
- ...wait
7083
- }).omit({ timeoutMs: true }),
7084
- strictObject({
7085
- ...base,
7086
- kind: literal("wait"),
7087
- ...wait,
7088
- autoContinue: waitAutoContinueDraftSchema.optional()
7089
- }).omit({ timeoutMs: true }),
7090
- object({
7091
- ...trigger,
7092
- kind: literal("manual")
7093
- }),
7094
- strictObject({
7095
- ...trigger,
7096
- kind: literal("start"),
7097
- inputDefs: workflowInputDefs
7098
- }),
7099
- strictObject({
7100
- ...trigger,
7101
- kind: literal("error"),
7102
- sourceFlowIds: sourceFlowIds.optional()
7103
- }),
7104
- object({
7105
- ...trigger,
7106
- kind: literal("webhook"),
7107
- ...webhook
7108
- }),
7109
- object({
7110
- ...trigger,
7111
- kind: literal("cron"),
7112
- cronTimes: triggerScheduleSchema
7113
- }),
7114
- object({
7115
- ...trigger,
7116
- kind: literal("poll"),
7117
- connectionId: text.min(1).optional(),
7118
- config: record$1(text, fixedInput),
7119
- definition: object({
7120
- ...definition,
7121
- type: literal("poll")
7122
- }),
7123
- pollTimes: triggerScheduleSchema
7124
- }),
7125
- object({
7126
- ...trigger,
7127
- kind: literal("integration"),
7128
- connectionId: text.min(1).optional(),
7129
- config: record$1(text, fixedInput),
7130
- definition: object({
7131
- ...definition,
7132
- type: literal("integration"),
7133
- endpoint
7134
- })
7135
- })
7136
- ]);
7137
- strictObject(condition), strictObject(wait), strictObject(webhook), managedFields.shape.executor.options[0].omit({ kind: true }).strict(), managedFields.shape.executor.options[1].omit({ kind: true }).strict(), managedFields.shape.executor.options[2].omit({ kind: true }).strict(), managedFields.shape.executor.options[3].omit({ kind: true }).strict(), managedFields.shape.executor.options[4].omit({
7138
- kind: true,
7139
- notification: true
7140
- }).strict();
7141
- var edge = object({
7142
- source: text,
7143
- target: text,
7144
- sourceHandle: text.optional()
7145
- });
7146
- var at = {
7147
- nodeId: text,
7148
- target: never().optional()
7149
- };
7150
- var graph = object({
7151
- nodes: record$1(text, node),
7152
- edges: array(edge).default([])
7153
- });
7154
- var binding = object({
7155
- kind: literal("variable"),
7156
- target: text
7157
- });
7158
- var module = object({
7159
- name: text,
7160
- imports: strings,
7161
- source: text
7162
- });
7163
- var document = preprocess(normalizeDocument, object({
7164
- bindings: record$1(text, binding),
7165
- graph
7166
- }));
7167
- object({
7168
- modelVersion: union([
7169
- literal(2),
7170
- literal(4),
7171
- literal(5),
7172
- literal(6),
7173
- literal(7),
7174
- literal(8),
7175
- literal(9),
7176
- literal(10)
7177
- ]),
7178
- document,
7179
- modules: record$1(text, module)
7180
- }).extend({
7181
- kind: literal("open-flow-flow-revision"),
7182
- version: literal(1)
7183
- });
7184
- function normalizeDocument(value) {
7185
- const candidate = record(value);
7186
- if (candidate.tasks !== void 0 && (candidate.tasks === null || typeof candidate.tasks !== "object" || Array.isArray(candidate.tasks) || Object.keys(candidate.tasks).length > 0)) throw new TypeError("Independent Task definitions are no longer supported.");
7187
- if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => Object.hasOwn(record(candidateNode), "taskId"))) throw new TypeError("Task references are no longer supported.");
7188
- const subflows = candidate.subflows;
7189
- if (subflows !== void 0 && (subflows === null || typeof subflows !== "object" || Array.isArray(subflows) || Object.keys(subflows).length > 0)) throw new TypeError("Subflows are no longer supported.");
7190
- if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind === "subflow")) throw new TypeError("Subflow nodes are no longer supported.");
7191
- if ([
7192
- "inputDefs",
7193
- "outputDefs",
7194
- "outputMappings"
7195
- ].some((field) => Object.hasOwn(candidate, field))) throw new TypeError("Workflow interface configuration must belong to Start and Outputs nodes.");
7196
- if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind == "start" && Object.hasOwn(record(candidateNode), "parameters"))) throw new TypeError("Legacy Start.parameters is unsupported; configure node.inputDefs.");
7197
- return value;
7198
- }
7199
- function record(value) {
7200
- return value != null && typeof value == "object" && !Array.isArray(value) ? value : {};
7201
- }
7202
- var shapes = {
7203
- "graph.trigger.sources.set": {
7204
- nodeId: text,
7205
- before: sourceFlowIds.optional(),
7206
- value: sourceFlowIds.optional()
7207
- },
7208
- "binding.create": {
7209
- bindingId: text,
7210
- binding
7211
- },
7212
- "binding.delete": { bindingId: text },
7213
- "binding.target.set": {
7214
- bindingId: text,
7215
- before: text,
7216
- value: text
7217
- },
7218
- "graph.edge.connect": {
7219
- edge,
7220
- target: never().optional()
7221
- },
7222
- "graph.edge.disconnect": {
7223
- edge,
7224
- target: never().optional()
7225
- },
7226
- "graph.node.create": {
7227
- ...at,
7228
- node
7229
- },
7230
- "graph.node.replace": {
7231
- ...at,
7232
- before: node,
7233
- node
7234
- },
7235
- "graph.node.delete": at,
7236
- "graph.node.field.set": union([
7237
- object({
7238
- ...at,
7239
- kind: literal("graph.node.field.set"),
7240
- field: literal("retry"),
7241
- before: retryConfigurationSchema.optional(),
7242
- value: retryConfigurationSchema.optional()
7243
- }),
7244
- object({
7245
- ...at,
7246
- kind: literal("graph.node.field.set"),
7247
- field: literal("connectionId"),
7248
- before: text.min(1).optional(),
7249
- value: text.min(1).optional()
7250
- }),
7251
- object({
7252
- ...at,
7253
- kind: literal("graph.node.field.set"),
7254
- field: _enum([
7255
- "description",
7256
- "icon",
7257
- "name",
7258
- "onError"
7259
- ]),
7260
- before: text.optional(),
7261
- value: text.optional()
7262
- }),
7263
- object({
7264
- ...at,
7265
- kind: literal("graph.node.field.set"),
7266
- field: literal("maxExecutions"),
7267
- before: number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),
7268
- value: number().int().positive().max(Number.MAX_SAFE_INTEGER).optional()
7269
- }),
7270
- object({
7271
- ...at,
7272
- kind: literal("graph.node.field.set"),
7273
- field: literal("timeoutMs"),
7274
- before: number().optional(),
7275
- value: number().optional()
7276
- })
7277
- ]),
7278
- "graph.node.input.set": {
7279
- ...at,
7280
- handle: text,
7281
- before: mapping.optional(),
7282
- value: mapping.optional()
7283
- },
7284
- "graph.node.additional-inputs.set": {
7285
- ...at,
7286
- before: array(input).optional(),
7287
- value: array(input).optional()
7288
- },
7289
- "graph.node.condition.set": {
7290
- ...at,
7291
- before: object(condition),
7292
- value: object(condition)
7293
- },
7294
- "graph.node.values.set": {
7295
- ...at,
7296
- before: array(input),
7297
- value: array(input)
7298
- },
7299
- "graph.node.resolution.set": {
7300
- ...at,
7301
- before: strictObject({
7302
- ...wait,
7303
- autoContinue: waitAutoContinueDraftSchema.optional()
7304
- }),
7305
- value: strictObject({
7306
- ...wait,
7307
- autoContinue: waitAutoContinueDraftSchema.optional()
7308
- })
7309
- },
7310
- "graph.node.webhook.set": {
7311
- ...at,
7312
- before: object(webhook),
7313
- value: object(webhook)
7314
- },
7315
- "graph.node.task.ports.set": {
7316
- ...at,
7317
- before: object(ports),
7318
- value: object(ports)
7319
- },
7320
- "graph.node.task.name.set": {
7321
- ...at,
7322
- before: text,
7323
- value: text
7324
- },
7325
- "graph.node.task.capabilities.set": {
7326
- ...at,
7327
- before: array(capability).optional(),
7328
- value: array(capability).optional()
7329
- },
7330
- "graph.trigger.config.set": {
7331
- nodeId: text,
7332
- name: text,
7333
- before: fixedInput.optional(),
7334
- value: fixedInput.optional()
7335
- },
7336
- "graph.trigger.schedule.set": {
7337
- nodeId: text,
7338
- before: triggerScheduleSchema,
7339
- value: triggerScheduleSchema
7340
- },
7341
- "module.create": {
7342
- moduleId: text,
7343
- module
7344
- },
7345
- "module.delete": { moduleId: text },
7346
- "module.rename": {
7347
- moduleId: text,
7348
- before: text,
7349
- name: text
7350
- },
7351
- "module.source.replace": {
7352
- moduleId: text,
7353
- beforeImports: strings,
7354
- beforeSource: text,
7355
- imports: strings,
7356
- source: text
7357
- },
7358
- "graph.node.task.set": {
7359
- ...at,
7360
- before: union([inline, managed]),
7361
- value: union([inline, managed])
7362
- }
7363
- };
7364
- array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, shape instanceof ZodType ? shape : object({
7365
- kind: literal(kind),
7366
- ...shape
7367
- })])).values()])).min(1);
7368
- //#endregion
7369
- //#region src/flow/common/change.ts
7370
- var schemaKeywords = /* @__PURE__ */ new Set([
7371
- "const",
7372
- "enum",
7373
- "exclusiveMaximum",
7374
- "exclusiveMinimum",
7375
- "maximum",
7376
- "maxItems",
7377
- "maxLength",
7378
- "maxProperties",
7379
- "minimum",
7380
- "minItems",
7381
- "minLength",
7382
- "minProperties",
7383
- "multipleOf",
7384
- "pattern",
7385
- "required",
7386
- "type"
7387
- ]);
7388
- function isSchemaKeyword(value) {
7389
- return schemaKeywords.has(value);
7390
- }
7391
- //#endregion
7392
6484
  //#region src/json-schema-subset/utils.ts
7393
6485
  var nextId = 0;
7394
6486
  function createId() {
@@ -10299,6 +9391,29 @@ function resolveLocalRefs(schema) {
10299
9391
  return visit(schema, /* @__PURE__ */ new Set());
10300
9392
  }
10301
9393
  //#endregion
9394
+ //#region src/flow/common/schemaKeywords.ts
9395
+ var schemaKeywords = /* @__PURE__ */ new Set([
9396
+ "const",
9397
+ "enum",
9398
+ "exclusiveMaximum",
9399
+ "exclusiveMinimum",
9400
+ "maximum",
9401
+ "maxItems",
9402
+ "maxLength",
9403
+ "maxProperties",
9404
+ "minimum",
9405
+ "minItems",
9406
+ "minLength",
9407
+ "minProperties",
9408
+ "multipleOf",
9409
+ "pattern",
9410
+ "required",
9411
+ "type"
9412
+ ]);
9413
+ function isSchemaKeyword(value) {
9414
+ return schemaKeywords.has(value);
9415
+ }
9416
+ //#endregion
10302
9417
  //#region src/flow/common/schema.ts
10303
9418
  function jsonEqual(left, right) {
10304
9419
  if (left === right) return true;
@@ -10419,7 +9534,7 @@ function comparePorts(source, target) {
10419
9534
  //#region src/workflow/common/workflow.ts
10420
9535
  var portSchema = object({
10421
9536
  handle: string().min(1),
10422
- jsonSchema: json$1(),
9537
+ jsonSchema: json(),
10423
9538
  nullable: boolean(),
10424
9539
  description: string().optional()
10425
9540
  });