@oomol-lab/open-flow 0.1.0-beta.53 → 0.1.0-beta.55

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 (38) hide show
  1. package/dist/browser/{createResourceDialog-BsaBMf7_.js → createResourceDialog-4H5_lZ6s.js} +3 -3
  2. package/dist/browser/{main-BPABKzwN.js → dist-BFmpkX4P.js} +9 -1
  3. package/dist/browser/flow-authoring-node.d.ts +5 -0
  4. package/dist/browser/flow-authoring.d.ts +1 -1
  5. package/dist/browser/flow-authoring.js +9434 -9187
  6. package/dist/browser/flow-change.d.ts +6 -1
  7. package/dist/browser/flow-change.js +3108 -141
  8. package/dist/browser/{flowChanges-CcscgZsW.js → flowChanges-ZzG-f9cg.js} +1978 -5437
  9. package/dist/browser/{flowWorkspace-CoT_ewLX.js → flowWorkspace-ChpRaTMX.js} +3197 -310
  10. package/dist/browser/{icons-0s-Q_3lp.js → icons-CdAB9wyS.js} +4294 -54
  11. package/dist/browser/{markdownContent-D3FFc-u_.js → markdownContent-frwDfQQU.js} +1 -2
  12. package/dist/browser/preview.css +375 -322
  13. package/dist/browser/preview.js +5458 -1888
  14. package/dist/browser/theme.css +1 -0
  15. package/dist/browser/ui.css +30 -0
  16. package/dist/browser/ui.js +4 -3
  17. package/dist/browser/workbench.css +375 -322
  18. package/dist/browser/workbench.js +28 -16
  19. package/dist/browser/{workbenchSelect-BqUPacsr.js → workbenchSelect-BRZN4ish.js} +1 -1
  20. package/dist/common/authoringExamples.d.ts +3 -2
  21. package/dist/common/control-api-conformance.js +3410 -3285
  22. package/dist/common/control-api.js +3680 -3531
  23. package/dist/common/control-requests.js +2132 -1860
  24. package/dist/common/decision.d.ts +47 -0
  25. package/dist/common/decision.js +10153 -0
  26. package/dist/common/flow-encoding.js +3105 -124
  27. package/dist/common/flow-semantics.js +276 -2
  28. package/dist/common/integration-trigger.js +202 -1
  29. package/dist/common/mcp.js +3748 -3623
  30. package/dist/common/openapi.js +202 -1
  31. package/dist/common/poll-trigger.js +226 -1
  32. package/dist/common/run-events.js +1 -0
  33. package/dist/common/runtime-contract.d.ts +8 -0
  34. package/dist/common/scheduler.d.ts +1 -1
  35. package/dist/common/scheduler.js +2137 -1936
  36. package/dist/common/webhook-trigger.js +202 -1
  37. package/package.json +5 -1
  38. package/dist/browser/dist-BDBTOgS5.js +0 -9
@@ -1,8 +1,7 @@
1
- import { $t as InputGroup, At as flowDependencies, Bn as inputValue, Bt as followWorkbenchLink, Ct as resetInputValues, Dn as allConnectorConnectionsQuery, Dt as setTriggerConnection, En as randomId, Et as setInputSources, F as deriveAddNodeOptions, G as resourceValue, Gn as providerIconAppearance, H as CacheResource, Hn as jsonValue, Ht as Popover, K as designerGraph, Kn as ApiError, Kt as PopoverTitle, L as feishuResourceKind, Mn as sampleErrorOutputs, Nn as triggerOutputDefinitions, Ot as updateTriggerConfig, P as addNodeIntent, Pn as isJsonObject, R as supportsFeishuChatFilter, Rn as connection, St as repairNodeNames, Tn as WorkbenchClient, Tt as setConnectorConnection, Un as record, Ut as PopoverContent, V as scopedValue, Vn as invalidResponse, Vt as Switch, W as resourceData, Wn as string, X as providerIcon, Yn as IconThemeContext, _ as updateTaskAdditionalInputs, _t as setComment, a as deleteSelection, an as EmptyHeader, at as Latest, b as updateWebhook, bt as setNodePositions, c as setInputVariable, cn as EventSourcesPage, d as updateNodeIcon, dn as createI18n, dt as actionWithConnections, en as InputGroupAddon, f as updateNodeName, ft as connectionCatalog, g as updateTask, gt as restoreCanvasPresentation, h as updateSubflow, ht as removeComments, i as createResource, in as EmptyDescription, it as revisionView, kn as decodeTriggerCatalog, kt as updateTriggerSchedule, l as updateCondition, m as updateResolution, mt as commentIds, nn as Empty, o as nameCreatedNodes, on as EmptyMedia, ot as deriveInspectorDiagnostics, p as updateNodeSettings, pt as canvasPresentationChange, qn as controlErrorCode, qt as PopoverTrigger, r as applyFlowChanges, rn as EmptyContent, s as setInputValue, sn as EmptyTitle, st as diagnosticItems, t as addNode, tn as InputGroupInput, tt as RunStore, u as updateNodeDescription, v as updateTaskPorts, vt as setFlowViewport, wn as errorNotice, wt as setCodeActions, xt as targetPresentation, y as updateValue, yt as setNodeContentHidden, z as combineSources, zn as connectorActionMetadata, zt as IdTooltip } from "./flowChanges-CcscgZsW.js";
1
+ import { An as decodeTriggerCatalog, At as flowDependencies, Bn as inputValue, Bt as followWorkbenchLink, Ct as resetInputValues, Dn as randomId, Dt as setTriggerConnection, En as WorkbenchClient, Et as setInputSources, F as deriveAddNodeOptions, Fn as isJsonObject, G as resourceValue, Gn as providerIconAppearance, H as CacheResource, Hn as jsonValue, Ht as Popover, Jt as PopoverTrigger, K as designerGraph, Kn as ApiError, L as feishuResourceKind, Nn as sampleErrorOutputs, On as allConnectorConnectionsQuery, Ot as updateTriggerConfig, P as addNodeIntent, Pn as triggerOutputDefinitions, R as supportsFeishuChatFilter, Rn as connection, St as repairNodeNames, Tn as errorNotice, Tt as setConnectorConnection, Un as record, Ut as PopoverContent, V as scopedValue, Vn as invalidResponse, Vt as Switch, W as resourceData, Wn as string, X as providerIcon, Yn as IconThemeContext, _ as updateTaskAdditionalInputs, _t as setComment, a as deleteSelection, an as EmptyDescription, at as Latest, b as updateWebhook, bt as setNodePositions, c as setInputVariable, cn as EmptyTitle, d as updateNodeIcon, dt as actionWithConnections, en as InputGroup, f as updateNodeName, fn as createI18n, ft as connectionCatalog, g as updateTask, gt as restoreCanvasPresentation, h as updateSubflow, ht as removeComments, i as createResource, in as EmptyContent, it as revisionView, kt as updateTriggerSchedule, l as updateCondition, ln as EventSourcesPage, m as updateResolution, mt as commentIds, nn as InputGroupInput, o as nameCreatedNodes, on as EmptyHeader, ot as deriveInspectorDiagnostics, p as updateNodeSettings, pt as canvasPresentationChange, qn as controlErrorCode, qt as PopoverTitle, r as applyFlowChanges, rn as Empty, s as setInputValue, sn as EmptyMedia, st as diagnosticItems, t as addNode, tn as InputGroupAddon, tt as RunStore, u as updateNodeDescription, v as updateTaskPorts, vt as setFlowViewport, wt as setCodeActions, xt as targetPresentation, y as updateValue, yt as setNodeContentHidden, z as combineSources, zn as connectorActionMetadata, zt as IdTooltip } from "./flowChanges-ZzG-f9cg.js";
2
2
  import { a as derive, i as compute, l as val } from "./dist-bO8nvHFH.js";
3
- import { a as useVal, i as useTranslate, r as useLang, t as I18nProvider } from "./main-BPABKzwN.js";
4
- import { C as FieldError, D as applyFlowChanges$1, E as FlowChangeError, I as mapConditionSources, Ir as cn, K as dequal$1, L as nodeInputMappings, N as resourceNameIssue, Pr as Button, T as FieldLabel, a as DialogDescription, b as Spinner, c as DialogTitle, d as TooltipContent, i as DialogContent, jn as Input, n as Dialog, o as DialogFooter, p as TooltipTrigger, r as DialogClose, s as DialogHeader, t as Icon, u as Tooltip, w as FieldGroup, x as Field } from "./icons-0s-Q_3lp.js";
5
- import { a as toPlainObject } from "./dist-BDBTOgS5.js";
3
+ import { a as toPlainObject, c as useLang, l as useTranslate, o as I18nProvider, u as useVal } from "./dist-BFmpkX4P.js";
4
+ import { D as FlowChangeError, E as FieldLabel, L as mapConditionSources, O as applyFlowChanges$1, P as resourceNameIssue, R as nodeInputMappings, S as Field, T as FieldGroup, a as DialogDescription, c as DialogTitle, d as TooltipContent, gi as Button, i as DialogContent, ir as Input, it as dequal$1, n as Dialog, o as DialogFooter, p as TooltipTrigger, r as DialogClose, s as DialogHeader, t as Icon, u as Tooltip, vi as cn, w as FieldError, x as Spinner } from "./icons-CdAB9wyS.js";
6
5
  import { c as isUiLanguage, d as uiLanguages, l as resolveUiLanguage, u as uiLanguageNames } from "./value-DL_poNiC.js";
7
6
  import { Suspense, lazy, useEffect, useRef, useState } from "react";
8
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -196,7 +195,7 @@ function Skeleton({ className, ...props }) {
196
195
  }
197
196
  //#endregion
198
197
  //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
199
- var CreateResourceDialog = lazy(() => import("./createResourceDialog-BsaBMf7_.js"));
198
+ var CreateResourceDialog = lazy(() => import("./createResourceDialog-4H5_lZ6s.js"));
200
199
  var flowIdTooltipAlignOffset = 44;
201
200
  var renamePopoverAlignOffset = -12;
202
201
  var renamePopoverVerticalShift = 8;
@@ -595,12 +594,13 @@ function FlowSkeleton() {
595
594
  })]
596
595
  });
597
596
  }
598
- function FlowBrowser({ catalogWidth, createFlowDisabled, createFlowField, flowBadges, hrefForFlow, onCreateFlow, onSelectFlow, store }) {
597
+ function FlowBrowser({ catalogWidth, createFlowDisabled, createFlowField, flowBadges, hrefForFlow, initializing = false, onCreateFlow, onSelectFlow, store }) {
599
598
  const t = useTranslate();
600
599
  const busy = useVal(store.workspace.$.busy);
601
600
  const loadFailed = useVal(store.workspace.$.flowLoadFailed);
602
601
  const loadMoreFailed = useVal(store.workspace.$.flowLoadMoreFailed);
603
- const loading = useVal(store.workspace.$.flowLoading);
602
+ const flowLoading = useVal(store.workspace.$.flowLoading);
603
+ const loading = initializing || flowLoading;
604
604
  const loadingMore = useVal(store.workspace.$.flowLoadingMore);
605
605
  const nextCursor = useVal(store.workspace.$.flowNextCursor);
606
606
  const refreshing = useVal(store.workspace.$.flowRefreshing);
@@ -629,6 +629,7 @@ function FlowBrowser({ catalogWidth, createFlowDisabled, createFlowField, flowBa
629
629
  children: t("resource.flows")
630
630
  }),
631
631
  /* @__PURE__ */ jsxs("section", {
632
+ "aria-busy": loading || refreshing,
632
633
  "aria-labelledby": "flow-list-title",
633
634
  className: "resource-list-section rounded-lg",
634
635
  children: [
@@ -657,7 +658,7 @@ function FlowBrowser({ catalogWidth, createFlowDisabled, createFlowField, flowBa
657
658
  })]
658
659
  }), /* @__PURE__ */ jsxs(Button, {
659
660
  className: "pr-3",
660
- disabled: busy != null,
661
+ disabled: initializing || busy != null,
661
662
  onClick: () => setCreating(true),
662
663
  children: [/* @__PURE__ */ jsx(Icon, {
663
664
  "data-icon": "inline-start",
@@ -4301,6 +4302,7 @@ function inverseFlowChanges(content, operations) {
4301
4302
  value: operation.before
4302
4303
  });
4303
4304
  break;
4305
+ case "task.decision.set":
4304
4306
  case "task.openapi.set":
4305
4307
  case "task.agent.set":
4306
4308
  restore.push({
@@ -5428,6 +5430,8 @@ var WorkspaceStore = class {
5428
5430
  this.#flows.dispose();
5429
5431
  }
5430
5432
  async start(flowId) {
5433
+ const current = this.#draftSession.capture();
5434
+ let initialLoad;
5431
5435
  this.#started = false;
5432
5436
  if (this.#stopCatalogWatch == null) {
5433
5437
  const subscription = this.#client.watchFlowCatalog((event) => {
@@ -5436,11 +5440,17 @@ var WorkspaceStore = class {
5436
5440
  if (event?.kind == "flow.created" && this.#started && this.#model.value.flowId == null && this.#model.value.busy == null) this.flowCreated(event.flowId);
5437
5441
  });
5438
5442
  this.#stopCatalogWatch = subscription.stop;
5439
- await subscription.ready;
5443
+ subscription.ready.then(async () => {
5444
+ if (initialLoad == null || this.#disposed) return;
5445
+ await initialLoad;
5446
+ if (!this.#disposed) await this.reloadFlows();
5447
+ });
5448
+ await Promise.resolve();
5440
5449
  }
5441
5450
  if (this.#disposed) return;
5442
- await this.reloadFlows();
5443
- if (!this.#disposed) await this.selectFlow(flowId);
5451
+ initialLoad = this.reloadFlows();
5452
+ await initialLoad;
5453
+ if (!this.#disposed && current()) await this.selectFlow(flowId);
5444
5454
  this.#started = !this.#disposed;
5445
5455
  }
5446
5456
  async reloadFlows() {
@@ -5947,12 +5957,12 @@ var WorkspaceStore = class {
5947
5957
  loadOpenApiDocument(url, signal) {
5948
5958
  return this.#client.loadOpenApiDocument(url, signal);
5949
5959
  }
5950
- async saveTaskSettings(nodeId, settings) {
5960
+ async saveTaskSettings(nodeId, settings, deletion) {
5951
5961
  const revision = this.$.revision.value;
5952
5962
  const target = this.#model.value.target;
5953
5963
  if (revision == null || target == null) return false;
5954
5964
  const changes = updateTask(revision, target, nodeId, settings);
5955
- return changes != null && await this.#editDraft(changes) != null;
5965
+ return changes != null && await this.#editDraft(changes, deletion) != null;
5956
5966
  }
5957
5967
  async saveTaskPorts(nodeId, ports, deletion, values) {
5958
5968
  const revision = this.$.revision.value;
@@ -6915,7 +6925,7 @@ var WorkbenchStore = class {
6915
6925
  };
6916
6926
  //#endregion
6917
6927
  //#region src/workbench/browser/runtime/openFlowWorkbench.tsx
6918
- var FlowWorkspace = lazy(() => import("./flowWorkspace-CoT_ewLX.js"));
6928
+ var FlowWorkspace = lazy(() => import("./flowWorkspace-ChpRaTMX.js"));
6919
6929
  function OpenFlowSessionGate({ action, description, error, onSubmit, onTokenChange, pending = false, title, token, tokenLabel }) {
6920
6930
  const hasToken = token != null && tokenLabel != null && onTokenChange != null;
6921
6931
  const tokenValue = token ?? "";
@@ -7015,7 +7025,7 @@ function NotificationBridge({ host, store }) {
7015
7025
  useEffect(() => () => notify(void 0), [notify]);
7016
7026
  return null;
7017
7027
  }
7018
- function Workbench({ catalogWidth, createFlow, createFlowDisabled, createFlowField, flowBadges, connectionHref, hrefFor, language, navigation, onConfigureConnector, onManageConnectorAccess, onLanguageChange, store, theme }) {
7028
+ function Workbench({ catalogWidth, createFlow, createFlowDisabled, createFlowField, flowBadges, connectionHref, hrefFor, initializing, language, navigation, onConfigureConnector, onManageConnectorAccess, onLanguageChange, store, theme }) {
7019
7029
  const flowId = useVal(store.workspace.$.flowId);
7020
7030
  return /* @__PURE__ */ jsx("div", {
7021
7031
  className: "app-shell",
@@ -7028,6 +7038,7 @@ function Workbench({ catalogWidth, createFlow, createFlowDisabled, createFlowFie
7028
7038
  flowId: flow.flowId,
7029
7039
  view: "design"
7030
7040
  }),
7041
+ initializing,
7031
7042
  language,
7032
7043
  onCreateFlow: (name) => navigation.createFlow(name, createFlow),
7033
7044
  onLanguageChange,
@@ -7107,7 +7118,7 @@ function Session({ catalogWidth, createFlow, createFlowDisabled, createFlowField
7107
7118
  children: [/* @__PURE__ */ jsx(NotificationBridge, {
7108
7119
  host,
7109
7120
  store
7110
- }), started ? /* @__PURE__ */ jsx(Workbench, {
7121
+ }), started || location.flowId == null ? /* @__PURE__ */ jsx(Workbench, {
7111
7122
  catalogWidth,
7112
7123
  createFlow,
7113
7124
  createFlowDisabled,
@@ -7115,6 +7126,7 @@ function Session({ catalogWidth, createFlow, createFlowDisabled, createFlowField
7115
7126
  flowBadges,
7116
7127
  connectionHref,
7117
7128
  hrefFor,
7129
+ initializing: !started,
7118
7130
  language,
7119
7131
  navigation,
7120
7132
  onConfigureConnector,
@@ -1,4 +1,4 @@
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";
1
+ import { St as SelectItem, Tt as SelectValue, bt as SelectContent, vi as cn, vt as Select, wt as SelectTrigger, xt as SelectGroup } from "./icons-CdAB9wyS.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  //#region src/workbench/browser/runtime/shell/workbenchSelect.tsx
4
4
  function WorkbenchSelect({ ariaLabel, className, disabled = false, id, onValueChange, options, portalRoot, size, value, variant }) {
@@ -6,6 +6,7 @@ declare const descriptions: {
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 decision: 'AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running.';
9
10
  readonly openapi: 'A fixed JSON API operation. Replace the example document and URL before running.';
10
11
  readonly connector: 'A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show.';
11
12
  readonly code: 'A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions.';
@@ -20,8 +21,8 @@ declare const descriptions: {
20
21
  };
21
22
  export declare const authoringExampleNames: (keyof typeof descriptions)[];
22
23
  export declare const authoringExamples: {
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
+ name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm-chat" | "llm-json" | "manual" | "openapi" | "poll" | "poll-notification" | "value" | "wait" | "webhook";
25
+ 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." | "AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running." | "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.";
25
26
  }[];
26
27
  export declare function authoringExample(name: string): {
27
28
  version: 1;