@oomol-lab/open-flow 0.1.0-beta.51 → 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 (41) hide show
  1. package/dist/browser/{createResourceDialog-BDtXpRSt.js → createResourceDialog-BsaBMf7_.js} +2 -1
  2. package/dist/browser/flow-authoring.js +46 -3
  3. package/dist/browser/flow-change.d.ts +6 -1
  4. package/dist/browser/flow-change.js +46 -3
  5. package/dist/browser/{flowChanges-BWSXSnMX.js → flowChanges-DtraMpva.js} +3463 -1930
  6. package/dist/browser/{flowWorkspace-DBaq2Eks.js → flowWorkspace-DLgti4Lk.js} +896 -325
  7. package/dist/browser/{workbenchSelect-C9kwcUmN.js → icons-0s-Q_3lp.js} +48 -32
  8. package/dist/browser/licenses.md +204 -0
  9. package/dist/browser/preview.css +282 -179
  10. package/dist/browser/preview.js +4289 -2193
  11. package/dist/browser/theme.css +2 -0
  12. package/dist/browser/ui-hostNavigationActions.d.ts +13 -0
  13. package/dist/browser/ui-hostTooltip.d.ts +8 -0
  14. package/dist/browser/ui-logo.d.ts +5 -0
  15. package/dist/browser/ui.css +82 -8
  16. package/dist/browser/ui.d.ts +3 -0
  17. package/dist/browser/ui.js +172 -8
  18. package/dist/browser/workbench-contract.d.ts +4 -11
  19. package/dist/browser/workbench.css +346 -200
  20. package/dist/browser/workbench.d.ts +1 -1
  21. package/dist/browser/workbench.js +1029 -365
  22. package/dist/browser/workbenchSelect-BqUPacsr.js +31 -0
  23. package/dist/common/authoringExamples.d.ts +4 -3
  24. package/dist/common/control-api-conformance.js +47 -1
  25. package/dist/common/control-api.d.ts +4 -0
  26. package/dist/common/control-api.js +51 -2
  27. package/dist/common/control-requests.d.ts +4 -0
  28. package/dist/common/control-requests.js +1299 -68
  29. package/dist/common/flow-encoding.js +34 -0
  30. package/dist/common/flow-semantics.js +674 -252
  31. package/dist/common/integration-trigger.js +23 -0
  32. package/dist/common/mcp.js +47 -1
  33. package/dist/common/openapi.d.ts +53 -0
  34. package/dist/common/openapi.js +10390 -0
  35. package/dist/common/poll-trigger.js +23 -0
  36. package/dist/common/provider-triggers.js +23 -0
  37. package/dist/common/run-events.js +1 -0
  38. package/dist/common/scheduler.d.ts +1 -1
  39. package/dist/common/scheduler.js +31 -1
  40. package/dist/common/webhook-trigger.js +23 -0
  41. package/package.json +5 -1
@@ -0,0 +1,31 @@
1
+ import { Ir as cn, ct as SelectContent, ft as SelectTrigger, lt as SelectGroup, ot as Select, pt as SelectValue, ut as SelectItem } from "./icons-0s-Q_3lp.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/workbench/browser/runtime/shell/workbenchSelect.tsx
4
+ function WorkbenchSelect({ ariaLabel, className, disabled = false, id, onValueChange, options, portalRoot, size, value, variant }) {
5
+ return /* @__PURE__ */ jsxs(Select, {
6
+ disabled,
7
+ onValueChange: (next) => {
8
+ if (next != null) onValueChange(next);
9
+ },
10
+ value,
11
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
12
+ "aria-label": ariaLabel,
13
+ className: cn("min-w-32", className),
14
+ id,
15
+ size,
16
+ variant,
17
+ children: /* @__PURE__ */ jsx(SelectValue, { children: options.find((option) => option.value == value)?.label ?? value })
18
+ }), /* @__PURE__ */ jsx(SelectContent, {
19
+ align: "end",
20
+ alignItemWithTrigger: false,
21
+ container: portalRoot,
22
+ children: /* @__PURE__ */ jsx(SelectGroup, { children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, {
23
+ disabled: option.disabled,
24
+ value: option.value,
25
+ children: option.label
26
+ }, option.value)) })
27
+ })]
28
+ });
29
+ }
30
+ //#endregion
31
+ export { WorkbenchSelect as t };
@@ -1,11 +1,12 @@
1
1
  import type { DraftOperation } from './draftOperations.js';
2
2
  declare const descriptions: {
3
3
  readonly manual: 'A Manual start node.';
4
- readonly error: 'An Error Trigger. Publish and enable this Flow before selecting it as another Flow’s error workflow.';
4
+ readonly error: 'A Flow Error node. Select upstream Flows, then publish and enable this Flow to listen for failures in their automatic runs.';
5
5
  readonly webhook: 'A Webhook start node.';
6
6
  readonly cron: 'An hourly scheduled start node.';
7
7
  readonly poll: 'Gmail polling by key; replace CONNECTION_ID with an active Gmail connection.';
8
8
  readonly integration: 'Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.';
9
+ readonly openapi: 'A fixed JSON API operation. Replace the example document and URL before running.';
9
10
  readonly connector: 'A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show.';
10
11
  readonly code: 'A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions.';
11
12
  readonly condition: 'A condition with true and false execution branches.';
@@ -19,8 +20,8 @@ declare const descriptions: {
19
20
  };
20
21
  export declare const authoringExampleNames: (keyof typeof descriptions)[];
21
22
  export declare const authoringExamples: {
22
- name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "error" | "integration" | "llm-chat" | "llm-json" | "manual" | "poll" | "poll-notification" | "value" | "wait" | "webhook";
23
- description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show." | "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions." | "A Manual start node." | "A Wait with a continue action and a built-in notification output." | "A Webhook start node." | "A condition with true and false execution branches." | "A fixed value node." | "An Agent with code computation enabled. Configure a model available in the deployment." | "An Approval with approve and reject decision branches and a built-in notification output." | "An Error Trigger. Publish and enable this Flow before selecting it as another Flow’s error workflow." | "An LLM JSON Task and its node; configure a model available in the deployment." | "An LLM chat Task and its node; configure a model available in the deployment." | "An hourly scheduled start node." | "Gmail events → JavaScript text formatting → Connector notification. Replace connection/action IDs and match the notification input ports." | "Gmail polling by key; replace CONNECTION_ID with an active Gmail connection." | "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.";
23
+ name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "error" | "integration" | "llm-chat" | "llm-json" | "manual" | "openapi" | "poll" | "poll-notification" | "value" | "wait" | "webhook";
24
+ description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show." | "A Flow Error node. Select upstream Flows, then publish and enable this Flow to listen for failures in their automatic runs." | "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions." | "A Manual start node." | "A Wait with a continue action and a built-in notification output." | "A Webhook start node." | "A condition with true and false execution branches." | "A fixed JSON API operation. Replace the example document and URL before running." | "A fixed value node." | "An Agent with code computation enabled. Configure a model available in the deployment." | "An Approval with approve and reject decision branches and a built-in notification output." | "An LLM JSON Task and its node; configure a model available in the deployment." | "An LLM chat Task and its node; configure a model available in the deployment." | "An hourly scheduled start node." | "Gmail events → JavaScript text formatting → Connector notification. Replace connection/action IDs and match the notification input ports." | "Gmail polling by key; replace CONNECTION_ID with an active Gmail connection." | "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.";
24
25
  }[];
25
26
  export declare function authoringExample(name: string): {
26
27
  version: 1;
@@ -5799,6 +5799,15 @@ function json$3(params) {
5799
5799
  });
5800
5800
  return jsonSchema;
5801
5801
  }
5802
+ //#endregion
5803
+ //#region src/openapi/common/authBindings.ts
5804
+ /** Never allow credentials to enter a Revision as literal node inputs. */
5805
+ function assertOpenApiAuthBindings(document) {
5806
+ for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
5807
+ if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
5808
+ for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && (mapping.kind == "value" || mapping.kind == "sources" && mapping.sources.some((source) => source.kind == "flow"))) throw new TypeError("OpenAPI authentication accepts deployment variables and upstream outputs only.");
5809
+ }
5810
+ }
5802
5811
  function checkJsonDepth(value, depth = 0) {
5803
5812
  if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
5804
5813
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
@@ -5929,6 +5938,24 @@ var managed = object({
5929
5938
  action: text,
5930
5939
  connectionId: text.optional()
5931
5940
  }),
5941
+ object({
5942
+ kind: literal("openapi"),
5943
+ sourceUrl: text,
5944
+ method: text,
5945
+ path: text,
5946
+ serverUrl: text,
5947
+ document: json$2,
5948
+ auth: array(object({
5949
+ id: text,
5950
+ type: _enum([
5951
+ "bearer",
5952
+ "basic",
5953
+ "apiKey"
5954
+ ]),
5955
+ name: text.optional(),
5956
+ in: _enum(["header", "query"]).optional()
5957
+ }))
5958
+ }),
5932
5959
  object({
5933
5960
  kind: literal("llm"),
5934
5961
  mode: _enum(["chat", "json"])
@@ -6195,6 +6222,7 @@ function decodeRevisionContent(value) {
6195
6222
  checkJsonDepth(value);
6196
6223
  const content = revision.parse(value);
6197
6224
  checkErrorModelVersion(content);
6225
+ assertOpenApiAuthBindings(content.document);
6198
6226
  return content;
6199
6227
  }
6200
6228
  var shapes = {
@@ -6356,6 +6384,11 @@ var shapes = {
6356
6384
  before: text.optional(),
6357
6385
  value: text.optional()
6358
6386
  },
6387
+ "task.openapi.set": {
6388
+ taskId: text,
6389
+ before: managed,
6390
+ value: managed
6391
+ },
6359
6392
  "task.agent.set": {
6360
6393
  taskId: text,
6361
6394
  before: managed,
@@ -9980,6 +10013,7 @@ function flow(value) {
9980
10013
  revisionId: string$1(target.revisionId)
9981
10014
  } },
9982
10015
  createdAt: string$1(source.createdAt),
10016
+ ...source.connectorTeamId == null ? {} : { connectorTeamId: string$1(source.connectorTeamId) },
9983
10017
  draftRevisionId: string$1(source.draftRevisionId),
9984
10018
  flowId: string$1(source.flowId),
9985
10019
  name: string$1(source.name),
@@ -10572,7 +10606,7 @@ function decodeRunEvent(value) {
10572
10606
  switch (kind) {
10573
10607
  case "node.started": {
10574
10608
  const nodeKind = payload.nodeKind;
10575
- if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
10609
+ if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
10576
10610
  return {
10577
10611
  ...base,
10578
10612
  kind,
@@ -10681,6 +10715,18 @@ var ControlClient = class {
10681
10715
  constructor(requestControl) {
10682
10716
  this.requestControl = requestControl;
10683
10717
  }
10718
+ async loadOpenApiDocument(url, signal) {
10719
+ const result = record$2(await this.request("/v1/openapi/document", {
10720
+ method: "POST",
10721
+ body: JSON.stringify({
10722
+ url,
10723
+ version: 1
10724
+ }),
10725
+ signal
10726
+ }));
10727
+ if (result.version != 1) return invalidResponse();
10728
+ return jsonValue(result.document);
10729
+ }
10684
10730
  async listFlows(options = {}) {
10685
10731
  const parameters = new URLSearchParams();
10686
10732
  if (options.cursor != null) parameters.set("cursor", options.cursor);
@@ -40,6 +40,8 @@ export interface Flow {
40
40
  readonly createdAt: string;
41
41
  readonly draftRevisionId: string;
42
42
  readonly flowId: string;
43
+ /** Connector Team scope used by the OOMOL resource cache. */
44
+ readonly connectorTeamId?: string;
43
45
  readonly name: string;
44
46
  readonly status: 'active' | 'retiring';
45
47
  readonly updatedAt: string;
@@ -388,6 +390,7 @@ export interface RunPage {
388
390
  }
389
391
  export type RunEvent = Readonly<ReturnType<typeof decodeRunEvent>>;
390
392
  export type RunEventKind = RunEvent['kind'];
393
+ export declare function isRunTerminalEvent(event: RunEvent | undefined): boolean;
391
394
  export interface RunEvents {
392
395
  readonly done: boolean;
393
396
  readonly events: readonly RunEvent[];
@@ -719,6 +722,7 @@ export type ConditionalResult<T> = {
719
722
  export declare class ControlClient {
720
723
  private readonly requestControl;
721
724
  constructor(requestControl: ControlRequest);
725
+ loadOpenApiDocument(url: string, signal?: AbortSignal): Promise<JsonValue>;
722
726
  listFlows(options?: {
723
727
  readonly cursor?: string;
724
728
  readonly includeTotal?: boolean;
@@ -5822,6 +5822,15 @@ function json$2(params) {
5822
5822
  });
5823
5823
  return jsonSchema;
5824
5824
  }
5825
+ //#endregion
5826
+ //#region src/openapi/common/authBindings.ts
5827
+ /** Never allow credentials to enter a Revision as literal node inputs. */
5828
+ function assertOpenApiAuthBindings(document) {
5829
+ for (const graph of [document.graph, ...Object.values(document.subflows).map((subflow) => subflow.graph)]) for (const node of Object.values(graph.nodes)) {
5830
+ if (node.kind != "task" || node.taskId == null || document.tasks[node.taskId]?.executor.kind != "openapi") continue;
5831
+ for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && (mapping.kind == "value" || mapping.kind == "sources" && mapping.sources.some((source) => source.kind == "flow"))) throw new TypeError("OpenAPI authentication accepts deployment variables and upstream outputs only.");
5832
+ }
5833
+ }
5825
5834
  function checkJsonDepth(value, depth = 0) {
5826
5835
  if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
5827
5836
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
@@ -5955,6 +5964,24 @@ var managed = object({
5955
5964
  action: text,
5956
5965
  connectionId: text.optional()
5957
5966
  }),
5967
+ object({
5968
+ kind: literal("openapi"),
5969
+ sourceUrl: text,
5970
+ method: text,
5971
+ path: text,
5972
+ serverUrl: text,
5973
+ document: json$1,
5974
+ auth: array(object({
5975
+ id: text,
5976
+ type: _enum([
5977
+ "bearer",
5978
+ "basic",
5979
+ "apiKey"
5980
+ ]),
5981
+ name: text.optional(),
5982
+ in: _enum(["header", "query"]).optional()
5983
+ }))
5984
+ }),
5958
5985
  object({
5959
5986
  kind: literal("llm"),
5960
5987
  mode: _enum(["chat", "json"])
@@ -6221,6 +6248,7 @@ function decodeRevisionContent(value) {
6221
6248
  checkJsonDepth(value);
6222
6249
  const content = revision.parse(value);
6223
6250
  checkErrorModelVersion(content);
6251
+ assertOpenApiAuthBindings(content.document);
6224
6252
  return content;
6225
6253
  }
6226
6254
  var shapes = {
@@ -6382,6 +6410,11 @@ var shapes = {
6382
6410
  before: text.optional(),
6383
6411
  value: text.optional()
6384
6412
  },
6413
+ "task.openapi.set": {
6414
+ taskId: text,
6415
+ before: managed,
6416
+ value: managed
6417
+ },
6385
6418
  "task.agent.set": {
6386
6419
  taskId: text,
6387
6420
  before: managed,
@@ -10570,6 +10603,7 @@ function flow(value) {
10570
10603
  revisionId: string$1(target.revisionId)
10571
10604
  } },
10572
10605
  createdAt: string$1(source.createdAt),
10606
+ ...source.connectorTeamId == null ? {} : { connectorTeamId: string$1(source.connectorTeamId) },
10573
10607
  draftRevisionId: string$1(source.draftRevisionId),
10574
10608
  flowId: string$1(source.flowId),
10575
10609
  name: string$1(source.name),
@@ -11068,6 +11102,9 @@ function randomId() {
11068
11102
  }
11069
11103
  //#endregion
11070
11104
  //#region src/control/common/api.ts
11105
+ function isRunTerminalEvent(event) {
11106
+ return event?.kind == "run.completed" || event?.kind == "run.failed" || event?.kind == "run.canceled" || event?.kind == "run.indeterminate";
11107
+ }
11071
11108
  function decodeRunEvent(value) {
11072
11109
  const source = record$1(value);
11073
11110
  const sequence = integer$1(source.sequence);
@@ -11162,7 +11199,7 @@ function decodeRunEvent(value) {
11162
11199
  switch (kind) {
11163
11200
  case "node.started": {
11164
11201
  const nodeKind = payload.nodeKind;
11165
- if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
11202
+ if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "openapi" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "subflow" && nodeKind !== "value" && nodeKind !== "wait") return invalidResponse();
11166
11203
  return {
11167
11204
  ...base,
11168
11205
  kind,
@@ -11271,6 +11308,18 @@ var ControlClient = class {
11271
11308
  constructor(requestControl) {
11272
11309
  this.requestControl = requestControl;
11273
11310
  }
11311
+ async loadOpenApiDocument(url, signal) {
11312
+ const result = record$1(await this.request("/v1/openapi/document", {
11313
+ method: "POST",
11314
+ body: JSON.stringify({
11315
+ url,
11316
+ version: 1
11317
+ }),
11318
+ signal
11319
+ }));
11320
+ if (result.version != 1) return invalidResponse();
11321
+ return jsonValue(result.document);
11322
+ }
11274
11323
  async listFlows(options = {}) {
11275
11324
  const parameters = new URLSearchParams();
11276
11325
  if (options.cursor != null) parameters.set("cursor", options.cursor);
@@ -11832,4 +11881,4 @@ var ControlClient = class {
11832
11881
  }
11833
11882
  };
11834
11883
  //#endregion
11835
- export { ApiError, ControlClient, actionSummary, controlErrorCode, controlErrorMetadata, connectorAccess as decodeConnectorAccess, connectorAccessSnapshot as decodeConnectorAccessSnapshot, decodeEventSource, decodeEventSources, decodeResultList, decodeResultRead, decodeRunEvent, decodeTriggerCatalog, flowInspection, inspectFlowDraft, nodeDetails, parseProviderAccessSource, parseResultQuery, providerAccessBindingId, providerIconAppearance, readResult, searchTriggerKeys };
11884
+ export { ApiError, ControlClient, actionSummary, controlErrorCode, controlErrorMetadata, connectorAccess as decodeConnectorAccess, connectorAccessSnapshot as decodeConnectorAccessSnapshot, decodeEventSource, decodeEventSources, decodeResultList, decodeResultRead, decodeRunEvent, decodeTriggerCatalog, flowInspection, inspectFlowDraft, isRunTerminalEvent, nodeDetails, parseProviderAccessSource, parseResultQuery, providerAccessBindingId, providerIconAppearance, readResult, searchTriggerKeys };
@@ -7,6 +7,10 @@ export declare const waitActionBodySchema: {
7
7
  };
8
8
  };
9
9
  export declare const controlRequests: {
10
+ loadOpenApiDocument: (value: unknown) => {
11
+ url: string;
12
+ version: 1;
13
+ };
10
14
  createEventSource: (value: unknown) => {
11
15
  version: 1;
12
16
  name: string;