@oomol-lab/open-flow 0.1.0-beta.74 → 0.1.0-beta.76

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 (139) hide show
  1. package/README.md +3 -1
  2. package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-Cm1hbVzW.js} +4 -3
  3. package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-NzKtla_c.js} +62 -62
  4. package/dist/browser/{createResourceDialog-DI9pL-Yr.js → createResourceDialog-BgdedQqu.js} +3 -3
  5. package/dist/browser/{dialog-BYJGvItc.js → dialog-aSElFFw2.js} +322 -26
  6. package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-Dcz4HTo_.js} +2 -2
  7. package/dist/browser/{flowChanges-RL-H4CjD.js → flowChanges-NZyS7HSp.js} +490 -438
  8. package/dist/browser/{flowWorkspace-BkDsETj0.js → flowWorkspace-Bl0SDehy.js} +499 -61
  9. package/dist/browser/preview.css +696 -825
  10. package/dist/browser/preview.js +1399 -717
  11. package/dist/browser/theme.css +114 -262
  12. package/dist/browser/{tooltip-wZJRB9oP.js → tooltip-3XMK9jkr.js} +1 -1
  13. package/dist/browser/{typeScriptSession-CSRwWmZm.js → typeScriptSession-C9sBGOKZ.js} +1 -1
  14. package/dist/browser/ui.css +354 -460
  15. package/dist/browser/ui.js +1 -1
  16. package/dist/browser/workbench.css +696 -825
  17. package/dist/browser/workbench.js +13 -7
  18. package/dist/browser/{workbenchSelect-BcWPWGzw.js → workbenchSelect-DBGP7Y4Z.js} +2 -2
  19. package/dist/command/index.js +41 -43
  20. package/dist/common/authoring.d.ts +5 -5
  21. package/dist/common/authoringExamples.d.ts +3 -2
  22. package/dist/common/authoringSchema.d.ts +70 -4
  23. package/dist/common/connector-proxy.d.ts +1 -1
  24. package/dist/common/control-api-conformance.js +250 -138
  25. package/dist/common/control-api.d.ts +3 -2
  26. package/dist/common/control-api.js +246 -134
  27. package/dist/common/control-requests.d.ts +3 -3
  28. package/dist/common/control-requests.js +353 -79
  29. package/dist/common/cron-trigger.d.ts +2 -1
  30. package/dist/common/decision.d.ts +4 -4
  31. package/dist/common/decision.js +5 -2
  32. package/dist/common/engine-contract.d.ts +6 -1
  33. package/dist/common/event-source-definition.d.ts +1 -1
  34. package/dist/common/event-source-view.d.ts +22 -0
  35. package/dist/common/event-source.d.ts +1 -1
  36. package/dist/common/event-source.js +24 -65
  37. package/dist/common/event-sources.d.ts +0 -21
  38. package/dist/common/flow-authoring.js +90 -19
  39. package/dist/common/flow-change-schema.d.ts +9 -1
  40. package/dist/common/flow-change.d.ts +7 -201
  41. package/dist/common/flow-change.js +96 -23
  42. package/dist/common/flow-encoding.js +89 -21
  43. package/dist/common/flow-graph.d.ts +2 -1
  44. package/dist/common/flow-input-value.d.ts +1 -1
  45. package/dist/common/flow-model.d.ts +121 -0
  46. package/dist/common/flow-notifications.d.ts +1 -1
  47. package/dist/common/flow-retry.d.ts +3 -5
  48. package/dist/common/flow-semantics.js +816 -586
  49. package/dist/common/flow-workflowReferences.d.ts +8 -0
  50. package/dist/common/flowInspection.d.ts +1 -1
  51. package/dist/common/http-hosts.d.ts +6 -0
  52. package/dist/common/http-request.d.ts +164 -0
  53. package/dist/common/http-request.js +5272 -0
  54. package/dist/common/integration-trigger.d.ts +2 -1
  55. package/dist/common/mcp.d.ts +3 -3
  56. package/dist/common/mcp.js +248 -136
  57. package/dist/common/openapi.d.ts +4 -4
  58. package/dist/common/openapi.js +4 -1
  59. package/dist/common/poll-trigger.d.ts +2 -1
  60. package/dist/common/run-events.js +11 -9
  61. package/dist/common/runtime-contract.d.ts +23 -1
  62. package/dist/common/runtime-contract.js +607 -72
  63. package/dist/common/runtime-nodejs-compat.d.ts +44 -0
  64. package/dist/common/runtime-nodejs-compat.js +5870 -0
  65. package/dist/common/scheduler-checkpoint.d.ts +1 -1
  66. package/dist/common/scheduler-node-execution.d.ts +1 -1
  67. package/dist/common/scheduler.d.ts +2 -2
  68. package/dist/common/scheduler.js +95 -25
  69. package/dist/common/trigger-catalog.d.ts +1 -7
  70. package/dist/common/trigger-config-options.d.ts +1 -1
  71. package/dist/common/trigger-config.d.ts +1 -1
  72. package/dist/common/trigger-contract.d.ts +2 -1
  73. package/dist/common/trigger-localization.d.ts +8 -2
  74. package/dist/common/trigger-model.d.ts +101 -0
  75. package/dist/common/webhook-response.d.ts +1 -3
  76. package/dist/common/webhook-trigger.d.ts +3 -1
  77. package/dist/common/webhook-trigger.js +12 -11
  78. package/dist/common/workflow.d.ts +3 -12
  79. package/dist/common/workflow.js +25 -23
  80. package/dist/index.d.ts +41 -14
  81. package/package.json +9 -1
  82. package/skills/open-flow/references/flow-authoring.md +1 -0
  83. package/skills/open-flow/references/flow-n8n-conversion.md +19 -15
  84. package/src/base/common/json.ts +1 -1
  85. package/src/connector/common/proxy.ts +1 -1
  86. package/src/control/common/api.ts +7 -5
  87. package/src/control/common/authoring.ts +14 -3
  88. package/src/control/common/authoringExamples.ts +8 -0
  89. package/src/control/common/authoringSchema.ts +38 -25
  90. package/src/control/common/authoringTools.ts +1 -1
  91. package/src/control/common/conformance.ts +1 -1
  92. package/src/control/common/connectorDecoders.ts +1 -1
  93. package/src/control/common/eventSources.ts +2 -29
  94. package/src/control/common/triggerCatalog.ts +1 -8
  95. package/src/decision/common/decision.ts +15 -7
  96. package/src/event-source/common/definition.ts +1 -1
  97. package/src/event-source/common/index.ts +1 -1
  98. package/src/event-source/common/view.ts +20 -0
  99. package/src/execution/common/checkpoint.ts +1 -1
  100. package/src/execution/common/events.ts +3 -0
  101. package/src/execution/common/node-execution.ts +5 -3
  102. package/src/execution/common/scheduler.ts +2 -1
  103. package/src/flow/common/change.ts +59 -192
  104. package/src/flow/common/changeSchema.ts +39 -5
  105. package/src/flow/common/connectionUsage.ts +1 -1
  106. package/src/flow/common/graph.ts +10 -4
  107. package/src/flow/common/inputValue.ts +1 -1
  108. package/src/flow/common/model.ts +130 -0
  109. package/src/flow/common/modules.ts +1 -1
  110. package/src/flow/common/portChanges.ts +1 -1
  111. package/src/flow/common/retry.ts +3 -5
  112. package/src/flow/common/semantics.ts +71 -7
  113. package/src/flow/common/webhookResponse.ts +4 -8
  114. package/src/flow/common/workflowReferences.ts +31 -0
  115. package/src/http/common/authBindings.ts +9 -0
  116. package/src/http/common/headers.ts +5 -0
  117. package/src/http/common/hosts.ts +13 -0
  118. package/src/http/common/httpRequest.ts +266 -0
  119. package/src/openapi/common/openapi.ts +9 -5
  120. package/src/{execution → runtime}/common/engineContract.ts +24 -15
  121. package/src/runtime/common/nodejsCompat.ts +275 -0
  122. package/src/runtime/common/nodejsGuest.generated.json +47 -0
  123. package/src/runtime/common/runtime.ts +1138 -0
  124. package/src/trigger/common/config.ts +1 -1
  125. package/src/trigger/common/configOptions.ts +1 -1
  126. package/src/trigger/common/contract.ts +2 -1
  127. package/src/trigger/common/cron.ts +2 -1
  128. package/src/trigger/common/integration.ts +2 -1
  129. package/src/trigger/common/model.ts +87 -0
  130. package/src/trigger/common/poll.ts +2 -1
  131. package/src/trigger/common/webhook.ts +7 -4
  132. package/src/trigger/providers/fieldDescriptions.ts +1 -1
  133. package/src/trigger/providers/localization.ts +9 -2
  134. package/src/trigger/providers/remote.ts +1 -1
  135. package/src/types/index.ts +44 -15
  136. package/src/workflow/common/workflow.ts +3 -44
  137. package/src/execution/common/runtime.ts +0 -563
  138. package/src/openapi/common/authBindings.ts +0 -12
  139. /package/src/{control → connector}/common/providerIconSprite.ts +0 -0
@@ -8693,16 +8693,10 @@ function isSchemaKeyword(value) {
8693
8693
  /** Shared by decision entry points, the editor, and durable decision storage. */
8694
8694
  var waitCommentSchema = string$1().trim().refine((value) => [...value].length <= 2e3, "Wait comment must contain at most 2,000 Unicode code points.").nullable().optional();
8695
8695
  //#endregion
8696
- //#region src/openapi/common/authBindings.ts
8697
- /** Never allow credentials to enter a Revision as literal node inputs. */
8698
- function assertOpenApiAuthBindings(document) {
8699
- for (const node of Object.values(document.graph.nodes)) {
8700
- if (node.kind != "task" || !("executor" in node.task) || node.task.executor.kind != "openapi") continue;
8701
- for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("OpenAPI authentication accepts deployment variables and upstream outputs only.");
8702
- }
8703
- }
8704
- //#endregion
8705
8696
  //#region src/decision/common/decision.ts
8697
+ function isDecisionExecutor(executor) {
8698
+ return executor.kind === "decision";
8699
+ }
8706
8700
  var decisionLimits = {
8707
8701
  choice: 255,
8708
8702
  score: 10
@@ -8725,7 +8719,7 @@ function limitDecisionQuestions(questions) {
8725
8719
  }
8726
8720
  /** Loading an oversized task also updates its previously generated output schemas. */
8727
8721
  function limitDecisionTask(task) {
8728
- if (task.executor.kind !== "decision") return task;
8722
+ if (!isDecisionExecutor(task.executor)) return task;
8729
8723
  const original = task.executor.questions;
8730
8724
  const questions = limitDecisionQuestions(original);
8731
8725
  if (questions === original) return task;
@@ -8791,6 +8785,67 @@ function answerSchema(question) {
8791
8785
  required: Object.keys(properties)
8792
8786
  };
8793
8787
  }
8788
+ //#endregion
8789
+ //#region src/http/common/authBindings.ts
8790
+ /** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
8791
+ function assertHttpAuthBindings(inputs) {
8792
+ for (const [handle, mapping] of Object.entries(inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("HTTP authentication accepts deployment variables and upstream outputs only.");
8793
+ }
8794
+ //#endregion
8795
+ //#region src/http/common/hosts.ts
8796
+ /** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
8797
+ var httpHostPattern = /^(?:\*\.)?(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
8798
+ /** Wildcards must name a registrable suffix, so `*.com` is rejected. */
8799
+ function isHttpHost(value) {
8800
+ return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
8801
+ }
8802
+ //#endregion
8803
+ //#region src/http/common/httpRequest.ts
8804
+ var parameterSchema = strictObject({
8805
+ mode: _enum(["fields", "object"]).default("fields"),
8806
+ names: array(string$1()).default([])
8807
+ });
8808
+ var httpRequestConfigSchema = strictObject({
8809
+ method: _enum([
8810
+ "GET",
8811
+ "POST",
8812
+ "PUT",
8813
+ "PATCH",
8814
+ "DELETE",
8815
+ "HEAD",
8816
+ "OPTIONS"
8817
+ ]).default("GET"),
8818
+ query: parameterSchema.default({
8819
+ mode: "fields",
8820
+ names: []
8821
+ }),
8822
+ headers: parameterSchema.default({
8823
+ mode: "fields",
8824
+ names: []
8825
+ }),
8826
+ bodyFormat: _enum([
8827
+ "none",
8828
+ "json",
8829
+ "text",
8830
+ "form"
8831
+ ]).default("none"),
8832
+ authentication: union([
8833
+ strictObject({ type: literal("none") }),
8834
+ strictObject({ type: _enum(["bearer", "basic"]) }),
8835
+ strictObject({
8836
+ type: literal("apiKey"),
8837
+ name: string$1(),
8838
+ in: _enum(["header", "query"])
8839
+ })
8840
+ ]).default({ type: "none" }),
8841
+ responseFormat: _enum([
8842
+ "auto",
8843
+ "json",
8844
+ "text"
8845
+ ]).default("auto"),
8846
+ statusPolicy: _enum(["success", "all"]).default("success")
8847
+ });
8848
+ var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
8794
8849
  function checkJsonDepth(value, depth = 0) {
8795
8850
  if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
8796
8851
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
@@ -8960,7 +9015,15 @@ var workflowCapabilitySchema = strictObject({
8960
9015
  inputs: array(port$1),
8961
9016
  outputs: array(port$1).nullable()
8962
9017
  });
8963
- var capability = union([connectorCapabilitySchema, workflowCapabilitySchema]);
9018
+ var httpCapabilitySchema = strictObject({
9019
+ kind: literal("http"),
9020
+ hosts: array(text.refine(isHttpHost, "Use a lowercase host name or IPv4 address, optionally prefixed by \"*.\" for subdomains.")).min(1).max(20).describe("Hosts Code may call with context.fetch. \"*.example.com\" matches subdomains only.")
9021
+ });
9022
+ var capability = union([
9023
+ connectorCapabilitySchema,
9024
+ workflowCapabilitySchema,
9025
+ httpCapabilitySchema
9026
+ ]);
8964
9027
  var inline = object({
8965
9028
  ...ports$1,
8966
9029
  name: text,
@@ -9070,7 +9133,8 @@ var managedFields = object({
9070
9133
  kind: literal("workflow"),
9071
9134
  flowId: text,
9072
9135
  revisionId: text
9073
- })
9136
+ }),
9137
+ httpRequestExecutorSchema
9074
9138
  ])
9075
9139
  });
9076
9140
  var managed = managedFields.transform(limitDecisionTask);
@@ -9339,7 +9403,8 @@ var revision = object({
9339
9403
  literal(8),
9340
9404
  literal(9),
9341
9405
  literal(10),
9342
- literal(11)
9406
+ literal(11),
9407
+ literal(12)
9343
9408
  ]),
9344
9409
  document,
9345
9410
  modules: record$2(text, module)
@@ -9370,7 +9435,7 @@ function decodeRevisionContent(value) {
9370
9435
  checkJsonDepth(value);
9371
9436
  const content = revision.parse(value);
9372
9437
  checkModelVersion(content);
9373
- assertOpenApiAuthBindings(content.document);
9438
+ assertDocumentHttpAuthBindings(content.document);
9374
9439
  return content;
9375
9440
  }
9376
9441
  var shapes = {
@@ -9540,6 +9605,8 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
9540
9605
  ...shape
9541
9606
  })])).values()])).min(1);
9542
9607
  function checkModelVersion(content) {
9608
+ if (content.modelVersion < 12 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "moduleId" in candidateNode.task && candidateNode.task.capabilities?.some((item) => item.kind == "http"))) throw new TypeError("Code HTTP access requires Flow model version 12.");
9609
+ if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind == "http-request")) throw new TypeError("HTTP Request requires Flow model version 11.");
9543
9610
  if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && ("moduleId" in candidateNode.task ? candidateNode.task.capabilities?.some((item) => item.kind == "workflow") : candidateNode.task.executor.kind == "agent" && candidateNode.task.executor.tools.some((item) => item.kind == "workflow")))) throw new TypeError("Workflow tools require Flow model version 11.");
9544
9611
  if (content.modelVersion < 10 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "webhook" && (candidateNode.options?.responseBody != null || candidateNode.options?.responseStatusCodeOutput != null || candidateNode.options?.responseHeadersSource != null || candidateNode.options?.responseHeaderOutputs != null))) throw new TypeError("Dynamic Webhook responses require Flow model version 10.");
9545
9612
  if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
@@ -9554,6 +9621,9 @@ function checkModelVersion(content) {
9554
9621
  if (content.modelVersion < 6 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task)) throw new TypeError("Node-owned managed Tasks require Flow model version 6.");
9555
9622
  if (content.modelVersion < 5 && Object.values(content.document.graph.nodes).some((itemNode) => itemNode.kind == "error")) throw new TypeError("Error workflows require Flow model version 5.");
9556
9623
  }
9624
+ function assertDocumentHttpAuthBindings(content) {
9625
+ for (const graphNode of Object.values(content.graph.nodes)) if (graphNode.kind == "task" && "executor" in graphNode.task && ["openapi", "http-request"].includes(graphNode.task.executor.kind)) assertHttpAuthBindings(graphNode.inputs);
9626
+ }
9557
9627
  function resourceNameIssue(value) {
9558
9628
  const name = value.trim();
9559
9629
  if (name.length == 0) return "empty";
@@ -9565,6 +9635,78 @@ function resourceNameIssue(value) {
9565
9635
  if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(name)) return "specialCharacter";
9566
9636
  }
9567
9637
  //#endregion
9638
+ //#region src/runtime/common/engineContract.ts
9639
+ /** v9 is a single contract: the Node compatibility builtins, `context.fetch`, and no `context.egress`. */
9640
+ var currentEngineContract = "open-flow-engine/v9";
9641
+ /** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
9642
+ var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
9643
+ var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
9644
+ export function identity(value) { return value }
9645
+ `;
9646
+ var v8Contract = {
9647
+ workflowTools: true,
9648
+ httpRequests: true,
9649
+ waitAutoContinue: true,
9650
+ webhookResponses: true,
9651
+ platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
9652
+ platformModule: "open-flow:platform",
9653
+ platformSource: platformSource("open-flow-engine/v8")
9654
+ };
9655
+ var nodejsContract = {
9656
+ ...v8Contract,
9657
+ builtinModules: new Set([
9658
+ "assert",
9659
+ "assert/strict",
9660
+ "buffer",
9661
+ "console",
9662
+ "constants",
9663
+ "crypto",
9664
+ "events",
9665
+ "fs",
9666
+ "fs/promises",
9667
+ "os",
9668
+ "path",
9669
+ "path/posix",
9670
+ "process",
9671
+ "punycode",
9672
+ "querystring",
9673
+ "stream",
9674
+ "stream/promises",
9675
+ "stream/web",
9676
+ "string_decoder",
9677
+ "timers",
9678
+ "timers/promises",
9679
+ "url",
9680
+ "util",
9681
+ "zlib"
9682
+ ].flatMap((name) => [name, `node:${name}`])),
9683
+ platformSource: platformSource(nodejsEngineContract)
9684
+ };
9685
+ var currentContract = {
9686
+ ...nodejsContract,
9687
+ codeFetch: true,
9688
+ platformSource: platformSource(currentEngineContract)
9689
+ };
9690
+ function findEngineContract(contract) {
9691
+ if (contract == "open-flow-engine/v9") return currentContract;
9692
+ if (contract == "open-flow-engine/v8") return v8Contract;
9693
+ if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
9694
+ if (contract == "open-flow-engine/v7" || contract == "open-flow-engine/v7/nodejs-compat-v1") return {
9695
+ ...contract.endsWith("/nodejs-compat-v1") ? nodejsContract : v8Contract,
9696
+ workflowTools: false,
9697
+ httpRequests: false,
9698
+ platformSource: platformSource(contract)
9699
+ };
9700
+ if (contract == "open-flow-engine/v6" || contract == "open-flow-engine/v6/nodejs-compat-v1") return {
9701
+ ...contract == "open-flow-engine/v6" ? v8Contract : nodejsContract,
9702
+ workflowTools: false,
9703
+ httpRequests: false,
9704
+ waitAutoContinue: false,
9705
+ webhookResponses: false,
9706
+ platformSource: platformSource(contract)
9707
+ };
9708
+ }
9709
+ //#endregion
9568
9710
  //#region src/control/common/authoringLlm.ts
9569
9711
  var authoringLlmConfiguration = strictObject({
9570
9712
  mode: _enum(["chat", "json"]),
@@ -9593,9 +9735,9 @@ var authoringOpenApiSchema = strictObject({
9593
9735
  });
9594
9736
  //#endregion
9595
9737
  //#region src/control/common/authoringSchema.ts
9596
- var id$2 = string$1().min(1);
9738
+ var id$3 = string$1().min(1);
9597
9739
  var json$2 = json$4();
9598
- var patch = record$2(id$2, json$2);
9740
+ var patch = record$2(id$3, json$2);
9599
9741
  var type = _enum([
9600
9742
  "start",
9601
9743
  "outputs",
@@ -9612,16 +9754,17 @@ var type = _enum([
9612
9754
  "llm",
9613
9755
  "decision",
9614
9756
  "openapi",
9757
+ "http-request",
9615
9758
  "condition",
9616
9759
  "value",
9617
9760
  "wait",
9618
9761
  "approval"
9619
9762
  ]);
9620
- var referenceSchema = id$2.describe("An existing node reference returned by read/search, or $alias for a preceding node.add in this edit batch. For node.add.as \"step\", reference \"$step\", never bare \"step\". Aliases are local to one batch.");
9763
+ var referenceSchema = id$3.describe("An existing node reference returned by read/search, or $alias for a preceding node.add in this edit batch. For node.add.as \"step\", reference \"$step\", never bare \"step\". Aliases are local to one batch.");
9621
9764
  var output = strictObject({
9622
9765
  kind: literal("output"),
9623
9766
  node: referenceSchema,
9624
- port: id$2.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
9767
+ port: id$3.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
9625
9768
  field: string$1().optional()
9626
9769
  });
9627
9770
  var system = strictObject({
@@ -9632,7 +9775,7 @@ var system = strictObject({
9632
9775
  });
9633
9776
  var variable$1 = strictObject({
9634
9777
  kind: literal("variable"),
9635
- name: id$2
9778
+ name: id$3
9636
9779
  });
9637
9780
  var authoringSourceSchema = union([
9638
9781
  output,
@@ -9663,7 +9806,7 @@ var operand = union([
9663
9806
  system,
9664
9807
  variable$1
9665
9808
  ]);
9666
- var toolSources = record$2(id$2, agentToolFields.inputs.element.shape.source).optional().describe("Tool input sources by name. The platform resolves types from the selected Action or workflow. New inputs default to model-provided; omitted existing sources are preserved.");
9809
+ var toolSources = record$2(id$3, agentToolFields.inputs.element.shape.source).optional().describe("Tool input sources by name. The platform resolves types from the selected Action or workflow. New inputs default to model-provided; omitted existing sources are preserved.");
9667
9810
  var agentTool = union([workflowAgentToolSchema.omit({
9668
9811
  id: true,
9669
9812
  inputs: true,
@@ -9673,20 +9816,24 @@ var agentTool = union([workflowAgentToolSchema.omit({
9673
9816
  id: true,
9674
9817
  inputs: true
9675
9818
  }).extend({ inputs: toolSources }).strict()]);
9676
- var authoringCapabilities = array(union([connectorCapabilitySchema, strictObject({
9677
- kind: literal("workflow"),
9678
- name: id$2,
9679
- flowId: id$2
9680
- })]));
9819
+ var authoringCapabilities = array(union([
9820
+ connectorCapabilitySchema,
9821
+ strictObject({
9822
+ kind: literal("workflow"),
9823
+ name: id$3,
9824
+ flowId: id$3
9825
+ }),
9826
+ httpCapabilitySchema
9827
+ ]));
9681
9828
  var notification = strictObject({
9682
9829
  ...authoringDefinitionSchemas.connector.shape,
9683
- messageHandle: id$2,
9684
- inputs: record$2(id$2, union([strictObject({
9830
+ messageHandle: id$3,
9831
+ inputs: record$2(id$3, union([strictObject({
9685
9832
  kind: literal("value"),
9686
9833
  value: json$2
9687
9834
  }), strictObject({
9688
9835
  kind: literal("input"),
9689
- input: id$2
9836
+ input: id$3
9690
9837
  })]))
9691
9838
  });
9692
9839
  var field = strictObject({
@@ -9694,14 +9841,14 @@ var field = strictObject({
9694
9841
  nullable: boolean().optional(),
9695
9842
  description: string$1().optional()
9696
9843
  });
9697
- var inputFields = record$2(id$2, field.extend({ default: json$2.optional() })).describe("Optional business input constraints by name. A binding to a new Code, Agent, LLM, Wait or Approval input automatically declares an input accepting any JSON. Existing constraints are preserved. Omitted schema accepts any JSON; omitted nullable is true. Use default for inherited values; input.set supplies data.");
9698
- var flowInputFields = record$2(id$2, field).describe("Workflow input definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Supply call values as trigger.outputs.");
9844
+ var inputFields = record$2(id$3, field.extend({ default: json$2.optional() })).describe("Optional business input constraints by name. A binding to a new Code, Agent, LLM, Wait or Approval input automatically declares an input accepting any JSON. Existing constraints are preserved. Omitted schema accepts any JSON; omitted nullable is true. Use default for inherited values; input.set supplies data.");
9845
+ var flowInputFields = record$2(id$3, field).describe("Workflow input definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Supply call values as trigger.outputs.");
9699
9846
  var flowOutputFields = flowInputFields.describe("Workflow output definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Set values on the Outputs node with input.set or node.add.inputs.");
9700
- var flowInputFieldsView = record$2(id$2, field.extend({
9847
+ var flowInputFieldsView = record$2(id$3, field.extend({
9701
9848
  schema: json$2,
9702
9849
  nullable: boolean()
9703
9850
  }));
9704
- var outputFields = record$2(id$2, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
9851
+ var outputFields = record$2(id$3, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
9705
9852
  var expression = strictObject({
9706
9853
  left: operand,
9707
9854
  operator: authoringDefinitionSchemas.condition.shape.cases.element.shape.groups.element.shape.expressions.element.shape.operator,
@@ -9715,20 +9862,20 @@ var when = union([
9715
9862
  ]);
9716
9863
  var authoringConfigurations = {
9717
9864
  "webhook-response": strictObject({}),
9718
- "workflow": strictObject({ flowId: id$2 }),
9865
+ "workflow": strictObject({ flowId: id$3 }),
9719
9866
  "start": strictObject({ inputDefs: flowInputFields.default({}) }),
9720
9867
  "outputs": strictObject({ outputDefs: flowOutputFields.default({}) }),
9721
- "error": strictObject({ sourceFlowIds: array(id$2).optional() }),
9868
+ "error": strictObject({ sourceFlowIds: array(id$3).optional() }),
9722
9869
  "webhook": authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
9723
9870
  "cron": strictObject({ schedule: authoringDefinitionSchemas.schedule }),
9724
9871
  "poll": strictObject({
9725
- key: id$2,
9726
- connectionId: id$2.optional(),
9872
+ key: id$3,
9873
+ connectionId: id$3.optional(),
9727
9874
  schedule: authoringDefinitionSchemas.schedule
9728
9875
  }),
9729
9876
  "integration": strictObject({
9730
- key: id$2,
9731
- connectionId: id$2.optional()
9877
+ key: id$3,
9878
+ connectionId: id$3.optional()
9732
9879
  }),
9733
9880
  "code": strictObject({
9734
9881
  inputs: inputFields,
@@ -9737,6 +9884,7 @@ var authoringConfigurations = {
9737
9884
  }),
9738
9885
  "connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
9739
9886
  "openapi": authoringOpenApiSchema,
9887
+ "http-request": httpRequestConfigSchema,
9740
9888
  "agent": authoringDefinitionSchemas.agent.omit({
9741
9889
  prompt: true,
9742
9890
  tools: true
@@ -9751,7 +9899,7 @@ var authoringConfigurations = {
9751
9899
  "condition": strictObject({
9752
9900
  match: _enum(["first", "all"]),
9753
9901
  branches: array(strictObject({
9754
- name: id$2,
9902
+ name: id$3,
9755
9903
  description: string$1().optional(),
9756
9904
  when
9757
9905
  }))
@@ -9768,7 +9916,7 @@ var authoringConfigurations = {
9768
9916
  };
9769
9917
  var updates = strictObject({
9770
9918
  onError: _enum(["stop", "error"]).optional(),
9771
- name: id$2.optional(),
9919
+ name: id$3.optional(),
9772
9920
  description: string$1().optional(),
9773
9921
  icon: string$1().optional(),
9774
9922
  maxExecutions: int().positive().optional(),
@@ -9779,13 +9927,13 @@ var updates = strictObject({
9779
9927
  var authoringEditSchema = discriminatedUnion("op", [
9780
9928
  strictObject({
9781
9929
  op: literal("node.add"),
9782
- as: id$2.regex(/^[A-Za-z][\w-]*$/).describe("Unique batch-local alias without the $ prefix. Later edits must reference this new node as $alias; the bare alias is not its node ID."),
9930
+ as: id$3.regex(/^[A-Za-z][\w-]*$/).describe("Unique batch-local alias without the $ prefix. Later edits must reference this new node as $alias; the bare alias is not its node ID."),
9783
9931
  type,
9784
- name: id$2,
9932
+ name: id$3,
9785
9933
  onError: _enum(["stop", "error"]).optional(),
9786
9934
  retry: retryConfigurationSchema.optional(),
9787
9935
  config: patch.optional(),
9788
- inputs: record$2(id$2, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
9936
+ inputs: record$2(id$3, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
9789
9937
  code: string$1().optional(),
9790
9938
  prompt: string$1().optional()
9791
9939
  }),
@@ -9793,12 +9941,12 @@ var authoringEditSchema = discriminatedUnion("op", [
9793
9941
  op: literal("node.update"),
9794
9942
  node: referenceSchema,
9795
9943
  set: updates.optional(),
9796
- clear: array(array(id$2).min(1)).optional()
9944
+ clear: array(array(id$3).min(1)).optional()
9797
9945
  }),
9798
9946
  strictObject({
9799
9947
  op: literal("node.refresh"),
9800
9948
  node: referenceSchema,
9801
- tool: id$2.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
9949
+ tool: id$3.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
9802
9950
  }),
9803
9951
  strictObject({
9804
9952
  op: literal("node.remove"),
@@ -9807,20 +9955,20 @@ var authoringEditSchema = discriminatedUnion("op", [
9807
9955
  strictObject({
9808
9956
  op: literal("input.set"),
9809
9957
  node: referenceSchema,
9810
- input: id$2,
9958
+ input: id$3,
9811
9959
  source: authoringSourceSchema
9812
9960
  }),
9813
9961
  strictObject({
9814
9962
  op: _enum(["edge.connect", "edge.disconnect"]),
9815
9963
  source: referenceSchema,
9816
9964
  target: referenceSchema,
9817
- branch: id$2.optional()
9965
+ branch: id$3.optional()
9818
9966
  }),
9819
9967
  strictObject({
9820
9968
  op: literal("text.edit"),
9821
9969
  node: referenceSchema,
9822
9970
  field: _enum(["code", "prompt"]),
9823
- oldText: id$2,
9971
+ oldText: id$3,
9824
9972
  newText: string$1()
9825
9973
  }),
9826
9974
  strictObject({
@@ -9831,15 +9979,15 @@ var authoringEditSchema = discriminatedUnion("op", [
9831
9979
  })
9832
9980
  ]);
9833
9981
  var authoringRequestSchema = strictObject({
9834
- baseRevision: id$2,
9835
- requestId: id$2.max(256),
9982
+ baseRevision: id$3,
9983
+ requestId: id$3.max(256),
9836
9984
  edits: array(authoringEditSchema).min(1).max(1e3)
9837
9985
  });
9838
9986
  var authoringReadSchema = strictObject({
9839
- revision: id$2.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
9840
- nodes: array(id$2).min(1).max(100).optional().describe("Node references to read in one batch. Mutually exclusive with text. Long texts return metadata."),
9987
+ revision: id$3.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
9988
+ nodes: array(id$3).min(1).max(100).optional().describe("Node references to read in one batch. Mutually exclusive with text. Long texts return metadata."),
9841
9989
  text: strictObject({
9842
- node: id$2,
9990
+ node: id$3,
9843
9991
  field: _enum(["code", "prompt"]),
9844
9992
  start: int().positive().default(1),
9845
9993
  lines: int().min(1).max(200).default(80)
@@ -9848,42 +9996,43 @@ var authoringReadSchema = strictObject({
9848
9996
  not: { required: ["nodes", "text"] },
9849
9997
  description: "Omit nodes and text for an outline; provide nodes for details, or text for an excerpt."
9850
9998
  });
9851
- strictObject({ revisionId: id$2 });
9999
+ strictObject({ revisionId: id$3 });
9852
10000
  var authoringSearchSchema = strictObject({
9853
- revision: id$2.optional(),
9854
- query: id$2.max(1e3),
10001
+ revision: id$3.optional(),
10002
+ query: id$3.max(1e3),
9855
10003
  type: type.optional(),
9856
10004
  offset: int().nonnegative().default(0),
9857
10005
  limit: int().min(1).max(100).default(20)
9858
10006
  });
9859
10007
  var authoringSchemaQuery = strictObject({
9860
10008
  type: type.optional(),
9861
- action: id$2.optional()
10009
+ action: id$3.optional()
9862
10010
  }).refine((v) => v.type == null || v.action == null, "Choose type or action.");
10011
+ `${[...findEngineContract(currentEngineContract).builtinModules].filter((name) => !name.startsWith("node:")).join(", ")}`;
9863
10012
  var authoringDiagnosticSchema = object({
9864
- code: id$2,
10013
+ code: id$3,
9865
10014
  message: string$1(),
9866
- nodes: array(id$2),
10015
+ nodes: array(id$3),
9867
10016
  field: string$1().optional(),
9868
10017
  line: number().optional(),
9869
10018
  column: number().optional()
9870
10019
  });
9871
10020
  var authoringCheckResponse = object({
9872
- flowId: id$2,
9873
- revisionId: id$2,
10021
+ flowId: id$3,
10022
+ revisionId: id$3,
9874
10023
  valid: boolean(),
9875
10024
  diagnostics: array(authoringDiagnosticSchema),
9876
10025
  version: literal(1)
9877
10026
  });
9878
10027
  var authoringEditResponse = object({
9879
- flowId: id$2,
10028
+ flowId: id$3,
9880
10029
  saved: literal(true),
9881
- revision: id$2,
9882
- nodes: record$2(id$2, id$2),
10030
+ revision: id$3,
10031
+ nodes: record$2(id$3, id$3),
9883
10032
  changes: array(object({
9884
10033
  index: int(),
9885
- op: id$2,
9886
- node: id$2.optional()
10034
+ op: id$3,
10035
+ node: id$3.optional()
9887
10036
  })),
9888
10037
  validation: object({
9889
10038
  status: _enum([
@@ -9896,8 +10045,8 @@ var authoringEditResponse = object({
9896
10045
  version: literal(1)
9897
10046
  });
9898
10047
  var authoringReadResponse = object({
9899
- flowId: id$2,
9900
- revision: id$2,
10048
+ flowId: id$3,
10049
+ revision: id$3,
9901
10050
  data: object({
9902
10051
  nodes: array(record$2(string$1(), json$2)).optional(),
9903
10052
  edges: array(json$2).optional(),
@@ -9906,12 +10055,12 @@ var authoringReadResponse = object({
9906
10055
  version: literal(1)
9907
10056
  });
9908
10057
  var authoringSearchResponse = object({
9909
- flowId: id$2,
9910
- revision: id$2,
10058
+ flowId: id$3,
10059
+ revision: id$3,
9911
10060
  data: object({
9912
10061
  matches: array(object({
9913
- node: id$2.optional(),
9914
- field: id$2,
10062
+ node: id$3.optional(),
10063
+ field: id$3,
9915
10064
  line: int().optional(),
9916
10065
  excerpt: string$1()
9917
10066
  })),
@@ -9929,35 +10078,6 @@ var resultQuerySchema = strictObject({
9929
10078
  maxBytes: number().int().min(1).max(1048576).default(15e3)
9930
10079
  });
9931
10080
  //#endregion
9932
- //#region src/execution/common/engineContract.ts
9933
- var currentEngineContract = "open-flow-engine/v8";
9934
- `${JSON.stringify(currentEngineContract)}`, new Set([
9935
- "assert",
9936
- "assert/strict",
9937
- "buffer",
9938
- "console",
9939
- "constants",
9940
- "crypto",
9941
- "events",
9942
- "fs",
9943
- "fs/promises",
9944
- "os",
9945
- "path",
9946
- "path/posix",
9947
- "process",
9948
- "punycode",
9949
- "querystring",
9950
- "stream",
9951
- "stream/promises",
9952
- "stream/web",
9953
- "string_decoder",
9954
- "timers",
9955
- "timers/promises",
9956
- "url",
9957
- "util",
9958
- "zlib"
9959
- ].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v8/nodejs-compat-v1")}`;
9960
- //#endregion
9961
10081
  //#region src/workflow/common/workflow.ts
9962
10082
  var portSchema = object({
9963
10083
  handle: string$1().min(1),
@@ -10521,7 +10641,7 @@ function decodeEntries(values, current) {
10521
10641
  return parsed.data;
10522
10642
  }
10523
10643
  //#endregion
10524
- //#region src/control/common/providerIconSprite.ts
10644
+ //#region src/connector/common/providerIconSprite.ts
10525
10645
  /** Optional artwork must never make an otherwise usable catalog unavailable. */
10526
10646
  function providerIconAppearance(metadata, position) {
10527
10647
  if (!metadata || typeof metadata != "object" || !position || typeof position != "object") return {};
@@ -10953,6 +11073,30 @@ function connectorProvider(value) {
10953
11073
  };
10954
11074
  }
10955
11075
  //#endregion
11076
+ //#region src/event-source/common/view.ts
11077
+ var id$2 = string$1().min(1).max(256);
11078
+ /** Public projection of a source that Connector validates and Open Flow exposes unchanged. */
11079
+ var eventSourceViewSchema = object({
11080
+ appId: id$2.nullable(),
11081
+ workspaceId: id$2.optional(),
11082
+ installationId: id$2.optional(),
11083
+ organizationId: id$2.optional(),
11084
+ projectId: id$2.optional(),
11085
+ projectKey: id$2.optional(),
11086
+ subscriptionStatus: _enum([
11087
+ "idle",
11088
+ "pending",
11089
+ "ready",
11090
+ "error"
11091
+ ]).optional(),
11092
+ lastError: string$1().optional(),
11093
+ signingSecretConfigured: boolean().optional(),
11094
+ manageSubscriptions: boolean().nullable(),
11095
+ verificationTokenConfigured: boolean().nullable(),
11096
+ encryptKeyConfigured: boolean().nullable(),
11097
+ verifiedAt: string$1().nullable()
11098
+ });
11099
+ //#endregion
10956
11100
  //#region src/control/common/eventSources.ts
10957
11101
  var id$1 = string$1().min(1).max(256);
10958
11102
  var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
@@ -10972,29 +11116,12 @@ var eventSourceSchema = object({
10972
11116
  "fireflies",
10973
11117
  "jira"
10974
11118
  ]),
10975
- appId: id$1.nullable(),
10976
- workspaceId: id$1.optional(),
10977
- installationId: id$1.optional(),
10978
- organizationId: id$1.optional(),
10979
- projectId: id$1.optional(),
10980
- projectKey: id$1.optional(),
10981
- subscriptionStatus: _enum([
10982
- "idle",
10983
- "pending",
10984
- "ready",
10985
- "error"
10986
- ]).optional(),
10987
- lastError: string$1().optional(),
10988
- signingSecretConfigured: boolean().optional(),
11119
+ ...eventSourceViewSchema.shape,
10989
11120
  connectionId: id$1,
10990
11121
  teamId: id$1.nullable(),
10991
11122
  enabled: boolean(),
10992
11123
  eventTypes: array(eventType),
10993
- manageSubscriptions: boolean().nullable(),
10994
- verificationTokenConfigured: boolean().nullable(),
10995
- encryptKeyConfigured: boolean().nullable(),
10996
11124
  endpointUrl: string$1().nullable(),
10997
- verifiedAt: string$1().nullable(),
10998
11125
  lastReceivedAt: string$1().nullable(),
10999
11126
  updatedAt: string$1(),
11000
11127
  consumers: array(object({
@@ -11003,21 +11130,6 @@ var eventSourceSchema = object({
11003
11130
  triggerNodeId: id$1
11004
11131
  }))
11005
11132
  });
11006
- eventSourceSchema.pick({
11007
- appId: true,
11008
- workspaceId: true,
11009
- installationId: true,
11010
- organizationId: true,
11011
- projectId: true,
11012
- projectKey: true,
11013
- subscriptionStatus: true,
11014
- lastError: true,
11015
- signingSecretConfigured: true,
11016
- manageSubscriptions: true,
11017
- verificationTokenConfigured: true,
11018
- encryptKeyConfigured: true,
11019
- verifiedAt: true
11020
- });
11021
11133
  function decodeEventSource(value) {
11022
11134
  return eventSourceSchema.parse(value);
11023
11135
  }
@@ -11855,7 +11967,7 @@ function decodeRunEvent(value) {
11855
11967
  switch (kind) {
11856
11968
  case "node.started": {
11857
11969
  const nodeKind = payload.nodeKind;
11858
- if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
11970
+ if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
11859
11971
  return {
11860
11972
  ...base,
11861
11973
  kind,