@oomol-lab/open-flow 0.1.0-beta.50 → 0.1.0-beta.52

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 (44) hide show
  1. package/dist/browser/{createResourceDialog-CSltk-qY.js → createResourceDialog-BsaBMf7_.js} +2 -1
  2. package/dist/browser/flow-authoring-node.d.ts +3 -1
  3. package/dist/browser/flow-authoring.js +82 -3
  4. package/dist/browser/flow-change-schema.d.ts +1 -1
  5. package/dist/browser/flow-change.d.ts +15 -2
  6. package/dist/browser/flow-change.js +81 -3
  7. package/dist/browser/{flowChanges-DbYrpHnS.js → flowChanges-DtraMpva.js} +3858 -1921
  8. package/dist/browser/{flowWorkspace-CjwpbVBR.js → flowWorkspace-DLgti4Lk.js} +1353 -513
  9. package/dist/browser/{workbenchSelect-oVujN2z6.js → icons-0s-Q_3lp.js} +92 -35
  10. package/dist/browser/licenses.md +204 -0
  11. package/dist/browser/preview.css +302 -179
  12. package/dist/browser/preview.js +4829 -2198
  13. package/dist/browser/theme.css +2 -0
  14. package/dist/browser/ui-hostNavigationActions.d.ts +13 -0
  15. package/dist/browser/ui-hostTooltip.d.ts +8 -0
  16. package/dist/browser/ui-logo.d.ts +5 -0
  17. package/dist/browser/ui.css +102 -8
  18. package/dist/browser/ui.d.ts +3 -0
  19. package/dist/browser/ui.js +176 -11
  20. package/dist/browser/workbench-contract.d.ts +5 -11
  21. package/dist/browser/workbench.css +366 -200
  22. package/dist/browser/workbench.d.ts +1 -1
  23. package/dist/browser/workbench.js +1154 -379
  24. package/dist/browser/workbenchSelect-BqUPacsr.js +31 -0
  25. package/dist/common/authoringExamples.d.ts +4 -2
  26. package/dist/common/control-api-conformance.js +129 -11
  27. package/dist/common/control-api.d.ts +38 -5
  28. package/dist/common/control-api.js +198 -12
  29. package/dist/common/control-requests.d.ts +4 -0
  30. package/dist/common/control-requests.js +1320 -67
  31. package/dist/common/flow-encoding.js +64 -5
  32. package/dist/common/flow-semantics.js +823 -316
  33. package/dist/common/integration-trigger.js +39 -1
  34. package/dist/common/mcp.js +129 -11
  35. package/dist/common/openapi.d.ts +53 -0
  36. package/dist/common/openapi.js +10390 -0
  37. package/dist/common/poll-trigger.js +39 -1
  38. package/dist/common/provider-triggers.js +39 -1
  39. package/dist/common/run-events.js +26 -1
  40. package/dist/common/scheduler.d.ts +4 -1
  41. package/dist/common/scheduler.js +122 -6
  42. package/dist/common/trigger-contract.d.ts +2 -0
  43. package/dist/common/webhook-trigger.js +39 -1
  44. package/package.json +5 -1
@@ -9345,6 +9345,24 @@ var managed = object({
9345
9345
  action: text,
9346
9346
  connectionId: text.optional()
9347
9347
  }),
9348
+ object({
9349
+ kind: literal("openapi"),
9350
+ sourceUrl: text,
9351
+ method: text,
9352
+ path: text,
9353
+ serverUrl: text,
9354
+ document: json,
9355
+ auth: array(object({
9356
+ id: text,
9357
+ type: _enum([
9358
+ "bearer",
9359
+ "basic",
9360
+ "apiKey"
9361
+ ]),
9362
+ name: text.optional(),
9363
+ in: _enum(["header", "query"]).optional()
9364
+ }))
9365
+ }),
9348
9366
  object({
9349
9367
  kind: literal("llm"),
9350
9368
  mode: _enum(["chat", "json"])
@@ -9461,6 +9479,7 @@ var endpoint = object({
9461
9479
  ])),
9462
9480
  successStatus: number()
9463
9481
  });
9482
+ var sourceFlowIds = array(text.min(1)).refine((ids) => new Set(ids).size === ids.length, "Duplicate source Flow ID.");
9464
9483
  var trigger = {
9465
9484
  name: text,
9466
9485
  description: text.optional(),
@@ -9518,6 +9537,11 @@ var node = union([
9518
9537
  ...trigger,
9519
9538
  kind: literal("manual")
9520
9539
  }),
9540
+ strictObject({
9541
+ ...trigger,
9542
+ kind: literal("error"),
9543
+ sourceFlowIds: sourceFlowIds.optional()
9544
+ }),
9521
9545
  object({
9522
9546
  ...trigger,
9523
9547
  kind: literal("webhook"),
@@ -9589,7 +9613,11 @@ var document = object({
9589
9613
  tasks: record(text, managed)
9590
9614
  });
9591
9615
  object({
9592
- modelVersion: union([literal(2), literal(4)]),
9616
+ modelVersion: union([
9617
+ literal(2),
9618
+ literal(4),
9619
+ literal(5)
9620
+ ]),
9593
9621
  document,
9594
9622
  modules: record(text, module)
9595
9623
  }).extend({
@@ -9597,6 +9625,11 @@ object({
9597
9625
  version: literal(1)
9598
9626
  });
9599
9627
  var shapes = {
9628
+ "graph.trigger.sources.set": {
9629
+ nodeId: text,
9630
+ before: sourceFlowIds.optional(),
9631
+ value: sourceFlowIds.optional()
9632
+ },
9600
9633
  "binding.create": {
9601
9634
  bindingId: text,
9602
9635
  binding
@@ -9750,6 +9783,11 @@ var shapes = {
9750
9783
  before: text.optional(),
9751
9784
  value: text.optional()
9752
9785
  },
9786
+ "task.openapi.set": {
9787
+ taskId: text,
9788
+ before: managed,
9789
+ value: managed
9790
+ },
9753
9791
  "task.agent.set": {
9754
9792
  taskId: text,
9755
9793
  before: managed,
@@ -6819,6 +6819,24 @@ var managed = object({
6819
6819
  action: text,
6820
6820
  connectionId: text.optional()
6821
6821
  }),
6822
+ object({
6823
+ kind: literal("openapi"),
6824
+ sourceUrl: text,
6825
+ method: text,
6826
+ path: text,
6827
+ serverUrl: text,
6828
+ document: json,
6829
+ auth: array(object({
6830
+ id: text,
6831
+ type: _enum([
6832
+ "bearer",
6833
+ "basic",
6834
+ "apiKey"
6835
+ ]),
6836
+ name: text.optional(),
6837
+ in: _enum(["header", "query"]).optional()
6838
+ }))
6839
+ }),
6822
6840
  object({
6823
6841
  kind: literal("llm"),
6824
6842
  mode: _enum(["chat", "json"])
@@ -6935,6 +6953,7 @@ var endpoint$3 = object({
6935
6953
  ])),
6936
6954
  successStatus: number()
6937
6955
  });
6956
+ var sourceFlowIds = array(text.min(1)).refine((ids) => new Set(ids).size === ids.length, "Duplicate source Flow ID.");
6938
6957
  var trigger = {
6939
6958
  name: text,
6940
6959
  description: text.optional(),
@@ -6992,6 +7011,11 @@ var node = union([
6992
7011
  ...trigger,
6993
7012
  kind: literal("manual")
6994
7013
  }),
7014
+ strictObject({
7015
+ ...trigger,
7016
+ kind: literal("error"),
7017
+ sourceFlowIds: sourceFlowIds.optional()
7018
+ }),
6995
7019
  object({
6996
7020
  ...trigger,
6997
7021
  kind: literal("webhook"),
@@ -7063,7 +7087,11 @@ var document = object({
7063
7087
  tasks: record$12(text, managed)
7064
7088
  });
7065
7089
  object({
7066
- modelVersion: union([literal(2), literal(4)]),
7090
+ modelVersion: union([
7091
+ literal(2),
7092
+ literal(4),
7093
+ literal(5)
7094
+ ]),
7067
7095
  document,
7068
7096
  modules: record$12(text, module)
7069
7097
  }).extend({
@@ -7071,6 +7099,11 @@ object({
7071
7099
  version: literal(1)
7072
7100
  });
7073
7101
  var shapes = {
7102
+ "graph.trigger.sources.set": {
7103
+ nodeId: text,
7104
+ before: sourceFlowIds.optional(),
7105
+ value: sourceFlowIds.optional()
7106
+ },
7074
7107
  "binding.create": {
7075
7108
  bindingId: text,
7076
7109
  binding
@@ -7224,6 +7257,11 @@ var shapes = {
7224
7257
  before: text.optional(),
7225
7258
  value: text.optional()
7226
7259
  },
7260
+ "task.openapi.set": {
7261
+ taskId: text,
7262
+ before: managed,
7263
+ value: managed
7264
+ },
7227
7265
  "task.agent.set": {
7228
7266
  taskId: text,
7229
7267
  before: managed,
@@ -6,6 +6,7 @@ var nodeKinds = /* @__PURE__ */ new Set([
6
6
  "condition",
7
7
  "connector",
8
8
  "javascript",
9
+ "openapi",
9
10
  "llm",
10
11
  "subflow",
11
12
  "value",
@@ -80,6 +81,8 @@ function artifact(value) {
80
81
  }
81
82
  function createEventProjector(platformRunId, nodeFailureCodes) {
82
83
  const flows = /* @__PURE__ */ new Map();
84
+ const paths = /* @__PURE__ */ new Map();
85
+ const jobs = /* @__PURE__ */ new Map();
83
86
  const nodeProgressBuckets = /* @__PURE__ */ new Map();
84
87
  const runProgressBuckets = /* @__PURE__ */ new Map();
85
88
  return async (value) => {
@@ -93,6 +96,9 @@ function createEventProjector(platformRunId, nodeFailureCodes) {
93
96
  flows.set(rawRunId, flowId);
94
97
  const parentRunId = event.parentRunId;
95
98
  if (parentRunId !== void 0 && (typeof parentRunId != "string" || parentRunId.length == 0)) throw new TypeError("Runtime run.started parentRunId must be a non-empty string when present.");
99
+ const parentJobId = optionalString(event.parentJobId, "Runtime run.started parentJobId");
100
+ const parentNode = parentRunId == null || parentJobId == null ? void 0 : jobs.get(JSON.stringify([parentRunId, parentJobId]));
101
+ paths.set(rawRunId, parentRunId == null ? [] : [...paths.get(parentRunId) ?? [], parentNode ?? flowId]);
96
102
  return {
97
103
  kind: "run.started",
98
104
  payload: {
@@ -120,7 +126,24 @@ function createEventProjector(platformRunId, nodeFailureCodes) {
120
126
  };
121
127
  }
122
128
  if (type == "run.completed" || type == "run.failed") {
123
- runId(event);
129
+ const rawRunId = runId(event);
130
+ if (type == "run.failed" && rawRunId == platformRunId && event.failure != null) {
131
+ const failure = object(event.failure, "Runtime terminal failure");
132
+ const context = nodeContext(failure, flows, platformRunId);
133
+ return {
134
+ kind: "node.failed",
135
+ payload: {
136
+ terminal: true,
137
+ nodeId: context.nodeId,
138
+ executionId: await context.executionId,
139
+ path: paths.get(context.rawRunId) ?? [],
140
+ error: {
141
+ code: nodeFailureCode(failure.code, nodeFailureCodes),
142
+ message: message(failure.message)
143
+ }
144
+ }
145
+ };
146
+ }
124
147
  return;
125
148
  }
126
149
  if (type == "node.started" || type == "node.progress" || type == "node.artifact" || type == "node.log" || type == "node.completed" || type == "node.failed") {
@@ -139,6 +162,7 @@ function createEventProjector(platformRunId, nodeFailureCodes) {
139
162
  value: object(event.outputs, "Runtime node.completed outputs")
140
163
  };
141
164
  case "node.started": {
165
+ jobs.set(JSON.stringify([context.rawRunId, event.jobId]), context.nodeId);
142
166
  const kind = nodeKind(event.nodeKind);
143
167
  const nodeTitle = optionalString(event.nodeTitle, "Runtime node.started nodeTitle");
144
168
  const operation = optionalString(event.operation, "Runtime node.started operation");
@@ -190,6 +214,7 @@ function createEventProjector(platformRunId, nodeFailureCodes) {
190
214
  kind: type,
191
215
  payload: {
192
216
  ...payload,
217
+ ...(paths.get(context.rawRunId)?.length ?? 0) == 0 ? {} : { path: paths.get(context.rawRunId) },
193
218
  error: {
194
219
  code: nodeFailureCode(event.code, nodeFailureCodes),
195
220
  message: message(event.message)
@@ -25,7 +25,7 @@ export type SchedulerEvent = {
25
25
  readonly inputs: Readonly<Record<string, JsonValue>>;
26
26
  readonly jobId: string;
27
27
  readonly nodeId: string;
28
- readonly nodeKind: 'agent' | 'approval' | 'condition' | 'connector' | 'javascript' | 'llm' | 'subflow' | 'value' | 'wait';
28
+ readonly nodeKind: 'agent' | 'approval' | 'condition' | 'connector' | 'javascript' | 'openapi' | 'llm' | 'subflow' | 'value' | 'wait';
29
29
  readonly nodeTitle?: string;
30
30
  readonly runId: string;
31
31
  readonly type: 'node.started';
@@ -57,6 +57,9 @@ export type SchedulerEvent = {
57
57
  readonly message: string;
58
58
  readonly runId: string;
59
59
  readonly type: 'run.failed';
60
+ readonly failure?: Extract<SchedulerEvent, {
61
+ readonly type: 'node.failed';
62
+ }>;
60
63
  };
61
64
  export interface FlowRunResult {
62
65
  readonly kind: 'node-results';
@@ -1,3 +1,4 @@
1
+ import * as Cause from "effect/Cause";
1
2
  import * as Clock from "effect/Clock";
2
3
  import * as Effect from "effect/Effect";
3
4
  import * as FiberSet from "effect/FiberSet";
@@ -6631,6 +6632,24 @@ var managed = object({
6631
6632
  action: text,
6632
6633
  connectionId: text.optional()
6633
6634
  }),
6635
+ object({
6636
+ kind: literal("openapi"),
6637
+ sourceUrl: text,
6638
+ method: text,
6639
+ path: text,
6640
+ serverUrl: text,
6641
+ document: json,
6642
+ auth: array(object({
6643
+ id: text,
6644
+ type: _enum([
6645
+ "bearer",
6646
+ "basic",
6647
+ "apiKey"
6648
+ ]),
6649
+ name: text.optional(),
6650
+ in: _enum(["header", "query"]).optional()
6651
+ }))
6652
+ }),
6634
6653
  object({
6635
6654
  kind: literal("llm"),
6636
6655
  mode: _enum(["chat", "json"])
@@ -6747,6 +6766,7 @@ var endpoint = object({
6747
6766
  ])),
6748
6767
  successStatus: number()
6749
6768
  });
6769
+ var sourceFlowIds = array(text.min(1)).refine((ids) => new Set(ids).size === ids.length, "Duplicate source Flow ID.");
6750
6770
  var trigger = {
6751
6771
  name: text,
6752
6772
  description: text.optional(),
@@ -6804,6 +6824,11 @@ var node = union([
6804
6824
  ...trigger,
6805
6825
  kind: literal("manual")
6806
6826
  }),
6827
+ strictObject({
6828
+ ...trigger,
6829
+ kind: literal("error"),
6830
+ sourceFlowIds: sourceFlowIds.optional()
6831
+ }),
6807
6832
  object({
6808
6833
  ...trigger,
6809
6834
  kind: literal("webhook"),
@@ -6875,7 +6900,11 @@ var document = object({
6875
6900
  tasks: record(text, managed)
6876
6901
  });
6877
6902
  object({
6878
- modelVersion: union([literal(2), literal(4)]),
6903
+ modelVersion: union([
6904
+ literal(2),
6905
+ literal(4),
6906
+ literal(5)
6907
+ ]),
6879
6908
  document,
6880
6909
  modules: record(text, module)
6881
6910
  }).extend({
@@ -6883,6 +6912,11 @@ object({
6883
6912
  version: literal(1)
6884
6913
  });
6885
6914
  var shapes = {
6915
+ "graph.trigger.sources.set": {
6916
+ nodeId: text,
6917
+ before: sourceFlowIds.optional(),
6918
+ value: sourceFlowIds.optional()
6919
+ },
6886
6920
  "binding.create": {
6887
6921
  bindingId: text,
6888
6922
  binding
@@ -7036,6 +7070,11 @@ var shapes = {
7036
7070
  before: text.optional(),
7037
7071
  value: text.optional()
7038
7072
  },
7073
+ "task.openapi.set": {
7074
+ taskId: text,
7075
+ before: managed,
7076
+ value: managed
7077
+ },
7039
7078
  "task.agent.set": {
7040
7079
  taskId: text,
7041
7080
  before: managed,
@@ -10201,6 +10240,67 @@ function isJsonObject(value) {
10201
10240
  }
10202
10241
  //#endregion
10203
10242
  //#region src/trigger/common/contract.ts
10243
+ var errorOutputs = [
10244
+ {
10245
+ handle: "workflow",
10246
+ nullable: false,
10247
+ jsonSchema: {
10248
+ type: "object",
10249
+ additionalProperties: false,
10250
+ required: [
10251
+ "flowId",
10252
+ "name",
10253
+ "revisionId",
10254
+ "publicationId"
10255
+ ],
10256
+ properties: {
10257
+ flowId: { type: "string" },
10258
+ name: { type: "string" },
10259
+ revisionId: { type: "string" },
10260
+ publicationId: { type: ["string", "null"] }
10261
+ }
10262
+ }
10263
+ },
10264
+ {
10265
+ handle: "execution",
10266
+ nullable: false,
10267
+ jsonSchema: {
10268
+ type: "object",
10269
+ additionalProperties: false,
10270
+ required: [
10271
+ "runId",
10272
+ "status",
10273
+ "startedAt",
10274
+ "finishedAt"
10275
+ ],
10276
+ properties: {
10277
+ runId: { type: "string" },
10278
+ status: { enum: ["failed", "indeterminate"] },
10279
+ startedAt: { type: ["string", "null"] },
10280
+ finishedAt: { type: "string" }
10281
+ }
10282
+ }
10283
+ },
10284
+ {
10285
+ handle: "error",
10286
+ nullable: false,
10287
+ jsonSchema: {
10288
+ type: "object",
10289
+ additionalProperties: false,
10290
+ required: ["code", "message"],
10291
+ properties: {
10292
+ code: { type: "string" },
10293
+ message: { type: "string" },
10294
+ nodeId: { type: "string" },
10295
+ jobId: { type: "string" },
10296
+ path: {
10297
+ type: "array",
10298
+ items: { type: "string" }
10299
+ }
10300
+ }
10301
+ }
10302
+ }
10303
+ ];
10204
10304
  var webhookOutputs = [
10205
10305
  {
10206
10306
  handle: "headers",
@@ -10245,6 +10345,7 @@ var cronOutputs = [{
10245
10345
  }];
10246
10346
  function triggerOutputDefinitions(trigger) {
10247
10347
  switch (trigger.kind) {
10348
+ case "error": return errorOutputs;
10248
10349
  case "manual": return [];
10249
10350
  case "cron": return cronOutputs;
10250
10351
  case "poll":
@@ -10316,6 +10417,7 @@ function nodeOutputPorts(document, node) {
10316
10417
  case "cron":
10317
10418
  case "integration":
10318
10419
  case "poll":
10420
+ case "error":
10319
10421
  case "manual":
10320
10422
  case "webhook": return triggerOutputPorts(node);
10321
10423
  }
@@ -10714,6 +10816,7 @@ function runGraph(context, target, runId, inputs, parent, launchInputs = {}, tri
10714
10816
  const kind = nodeKind(context.prepared, node);
10715
10817
  const title = nodeTitle(context.prepared, node);
10716
10818
  const projectedInputs = Object.fromEntries(Object.entries(nodeInputs).filter(([handle]) => {
10819
+ if (node.kind == "task" && node.taskId != null && context.prepared.tasks[node.taskId]?.executor.kind == "openapi" && handle.startsWith("auth.")) return false;
10717
10820
  const mapping = nodeInputMappings(node)[handle];
10718
10821
  return mapping?.kind != "sources" || mapping.sources.every((source) => source.kind != "binding");
10719
10822
  }));
@@ -10755,7 +10858,13 @@ function runGraph(context, target, runId, inputs, parent, launchInputs = {}, tri
10755
10858
  additionalInputs: Object.fromEntries(Object.entries(nodeInputs).filter(([handle]) => additional.has(handle))),
10756
10859
  blockId: node.task != null ? node.task.moduleId : node.taskId,
10757
10860
  flowId: target.flowId,
10758
- input: Object.fromEntries(Object.entries(nodeInputs).filter(([handle]) => !additional.has(handle))),
10861
+ input: Object.fromEntries(Object.entries(nodeInputs).filter(([handle]) => {
10862
+ if (additional.has(handle)) return false;
10863
+ const task = node.taskId == null ? void 0 : context.prepared.tasks[node.taskId];
10864
+ if (task?.executor.kind != "openapi") return true;
10865
+ const mapping = node.inputs[handle];
10866
+ return mapping?.kind != "unset" && (mapping != null || task.inputs.some((port) => "handle" in port && port.handle == handle && port.value !== void 0));
10867
+ })),
10759
10868
  invocationId: saved?.invocationId ?? (config == null ? context.createId() : jobId),
10760
10869
  ...resolution == null || saved == null ? {} : { agent: {
10761
10870
  action: resolution,
@@ -10863,14 +10972,19 @@ function runGraph(context, target, runId, inputs, parent, launchInputs = {}, tri
10863
10972
  return createWait(nodeId, jobId, result.value);
10864
10973
  };
10865
10974
  const observe = (nodeId, jobId, effect) => effect.pipe(Effect.catchDefect((error) => Effect.fail(error instanceof Error ? error : new Error(String(error)))), Effect.tapError((error) => Effect.gen(function* () {
10866
- if (firstCause == null) firstFailure ??= error;
10867
- yield* context.emit({
10975
+ const failure = {
10868
10976
  ...nodeFailure(error, context.projectFailure),
10869
10977
  jobId,
10870
10978
  nodeId,
10871
10979
  runId,
10872
10980
  type: "node.failed"
10873
- }).pipe(Effect.ignore);
10981
+ };
10982
+ if (!context.failures.has(error)) context.failures.set(error, failure);
10983
+ if (firstCause == null) {
10984
+ firstFailure = error;
10985
+ firstCause = Cause.fail(error);
10986
+ }
10987
+ yield* context.emit(failure).pipe(Effect.ignore);
10874
10988
  })), Effect.tapCause((cause) => Effect.sync(() => {
10875
10989
  firstCause ??= cause;
10876
10990
  })));
@@ -10960,7 +11074,8 @@ function runGraph(context, target, runId, inputs, parent, launchInputs = {}, tri
10960
11074
  yield* context.emit({
10961
11075
  message: firstFailure?.message ?? "Execution failed.",
10962
11076
  runId,
10963
- type: "run.failed"
11077
+ type: "run.failed",
11078
+ ...firstFailure == null ? {} : { failure: context.failures.get(firstFailure) }
10964
11079
  }).pipe(Effect.ignore);
10965
11080
  return yield* Effect.failCause(firstCause);
10966
11081
  }
@@ -11052,6 +11167,7 @@ function runFlow(prepared, options) {
11052
11167
  const triggerNode = options.trigger == null ? void 0 : prepared.graph.nodes[options.trigger.nodeId];
11053
11168
  if (options.trigger != null && (triggerNode == null || "inputs" in triggerNode)) return yield* Effect.fail(/* @__PURE__ */ new Error(`Node "${options.trigger.nodeId}" is not a TriggerNode in Flow "${options.flowId}".`));
11054
11169
  return yield* runGraph({
11170
+ failures: /* @__PURE__ */ new WeakMap(),
11055
11171
  counts: Object.fromEntries(Object.entries(checkpoint?.counts ?? {}).map(([scope, counts]) => [scope, { ...counts }])),
11056
11172
  bindingValues: checkpoint?.bindingValues ?? options.bindingValues ?? {},
11057
11173
  createId: options.createId,
@@ -1,6 +1,8 @@
1
1
  import type { JsonValue, Port, PortDefinition, TriggerNode } from '../browser/flow-change.js';
2
2
  import { webhookMethods, webhookSupportsBody } from '../browser/webhook-method.js';
3
3
  export { webhookMethods, webhookSupportsBody };
4
+ export declare const errorOutputs: readonly Port[];
5
+ export declare const sampleErrorOutputs: Readonly<Record<string, JsonValue>>;
4
6
  export declare const webhookOutputs: readonly Port[];
5
7
  export declare function triggerOutputDefinitions(trigger: TriggerNode): readonly Port[];
6
8
  export declare function triggerOutputPorts(trigger: TriggerNode): Readonly<Record<string, PortDefinition>>;
@@ -8485,6 +8485,24 @@ var managed = object({
8485
8485
  action: text,
8486
8486
  connectionId: text.optional()
8487
8487
  }),
8488
+ object({
8489
+ kind: literal("openapi"),
8490
+ sourceUrl: text,
8491
+ method: text,
8492
+ path: text,
8493
+ serverUrl: text,
8494
+ document: json,
8495
+ auth: array(object({
8496
+ id: text,
8497
+ type: _enum([
8498
+ "bearer",
8499
+ "basic",
8500
+ "apiKey"
8501
+ ]),
8502
+ name: text.optional(),
8503
+ in: _enum(["header", "query"]).optional()
8504
+ }))
8505
+ }),
8488
8506
  object({
8489
8507
  kind: literal("llm"),
8490
8508
  mode: _enum(["chat", "json"])
@@ -8601,6 +8619,7 @@ var endpoint = object({
8601
8619
  ])),
8602
8620
  successStatus: number()
8603
8621
  });
8622
+ var sourceFlowIds = array(text.min(1)).refine((ids) => new Set(ids).size === ids.length, "Duplicate source Flow ID.");
8604
8623
  var trigger = {
8605
8624
  name: text,
8606
8625
  description: text.optional(),
@@ -8658,6 +8677,11 @@ var node = union([
8658
8677
  ...trigger,
8659
8678
  kind: literal("manual")
8660
8679
  }),
8680
+ strictObject({
8681
+ ...trigger,
8682
+ kind: literal("error"),
8683
+ sourceFlowIds: sourceFlowIds.optional()
8684
+ }),
8661
8685
  object({
8662
8686
  ...trigger,
8663
8687
  kind: literal("webhook"),
@@ -8729,7 +8753,11 @@ var document = object({
8729
8753
  tasks: record(text, managed)
8730
8754
  });
8731
8755
  object({
8732
- modelVersion: union([literal(2), literal(4)]),
8756
+ modelVersion: union([
8757
+ literal(2),
8758
+ literal(4),
8759
+ literal(5)
8760
+ ]),
8733
8761
  document,
8734
8762
  modules: record(text, module)
8735
8763
  }).extend({
@@ -8737,6 +8765,11 @@ object({
8737
8765
  version: literal(1)
8738
8766
  });
8739
8767
  var shapes = {
8768
+ "graph.trigger.sources.set": {
8769
+ nodeId: text,
8770
+ before: sourceFlowIds.optional(),
8771
+ value: sourceFlowIds.optional()
8772
+ },
8740
8773
  "binding.create": {
8741
8774
  bindingId: text,
8742
8775
  binding
@@ -8890,6 +8923,11 @@ var shapes = {
8890
8923
  before: text.optional(),
8891
8924
  value: text.optional()
8892
8925
  },
8926
+ "task.openapi.set": {
8927
+ taskId: text,
8928
+ before: managed,
8929
+ value: managed
8930
+ },
8893
8931
  "task.agent.set": {
8894
8932
  taskId: text,
8895
8933
  before: managed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oomol-lab/open-flow",
3
- "version": "0.1.0-beta.50",
3
+ "version": "0.1.0-beta.52",
4
4
  "description": "TypeScript contracts and Browser runtime for Open Flow.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,6 +13,10 @@
13
13
  ".": {
14
14
  "types": "./dist/index.d.ts"
15
15
  },
16
+ "./openapi": {
17
+ "types": "./dist/common/openapi.d.ts",
18
+ "import": "./dist/common/openapi.js"
19
+ },
16
20
  "./connector-action": {
17
21
  "types": "./dist/common/connector-action.d.ts",
18
22
  "import": "./dist/common/connector-action.js"