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

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 (60) hide show
  1. package/README.md +1 -0
  2. package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-FCpKiwjp.js} +2 -1
  3. package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-dzRBnlUT.js} +1 -1
  4. package/dist/browser/{createResourceDialog-DI9pL-Yr.js → createResourceDialog-BeYDdUl-.js} +2 -2
  5. package/dist/browser/{dialog-BYJGvItc.js → dialog-ZtpsFbl4.js} +284 -13
  6. package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-DqXw1yf-.js} +2 -2
  7. package/dist/browser/{flowChanges-RL-H4CjD.js → flowChanges-b_5UobFj.js} +285 -44
  8. package/dist/browser/{flowWorkspace-BkDsETj0.js → flowWorkspace-ItojZbO4.js} +414 -53
  9. package/dist/browser/preview.css +181 -176
  10. package/dist/browser/preview.js +955 -182
  11. package/dist/browser/workbench.css +181 -176
  12. package/dist/browser/workbench.js +12 -6
  13. package/dist/browser/{workbenchSelect-BcWPWGzw.js → workbenchSelect-M441Lz0d.js} +1 -1
  14. package/dist/command/index.js +36 -36
  15. package/dist/common/authoring.d.ts +4 -4
  16. package/dist/common/authoringExamples.d.ts +3 -2
  17. package/dist/common/authoringSchema.d.ts +67 -4
  18. package/dist/common/control-api-conformance.js +58 -7
  19. package/dist/common/control-api.js +58 -7
  20. package/dist/common/control-requests.d.ts +3 -3
  21. package/dist/common/control-requests.js +234 -62
  22. package/dist/common/engine-contract.d.ts +1 -0
  23. package/dist/common/flow-authoring.js +56 -7
  24. package/dist/common/flow-change.d.ts +1 -1
  25. package/dist/common/flow-change.js +56 -7
  26. package/dist/common/flow-encoding.js +55 -7
  27. package/dist/common/flow-graph.d.ts +2 -1
  28. package/dist/common/flow-retry.d.ts +1 -1
  29. package/dist/common/flow-semantics.js +810 -577
  30. package/dist/common/http-request.d.ts +156 -0
  31. package/dist/common/http-request.js +5254 -0
  32. package/dist/common/mcp.d.ts +3 -3
  33. package/dist/common/mcp.js +58 -7
  34. package/dist/common/run-events.js +11 -9
  35. package/dist/common/runtime-contract.js +3 -0
  36. package/dist/common/scheduler.d.ts +1 -1
  37. package/dist/common/scheduler.js +70 -21
  38. package/dist/common/webhook-response.d.ts +0 -2
  39. package/dist/common/webhook-trigger.js +12 -11
  40. package/package.json +5 -1
  41. package/skills/open-flow/references/flow-authoring.md +1 -0
  42. package/skills/open-flow/references/flow-n8n-conversion.md +19 -15
  43. package/src/control/common/api.ts +1 -0
  44. package/src/control/common/authoring.ts +14 -3
  45. package/src/control/common/authoringExamples.ts +8 -0
  46. package/src/control/common/authoringSchema.ts +30 -24
  47. package/src/execution/common/engineContract.ts +4 -0
  48. package/src/execution/common/events.ts +3 -0
  49. package/src/execution/common/node-execution.ts +4 -2
  50. package/src/execution/common/scheduler.ts +1 -0
  51. package/src/flow/common/change.ts +3 -2
  52. package/src/flow/common/changeSchema.ts +12 -3
  53. package/src/flow/common/graph.ts +10 -4
  54. package/src/flow/common/retry.ts +1 -1
  55. package/src/flow/common/semantics.ts +60 -3
  56. package/src/flow/common/webhookResponse.ts +3 -7
  57. package/src/{openapi → http}/common/authBindings.ts +3 -3
  58. package/src/http/common/headers.ts +5 -0
  59. package/src/http/common/httpRequest.ts +251 -0
  60. package/src/trigger/common/webhook.ts +4 -3
@@ -1,9 +1,9 @@
1
- //#region src/openapi/common/authBindings.ts
1
+ //#region src/http/common/authBindings.ts
2
2
  /** Never allow credentials to enter a Revision as literal node inputs. */
3
- function assertOpenApiAuthBindings(document) {
3
+ function assertHttpAuthBindings(document) {
4
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.");
5
+ if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
6
+ 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.");
7
7
  }
8
8
  }
9
9
  //#endregion
@@ -8779,6 +8779,52 @@ function answerSchema(question) {
8779
8779
  required: Object.keys(properties)
8780
8780
  };
8781
8781
  }
8782
+ //#endregion
8783
+ //#region src/http/common/httpRequest.ts
8784
+ var parameterSchema = strictObject({
8785
+ mode: _enum(["fields", "object"]).default("fields"),
8786
+ names: array(string()).default([])
8787
+ });
8788
+ var httpRequestExecutorSchema = strictObject({
8789
+ method: _enum([
8790
+ "GET",
8791
+ "POST",
8792
+ "PUT",
8793
+ "PATCH",
8794
+ "DELETE",
8795
+ "HEAD",
8796
+ "OPTIONS"
8797
+ ]).default("GET"),
8798
+ query: parameterSchema.default({
8799
+ mode: "fields",
8800
+ names: []
8801
+ }),
8802
+ headers: parameterSchema.default({
8803
+ mode: "fields",
8804
+ names: []
8805
+ }),
8806
+ bodyFormat: _enum([
8807
+ "none",
8808
+ "json",
8809
+ "text",
8810
+ "form"
8811
+ ]).default("none"),
8812
+ authentication: union([
8813
+ strictObject({ type: literal("none") }),
8814
+ strictObject({ type: _enum(["bearer", "basic"]) }),
8815
+ strictObject({
8816
+ type: literal("apiKey"),
8817
+ name: string(),
8818
+ in: _enum(["header", "query"])
8819
+ })
8820
+ ]).default({ type: "none" }),
8821
+ responseFormat: _enum([
8822
+ "auto",
8823
+ "json",
8824
+ "text"
8825
+ ]).default("auto"),
8826
+ statusPolicy: _enum(["success", "all"]).default("success")
8827
+ }).extend({ kind: literal("http-request") });
8782
8828
  function checkJsonDepth(value, depth = 0) {
8783
8829
  if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
8784
8830
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
@@ -8789,6 +8835,7 @@ var retryNodeTypes = [
8789
8835
  "code",
8790
8836
  "connector",
8791
8837
  "openapi",
8838
+ "http-request",
8792
8839
  "llm",
8793
8840
  "decision"
8794
8841
  ];
@@ -9068,7 +9115,8 @@ var managedFields = object({
9068
9115
  kind: literal("workflow"),
9069
9116
  flowId: text,
9070
9117
  revisionId: text
9071
- })
9118
+ }),
9119
+ httpRequestExecutorSchema
9072
9120
  ])
9073
9121
  });
9074
9122
  var managed = managedFields.transform(limitDecisionTask);
@@ -9368,7 +9416,7 @@ function decodeRevisionContent(value) {
9368
9416
  checkJsonDepth(value);
9369
9417
  const content = revision.parse(value);
9370
9418
  checkModelVersion(content);
9371
- assertOpenApiAuthBindings(content.document);
9419
+ assertHttpAuthBindings(content.document);
9372
9420
  return content;
9373
9421
  }
9374
9422
  var shapes = {
@@ -9562,6 +9610,7 @@ function changeOperationsSchema(kind) {
9562
9610
  return toJSONSchema(schema, { io: "input" });
9563
9611
  }
9564
9612
  function checkModelVersion(content) {
9613
+ 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.");
9565
9614
  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.");
9566
9615
  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.");
9567
9616
  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.");
@@ -10327,7 +10376,7 @@ function applyFlowChanges(content, operations) {
10327
10376
  break;
10328
10377
  }
10329
10378
  }
10330
- assertOpenApiAuthBindings(document);
10379
+ assertHttpAuthBindings(document);
10331
10380
  return upgradeDecodedRevisionContent({
10332
10381
  document,
10333
10382
  modelVersion: 11,
@@ -1,9 +1,9 @@
1
- //#region src/openapi/common/authBindings.ts
1
+ //#region src/http/common/authBindings.ts
2
2
  /** Never allow credentials to enter a Revision as literal node inputs. */
3
- function assertOpenApiAuthBindings(document) {
3
+ function assertHttpAuthBindings(document) {
4
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.");
5
+ if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
6
+ 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.");
7
7
  }
8
8
  }
9
9
  //#endregion
@@ -8551,6 +8551,52 @@ function answerSchema(question) {
8551
8551
  };
8552
8552
  }
8553
8553
  //#endregion
8554
+ //#region src/http/common/httpRequest.ts
8555
+ var parameterSchema = strictObject({
8556
+ mode: _enum(["fields", "object"]).default("fields"),
8557
+ names: array(string()).default([])
8558
+ });
8559
+ var httpRequestExecutorSchema = strictObject({
8560
+ method: _enum([
8561
+ "GET",
8562
+ "POST",
8563
+ "PUT",
8564
+ "PATCH",
8565
+ "DELETE",
8566
+ "HEAD",
8567
+ "OPTIONS"
8568
+ ]).default("GET"),
8569
+ query: parameterSchema.default({
8570
+ mode: "fields",
8571
+ names: []
8572
+ }),
8573
+ headers: parameterSchema.default({
8574
+ mode: "fields",
8575
+ names: []
8576
+ }),
8577
+ bodyFormat: _enum([
8578
+ "none",
8579
+ "json",
8580
+ "text",
8581
+ "form"
8582
+ ]).default("none"),
8583
+ authentication: union([
8584
+ strictObject({ type: literal("none") }),
8585
+ strictObject({ type: _enum(["bearer", "basic"]) }),
8586
+ strictObject({
8587
+ type: literal("apiKey"),
8588
+ name: string(),
8589
+ in: _enum(["header", "query"])
8590
+ })
8591
+ ]).default({ type: "none" }),
8592
+ responseFormat: _enum([
8593
+ "auto",
8594
+ "json",
8595
+ "text"
8596
+ ]).default("auto"),
8597
+ statusPolicy: _enum(["success", "all"]).default("success")
8598
+ }).extend({ kind: literal("http-request") });
8599
+ //#endregion
8554
8600
  //#region src/flow/common/json.ts
8555
8601
  var maxJsonDepth = 64;
8556
8602
  function checkJsonDepth(value, depth = 0) {
@@ -8828,7 +8874,8 @@ var managedFields = object({
8828
8874
  kind: literal("workflow"),
8829
8875
  flowId: text,
8830
8876
  revisionId: text
8831
- })
8877
+ }),
8878
+ httpRequestExecutorSchema
8832
8879
  ])
8833
8880
  });
8834
8881
  var managed = managedFields.transform(limitDecisionTask);
@@ -9359,7 +9406,7 @@ function decodeRevisionContent(value) {
9359
9406
  checkJsonDepth(value);
9360
9407
  const content = revision.parse(value);
9361
9408
  checkModelVersion(content);
9362
- assertOpenApiAuthBindings(content.document);
9409
+ assertHttpAuthBindings(content.document);
9363
9410
  return content;
9364
9411
  }
9365
9412
  function decodeRevisionEnvelope(value) {
@@ -9371,7 +9418,7 @@ function decodeRevisionEnvelope(value) {
9371
9418
  } : value;
9372
9419
  const content = envelope$1.parse(candidate);
9373
9420
  checkModelVersion(content);
9374
- assertOpenApiAuthBindings(content.document);
9421
+ assertHttpAuthBindings(content.document);
9375
9422
  return {
9376
9423
  modelVersion: content.modelVersion,
9377
9424
  document: content.document,
@@ -9545,6 +9592,7 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
9545
9592
  ...shape
9546
9593
  })])).values()])).min(1);
9547
9594
  function checkModelVersion(content) {
9595
+ 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
9596
  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
9597
  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
9598
  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.");
@@ -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 {};
@@ -4,7 +4,7 @@ export interface RetryConfiguration {
4
4
  readonly maxRetries: number;
5
5
  readonly intervalMs: number;
6
6
  }
7
- export declare const retryNodeTypes: readonly ['code', 'connector', 'openapi', 'llm', 'decision'];
7
+ export declare const retryNodeTypes: readonly ['code', 'connector', 'openapi', 'http-request', 'llm', 'decision'];
8
8
  export declare const nodeRetryLimits: {
9
9
  readonly maxRetries: 5;
10
10
  readonly minIntervalMs: 1000;