@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
@@ -18,7 +18,7 @@ export declare function authoringNode(content: RevisionContent, ref: string): {
18
18
  timeoutMs?: number | undefined;
19
19
  maxExecutions?: number | undefined;
20
20
  onError?: "error" | "stop" | undefined;
21
- retry?: import('./flow-retry.js').RetryConfiguration | undefined;
21
+ retry?: import("./flow-model.js").RetryConfiguration | undefined;
22
22
  config: JsonValue;
23
23
  texts: {
24
24
  [k: string]: {
@@ -82,6 +82,7 @@ export declare function authoringNode(content: RevisionContent, ref: string): {
82
82
  })[];
83
83
  };
84
84
  export declare function readAuthoring(content: RevisionContent, query?: AuthoringRead): {
85
+ nodes?: undefined;
85
86
  text: {
86
87
  node: string;
87
88
  field: "code" | "prompt";
@@ -92,7 +93,6 @@ export declare function readAuthoring(content: RevisionContent, query?: Authorin
92
93
  nextStart?: number | undefined;
93
94
  truncated: boolean;
94
95
  };
95
- nodes?: undefined;
96
96
  edges?: undefined;
97
97
  } | {
98
98
  text?: undefined;
@@ -106,7 +106,7 @@ export declare function readAuthoring(content: RevisionContent, query?: Authorin
106
106
  timeoutMs?: number | undefined;
107
107
  maxExecutions?: number | undefined;
108
108
  onError?: "error" | "stop" | undefined;
109
- retry?: import('./flow-retry.js').RetryConfiguration | undefined;
109
+ retry?: import("./flow-model.js").RetryConfiguration | undefined;
110
110
  config: JsonValue;
111
111
  texts: {
112
112
  [k: string]: {
@@ -218,6 +218,9 @@ export declare const authoringConfigurations: {
218
218
  kind: z.ZodLiteral<"workflow">;
219
219
  name: z.ZodString;
220
220
  flowId: z.ZodString;
221
+ }, z.core.$strict>, z.ZodObject<{
222
+ kind: z.ZodLiteral<"http">;
223
+ hosts: z.ZodArray<z.ZodString>;
221
224
  }, z.core.$strict>]>>>;
222
225
  }, z.core.$strict>;
223
226
  connector: z.ZodObject<{
@@ -1,5 +1,5 @@
1
1
  import type { SourceOperation, SourceReferenceOperation } from './event-source-definition.js';
2
- import type { JsonValue } from './flow-change.js';
2
+ import type { JsonValue } from '../index.js';
3
3
  export type TriggerOperationRequest = {
4
4
  readonly operation: 'sourceReference';
5
5
  readonly request: SourceReferenceOperation;
@@ -22,44 +22,6 @@ function dequal(foo, bar) {
22
22
  return foo !== foo && bar !== bar;
23
23
  }
24
24
  //#endregion
25
- //#region src/execution/common/engineContract.ts
26
- var currentEngineContract = "open-flow-engine/v8";
27
- `${JSON.stringify(currentEngineContract)}`, new Set([
28
- "assert",
29
- "assert/strict",
30
- "buffer",
31
- "console",
32
- "constants",
33
- "crypto",
34
- "events",
35
- "fs",
36
- "fs/promises",
37
- "os",
38
- "path",
39
- "path/posix",
40
- "process",
41
- "punycode",
42
- "querystring",
43
- "stream",
44
- "stream/promises",
45
- "stream/web",
46
- "string_decoder",
47
- "timers",
48
- "timers/promises",
49
- "url",
50
- "util",
51
- "zlib"
52
- ].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v8/nodejs-compat-v1")}`;
53
- //#endregion
54
- //#region src/http/common/authBindings.ts
55
- /** Never allow credentials to enter a Revision as literal node inputs. */
56
- function assertHttpAuthBindings(document) {
57
- for (const node of Object.values(document.graph.nodes)) {
58
- if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
59
- 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.");
60
- }
61
- }
62
- //#endregion
63
25
  //#region ../../node_modules/.bun/zod@4.6.5/node_modules/zod/v4/core/util.js
64
26
  function getEnumValues(entries) {
65
27
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
@@ -8514,6 +8476,9 @@ function isSchemaKeyword(value) {
8514
8476
  }
8515
8477
  //#endregion
8516
8478
  //#region src/decision/common/decision.ts
8479
+ function isDecisionExecutor(executor) {
8480
+ return executor.kind === "decision";
8481
+ }
8517
8482
  var decisionLimits = {
8518
8483
  choice: 255,
8519
8484
  score: 10
@@ -8536,7 +8501,7 @@ function limitDecisionQuestions(questions) {
8536
8501
  }
8537
8502
  /** Loading an oversized task also updates its previously generated output schemas. */
8538
8503
  function limitDecisionTask(task) {
8539
- if (task.executor.kind !== "decision") return task;
8504
+ if (!isDecisionExecutor(task.executor)) return task;
8540
8505
  const original = task.executor.questions;
8541
8506
  const questions = limitDecisionQuestions(original);
8542
8507
  if (questions === original) return task;
@@ -8603,6 +8568,20 @@ function answerSchema(question) {
8603
8568
  };
8604
8569
  }
8605
8570
  //#endregion
8571
+ //#region src/http/common/authBindings.ts
8572
+ /** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
8573
+ function assertHttpAuthBindings(inputs) {
8574
+ 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.");
8575
+ }
8576
+ //#endregion
8577
+ //#region src/http/common/hosts.ts
8578
+ /** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
8579
+ 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])?$/;
8580
+ /** Wildcards must name a registrable suffix, so `*.com` is rejected. */
8581
+ function isHttpHost(value) {
8582
+ return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
8583
+ }
8584
+ //#endregion
8606
8585
  //#region src/http/common/httpRequest.ts
8607
8586
  var parameterSchema = strictObject({
8608
8587
  mode: _enum(["fields", "object"]).default("fields"),
@@ -8818,7 +8797,15 @@ var workflowCapabilitySchema = strictObject({
8818
8797
  inputs: array(port$1),
8819
8798
  outputs: array(port$1).nullable()
8820
8799
  });
8821
- var capability = union([connectorCapabilitySchema, workflowCapabilitySchema]);
8800
+ var httpCapabilitySchema = strictObject({
8801
+ kind: literal("http"),
8802
+ 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.")
8803
+ });
8804
+ var capability = union([
8805
+ connectorCapabilitySchema,
8806
+ workflowCapabilitySchema,
8807
+ httpCapabilitySchema
8808
+ ]);
8822
8809
  var inline = object({
8823
8810
  ...ports$1,
8824
8811
  name: text,
@@ -9198,7 +9185,8 @@ var revision = object({
9198
9185
  literal(8),
9199
9186
  literal(9),
9200
9187
  literal(10),
9201
- literal(11)
9188
+ literal(11),
9189
+ literal(12)
9202
9190
  ]),
9203
9191
  document,
9204
9192
  modules: record$3(text, module)
@@ -9229,7 +9217,7 @@ function decodeRevisionContent(value) {
9229
9217
  checkJsonDepth(value);
9230
9218
  const content = revision.parse(value);
9231
9219
  checkModelVersion(content);
9232
- assertHttpAuthBindings(content.document);
9220
+ assertDocumentHttpAuthBindings(content.document);
9233
9221
  return content;
9234
9222
  }
9235
9223
  var shapes = {
@@ -9399,6 +9387,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
9399
9387
  ...shape
9400
9388
  })])).values()])).min(1);
9401
9389
  function checkModelVersion(content) {
9390
+ 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.");
9402
9391
  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.");
9403
9392
  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.");
9404
9393
  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.");
@@ -9414,6 +9403,9 @@ function checkModelVersion(content) {
9414
9403
  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.");
9415
9404
  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.");
9416
9405
  }
9406
+ function assertDocumentHttpAuthBindings(content) {
9407
+ 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);
9408
+ }
9417
9409
  //#endregion
9418
9410
  //#region src/flow/common/change.ts
9419
9411
  /** Lossless upgrade of readable content. Historical content and its encoding stay unchanged. */
@@ -9424,10 +9416,10 @@ function upgradeRevisionContent(content) {
9424
9416
  function upgradeDecodedRevisionContent(content) {
9425
9417
  const graph = content.document.graph;
9426
9418
  const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
9427
- if (!hasManual && content.modelVersion == 11) return content;
9419
+ if (!hasManual && content.modelVersion == 12) return content;
9428
9420
  return {
9429
9421
  ...content,
9430
- modelVersion: 11,
9422
+ modelVersion: 12,
9431
9423
  document: {
9432
9424
  ...content.document,
9433
9425
  graph: hasManual ? {
@@ -9445,6 +9437,78 @@ function upgradeManualTrigger(node) {
9445
9437
  } : node;
9446
9438
  }
9447
9439
  //#endregion
9440
+ //#region src/runtime/common/engineContract.ts
9441
+ /** v9 is a single contract: the Node compatibility builtins, `context.fetch`, and no `context.egress`. */
9442
+ var currentEngineContract = "open-flow-engine/v9";
9443
+ /** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
9444
+ var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
9445
+ var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
9446
+ export function identity(value) { return value }
9447
+ `;
9448
+ var v8Contract = {
9449
+ workflowTools: true,
9450
+ httpRequests: true,
9451
+ waitAutoContinue: true,
9452
+ webhookResponses: true,
9453
+ platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
9454
+ platformModule: "open-flow:platform",
9455
+ platformSource: platformSource("open-flow-engine/v8")
9456
+ };
9457
+ var nodejsContract = {
9458
+ ...v8Contract,
9459
+ builtinModules: new Set([
9460
+ "assert",
9461
+ "assert/strict",
9462
+ "buffer",
9463
+ "console",
9464
+ "constants",
9465
+ "crypto",
9466
+ "events",
9467
+ "fs",
9468
+ "fs/promises",
9469
+ "os",
9470
+ "path",
9471
+ "path/posix",
9472
+ "process",
9473
+ "punycode",
9474
+ "querystring",
9475
+ "stream",
9476
+ "stream/promises",
9477
+ "stream/web",
9478
+ "string_decoder",
9479
+ "timers",
9480
+ "timers/promises",
9481
+ "url",
9482
+ "util",
9483
+ "zlib"
9484
+ ].flatMap((name) => [name, `node:${name}`])),
9485
+ platformSource: platformSource(nodejsEngineContract)
9486
+ };
9487
+ var currentContract = {
9488
+ ...nodejsContract,
9489
+ codeFetch: true,
9490
+ platformSource: platformSource(currentEngineContract)
9491
+ };
9492
+ function findEngineContract(contract) {
9493
+ if (contract == "open-flow-engine/v9") return currentContract;
9494
+ if (contract == "open-flow-engine/v8") return v8Contract;
9495
+ if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
9496
+ if (contract == "open-flow-engine/v7" || contract == "open-flow-engine/v7/nodejs-compat-v1") return {
9497
+ ...contract.endsWith("/nodejs-compat-v1") ? nodejsContract : v8Contract,
9498
+ workflowTools: false,
9499
+ httpRequests: false,
9500
+ platformSource: platformSource(contract)
9501
+ };
9502
+ if (contract == "open-flow-engine/v6" || contract == "open-flow-engine/v6/nodejs-compat-v1") return {
9503
+ ...contract == "open-flow-engine/v6" ? v8Contract : nodejsContract,
9504
+ workflowTools: false,
9505
+ httpRequests: false,
9506
+ waitAutoContinue: false,
9507
+ webhookResponses: false,
9508
+ platformSource: platformSource(contract)
9509
+ };
9510
+ }
9511
+ //#endregion
9448
9512
  //#region src/workflow/common/workflow.ts
9449
9513
  var portSchema = object({
9450
9514
  handle: string$1().min(1),
@@ -9510,9 +9574,9 @@ var authoringOpenApiSchema = strictObject({
9510
9574
  });
9511
9575
  //#endregion
9512
9576
  //#region src/control/common/authoringSchema.ts
9513
- var id$1 = string$1().min(1);
9577
+ var id$2 = string$1().min(1);
9514
9578
  var json$2 = json$4();
9515
- var patch = record$3(id$1, json$2);
9579
+ var patch = record$3(id$2, json$2);
9516
9580
  var type = _enum([
9517
9581
  "start",
9518
9582
  "outputs",
@@ -9535,11 +9599,11 @@ var type = _enum([
9535
9599
  "wait",
9536
9600
  "approval"
9537
9601
  ]);
9538
- 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.");
9602
+ 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.");
9539
9603
  var output = strictObject({
9540
9604
  kind: literal("output"),
9541
9605
  node: referenceSchema,
9542
- port: id$1.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
9606
+ port: id$2.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
9543
9607
  field: string$1().optional()
9544
9608
  });
9545
9609
  var system = strictObject({
@@ -9550,7 +9614,7 @@ var system = strictObject({
9550
9614
  });
9551
9615
  var variable$1 = strictObject({
9552
9616
  kind: literal("variable"),
9553
- name: id$1
9617
+ name: id$2
9554
9618
  });
9555
9619
  var authoringSourceSchema = union([
9556
9620
  output,
@@ -9581,7 +9645,7 @@ var operand = union([
9581
9645
  system,
9582
9646
  variable$1
9583
9647
  ]);
9584
- var toolSources = record$3(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.");
9648
+ var toolSources = record$3(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.");
9585
9649
  var agentTool = union([workflowAgentToolSchema.omit({
9586
9650
  id: true,
9587
9651
  inputs: true,
@@ -9591,20 +9655,24 @@ var agentTool = union([workflowAgentToolSchema.omit({
9591
9655
  id: true,
9592
9656
  inputs: true
9593
9657
  }).extend({ inputs: toolSources }).strict()]);
9594
- var authoringCapabilities = array(union([connectorCapabilitySchema, strictObject({
9595
- kind: literal("workflow"),
9596
- name: id$1,
9597
- flowId: id$1
9598
- })]));
9658
+ var authoringCapabilities = array(union([
9659
+ connectorCapabilitySchema,
9660
+ strictObject({
9661
+ kind: literal("workflow"),
9662
+ name: id$2,
9663
+ flowId: id$2
9664
+ }),
9665
+ httpCapabilitySchema
9666
+ ]));
9599
9667
  var notification = strictObject({
9600
9668
  ...authoringDefinitionSchemas.connector.shape,
9601
- messageHandle: id$1,
9602
- inputs: record$3(id$1, union([strictObject({
9669
+ messageHandle: id$2,
9670
+ inputs: record$3(id$2, union([strictObject({
9603
9671
  kind: literal("value"),
9604
9672
  value: json$2
9605
9673
  }), strictObject({
9606
9674
  kind: literal("input"),
9607
- input: id$1
9675
+ input: id$2
9608
9676
  })]))
9609
9677
  });
9610
9678
  var field = strictObject({
@@ -9612,14 +9680,14 @@ var field = strictObject({
9612
9680
  nullable: boolean().optional(),
9613
9681
  description: string$1().optional()
9614
9682
  });
9615
- var inputFields = record$3(id$1, 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.");
9616
- var flowInputFields = record$3(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.");
9683
+ var inputFields = record$3(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.");
9684
+ var flowInputFields = record$3(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.");
9617
9685
  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.");
9618
- var flowInputFieldsView = record$3(id$1, field.extend({
9686
+ var flowInputFieldsView = record$3(id$2, field.extend({
9619
9687
  schema: json$2,
9620
9688
  nullable: boolean()
9621
9689
  }));
9622
- var outputFields = record$3(id$1, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
9690
+ var outputFields = record$3(id$2, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
9623
9691
  var expression = strictObject({
9624
9692
  left: operand,
9625
9693
  operator: authoringDefinitionSchemas.condition.shape.cases.element.shape.groups.element.shape.expressions.element.shape.operator,
@@ -9633,20 +9701,20 @@ var when = union([
9633
9701
  ]);
9634
9702
  var authoringConfigurations = {
9635
9703
  "webhook-response": strictObject({}),
9636
- "workflow": strictObject({ flowId: id$1 }),
9704
+ "workflow": strictObject({ flowId: id$2 }),
9637
9705
  "start": strictObject({ inputDefs: flowInputFields.default({}) }),
9638
9706
  "outputs": strictObject({ outputDefs: flowOutputFields.default({}) }),
9639
- "error": strictObject({ sourceFlowIds: array(id$1).optional() }),
9707
+ "error": strictObject({ sourceFlowIds: array(id$2).optional() }),
9640
9708
  "webhook": authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
9641
9709
  "cron": strictObject({ schedule: authoringDefinitionSchemas.schedule }),
9642
9710
  "poll": strictObject({
9643
- key: id$1,
9644
- connectionId: id$1.optional(),
9711
+ key: id$2,
9712
+ connectionId: id$2.optional(),
9645
9713
  schedule: authoringDefinitionSchemas.schedule
9646
9714
  }),
9647
9715
  "integration": strictObject({
9648
- key: id$1,
9649
- connectionId: id$1.optional()
9716
+ key: id$2,
9717
+ connectionId: id$2.optional()
9650
9718
  }),
9651
9719
  "code": strictObject({
9652
9720
  inputs: inputFields,
@@ -9670,7 +9738,7 @@ var authoringConfigurations = {
9670
9738
  "condition": strictObject({
9671
9739
  match: _enum(["first", "all"]),
9672
9740
  branches: array(strictObject({
9673
- name: id$1,
9741
+ name: id$2,
9674
9742
  description: string$1().optional(),
9675
9743
  when
9676
9744
  }))
@@ -9687,7 +9755,7 @@ var authoringConfigurations = {
9687
9755
  };
9688
9756
  var updates = strictObject({
9689
9757
  onError: _enum(["stop", "error"]).optional(),
9690
- name: id$1.optional(),
9758
+ name: id$2.optional(),
9691
9759
  description: string$1().optional(),
9692
9760
  icon: string$1().optional(),
9693
9761
  maxExecutions: int().positive().optional(),
@@ -9698,13 +9766,13 @@ var updates = strictObject({
9698
9766
  var authoringEditSchema = discriminatedUnion("op", [
9699
9767
  strictObject({
9700
9768
  op: literal("node.add"),
9701
- 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."),
9769
+ 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."),
9702
9770
  type,
9703
- name: id$1,
9771
+ name: id$2,
9704
9772
  onError: _enum(["stop", "error"]).optional(),
9705
9773
  retry: retryConfigurationSchema.optional(),
9706
9774
  config: patch.optional(),
9707
- inputs: record$3(id$1, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
9775
+ inputs: record$3(id$2, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
9708
9776
  code: string$1().optional(),
9709
9777
  prompt: string$1().optional()
9710
9778
  }),
@@ -9712,12 +9780,12 @@ var authoringEditSchema = discriminatedUnion("op", [
9712
9780
  op: literal("node.update"),
9713
9781
  node: referenceSchema,
9714
9782
  set: updates.optional(),
9715
- clear: array(array(id$1).min(1)).optional()
9783
+ clear: array(array(id$2).min(1)).optional()
9716
9784
  }),
9717
9785
  strictObject({
9718
9786
  op: literal("node.refresh"),
9719
9787
  node: referenceSchema,
9720
- tool: id$1.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
9788
+ tool: id$2.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
9721
9789
  }),
9722
9790
  strictObject({
9723
9791
  op: literal("node.remove"),
@@ -9726,20 +9794,20 @@ var authoringEditSchema = discriminatedUnion("op", [
9726
9794
  strictObject({
9727
9795
  op: literal("input.set"),
9728
9796
  node: referenceSchema,
9729
- input: id$1,
9797
+ input: id$2,
9730
9798
  source: authoringSourceSchema
9731
9799
  }),
9732
9800
  strictObject({
9733
9801
  op: _enum(["edge.connect", "edge.disconnect"]),
9734
9802
  source: referenceSchema,
9735
9803
  target: referenceSchema,
9736
- branch: id$1.optional()
9804
+ branch: id$2.optional()
9737
9805
  }),
9738
9806
  strictObject({
9739
9807
  op: literal("text.edit"),
9740
9808
  node: referenceSchema,
9741
9809
  field: _enum(["code", "prompt"]),
9742
- oldText: id$1,
9810
+ oldText: id$2,
9743
9811
  newText: string$1()
9744
9812
  }),
9745
9813
  strictObject({
@@ -9750,15 +9818,15 @@ var authoringEditSchema = discriminatedUnion("op", [
9750
9818
  })
9751
9819
  ]);
9752
9820
  strictObject({
9753
- baseRevision: id$1,
9754
- requestId: id$1.max(256),
9821
+ baseRevision: id$2,
9822
+ requestId: id$2.max(256),
9755
9823
  edits: array(authoringEditSchema).min(1).max(1e3)
9756
9824
  });
9757
9825
  strictObject({
9758
- revision: id$1.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
9759
- 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."),
9826
+ revision: id$2.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
9827
+ 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."),
9760
9828
  text: strictObject({
9761
- node: id$1,
9829
+ node: id$2,
9762
9830
  field: _enum(["code", "prompt"]),
9763
9831
  start: int().positive().default(1),
9764
9832
  lines: int().min(1).max(200).default(80)
@@ -9767,42 +9835,43 @@ strictObject({
9767
9835
  not: { required: ["nodes", "text"] },
9768
9836
  description: "Omit nodes and text for an outline; provide nodes for details, or text for an excerpt."
9769
9837
  });
9770
- strictObject({ revisionId: id$1 });
9838
+ strictObject({ revisionId: id$2 });
9771
9839
  strictObject({
9772
- revision: id$1.optional(),
9773
- query: id$1.max(1e3),
9840
+ revision: id$2.optional(),
9841
+ query: id$2.max(1e3),
9774
9842
  type: type.optional(),
9775
9843
  offset: int().nonnegative().default(0),
9776
9844
  limit: int().min(1).max(100).default(20)
9777
9845
  });
9778
9846
  strictObject({
9779
9847
  type: type.optional(),
9780
- action: id$1.optional()
9848
+ action: id$2.optional()
9781
9849
  }).refine((v) => v.type == null || v.action == null, "Choose type or action.");
9850
+ `${[...findEngineContract(currentEngineContract).builtinModules].filter((name) => !name.startsWith("node:")).join(", ")}`;
9782
9851
  var authoringDiagnosticSchema = object({
9783
- code: id$1,
9852
+ code: id$2,
9784
9853
  message: string$1(),
9785
- nodes: array(id$1),
9854
+ nodes: array(id$2),
9786
9855
  field: string$1().optional(),
9787
9856
  line: number().optional(),
9788
9857
  column: number().optional()
9789
9858
  });
9790
9859
  var authoringCheckResponse = object({
9791
- flowId: id$1,
9792
- revisionId: id$1,
9860
+ flowId: id$2,
9861
+ revisionId: id$2,
9793
9862
  valid: boolean(),
9794
9863
  diagnostics: array(authoringDiagnosticSchema),
9795
9864
  version: literal(1)
9796
9865
  });
9797
9866
  var authoringEditResponse = object({
9798
- flowId: id$1,
9867
+ flowId: id$2,
9799
9868
  saved: literal(true),
9800
- revision: id$1,
9801
- nodes: record$3(id$1, id$1),
9869
+ revision: id$2,
9870
+ nodes: record$3(id$2, id$2),
9802
9871
  changes: array(object({
9803
9872
  index: int(),
9804
- op: id$1,
9805
- node: id$1.optional()
9873
+ op: id$2,
9874
+ node: id$2.optional()
9806
9875
  })),
9807
9876
  validation: object({
9808
9877
  status: _enum([
@@ -9815,8 +9884,8 @@ var authoringEditResponse = object({
9815
9884
  version: literal(1)
9816
9885
  });
9817
9886
  var authoringReadResponse = object({
9818
- flowId: id$1,
9819
- revision: id$1,
9887
+ flowId: id$2,
9888
+ revision: id$2,
9820
9889
  data: object({
9821
9890
  nodes: array(record$3(string$1(), json$2)).optional(),
9822
9891
  edges: array(json$2).optional(),
@@ -9825,12 +9894,12 @@ var authoringReadResponse = object({
9825
9894
  version: literal(1)
9826
9895
  });
9827
9896
  var authoringSearchResponse = object({
9828
- flowId: id$1,
9829
- revision: id$1,
9897
+ flowId: id$2,
9898
+ revision: id$2,
9830
9899
  data: object({
9831
9900
  matches: array(object({
9832
- node: id$1.optional(),
9833
- field: id$1,
9901
+ node: id$2.optional(),
9902
+ field: id$2,
9834
9903
  line: int().optional(),
9835
9904
  excerpt: string$1()
9836
9905
  })),
@@ -10366,7 +10435,7 @@ function decodeEntries(values, current) {
10366
10435
  return parsed.data;
10367
10436
  }
10368
10437
  //#endregion
10369
- //#region src/control/common/providerIconSprite.ts
10438
+ //#region src/connector/common/providerIconSprite.ts
10370
10439
  /** Optional artwork must never make an otherwise usable catalog unavailable. */
10371
10440
  function providerIconAppearance(metadata, position) {
10372
10441
  if (!metadata || typeof metadata != "object" || !position || typeof position != "object") return {};
@@ -10798,6 +10867,30 @@ function connectorProvider(value) {
10798
10867
  };
10799
10868
  }
10800
10869
  //#endregion
10870
+ //#region src/event-source/common/view.ts
10871
+ var id$1 = string$1().min(1).max(256);
10872
+ /** Public projection of a source that Connector validates and Open Flow exposes unchanged. */
10873
+ var eventSourceViewSchema = object({
10874
+ appId: id$1.nullable(),
10875
+ workspaceId: id$1.optional(),
10876
+ installationId: id$1.optional(),
10877
+ organizationId: id$1.optional(),
10878
+ projectId: id$1.optional(),
10879
+ projectKey: id$1.optional(),
10880
+ subscriptionStatus: _enum([
10881
+ "idle",
10882
+ "pending",
10883
+ "ready",
10884
+ "error"
10885
+ ]).optional(),
10886
+ lastError: string$1().optional(),
10887
+ signingSecretConfigured: boolean().optional(),
10888
+ manageSubscriptions: boolean().nullable(),
10889
+ verificationTokenConfigured: boolean().nullable(),
10890
+ encryptKeyConfigured: boolean().nullable(),
10891
+ verifiedAt: string$1().nullable()
10892
+ });
10893
+ //#endregion
10801
10894
  //#region src/control/common/eventSources.ts
10802
10895
  var id = string$1().min(1).max(256);
10803
10896
  var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
@@ -10817,29 +10910,12 @@ var eventSourceSchema = object({
10817
10910
  "fireflies",
10818
10911
  "jira"
10819
10912
  ]),
10820
- appId: id.nullable(),
10821
- workspaceId: id.optional(),
10822
- installationId: id.optional(),
10823
- organizationId: id.optional(),
10824
- projectId: id.optional(),
10825
- projectKey: id.optional(),
10826
- subscriptionStatus: _enum([
10827
- "idle",
10828
- "pending",
10829
- "ready",
10830
- "error"
10831
- ]).optional(),
10832
- lastError: string$1().optional(),
10833
- signingSecretConfigured: boolean().optional(),
10913
+ ...eventSourceViewSchema.shape,
10834
10914
  connectionId: id,
10835
10915
  teamId: id.nullable(),
10836
10916
  enabled: boolean(),
10837
10917
  eventTypes: array(eventType),
10838
- manageSubscriptions: boolean().nullable(),
10839
- verificationTokenConfigured: boolean().nullable(),
10840
- encryptKeyConfigured: boolean().nullable(),
10841
10918
  endpointUrl: string$1().nullable(),
10842
- verifiedAt: string$1().nullable(),
10843
10919
  lastReceivedAt: string$1().nullable(),
10844
10920
  updatedAt: string$1(),
10845
10921
  consumers: array(object({
@@ -10848,21 +10924,6 @@ var eventSourceSchema = object({
10848
10924
  triggerNodeId: id
10849
10925
  }))
10850
10926
  });
10851
- eventSourceSchema.pick({
10852
- appId: true,
10853
- workspaceId: true,
10854
- installationId: true,
10855
- organizationId: true,
10856
- projectId: true,
10857
- projectKey: true,
10858
- subscriptionStatus: true,
10859
- lastError: true,
10860
- signingSecretConfigured: true,
10861
- manageSubscriptions: true,
10862
- verificationTokenConfigured: true,
10863
- encryptKeyConfigured: true,
10864
- verifiedAt: true
10865
- });
10866
10927
  function decodeEventSource(value) {
10867
10928
  return eventSourceSchema.parse(value);
10868
10929
  }