@oomol-lab/open-flow 0.1.0-beta.50 → 0.1.0-beta.52

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 (44) hide show
  1. package/dist/browser/{createResourceDialog-CSltk-qY.js → createResourceDialog-BsaBMf7_.js} +2 -1
  2. package/dist/browser/flow-authoring-node.d.ts +3 -1
  3. package/dist/browser/flow-authoring.js +82 -3
  4. package/dist/browser/flow-change-schema.d.ts +1 -1
  5. package/dist/browser/flow-change.d.ts +15 -2
  6. package/dist/browser/flow-change.js +81 -3
  7. package/dist/browser/{flowChanges-DbYrpHnS.js → flowChanges-DtraMpva.js} +3858 -1921
  8. package/dist/browser/{flowWorkspace-CjwpbVBR.js → flowWorkspace-DLgti4Lk.js} +1353 -513
  9. package/dist/browser/{workbenchSelect-oVujN2z6.js → icons-0s-Q_3lp.js} +92 -35
  10. package/dist/browser/licenses.md +204 -0
  11. package/dist/browser/preview.css +302 -179
  12. package/dist/browser/preview.js +4829 -2198
  13. package/dist/browser/theme.css +2 -0
  14. package/dist/browser/ui-hostNavigationActions.d.ts +13 -0
  15. package/dist/browser/ui-hostTooltip.d.ts +8 -0
  16. package/dist/browser/ui-logo.d.ts +5 -0
  17. package/dist/browser/ui.css +102 -8
  18. package/dist/browser/ui.d.ts +3 -0
  19. package/dist/browser/ui.js +176 -11
  20. package/dist/browser/workbench-contract.d.ts +5 -11
  21. package/dist/browser/workbench.css +366 -200
  22. package/dist/browser/workbench.d.ts +1 -1
  23. package/dist/browser/workbench.js +1154 -379
  24. package/dist/browser/workbenchSelect-BqUPacsr.js +31 -0
  25. package/dist/common/authoringExamples.d.ts +4 -2
  26. package/dist/common/control-api-conformance.js +129 -11
  27. package/dist/common/control-api.d.ts +38 -5
  28. package/dist/common/control-api.js +198 -12
  29. package/dist/common/control-requests.d.ts +4 -0
  30. package/dist/common/control-requests.js +1320 -67
  31. package/dist/common/flow-encoding.js +64 -5
  32. package/dist/common/flow-semantics.js +823 -316
  33. package/dist/common/integration-trigger.js +39 -1
  34. package/dist/common/mcp.js +129 -11
  35. package/dist/common/openapi.d.ts +53 -0
  36. package/dist/common/openapi.js +10390 -0
  37. package/dist/common/poll-trigger.js +39 -1
  38. package/dist/common/provider-triggers.js +39 -1
  39. package/dist/common/run-events.js +26 -1
  40. package/dist/common/scheduler.d.ts +4 -1
  41. package/dist/common/scheduler.js +122 -6
  42. package/dist/common/trigger-contract.d.ts +2 -0
  43. package/dist/common/webhook-trigger.js +39 -1
  44. package/package.json +5 -1
@@ -1,3 +1,12 @@
1
+ //#region src/openapi/common/authBindings.ts
2
+ /** Never allow credentials to enter a Revision as literal node inputs. */
3
+ function assertOpenApiAuthBindings(document) {
4
+ for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
5
+ if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
6
+ for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && (mapping.kind == "value" || mapping.kind == "sources" && mapping.sources.some((source) => source.kind == "flow"))) throw new TypeError("OpenAPI authentication accepts deployment variables and upstream outputs only.");
7
+ }
8
+ }
9
+ //#endregion
1
10
  //#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/core/util.js
2
11
  function getEnumValues(entries) {
3
12
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
@@ -5709,6 +5718,24 @@ var managed = object({
5709
5718
  action: text,
5710
5719
  connectionId: text.optional()
5711
5720
  }),
5721
+ object({
5722
+ kind: literal("openapi"),
5723
+ sourceUrl: text,
5724
+ method: text,
5725
+ path: text,
5726
+ serverUrl: text,
5727
+ document: json,
5728
+ auth: array(object({
5729
+ id: text,
5730
+ type: _enum([
5731
+ "bearer",
5732
+ "basic",
5733
+ "apiKey"
5734
+ ]),
5735
+ name: text.optional(),
5736
+ in: _enum(["header", "query"]).optional()
5737
+ }))
5738
+ }),
5712
5739
  object({
5713
5740
  kind: literal("llm"),
5714
5741
  mode: _enum(["chat", "json"])
@@ -5825,6 +5852,7 @@ var endpoint = object({
5825
5852
  ])),
5826
5853
  successStatus: number()
5827
5854
  });
5855
+ var sourceFlowIds = array(text.min(1)).refine((ids) => new Set(ids).size === ids.length, "Duplicate source Flow ID.");
5828
5856
  var trigger = {
5829
5857
  name: text,
5830
5858
  description: text.optional(),
@@ -5882,6 +5910,11 @@ var node = union([
5882
5910
  ...trigger,
5883
5911
  kind: literal("manual")
5884
5912
  }),
5913
+ strictObject({
5914
+ ...trigger,
5915
+ kind: literal("error"),
5916
+ sourceFlowIds: sourceFlowIds.optional()
5917
+ }),
5885
5918
  object({
5886
5919
  ...trigger,
5887
5920
  kind: literal("webhook"),
@@ -5953,7 +5986,11 @@ var document = object({
5953
5986
  tasks: record$1(text, managed)
5954
5987
  });
5955
5988
  var revision = object({
5956
- modelVersion: union([literal(2), literal(4)]),
5989
+ modelVersion: union([
5990
+ literal(2),
5991
+ literal(4),
5992
+ literal(5)
5993
+ ]),
5957
5994
  document,
5958
5995
  modules: record$1(text, module)
5959
5996
  });
@@ -6113,7 +6150,7 @@ function repairRevisionEnvelope(value) {
6113
6150
  checkJsonDepth(value);
6114
6151
  const envelopeSource = record(value);
6115
6152
  if (envelopeSource.kind != "open-flow-flow-revision" || envelopeSource.version != 1) throw new TypeError("The value is not an Open Flow Revision envelope.");
6116
- if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 4) throw new TypeError("The Flow model is newer than this package.");
6153
+ if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 5) throw new TypeError("The Flow model is newer than this package.");
6117
6154
  const sourceDocument = record(envelopeSource.modelVersion == 1 || envelopeSource.modelVersion == 2 ? upgradeLegacyDocument(envelopeSource.document) : envelopeSource.document);
6118
6155
  const bindings = record(sourceDocument.bindings);
6119
6156
  const sourceGraph = repairGraph(sourceDocument.graph, bindings);
@@ -6126,7 +6163,7 @@ function repairRevisionEnvelope(value) {
6126
6163
  return result.success ? [[id, result.data]] : [];
6127
6164
  }));
6128
6165
  return decodeRevisionContent({
6129
- modelVersion: 4,
6166
+ modelVersion: 5,
6130
6167
  document: {
6131
6168
  bindings: repairedEntries(sourceDocument.bindings, binding),
6132
6169
  graph: sourceGraph,
@@ -6142,7 +6179,10 @@ function decodeFlowDocument(value) {
6142
6179
  }
6143
6180
  function decodeRevisionContent(value) {
6144
6181
  checkJsonDepth(value);
6145
- return revision.parse(value);
6182
+ const content = revision.parse(value);
6183
+ checkErrorModelVersion(content);
6184
+ assertOpenApiAuthBindings(content.document);
6185
+ return content;
6146
6186
  }
6147
6187
  function decodeRevisionEnvelope(value) {
6148
6188
  checkJsonDepth(value);
@@ -6152,6 +6192,8 @@ function decodeRevisionEnvelope(value) {
6152
6192
  document: upgradeLegacyDocument(revisionSource.document)
6153
6193
  } : value;
6154
6194
  const content = envelope.parse(candidate);
6195
+ checkErrorModelVersion(content);
6196
+ assertOpenApiAuthBindings(content.document);
6155
6197
  return {
6156
6198
  modelVersion: content.modelVersion,
6157
6199
  document: content.document,
@@ -6159,6 +6201,11 @@ function decodeRevisionEnvelope(value) {
6159
6201
  };
6160
6202
  }
6161
6203
  var shapes = {
6204
+ "graph.trigger.sources.set": {
6205
+ nodeId: text,
6206
+ before: sourceFlowIds.optional(),
6207
+ value: sourceFlowIds.optional()
6208
+ },
6162
6209
  "binding.create": {
6163
6210
  bindingId: text,
6164
6211
  binding
@@ -6312,6 +6359,11 @@ var shapes = {
6312
6359
  before: text.optional(),
6313
6360
  value: text.optional()
6314
6361
  },
6362
+ "task.openapi.set": {
6363
+ taskId: text,
6364
+ before: managed,
6365
+ value: managed
6366
+ },
6315
6367
  "task.agent.set": {
6316
6368
  taskId: text,
6317
6369
  before: managed,
@@ -6332,6 +6384,9 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
6332
6384
  kind: literal(kind),
6333
6385
  ...shape
6334
6386
  })])).values()])).min(1);
6387
+ function checkErrorModelVersion(content) {
6388
+ if (content.modelVersion < 5 && [content.document.graph, ...Object.values(content.document.subflows).map((item) => item.graph)].some((item) => Object.values(item.nodes).some((itemNode) => itemNode.kind == "error"))) throw new TypeError("Error workflows require Flow model version 5.");
6389
+ }
6335
6390
  //#endregion
6336
6391
  //#region src/flow/common/encoding.ts
6337
6392
  var encoder = new TextEncoder();
@@ -6606,6 +6661,10 @@ function canonicalTriggerNode(trigger) {
6606
6661
  name: trigger.name
6607
6662
  });
6608
6663
  switch (trigger.kind) {
6664
+ case "error": return {
6665
+ ...common(trigger.kind),
6666
+ ...trigger.sourceFlowIds == null ? {} : { sourceFlowIds: [...trigger.sourceFlowIds] }
6667
+ };
6609
6668
  case "manual": return common(trigger.kind);
6610
6669
  case "webhook": return {
6611
6670
  ...common(trigger.kind),
@@ -6705,7 +6764,7 @@ function revisionRepairKind(bytes) {
6705
6764
  return;
6706
6765
  }
6707
6766
  const source = value;
6708
- return typeof source.modelVersion == "number" && source.modelVersion < 4 ? "upgrade" : "repair";
6767
+ return typeof source.modelVersion == "number" && source.modelVersion < 5 ? "upgrade" : "repair";
6709
6768
  }
6710
6769
  function repairRevision(bytes) {
6711
6770
  return repairRevisionEnvelope(revisionValue(bytes));