@oomol-lab/open-flow 0.1.0-beta.75 → 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 (125) hide show
  1. package/README.md +2 -1
  2. package/dist/browser/{ContentIcon-FCpKiwjp.js → ContentIcon-Cm1hbVzW.js} +2 -2
  3. package/dist/browser/{FlowCanvas-dzRBnlUT.js → FlowCanvas-NzKtla_c.js} +62 -62
  4. package/dist/browser/{createResourceDialog-BeYDdUl-.js → createResourceDialog-BgdedQqu.js} +3 -3
  5. package/dist/browser/{dialog-ZtpsFbl4.js → dialog-aSElFFw2.js} +49 -24
  6. package/dist/browser/{exportSvg-DqXw1yf-.js → exportSvg-Dcz4HTo_.js} +2 -2
  7. package/dist/browser/{flowChanges-b_5UobFj.js → flowChanges-NZyS7HSp.js} +207 -396
  8. package/dist/browser/{flowWorkspace-ItojZbO4.js → flowWorkspace-Bl0SDehy.js} +90 -13
  9. package/dist/browser/preview.css +515 -649
  10. package/dist/browser/preview.js +454 -545
  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 +515 -649
  17. package/dist/browser/workbench.js +7 -7
  18. package/dist/browser/{workbenchSelect-M441Lz0d.js → workbenchSelect-DBGP7Y4Z.js} +2 -2
  19. package/dist/command/index.js +33 -35
  20. package/dist/common/authoring.d.ts +3 -3
  21. package/dist/common/authoringSchema.d.ts +3 -0
  22. package/dist/common/connector-proxy.d.ts +1 -1
  23. package/dist/common/control-api-conformance.js +197 -136
  24. package/dist/common/control-api.d.ts +3 -2
  25. package/dist/common/control-api.js +192 -131
  26. package/dist/common/control-requests.js +126 -24
  27. package/dist/common/cron-trigger.d.ts +2 -1
  28. package/dist/common/decision.d.ts +4 -4
  29. package/dist/common/decision.js +5 -2
  30. package/dist/common/engine-contract.d.ts +5 -1
  31. package/dist/common/event-source-definition.d.ts +1 -1
  32. package/dist/common/event-source-view.d.ts +22 -0
  33. package/dist/common/event-source.d.ts +1 -1
  34. package/dist/common/event-source.js +24 -65
  35. package/dist/common/event-sources.d.ts +0 -21
  36. package/dist/common/flow-authoring.js +40 -18
  37. package/dist/common/flow-change-schema.d.ts +9 -1
  38. package/dist/common/flow-change.d.ts +7 -201
  39. package/dist/common/flow-change.js +46 -22
  40. package/dist/common/flow-encoding.js +40 -20
  41. package/dist/common/flow-input-value.d.ts +1 -1
  42. package/dist/common/flow-model.d.ts +121 -0
  43. package/dist/common/flow-notifications.d.ts +1 -1
  44. package/dist/common/flow-retry.d.ts +2 -4
  45. package/dist/common/flow-semantics.js +83 -86
  46. package/dist/common/flow-workflowReferences.d.ts +8 -0
  47. package/dist/common/flowInspection.d.ts +1 -1
  48. package/dist/common/http-hosts.d.ts +6 -0
  49. package/dist/common/http-request.d.ts +13 -5
  50. package/dist/common/http-request.js +23 -5
  51. package/dist/common/integration-trigger.d.ts +2 -1
  52. package/dist/common/mcp.js +195 -134
  53. package/dist/common/openapi.d.ts +4 -4
  54. package/dist/common/openapi.js +4 -1
  55. package/dist/common/poll-trigger.d.ts +2 -1
  56. package/dist/common/runtime-contract.d.ts +23 -1
  57. package/dist/common/runtime-contract.js +604 -72
  58. package/dist/common/runtime-nodejs-compat.d.ts +44 -0
  59. package/dist/common/runtime-nodejs-compat.js +5870 -0
  60. package/dist/common/scheduler-checkpoint.d.ts +1 -1
  61. package/dist/common/scheduler-node-execution.d.ts +1 -1
  62. package/dist/common/scheduler.d.ts +1 -1
  63. package/dist/common/scheduler.js +25 -4
  64. package/dist/common/trigger-catalog.d.ts +1 -7
  65. package/dist/common/trigger-config-options.d.ts +1 -1
  66. package/dist/common/trigger-config.d.ts +1 -1
  67. package/dist/common/trigger-contract.d.ts +2 -1
  68. package/dist/common/trigger-localization.d.ts +8 -2
  69. package/dist/common/trigger-model.d.ts +101 -0
  70. package/dist/common/webhook-response.d.ts +1 -1
  71. package/dist/common/webhook-trigger.d.ts +3 -1
  72. package/dist/common/workflow.d.ts +3 -12
  73. package/dist/common/workflow.js +25 -23
  74. package/dist/index.d.ts +41 -14
  75. package/package.json +5 -1
  76. package/src/base/common/json.ts +1 -1
  77. package/src/connector/common/proxy.ts +1 -1
  78. package/src/control/common/api.ts +6 -5
  79. package/src/control/common/authoringSchema.ts +9 -2
  80. package/src/control/common/authoringTools.ts +1 -1
  81. package/src/control/common/conformance.ts +1 -1
  82. package/src/control/common/connectorDecoders.ts +1 -1
  83. package/src/control/common/eventSources.ts +2 -29
  84. package/src/control/common/triggerCatalog.ts +1 -8
  85. package/src/decision/common/decision.ts +15 -7
  86. package/src/event-source/common/definition.ts +1 -1
  87. package/src/event-source/common/index.ts +1 -1
  88. package/src/event-source/common/view.ts +20 -0
  89. package/src/execution/common/checkpoint.ts +1 -1
  90. package/src/execution/common/node-execution.ts +1 -1
  91. package/src/execution/common/scheduler.ts +1 -1
  92. package/src/flow/common/change.ts +58 -192
  93. package/src/flow/common/changeSchema.ts +29 -4
  94. package/src/flow/common/connectionUsage.ts +1 -1
  95. package/src/flow/common/inputValue.ts +1 -1
  96. package/src/flow/common/model.ts +130 -0
  97. package/src/flow/common/modules.ts +1 -1
  98. package/src/flow/common/portChanges.ts +1 -1
  99. package/src/flow/common/retry.ts +2 -4
  100. package/src/flow/common/semantics.ts +11 -4
  101. package/src/flow/common/webhookResponse.ts +1 -1
  102. package/src/flow/common/workflowReferences.ts +31 -0
  103. package/src/http/common/authBindings.ts +6 -9
  104. package/src/http/common/hosts.ts +13 -0
  105. package/src/http/common/httpRequest.ts +30 -15
  106. package/src/openapi/common/openapi.ts +9 -5
  107. package/src/{execution → runtime}/common/engineContract.ts +20 -15
  108. package/src/runtime/common/nodejsCompat.ts +275 -0
  109. package/src/runtime/common/nodejsGuest.generated.json +47 -0
  110. package/src/runtime/common/runtime.ts +1138 -0
  111. package/src/trigger/common/config.ts +1 -1
  112. package/src/trigger/common/configOptions.ts +1 -1
  113. package/src/trigger/common/contract.ts +2 -1
  114. package/src/trigger/common/cron.ts +2 -1
  115. package/src/trigger/common/integration.ts +2 -1
  116. package/src/trigger/common/model.ts +87 -0
  117. package/src/trigger/common/poll.ts +2 -1
  118. package/src/trigger/common/webhook.ts +3 -1
  119. package/src/trigger/providers/fieldDescriptions.ts +1 -1
  120. package/src/trigger/providers/localization.ts +9 -2
  121. package/src/trigger/providers/remote.ts +1 -1
  122. package/src/types/index.ts +44 -15
  123. package/src/workflow/common/workflow.ts +3 -44
  124. package/src/execution/common/runtime.ts +0 -563
  125. /package/src/{control → connector}/common/providerIconSprite.ts +0 -0
@@ -4,8 +4,8 @@ import type { LiveDetails } from './liveDetails.js';
4
4
  export { liveEntries } from './liveDetails.js';
5
5
  export { flowInputDefinitions } from './authoringFields.js';
6
6
  export type { LiveDetails, LiveEntry } from './liveDetails.js';
7
- import type { AuthoringRead, AuthoringSearch, AuthoringRequest, AuthoringType } from './authoringSchema.js';
8
7
  import type { ProviderIconAppearance } from './providerIconSprite.js';
8
+ import type { AuthoringRead, AuthoringSearch, AuthoringRequest, AuthoringType } from './authoringSchema.js';
9
9
  export { providerIconAppearance } from './providerIconSprite.js';
10
10
  export type { ProviderIconAppearance, ProviderIconSprite, ProviderIconSpriteCatalog } from './providerIconSprite.js';
11
11
  export { connectorAccess as decodeConnectorAccess, connectorAccessSnapshot as decodeConnectorAccessSnapshot } from './connectorDecoders.js';
@@ -18,7 +18,8 @@ import type { SchemaMismatch } from './flow-change.js';
18
18
  import type { CreateEventSource, UpdateEventSource, EventSource } from './event-sources.js';
19
19
  export { decodeEventSource, decodeEventSources, type CreateEventSource, type UpdateEventSource, type EventSource } from './event-sources.js';
20
20
  import type { TriggerCatalogCache } from './trigger-catalog.js';
21
- export { decodeTriggerCatalog, searchTriggerKeys, type TriggerCatalog, type TriggerCatalogCache, type TriggerDisplay } from './trigger-catalog.js';
21
+ export { decodeTriggerCatalog, searchTriggerKeys, type TriggerCatalog, type TriggerCatalogCache } from './trigger-catalog.js';
22
+ export type { TriggerDisplay } from './trigger-localization.js';
22
23
  import type { TriggerConfigOption } from './trigger-config-options.js';
23
24
  export type { TriggerConfigOption } from './trigger-config-options.js';
24
25
  import type { ResultQuery } from './run-results.js';
@@ -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;
@@ -8644,12 +8690,17 @@ function answerSchema(question) {
8644
8690
  }
8645
8691
  //#endregion
8646
8692
  //#region src/http/common/authBindings.ts
8647
- /** Never allow credentials to enter a Revision as literal node inputs. */
8648
- function assertHttpAuthBindings(document) {
8649
- for (const node of Object.values(document.graph.nodes)) {
8650
- if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
8651
- for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("HTTP authentication accepts deployment variables and upstream outputs only.");
8652
- }
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.");
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("."));
8653
8704
  }
8654
8705
  //#endregion
8655
8706
  //#region src/http/common/httpRequest.ts
@@ -8875,7 +8926,15 @@ var workflowCapabilitySchema = strictObject({
8875
8926
  inputs: array(port$1),
8876
8927
  outputs: array(port$1).nullable()
8877
8928
  });
8878
- 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
+ ]);
8879
8938
  var inline = object({
8880
8939
  ...ports$1,
8881
8940
  name: text,
@@ -9255,7 +9314,8 @@ var revision = object({
9255
9314
  literal(8),
9256
9315
  literal(9),
9257
9316
  literal(10),
9258
- literal(11)
9317
+ literal(11),
9318
+ literal(12)
9259
9319
  ]),
9260
9320
  document,
9261
9321
  modules: record$2(text, module)
@@ -9286,7 +9346,7 @@ function decodeRevisionContent(value) {
9286
9346
  checkJsonDepth(value);
9287
9347
  const content = revision.parse(value);
9288
9348
  checkModelVersion(content);
9289
- assertHttpAuthBindings(content.document);
9349
+ assertDocumentHttpAuthBindings(content.document);
9290
9350
  return content;
9291
9351
  }
9292
9352
  var shapes = {
@@ -9456,6 +9516,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
9456
9516
  ...shape
9457
9517
  })])).values()])).min(1);
9458
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.");
9459
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.");
9460
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.");
9461
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.");
@@ -9471,6 +9532,9 @@ function checkModelVersion(content) {
9471
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.");
9472
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.");
9473
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
+ }
9474
9538
  //#endregion
9475
9539
  //#region src/control/common/authoringLlm.ts
9476
9540
  var authoringLlmConfiguration = strictObject({
@@ -9500,9 +9564,9 @@ var authoringOpenApiSchema = strictObject({
9500
9564
  });
9501
9565
  //#endregion
9502
9566
  //#region src/control/common/authoringSchema.ts
9503
- var id$1 = string$1().min(1);
9567
+ var id$2 = string$1().min(1);
9504
9568
  var json$1 = json$3();
9505
- var patch = record$2(id$1, json$1);
9569
+ var patch = record$2(id$2, json$1);
9506
9570
  var type = _enum([
9507
9571
  "start",
9508
9572
  "outputs",
@@ -9525,11 +9589,11 @@ var type = _enum([
9525
9589
  "wait",
9526
9590
  "approval"
9527
9591
  ]);
9528
- 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.");
9529
9593
  var output = strictObject({
9530
9594
  kind: literal("output"),
9531
9595
  node: referenceSchema,
9532
- 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."),
9533
9597
  field: string$1().optional()
9534
9598
  });
9535
9599
  var system = strictObject({
@@ -9540,7 +9604,7 @@ var system = strictObject({
9540
9604
  });
9541
9605
  var variable$1 = strictObject({
9542
9606
  kind: literal("variable"),
9543
- name: id$1
9607
+ name: id$2
9544
9608
  });
9545
9609
  var authoringSourceSchema = union([
9546
9610
  output,
@@ -9571,7 +9635,7 @@ var operand = union([
9571
9635
  system,
9572
9636
  variable$1
9573
9637
  ]);
9574
- 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.");
9575
9639
  var agentTool = union([workflowAgentToolSchema.omit({
9576
9640
  id: true,
9577
9641
  inputs: true,
@@ -9581,20 +9645,24 @@ var agentTool = union([workflowAgentToolSchema.omit({
9581
9645
  id: true,
9582
9646
  inputs: true
9583
9647
  }).extend({ inputs: toolSources }).strict()]);
9584
- var authoringCapabilities = array(union([connectorCapabilitySchema, strictObject({
9585
- kind: literal("workflow"),
9586
- name: id$1,
9587
- flowId: id$1
9588
- })]));
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
+ ]));
9589
9657
  var notification = strictObject({
9590
9658
  ...authoringDefinitionSchemas.connector.shape,
9591
- messageHandle: id$1,
9592
- inputs: record$2(id$1, union([strictObject({
9659
+ messageHandle: id$2,
9660
+ inputs: record$2(id$2, union([strictObject({
9593
9661
  kind: literal("value"),
9594
9662
  value: json$1
9595
9663
  }), strictObject({
9596
9664
  kind: literal("input"),
9597
- input: id$1
9665
+ input: id$2
9598
9666
  })]))
9599
9667
  });
9600
9668
  var field = strictObject({
@@ -9602,14 +9670,14 @@ var field = strictObject({
9602
9670
  nullable: boolean().optional(),
9603
9671
  description: string$1().optional()
9604
9672
  });
9605
- 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.");
9606
- 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.");
9607
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.");
9608
- var flowInputFieldsView = record$2(id$1, field.extend({
9676
+ var flowInputFieldsView = record$2(id$2, field.extend({
9609
9677
  schema: json$1,
9610
9678
  nullable: boolean()
9611
9679
  }));
9612
- 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.");
9613
9681
  var expression = strictObject({
9614
9682
  left: operand,
9615
9683
  operator: authoringDefinitionSchemas.condition.shape.cases.element.shape.groups.element.shape.expressions.element.shape.operator,
@@ -9623,20 +9691,20 @@ var when = union([
9623
9691
  ]);
9624
9692
  var authoringConfigurations = {
9625
9693
  "webhook-response": strictObject({}),
9626
- "workflow": strictObject({ flowId: id$1 }),
9694
+ "workflow": strictObject({ flowId: id$2 }),
9627
9695
  "start": strictObject({ inputDefs: flowInputFields.default({}) }),
9628
9696
  "outputs": strictObject({ outputDefs: flowOutputFields.default({}) }),
9629
- "error": strictObject({ sourceFlowIds: array(id$1).optional() }),
9697
+ "error": strictObject({ sourceFlowIds: array(id$2).optional() }),
9630
9698
  "webhook": authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
9631
9699
  "cron": strictObject({ schedule: authoringDefinitionSchemas.schedule }),
9632
9700
  "poll": strictObject({
9633
- key: id$1,
9634
- connectionId: id$1.optional(),
9701
+ key: id$2,
9702
+ connectionId: id$2.optional(),
9635
9703
  schedule: authoringDefinitionSchemas.schedule
9636
9704
  }),
9637
9705
  "integration": strictObject({
9638
- key: id$1,
9639
- connectionId: id$1.optional()
9706
+ key: id$2,
9707
+ connectionId: id$2.optional()
9640
9708
  }),
9641
9709
  "code": strictObject({
9642
9710
  inputs: inputFields,
@@ -9660,7 +9728,7 @@ var authoringConfigurations = {
9660
9728
  "condition": strictObject({
9661
9729
  match: _enum(["first", "all"]),
9662
9730
  branches: array(strictObject({
9663
- name: id$1,
9731
+ name: id$2,
9664
9732
  description: string$1().optional(),
9665
9733
  when
9666
9734
  }))
@@ -9677,7 +9745,7 @@ var authoringConfigurations = {
9677
9745
  };
9678
9746
  var updates = strictObject({
9679
9747
  onError: _enum(["stop", "error"]).optional(),
9680
- name: id$1.optional(),
9748
+ name: id$2.optional(),
9681
9749
  description: string$1().optional(),
9682
9750
  icon: string$1().optional(),
9683
9751
  maxExecutions: int().positive().optional(),
@@ -9688,13 +9756,13 @@ var updates = strictObject({
9688
9756
  var authoringEditSchema = discriminatedUnion("op", [
9689
9757
  strictObject({
9690
9758
  op: literal("node.add"),
9691
- 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."),
9692
9760
  type,
9693
- name: id$1,
9761
+ name: id$2,
9694
9762
  onError: _enum(["stop", "error"]).optional(),
9695
9763
  retry: retryConfigurationSchema.optional(),
9696
9764
  config: patch.optional(),
9697
- 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."),
9698
9766
  code: string$1().optional(),
9699
9767
  prompt: string$1().optional()
9700
9768
  }),
@@ -9702,12 +9770,12 @@ var authoringEditSchema = discriminatedUnion("op", [
9702
9770
  op: literal("node.update"),
9703
9771
  node: referenceSchema,
9704
9772
  set: updates.optional(),
9705
- clear: array(array(id$1).min(1)).optional()
9773
+ clear: array(array(id$2).min(1)).optional()
9706
9774
  }),
9707
9775
  strictObject({
9708
9776
  op: literal("node.refresh"),
9709
9777
  node: referenceSchema,
9710
- 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.")
9711
9779
  }),
9712
9780
  strictObject({
9713
9781
  op: literal("node.remove"),
@@ -9716,20 +9784,20 @@ var authoringEditSchema = discriminatedUnion("op", [
9716
9784
  strictObject({
9717
9785
  op: literal("input.set"),
9718
9786
  node: referenceSchema,
9719
- input: id$1,
9787
+ input: id$2,
9720
9788
  source: authoringSourceSchema
9721
9789
  }),
9722
9790
  strictObject({
9723
9791
  op: _enum(["edge.connect", "edge.disconnect"]),
9724
9792
  source: referenceSchema,
9725
9793
  target: referenceSchema,
9726
- branch: id$1.optional()
9794
+ branch: id$2.optional()
9727
9795
  }),
9728
9796
  strictObject({
9729
9797
  op: literal("text.edit"),
9730
9798
  node: referenceSchema,
9731
9799
  field: _enum(["code", "prompt"]),
9732
- oldText: id$1,
9800
+ oldText: id$2,
9733
9801
  newText: string$1()
9734
9802
  }),
9735
9803
  strictObject({
@@ -9740,15 +9808,15 @@ var authoringEditSchema = discriminatedUnion("op", [
9740
9808
  })
9741
9809
  ]);
9742
9810
  strictObject({
9743
- baseRevision: id$1,
9744
- requestId: id$1.max(256),
9811
+ baseRevision: id$2,
9812
+ requestId: id$2.max(256),
9745
9813
  edits: array(authoringEditSchema).min(1).max(1e3)
9746
9814
  });
9747
9815
  strictObject({
9748
- revision: id$1.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
9749
- 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."),
9750
9818
  text: strictObject({
9751
- node: id$1,
9819
+ node: id$2,
9752
9820
  field: _enum(["code", "prompt"]),
9753
9821
  start: int().positive().default(1),
9754
9822
  lines: int().min(1).max(200).default(80)
@@ -9757,42 +9825,43 @@ strictObject({
9757
9825
  not: { required: ["nodes", "text"] },
9758
9826
  description: "Omit nodes and text for an outline; provide nodes for details, or text for an excerpt."
9759
9827
  });
9760
- strictObject({ revisionId: id$1 });
9828
+ strictObject({ revisionId: id$2 });
9761
9829
  strictObject({
9762
- revision: id$1.optional(),
9763
- query: id$1.max(1e3),
9830
+ revision: id$2.optional(),
9831
+ query: id$2.max(1e3),
9764
9832
  type: type.optional(),
9765
9833
  offset: int().nonnegative().default(0),
9766
9834
  limit: int().min(1).max(100).default(20)
9767
9835
  });
9768
9836
  strictObject({
9769
9837
  type: type.optional(),
9770
- action: id$1.optional()
9838
+ action: id$2.optional()
9771
9839
  }).refine((v) => v.type == null || v.action == null, "Choose type or action.");
9840
+ `${[...findEngineContract(currentEngineContract).builtinModules].filter((name) => !name.startsWith("node:")).join(", ")}`;
9772
9841
  var authoringDiagnosticSchema = object({
9773
- code: id$1,
9842
+ code: id$2,
9774
9843
  message: string$1(),
9775
- nodes: array(id$1),
9844
+ nodes: array(id$2),
9776
9845
  field: string$1().optional(),
9777
9846
  line: number().optional(),
9778
9847
  column: number().optional()
9779
9848
  });
9780
9849
  var authoringCheckResponse = object({
9781
- flowId: id$1,
9782
- revisionId: id$1,
9850
+ flowId: id$2,
9851
+ revisionId: id$2,
9783
9852
  valid: boolean(),
9784
9853
  diagnostics: array(authoringDiagnosticSchema),
9785
9854
  version: literal(1)
9786
9855
  });
9787
9856
  var authoringEditResponse = object({
9788
- flowId: id$1,
9857
+ flowId: id$2,
9789
9858
  saved: literal(true),
9790
- revision: id$1,
9791
- nodes: record$2(id$1, id$1),
9859
+ revision: id$2,
9860
+ nodes: record$2(id$2, id$2),
9792
9861
  changes: array(object({
9793
9862
  index: int(),
9794
- op: id$1,
9795
- node: id$1.optional()
9863
+ op: id$2,
9864
+ node: id$2.optional()
9796
9865
  })),
9797
9866
  validation: object({
9798
9867
  status: _enum([
@@ -9805,8 +9874,8 @@ var authoringEditResponse = object({
9805
9874
  version: literal(1)
9806
9875
  });
9807
9876
  var authoringReadResponse = object({
9808
- flowId: id$1,
9809
- revision: id$1,
9877
+ flowId: id$2,
9878
+ revision: id$2,
9810
9879
  data: object({
9811
9880
  nodes: array(record$2(string$1(), json$1)).optional(),
9812
9881
  edges: array(json$1).optional(),
@@ -9815,12 +9884,12 @@ var authoringReadResponse = object({
9815
9884
  version: literal(1)
9816
9885
  });
9817
9886
  var authoringSearchResponse = object({
9818
- flowId: id$1,
9819
- revision: id$1,
9887
+ flowId: id$2,
9888
+ revision: id$2,
9820
9889
  data: object({
9821
9890
  matches: array(object({
9822
- node: id$1.optional(),
9823
- field: id$1,
9891
+ node: id$2.optional(),
9892
+ field: id$2,
9824
9893
  line: int().optional(),
9825
9894
  excerpt: string$1()
9826
9895
  })),
@@ -10463,7 +10532,7 @@ function decodeEntries(values, current) {
10463
10532
  return parsed.data;
10464
10533
  }
10465
10534
  //#endregion
10466
- //#region src/control/common/providerIconSprite.ts
10535
+ //#region src/connector/common/providerIconSprite.ts
10467
10536
  /** Optional artwork must never make an otherwise usable catalog unavailable. */
10468
10537
  function providerIconAppearance(metadata, position) {
10469
10538
  if (!metadata || typeof metadata != "object" || !position || typeof position != "object") return {};
@@ -10521,7 +10590,7 @@ function conditionInputPorts(node) {
10521
10590
  }]));
10522
10591
  }
10523
10592
  //#endregion
10524
- //#region src/flow/common/change.ts
10593
+ //#region src/flow/common/model.ts
10525
10594
  function portsByHandle(ports) {
10526
10595
  return Object.fromEntries(ports.flatMap((port) => "handle" in port ? [[port.handle, port]] : []));
10527
10596
  }
@@ -11349,6 +11418,30 @@ function nodeDetails(content, nodeId, node) {
11349
11418
  };
11350
11419
  }
11351
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
11352
11445
  //#region src/control/common/eventSources.ts
11353
11446
  var id = string$1().min(1).max(256);
11354
11447
  var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
@@ -11368,29 +11461,12 @@ var eventSourceSchema = object({
11368
11461
  "fireflies",
11369
11462
  "jira"
11370
11463
  ]),
11371
- appId: id.nullable(),
11372
- workspaceId: id.optional(),
11373
- installationId: id.optional(),
11374
- organizationId: id.optional(),
11375
- projectId: id.optional(),
11376
- projectKey: id.optional(),
11377
- subscriptionStatus: _enum([
11378
- "idle",
11379
- "pending",
11380
- "ready",
11381
- "error"
11382
- ]).optional(),
11383
- lastError: string$1().optional(),
11384
- signingSecretConfigured: boolean().optional(),
11464
+ ...eventSourceViewSchema.shape,
11385
11465
  connectionId: id,
11386
11466
  teamId: id.nullable(),
11387
11467
  enabled: boolean(),
11388
11468
  eventTypes: array(eventType),
11389
- manageSubscriptions: boolean().nullable(),
11390
- verificationTokenConfigured: boolean().nullable(),
11391
- encryptKeyConfigured: boolean().nullable(),
11392
11469
  endpointUrl: string$1().nullable(),
11393
- verifiedAt: string$1().nullable(),
11394
11470
  lastReceivedAt: string$1().nullable(),
11395
11471
  updatedAt: string$1(),
11396
11472
  consumers: array(object({
@@ -11399,21 +11475,6 @@ var eventSourceSchema = object({
11399
11475
  triggerNodeId: id
11400
11476
  }))
11401
11477
  });
11402
- eventSourceSchema.pick({
11403
- appId: true,
11404
- workspaceId: true,
11405
- installationId: true,
11406
- organizationId: true,
11407
- projectId: true,
11408
- projectKey: true,
11409
- subscriptionStatus: true,
11410
- lastError: true,
11411
- signingSecretConfigured: true,
11412
- manageSubscriptions: true,
11413
- verificationTokenConfigured: true,
11414
- encryptKeyConfigured: true,
11415
- verifiedAt: true
11416
- });
11417
11478
  function decodeEventSource(value) {
11418
11479
  return eventSourceSchema.parse(value);
11419
11480
  }