@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,12 +1,3 @@
1
- //#region src/openapi/common/authBindings.ts
2
- /** Never allow credentials to enter a Revision as literal node inputs. */
3
- function assertOpenApiAuthBindings(document) {
4
- for (const node of Object.values(document.graph.nodes)) {
5
- if (node.kind != "task" || !("executor" in node.task) || node.task.executor.kind != "openapi") continue;
6
- 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.");
7
- }
8
- }
9
- //#endregion
10
1
  //#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/lite/index.mjs
11
2
  var has = Object.prototype.hasOwnProperty;
12
3
  function dequal(foo, bar) {
@@ -8462,6 +8453,9 @@ function createSchemaComparer() {
8462
8453
  createSchemaComparer();
8463
8454
  //#endregion
8464
8455
  //#region src/decision/common/decision.ts
8456
+ function isDecisionExecutor(executor) {
8457
+ return executor.kind === "decision";
8458
+ }
8465
8459
  var decisionLimits = {
8466
8460
  choice: 255,
8467
8461
  score: 10
@@ -8484,7 +8478,7 @@ function limitDecisionQuestions(questions) {
8484
8478
  }
8485
8479
  /** Loading an oversized task also updates its previously generated output schemas. */
8486
8480
  function limitDecisionTask(task) {
8487
- if (task.executor.kind !== "decision") return task;
8481
+ if (!isDecisionExecutor(task.executor)) return task;
8488
8482
  const original = task.executor.questions;
8489
8483
  const questions = limitDecisionQuestions(original);
8490
8484
  if (questions === original) return task;
@@ -8551,6 +8545,66 @@ function answerSchema(question) {
8551
8545
  };
8552
8546
  }
8553
8547
  //#endregion
8548
+ //#region src/http/common/authBindings.ts
8549
+ /** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
8550
+ function assertHttpAuthBindings(inputs) {
8551
+ 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.");
8552
+ }
8553
+ //#endregion
8554
+ //#region src/http/common/hosts.ts
8555
+ /** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
8556
+ 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])?$/;
8557
+ /** Wildcards must name a registrable suffix, so `*.com` is rejected. */
8558
+ function isHttpHost(value) {
8559
+ return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
8560
+ }
8561
+ //#endregion
8562
+ //#region src/http/common/httpRequest.ts
8563
+ var parameterSchema = strictObject({
8564
+ mode: _enum(["fields", "object"]).default("fields"),
8565
+ names: array(string()).default([])
8566
+ });
8567
+ var httpRequestExecutorSchema = strictObject({
8568
+ method: _enum([
8569
+ "GET",
8570
+ "POST",
8571
+ "PUT",
8572
+ "PATCH",
8573
+ "DELETE",
8574
+ "HEAD",
8575
+ "OPTIONS"
8576
+ ]).default("GET"),
8577
+ query: parameterSchema.default({
8578
+ mode: "fields",
8579
+ names: []
8580
+ }),
8581
+ headers: parameterSchema.default({
8582
+ mode: "fields",
8583
+ names: []
8584
+ }),
8585
+ bodyFormat: _enum([
8586
+ "none",
8587
+ "json",
8588
+ "text",
8589
+ "form"
8590
+ ]).default("none"),
8591
+ authentication: union([
8592
+ strictObject({ type: literal("none") }),
8593
+ strictObject({ type: _enum(["bearer", "basic"]) }),
8594
+ strictObject({
8595
+ type: literal("apiKey"),
8596
+ name: string(),
8597
+ in: _enum(["header", "query"])
8598
+ })
8599
+ ]).default({ type: "none" }),
8600
+ responseFormat: _enum([
8601
+ "auto",
8602
+ "json",
8603
+ "text"
8604
+ ]).default("auto"),
8605
+ statusPolicy: _enum(["success", "all"]).default("success")
8606
+ }).extend({ kind: literal("http-request") });
8607
+ //#endregion
8554
8608
  //#region src/flow/common/json.ts
8555
8609
  var maxJsonDepth = 64;
8556
8610
  function checkJsonDepth(value, depth = 0) {
@@ -8718,7 +8772,14 @@ var workflowCapabilitySchema = strictObject({
8718
8772
  inputs: array(port),
8719
8773
  outputs: array(port).nullable()
8720
8774
  });
8721
- var capability = union([connectorCapabilitySchema, workflowCapabilitySchema]);
8775
+ var capability = union([
8776
+ connectorCapabilitySchema,
8777
+ workflowCapabilitySchema,
8778
+ strictObject({
8779
+ kind: literal("http"),
8780
+ 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.")
8781
+ })
8782
+ ]);
8722
8783
  var inline = object({
8723
8784
  ...ports,
8724
8785
  name: text,
@@ -8828,7 +8889,8 @@ var managedFields = object({
8828
8889
  kind: literal("workflow"),
8829
8890
  flowId: text,
8830
8891
  revisionId: text
8831
- })
8892
+ }),
8893
+ httpRequestExecutorSchema
8832
8894
  ])
8833
8895
  });
8834
8896
  var managed = managedFields.transform(limitDecisionTask);
@@ -9081,7 +9143,8 @@ var revision = object({
9081
9143
  literal(8),
9082
9144
  literal(9),
9083
9145
  literal(10),
9084
- literal(11)
9146
+ literal(11),
9147
+ literal(12)
9085
9148
  ]),
9086
9149
  document,
9087
9150
  modules: record$1(text, module)
@@ -9336,14 +9399,14 @@ function repairRevisionEnvelope(value) {
9336
9399
  checkJsonDepth(value);
9337
9400
  const envelopeSource = record(value);
9338
9401
  if (envelopeSource.kind != "open-flow-flow-revision" || envelopeSource.version != 1) throw new TypeError("The value is not an Open Flow Revision envelope.");
9339
- if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 11) throw new TypeError("The Flow model is newer than this package.");
9402
+ if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 12) throw new TypeError("The Flow model is newer than this package.");
9340
9403
  let sourceDocument = record(envelopeSource.modelVersion == 1 || envelopeSource.modelVersion == 2 ? upgradeLegacyDocument(envelopeSource.document) : envelopeSource.document);
9341
9404
  if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion < 6) sourceDocument = upgradeTaskNodes(sourceDocument);
9342
9405
  sourceDocument = record(normalizeDocument(sourceDocument));
9343
9406
  const bindings = record(sourceDocument.bindings);
9344
9407
  const sourceGraph = repairGraph(sourceDocument.graph, bindings);
9345
9408
  return decodeRevisionContent({
9346
- modelVersion: 11,
9409
+ modelVersion: 12,
9347
9410
  document: {
9348
9411
  bindings: repairedEntries(sourceDocument.bindings, binding),
9349
9412
  graph: sourceGraph
@@ -9359,7 +9422,7 @@ function decodeRevisionContent(value) {
9359
9422
  checkJsonDepth(value);
9360
9423
  const content = revision.parse(value);
9361
9424
  checkModelVersion(content);
9362
- assertOpenApiAuthBindings(content.document);
9425
+ assertDocumentHttpAuthBindings(content.document);
9363
9426
  return content;
9364
9427
  }
9365
9428
  function decodeRevisionEnvelope(value) {
@@ -9371,7 +9434,7 @@ function decodeRevisionEnvelope(value) {
9371
9434
  } : value;
9372
9435
  const content = envelope$1.parse(candidate);
9373
9436
  checkModelVersion(content);
9374
- assertOpenApiAuthBindings(content.document);
9437
+ assertDocumentHttpAuthBindings(content.document);
9375
9438
  return {
9376
9439
  modelVersion: content.modelVersion,
9377
9440
  document: content.document,
@@ -9545,6 +9608,8 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
9545
9608
  ...shape
9546
9609
  })])).values()])).min(1);
9547
9610
  function checkModelVersion(content) {
9611
+ 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.");
9612
+ 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.");
9548
9613
  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.");
9549
9614
  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.");
9550
9615
  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.");
@@ -9559,6 +9624,9 @@ function checkModelVersion(content) {
9559
9624
  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.");
9560
9625
  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.");
9561
9626
  }
9627
+ function assertDocumentHttpAuthBindings(content) {
9628
+ 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);
9629
+ }
9562
9630
  //#endregion
9563
9631
  //#region src/flow/common/condition.ts
9564
9632
  function clearConditionBinding(operand) {
@@ -9601,10 +9669,10 @@ function upgradeRevisionContent(content) {
9601
9669
  function upgradeDecodedRevisionContent(content) {
9602
9670
  const graph = content.document.graph;
9603
9671
  const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
9604
- if (!hasManual && content.modelVersion == 11) return content;
9672
+ if (!hasManual && content.modelVersion == 12) return content;
9605
9673
  return {
9606
9674
  ...content,
9607
- modelVersion: 11,
9675
+ modelVersion: 12,
9608
9676
  document: {
9609
9677
  ...content.document,
9610
9678
  graph: hasManual ? {
@@ -9680,7 +9748,7 @@ function clearNodeConnections(graph, connectionId) {
9680
9748
  return [id, node];
9681
9749
  }
9682
9750
  const capabilities = node.task.capabilities?.map((capability) => {
9683
- if (capability.kind == "workflow") return capability;
9751
+ if (capability.kind == "workflow" || capability.kind == "http") return capability;
9684
9752
  if (!("mode" in capability)) {
9685
9753
  if ("action" in capability) {
9686
9754
  const { connectionId: selected, ...rest } = capability;
@@ -10176,7 +10244,7 @@ function revisionRepairKind(bytes) {
10176
10244
  return;
10177
10245
  }
10178
10246
  const source = value;
10179
- return typeof source.modelVersion == "number" && source.modelVersion < 11 ? "upgrade" : "repair";
10247
+ return typeof source.modelVersion == "number" && source.modelVersion < 12 ? "upgrade" : "repair";
10180
10248
  }
10181
10249
  function repairRevision(bytes) {
10182
10250
  return repairRevisionEnvelope(revisionValue(bytes));
@@ -1,3 +1,4 @@
1
+ import type { InputPort } from './flow-change.js';
1
2
  import type { Graph, GraphNode, InputPortDefinition, NodeSource, PortDefinition, RevisionContent, SchemaMismatch } from './flow-change.js';
2
3
  import type { Diagnostic } from './flow-semantics.js';
3
4
  export declare function isResolutionNode(node: GraphNode | undefined): node is Extract<GraphNode, {
@@ -58,7 +59,7 @@ export interface InputSourcesCheck {
58
59
  export declare function checkInputSource(graph: Graph, target: string, handle: string, source: Pick<NodeSource, 'nodeId' | 'output' | 'field' | 'system'>): InputSourceCheck;
59
60
  export declare function checkInputSources(graph: Graph, target: string, handle: string, sources: readonly Pick<NodeSource, 'nodeId' | 'output' | 'field' | 'system'>[]): InputSourcesCheck;
60
61
  /** Enumerate structurally available outputs while retaining their compatibility with one input. */
61
- export declare function inputSourceCandidates(graph: Graph, target: string, handle: string): Readonly<Record<string, readonly InputSourceCandidate[]>>;
62
+ export declare function inputSourceCandidates(graph: Graph, target: string, handle: string, inputPort?: InputPort): Readonly<Record<string, readonly InputSourceCandidate[]>>;
62
63
  export declare function availableOutputs(graph: Graph, target: string, handle: string | undefined): Readonly<Record<string, readonly string[]>>;
63
64
  export declare function validateFlowGraph(revision: RevisionContent): readonly Diagnostic[];
64
65
  export {};
@@ -1,4 +1,4 @@
1
- import type { FixedInputValue, InputValues, InputMapping, JsonValue } from './flow-change.js';
1
+ import type { FixedInputValue, InputValues, InputMapping, JsonValue } from './flow-model.js';
2
2
  /** An explicit clear suppresses the default; absent mappings still inherit it. */
3
3
  export declare function inputValue(mapping: InputMapping | undefined, fallback: JsonValue | undefined): JsonValue | undefined;
4
4
  /** Converts explicit user values at authoring boundaries, never persisted legacy data. */
@@ -0,0 +1,121 @@
1
+ import type { JsonValue, Port, PortDefinition } from '../index.js';
2
+ export type { JsonValue, Port, PortDefinition } from '../index.js';
3
+ /** Primitives shared by every node family. Node unions and graph operations belong to change.ts. */
4
+ export interface RetryConfiguration {
5
+ readonly maxRetries: number;
6
+ readonly intervalMs: number;
7
+ }
8
+ export interface InputPortDefinition extends PortDefinition {
9
+ readonly value?: JsonValue;
10
+ }
11
+ export interface InputPort extends InputPortDefinition {
12
+ readonly handle: string;
13
+ }
14
+ export interface Group {
15
+ readonly collapsed?: boolean;
16
+ readonly group: string;
17
+ }
18
+ export declare function portsByHandle<Value extends Port>(ports: readonly (Value | Group)[]): Readonly<Record<string, Value>>;
19
+ export interface NodeSource {
20
+ readonly system?: true;
21
+ readonly field?: string;
22
+ readonly kind: 'node';
23
+ readonly nodeId: string;
24
+ readonly output: string;
25
+ }
26
+ export interface BindingSource {
27
+ readonly bindingId: string;
28
+ readonly kind: 'binding';
29
+ }
30
+ export type FixedInputValue = {
31
+ readonly kind: 'unset';
32
+ } | {
33
+ readonly kind: 'value';
34
+ readonly value: JsonValue;
35
+ };
36
+ export type InputValues = Readonly<Record<string, FixedInputValue>>;
37
+ export type InputMapping = FixedInputValue | {
38
+ readonly kind: 'sources';
39
+ readonly sources: readonly (BindingSource | NodeSource)[];
40
+ };
41
+ export interface GraphNodeBase {
42
+ readonly description?: string;
43
+ readonly icon?: string;
44
+ readonly inputs: Readonly<Record<string, InputMapping>>;
45
+ readonly name?: string;
46
+ readonly maxExecutions?: number;
47
+ readonly timeoutMs?: number;
48
+ readonly retry?: RetryConfiguration;
49
+ readonly onError?: 'stop' | 'error';
50
+ }
51
+ export type Source = BindingSource | NodeSource;
52
+ export interface WorkflowCapability {
53
+ readonly kind: 'workflow';
54
+ readonly name: string;
55
+ readonly flowId: string;
56
+ readonly revisionId: string;
57
+ readonly inputs: readonly Port[];
58
+ readonly outputs: readonly Port[] | null;
59
+ }
60
+ /** Hosts that Code may call through `context.fetch`; requires Flow model 12 and Engine v9. */
61
+ export interface HttpCapability {
62
+ readonly kind: 'http';
63
+ readonly hosts: readonly string[];
64
+ }
65
+ export type TaskCapability = ConnectorCapability | WorkflowCapability | HttpCapability;
66
+ export interface ConnectorAccessCapability {
67
+ readonly actionHints?: readonly string[];
68
+ readonly connectionHints?: readonly {
69
+ readonly action: string;
70
+ readonly connectionId: string;
71
+ readonly alias?: string;
72
+ }[];
73
+ readonly kind: 'connector';
74
+ }
75
+ export interface ConnectorActionCapability {
76
+ readonly action: string;
77
+ readonly connections: readonly {
78
+ readonly connectionId: string;
79
+ readonly alias?: string;
80
+ }[];
81
+ readonly connectionId?: string;
82
+ readonly kind: 'connector';
83
+ }
84
+ export type ConnectorPermissionCapability = {
85
+ readonly kind: 'connector';
86
+ readonly mode: 'shared';
87
+ } | {
88
+ readonly kind: 'connector';
89
+ readonly mode: 'independent';
90
+ readonly actions: readonly {
91
+ readonly action: string;
92
+ readonly connectionId?: string;
93
+ }[];
94
+ };
95
+ export type ConnectorCapability = ConnectorAccessCapability | ConnectorActionCapability | ConnectorPermissionCapability;
96
+ export interface TaskDefinitionBase {
97
+ readonly inputs: readonly (InputPort | Group)[];
98
+ readonly name: string;
99
+ readonly outputs: readonly (Port | Group)[];
100
+ }
101
+ export interface InlineTaskDefinition extends TaskDefinitionBase {
102
+ readonly capabilities?: readonly TaskCapability[];
103
+ readonly moduleId: string;
104
+ }
105
+ /** The executor shape every managed Task shares; each node family narrows it with its own executor. */
106
+ export interface TaskExecutor {
107
+ readonly kind: string;
108
+ }
109
+ export interface ManagedTaskDefinitionOf<Executor extends TaskExecutor> extends TaskDefinitionBase {
110
+ readonly executor: Executor;
111
+ }
112
+ export interface WorkflowExecutor {
113
+ readonly kind: 'workflow';
114
+ readonly flowId: string;
115
+ readonly revisionId: string;
116
+ }
117
+ export interface CodeModule {
118
+ readonly imports: readonly string[];
119
+ readonly name: string;
120
+ readonly source: string;
121
+ }
@@ -1,4 +1,4 @@
1
- import type { CanvasCommand } from '../common/canvas-commands.js';
1
+ import type { CanvasCommand } from './canvas-commands.js';
2
2
  export type FlowCatalogEvent = {
3
3
  readonly kind: 'flows.changed';
4
4
  readonly version: 1;
@@ -1,10 +1,8 @@
1
1
  import type { GraphNode } from './flow-change.js';
2
+ import type { RetryConfiguration } from './flow-model.js';
2
3
  import { z } from 'zod';
3
- export interface RetryConfiguration {
4
- readonly maxRetries: number;
5
- readonly intervalMs: number;
6
- }
7
- export declare const retryNodeTypes: readonly ['code', 'connector', 'openapi', 'llm', 'decision'];
4
+ export type { RetryConfiguration } from './flow-model.js';
5
+ export declare const retryNodeTypes: readonly ['code', 'connector', 'openapi', 'http-request', 'llm', 'decision'];
8
6
  export declare const nodeRetryLimits: {
9
7
  readonly maxRetries: 5;
10
8
  readonly minIntervalMs: 1000;