@oomol-lab/open-flow 0.1.0-beta.65 → 0.1.0-beta.66

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 (49) hide show
  1. package/dist/browser/{createResourceDialog-BAJXbzNH.js → createResourceDialog-C-Si_cYs.js} +2 -2
  2. package/dist/browser/flow-authoring-node.d.ts +12 -3
  3. package/dist/browser/flow-authoring.js +114 -19
  4. package/dist/browser/flow-change-schema.d.ts +3 -1
  5. package/dist/browser/flow-change.d.ts +15 -3
  6. package/dist/browser/flow-change.js +111 -16
  7. package/dist/browser/{flowChanges-DkvG5uDq.js → flowChanges-T4_R5p1f.js} +2654 -1858
  8. package/dist/browser/{flowRunInputEditorStore-B2Rw4VsT.js → flowRunInputEditorStore-DJqmR6Qh.js} +3 -2
  9. package/dist/browser/{flowWorkspace-BEp-lxqF.js → flowWorkspace-C0J5C0oM.js} +700 -224
  10. package/dist/browser/{icons-Db2Jb2iX.js → icons-BD3m0RQq.js} +4484 -4370
  11. package/dist/browser/preview.css +152 -64
  12. package/dist/browser/preview.js +4460 -3412
  13. package/dist/browser/ui.css +85 -3
  14. package/dist/browser/ui.js +8 -5
  15. package/dist/browser/workbench.css +152 -64
  16. package/dist/browser/workbench.js +146 -57
  17. package/dist/browser/{workbenchSelect-C-jf6NIM.js → workbenchSelect-B-PFpF_Q.js} +1 -1
  18. package/dist/command/index.js +49 -49
  19. package/dist/common/authoring.d.ts +7 -5
  20. package/dist/common/authoringExamples.d.ts +3 -3
  21. package/dist/common/authoringFields.d.ts +20 -0
  22. package/dist/common/authoringSchema.d.ts +404 -15
  23. package/dist/common/control-api-conformance.js +384 -137
  24. package/dist/common/control-api.d.ts +63 -7
  25. package/dist/common/control-api.js +3562 -3428
  26. package/dist/common/control-requests.d.ts +10 -3
  27. package/dist/common/control-requests.js +418 -43
  28. package/dist/common/decision.js +28 -3
  29. package/dist/common/flow-encoding.d.ts +4 -2
  30. package/dist/common/flow-encoding.js +144 -10
  31. package/dist/common/flow-graph.d.ts +1 -1
  32. package/dist/common/flow-semantics.d.ts +12 -2
  33. package/dist/common/flow-semantics.js +146 -33
  34. package/dist/common/integration-trigger.js +28 -3
  35. package/dist/common/liveDetails.d.ts +26 -11
  36. package/dist/common/mcp.d.ts +6 -3
  37. package/dist/common/mcp.js +203 -84
  38. package/dist/common/openapi.js +28 -3
  39. package/dist/common/poll-trigger.js +28 -3
  40. package/dist/common/run-events.d.ts +2 -0
  41. package/dist/common/run-events.js +9 -3
  42. package/dist/common/scheduler.d.ts +10 -1
  43. package/dist/common/scheduler.js +167 -45
  44. package/dist/common/trigger-contract.d.ts +2 -0
  45. package/dist/common/webhook-trigger.js +28 -3
  46. package/dist/common/workflow.d.ts +93 -0
  47. package/dist/common/workflow.js +10491 -0
  48. package/package.json +5 -1
  49. package/skills/open-flow/references/flow-authoring.md +26 -16
@@ -1,11 +1,11 @@
1
1
  import { i as __require, o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
2
- import { $ as useIconifyData, $n as isJsonObject, $t as EmptyTitle, A as datePickerValue, An as createI18n$1, Bn as I18n, Bt as PopoverTrigger, C as valueForEditor, Cn as useContextMenuRootContext, Cr as controlErrorCode, D as calendarChange, E as typeOfSchema, En as Badge, Er as IconThemeContext, F as feishuResourceKind, Fn as ru_default$1, Ft as PopoverContent, G as designerGraph, Gt as InputGroup, H as resourceData, Hn as EventSourceSetup, Ht as ScrollArea, I as supportsFeishuChatFilter, In as ko_default$1, It as PopoverDescription, J as actionSummary, Jt as Empty, K as semanticNodeIcon, Kt as InputGroupAddon, Ln as ja_default$1, Lt as PopoverHeader, Mn as waitBranchDescription, Mt as IdTooltip, Nn as zh_TW_default$1, Nt as followWorkbenchLink, O as calendarDate, On as SourceForm, P as indexAddNodeOptions, Pn as zh_CN_default$1, Pt as Popover, Q as useIconifyCollectionLoader, Qn as triggerOutputDefinitions, Qt as EmptyMedia, R as mapSource, Rn as fr_default$1, Rt as PopoverPanelContent, S as schemaForEditor, Sn as ContextMenuRootContext, T as isUnconstrainedSchema, Tn as useMenuRootContext, Tr as useAriaLabelledBy, U as resourceValue, Un as errorNotice, Ut as VirtualScrollArea, V as observeResource, Vn as FeishuEventPicker, Vt as NativeScrollArea, Wt as Z$2, X as ContentIcon, Xn as sourceOutputLabel, Xt as EmptyDescription, Y as providerIcon, Yn as resolutionOutputPorts, Yt as EmptyContent, Z as IconifyProvider, Zt as EmptyHeader, _n as MenuPositioner, _r as inputValue, an as DropdownMenuLabel, b as editorComponent, bn as MenuItem, cn as DropdownMenuSeparator, dn as DropdownMenuSubTrigger, dr as openApiFieldIssues, dt as schemaMismatchMessage, en as DropdownMenu, et as wrapLayout, fn as DropdownMenuTrigger, fr as openApiTask, gn as MenuRoot, gr as servers, hn as useCompositeItem, hr as serverAddress, in as DropdownMenuItem, it as revisionView, j as isDateFormat, jn as uiLocales, jt as WorkflowExportMenuItem, k as datePickerChange, kn as SourceSelect, ln as DropdownMenuSub, lr as listOperations, lt as diagnosticMessage, mn as findRootOwnerId, mr as selectOperation, n as agentTool, nn as DropdownMenuContent, nt as canCancelRun, on as DropdownMenuRadioGroup, or as triggerConfigValue, pn as isElementDisabled, pr as securityOptions, pt as connectionCatalog, q as triggerNodeIcon, qn as decodeResultList, qt as InputGroupInput, rn as DropdownMenuGroup, rt as hasRunFilter, sn as DropdownMenuRadioItem, sr as triggerConfigValues, tn as DropdownMenuCheckboxItem, un as DropdownMenuSubContent, ur as object, ut as diagnosticNodeId, vn as MenuPortal, w as getDefaultValue, wn as MenuRootContext, wr as Checkbox, x as editorGroups, xn as MenuGroup, y as defaultValueEditorSchema, yn as MenuPopup, zn as en_default$1, zt as PopoverTitle } from "./flowChanges-DkvG5uDq.js";
2
+ import { $ as useIconifyCollectionLoader, $t as EmptyHeader, A as datePickerChange, An as SourceForm, Ar as Checkbox, Bn as fr_default$1, Bt as PopoverPanelContent, C as schemaForEditor, Cn as MenuGroup, Cr as inputValue, D as typeOfSchema, Dn as useMenuRootContext, E as isUnconstrainedSchema, En as MenuRootContext, F as indexAddNodeOptions, Fn as zh_TW_default$1, Ft as followWorkbenchLink, Gn as errorNotice, Gt as VirtualScrollArea, H as observeResource, Hn as I18n, Ht as PopoverTrigger, I as feishuResourceKind, In as zh_CN_default$1, It as Popover, J as triggerNodeIcon, Jt as InputGroupAddon, K as designerGraph, Kt as Z$2, L as supportsFeishuChatFilter, Ln as ru_default$1, Lt as PopoverContent, M as isDateFormat, Mn as createI18n$1, Mr as IconThemeContext, Nn as uiLocales, Nt as WorkflowExportMenuItem, O as calendarChange, On as Badge, Pn as waitBranchDescription, Pt as IdTooltip, Q as IconifyProvider, Qn as sourceOutputLabel, Qt as EmptyDescription, Rn as ko_default$1, Rt as PopoverDescription, S as editorGroups, Sn as MenuItem, Sr as workflowSelectionTask, T as getDefaultValue, Tn as useContextMenuRootContext, U as resourceData, Un as FeishuEventPicker, Ut as NativeScrollArea, Vn as en_default$1, Vt as PopoverTitle, W as resourceValue, Wn as EventSourceSetup, Wt as ScrollArea, X as providerIcon, Xt as Empty, Y as actionSummary, Yn as decodeResultList, Yt as InputGroupInput, Z as ContentIcon, Zn as resolutionOutputPorts, Zt as EmptyContent, _n as useCompositeItem, _r as selectOperation, an as DropdownMenuGroup, at as revisionView, b as defaultValueEditorSchema, bn as MenuPortal, cn as DropdownMenuRadioGroup, dn as DropdownMenuSub, dt as diagnosticNodeId, en as EmptyMedia, et as useIconifyData, fn as DropdownMenuSubContent, fr as listOperations, ft as schemaMismatchMessage, gn as findRootOwnerId, gr as securityOptions, hn as isElementDisabled, hr as openApiTask, in as DropdownMenuContent, it as hasRunFilter, j as datePickerValue, jn as SourceSelect, jr as useAriaLabelledBy, k as calendarDate, kr as controlErrorCode, ln as DropdownMenuRadioItem, lr as triggerConfigValue, mn as DropdownMenuTrigger, mr as openApiFieldIssues, mt as connectionCatalog, n as agentTool, nn as DropdownMenu, nr as isJsonObject, on as DropdownMenuItem, pn as DropdownMenuSubTrigger, pr as object, q as semanticNodeIcon, qt as InputGroup, rn as DropdownMenuCheckboxItem, rt as canCancelRun, sn as DropdownMenuLabel, tn as EmptyTitle, tr as triggerOutputDefinitions, tt as wrapLayout, un as DropdownMenuSeparator, ur as triggerConfigValues, ut as diagnosticMessage, vn as MenuRoot, vr as serverAddress, w as valueForEditor, wn as ContextMenuRootContext, x as editorComponent, xn as MenuPopup, xr as workflowCandidateGroup, yn as MenuPositioner, yr as servers, z as mapSource, zn as ja_default$1, zt as PopoverHeader } from "./flowChanges-T4_R5p1f.js";
3
3
  import { a as derive, c as strictEqual, i as compute, l as val, n as attachSetter, r as combine, s as readonlyVal } from "./dist-bO8nvHFH.js";
4
4
  import { c as useLang, i as isString, l as useTranslate, n as isBoolean, o as I18nProvider, r as isPlainObject, s as useI18n, t as isArray$1, u as useVal } from "./dist-BFmpkX4P.js";
5
- import { $ as operandHandle, $n as Store, $r as inputChange, $t as InternalBackdrop, A as decisionLimits, Ar as isAndroid, At as SelectValue, Bi as useRefWithInit, C as FieldDescription, Ci as cn$1, Cn as useListNavigation, Cr as isIndexOutOfListBounds, Ct as Select$1, Di as EMPTY_ARRAY$1, Dr as activeElement, Dt as SelectItem, E as FieldLabel, Ei as useRenderElement, Er as isInteractiveElement, Et as SelectGroup, F as limitDecisionQuestions, Fi as formatErrorMessage, Fr as ChevronDown, Ft as ARROW_DOWN, Gr as createChangeEventDetails, Gt as VERTICAL_KEYS, Hi as isElement, Hr as transitionStatusMapping, Ht as HORIZONTAL_KEYS, Ii as mergeProps, It as ARROW_KEYS, Jn as DROPDOWN_COLLISION_AVOIDANCE, Jr as clearPress, Jt as scrollIntoViewIfNeeded, Kn as FloatingPortal, Kr as createGenericEventDetails, Kt as VERTICAL_KEYS_WITH_EXTRA_KEYS, L as matchesSchema, Li as useIsoLayoutEffect, Ln as useDismiss, Lr as createLucideIcon, Lt as ARROW_LEFT, M as decisionQuestionIssues, Mi as useButton, Mt as IndexGuessBehavior, N as decisionTask, Ni as CompositeRootContext, Nr as ownerDocument, Nt as useCompositeListItem, O as decodeRevisionContent, Oi as EMPTY_OBJECT, Or as contains, Ot as SelectSeparator, P as defaultDecisionQuestion, Pr as useLabelableId, Pt as ALL_KEYS, Q as nodeInputMappings, Qt as getDisabledMountTransitionStyles, R as schemaObject, Rn as useClick, Rr as useTransitionStatus, Rt as ARROW_RIGHT, S as Field, Si as buttonVariants, Sr as getMinListIndex, T as FieldGroup, Ti as clsx, Tr as stopEvent$1, Tt as SelectContent, Ut as HORIZONTAL_KEYS_WITH_EXTRA_KEYS, Vr as TransitionStatusDataAttributes, W as nodeNameIssue, Wr as useValueChanged, Wt as MODIFIER_KEYS, Xr as escapeKey, Xt as useAnchoredPopupScrollLock, Y as comparisonIssue, Yr as closePress, Zn as addEventListener, Zt as usePositioner, _ as TooltipPositioner, _i as fieldValidityMapping, _n as findItemIndex, _r as findNonDisabledListIndex, a as DialogDescription, an as getPseudoElementBounds, ar as createSelector, at as dequal, b as TooltipRoot, bi as useControlled, br as getGridNavigatedIndex, bt as string, c as DialogTitle, cn as triggerOpenStateMapping, cr as Label, d as TooltipContent, di as useFormContext, dn as hasNullItemLabel, dr as useTimeout, dt as discriminatedUnion, ei as inputClear, en as useAnchorPositioning, er as useStore$1, et as operatorsForType, f as TooltipProvider, fi as useRegisterFieldControl, fn as isGroupedItems, g as TooltipPopup, gi as DEFAULT_FIELD_STATE_ATTRIBUTES, gn as defaultItemEquality, gr as createGridCellMap, gt as number, h as TooltipArrow, hi as useId$1, hn as compareItemEquality, ht as literal, i as DialogContent, ii as none$1, in as inertValue, ir as require_builtin_esm_external_require_react, ji as useMergedRefs, jr as isFirefox, ki as NOOP, kn as useFloatingRootContext, kr as getTarget, kt as SelectTrigger, l as DialogTrigger, li as triggerPress, ln as resolveAriaLabelledBy, lr as Input$1, m as createTooltipHandle, mi as useBaseUiId, mn as stringifyAsValue, n as Dialog, ni as itemPress, nn as useDirection, nt as unaryOperator, on as popupStateMapping, or as useValueAsRef, ot as webhookMethods, p as TooltipTrigger, pi as useFieldRootContext, pn as stringifyAsLabel, qr as cancelOpen, qt as isNativeInput, ri as listNavigation, rn as CompositeList, rr as require_with_selector, rt as valueType, sn as pressableTriggerOpenStateMapping, sr as useOnFirstRender, st as webhookSupportsBody, t as Icon, ti as inputPress, u as Tooltip, ui as useLabelableContext, un as useOpenInteractionType, v as TooltipPortal, vi as visuallyHidden, vn as removeItem, vr as getGridCellIndexOfCorner, w as FieldError, wi as cva, wn as useInteractions, wr as isListIndexDisabled, wt as SelectChevron, x as Spinner, xi as Button$1, xn as useTypeahead, xr as getMaxListIndex, y as TooltipTrigger$1, yi as visuallyHiddenInput, yn as selectedValueIncludes, yr as getGridCellIndices, yt as strictObject, z as variableInputCompatible, zi as useStableCallback, zn as FloatingFocusManager, zr as useOpenChangeComplete, zt as ARROW_UP } from "./icons-Db2Jb2iX.js";
5
+ import { $ as decodeRevisionContent, $r as escapeKey, $t as useAnchoredPopupScrollLock, A as variableInputCompatible, Ai as EMPTY_ARRAY$1, Ar as activeElement, At as SelectItem, Bi as useIsoLayoutEffect, Bn as useDismiss, Br as createLucideIcon, Bt as ARROW_LEFT, C as FieldDescription, Ci as useControlled, Cr as getGridNavigatedIndex, Di as cva, Dn as useInteractions, Dr as isListIndexDisabled, Dt as SelectChevron, E as FieldLabel, Ei as cn$1, En as useListNavigation, Er as isIndexOutOfListBounds, Et as Select$1, Fi as useButton, Ft as IndexGuessBehavior, Gi as isElement, Gr as transitionStatusMapping, Gt as HORIZONTAL_KEYS, Hi as useStableCallback, Hn as FloatingFocusManager, Hr as useOpenChangeComplete, Ht as ARROW_UP, I as nodeNameIssue, Ii as CompositeRootContext, Ir as ownerDocument, It as useCompositeListItem, J as operatorsForType, Jr as createChangeEventDetails, Jt as VERTICAL_KEYS, Kt as HORIZONTAL_KEYS_WITH_EXTRA_KEYS, Lr as useLabelableId, Lt as ALL_KEYS, Mi as NOOP, Mn as useFloatingRootContext, Mr as getTarget, Mt as SelectTrigger, Nr as isAndroid, Nt as SelectValue, O as matchesSchema, Oi as clsx, Or as stopEvent$1, Ot as SelectContent, Pi as useMergedRefs, Pr as isFirefox, Qr as closePress, Ri as formatErrorMessage, Rr as ChevronDown, Rt as ARROW_DOWN, S as Field, Si as visuallyHiddenInput, Sn as selectedValueIncludes, Sr as getGridCellIndices, St as string, T as FieldGroup, Ti as buttonVariants, Tr as getMinListIndex, Tt as dequal, U as comparisonIssue, Ui as useRefWithInit, Vn as useClick, Vr as useTransitionStatus, Vt as ARROW_RIGHT, Wr as TransitionStatusDataAttributes, X as unaryOperator, Xr as cancelOpen, Xt as isNativeInput, Yn as FloatingPortal, Yr as createGenericEventDetails, Yt as VERTICAL_KEYS_WITH_EXTRA_KEYS, Z as valueType, Zn as DROPDOWN_COLLISION_AVOIDANCE, Zr as clearPress, Zt as scrollIntoViewIfNeeded, _ as TooltipPositioner, _i as useBaseUiId, _n as stringifyAsValue, _t as literal, a as DialogDescription, ai as itemPress, an as useDirection, at as decisionQuestionIssues, b as TooltipRoot, bi as fieldValidityMapping, bn as findItemIndex, br as findNonDisabledListIndex, c as DialogTitle, cn as getPseudoElementBounds, cr as createSelector, ct as limitDecisionQuestions, d as TooltipContent, dn as triggerOpenStateMapping, dr as Label, en as usePositioner, er as addEventListener, et as webhookMethods, f as TooltipProvider, fi as triggerPress, fn as resolveAriaLabelledBy, fr as Input$1, g as TooltipPopup, gi as useFieldRootContext, gn as stringifyAsLabel, h as TooltipArrow, hi as useRegisterFieldControl, hn as isGroupedItems, i as DialogContent, ii as inputPress, ji as EMPTY_OBJECT, jr as contains, jt as SelectSeparator, k as schemaObject, ki as useRenderElement, kr as isInteractiveElement, kt as SelectGroup, l as DialogTrigger, ln as popupStateMapping, lr as useValueAsRef, m as createTooltipHandle, mi as useFormContext, mn as hasNullItemLabel, mr as useTimeout, n as Dialog, ni as inputChange, nn as InternalBackdrop, nr as Store, oi as listNavigation, on as CompositeList, or as require_with_selector, ot as decisionTask, p as TooltipTrigger, pi as useLabelableContext, pn as useOpenInteractionType, pt as discriminatedUnion, q as operandHandle, qr as useValueChanged, qt as MODIFIER_KEYS, ri as inputClear, rn as useAnchorPositioning, rr as useStore$1, rt as decisionLimits, si as none$1, sn as inertValue, sr as require_builtin_esm_external_require_react, st as defaultDecisionQuestion, t as Icon, tn as getDisabledMountTransitionStyles, tt as webhookSupportsBody, u as Tooltip, un as pressableTriggerOpenStateMapping, ur as useOnFirstRender, v as TooltipPortal, vi as useId$1, vn as compareItemEquality, vt as number, w as FieldError, wi as Button$1, wn as useTypeahead, wr as getMaxListIndex, x as Spinner, xi as visuallyHidden, xn as removeItem, xr as getGridCellIndexOfCorner, xt as strictObject, y as TooltipTrigger$1, yi as DEFAULT_FIELD_STATE_ATTRIBUTES, yn as defaultItemEquality, yr as createGridCellMap, zi as mergeProps, zt as ARROW_KEYS } from "./icons-BD3m0RQq.js";
6
6
  import { a as renameObjectField, i as objectValue, n as isJsonValue, o as setObjectField, r as jsonDataTypes, s as valueType$1, t as initialValue, u as resolveUiLanguage } from "./value-BADHeZ9I.js";
7
- import { n as compile, r as validate } from "./flowRunInputEditorStore-B2Rw4VsT.js";
8
- import { t as WorkbenchSelect } from "./workbenchSelect-C-jf6NIM.js";
7
+ import { n as compile, r as validate } from "./flowRunInputEditorStore-DJqmR6Qh.js";
8
+ import { t as WorkbenchSelect } from "./workbenchSelect-B-PFpF_Q.js";
9
9
  import * as React from "react";
10
10
  import reactExports, { Children, Fragment, Suspense, createContext, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -2222,6 +2222,7 @@ function menuItems(options, providersOnly = false) {
2222
2222
  }
2223
2223
  function fallbackIcon$1(item) {
2224
2224
  switch (item.type) {
2225
+ case "workflow": return "flow";
2225
2226
  case "agent": return "llm";
2226
2227
  case "condition": return "condition";
2227
2228
  case "decision": return "decision";
@@ -2232,6 +2233,7 @@ function fallbackIcon$1(item) {
2232
2233
  case "approval": return "task";
2233
2234
  case "trigger": return "trigger";
2234
2235
  case "value": return "value";
2236
+ case "outputs": return "outputs";
2235
2237
  case "wait": return "wait";
2236
2238
  case "new-task":
2237
2239
  case "comment": return "task";
@@ -5995,6 +5997,23 @@ function FieldSelect({ id, value, onChange, children, disabled, readOnly, danger
5995
5997
  });
5996
5998
  }
5997
5999
  //#endregion
6000
+ //#region src/workbench/browser/runtime/editor/inspectorStatusSection.tsx
6001
+ function InspectorStatusSection({ title, actions, children, tone = "neutral", section, alert = false }) {
6002
+ return /* @__PURE__ */ jsxs("section", {
6003
+ className: "inspector-status",
6004
+ "data-tone": tone,
6005
+ "data-inspector-section": section,
6006
+ role: alert ? "alert" : void 0,
6007
+ children: [/* @__PURE__ */ jsxs("h3", {
6008
+ className: "inspector-section-title",
6009
+ children: [title, actions]
6010
+ }), /* @__PURE__ */ jsx("div", {
6011
+ className: "inspector-status-content",
6012
+ children
6013
+ })]
6014
+ });
6015
+ }
6016
+ //#endregion
5998
6017
  //#region src/workbench/browser/runtime/editor/connectionSettings.tsx
5999
6018
  var manageAccountOption = "__manage-account__";
6000
6019
  function ConnectionAlert({ detail, disabled, message, onRetry }) {
@@ -6179,7 +6198,7 @@ function ConnectorAccount({ accessError, onConfigureAccess, action, actionError,
6179
6198
  onRetry: () => void connectors.refresh(true)
6180
6199
  });
6181
6200
  else if (connectionId == null && available.length == 0) content = /* @__PURE__ */ jsxs(Fragment$1, { children: [authorizationPending && /* @__PURE__ */ jsx("p", { children: t("inspector.account.authorizationPending") }), /* @__PURE__ */ jsxs("div", {
6182
- className: "connection-prompt",
6201
+ className: "inspector-status-prompt",
6183
6202
  children: [/* @__PURE__ */ jsx("p", { children: t("inspector.account.connectBeforeRun", { service: action.serviceName }) }), /* @__PURE__ */ jsxs(Button$1, {
6184
6203
  disabled: disabled || onConfigureAccess == null,
6185
6204
  onClick: onConfigureAccess,
@@ -6219,31 +6238,27 @@ function ConnectorAccount({ accessError, onConfigureAccess, action, actionError,
6219
6238
  status != null && /* @__PURE__ */ jsx("p", { children: status })
6220
6239
  ] });
6221
6240
  }
6222
- return /* @__PURE__ */ jsxs("section", {
6223
- className: `connection-state ${required ? "required" : ""}`,
6224
- "data-inspector-section": "account",
6225
- children: [/* @__PURE__ */ jsxs("h3", {
6226
- className: "inspector-section-title",
6227
- children: [t(!pending && accessIssue != null ? "inspector.account.accessTitle" : required ? "inspector.account.required" : "inspector.account.title"), onManage != null && /* @__PURE__ */ jsx(Button$1, {
6228
- className: "ml-auto",
6229
- disabled,
6230
- onClick: onManage,
6231
- size: "xs",
6232
- type: "button",
6233
- variant: "ghost",
6234
- children: t("inspector.account.manageAccount")
6235
- })]
6236
- }), /* @__PURE__ */ jsxs("div", {
6237
- className: "connection-state-content",
6238
- children: [content, !pending && onConfigureAccess != null && accessIssue != null && /* @__PURE__ */ jsx(Button$1, {
6239
- className: "self-start",
6240
- disabled,
6241
- onClick: onConfigureAccess,
6242
- size: "sm",
6243
- type: "button",
6244
- variant: "default",
6245
- children: t("inspector.account.manageAccount")
6246
- })]
6241
+ return /* @__PURE__ */ jsxs(InspectorStatusSection, {
6242
+ tone: required ? "warning" : "neutral",
6243
+ section: "account",
6244
+ title: t(!pending && accessIssue != null ? "inspector.account.accessTitle" : required ? "inspector.account.required" : "inspector.account.title"),
6245
+ actions: onManage != null && /* @__PURE__ */ jsx(Button$1, {
6246
+ className: "ml-auto",
6247
+ disabled,
6248
+ onClick: onManage,
6249
+ size: "xs",
6250
+ type: "button",
6251
+ variant: "ghost",
6252
+ children: t("inspector.account.manageAccount")
6253
+ }),
6254
+ children: [content, !pending && onConfigureAccess != null && accessIssue != null && /* @__PURE__ */ jsx(Button$1, {
6255
+ className: "self-start",
6256
+ disabled,
6257
+ onClick: onConfigureAccess,
6258
+ size: "sm",
6259
+ type: "button",
6260
+ variant: "default",
6261
+ children: t("inspector.account.manageAccount")
6247
6262
  })]
6248
6263
  });
6249
6264
  }
@@ -6253,75 +6268,65 @@ function TriggerConnection({ activeConnections, authorizationPending, connection
6253
6268
  const providerTrigger = trigger.kind == "poll" || trigger.kind == "integration" ? trigger : void 0;
6254
6269
  const fieldIdPrefix = `trigger-${selection.id}`;
6255
6270
  const canManage = onConfigureAccess != null && !connectionLoading && connectionError == null && (activeConnections?.length ?? 0) > 0;
6256
- return providerTrigger == null ? null : /* @__PURE__ */ jsxs("section", {
6257
- className: `connection-state ${connection?.status == "active" ? "" : "required"}`,
6258
- "data-inspector-section": "account",
6259
- children: [/* @__PURE__ */ jsxs("h3", {
6260
- className: "inspector-section-title",
6261
- children: [t(connection?.status == "active" ? "inspector.account.title" : "inspector.account.required"), canManage && /* @__PURE__ */ jsx(Button$1, {
6262
- className: "ml-auto",
6263
- disabled,
6271
+ return providerTrigger == null ? null : /* @__PURE__ */ jsxs(InspectorStatusSection, {
6272
+ tone: connection?.status == "active" ? "neutral" : "warning",
6273
+ section: "account",
6274
+ title: t(connection?.status == "active" ? "inspector.account.title" : "inspector.account.required"),
6275
+ actions: canManage && /* @__PURE__ */ jsx(Button$1, {
6276
+ className: "ml-auto",
6277
+ disabled,
6278
+ onClick: () => onConfigureAccess?.(providerTrigger.definition.provider),
6279
+ size: "xs",
6280
+ type: "button",
6281
+ variant: "ghost",
6282
+ children: t("inspector.account.manageAccount")
6283
+ }),
6284
+ children: [authorizationPending && /* @__PURE__ */ jsx("p", { children: t("inspector.account.authorizationPending") }), connectionLoading ? /* @__PURE__ */ jsx("p", { children: t("inspector.account.loading") }) : connectionError != null ? /* @__PURE__ */ jsx(ConnectionAlert, {
6285
+ detail: connectionError,
6286
+ disabled,
6287
+ message: t("inspector.account.refreshFailed"),
6288
+ onRetry: () => void triggers.refresh(true)
6289
+ }) : (activeConnections?.length ?? 0) == 0 ? /* @__PURE__ */ jsxs("div", {
6290
+ className: "inspector-status-prompt",
6291
+ children: [/* @__PURE__ */ jsx("p", { children: t("inspector.account.connectBeforeRun", { service: providerTrigger.definition.provider }) }), /* @__PURE__ */ jsx(Button$1, {
6292
+ disabled: disabled || onConfigureAccess == null,
6264
6293
  onClick: () => onConfigureAccess?.(providerTrigger.definition.provider),
6265
- size: "xs",
6294
+ size: "sm",
6266
6295
  type: "button",
6267
- variant: "ghost",
6268
6296
  children: t("inspector.account.manageAccount")
6269
6297
  })]
6270
- }), /* @__PURE__ */ jsxs("div", {
6271
- className: "connection-state-content",
6272
- children: [authorizationPending && /* @__PURE__ */ jsx("p", { children: t("inspector.account.authorizationPending") }), connectionLoading ? /* @__PURE__ */ jsx("p", { children: t("inspector.account.loading") }) : connectionError != null ? /* @__PURE__ */ jsx(ConnectionAlert, {
6273
- detail: connectionError,
6298
+ }) : /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs(Field, {
6299
+ className: "connection-field",
6300
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
6301
+ className: "sr-only",
6302
+ htmlFor: `${fieldIdPrefix}-connection`,
6303
+ children: t("inspector.account.connection")
6304
+ }), /* @__PURE__ */ jsx(AccountSelect, {
6305
+ connections: activeConnections,
6274
6306
  disabled,
6275
- message: t("inspector.account.refreshFailed"),
6276
- onRetry: () => void triggers.refresh(true)
6277
- }) : (activeConnections?.length ?? 0) == 0 ? /* @__PURE__ */ jsxs("div", {
6278
- className: "connection-prompt",
6279
- children: [/* @__PURE__ */ jsx("p", { children: t("inspector.account.connectBeforeRun", { service: providerTrigger.definition.provider }) }), /* @__PURE__ */ jsx(Button$1, {
6280
- disabled: disabled || onConfigureAccess == null,
6281
- onClick: () => onConfigureAccess?.(providerTrigger.definition.provider),
6282
- size: "sm",
6283
- type: "button",
6284
- children: t("inspector.account.manageAccount")
6285
- })]
6286
- }) : /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs(Field, {
6287
- className: "connection-field",
6288
- children: [/* @__PURE__ */ jsx(FieldLabel, {
6289
- className: "sr-only",
6290
- htmlFor: `${fieldIdPrefix}-connection`,
6291
- children: t("inspector.account.connection")
6292
- }), /* @__PURE__ */ jsx(AccountSelect, {
6293
- connections: activeConnections,
6294
- disabled,
6295
- id: `${fieldIdPrefix}-connection`,
6296
- selectedConnection: connection,
6297
- selectedId: connection?.connectionId,
6298
- onChange: (next) => void triggers.setConnection(selection.id, next),
6299
- onManage: onConfigureAccess == null ? void 0 : () => onConfigureAccess(providerTrigger.definition.provider)
6300
- })]
6301
- }) })]
6302
- })]
6307
+ id: `${fieldIdPrefix}-connection`,
6308
+ selectedConnection: connection,
6309
+ selectedId: connection?.connectionId,
6310
+ onChange: (next) => void triggers.setConnection(selection.id, next),
6311
+ onManage: onConfigureAccess == null ? void 0 : () => onConfigureAccess(providerTrigger.definition.provider)
6312
+ })]
6313
+ }) })]
6303
6314
  });
6304
6315
  }
6305
6316
  /** A persisted reference has no live account health or authorization state. */
6306
6317
  function SavedConnectionReference({ action, connectionId }) {
6307
6318
  const t = useTranslate();
6308
- return /* @__PURE__ */ jsxs("section", {
6309
- className: "connection-state",
6310
- "data-inspector-section": "account",
6311
- children: [/* @__PURE__ */ jsx("h3", {
6312
- className: "inspector-section-title",
6313
- children: t("inspector.account.title")
6314
- }), /* @__PURE__ */ jsxs("div", {
6315
- className: "connection-state-content",
6316
- children: [/* @__PURE__ */ jsx("p", {
6317
- className: "reference-value",
6318
- children: action
6319
- }), connectionId != null && /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: t("inspector.account.connection") }), /* @__PURE__ */ jsx(Input$1, {
6320
- "aria-label": t("inspector.account.connection"),
6321
- readOnly: true,
6322
- value: connectionId
6323
- })] })]
6324
- })]
6319
+ return /* @__PURE__ */ jsxs(InspectorStatusSection, {
6320
+ title: t("inspector.account.title"),
6321
+ section: "account",
6322
+ children: [/* @__PURE__ */ jsx("p", {
6323
+ className: "reference-value",
6324
+ children: action
6325
+ }), connectionId != null && /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: t("inspector.account.connection") }), /* @__PURE__ */ jsx(Input$1, {
6326
+ "aria-label": t("inspector.account.connection"),
6327
+ readOnly: true,
6328
+ value: connectionId
6329
+ })] })]
6325
6330
  });
6326
6331
  }
6327
6332
  //#endregion
@@ -21154,7 +21159,7 @@ function EditableAgentSettingsProvider({ children, task, nodeId, store, connecto
21154
21159
  const definition = current?.kind == "task" ? current.definition : void 0;
21155
21160
  if (definition == null || !("executor" in definition) || !dequal(definition.executor, before)) return false;
21156
21161
  const decoded = decodeRevisionContent({
21157
- modelVersion: 6,
21162
+ modelVersion: 8,
21158
21163
  modules: {},
21159
21164
  document: {
21160
21165
  bindings: {},
@@ -26635,6 +26640,14 @@ if (process.env.NODE_ENV !== "production") GroupCollectionContext.displayName =
26635
26640
  function useGroupCollectionContext() {
26636
26641
  return React.useContext(GroupCollectionContext);
26637
26642
  }
26643
+ function GroupCollectionProvider(props) {
26644
+ const { children, items } = props;
26645
+ const contextValue = React.useMemo(() => ({ items }), [items]);
26646
+ return /*#__PURE__*/ jsx(GroupCollectionContext.Provider, {
26647
+ value: contextValue,
26648
+ children
26649
+ });
26650
+ }
26638
26651
  //#endregion
26639
26652
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js
26640
26653
  /**
@@ -26917,6 +26930,77 @@ var ComboboxPopup = /*#__PURE__*/ React.forwardRef(function ComboboxPopup(compon
26917
26930
  });
26918
26931
  if (process.env.NODE_ENV !== "production") ComboboxPopup.displayName = "ComboboxPopup";
26919
26932
  //#endregion
26933
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/group/ComboboxGroupContext.js
26934
+ var ComboboxGroupContext = /*#__PURE__*/ React.createContext(void 0);
26935
+ if (process.env.NODE_ENV !== "production") ComboboxGroupContext.displayName = "ComboboxGroupContext";
26936
+ function useComboboxGroupContext() {
26937
+ const context = React.useContext(ComboboxGroupContext);
26938
+ if (context === void 0) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>." : formatErrorMessage(18));
26939
+ return context;
26940
+ }
26941
+ //#endregion
26942
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/group/ComboboxGroup.js
26943
+ /**
26944
+ * Groups related items with the corresponding label.
26945
+ * Renders a `<div>` element.
26946
+ *
26947
+ * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
26948
+ */
26949
+ var ComboboxGroup = /*#__PURE__*/ React.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {
26950
+ const { render, className, style, items, ...elementProps } = componentProps;
26951
+ const [labelId, setLabelId] = React.useState();
26952
+ const contextValue = React.useMemo(() => ({
26953
+ labelId,
26954
+ setLabelId,
26955
+ items
26956
+ }), [
26957
+ labelId,
26958
+ setLabelId,
26959
+ items
26960
+ ]);
26961
+ const element = useRenderElement("div", componentProps, {
26962
+ ref: forwardedRef,
26963
+ props: [{
26964
+ role: "group",
26965
+ "aria-labelledby": labelId
26966
+ }, elementProps]
26967
+ });
26968
+ const wrappedElement = /*#__PURE__*/ jsx(ComboboxGroupContext.Provider, {
26969
+ value: contextValue,
26970
+ children: element
26971
+ });
26972
+ if (items) return /*#__PURE__*/ jsx(GroupCollectionProvider, {
26973
+ items,
26974
+ children: wrappedElement
26975
+ });
26976
+ return wrappedElement;
26977
+ });
26978
+ if (process.env.NODE_ENV !== "production") ComboboxGroup.displayName = "ComboboxGroup";
26979
+ //#endregion
26980
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/group-label/ComboboxGroupLabel.js
26981
+ /**
26982
+ * An accessible label that is automatically associated with its parent group.
26983
+ * Renders a `<div>` element.
26984
+ *
26985
+ * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
26986
+ */
26987
+ var ComboboxGroupLabel = /*#__PURE__*/ React.forwardRef(function ComboboxGroupLabel(componentProps, forwardedRef) {
26988
+ const { render, className, style, id: idProp, ...elementProps } = componentProps;
26989
+ const { setLabelId } = useComboboxGroupContext();
26990
+ const id = useBaseUiId(idProp);
26991
+ useIsoLayoutEffect(() => {
26992
+ setLabelId(id);
26993
+ return () => {
26994
+ setLabelId(void 0);
26995
+ };
26996
+ }, [id, setLabelId]);
26997
+ return useRenderElement("div", componentProps, {
26998
+ ref: forwardedRef,
26999
+ props: [{ id }, elementProps]
27000
+ });
27001
+ });
27002
+ if (process.env.NODE_ENV !== "production") ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
27003
+ //#endregion
26920
27004
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/item/ComboboxItemContext.js
26921
27005
  var ComboboxItemContext = /*#__PURE__*/ React.createContext(void 0);
26922
27006
  if (process.env.NODE_ENV !== "production") ComboboxItemContext.displayName = "ComboboxItemContext";
@@ -28982,21 +29066,25 @@ function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
28982
29066
  const controller = new AbortController();
28983
29067
  setState((previous) => ({
28984
29068
  flowId,
29069
+ source,
28985
29070
  loading: true,
28986
- bots: previous?.flowId == flowId ? previous.bots : void 0
29071
+ bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0
28987
29072
  }));
28988
29073
  source.listLeinaBots(flowId, controller.signal).then((bots) => {
28989
29074
  if (!controller.signal.aborted) setState({
28990
29075
  flowId,
29076
+ source,
28991
29077
  bots,
28992
29078
  loading: false
28993
29079
  });
28994
29080
  }, (error) => {
28995
- if (!controller.signal.aborted) setState({
29081
+ if (!controller.signal.aborted) setState((previous) => ({
28996
29082
  flowId,
29083
+ source,
29084
+ bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0,
28997
29085
  loading: false,
28998
29086
  error: error instanceof Error ? error.message : t("contextPanel.loadFailed")
28999
- });
29087
+ }));
29000
29088
  });
29001
29089
  return () => controller.abort();
29002
29090
  }, [
@@ -29005,73 +29093,82 @@ function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
29005
29093
  attempt,
29006
29094
  t
29007
29095
  ]);
29008
- const current = state?.flowId == flowId ? state : void 0;
29096
+ const current = state?.flowId == flowId && state.source == source ? state : void 0;
29009
29097
  const bots = current?.bots;
29010
- const selected = typeof value == "string" ? value : value === void 0 ? void 0 : JSON.stringify(value);
29098
+ const selected = typeof value == "string" && value.trim().length > 0 ? value : void 0;
29011
29099
  const missing = selected != null && bots != null && !bots.some((bot) => bot.leinaId == selected);
29100
+ const error = selected == null ? t("leina.select") : missing ? t("leina.unavailable", { id: selected }) : void 0;
29101
+ const selectedLabel = bots?.find((bot) => bot.leinaId == selected)?.name ?? (missing ? t("leina.unavailable", { id: selected }) : current?.error != null ? t("leina.loadFailed") : t("leina.loading"));
29012
29102
  const items = [...(bots ?? []).map((bot) => ({
29013
29103
  value: bot.leinaId,
29014
29104
  label: bot.name
29015
29105
  })), ...selected != null && !bots?.some((bot) => bot.leinaId == selected) ? [{
29016
29106
  value: selected,
29017
- label: missing ? t("leina.unavailable", { id: selected }) : selected
29107
+ label: selectedLabel
29018
29108
  }] : []];
29019
- return /* @__PURE__ */ jsxs(Select$1, {
29020
- items,
29021
- value: selected ?? null,
29022
- disabled,
29023
- onOpenChange: (open) => {
29024
- if (open) setAttempt((previous) => previous + 1);
29025
- },
29026
- onValueChange: (next) => {
29027
- if (typeof next == "string" && bots?.some((bot) => bot.leinaId == next)) onChange(next);
29028
- },
29029
- children: [/* @__PURE__ */ jsx(SelectTrigger, {
29030
- size: "field",
29031
- className: "w-full",
29032
- "data-field-control": true,
29033
- "aria-label": t("leina.robot"),
29034
- "aria-invalid": missing || void 0,
29035
- children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t("leina.select") })
29036
- }), /* @__PURE__ */ jsxs(SelectContent, {
29037
- align: "start",
29038
- alignItemWithTrigger: false,
29039
- className: selectionMenuContentClass,
29040
- children: [
29041
- (current?.loading ?? true) && /* @__PURE__ */ jsx("span", {
29042
- role: "status",
29043
- className: "block px-1.5 py-1 text-xs leading-5 text-muted-foreground",
29044
- children: t("leina.loading")
29045
- }),
29046
- bots?.map((bot) => /* @__PURE__ */ jsx(SelectItem, {
29047
- value: bot.leinaId,
29048
- className: selectionMenuItemClass,
29049
- children: /* @__PURE__ */ jsx("span", {
29050
- className: "truncate",
29051
- children: bot.name
29052
- })
29053
- }, bot.leinaId)),
29054
- missing && selected != null && /* @__PURE__ */ jsx(SelectItem, {
29055
- value: selected,
29056
- disabled: true,
29057
- className: `mt-1 first-of-type:mt-0 min-h-7 rounded-[var(--ui-control-radius,var(--ui-radius))] py-1 text-xs leading-5 font-normal text-destructive`,
29058
- children: t("leina.unavailable", { id: selected })
29059
- }),
29060
- current?.error != null && /* @__PURE__ */ jsxs("span", {
29061
- role: "alert",
29062
- className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal break-words text-destructive",
29063
- children: [
29064
- t("leina.loadFailed"),
29065
- " ",
29066
- current.error
29067
- ]
29068
- }),
29069
- bots?.length == 0 && !current?.loading && /* @__PURE__ */ jsx("span", {
29070
- className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal text-muted-foreground",
29071
- children: t("leina.empty")
29109
+ return /* @__PURE__ */ jsx(ValueEditorFeedback, {
29110
+ error,
29111
+ children: (errorId) => /* @__PURE__ */ jsxs(Select$1, {
29112
+ items,
29113
+ value: selected ?? null,
29114
+ disabled,
29115
+ onOpenChange: (open) => {
29116
+ if (open) setAttempt((previous) => previous + 1);
29117
+ },
29118
+ onValueChange: (next) => {
29119
+ if (typeof next == "string" && bots?.some((bot) => bot.leinaId == next)) onChange(next);
29120
+ },
29121
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
29122
+ size: "field",
29123
+ className: "w-full",
29124
+ "data-field-control": true,
29125
+ "aria-label": t("leina.robot"),
29126
+ "aria-invalid": error != null || void 0,
29127
+ "aria-describedby": errorId,
29128
+ children: /* @__PURE__ */ jsx(SelectValue, {
29129
+ placeholder: t("leina.select"),
29130
+ children: selected == null ? void 0 : selectedLabel
29072
29131
  })
29073
- ]
29074
- })]
29132
+ }), /* @__PURE__ */ jsxs(SelectContent, {
29133
+ align: "start",
29134
+ alignItemWithTrigger: false,
29135
+ className: selectionMenuContentClass,
29136
+ children: [
29137
+ (current?.loading ?? true) && /* @__PURE__ */ jsx("span", {
29138
+ role: "status",
29139
+ className: "block px-1.5 py-1 text-xs leading-5 text-muted-foreground",
29140
+ children: t("leina.loading")
29141
+ }),
29142
+ bots?.map((bot) => /* @__PURE__ */ jsx(SelectItem, {
29143
+ value: bot.leinaId,
29144
+ className: selectionMenuItemClass,
29145
+ children: /* @__PURE__ */ jsx("span", {
29146
+ className: "truncate",
29147
+ children: bot.name
29148
+ })
29149
+ }, bot.leinaId)),
29150
+ missing && selected != null && /* @__PURE__ */ jsx(SelectItem, {
29151
+ value: selected,
29152
+ disabled: true,
29153
+ className: `mt-1 first-of-type:mt-0 min-h-7 rounded-[var(--ui-control-radius,var(--ui-radius))] py-1 text-xs leading-5 font-normal text-destructive`,
29154
+ children: t("leina.unavailable", { id: selected })
29155
+ }),
29156
+ current?.error != null && /* @__PURE__ */ jsxs("span", {
29157
+ role: "alert",
29158
+ className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal break-words text-destructive",
29159
+ children: [
29160
+ t("leina.loadFailed"),
29161
+ " ",
29162
+ current.error
29163
+ ]
29164
+ }),
29165
+ bots?.length == 0 && !current?.loading && /* @__PURE__ */ jsx("span", {
29166
+ className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal text-muted-foreground",
29167
+ children: t("leina.empty")
29168
+ })
29169
+ ]
29170
+ })]
29171
+ })
29075
29172
  });
29076
29173
  }
29077
29174
  //#endregion
@@ -34489,6 +34586,294 @@ function WebhookEditor({ bodyFields, method, options, disabled, readOnly, output
34489
34586
  ] });
34490
34587
  }
34491
34588
  //#endregion
34589
+ //#region src/workbench/browser/runtime/linkContext.ts
34590
+ /** The host owns URLs for links within the deployment. */
34591
+ var WorkbenchLinkContext = createContext(void 0);
34592
+ //#endregion
34593
+ //#region src/workbench/browser/runtime/editor/workflowSection.tsx
34594
+ function OpenWorkflowLink({ flowId }) {
34595
+ const t = useTranslate();
34596
+ const hrefFor = useContext(WorkbenchLinkContext);
34597
+ if (!flowId || hrefFor == null) return null;
34598
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
34599
+ render: /* @__PURE__ */ jsx("a", {
34600
+ className: buttonVariants({
34601
+ variant: "ghost",
34602
+ size: "icon-xs",
34603
+ className: "text-muted-foreground"
34604
+ }),
34605
+ href: hrefFor({
34606
+ flowId,
34607
+ view: "design"
34608
+ }),
34609
+ target: "_blank",
34610
+ rel: "noopener noreferrer",
34611
+ "aria-label": t("workflow.open")
34612
+ }),
34613
+ children: /* @__PURE__ */ jsx("i", {
34614
+ "aria-hidden": "true",
34615
+ className: "i-lucide-light:external-link text-sm"
34616
+ })
34617
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: t("workflow.open") })] });
34618
+ }
34619
+ function useWorkflowActions(props) {
34620
+ const t = useTranslate();
34621
+ const [state, setState] = useState();
34622
+ const request = useRef();
34623
+ const nodeId = props?.nodeId;
34624
+ useEffect(() => () => request.current?.abort(), [nodeId]);
34625
+ const current = state?.nodeId == nodeId ? state : void 0;
34626
+ async function update(choice) {
34627
+ if (props == null || props.disabled || props.task.executor.kind != "workflow") return;
34628
+ const candidate = choice ?? {
34629
+ flowId: props.task.executor.flowId,
34630
+ name: props.task.name,
34631
+ problem: null
34632
+ };
34633
+ if (!candidate.flowId) return;
34634
+ request.current?.abort();
34635
+ const controller = new AbortController();
34636
+ request.current = controller;
34637
+ const set = (next) => {
34638
+ if (!controller.signal.aborted) setState({
34639
+ nodeId: props.nodeId,
34640
+ flowId: candidate.flowId,
34641
+ ...next
34642
+ });
34643
+ };
34644
+ set({
34645
+ busy: true,
34646
+ pending: choice
34647
+ });
34648
+ let contract;
34649
+ let failure;
34650
+ try {
34651
+ if (choice?.problem == null) try {
34652
+ contract = await props.load(candidate.flowId, controller.signal);
34653
+ } catch (cause) {
34654
+ failure = errorNotice(cause, t).message;
34655
+ }
34656
+ if (controller.signal.aborted) return;
34657
+ const next = workflowSelectionTask(candidate, contract, props.task);
34658
+ if ((choice != null || contract != null) && !dequal(next, props.task)) {
34659
+ if (!await props.onSave(props.task, next)) failure = void 0;
34660
+ } else if (!controller.signal.aborted) await props.onCheck();
34661
+ } catch (cause) {
34662
+ failure = errorNotice(cause, t).message;
34663
+ } finally {
34664
+ set({
34665
+ busy: false,
34666
+ error: failure
34667
+ });
34668
+ }
34669
+ }
34670
+ return {
34671
+ busy: current?.busy ?? false,
34672
+ error: props?.task.executor.kind == "workflow" && current?.flowId == props.task.executor.flowId ? current?.error : void 0,
34673
+ pending: current?.pending,
34674
+ select: (choice) => update(choice),
34675
+ recheck: () => update()
34676
+ };
34677
+ }
34678
+ function WorkflowInterfaceAlert({ actions, disabled, message, stale, flowId }) {
34679
+ const t = useTranslate();
34680
+ return /* @__PURE__ */ jsx(InspectorStatusSection, {
34681
+ title: t(stale ? "workflow.staleTitle" : "workflow.problemTitle"),
34682
+ tone: "danger",
34683
+ section: "workflow-status",
34684
+ alert: true,
34685
+ actions: /* @__PURE__ */ jsx("span", {
34686
+ className: "ml-auto",
34687
+ children: /* @__PURE__ */ jsx(OpenWorkflowLink, { flowId })
34688
+ }),
34689
+ children: /* @__PURE__ */ jsxs("div", {
34690
+ className: "inspector-status-prompt",
34691
+ children: [/* @__PURE__ */ jsx("p", { children: actions.error || message }), /* @__PURE__ */ jsx(Button$1, {
34692
+ disabled: disabled || actions.busy,
34693
+ size: "sm",
34694
+ type: "button",
34695
+ onClick: () => void actions.recheck(),
34696
+ children: t(stale ? "workflow.refresh" : "workflow.recheck")
34697
+ })]
34698
+ })
34699
+ });
34700
+ }
34701
+ function WorkflowSection({ task, disabled, actions, list }) {
34702
+ const t = useTranslate();
34703
+ const id = useId();
34704
+ const [container, setContainer] = useState(null);
34705
+ const [loading, setLoading] = useState(false);
34706
+ const [open, setOpen] = useState(false);
34707
+ const [query, setQuery] = useState("");
34708
+ const [error, setError] = useState();
34709
+ const [choices, setChoices] = useState([]);
34710
+ const request = useRef();
34711
+ useEffect(() => () => request.current?.abort(), []);
34712
+ const target = actions.pending?.flowId ?? (task.executor.kind == "workflow" ? task.executor.flowId : "");
34713
+ const selectedName = actions.pending?.name ?? choices.find((item) => item.flowId == target)?.name ?? task.name;
34714
+ const targetError = error || (!target ? t("diagnostics.messages.workflow.target-required") : void 0);
34715
+ const visible = choices.filter((item) => `${item.name} ${item.flowId}`.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()));
34716
+ async function readChoices() {
34717
+ request.current?.abort();
34718
+ const controller = new AbortController();
34719
+ request.current = controller;
34720
+ setLoading(true);
34721
+ setError(void 0);
34722
+ try {
34723
+ const result = await list(controller.signal);
34724
+ if (!controller.signal.aborted) setChoices(result);
34725
+ } catch (cause) {
34726
+ if (!controller.signal.aborted) setError(errorNotice(cause, t).message);
34727
+ } finally {
34728
+ if (!controller.signal.aborted) setLoading(false);
34729
+ }
34730
+ }
34731
+ return /* @__PURE__ */ jsxs(Field, {
34732
+ className: "inspector-field-section",
34733
+ "data-inspector-section": "task",
34734
+ children: [/* @__PURE__ */ jsxs(FieldLabel, {
34735
+ className: "inspector-section-title justify-between",
34736
+ htmlFor: id,
34737
+ children: [/* @__PURE__ */ jsx("span", { children: t("workflow.target") }), /* @__PURE__ */ jsx(OpenWorkflowLink, { flowId: target })]
34738
+ }), /* @__PURE__ */ jsx("div", {
34739
+ ref: setContainer,
34740
+ className: "node-settings",
34741
+ children: /* @__PURE__ */ jsxs(ComboboxRoot, {
34742
+ disabled: disabled || actions.busy,
34743
+ value: target || null,
34744
+ items: visible.map((item) => item.flowId),
34745
+ filter: null,
34746
+ inputValue: open ? query : target ? selectedName : "",
34747
+ onInputValueChange: setQuery,
34748
+ onValueChange: (value) => {
34749
+ const candidate = choices.find((item) => item.flowId == value);
34750
+ if (candidate != null) actions.select(candidate);
34751
+ },
34752
+ open,
34753
+ onOpenChange: (nextOpen) => {
34754
+ setOpen(nextOpen);
34755
+ setQuery("");
34756
+ if (nextOpen) readChoices();
34757
+ },
34758
+ children: [/* @__PURE__ */ jsx(ValueEditorFeedback, {
34759
+ error: open ? void 0 : targetError,
34760
+ children: (errorId) => /* @__PURE__ */ jsxs(ComboboxInputGroup, {
34761
+ render: /* @__PURE__ */ jsx(InputGroup, {}),
34762
+ children: [
34763
+ target && /* @__PURE__ */ jsx(InputGroupAddon, {
34764
+ align: "inline-start",
34765
+ children: /* @__PURE__ */ jsx("i", {
34766
+ "aria-hidden": "true",
34767
+ className: "i-lucide-light:workflow shrink-0 text-sm"
34768
+ })
34769
+ }),
34770
+ /* @__PURE__ */ jsx(ComboboxInput, {
34771
+ render: /* @__PURE__ */ jsx(InputGroupInput, {}),
34772
+ id,
34773
+ "aria-label": t("workflow.target"),
34774
+ placeholder: t(open ? "workflow.search" : "workflow.select"),
34775
+ "aria-invalid": !!targetError || void 0,
34776
+ "aria-describedby": errorId,
34777
+ "data-field-prompt": !target || void 0
34778
+ }),
34779
+ /* @__PURE__ */ jsx(InputGroupAddon, {
34780
+ align: "inline-end",
34781
+ children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
34782
+ render: /* @__PURE__ */ jsx(ComboboxTrigger, {
34783
+ render: /* @__PURE__ */ jsx(Button$1, {
34784
+ variant: "ghost",
34785
+ size: "icon-xs"
34786
+ }),
34787
+ "aria-label": t("workflow.select")
34788
+ }),
34789
+ children: /* @__PURE__ */ jsx(SelectChevron, {})
34790
+ }), /* @__PURE__ */ jsx(TooltipContent, {
34791
+ container,
34792
+ children: t("workflow.select")
34793
+ })] })
34794
+ })
34795
+ ]
34796
+ })
34797
+ }), /* @__PURE__ */ jsx(ComboboxPortal, {
34798
+ container,
34799
+ className: "contents",
34800
+ children: /* @__PURE__ */ jsx(ComboboxPositioner, {
34801
+ align: "start",
34802
+ sideOffset: 4,
34803
+ className: "isolate z-50",
34804
+ children: /* @__PURE__ */ jsx(ComboboxPopup, {
34805
+ className: `w-(--anchor-width) min-w-56 max-w-[calc(100vw-24px)] bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-none ${selectionMenuContentClass}`,
34806
+ children: /* @__PURE__ */ jsxs(ComboboxList, {
34807
+ "aria-label": t("workflow.target"),
34808
+ className: "max-h-[min(50vh,360px,calc(var(--available-height)-0.5rem))] overflow-y-auto overscroll-contain",
34809
+ children: [
34810
+ [
34811
+ "published",
34812
+ "missingStart",
34813
+ "other"
34814
+ ].map((group) => {
34815
+ const items = visible.filter((item) => workflowCandidateGroup(item) == group);
34816
+ if (!items.length && group != "published") return null;
34817
+ return /* @__PURE__ */ jsxs(ComboboxGroup, { children: [
34818
+ /* @__PURE__ */ jsxs(ComboboxGroupLabel, {
34819
+ className: "flex items-center gap-2 px-2 py-1.5 text-xs text-muted-foreground",
34820
+ children: [/* @__PURE__ */ jsx("span", {
34821
+ "aria-hidden": "true",
34822
+ className: `status-dot ${group == "published" ? "success" : group == "missingStart" ? "warning" : "neutral"}`
34823
+ }), t(`workflow.groups.${group}`)]
34824
+ }),
34825
+ !items.length && !loading && !error && /* @__PURE__ */ jsx("div", {
34826
+ className: `pr-2 pl-6 text-muted-foreground mt-1 first-of-type:mt-0 min-h-7 rounded-[var(--ui-control-radius,var(--ui-radius))] py-1 text-xs leading-5 font-normal`,
34827
+ children: t(query ? "workflow.noMatches" : "workflow.empty")
34828
+ }),
34829
+ items.map((item) => /* @__PURE__ */ jsxs(ComboboxItem, {
34830
+ value: item.flowId,
34831
+ className: `flex cursor-default items-center gap-2 pr-2 pl-6 data-highlighted:bg-accent ${selectionMenuItemClass}`,
34832
+ children: [
34833
+ /* @__PURE__ */ jsx("i", {
34834
+ "aria-hidden": "true",
34835
+ className: "i-lucide-light:workflow shrink-0 text-sm"
34836
+ }),
34837
+ /* @__PURE__ */ jsx("span", {
34838
+ className: "min-w-0 flex-1 truncate",
34839
+ children: item.name
34840
+ }),
34841
+ /* @__PURE__ */ jsx(ComboboxItemIndicator, { children: /* @__PURE__ */ jsx("i", {
34842
+ "aria-hidden": "true",
34843
+ className: "i-lucide-light:check shrink-0 text-sm"
34844
+ }) })
34845
+ ]
34846
+ }, item.flowId))
34847
+ ] }, group);
34848
+ }),
34849
+ loading && /* @__PURE__ */ jsx("p", {
34850
+ role: "status",
34851
+ className: "px-2 py-2 text-xs text-muted-foreground",
34852
+ children: t("workflow.loading")
34853
+ }),
34854
+ error && /* @__PURE__ */ jsxs("div", {
34855
+ role: "alert",
34856
+ className: "flex items-center gap-2 px-2 py-2 text-xs",
34857
+ children: [/* @__PURE__ */ jsx("span", {
34858
+ className: "min-w-0 flex-1",
34859
+ children: error
34860
+ }), /* @__PURE__ */ jsx(Button$1, {
34861
+ variant: "outline",
34862
+ size: "xs",
34863
+ onClick: () => void readChoices(),
34864
+ children: t("workflow.retry")
34865
+ })]
34866
+ })
34867
+ ]
34868
+ })
34869
+ })
34870
+ })
34871
+ })]
34872
+ })
34873
+ })]
34874
+ });
34875
+ }
34876
+ //#endregion
34492
34877
  //#region src/workbench/browser/runtime/editor/nodeInspector.tsx
34493
34878
  function inspectorIcon(node) {
34494
34879
  if (node?.kind == "trigger") return "trigger";
@@ -34496,8 +34881,10 @@ function inspectorIcon(node) {
34496
34881
  if (node?.kind == "value") return "value";
34497
34882
  if (node?.kind == "approval") return "check";
34498
34883
  if (node?.kind == "wait") return "wait";
34884
+ if (node?.kind == "outputs") return "outputs";
34499
34885
  if (node?.kind == "task" && node.definition != null && "executor" in node.definition) {
34500
34886
  if (node.definition.executor.kind == "decision") return "decision";
34887
+ if (node.definition.executor.kind == "workflow") return "flow";
34501
34888
  if (node.definition.executor.kind == "openapi") return "task";
34502
34889
  return node.definition.executor.kind == "connector" ? "connection" : "llm";
34503
34890
  }
@@ -34506,6 +34893,7 @@ function inspectorIcon(node) {
34506
34893
  function nodePurposePlaceholder(selection, t, action, displays) {
34507
34894
  switch (selection.kind) {
34508
34895
  case "condition": return t("addNode.conditionDescription");
34896
+ case "outputs": return t("addNode.outputsDescription");
34509
34897
  case "value": return t("addNode.valueDescription");
34510
34898
  case "approval": return t("addNode.approvalDescription");
34511
34899
  case "wait": return t("addNode.waitDescription");
@@ -34513,6 +34901,7 @@ function nodePurposePlaceholder(selection, t, action, displays) {
34513
34901
  const node = selection.node;
34514
34902
  switch (node.kind) {
34515
34903
  case "manual": return t("addNode.manualDescription");
34904
+ case "start": return t("addNode.startDescription");
34516
34905
  case "error": return t("errorWorkflow.description");
34517
34906
  case "cron": return t("addNode.cronDescription");
34518
34907
  case "webhook": return t("addNode.webhookDescription");
@@ -34527,6 +34916,7 @@ function nodePurposePlaceholder(selection, t, action, displays) {
34527
34916
  switch (definition.executor.kind) {
34528
34917
  case "agent": return t("addNode.agentDescription");
34529
34918
  case "decision": return t("decision.description");
34919
+ case "workflow": return t("workflow.description");
34530
34920
  case "openapi": return t("openapi.description");
34531
34921
  case "connector": return action?.description;
34532
34922
  case "llm": return t(definition.executor.mode == "json" ? "addNode.llmStructuredDescription" : "addNode.llmChatDescription");
@@ -34536,7 +34926,7 @@ function nodePurposePlaceholder(selection, t, action, displays) {
34536
34926
  }
34537
34927
  function inputUpstreamSources({ revision, sourceNodeIcons, selection, store, handleName, t, triggerDisplays }) {
34538
34928
  const graph = revision.graph();
34539
- const mapping = nodeInputMappings(selection.node)[handleName];
34929
+ const mapping = revision.inputMappings(selection.node)[handleName];
34540
34930
  const sources = mapping?.kind == "sources" ? mapping.sources.filter((source) => source.kind == "node") : [];
34541
34931
  const providerDisplay = (node) => node?.kind == "integration" || node?.kind == "poll" ? triggerDisplays?.[node.definition.key] : void 0;
34542
34932
  return {
@@ -34585,10 +34975,26 @@ function NodeInspector({ webhookDeployment, variables = {
34585
34975
  const isAgent = task != null && "executor" in task && task.executor.kind == "agent";
34586
34976
  const isDecision = task != null && "executor" in task && task.executor.kind == "decision";
34587
34977
  const isOpenApi = task != null && "executor" in task && task.executor.kind == "openapi";
34978
+ const unconfiguredWorkflow = task != null && "executor" in task && task.executor.kind == "workflow" && !task.executor.flowId;
34588
34979
  const unconfiguredOpenApi = task != null && "executor" in task && task.executor.kind == "openapi" && !task.executor.path;
34589
34980
  const isLlm = task != null && "executor" in task && task.executor.kind == "llm";
34590
34981
  const connector = task != null && "executor" in task && task.executor.kind == "connector" ? task.executor : void 0;
34591
34982
  const nodeId = selection?.kind == "task" ? selection.id : void 0;
34983
+ const workflowSettings = task != null && "executor" in task && task.executor.kind == "workflow" && selection != null ? {
34984
+ task,
34985
+ nodeId: selection.id,
34986
+ onCheck: () => store?.check() ?? Promise.resolve(),
34987
+ disabled: disabled || readOnly,
34988
+ load: (flowId, signal) => store.loadWorkflowContract(flowId, signal),
34989
+ onSave: (before, value) => store?.saveTaskSettings(selection.id, {
34990
+ kind: "workflow",
34991
+ name: value.name,
34992
+ before,
34993
+ task: value
34994
+ }) ?? Promise.resolve(false)
34995
+ } : void 0;
34996
+ const workflowActions = useWorkflowActions(workflowSettings);
34997
+ const workflowIssue = diagnostics?.find((issue) => issue.code.startsWith("workflow.") && issue.code != "workflow.target-required");
34592
34998
  const locatedRequest = useRef();
34593
34999
  useEffect(() => {
34594
35000
  if (focus == null) return;
@@ -34653,6 +35059,13 @@ function NodeInspector({ webhookDeployment, variables = {
34653
35059
  loading: connectorLoading,
34654
35060
  nodeId
34655
35061
  }),
35062
+ !readOnly && workflowSettings != null && (workflowIssue != null || workflowActions.error != null) && /* @__PURE__ */ jsx(WorkflowInterfaceAlert, {
35063
+ flowId: workflowSettings.task.executor.kind == "workflow" ? workflowSettings.task.executor.flowId : "",
35064
+ actions: workflowActions,
35065
+ disabled,
35066
+ stale: workflowIssue?.code == "workflow.revision-stale" || workflowIssue?.code == "workflow.snapshot-missing",
35067
+ message: workflowIssue == null ? void 0 : diagnosticMessage(workflowIssue, t)
35068
+ }, `workflow-alert:${selection?.id}`),
34656
35069
  selection != null && /* @__PURE__ */ jsx(NodeDescription, {
34657
35070
  value: selection.node.description,
34658
35071
  placeholder: nodePurposePlaceholder(selection, t, connectorAction, triggerDisplays),
@@ -34721,7 +35134,22 @@ function NodeInspector({ webhookDeployment, variables = {
34721
35134
  value: selection.trigger.sourceFlowIds ?? [],
34722
35135
  disabled
34723
35136
  }) }),
34724
- selection?.kind === "trigger" && selection.trigger.kind !== "webhook" && /* @__PURE__ */ jsx(TriggerSummary, {
35137
+ selection?.kind === "trigger" && selection.trigger.kind === "start" && /* @__PURE__ */ jsx("section", {
35138
+ className: "inspector-port-section",
35139
+ "data-inspector-section": "outputs",
35140
+ children: /* @__PURE__ */ jsx(PortDefinitionEditor, {
35141
+ layout: "ports",
35142
+ title: t("inspector.ports.startParametersTitle"),
35143
+ output: true,
35144
+ readOnly,
35145
+ disabled,
35146
+ values: selection.trigger.inputDefs,
35147
+ onChange: (parameters, deletion) => {
35148
+ store?.saveStartInputDefs(selection.id, parameters, deletion);
35149
+ }
35150
+ })
35151
+ }),
35152
+ selection?.kind === "trigger" && selection.trigger.kind !== "webhook" && selection.trigger.kind !== "start" && /* @__PURE__ */ jsx(TriggerSummary, {
34725
35153
  trigger: selection.trigger,
34726
35154
  display: selection.trigger.kind == "integration" || selection.trigger.kind == "poll" ? triggerDisplays?.[selection.trigger.definition.key] : void 0
34727
35155
  }),
@@ -34754,10 +35182,15 @@ function NodeInspector({ webhookDeployment, variables = {
34754
35182
  task: value
34755
35183
  }, deletion) ?? Promise.resolve(false)
34756
35184
  }, `decision:${selection.id}`),
35185
+ workflowSettings != null && /* @__PURE__ */ jsx(WorkflowSection, {
35186
+ ...workflowSettings,
35187
+ actions: workflowActions,
35188
+ list: (signal) => store.listWorkflowTargets(signal)
35189
+ }, `workflow:${selection?.id}`),
34757
35190
  isOpenApi && task != null && "executor" in task && /* @__PURE__ */ jsx(OpenApiSection, {
34758
35191
  task,
34759
35192
  credentials: (onInvalidChange) => selection?.kind === "task" && task.inputs.filter((port) => "handle" in port && port.handle.startsWith("auth.")).map((definition) => {
34760
- const mapping = selection.node.inputs[definition.handle];
35193
+ const mapping = revision.inputMappings(selection.node)[definition.handle];
34761
35194
  const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
34762
35195
  const binding = source?.kind === "binding" ? revision.binding(source.bindingId) : void 0;
34763
35196
  return /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: definition.handle.slice(5).replace(/^manual\./, "").replaceAll(".", " · ") }), /* @__PURE__ */ jsx(NodeInputValue, {
@@ -34802,10 +35235,10 @@ function NodeInspector({ webhookDeployment, variables = {
34802
35235
  task: value
34803
35236
  }) ?? Promise.resolve(false)
34804
35237
  }, `openapi:${selection?.id}`),
34805
- !unconfiguredOpenApi && (selection?.kind === "approval" || selection?.kind === "wait" || selection?.kind === "task") && (() => {
34806
- const definitions = selection.kind === "task" ? [...selection.definition?.inputs ?? []] : [...selection.node.inputDefinitions];
35238
+ !unconfiguredOpenApi && !unconfiguredWorkflow && (selection?.kind === "outputs" || selection?.kind === "approval" || selection?.kind === "wait" || selection?.kind === "task") && (() => {
35239
+ const definitions = selection.kind === "outputs" ? [...selection.node.outputDefs] : selection.kind === "task" ? [...selection.definition?.inputs ?? []] : [...selection.node.inputDefinitions];
34807
35240
  const handles = new Set(definitions.flatMap((definition) => "handle" in definition ? [definition.handle] : []));
34808
- for (const handle of Object.keys(selection.node.inputs)) if (!handles.has(handle) && !(selection.kind === "task" && selection.node.additionalInputs?.some((port) => port.handle === handle))) definitions.push({
35241
+ for (const handle of Object.keys(revision.inputMappings(selection.node))) if (!handles.has(handle) && !(selection.kind === "task" && selection.node.additionalInputs?.some((port) => port.handle === handle))) definitions.push({
34809
35242
  handle,
34810
35243
  jsonSchema: {},
34811
35244
  nullable: true
@@ -34816,7 +35249,7 @@ function NodeInspector({ webhookDeployment, variables = {
34816
35249
  ...definition,
34817
35250
  description: t("decision.targetDescription")
34818
35251
  };
34819
- const mapping = selection.node.inputs[definition.handle];
35252
+ const mapping = revision.inputMappings(selection.node)[definition.handle];
34820
35253
  const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
34821
35254
  const binding = source?.kind === "binding" ? revision.binding(source.bindingId) : void 0;
34822
35255
  return {
@@ -34838,8 +35271,9 @@ function NodeInspector({ webhookDeployment, variables = {
34838
35271
  });
34839
35272
  const fields = /* @__PURE__ */ jsx(NodeInputs, {
34840
35273
  readOnly,
34841
- allowAddGroup: selection.kind !== "wait" && selection.kind !== "approval",
34842
- title: t("inspector.ports.inputsTitle"),
35274
+ allowAddGroup: selection.kind === "task",
35275
+ title: t(selection.kind === "outputs" ? "inspector.ports.outputsTitle" : "inspector.ports.inputsTitle"),
35276
+ titleIcon: selection.kind === "outputs" ? "output" : "input",
34843
35277
  entries,
34844
35278
  fieldLabels: connector?.action == "leina.send_notification" ? {
34845
35279
  leinaId: t("leina.robot"),
@@ -34848,7 +35282,9 @@ function NodeInspector({ webhookDeployment, variables = {
34848
35282
  onReset: () => {
34849
35283
  return store?.resetInputs(selection.id, entries.flatMap((entry) => "group" in entry ? [] : [entry.definition.handle]));
34850
35284
  },
34851
- onDefinitions: selection.kind === "task" && selection.definition != null && ("moduleId" in selection.node.task || isAgent) ? (inputs, deletion, values) => {
35285
+ onDefinitions: selection.kind === "outputs" ? (outputDefinitions, deletion, values) => {
35286
+ store?.saveOutputsDefs(selection.id, outputDefinitions.filter((port) => "handle" in port), deletion, values);
35287
+ } : selection.kind === "task" && selection.definition != null && ("moduleId" in selection.node.task || isAgent) ? (inputs, deletion, values) => {
34852
35288
  store?.saveTaskPorts(selection.id, {
34853
35289
  inputs,
34854
35290
  outputs: selection.definition.outputs
@@ -34888,7 +35324,7 @@ function NodeInspector({ webhookDeployment, variables = {
34888
35324
  title: t("inspector.task.additionalInputs"),
34889
35325
  allowAddGroup: false,
34890
35326
  entries: (selection.node.additionalInputs ?? []).map((definition) => {
34891
- const mapping = selection.node.inputs[definition.handle];
35327
+ const mapping = revision.inputMappings(selection.node)[definition.handle];
34892
35328
  const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
34893
35329
  const binding = source?.kind === "binding" ? revision.binding(source.bindingId) : void 0;
34894
35330
  return {
@@ -34959,7 +35395,7 @@ function NodeInspector({ webhookDeployment, variables = {
34959
35395
  }
34960
35396
  })
34961
35397
  }),
34962
- !unconfiguredOpenApi && selection?.kind === "task" && selection.definition != null && /* @__PURE__ */ jsx("section", {
35398
+ !unconfiguredOpenApi && !unconfiguredWorkflow && selection?.kind === "task" && selection.definition != null && /* @__PURE__ */ jsx("section", {
34963
35399
  className: "inspector-port-section",
34964
35400
  children: /* @__PURE__ */ jsx(PortDefinitionEditor, {
34965
35401
  readOnly,
@@ -37992,6 +38428,7 @@ function createNodeEntry(node, contentKey, canvasStore) {
37992
38428
  const duplicateNode = (offset) => canvasStore.onDuplicate?.([node.id], offset);
37993
38429
  const types = {
37994
38430
  approval: NODE_TYPE.TaskNode,
38431
+ outputs: NODE_TYPE.TaskNode,
37995
38432
  condition: NODE_TYPE.ConditionNode,
37996
38433
  task: NODE_TYPE.TaskNode,
37997
38434
  trigger: NODE_TYPE.TriggerNode,
@@ -38003,7 +38440,7 @@ function createNodeEntry(node, contentKey, canvasStore) {
38003
38440
  onIgnore: (ignored) => canvasStore.ignoreNodes([node.id], ignored),
38004
38441
  content$,
38005
38442
  position: node.position,
38006
- duplicateNode: node.kind === "trigger" && node.presentation?.kind === "manual" ? void 0 : duplicateNode
38443
+ duplicateNode: node.kind === "outputs" || node.kind === "trigger" && (node.presentation?.kind === "manual" || node.presentation?.kind === "start") ? void 0 : duplicateNode
38007
38444
  });
38008
38445
  return {
38009
38446
  contentKey,
@@ -50726,7 +51163,7 @@ function CanvasNode({ nodeStore, problem, branches, compact = false, compactCont
50726
51163
  const title = node.title;
50727
51164
  const { values, summary, schedules, images, inline, hidden } = nodeCardContent(node);
50728
51165
  const kind = node?.kind ?? "task";
50729
- const triggerSource = node.kind == "trigger" ? node.presentation?.kind == "error" || node.presentation?.kind == "manual" || node.presentation?.kind == "cron" || node.presentation?.kind == "webhook" ? t(`canvasCard.triggerSource.${node.presentation.kind}`) : node.presentation?.source : void 0;
51166
+ const triggerSource = node.kind == "trigger" ? node.presentation?.kind == "error" || node.presentation?.kind == "manual" || node.presentation?.kind == "start" || node.presentation?.kind == "cron" || node.presentation?.kind == "webhook" ? t(`canvasCard.triggerSource.${node.presentation.kind}`) : node.presentation?.source : void 0;
50730
51167
  const subtitle = inline ? summary : node.kind == "task" ? node.executorName || t("canvasCard.kind.task") : node.kind == "trigger" && triggerSource ? `${t("canvasCard.kind.trigger")} · ${triggerSource}` : t(`canvasCard.kind.${kind}`);
50731
51168
  const runContent = node?.run == null || node.run.status == "idle" ? void 0 : /* @__PURE__ */ jsx(RunChips, { run: node.run });
50732
51169
  return /* @__PURE__ */ jsx("div", {
@@ -51833,7 +52270,7 @@ var NodeLayout = /* @__PURE__ */ memo(({ canvasStore, nodeStore, visible }) => {
51833
52270
  isConnectable: editable,
51834
52271
  hintRequested
51835
52272
  }),
51836
- nodeStore.nodeType != NODE_TYPE.CommentNode && branches == null && /* @__PURE__ */ jsx(ExecutionHandle, {
52273
+ nodeStore.nodeType != NODE_TYPE.CommentNode && modelNode?.kind != "outputs" && branches == null && /* @__PURE__ */ jsx(ExecutionHandle, {
51837
52274
  id: toRFHandleName("$out"),
51838
52275
  type: "output",
51839
52276
  isConnectable: editable,
@@ -53813,7 +54250,7 @@ var WorkbenchCanvas = forwardRef(function WorkbenchCanvas({ nodePicker, annotati
53813
54250
  screenPosition: screenPosition(canvasPosition)
53814
54251
  });
53815
54252
  };
53816
- const manualTrigger = staticOptions.get("trigger:manual");
54253
+ const startTrigger = staticOptions.get("trigger:start");
53817
54254
  const needsTrigger = !model.nodes.some((node) => node.kind == "trigger");
53818
54255
  const addRecommended = async (option) => {
53819
54256
  if (addingRecommended.current) return;
@@ -53897,7 +54334,7 @@ var WorkbenchCanvas = forwardRef(function WorkbenchCanvas({ nodePicker, annotati
53897
54334
  disabled,
53898
54335
  onOpenNodePicker: openAddNode,
53899
54336
  runControl,
53900
- onAddTrigger: needsTrigger && model.nodes.length > 0 && manualTrigger != null ? () => void addRecommended(manualTrigger) : void 0
54337
+ onAddTrigger: needsTrigger && model.nodes.length > 0 && startTrigger != null ? () => void addRecommended(startTrigger) : void 0
53901
54338
  }),
53902
54339
  onAddNode: async (itemId, position, connection) => {
53903
54340
  const dragged = draggedNode.current.consume(itemId);
@@ -54843,52 +55280,6 @@ function PublicationsView({ store, onClose, theme = "light" }) {
54843
55280
  });
54844
55281
  }
54845
55282
  //#endregion
54846
- //#region src/workbench/browser/runtime/runs/errorHandling.tsx
54847
- var RunLinkContext = createContext(void 0);
54848
- function ErrorHandling({ run }) {
54849
- const t = useTranslate();
54850
- const hrefFor = useContext(RunLinkContext);
54851
- if (run == null || !("waits" in run) || run.errorSource == null && run.errorDispatches == null) return null;
54852
- const link = (flowId, runId, label) => hrefFor == null ? /* @__PURE__ */ jsxs("span", { children: [
54853
- label,
54854
- ": ",
54855
- runId
54856
- ] }) : /* @__PURE__ */ jsx("a", {
54857
- className: "text-foreground underline underline-offset-2 hover:text-muted-foreground",
54858
- href: hrefFor({
54859
- flowId,
54860
- runId,
54861
- view: "runs"
54862
- }),
54863
- children: label
54864
- });
54865
- return /* @__PURE__ */ jsxs("div", {
54866
- className: "flex flex-col gap-1 px-4 py-2 text-sm",
54867
- role: "status",
54868
- children: [run.errorSource != null && link(run.errorSource.flowId, run.errorSource.runId, t("errorWorkflow.source")), run.errorDispatches?.map((dispatch) => /* @__PURE__ */ jsxs("div", { children: [
54869
- dispatch.status == "pending" && /* @__PURE__ */ jsxs("span", {
54870
- className: "text-muted-foreground",
54871
- children: [
54872
- t("errorWorkflow.pending"),
54873
- ": ",
54874
- dispatch.flowId
54875
- ]
54876
- }),
54877
- dispatch.status == "dispatched" && link(dispatch.flowId, dispatch.runId, `${t("errorWorkflow.dispatched")}: ${dispatch.flowId}`),
54878
- dispatch.status == "failed" && /* @__PURE__ */ jsxs("span", {
54879
- className: "text-destructive",
54880
- children: [
54881
- t("errorWorkflow.failed"),
54882
- " (",
54883
- dispatch.flowId,
54884
- "): ",
54885
- dispatch.message
54886
- ]
54887
- })
54888
- ] }, dispatch.flowId))]
54889
- });
54890
- }
54891
- //#endregion
54892
55283
  //#region src/workbench/browser/runtime/runs/runControl.tsx
54893
55284
  function RunControl({ disabled, inputContent, inputOpen, inputStatus, onInputOpenChange, onRun, onSelectTrigger, selectedTriggerId, starting, title, triggers }) {
54894
55285
  const t = useTranslate();
@@ -55083,6 +55474,51 @@ function AlertDescription({ className, ...props }) {
55083
55474
  });
55084
55475
  }
55085
55476
  //#endregion
55477
+ //#region src/workbench/browser/runtime/runs/errorHandling.tsx
55478
+ function ErrorHandling({ run }) {
55479
+ const t = useTranslate();
55480
+ const hrefFor = useContext(WorkbenchLinkContext);
55481
+ if (run == null || !("waits" in run) || run.errorSource == null && run.errorDispatches == null) return null;
55482
+ const link = (flowId, runId, label) => hrefFor == null ? /* @__PURE__ */ jsxs("span", { children: [
55483
+ label,
55484
+ ": ",
55485
+ runId
55486
+ ] }) : /* @__PURE__ */ jsx("a", {
55487
+ className: "text-foreground underline underline-offset-2 hover:text-muted-foreground",
55488
+ href: hrefFor({
55489
+ flowId,
55490
+ runId,
55491
+ view: "runs"
55492
+ }),
55493
+ children: label
55494
+ });
55495
+ return /* @__PURE__ */ jsxs("div", {
55496
+ className: "flex flex-col gap-1 px-4 py-2 text-sm",
55497
+ role: "status",
55498
+ children: [run.errorSource != null && link(run.errorSource.flowId, run.errorSource.runId, t("errorWorkflow.source")), run.errorDispatches?.map((dispatch) => /* @__PURE__ */ jsxs("div", { children: [
55499
+ dispatch.status == "pending" && /* @__PURE__ */ jsxs("span", {
55500
+ className: "text-muted-foreground",
55501
+ children: [
55502
+ t("errorWorkflow.pending"),
55503
+ ": ",
55504
+ dispatch.flowId
55505
+ ]
55506
+ }),
55507
+ dispatch.status == "dispatched" && link(dispatch.flowId, dispatch.runId, `${t("errorWorkflow.dispatched")}: ${dispatch.flowId}`),
55508
+ dispatch.status == "failed" && /* @__PURE__ */ jsxs("span", {
55509
+ className: "text-destructive",
55510
+ children: [
55511
+ t("errorWorkflow.failed"),
55512
+ " (",
55513
+ dispatch.flowId,
55514
+ "): ",
55515
+ dispatch.message
55516
+ ]
55517
+ })
55518
+ ] }, dispatch.flowId))]
55519
+ });
55520
+ }
55521
+ //#endregion
55086
55522
  //#region src/workbench/browser/runtime/runs/runGroups.ts
55087
55523
  function groupEvents(events) {
55088
55524
  const groups = [];
@@ -55729,6 +56165,48 @@ function RunResults({ client, runId, results }) {
55729
56165
  });
55730
56166
  }
55731
56167
  //#endregion
56168
+ //#region src/workbench/browser/runtime/runs/workflowCalls.tsx
56169
+ function WorkflowCalls({ run }) {
56170
+ const t = useTranslate();
56171
+ const hrefFor = useContext(WorkbenchLinkContext);
56172
+ if (!("waits" in run)) return null;
56173
+ const link = (flowId, runId, label) => hrefFor == null ? /* @__PURE__ */ jsxs("span", { children: [
56174
+ label,
56175
+ ": ",
56176
+ runId
56177
+ ] }) : /* @__PURE__ */ jsx("a", {
56178
+ className: "text-foreground underline underline-offset-2 hover:text-muted-foreground",
56179
+ href: hrefFor({
56180
+ flowId,
56181
+ runId,
56182
+ view: "runs"
56183
+ }),
56184
+ children: label
56185
+ });
56186
+ return /* @__PURE__ */ jsxs("div", {
56187
+ className: "flex flex-col gap-2 px-4 py-2 text-sm",
56188
+ children: [run.caller != null && /* @__PURE__ */ jsxs("div", { children: [
56189
+ link(run.caller.flowId, run.caller.runId, t("workflow.parent")),
56190
+ " · ",
56191
+ run.caller.nodeId
56192
+ ] }), run.calls?.map((call) => /* @__PURE__ */ jsxs("div", {
56193
+ className: "flex flex-wrap items-center gap-2",
56194
+ children: [
56195
+ /* @__PURE__ */ jsxs("span", { children: [
56196
+ call.nodeId,
56197
+ " → ",
56198
+ call.flowId
56199
+ ] }),
56200
+ /* @__PURE__ */ jsx("span", {
56201
+ className: "text-muted-foreground",
56202
+ children: call.status == null ? t("workflow.unavailable") : runLabel({ status: call.status }, t)
56203
+ }),
56204
+ link(call.flowId, call.runId, t("workflow.viewRun"))
56205
+ ]
56206
+ }, call.executionId))]
56207
+ });
56208
+ }
56209
+ //#endregion
55732
56210
  //#region src/workbench/browser/runtime/runs/runDrawer.tsx
55733
56211
  var RunVirtualItem = forwardRef(function RunVirtualItem({ index, ...props }, ref) {
55734
56212
  return /* @__PURE__ */ jsx("div", {
@@ -56524,6 +57002,7 @@ function RunDrawer({ resultClient, cancelDisabled, canceling, events, eventsExpi
56524
57002
  className: "run-content",
56525
57003
  children: [
56526
57004
  /* @__PURE__ */ jsx(ErrorHandling, { run }),
57005
+ run != null && /* @__PURE__ */ jsx(WorkflowCalls, { run }),
56527
57006
  run != null && /* @__PURE__ */ jsx(ActiveWait, {
56528
57007
  onLocate: onLocateWait,
56529
57008
  onResolve,
@@ -56692,7 +57171,7 @@ function Form({ onStarted, request, store, theme }) {
56692
57171
  }),
56693
57172
  request.editor && /* @__PURE__ */ jsxs("section", {
56694
57173
  className: "run-input-group",
56695
- children: [/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx("strong", { children: t("inspector.ports.outputsTitle") }) }), /* @__PURE__ */ jsx(FlowRunInputEditor, {
57174
+ children: [/* @__PURE__ */ jsxs("header", { children: [/* @__PURE__ */ jsx("strong", { children: t(request.editor.allowOmittedNullable ? "inspector.ports.startParametersTitle" : "inspector.ports.outputsTitle") }), request.editor.allowOmittedNullable && /* @__PURE__ */ jsx("p", { children: t("runInput.startParametersHint") })] }), /* @__PURE__ */ jsx(FlowRunInputEditor, {
56696
57175
  store: request.editor,
56697
57176
  theme,
56698
57177
  showErrors: request.attempted
@@ -57381,6 +57860,7 @@ function RunsView({ flowName, onClose, onConfigureConnector, onLocateEvent, onLo
57381
57860
  ]
57382
57861
  }),
57383
57862
  /* @__PURE__ */ jsx(ErrorHandling, { run }),
57863
+ /* @__PURE__ */ jsx(WorkflowCalls, { run }),
57384
57864
  /* @__PURE__ */ jsx(ActiveWait, {
57385
57865
  onLocate: onLocateWait,
57386
57866
  onResolve: (waitId, action, comment) => void store.runs.resolve(waitId, action, comment),
@@ -58065,10 +58545,10 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
58065
58545
  const checkLoading = useVal(store.workspace.$.checkLoading);
58066
58546
  const history = useVal(store.workspace.history$);
58067
58547
  const designer = useVal(store.$.designer);
58548
+ const draft = useVal(store.workspace.$.draft);
58068
58549
  const triggers = designer.nodes.filter((node) => node.kind == "trigger");
58069
- const selectedTrigger = triggers.find((node) => node.id == startId) ?? triggers[0];
58550
+ const selectedTrigger = triggers.find((node) => node.id == startId) ?? triggers.find((node) => node.presentation?.kind == "start") ?? triggers[0];
58070
58551
  const diagnosticFocus = useVal(store.workspace.$.diagnosticFocus);
58071
- const draft = useVal(store.workspace.$.draft);
58072
58552
  const live = useVal(store.workspace.$.live);
58073
58553
  const nodeFocus = useVal(store.workspace.$.nodeFocus);
58074
58554
  const flowId = useVal(store.workspace.$.flowId);
@@ -58323,7 +58803,7 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
58323
58803
  } : void 0,
58324
58804
  nodeId: singleSelected ? selectedDesignerNode?.id : void 0,
58325
58805
  nodeHeading: singleSelected && selection != null ? {
58326
- titleReadOnly: selection.kind === "trigger" && selection.trigger.kind === "manual",
58806
+ titleReadOnly: selection.kind === "trigger" && (selection.trigger.kind === "manual" || selection.trigger.kind === "start"),
58327
58807
  title: selection.node.name ?? selectedDesignerNode?.title ?? "",
58328
58808
  icon: selectedDesignerNode != null && "icon" in selectedDesignerNode ? selectedDesignerNode.icon : void 0,
58329
58809
  disabled: authoringDisabled,
@@ -58443,11 +58923,7 @@ function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConn
58443
58923
  store,
58444
58924
  view
58445
58925
  ]);
58446
- useEffect(() => store.runRequests.dismissInputs(), [
58447
- draft?.revisionId,
58448
- flowId,
58449
- store
58450
- ]);
58926
+ useEffect(() => store.runRequests.dismissInputs(), [flowId, store]);
58451
58927
  useEffect(() => {
58452
58928
  if (submitting == null || !draftReady) return;
58453
58929
  navigation.open("design");
@@ -58483,7 +58959,7 @@ function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConn
58483
58959
  flowsHref: hrefFor({ view: "design" }),
58484
58960
  onOpenFlows: () => void navigation.openFlows()
58485
58961
  });
58486
- return /* @__PURE__ */ jsx(IconifyProvider, { children: /* @__PURE__ */ jsx(RunLinkContext.Provider, {
58962
+ return /* @__PURE__ */ jsx(IconifyProvider, { children: /* @__PURE__ */ jsx(WorkbenchLinkContext.Provider, {
58487
58963
  value: hrefFor,
58488
58964
  children: /* @__PURE__ */ jsxs("main", {
58489
58965
  className: "workspace",