@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
@@ -1,31 +1,74 @@
1
- //#region src/execution/common/engineContract.ts
2
- var currentEngineContract = "open-flow-engine/v8";
3
- `${JSON.stringify(currentEngineContract)}`, new Set([
4
- "assert",
5
- "assert/strict",
6
- "buffer",
7
- "console",
8
- "constants",
9
- "crypto",
10
- "events",
11
- "fs",
12
- "fs/promises",
13
- "os",
14
- "path",
15
- "path/posix",
16
- "process",
17
- "punycode",
18
- "querystring",
19
- "stream",
20
- "stream/promises",
21
- "stream/web",
22
- "string_decoder",
23
- "timers",
24
- "timers/promises",
25
- "url",
26
- "util",
27
- "zlib"
28
- ].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v8/nodejs-compat-v1")}`;
1
+ //#region src/runtime/common/engineContract.ts
2
+ /** v9 is a single contract: the Node compatibility builtins, `context.fetch`, and no `context.egress`. */
3
+ var currentEngineContract = "open-flow-engine/v9";
4
+ /** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
5
+ var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
6
+ var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
7
+ export function identity(value) { return value }
8
+ `;
9
+ var v8Contract = {
10
+ workflowTools: true,
11
+ httpRequests: true,
12
+ waitAutoContinue: true,
13
+ webhookResponses: true,
14
+ platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
15
+ platformModule: "open-flow:platform",
16
+ platformSource: platformSource("open-flow-engine/v8")
17
+ };
18
+ var nodejsContract = {
19
+ ...v8Contract,
20
+ builtinModules: new Set([
21
+ "assert",
22
+ "assert/strict",
23
+ "buffer",
24
+ "console",
25
+ "constants",
26
+ "crypto",
27
+ "events",
28
+ "fs",
29
+ "fs/promises",
30
+ "os",
31
+ "path",
32
+ "path/posix",
33
+ "process",
34
+ "punycode",
35
+ "querystring",
36
+ "stream",
37
+ "stream/promises",
38
+ "stream/web",
39
+ "string_decoder",
40
+ "timers",
41
+ "timers/promises",
42
+ "url",
43
+ "util",
44
+ "zlib"
45
+ ].flatMap((name) => [name, `node:${name}`])),
46
+ platformSource: platformSource(nodejsEngineContract)
47
+ };
48
+ var currentContract = {
49
+ ...nodejsContract,
50
+ codeFetch: true,
51
+ platformSource: platformSource(currentEngineContract)
52
+ };
53
+ function findEngineContract(contract) {
54
+ if (contract == "open-flow-engine/v9") return currentContract;
55
+ if (contract == "open-flow-engine/v8") return v8Contract;
56
+ if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
57
+ if (contract == "open-flow-engine/v7" || contract == "open-flow-engine/v7/nodejs-compat-v1") return {
58
+ ...contract.endsWith("/nodejs-compat-v1") ? nodejsContract : v8Contract,
59
+ workflowTools: false,
60
+ httpRequests: false,
61
+ platformSource: platformSource(contract)
62
+ };
63
+ if (contract == "open-flow-engine/v6" || contract == "open-flow-engine/v6/nodejs-compat-v1") return {
64
+ ...contract == "open-flow-engine/v6" ? v8Contract : nodejsContract,
65
+ workflowTools: false,
66
+ httpRequests: false,
67
+ waitAutoContinue: false,
68
+ webhookResponses: false,
69
+ platformSource: platformSource(contract)
70
+ };
71
+ }
29
72
  //#endregion
30
73
  //#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/lite/index.mjs
31
74
  var has = Object.prototype.hasOwnProperty;
@@ -8554,6 +8597,9 @@ function webhookSupportsBody(method) {
8554
8597
  }
8555
8598
  //#endregion
8556
8599
  //#region src/decision/common/decision.ts
8600
+ function isDecisionExecutor(executor) {
8601
+ return executor.kind === "decision";
8602
+ }
8557
8603
  var decisionLimits = {
8558
8604
  choice: 255,
8559
8605
  score: 10
@@ -8576,7 +8622,7 @@ function limitDecisionQuestions(questions) {
8576
8622
  }
8577
8623
  /** Loading an oversized task also updates its previously generated output schemas. */
8578
8624
  function limitDecisionTask(task) {
8579
- if (task.executor.kind !== "decision") return task;
8625
+ if (!isDecisionExecutor(task.executor)) return task;
8580
8626
  const original = task.executor.questions;
8581
8627
  const questions = limitDecisionQuestions(original);
8582
8628
  if (questions === original) return task;
@@ -8643,14 +8689,66 @@ function answerSchema(question) {
8643
8689
  };
8644
8690
  }
8645
8691
  //#endregion
8646
- //#region src/openapi/common/authBindings.ts
8647
- /** Never allow credentials to enter a Revision as literal node inputs. */
8648
- function assertOpenApiAuthBindings(document) {
8649
- for (const node of Object.values(document.graph.nodes)) {
8650
- if (node.kind != "task" || !("executor" in node.task) || node.task.executor.kind != "openapi") continue;
8651
- 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.");
8652
- }
8692
+ //#region src/http/common/authBindings.ts
8693
+ /** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
8694
+ function assertHttpAuthBindings(inputs) {
8695
+ 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.");
8653
8696
  }
8697
+ //#endregion
8698
+ //#region src/http/common/hosts.ts
8699
+ /** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
8700
+ 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])?$/;
8701
+ /** Wildcards must name a registrable suffix, so `*.com` is rejected. */
8702
+ function isHttpHost(value) {
8703
+ return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
8704
+ }
8705
+ //#endregion
8706
+ //#region src/http/common/httpRequest.ts
8707
+ var parameterSchema = strictObject({
8708
+ mode: _enum(["fields", "object"]).default("fields"),
8709
+ names: array(string$1()).default([])
8710
+ });
8711
+ var httpRequestConfigSchema = strictObject({
8712
+ method: _enum([
8713
+ "GET",
8714
+ "POST",
8715
+ "PUT",
8716
+ "PATCH",
8717
+ "DELETE",
8718
+ "HEAD",
8719
+ "OPTIONS"
8720
+ ]).default("GET"),
8721
+ query: parameterSchema.default({
8722
+ mode: "fields",
8723
+ names: []
8724
+ }),
8725
+ headers: parameterSchema.default({
8726
+ mode: "fields",
8727
+ names: []
8728
+ }),
8729
+ bodyFormat: _enum([
8730
+ "none",
8731
+ "json",
8732
+ "text",
8733
+ "form"
8734
+ ]).default("none"),
8735
+ authentication: union([
8736
+ strictObject({ type: literal("none") }),
8737
+ strictObject({ type: _enum(["bearer", "basic"]) }),
8738
+ strictObject({
8739
+ type: literal("apiKey"),
8740
+ name: string$1(),
8741
+ in: _enum(["header", "query"])
8742
+ })
8743
+ ]).default({ type: "none" }),
8744
+ responseFormat: _enum([
8745
+ "auto",
8746
+ "json",
8747
+ "text"
8748
+ ]).default("auto"),
8749
+ statusPolicy: _enum(["success", "all"]).default("success")
8750
+ });
8751
+ var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
8654
8752
  function checkJsonDepth(value, depth = 0) {
8655
8753
  if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
8656
8754
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
@@ -8828,7 +8926,15 @@ var workflowCapabilitySchema = strictObject({
8828
8926
  inputs: array(port$1),
8829
8927
  outputs: array(port$1).nullable()
8830
8928
  });
8831
- var capability = union([connectorCapabilitySchema, workflowCapabilitySchema]);
8929
+ var httpCapabilitySchema = strictObject({
8930
+ kind: literal("http"),
8931
+ 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.")
8932
+ });
8933
+ var capability = union([
8934
+ connectorCapabilitySchema,
8935
+ workflowCapabilitySchema,
8936
+ httpCapabilitySchema
8937
+ ]);
8832
8938
  var inline = object({
8833
8939
  ...ports$1,
8834
8940
  name: text,
@@ -8938,7 +9044,8 @@ var managedFields = object({
8938
9044
  kind: literal("workflow"),
8939
9045
  flowId: text,
8940
9046
  revisionId: text
8941
- })
9047
+ }),
9048
+ httpRequestExecutorSchema
8942
9049
  ])
8943
9050
  });
8944
9051
  var managed = managedFields.transform(limitDecisionTask);
@@ -9207,7 +9314,8 @@ var revision = object({
9207
9314
  literal(8),
9208
9315
  literal(9),
9209
9316
  literal(10),
9210
- literal(11)
9317
+ literal(11),
9318
+ literal(12)
9211
9319
  ]),
9212
9320
  document,
9213
9321
  modules: record$2(text, module)
@@ -9238,7 +9346,7 @@ function decodeRevisionContent(value) {
9238
9346
  checkJsonDepth(value);
9239
9347
  const content = revision.parse(value);
9240
9348
  checkModelVersion(content);
9241
- assertOpenApiAuthBindings(content.document);
9349
+ assertDocumentHttpAuthBindings(content.document);
9242
9350
  return content;
9243
9351
  }
9244
9352
  var shapes = {
@@ -9408,6 +9516,8 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
9408
9516
  ...shape
9409
9517
  })])).values()])).min(1);
9410
9518
  function checkModelVersion(content) {
9519
+ 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.");
9520
+ 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.");
9411
9521
  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.");
9412
9522
  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.");
9413
9523
  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.");
@@ -9422,6 +9532,9 @@ function checkModelVersion(content) {
9422
9532
  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.");
9423
9533
  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.");
9424
9534
  }
9535
+ function assertDocumentHttpAuthBindings(content) {
9536
+ 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);
9537
+ }
9425
9538
  //#endregion
9426
9539
  //#region src/control/common/authoringLlm.ts
9427
9540
  var authoringLlmConfiguration = strictObject({
@@ -9451,9 +9564,9 @@ var authoringOpenApiSchema = strictObject({
9451
9564
  });
9452
9565
  //#endregion
9453
9566
  //#region src/control/common/authoringSchema.ts
9454
- var id$1 = string$1().min(1);
9567
+ var id$2 = string$1().min(1);
9455
9568
  var json$1 = json$3();
9456
- var patch = record$2(id$1, json$1);
9569
+ var patch = record$2(id$2, json$1);
9457
9570
  var type = _enum([
9458
9571
  "start",
9459
9572
  "outputs",
@@ -9470,16 +9583,17 @@ var type = _enum([
9470
9583
  "llm",
9471
9584
  "decision",
9472
9585
  "openapi",
9586
+ "http-request",
9473
9587
  "condition",
9474
9588
  "value",
9475
9589
  "wait",
9476
9590
  "approval"
9477
9591
  ]);
9478
- var referenceSchema = id$1.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.");
9592
+ 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.");
9479
9593
  var output = strictObject({
9480
9594
  kind: literal("output"),
9481
9595
  node: referenceSchema,
9482
- port: id$1.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
9596
+ port: id$2.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
9483
9597
  field: string$1().optional()
9484
9598
  });
9485
9599
  var system = strictObject({
@@ -9490,7 +9604,7 @@ var system = strictObject({
9490
9604
  });
9491
9605
  var variable$1 = strictObject({
9492
9606
  kind: literal("variable"),
9493
- name: id$1
9607
+ name: id$2
9494
9608
  });
9495
9609
  var authoringSourceSchema = union([
9496
9610
  output,
@@ -9521,7 +9635,7 @@ var operand = union([
9521
9635
  system,
9522
9636
  variable$1
9523
9637
  ]);
9524
- var toolSources = record$2(id$1, 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.");
9638
+ 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.");
9525
9639
  var agentTool = union([workflowAgentToolSchema.omit({
9526
9640
  id: true,
9527
9641
  inputs: true,
@@ -9531,20 +9645,24 @@ var agentTool = union([workflowAgentToolSchema.omit({
9531
9645
  id: true,
9532
9646
  inputs: true
9533
9647
  }).extend({ inputs: toolSources }).strict()]);
9534
- var authoringCapabilities = array(union([connectorCapabilitySchema, strictObject({
9535
- kind: literal("workflow"),
9536
- name: id$1,
9537
- flowId: id$1
9538
- })]));
9648
+ var authoringCapabilities = array(union([
9649
+ connectorCapabilitySchema,
9650
+ strictObject({
9651
+ kind: literal("workflow"),
9652
+ name: id$2,
9653
+ flowId: id$2
9654
+ }),
9655
+ httpCapabilitySchema
9656
+ ]));
9539
9657
  var notification = strictObject({
9540
9658
  ...authoringDefinitionSchemas.connector.shape,
9541
- messageHandle: id$1,
9542
- inputs: record$2(id$1, union([strictObject({
9659
+ messageHandle: id$2,
9660
+ inputs: record$2(id$2, union([strictObject({
9543
9661
  kind: literal("value"),
9544
9662
  value: json$1
9545
9663
  }), strictObject({
9546
9664
  kind: literal("input"),
9547
- input: id$1
9665
+ input: id$2
9548
9666
  })]))
9549
9667
  });
9550
9668
  var field = strictObject({
@@ -9552,14 +9670,14 @@ var field = strictObject({
9552
9670
  nullable: boolean().optional(),
9553
9671
  description: string$1().optional()
9554
9672
  });
9555
- var inputFields = record$2(id$1, field.extend({ default: json$1.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.");
9556
- var flowInputFields = record$2(id$1, field).describe("Workflow input definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Supply call values as trigger.outputs.");
9673
+ var inputFields = record$2(id$2, field.extend({ default: json$1.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.");
9674
+ 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.");
9557
9675
  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.");
9558
- var flowInputFieldsView = record$2(id$1, field.extend({
9676
+ var flowInputFieldsView = record$2(id$2, field.extend({
9559
9677
  schema: json$1,
9560
9678
  nullable: boolean()
9561
9679
  }));
9562
- var outputFields = record$2(id$1, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
9680
+ var outputFields = record$2(id$2, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
9563
9681
  var expression = strictObject({
9564
9682
  left: operand,
9565
9683
  operator: authoringDefinitionSchemas.condition.shape.cases.element.shape.groups.element.shape.expressions.element.shape.operator,
@@ -9573,20 +9691,20 @@ var when = union([
9573
9691
  ]);
9574
9692
  var authoringConfigurations = {
9575
9693
  "webhook-response": strictObject({}),
9576
- "workflow": strictObject({ flowId: id$1 }),
9694
+ "workflow": strictObject({ flowId: id$2 }),
9577
9695
  "start": strictObject({ inputDefs: flowInputFields.default({}) }),
9578
9696
  "outputs": strictObject({ outputDefs: flowOutputFields.default({}) }),
9579
- "error": strictObject({ sourceFlowIds: array(id$1).optional() }),
9697
+ "error": strictObject({ sourceFlowIds: array(id$2).optional() }),
9580
9698
  "webhook": authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
9581
9699
  "cron": strictObject({ schedule: authoringDefinitionSchemas.schedule }),
9582
9700
  "poll": strictObject({
9583
- key: id$1,
9584
- connectionId: id$1.optional(),
9701
+ key: id$2,
9702
+ connectionId: id$2.optional(),
9585
9703
  schedule: authoringDefinitionSchemas.schedule
9586
9704
  }),
9587
9705
  "integration": strictObject({
9588
- key: id$1,
9589
- connectionId: id$1.optional()
9706
+ key: id$2,
9707
+ connectionId: id$2.optional()
9590
9708
  }),
9591
9709
  "code": strictObject({
9592
9710
  inputs: inputFields,
@@ -9595,6 +9713,7 @@ var authoringConfigurations = {
9595
9713
  }),
9596
9714
  "connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
9597
9715
  "openapi": authoringOpenApiSchema,
9716
+ "http-request": httpRequestConfigSchema,
9598
9717
  "agent": authoringDefinitionSchemas.agent.omit({
9599
9718
  prompt: true,
9600
9719
  tools: true
@@ -9609,7 +9728,7 @@ var authoringConfigurations = {
9609
9728
  "condition": strictObject({
9610
9729
  match: _enum(["first", "all"]),
9611
9730
  branches: array(strictObject({
9612
- name: id$1,
9731
+ name: id$2,
9613
9732
  description: string$1().optional(),
9614
9733
  when
9615
9734
  }))
@@ -9626,7 +9745,7 @@ var authoringConfigurations = {
9626
9745
  };
9627
9746
  var updates = strictObject({
9628
9747
  onError: _enum(["stop", "error"]).optional(),
9629
- name: id$1.optional(),
9748
+ name: id$2.optional(),
9630
9749
  description: string$1().optional(),
9631
9750
  icon: string$1().optional(),
9632
9751
  maxExecutions: int().positive().optional(),
@@ -9637,13 +9756,13 @@ var updates = strictObject({
9637
9756
  var authoringEditSchema = discriminatedUnion("op", [
9638
9757
  strictObject({
9639
9758
  op: literal("node.add"),
9640
- as: id$1.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."),
9759
+ 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."),
9641
9760
  type,
9642
- name: id$1,
9761
+ name: id$2,
9643
9762
  onError: _enum(["stop", "error"]).optional(),
9644
9763
  retry: retryConfigurationSchema.optional(),
9645
9764
  config: patch.optional(),
9646
- inputs: record$2(id$1, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
9765
+ inputs: record$2(id$2, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
9647
9766
  code: string$1().optional(),
9648
9767
  prompt: string$1().optional()
9649
9768
  }),
@@ -9651,12 +9770,12 @@ var authoringEditSchema = discriminatedUnion("op", [
9651
9770
  op: literal("node.update"),
9652
9771
  node: referenceSchema,
9653
9772
  set: updates.optional(),
9654
- clear: array(array(id$1).min(1)).optional()
9773
+ clear: array(array(id$2).min(1)).optional()
9655
9774
  }),
9656
9775
  strictObject({
9657
9776
  op: literal("node.refresh"),
9658
9777
  node: referenceSchema,
9659
- tool: id$1.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
9778
+ tool: id$2.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
9660
9779
  }),
9661
9780
  strictObject({
9662
9781
  op: literal("node.remove"),
@@ -9665,20 +9784,20 @@ var authoringEditSchema = discriminatedUnion("op", [
9665
9784
  strictObject({
9666
9785
  op: literal("input.set"),
9667
9786
  node: referenceSchema,
9668
- input: id$1,
9787
+ input: id$2,
9669
9788
  source: authoringSourceSchema
9670
9789
  }),
9671
9790
  strictObject({
9672
9791
  op: _enum(["edge.connect", "edge.disconnect"]),
9673
9792
  source: referenceSchema,
9674
9793
  target: referenceSchema,
9675
- branch: id$1.optional()
9794
+ branch: id$2.optional()
9676
9795
  }),
9677
9796
  strictObject({
9678
9797
  op: literal("text.edit"),
9679
9798
  node: referenceSchema,
9680
9799
  field: _enum(["code", "prompt"]),
9681
- oldText: id$1,
9800
+ oldText: id$2,
9682
9801
  newText: string$1()
9683
9802
  }),
9684
9803
  strictObject({
@@ -9689,15 +9808,15 @@ var authoringEditSchema = discriminatedUnion("op", [
9689
9808
  })
9690
9809
  ]);
9691
9810
  strictObject({
9692
- baseRevision: id$1,
9693
- requestId: id$1.max(256),
9811
+ baseRevision: id$2,
9812
+ requestId: id$2.max(256),
9694
9813
  edits: array(authoringEditSchema).min(1).max(1e3)
9695
9814
  });
9696
9815
  strictObject({
9697
- revision: id$1.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
9698
- nodes: array(id$1).min(1).max(100).optional().describe("Node references to read in one batch. Mutually exclusive with text. Long texts return metadata."),
9816
+ revision: id$2.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
9817
+ 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."),
9699
9818
  text: strictObject({
9700
- node: id$1,
9819
+ node: id$2,
9701
9820
  field: _enum(["code", "prompt"]),
9702
9821
  start: int().positive().default(1),
9703
9822
  lines: int().min(1).max(200).default(80)
@@ -9706,42 +9825,43 @@ strictObject({
9706
9825
  not: { required: ["nodes", "text"] },
9707
9826
  description: "Omit nodes and text for an outline; provide nodes for details, or text for an excerpt."
9708
9827
  });
9709
- strictObject({ revisionId: id$1 });
9828
+ strictObject({ revisionId: id$2 });
9710
9829
  strictObject({
9711
- revision: id$1.optional(),
9712
- query: id$1.max(1e3),
9830
+ revision: id$2.optional(),
9831
+ query: id$2.max(1e3),
9713
9832
  type: type.optional(),
9714
9833
  offset: int().nonnegative().default(0),
9715
9834
  limit: int().min(1).max(100).default(20)
9716
9835
  });
9717
9836
  strictObject({
9718
9837
  type: type.optional(),
9719
- action: id$1.optional()
9838
+ action: id$2.optional()
9720
9839
  }).refine((v) => v.type == null || v.action == null, "Choose type or action.");
9840
+ `${[...findEngineContract(currentEngineContract).builtinModules].filter((name) => !name.startsWith("node:")).join(", ")}`;
9721
9841
  var authoringDiagnosticSchema = object({
9722
- code: id$1,
9842
+ code: id$2,
9723
9843
  message: string$1(),
9724
- nodes: array(id$1),
9844
+ nodes: array(id$2),
9725
9845
  field: string$1().optional(),
9726
9846
  line: number().optional(),
9727
9847
  column: number().optional()
9728
9848
  });
9729
9849
  var authoringCheckResponse = object({
9730
- flowId: id$1,
9731
- revisionId: id$1,
9850
+ flowId: id$2,
9851
+ revisionId: id$2,
9732
9852
  valid: boolean(),
9733
9853
  diagnostics: array(authoringDiagnosticSchema),
9734
9854
  version: literal(1)
9735
9855
  });
9736
9856
  var authoringEditResponse = object({
9737
- flowId: id$1,
9857
+ flowId: id$2,
9738
9858
  saved: literal(true),
9739
- revision: id$1,
9740
- nodes: record$2(id$1, id$1),
9859
+ revision: id$2,
9860
+ nodes: record$2(id$2, id$2),
9741
9861
  changes: array(object({
9742
9862
  index: int(),
9743
- op: id$1,
9744
- node: id$1.optional()
9863
+ op: id$2,
9864
+ node: id$2.optional()
9745
9865
  })),
9746
9866
  validation: object({
9747
9867
  status: _enum([
@@ -9754,8 +9874,8 @@ var authoringEditResponse = object({
9754
9874
  version: literal(1)
9755
9875
  });
9756
9876
  var authoringReadResponse = object({
9757
- flowId: id$1,
9758
- revision: id$1,
9877
+ flowId: id$2,
9878
+ revision: id$2,
9759
9879
  data: object({
9760
9880
  nodes: array(record$2(string$1(), json$1)).optional(),
9761
9881
  edges: array(json$1).optional(),
@@ -9764,12 +9884,12 @@ var authoringReadResponse = object({
9764
9884
  version: literal(1)
9765
9885
  });
9766
9886
  var authoringSearchResponse = object({
9767
- flowId: id$1,
9768
- revision: id$1,
9887
+ flowId: id$2,
9888
+ revision: id$2,
9769
9889
  data: object({
9770
9890
  matches: array(object({
9771
- node: id$1.optional(),
9772
- field: id$1,
9891
+ node: id$2.optional(),
9892
+ field: id$2,
9773
9893
  line: int().optional(),
9774
9894
  excerpt: string$1()
9775
9895
  })),
@@ -10412,7 +10532,7 @@ function decodeEntries(values, current) {
10412
10532
  return parsed.data;
10413
10533
  }
10414
10534
  //#endregion
10415
- //#region src/control/common/providerIconSprite.ts
10535
+ //#region src/connector/common/providerIconSprite.ts
10416
10536
  /** Optional artwork must never make an otherwise usable catalog unavailable. */
10417
10537
  function providerIconAppearance(metadata, position) {
10418
10538
  if (!metadata || typeof metadata != "object" || !position || typeof position != "object") return {};
@@ -10470,7 +10590,7 @@ function conditionInputPorts(node) {
10470
10590
  }]));
10471
10591
  }
10472
10592
  //#endregion
10473
- //#region src/flow/common/change.ts
10593
+ //#region src/flow/common/model.ts
10474
10594
  function portsByHandle(ports) {
10475
10595
  return Object.fromEntries(ports.flatMap((port) => "handle" in port ? [[port.handle, port]] : []));
10476
10596
  }
@@ -11298,6 +11418,30 @@ function nodeDetails(content, nodeId, node) {
11298
11418
  };
11299
11419
  }
11300
11420
  //#endregion
11421
+ //#region src/event-source/common/view.ts
11422
+ var id$1 = string$1().min(1).max(256);
11423
+ /** Public projection of a source that Connector validates and Open Flow exposes unchanged. */
11424
+ var eventSourceViewSchema = object({
11425
+ appId: id$1.nullable(),
11426
+ workspaceId: id$1.optional(),
11427
+ installationId: id$1.optional(),
11428
+ organizationId: id$1.optional(),
11429
+ projectId: id$1.optional(),
11430
+ projectKey: id$1.optional(),
11431
+ subscriptionStatus: _enum([
11432
+ "idle",
11433
+ "pending",
11434
+ "ready",
11435
+ "error"
11436
+ ]).optional(),
11437
+ lastError: string$1().optional(),
11438
+ signingSecretConfigured: boolean().optional(),
11439
+ manageSubscriptions: boolean().nullable(),
11440
+ verificationTokenConfigured: boolean().nullable(),
11441
+ encryptKeyConfigured: boolean().nullable(),
11442
+ verifiedAt: string$1().nullable()
11443
+ });
11444
+ //#endregion
11301
11445
  //#region src/control/common/eventSources.ts
11302
11446
  var id = string$1().min(1).max(256);
11303
11447
  var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
@@ -11317,29 +11461,12 @@ var eventSourceSchema = object({
11317
11461
  "fireflies",
11318
11462
  "jira"
11319
11463
  ]),
11320
- appId: id.nullable(),
11321
- workspaceId: id.optional(),
11322
- installationId: id.optional(),
11323
- organizationId: id.optional(),
11324
- projectId: id.optional(),
11325
- projectKey: id.optional(),
11326
- subscriptionStatus: _enum([
11327
- "idle",
11328
- "pending",
11329
- "ready",
11330
- "error"
11331
- ]).optional(),
11332
- lastError: string$1().optional(),
11333
- signingSecretConfigured: boolean().optional(),
11464
+ ...eventSourceViewSchema.shape,
11334
11465
  connectionId: id,
11335
11466
  teamId: id.nullable(),
11336
11467
  enabled: boolean(),
11337
11468
  eventTypes: array(eventType),
11338
- manageSubscriptions: boolean().nullable(),
11339
- verificationTokenConfigured: boolean().nullable(),
11340
- encryptKeyConfigured: boolean().nullable(),
11341
11469
  endpointUrl: string$1().nullable(),
11342
- verifiedAt: string$1().nullable(),
11343
11470
  lastReceivedAt: string$1().nullable(),
11344
11471
  updatedAt: string$1(),
11345
11472
  consumers: array(object({
@@ -11348,21 +11475,6 @@ var eventSourceSchema = object({
11348
11475
  triggerNodeId: id
11349
11476
  }))
11350
11477
  });
11351
- eventSourceSchema.pick({
11352
- appId: true,
11353
- workspaceId: true,
11354
- installationId: true,
11355
- organizationId: true,
11356
- projectId: true,
11357
- projectKey: true,
11358
- subscriptionStatus: true,
11359
- lastError: true,
11360
- signingSecretConfigured: true,
11361
- manageSubscriptions: true,
11362
- verificationTokenConfigured: true,
11363
- encryptKeyConfigured: true,
11364
- verifiedAt: true
11365
- });
11366
11478
  function decodeEventSource(value) {
11367
11479
  return eventSourceSchema.parse(value);
11368
11480
  }
@@ -12354,7 +12466,7 @@ function decodeRunEvent(value) {
12354
12466
  switch (kind) {
12355
12467
  case "node.started": {
12356
12468
  const nodeKind = payload.nodeKind;
12357
- 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();
12469
+ 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();
12358
12470
  return {
12359
12471
  ...base,
12360
12472
  kind,