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

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 (54) hide show
  1. package/dist/browser/{createResourceDialog-BAJXbzNH.js → createResourceDialog-BQVD8Rqb.js} +2 -2
  2. package/dist/browser/{icons-Db2Jb2iX.js → dialog-CS2Vt2if.js} +5736 -5621
  3. package/dist/browser/event-sources.d.ts +4 -1
  4. package/dist/browser/flow-authoring-node.d.ts +14 -3
  5. package/dist/browser/flow-authoring.js +120 -24
  6. package/dist/browser/flow-change-schema.d.ts +3 -1
  7. package/dist/browser/flow-change.d.ts +15 -3
  8. package/dist/browser/flow-change.js +117 -21
  9. package/dist/browser/{flowChanges-DkvG5uDq.js → flowChanges-VB9Y4iy7.js} +3423 -2380
  10. package/dist/browser/{flowRunInputEditorStore-B2Rw4VsT.js → flowRunInputEditorStore-DJqmR6Qh.js} +3 -2
  11. package/dist/browser/{flowWorkspace-BEp-lxqF.js → flowWorkspace-C1hlTnZq.js} +1410 -799
  12. package/dist/browser/preview.css +273 -119
  13. package/dist/browser/preview.js +17118 -15810
  14. package/dist/browser/theme.css +1 -0
  15. package/dist/browser/ui.css +119 -7
  16. package/dist/browser/ui.js +8 -5
  17. package/dist/browser/workbench-contract.d.ts +1 -1
  18. package/dist/browser/workbench.css +282 -162
  19. package/dist/browser/workbench.d.ts +0 -1
  20. package/dist/browser/workbench.js +503 -173
  21. package/dist/browser/{workbenchSelect-C-jf6NIM.js → workbenchSelect-CpXhjUou.js} +1 -1
  22. package/dist/command/index.js +49 -49
  23. package/dist/common/authoring.d.ts +7 -5
  24. package/dist/common/authoringExamples.d.ts +4 -4
  25. package/dist/common/authoringFields.d.ts +20 -0
  26. package/dist/common/authoringSchema.d.ts +404 -15
  27. package/dist/common/control-api-conformance.js +415 -146
  28. package/dist/common/control-api.d.ts +67 -8
  29. package/dist/common/control-api.js +3587 -3443
  30. package/dist/common/control-requests.d.ts +10 -3
  31. package/dist/common/control-requests.js +425 -49
  32. package/dist/common/decision.js +33 -7
  33. package/dist/common/flow-encoding.d.ts +4 -2
  34. package/dist/common/flow-encoding.js +151 -14
  35. package/dist/common/flow-graph.d.ts +1 -1
  36. package/dist/common/flow-semantics.d.ts +12 -2
  37. package/dist/common/flow-semantics.js +157 -41
  38. package/dist/common/integration-trigger.js +33 -7
  39. package/dist/common/liveDetails.d.ts +26 -11
  40. package/dist/common/mcp.d.ts +6 -3
  41. package/dist/common/mcp.js +219 -90
  42. package/dist/common/openapi.js +33 -7
  43. package/dist/common/poll-trigger.js +33 -7
  44. package/dist/common/run-events.d.ts +2 -0
  45. package/dist/common/run-events.js +9 -3
  46. package/dist/common/scheduler.d.ts +10 -1
  47. package/dist/common/scheduler.js +172 -49
  48. package/dist/common/trigger-contract.d.ts +2 -0
  49. package/dist/common/webhook-trigger.js +33 -7
  50. package/dist/common/workflow.d.ts +93 -0
  51. package/dist/common/workflow.js +10492 -0
  52. package/package.json +5 -1
  53. package/skills/open-flow/SKILL.md +9 -0
  54. package/skills/open-flow/references/flow-authoring.md +28 -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, $n as sourceOutputLabel, $t as EmptyDescription, A as datePickerChange, Ar as controlErrorCode, Bn as ja_default$1, Bt as PopoverHeader, C as schemaForEditor, Cn as MenuItem, Cr as workflowSelectionTask, D as typeOfSchema, Dn as MenuRootContext, E as isUnconstrainedSchema, En as useContextMenuRootContext, F as indexAddNodeOptions, Fn as waitBranchDescription, Ft as IdTooltip, Gn as EventSourceSetup, Gt as ScrollArea, H as observeResource, Hn as en_default$1, Ht as PopoverTitle, I as feishuResourceKind, In as zh_TW_default$1, It as followWorkbenchLink, J as triggerNodeIcon, Jt as InputGroup, K as designerGraph, Kn as errorNotice, Kt as VirtualScrollArea, L as supportsFeishuChatFilter, Ln as zh_CN_default$1, Lt as Popover, M as isDateFormat, Mn as SourceSelect, Mr as useAriaLabelledBy, Nn as createI18n$1, Nr as IconThemeContext, O as calendarChange, On as useMenuRootContext, Pn as uiLocales, Pt as WorkflowExportMenuItem, Q as IconifyProvider, Qn as resolutionOutputPorts, Qt as EmptyContent, Rn as ru_default$1, Rt as PopoverContent, S as editorGroups, Sn as MenuPopup, Sr as workflowCandidateGroup, T as getDefaultValue, Tn as ContextMenuRootContext, U as resourceData, Un as I18n, Ut as PopoverTrigger, Vn as fr_default$1, Vt as PopoverPanelContent, W as resourceValue, Wn as FeishuEventPicker, Wt as NativeScrollArea, X as providerIcon, Xn as decodeResultList, Xt as InputGroupInput, Y as actionSummary, Yt as InputGroupAddon, Z as ContentIcon, Zt as Empty, _n as findRootOwnerId, _r as securityOptions, an as DropdownMenuContent, at as revisionView, b as defaultValueEditorSchema, bn as MenuPositioner, br as servers, cn as DropdownMenuLabel, dn as DropdownMenuSeparator, dr as triggerConfigValues, dt as diagnosticNodeId, en as EmptyHeader, et as useIconifyData, fn as DropdownMenuSub, ft as schemaMismatchMessage, gn as isElementDisabled, gr as openApiTask, hn as DropdownMenuTrigger, hr as openApiFieldIssues, in as DropdownMenuCheckboxItem, it as hasRunFilter, j as datePickerValue, jn as SourceForm, jr as Checkbox, k as calendarDate, kn as Badge, ln as DropdownMenuRadioGroup, mn as DropdownMenuSubTrigger, mr as object, mt as connectionCatalog, n as agentTool, nn as EmptyTitle, nr as triggerOutputDefinitions, on as DropdownMenuGroup, pn as DropdownMenuSubContent, pr as listOperations, q as semanticNodeIcon, qt as Z$2, rn as DropdownMenu, rr as isJsonObject, rt as canCancelRun, sn as DropdownMenuItem, tn as EmptyMedia, tt as wrapLayout, un as DropdownMenuRadioItem, ur as triggerConfigValue, ut as diagnosticMessage, vn as useCompositeItem, vr as selectOperation, w as valueForEditor, wn as MenuGroup, wr as inputValue, x as editorComponent, xn as MenuPortal, yn as MenuRoot, yr as serverAddress, z as mapSource, zn as ko_default$1, zt as PopoverDescription } from "./flowChanges-VB9Y4iy7.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, ai as itemPress, an as useDirection, at as decisionQuestionIssues, b as TooltipRoot, bi as fieldValidityMapping, bn as findItemIndex, br as findNonDisabledListIndex, c as DialogTrigger, 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 DialogDescription, 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 Icon, ln as popupStateMapping, lr as useValueAsRef, m as createTooltipHandle, mi as useFormContext, mn as hasNullItemLabel, mr as useTimeout, 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, r as DialogContent, ri as inputClear, rn as useAnchorPositioning, rr as useStore$1, rt as decisionLimits, s as DialogTitle, si as none$1, sn as inertValue, sr as require_builtin_esm_external_require_react, st as defaultDecisionQuestion, t as Dialog, 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 "./dialog-CS2Vt2if.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-CpXhjUou.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";
@@ -1474,6 +1474,473 @@ function AccountName({ name, builtIn, truncate = false }) {
1474
1474
  });
1475
1475
  }
1476
1476
  //#endregion
1477
+ //#region src/form/browser/fieldTypeDisplay.tsx
1478
+ /** Presents a fixed type, optionally using its read-only surface as a disclosure control. */
1479
+ function FieldTypeDisplay({ id, label, accessibleLabel, icon, compact = true, addon = false, surface = false, disclosure }) {
1480
+ const [container, setContainer] = useState(null);
1481
+ const className = `flex ${addon ? "size-6 px-1" : "h-[30px] w-full px-2"} min-w-0 items-center gap-1.5 text-xs font-normal text-muted-foreground ${compact ? "justify-center" : ""} ${surface ? "rounded-[var(--ui-control-radius,var(--ui-radius))] border border-input bg-[var(--ui-control-background,var(--ui-muted))] dark:bg-[var(--ui-control-background,var(--ui-muted))]" : ""}`;
1482
+ return /* @__PURE__ */ jsx("div", {
1483
+ ref: setContainer,
1484
+ className: "min-w-0",
1485
+ children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsxs(TooltipTrigger, {
1486
+ render: disclosure == null ? /* @__PURE__ */ jsx("span", {
1487
+ id,
1488
+ role: "img",
1489
+ "aria-label": accessibleLabel,
1490
+ "data-field-control": surface || void 0,
1491
+ "data-readonly": surface || void 0
1492
+ }) : /* @__PURE__ */ jsx("button", {
1493
+ id,
1494
+ type: "button",
1495
+ "aria-label": accessibleLabel,
1496
+ "aria-expanded": disclosure.expanded,
1497
+ "aria-controls": disclosure.controls,
1498
+ "data-field-control": true,
1499
+ "data-readonly": true,
1500
+ onClick: disclosure.onToggle
1501
+ }),
1502
+ className: `${className} ${disclosure == null ? "cursor-default" : "cursor-pointer text-left outline-none hover:bg-accent focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-1 focus-visible:outline-ring"}`,
1503
+ children: [icon, !compact && /* @__PURE__ */ jsx("span", {
1504
+ className: "min-w-0 truncate",
1505
+ children: label
1506
+ })]
1507
+ }), /* @__PURE__ */ jsx(TooltipContent, {
1508
+ container,
1509
+ children: label
1510
+ })] })
1511
+ });
1512
+ }
1513
+ //#endregion
1514
+ //#region src/form/browser/selectionMenuStyles.ts
1515
+ var selectionMenuContentClass = "rounded-[calc(var(--ui-control-radius,var(--ui-radius))_+_2px)] p-1";
1516
+ var selectionMenuItemClass = "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";
1517
+ //#endregion
1518
+ //#region src/form/browser/fieldSelect.tsx
1519
+ var fieldSelectTriggerClass = "w-full min-w-0 px-2 text-xs font-normal text-foreground";
1520
+ /** The field editor uses the product selection surface instead of the browser menu. */
1521
+ function FieldSelect({ id, value, onChange, children, disabled, readOnly, danger, icons, displayValue, showTooltip, variant, "aria-label": label, "aria-invalid": invalid, "aria-describedby": describedBy }) {
1522
+ const [open, setOpen] = useState(false);
1523
+ const [container, setContainer] = useState(null);
1524
+ const options = Children.toArray(children).filter(isValidElement).map((child) => {
1525
+ const props = child.props;
1526
+ return {
1527
+ value: String(props.value ?? props.children),
1528
+ label: props.children,
1529
+ disabled: props.disabled
1530
+ };
1531
+ });
1532
+ const selected = options.find((option) => option.value === String(value));
1533
+ if (readOnly && icons?.[value]) return /* @__PURE__ */ jsx(FieldTypeDisplay, {
1534
+ addon: variant === "addon",
1535
+ id,
1536
+ label: selected?.label,
1537
+ accessibleLabel: `${label}: ${selected?.label ?? value}`,
1538
+ icon: /* @__PURE__ */ jsx("i", {
1539
+ "aria-hidden": "true",
1540
+ className: `${icons[value]} inline-block shrink-0 text-base`
1541
+ })
1542
+ });
1543
+ const trigger = /* @__PURE__ */ jsx(SelectTrigger, {
1544
+ id,
1545
+ size: "field",
1546
+ variant,
1547
+ "aria-label": label,
1548
+ "aria-invalid": invalid || danger,
1549
+ "aria-describedby": describedBy,
1550
+ "data-field-prompt": danger || void 0,
1551
+ className: variant === "addon" ? void 0 : fieldSelectTriggerClass,
1552
+ children: /* @__PURE__ */ jsx(SelectValue, {
1553
+ className: variant === "addon" ? "flex-none justify-center" : void 0,
1554
+ children: displayValue ?? (icons?.[value] ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("i", {
1555
+ "aria-hidden": "true",
1556
+ className: `${icons[value]} inline-block shrink-0 text-base`
1557
+ }), /* @__PURE__ */ jsx("span", {
1558
+ className: "sr-only",
1559
+ children: selected?.label
1560
+ })] }) : void 0)
1561
+ })
1562
+ });
1563
+ return /* @__PURE__ */ jsx("div", {
1564
+ ref: setContainer,
1565
+ className: "min-w-0",
1566
+ children: /* @__PURE__ */ jsxs(Select$1, {
1567
+ open,
1568
+ onOpenChange: setOpen,
1569
+ value: String(value),
1570
+ onValueChange: (next) => {
1571
+ if (next != null) onChange(next);
1572
+ },
1573
+ disabled: disabled || readOnly,
1574
+ items: options,
1575
+ children: [icons || showTooltip ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: trigger }), /* @__PURE__ */ jsx(TooltipContent, {
1576
+ container,
1577
+ children: selected?.label
1578
+ })] }) : trigger, /* @__PURE__ */ jsx(SelectContent, {
1579
+ container,
1580
+ align: "start",
1581
+ alignItemWithTrigger: false,
1582
+ className: `${selectionMenuContentClass} w-max min-w-[max(9rem,var(--anchor-width))] max-w-(--available-width)`,
1583
+ children: options.filter((option) => !option.disabled).map((option) => /* @__PURE__ */ jsxs(SelectItem, {
1584
+ value: option.value,
1585
+ disabled: option.disabled,
1586
+ className: selectionMenuItemClass,
1587
+ children: [icons?.[option.value] && /* @__PURE__ */ jsx("i", {
1588
+ "aria-hidden": "true",
1589
+ className: `${icons[option.value]} inline-block shrink-0 text-base`
1590
+ }), option.label]
1591
+ }, option.value))
1592
+ })]
1593
+ })
1594
+ });
1595
+ }
1596
+ //#endregion
1597
+ //#region src/workbench/browser/runtime/editor/inspectorStatusSection.tsx
1598
+ function InspectorStatusSection({ title, actions, children, tone = "neutral", section, alert = false }) {
1599
+ return /* @__PURE__ */ jsxs("section", {
1600
+ className: "inspector-status",
1601
+ "data-tone": tone,
1602
+ "data-inspector-section": section,
1603
+ role: alert ? "alert" : void 0,
1604
+ children: [/* @__PURE__ */ jsxs("h3", {
1605
+ className: "inspector-section-title",
1606
+ children: [title, actions]
1607
+ }), /* @__PURE__ */ jsx("div", {
1608
+ className: "inspector-status-content",
1609
+ children
1610
+ })]
1611
+ });
1612
+ }
1613
+ //#endregion
1614
+ //#region src/workbench/browser/runtime/editor/connectionSettings.tsx
1615
+ var manageAccountOption = "__manage-account__";
1616
+ var noAccountsOption = "__no-accounts__";
1617
+ function ConnectionAlert({ detail, disabled, message, onRetry }) {
1618
+ const t = useTranslate();
1619
+ return /* @__PURE__ */ jsxs("div", {
1620
+ className: "connection-alert",
1621
+ role: "alert",
1622
+ children: [
1623
+ /* @__PURE__ */ jsx(Icon, {
1624
+ name: "alert",
1625
+ size: 14
1626
+ }),
1627
+ /* @__PURE__ */ jsxs("div", {
1628
+ className: "connection-alert-message",
1629
+ children: [/* @__PURE__ */ jsx("p", { children: message }), detail != null && /* @__PURE__ */ jsx("p", { children: detail })]
1630
+ }),
1631
+ onRetry != null && /* @__PURE__ */ jsx(Button$1, {
1632
+ disabled,
1633
+ onClick: onRetry,
1634
+ size: "sm",
1635
+ type: "button",
1636
+ variant: "secondary",
1637
+ children: t("inspector.account.retry")
1638
+ })
1639
+ ]
1640
+ });
1641
+ }
1642
+ function AccountControlButton({ disabled, status, label, hint, onClick }) {
1643
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs(Button$1, {
1644
+ type: "button",
1645
+ variant: "outline",
1646
+ size: "sm",
1647
+ className: "account-control justify-between font-normal",
1648
+ "data-status": status,
1649
+ disabled,
1650
+ onClick,
1651
+ children: [/* @__PURE__ */ jsx("span", {
1652
+ className: "truncate",
1653
+ children: label
1654
+ }), /* @__PURE__ */ jsx("i", {
1655
+ "aria-hidden": "true",
1656
+ className: status === "warning" ? "i-lucide-light:plus size-3.5" : "i-lucide-light:rotate-cw size-3.5"
1657
+ })]
1658
+ }) }), /* @__PURE__ */ jsx(TooltipContent, { children: hint ?? label })] });
1659
+ }
1660
+ function AccountSelect({ connections, disabled, loading = false, id, invalid, warning, addWhenEmpty, allowDeferred = false, label, selectedConnection, selectedId, onChange, onManage }) {
1661
+ const t = useTranslate();
1662
+ const [container, setContainer] = useState(null);
1663
+ const selected = selectedConnection ?? connections.find((candidate) => candidate.connectionId == selectedId);
1664
+ const showLoading = loading && selected == null && selectedId !== "";
1665
+ const builtInName = t("inspector.account.oomolBuiltIn");
1666
+ const displayName = (connection) => accountDisplayName(connection, connection.displayName, builtInName);
1667
+ const selectedLabel = selectedId === "" ? t("inspector.account.deferred") : selected == null ? selectedId == null ? void 0 : `${selectedId} (${t("inspector.account.unavailable")})` : `${displayName(selected)}${selected.isDefault ? ` (${t("inspector.account.teamDefault")})` : ""}`;
1668
+ const missingSelected = selectedId != null && selectedId !== "" && !connections.some((candidate) => candidate.connectionId == selectedId);
1669
+ const empty = !loading && connections.length == 0;
1670
+ const items = [
1671
+ ...allowDeferred || selectedId === "" ? [{
1672
+ value: "",
1673
+ label: t("inspector.account.deferred"),
1674
+ disabled: !allowDeferred
1675
+ }] : [],
1676
+ ...missingSelected ? [{
1677
+ value: selectedId,
1678
+ label: selectedLabel,
1679
+ disabled: true
1680
+ }] : [],
1681
+ ...empty ? [{
1682
+ value: noAccountsOption,
1683
+ label: t("inspector.account.noAccounts"),
1684
+ disabled: true
1685
+ }] : [],
1686
+ ...connections.map((candidate) => ({
1687
+ value: candidate.connectionId,
1688
+ label: `${displayName(candidate)}${candidate.isDefault ? ` (${t("inspector.account.teamDefault")})` : ""}`
1689
+ })),
1690
+ ...onManage == null ? [] : [{
1691
+ value: manageAccountOption,
1692
+ label: t("inspector.account.addAccount")
1693
+ }]
1694
+ ];
1695
+ if (!allowDeferred && !loading && addWhenEmpty && connections.length === 0 && selectedId == null) return /* @__PURE__ */ jsx(AccountControlButton, {
1696
+ disabled,
1697
+ status: "warning",
1698
+ onClick: onManage,
1699
+ label: t("inspector.account.addAccount")
1700
+ });
1701
+ return /* @__PURE__ */ jsxs("div", {
1702
+ ref: setContainer,
1703
+ className: "account-select relative min-w-0",
1704
+ children: [/* @__PURE__ */ jsxs(Select$1, {
1705
+ disabled: disabled || loading,
1706
+ items,
1707
+ value: selectedId ?? null,
1708
+ onValueChange: (value) => {
1709
+ if (value == null) return;
1710
+ if (value == manageAccountOption) onManage?.();
1711
+ else onChange(value);
1712
+ },
1713
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
1714
+ id,
1715
+ size: "field",
1716
+ "aria-label": label ?? t("inspector.account.connection"),
1717
+ "aria-busy": loading || void 0,
1718
+ "aria-invalid": invalid || void 0,
1719
+ "data-status": invalid ? "danger" : warning ? "warning" : void 0,
1720
+ className: `${fieldSelectTriggerClass} account-control`,
1721
+ children: /* @__PURE__ */ jsx(SelectValue, {
1722
+ className: !loading && selectedId != null ? "mr-5" : void 0,
1723
+ placeholder: t("inspector.account.chooseAccount"),
1724
+ children: showLoading ? /* @__PURE__ */ jsxs("span", {
1725
+ role: "status",
1726
+ className: "flex min-w-0 items-center gap-2 text-muted-foreground",
1727
+ children: [/* @__PURE__ */ jsx(Spinner, {}), /* @__PURE__ */ jsx("span", {
1728
+ className: "truncate",
1729
+ children: t("inspector.account.loading")
1730
+ })]
1731
+ }) : selected == null ? selectedLabel : /* @__PURE__ */ jsx(AccountName, {
1732
+ name: displayName(selected),
1733
+ builtIn: selected.builtInAccount,
1734
+ truncate: true
1735
+ })
1736
+ })
1737
+ }), /* @__PURE__ */ jsxs(SelectContent, {
1738
+ container,
1739
+ align: "start",
1740
+ alignItemWithTrigger: false,
1741
+ className: `${selectionMenuContentClass} w-max min-w-[max(9rem,var(--anchor-width))] max-w-(--available-width)`,
1742
+ children: [
1743
+ (allowDeferred || selectedId === "") && /* @__PURE__ */ jsx(SelectItem, {
1744
+ value: "",
1745
+ disabled: !allowDeferred,
1746
+ 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",
1747
+ children: t("inspector.account.deferred")
1748
+ }),
1749
+ missingSelected && /* @__PURE__ */ jsx(SelectItem, {
1750
+ value: selectedId,
1751
+ disabled: true,
1752
+ 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",
1753
+ children: selectedLabel
1754
+ }),
1755
+ empty && /* @__PURE__ */ jsx(SelectItem, {
1756
+ value: noAccountsOption,
1757
+ disabled: true,
1758
+ 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",
1759
+ children: t("inspector.account.noAccounts")
1760
+ }),
1761
+ connections.map((candidate) => /* @__PURE__ */ jsxs(SelectItem, {
1762
+ value: candidate.connectionId,
1763
+ className: selectionMenuItemClass,
1764
+ children: [/* @__PURE__ */ jsx(AccountName, {
1765
+ name: displayName(candidate),
1766
+ builtIn: candidate.builtInAccount,
1767
+ truncate: true
1768
+ }), candidate.isDefault ? ` (${t("inspector.account.teamDefault")})` : ""]
1769
+ }, candidate.connectionId)),
1770
+ onManage != null && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SelectSeparator, { className: "mx-2 bg-border/50" }), /* @__PURE__ */ jsx(SelectItem, {
1771
+ value: manageAccountOption,
1772
+ 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",
1773
+ children: t("inspector.account.addAccount")
1774
+ })] })
1775
+ ]
1776
+ })]
1777
+ }), !loading && selectedId != null && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(Button$1, {
1778
+ className: "account-select-clear absolute top-1/2 right-7 -translate-y-1/2 text-muted-foreground",
1779
+ type: "button",
1780
+ variant: "ghost",
1781
+ size: "icon-xs",
1782
+ "aria-label": t(selectedId === "" ? "inspector.account.clearDeferred" : "connectionUsage.stopUsing"),
1783
+ disabled,
1784
+ onPointerDown: (event) => {
1785
+ if (event.button == 0) onChange(void 0);
1786
+ },
1787
+ onClick: (event) => {
1788
+ if (event.detail == 0) onChange(void 0);
1789
+ },
1790
+ children: /* @__PURE__ */ jsx("i", {
1791
+ "aria-hidden": "true",
1792
+ className: "i-lucide-light:x"
1793
+ })
1794
+ }) }), /* @__PURE__ */ jsx(TooltipContent, {
1795
+ container,
1796
+ children: t(selectedId === "" ? "inspector.account.clearDeferred" : "connectionUsage.stopUsing")
1797
+ })] })]
1798
+ });
1799
+ }
1800
+ function ConnectorAccount({ accessError, onConfigureAccess, action, actionError, actionId, activeConnections, authorizationPending, connection, connectionError, connectionId, connectors, disabled, fieldIdPrefix, loading, nodeId }) {
1801
+ const t = useTranslate();
1802
+ const available = activeConnections ?? [];
1803
+ const accessIssue = accessError ?? (actionError?.code == "connector.access-required" || actionError?.code == "connector.access-invalid" ? actionError.message : void 0);
1804
+ const pending = loading || accessIssue == null && actionError == null && (action == null || activeConnections == null && connectionError == null);
1805
+ const required = !pending && (accessIssue != null || connectionId !== "" && action?.authenticated == true && (connectionId == null || activeConnections != null && connection?.status != "active"));
1806
+ let onManage;
1807
+ let content;
1808
+ if (pending) content = /* @__PURE__ */ jsx("p", { children: t("inspector.account.loading") });
1809
+ else if (accessIssue != null) content = /* @__PURE__ */ jsx("p", { children: accessIssue });
1810
+ else if (actionError != null || action == null) {
1811
+ const canRetry = actionError?.code != "authorization.denied" && actionError?.code != "connector.action-not-found";
1812
+ content = /* @__PURE__ */ jsx(ConnectionAlert, {
1813
+ disabled,
1814
+ message: actionError?.code == "authorization.denied" ? t("inspector.account.contactAdmin") : actionError?.message ?? t("inspector.account.statusUnavailable", { action: actionId }),
1815
+ onRetry: canRetry ? () => void connectors.refresh(true) : void 0
1816
+ });
1817
+ } else if (connectionError != null) content = /* @__PURE__ */ jsx(ConnectionAlert, {
1818
+ detail: connectionError,
1819
+ disabled,
1820
+ message: t("inspector.account.refreshFailed"),
1821
+ onRetry: () => void connectors.refresh(true)
1822
+ });
1823
+ else {
1824
+ onManage = onConfigureAccess;
1825
+ let status;
1826
+ if (connectionId != null && connectionId !== "") {
1827
+ if (connection == null) status = t("inspector.account.missing");
1828
+ else if (connection.status != "active") status = t(`inspector.account.status.${connection.status}`);
1829
+ }
1830
+ content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
1831
+ authorizationPending && /* @__PURE__ */ jsx("p", { children: t("inspector.account.authorizationPending") }),
1832
+ /* @__PURE__ */ jsxs(Field, {
1833
+ className: "connection-field",
1834
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
1835
+ className: "sr-only",
1836
+ htmlFor: `${fieldIdPrefix}-connection`,
1837
+ children: t("inspector.account.connection")
1838
+ }), /* @__PURE__ */ jsx(AccountSelect, {
1839
+ allowDeferred: true,
1840
+ connections: available,
1841
+ disabled,
1842
+ id: `${fieldIdPrefix}-connection`,
1843
+ selectedConnection: connection,
1844
+ selectedId: connectionId,
1845
+ onChange: (next) => void connectors.setConnection(nodeId, next),
1846
+ onManage: onConfigureAccess
1847
+ })]
1848
+ }),
1849
+ status != null && /* @__PURE__ */ jsx("p", { children: status })
1850
+ ] });
1851
+ }
1852
+ return /* @__PURE__ */ jsxs(InspectorStatusSection, {
1853
+ tone: required ? "warning" : "neutral",
1854
+ section: "account",
1855
+ title: t(!pending && accessIssue != null ? "inspector.account.accessTitle" : required ? "inspector.account.required" : "inspector.account.title"),
1856
+ actions: onManage != null && /* @__PURE__ */ jsx(Button$1, {
1857
+ className: "ml-auto",
1858
+ disabled,
1859
+ onClick: onManage,
1860
+ size: "xs",
1861
+ type: "button",
1862
+ variant: "ghost",
1863
+ children: t("inspector.account.manageAccount")
1864
+ }),
1865
+ children: [content, !pending && onConfigureAccess != null && accessIssue != null && /* @__PURE__ */ jsx(Button$1, {
1866
+ className: "self-start",
1867
+ disabled,
1868
+ onClick: onConfigureAccess,
1869
+ size: "sm",
1870
+ type: "button",
1871
+ variant: "default",
1872
+ children: t("inspector.account.manageAccount")
1873
+ })]
1874
+ });
1875
+ }
1876
+ function TriggerConnection({ activeConnections, authorizationPending, connection, connectionError, connectionLoading, disabled, selection, onConfigureAccess, triggers }) {
1877
+ const t = useTranslate();
1878
+ const trigger = selection.trigger;
1879
+ const providerTrigger = trigger.kind == "poll" || trigger.kind == "integration" ? trigger : void 0;
1880
+ const fieldIdPrefix = `trigger-${selection.id}`;
1881
+ const canManage = onConfigureAccess != null && !connectionLoading && connectionError == null && (activeConnections?.length ?? 0) > 0;
1882
+ return providerTrigger == null ? null : /* @__PURE__ */ jsxs(InspectorStatusSection, {
1883
+ tone: connection?.status == "active" ? "neutral" : "warning",
1884
+ section: "account",
1885
+ title: t(connection?.status == "active" ? "inspector.account.title" : "inspector.account.required"),
1886
+ actions: canManage && /* @__PURE__ */ jsx(Button$1, {
1887
+ className: "ml-auto",
1888
+ disabled,
1889
+ onClick: () => onConfigureAccess?.(providerTrigger.definition.provider),
1890
+ size: "xs",
1891
+ type: "button",
1892
+ variant: "ghost",
1893
+ children: t("inspector.account.manageAccount")
1894
+ }),
1895
+ children: [authorizationPending && /* @__PURE__ */ jsx("p", { children: t("inspector.account.authorizationPending") }), connectionLoading ? /* @__PURE__ */ jsx("p", { children: t("inspector.account.loading") }) : connectionError != null ? /* @__PURE__ */ jsx(ConnectionAlert, {
1896
+ detail: connectionError,
1897
+ disabled,
1898
+ message: t("inspector.account.refreshFailed"),
1899
+ onRetry: () => void triggers.refresh(true)
1900
+ }) : (activeConnections?.length ?? 0) == 0 ? /* @__PURE__ */ jsxs("div", {
1901
+ className: "inspector-status-prompt",
1902
+ children: [/* @__PURE__ */ jsx("p", { children: t("inspector.account.connectBeforeRun", { service: providerTrigger.definition.provider }) }), /* @__PURE__ */ jsx(Button$1, {
1903
+ disabled: disabled || onConfigureAccess == null,
1904
+ onClick: () => onConfigureAccess?.(providerTrigger.definition.provider),
1905
+ size: "sm",
1906
+ type: "button",
1907
+ children: t("inspector.account.manageAccount")
1908
+ })]
1909
+ }) : /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs(Field, {
1910
+ className: "connection-field",
1911
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
1912
+ className: "sr-only",
1913
+ htmlFor: `${fieldIdPrefix}-connection`,
1914
+ children: t("inspector.account.connection")
1915
+ }), /* @__PURE__ */ jsx(AccountSelect, {
1916
+ connections: activeConnections,
1917
+ disabled,
1918
+ id: `${fieldIdPrefix}-connection`,
1919
+ selectedConnection: connection,
1920
+ selectedId: connection?.connectionId,
1921
+ onChange: (next) => void triggers.setConnection(selection.id, next),
1922
+ onManage: onConfigureAccess == null ? void 0 : () => onConfigureAccess(providerTrigger.definition.provider)
1923
+ })]
1924
+ }) })]
1925
+ });
1926
+ }
1927
+ /** A persisted reference has no live account health or authorization state. */
1928
+ function SavedConnectionReference({ action, connectionId }) {
1929
+ const t = useTranslate();
1930
+ return /* @__PURE__ */ jsxs(InspectorStatusSection, {
1931
+ title: t("inspector.account.title"),
1932
+ section: "account",
1933
+ children: [/* @__PURE__ */ jsx("p", {
1934
+ className: "reference-value",
1935
+ children: action
1936
+ }), connectionId != null && /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: t("inspector.account.connection") }), /* @__PURE__ */ jsx(Input$1, {
1937
+ "aria-label": t("inspector.account.connection"),
1938
+ readOnly: true,
1939
+ value: connectionId
1940
+ })] })]
1941
+ });
1942
+ }
1943
+ //#endregion
1477
1944
  //#region src/workbench/browser/runtime/editor/connectorAccessPresentation.ts
1478
1945
  function connectorAccessPermissionGroupLabel(binding, t) {
1479
1946
  if (binding.source == null) return t("connectorAccess.reauthorize");
@@ -2222,6 +2689,7 @@ function menuItems(options, providersOnly = false) {
2222
2689
  }
2223
2690
  function fallbackIcon$1(item) {
2224
2691
  switch (item.type) {
2692
+ case "workflow": return "flow";
2225
2693
  case "agent": return "llm";
2226
2694
  case "condition": return "condition";
2227
2695
  case "decision": return "decision";
@@ -2232,6 +2700,7 @@ function fallbackIcon$1(item) {
2232
2700
  case "approval": return "task";
2233
2701
  case "trigger": return "trigger";
2234
2702
  case "value": return "value";
2703
+ case "outputs": return "outputs";
2235
2704
  case "wait": return "wait";
2236
2705
  case "new-task":
2237
2706
  case "comment": return "task";
@@ -2776,7 +3245,7 @@ function hasConnectionUsageIssue(uses, access, providers, connections) {
2776
3245
  if (pendingConnectionUses(uses, providers).length > 0) return true;
2777
3246
  if (access?.version == 1 && access.bindings.some((binding) => binding.connectionId == null || binding.status != "active")) return true;
2778
3247
  if (connections == null) return false;
2779
- const connectionIds = new Set(uses.flatMap((use) => use.connectionId == null ? [] : [use.connectionId]));
3248
+ const connectionIds = new Set(uses.flatMap((use) => use.connectionId == null || use.connectionId === "" ? [] : [use.connectionId]));
2780
3249
  for (const binding of access == null ? [] : access.version == 2 ? access.sharedBindings : access.bindings) if (binding.connectionId != null) connectionIds.add(binding.connectionId);
2781
3250
  return [...connectionIds].some((id) => connections.find((connection) => connection.connectionId == id)?.status != "active");
2782
3251
  }
@@ -2812,7 +3281,7 @@ function ConnectionUsageButton(props) {
2812
3281
  "aria-hidden": "true",
2813
3282
  className: "i-lucide-light:plug",
2814
3283
  "data-corner-icon": true,
2815
- style: hasIssue ? { color: "var(--warning-foreground)" } : void 0
3284
+ style: hasIssue ? { color: "var(--ui-destructive)" } : void 0
2816
3285
  })
2817
3286
  })
2818
3287
  }), /* @__PURE__ */ jsx(PopoverPanelContent, {
@@ -2825,7 +3294,7 @@ function ConnectionUsageButton(props) {
2825
3294
  children: t("connectionUsage.title")
2826
3295
  }),
2827
3296
  closeLabel: t("connectionUsage.close"),
2828
- className: "w-96",
3297
+ className: "w-md",
2829
3298
  children: /* @__PURE__ */ jsx(ConnectorAccessSettings, {
2830
3299
  ...props,
2831
3300
  onSelectReference: props.onSelectReference == null ? void 0 : (reference) => {
@@ -2878,6 +3347,7 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
2878
3347
  const [root, setRoot] = useState(null);
2879
3348
  const [removing, setRemoving] = useState();
2880
3349
  const [pending, setPending] = useState(false);
3350
+ const [selectingAccount, setSelectingAccount] = useState(false);
2881
3351
  const portal = useCallback((element) => {
2882
3352
  panel.current = element;
2883
3353
  setRoot(element?.closest(".open-flow-workbench") ?? element?.closest(".open-flow-theme") ?? null);
@@ -2888,7 +3358,7 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
2888
3358
  const uses = displayed?.connectorReferences.accounts ?? [];
2889
3359
  const accounts = /* @__PURE__ */ new Map();
2890
3360
  for (const use of uses) {
2891
- if (use.connectionId == null || accounts.has(use.connectionId)) continue;
3361
+ if (use.connectionId == null || use.connectionId === "" || accounts.has(use.connectionId)) continue;
2892
3362
  const connection = connections.find((item) => item.connectionId == use.connectionId);
2893
3363
  accounts.set(use.connectionId, {
2894
3364
  name: (published ? fixedSnapshot?.access.selectedBindings.find((binding) => binding.connectionId == use.connectionId)?.connectionDisplayName : void 0) ?? connection?.displayName ?? use.connectionId,
@@ -2908,6 +3378,8 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
2908
3378
  });
2909
3379
  }
2910
3380
  const pendingUses = pendingConnectionUses(uses, providers.data);
3381
+ const deferredUses = uses.filter((use) => use.connectionId === "" && use.kind != "trigger");
3382
+ const hasAccountUses = accounts.size > 0 || pendingUses.length > 0 || deferredUses.length > 0;
2911
3383
  const providerMetadata = Object.fromEntries((providers.data ?? []).map((provider) => [provider.serviceId, provider]));
2912
3384
  const referenceIcon = (reference) => {
2913
3385
  const node = displayed?.node(reference.nodeId);
@@ -2938,9 +3410,9 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
2938
3410
  children: t("connectionUsage.published")
2939
3411
  })]
2940
3412
  }),
2941
- /* @__PURE__ */ jsx("p", {
3413
+ published && /* @__PURE__ */ jsx("p", {
2942
3414
  className: "m-0 text-xs text-muted-foreground",
2943
- children: t(published ? "connectionUsage.publishedDescription" : "connectionUsage.description")
3415
+ children: t("connectionUsage.publishedDescription")
2944
3416
  }),
2945
3417
  published && snapshotError || !published && !state.loading && state.access == null ? /* @__PURE__ */ jsxs("p", {
2946
3418
  role: "alert",
@@ -2957,21 +3429,72 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
2957
3429
  }) : !published && (state.loading || revision == null) || published && fixedSnapshot == null ? /* @__PURE__ */ jsx("p", {
2958
3430
  className: "text-xs",
2959
3431
  children: t("connectionUsage.loading")
2960
- }) : accounts.size == 0 && pendingUses.length == 0 ? /* @__PURE__ */ jsx("p", {
3432
+ }) : !hasAccountUses ? /* @__PURE__ */ jsx("p", {
2961
3433
  className: "text-xs text-muted-foreground",
2962
3434
  children: t(published ? "connectionUsage.publishedEmpty" : "connectionUsage.empty")
2963
3435
  }) : /* @__PURE__ */ jsxs("div", {
2964
3436
  className: "flex flex-col gap-4",
2965
- children: [pendingUses.length > 0 && /* @__PURE__ */ jsx("div", {
2966
- className: "rounded-md bg-[var(--warning-subtle-surface)] p-2 [--ui-control-hover-background:var(--warning-subtle-hover)]",
2967
- children: /* @__PURE__ */ jsx(AccountReferences, {
2968
- icon: referenceIcon,
2969
- references: pendingUses,
2970
- label: t("connectionUsage.needsConnection"),
2971
- labelClassName: "text-[var(--warning-foreground)]",
2972
- onSelect: published ? void 0 : onSelectReference
2973
- })
2974
- }), /* @__PURE__ */ jsx("div", {
3437
+ children: [[{
3438
+ deferred: false,
3439
+ references: pendingUses
3440
+ }, {
3441
+ deferred: true,
3442
+ references: deferredUses
3443
+ }].map(({ deferred, references }) => references.length > 0 && /* @__PURE__ */ jsxs("section", {
3444
+ className: "flex flex-col gap-3",
3445
+ "aria-label": t(deferred ? "inspector.account.deferred" : "connectionUsage.needsConnection"),
3446
+ children: [/* @__PURE__ */ jsx("h3", {
3447
+ className: cn$1("m-0 text-xs font-medium", deferred ? "text-muted-foreground" : "text-[var(--warning-foreground)]"),
3448
+ children: t(deferred ? "inspector.account.deferred" : "connectionUsage.needsConnection")
3449
+ }), [...new Set(references.map((use) => use.providerId))].map((providerId) => {
3450
+ const provider = providers.data?.find((item) => item.serviceId == providerId) ?? {
3451
+ serviceId: providerId,
3452
+ serviceName: providerId
3453
+ };
3454
+ const providerReferences = references.filter((use) => use.providerId == providerId);
3455
+ return /* @__PURE__ */ jsxs("section", {
3456
+ "aria-label": provider.serviceName,
3457
+ className: cn$1("flex min-w-0 flex-col gap-3 rounded-md p-3", deferred ? "border border-border/50" : "bg-[var(--warning-subtle-surface)] [--ui-control-hover-background:var(--warning-subtle-hover)]"),
3458
+ children: [
3459
+ /* @__PURE__ */ jsxs("div", {
3460
+ className: "flex min-w-0 items-center gap-2 text-[13px] font-medium",
3461
+ children: [/* @__PURE__ */ jsx(ContentIcon, {
3462
+ src: providerIcon(provider),
3463
+ className: "size-4 shrink-0 data-[icon-kind=initials]:text-[20px]"
3464
+ }), /* @__PURE__ */ jsx("span", {
3465
+ className: "min-w-0 truncate",
3466
+ title: provider.serviceName,
3467
+ children: provider.serviceName
3468
+ })]
3469
+ }),
3470
+ !published && /* @__PURE__ */ jsx(AccountSelect, {
3471
+ connections: connections.filter((connection) => connection.serviceId == providerId && connection.status == "active"),
3472
+ disabled: selectingAccount || connectionState.error != null,
3473
+ loading: connectionState.data == null && connectionState.error == null,
3474
+ warning: !deferred,
3475
+ selectedId: deferred ? "" : void 0,
3476
+ allowDeferred: !providerReferences.some((use) => use.kind == "trigger"),
3477
+ label: t("actionPicker.accountFor", { action: provider.serviceName }),
3478
+ onChange: (connectionId) => {
3479
+ setSelectingAccount(true);
3480
+ store.workspace.setServiceConnections(providerId, connectionId, deferred ? "" : void 0).then((saved) => {
3481
+ setSelectingAccount(false);
3482
+ if (saved) panel.current?.focus();
3483
+ });
3484
+ },
3485
+ onManage: () => void store.connectors.connect(providerId)
3486
+ }),
3487
+ /* @__PURE__ */ jsx(AccountReferences, {
3488
+ showLabel: false,
3489
+ icon: referenceIcon,
3490
+ references: providerReferences,
3491
+ label: t(deferred ? "inspector.account.deferred" : "connectionUsage.needsConnection"),
3492
+ onSelect: published ? void 0 : onSelectReference
3493
+ })
3494
+ ]
3495
+ }, providerId);
3496
+ })]
3497
+ }, String(deferred))), /* @__PURE__ */ jsx("div", {
2975
3498
  className: "flex flex-col gap-4",
2976
3499
  children: [...new Set([...accounts.values()].map((account) => account.providerId))].map((providerId) => {
2977
3500
  const provider = providers.data?.find((item) => item.serviceId == providerId) ?? {
@@ -2990,7 +3513,8 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
2990
3513
  src: providerIcon(provider),
2991
3514
  className: "size-4 shrink-0 data-[icon-kind=initials]:text-[20px]"
2992
3515
  }), /* @__PURE__ */ jsx("span", {
2993
- className: "min-w-0 wrap-anywhere",
3516
+ className: "min-w-0 truncate",
3517
+ title: provider.serviceName,
2994
3518
  children: provider.serviceName
2995
3519
  })]
2996
3520
  }), /* @__PURE__ */ jsx("span", {
@@ -3013,7 +3537,8 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
3013
3537
  className: "i-codicon:credit-card size-3.5 shrink-0 text-sm text-muted-foreground"
3014
3538
  }), /* @__PURE__ */ jsx(AccountName, {
3015
3539
  name: accountDisplayName(connection, account.name, builtInName),
3016
- builtIn: connection?.builtInAccount
3540
+ builtIn: connection?.builtInAccount,
3541
+ truncate: true
3017
3542
  })]
3018
3543
  }), !published && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
3019
3544
  render: /* @__PURE__ */ jsx(Button$1, {
@@ -3056,7 +3581,7 @@ function ConnectorAccessSettings({ connectionHref, onManage, onSelectReference,
3056
3581
  })
3057
3582
  })]
3058
3583
  }),
3059
- accounts.size > 0 && (connectionState.error != null || connectionState.data == null) && /* @__PURE__ */ jsxs("p", {
3584
+ hasAccountUses && (connectionState.error != null || connectionState.data == null) && /* @__PURE__ */ jsxs("p", {
3060
3585
  className: "text-xs text-muted-foreground",
3061
3586
  role: "status",
3062
3587
  children: [t(connectionState.error != null ? "connectorAccess.accountsFailed" : "inspector.account.loading"), connectionState.error != null && /* @__PURE__ */ jsx(Button$1, {
@@ -3466,14 +3991,14 @@ function ConnectorAccessEmptyState({ store, serviceId }) {
3466
3991
  })]
3467
3992
  });
3468
3993
  }
3469
- function AccountReferences({ hierarchy = false, icon, code = false, references, label, labelClassName, onSelect }) {
3994
+ function AccountReferences({ hierarchy = false, showLabel = !hierarchy, icon, code = false, references, label, onSelect }) {
3470
3995
  const t = useTranslate();
3471
3996
  if (references.length == 0 && !code) return null;
3472
3997
  return /* @__PURE__ */ jsxs("div", {
3473
3998
  className: "flex min-w-0 flex-col gap-1",
3474
3999
  children: [
3475
- (!hierarchy || references.length == 0) && /* @__PURE__ */ jsx("span", {
3476
- className: cn$1("text-xs text-muted-foreground", labelClassName),
4000
+ (showLabel || references.length == 0) && /* @__PURE__ */ jsx("span", {
4001
+ className: "text-xs text-muted-foreground",
3477
4002
  children: references.length > 0 ? label : t("connectionUsage.codeAccess")
3478
4003
  }),
3479
4004
  references.length > 0 && /* @__PURE__ */ jsx("ul", {
@@ -3486,7 +4011,8 @@ function AccountReferences({ hierarchy = false, icon, code = false, references,
3486
4011
  className: "size-4 shrink-0 data-[icon-kind=initials]:text-[20px]"
3487
4012
  }),
3488
4013
  /* @__PURE__ */ jsx("span", {
3489
- className: "min-w-0 flex-1 wrap-anywhere",
4014
+ className: "min-w-0 flex-1 truncate",
4015
+ title: reference.name,
3490
4016
  children: reference.name
3491
4017
  }),
3492
4018
  reference.kind != null && /* @__PURE__ */ jsx("span", {
@@ -3506,7 +4032,7 @@ function AccountReferences({ hierarchy = false, icon, code = false, references,
3506
4032
  className: "flex min-h-7 items-center gap-2 px-2 py-1 text-[13px]",
3507
4033
  children: content
3508
4034
  }) : /* @__PURE__ */ jsxs(Button$1, {
3509
- className: "h-auto min-h-7 w-full justify-start gap-2 px-2 py-1 text-left text-[13px] font-normal whitespace-normal",
4035
+ className: "h-auto min-h-7 w-full justify-start gap-2 px-2 py-1 text-left text-[13px] font-normal",
3510
4036
  variant: "ghost",
3511
4037
  size: "xs",
3512
4038
  type: "button",
@@ -3516,7 +4042,11 @@ function AccountReferences({ hierarchy = false, icon, code = false, references,
3516
4042
  className: "i-lucide-light:arrow-up-right size-3 shrink-0 text-muted-foreground"
3517
4043
  })]
3518
4044
  })]
3519
- }, JSON.stringify([reference.nodeId, reference.kind]));
4045
+ }, JSON.stringify([
4046
+ reference.nodeId,
4047
+ reference.kind,
4048
+ reference.providerId
4049
+ ]));
3520
4050
  })
3521
4051
  }),
3522
4052
  code && /* @__PURE__ */ jsx("p", {
@@ -3530,7 +4060,7 @@ function ConnectionConsoleLink({ href, children }) {
3530
4060
  const className = cn$1(buttonVariants({
3531
4061
  variant: "ghost",
3532
4062
  size: "xs"
3533
- }), "-my-1 -ml-2 min-w-0 h-auto min-h-6 shrink justify-start gap-2 py-1 text-left text-[13px] text-foreground whitespace-normal");
4063
+ }), "-my-1 -ml-2 min-w-0 h-auto min-h-6 shrink justify-start gap-2 py-1 text-left text-[13px] text-foreground");
3534
4064
  return href == null ? /* @__PURE__ */ jsx("span", {
3535
4065
  className: cn$1(className, "pointer-events-none"),
3536
4066
  children
@@ -5875,458 +6405,8 @@ function ActionPickerPage({ portalRoot, connectors, disabled, selected, onToggle
5875
6405
  });
5876
6406
  }
5877
6407
  //#endregion
5878
- //#region src/form/browser/fieldTypeDisplay.tsx
5879
- /** Presents a fixed type, optionally using its read-only surface as a disclosure control. */
5880
- function FieldTypeDisplay({ id, label, accessibleLabel, icon, compact = true, addon = false, surface = false, disclosure }) {
5881
- const [container, setContainer] = useState(null);
5882
- const className = `flex ${addon ? "size-6 px-1" : "h-[30px] w-full px-2"} min-w-0 items-center gap-1.5 text-xs font-normal text-muted-foreground ${compact ? "justify-center" : ""} ${surface ? "rounded-[var(--ui-control-radius,var(--ui-radius))] border border-input bg-[var(--ui-control-background,var(--ui-muted))] dark:bg-[var(--ui-control-background,var(--ui-muted))]" : ""}`;
5883
- return /* @__PURE__ */ jsx("div", {
5884
- ref: setContainer,
5885
- className: "min-w-0",
5886
- children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsxs(TooltipTrigger, {
5887
- render: disclosure == null ? /* @__PURE__ */ jsx("span", {
5888
- id,
5889
- role: "img",
5890
- "aria-label": accessibleLabel,
5891
- "data-field-control": surface || void 0,
5892
- "data-readonly": surface || void 0
5893
- }) : /* @__PURE__ */ jsx("button", {
5894
- id,
5895
- type: "button",
5896
- "aria-label": accessibleLabel,
5897
- "aria-expanded": disclosure.expanded,
5898
- "aria-controls": disclosure.controls,
5899
- "data-field-control": true,
5900
- "data-readonly": true,
5901
- onClick: disclosure.onToggle
5902
- }),
5903
- className: `${className} ${disclosure == null ? "cursor-default" : "cursor-pointer text-left outline-none hover:bg-accent focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-1 focus-visible:outline-ring"}`,
5904
- children: [icon, !compact && /* @__PURE__ */ jsx("span", {
5905
- className: "min-w-0 truncate",
5906
- children: label
5907
- })]
5908
- }), /* @__PURE__ */ jsx(TooltipContent, {
5909
- container,
5910
- children: label
5911
- })] })
5912
- });
5913
- }
5914
- //#endregion
5915
- //#region src/form/browser/selectionMenuStyles.ts
5916
- var selectionMenuContentClass = "rounded-[calc(var(--ui-control-radius,var(--ui-radius))_+_2px)] p-1";
5917
- var selectionMenuItemClass = "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";
5918
- //#endregion
5919
- //#region src/form/browser/fieldSelect.tsx
5920
- var fieldSelectTriggerClass = "w-full min-w-0 px-2 text-xs font-normal text-foreground";
5921
- /** The field editor uses the product selection surface instead of the browser menu. */
5922
- function FieldSelect({ id, value, onChange, children, disabled, readOnly, danger, icons, displayValue, showTooltip, variant, "aria-label": label, "aria-invalid": invalid, "aria-describedby": describedBy }) {
5923
- const [open, setOpen] = useState(false);
5924
- const [container, setContainer] = useState(null);
5925
- const options = Children.toArray(children).filter(isValidElement).map((child) => {
5926
- const props = child.props;
5927
- return {
5928
- value: String(props.value ?? props.children),
5929
- label: props.children,
5930
- disabled: props.disabled
5931
- };
5932
- });
5933
- const selected = options.find((option) => option.value === String(value));
5934
- if (readOnly && icons?.[value]) return /* @__PURE__ */ jsx(FieldTypeDisplay, {
5935
- addon: variant === "addon",
5936
- id,
5937
- label: selected?.label,
5938
- accessibleLabel: `${label}: ${selected?.label ?? value}`,
5939
- icon: /* @__PURE__ */ jsx("i", {
5940
- "aria-hidden": "true",
5941
- className: `${icons[value]} inline-block shrink-0 text-base`
5942
- })
5943
- });
5944
- const trigger = /* @__PURE__ */ jsx(SelectTrigger, {
5945
- id,
5946
- size: "field",
5947
- variant,
5948
- "aria-label": label,
5949
- "aria-invalid": invalid || danger,
5950
- "aria-describedby": describedBy,
5951
- "data-field-prompt": danger || void 0,
5952
- className: variant === "addon" ? void 0 : fieldSelectTriggerClass,
5953
- children: /* @__PURE__ */ jsx(SelectValue, {
5954
- className: variant === "addon" ? "flex-none justify-center" : void 0,
5955
- children: displayValue ?? (icons?.[value] ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("i", {
5956
- "aria-hidden": "true",
5957
- className: `${icons[value]} inline-block shrink-0 text-base`
5958
- }), /* @__PURE__ */ jsx("span", {
5959
- className: "sr-only",
5960
- children: selected?.label
5961
- })] }) : void 0)
5962
- })
5963
- });
5964
- return /* @__PURE__ */ jsx("div", {
5965
- ref: setContainer,
5966
- className: "min-w-0",
5967
- children: /* @__PURE__ */ jsxs(Select$1, {
5968
- open,
5969
- onOpenChange: setOpen,
5970
- value: String(value),
5971
- onValueChange: (next) => {
5972
- if (next != null) onChange(next);
5973
- },
5974
- disabled: disabled || readOnly,
5975
- items: options,
5976
- children: [icons || showTooltip ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: trigger }), /* @__PURE__ */ jsx(TooltipContent, {
5977
- container,
5978
- children: selected?.label
5979
- })] }) : trigger, /* @__PURE__ */ jsx(SelectContent, {
5980
- container,
5981
- align: "start",
5982
- alignItemWithTrigger: false,
5983
- className: `${selectionMenuContentClass} w-max min-w-[max(9rem,var(--anchor-width))] max-w-(--available-width)`,
5984
- children: options.filter((option) => !option.disabled).map((option) => /* @__PURE__ */ jsxs(SelectItem, {
5985
- value: option.value,
5986
- disabled: option.disabled,
5987
- className: selectionMenuItemClass,
5988
- children: [icons?.[option.value] && /* @__PURE__ */ jsx("i", {
5989
- "aria-hidden": "true",
5990
- className: `${icons[option.value]} inline-block shrink-0 text-base`
5991
- }), option.label]
5992
- }, option.value))
5993
- })]
5994
- })
5995
- });
5996
- }
5997
- //#endregion
5998
- //#region src/workbench/browser/runtime/editor/connectionSettings.tsx
5999
- var manageAccountOption = "__manage-account__";
6000
- function ConnectionAlert({ detail, disabled, message, onRetry }) {
6001
- const t = useTranslate();
6002
- return /* @__PURE__ */ jsxs("div", {
6003
- className: "connection-alert",
6004
- role: "alert",
6005
- children: [
6006
- /* @__PURE__ */ jsx(Icon, {
6007
- name: "alert",
6008
- size: 14
6009
- }),
6010
- /* @__PURE__ */ jsxs("div", {
6011
- className: "connection-alert-message",
6012
- children: [/* @__PURE__ */ jsx("p", { children: message }), detail != null && /* @__PURE__ */ jsx("p", { children: detail })]
6013
- }),
6014
- onRetry != null && /* @__PURE__ */ jsx(Button$1, {
6015
- disabled,
6016
- onClick: onRetry,
6017
- size: "sm",
6018
- type: "button",
6019
- variant: "secondary",
6020
- children: t("inspector.account.retry")
6021
- })
6022
- ]
6023
- });
6024
- }
6025
- function AccountControlButton({ disabled, status, label, hint, onClick }) {
6026
- return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs(Button$1, {
6027
- type: "button",
6028
- variant: "outline",
6029
- size: "sm",
6030
- className: "account-control justify-between font-normal",
6031
- "data-status": status,
6032
- disabled,
6033
- onClick,
6034
- children: [/* @__PURE__ */ jsx("span", {
6035
- className: "truncate",
6036
- children: label
6037
- }), /* @__PURE__ */ jsx("i", {
6038
- "aria-hidden": "true",
6039
- className: status === "warning" ? "i-lucide-light:plus size-3.5" : "i-lucide-light:rotate-cw size-3.5"
6040
- })]
6041
- }) }), /* @__PURE__ */ jsx(TooltipContent, { children: hint ?? label })] });
6042
- }
6043
- function AccountSelect({ connections, disabled, loading = false, id, invalid, warning, addWhenEmpty, label, selectedConnection, selectedId, onChange, onManage }) {
6044
- const t = useTranslate();
6045
- const [container, setContainer] = useState(null);
6046
- const selected = selectedConnection ?? connections.find((candidate) => candidate.connectionId == selectedId);
6047
- const showLoading = loading && selected == null;
6048
- const builtInName = t("inspector.account.oomolBuiltIn");
6049
- const displayName = (connection) => accountDisplayName(connection, connection.displayName, builtInName);
6050
- const selectedLabel = selected == null ? selectedId == null ? void 0 : `${selectedId} (${t("inspector.account.unavailable")})` : `${displayName(selected)}${selected.isDefault ? ` (${t("inspector.account.teamDefault")})` : ""}`;
6051
- const missingSelected = selectedId != null && !connections.some((candidate) => candidate.connectionId == selectedId);
6052
- const items = [
6053
- ...missingSelected ? [{
6054
- value: selectedId,
6055
- label: selectedLabel,
6056
- disabled: true
6057
- }] : [],
6058
- ...connections.map((candidate) => ({
6059
- value: candidate.connectionId,
6060
- label: `${displayName(candidate)}${candidate.isDefault ? ` (${t("inspector.account.teamDefault")})` : ""}`
6061
- })),
6062
- ...onManage == null ? [] : [{
6063
- value: manageAccountOption,
6064
- label: t("inspector.account.addAccount")
6065
- }]
6066
- ];
6067
- if (!loading && addWhenEmpty && connections.length === 0 && selectedId == null) return /* @__PURE__ */ jsx(AccountControlButton, {
6068
- disabled,
6069
- status: "warning",
6070
- onClick: onManage,
6071
- label: t("inspector.account.addAccount")
6072
- });
6073
- return /* @__PURE__ */ jsxs("div", {
6074
- ref: setContainer,
6075
- className: "account-select relative min-w-0",
6076
- children: [/* @__PURE__ */ jsxs(Select$1, {
6077
- disabled: disabled || loading,
6078
- items,
6079
- value: selectedId ?? null,
6080
- onValueChange: (value) => {
6081
- if (value == null) return;
6082
- if (value == manageAccountOption) onManage?.();
6083
- else onChange(value);
6084
- },
6085
- children: [/* @__PURE__ */ jsx(SelectTrigger, {
6086
- id,
6087
- size: "field",
6088
- "aria-label": label ?? t("inspector.account.connection"),
6089
- "aria-busy": loading || void 0,
6090
- "aria-invalid": invalid || void 0,
6091
- "data-status": invalid ? "danger" : warning ? "warning" : void 0,
6092
- className: `${fieldSelectTriggerClass} account-control`,
6093
- children: /* @__PURE__ */ jsx(SelectValue, {
6094
- className: !loading && selectedId != null ? "mr-5" : void 0,
6095
- placeholder: t("inspector.account.chooseAccount"),
6096
- children: showLoading ? /* @__PURE__ */ jsxs("span", {
6097
- role: "status",
6098
- className: "flex min-w-0 items-center gap-2 text-muted-foreground",
6099
- children: [/* @__PURE__ */ jsx(Spinner, {}), /* @__PURE__ */ jsx("span", {
6100
- className: "truncate",
6101
- children: t("inspector.account.loading")
6102
- })]
6103
- }) : selected == null ? selectedLabel : /* @__PURE__ */ jsx(AccountName, {
6104
- name: displayName(selected),
6105
- builtIn: selected.builtInAccount,
6106
- truncate: true
6107
- })
6108
- })
6109
- }), /* @__PURE__ */ jsxs(SelectContent, {
6110
- container,
6111
- align: "start",
6112
- alignItemWithTrigger: false,
6113
- className: `${selectionMenuContentClass} w-max min-w-[max(9rem,var(--anchor-width))] max-w-(--available-width)`,
6114
- children: [
6115
- missingSelected && /* @__PURE__ */ jsx(SelectItem, {
6116
- value: selectedId,
6117
- disabled: true,
6118
- 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",
6119
- children: selectedLabel
6120
- }),
6121
- connections.map((candidate) => /* @__PURE__ */ jsxs(SelectItem, {
6122
- value: candidate.connectionId,
6123
- className: selectionMenuItemClass,
6124
- children: [/* @__PURE__ */ jsx(AccountName, {
6125
- name: displayName(candidate),
6126
- builtIn: candidate.builtInAccount,
6127
- truncate: true
6128
- }), candidate.isDefault ? ` (${t("inspector.account.teamDefault")})` : ""]
6129
- }, candidate.connectionId)),
6130
- onManage != null && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SelectSeparator, { className: "mx-2 bg-border/50" }), /* @__PURE__ */ jsx(SelectItem, {
6131
- value: manageAccountOption,
6132
- 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",
6133
- children: t("inspector.account.addAccount")
6134
- })] })
6135
- ]
6136
- })]
6137
- }), !loading && selectedId != null && /* @__PURE__ */ jsx(Button$1, {
6138
- className: "account-select-clear absolute top-1/2 right-7 -translate-y-1/2 text-muted-foreground",
6139
- type: "button",
6140
- variant: "ghost",
6141
- size: "icon-xs",
6142
- "aria-label": t("connectionUsage.stopUsing"),
6143
- title: t("connectionUsage.stopUsing"),
6144
- disabled,
6145
- onPointerDown: (event) => {
6146
- if (event.button == 0) onChange(void 0);
6147
- },
6148
- onClick: (event) => {
6149
- if (event.detail == 0) onChange(void 0);
6150
- },
6151
- children: /* @__PURE__ */ jsx("i", {
6152
- "aria-hidden": "true",
6153
- className: "i-lucide-light:x"
6154
- })
6155
- })]
6156
- });
6157
- }
6158
- function ConnectorAccount({ accessError, onConfigureAccess, action, actionError, actionId, activeConnections, authorizationPending, connection, connectionError, connectionId, connectors, disabled, fieldIdPrefix, loading, nodeId }) {
6159
- const t = useTranslate();
6160
- const available = activeConnections ?? [];
6161
- const accessIssue = accessError ?? (actionError?.code == "connector.access-required" || actionError?.code == "connector.access-invalid" ? actionError.message : void 0);
6162
- const pending = loading || accessIssue == null && actionError == null && (action == null || activeConnections == null && connectionError == null);
6163
- const required = !pending && (accessIssue != null || action?.authenticated == true && (connectionId == null || activeConnections != null && connection?.status != "active"));
6164
- let onManage;
6165
- let content;
6166
- if (pending) content = /* @__PURE__ */ jsx("p", { children: t("inspector.account.loading") });
6167
- else if (accessIssue != null) content = /* @__PURE__ */ jsx("p", { children: accessIssue });
6168
- else if (actionError != null || action == null) {
6169
- const canRetry = actionError?.code != "authorization.denied" && actionError?.code != "connector.action-not-found";
6170
- content = /* @__PURE__ */ jsx(ConnectionAlert, {
6171
- disabled,
6172
- message: actionError?.code == "authorization.denied" ? t("inspector.account.contactAdmin") : actionError?.message ?? t("inspector.account.statusUnavailable", { action: actionId }),
6173
- onRetry: canRetry ? () => void connectors.refresh(true) : void 0
6174
- });
6175
- } else if (connectionError != null) content = /* @__PURE__ */ jsx(ConnectionAlert, {
6176
- detail: connectionError,
6177
- disabled,
6178
- message: t("inspector.account.refreshFailed"),
6179
- onRetry: () => void connectors.refresh(true)
6180
- });
6181
- 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",
6183
- children: [/* @__PURE__ */ jsx("p", { children: t("inspector.account.connectBeforeRun", { service: action.serviceName }) }), /* @__PURE__ */ jsxs(Button$1, {
6184
- disabled: disabled || onConfigureAccess == null,
6185
- onClick: onConfigureAccess,
6186
- size: "sm",
6187
- type: "button",
6188
- children: [/* @__PURE__ */ jsx(Icon, {
6189
- "data-icon": "inline-start",
6190
- name: "plus"
6191
- }), t("inspector.account.manageAccount")]
6192
- })]
6193
- })] });
6194
- else {
6195
- onManage = onConfigureAccess;
6196
- let status;
6197
- if (connectionId != null) {
6198
- if (connection == null) status = t("inspector.account.missing");
6199
- else if (connection.status != "active") status = t(`inspector.account.status.${connection.status}`);
6200
- }
6201
- content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
6202
- authorizationPending && /* @__PURE__ */ jsx("p", { children: t("inspector.account.authorizationPending") }),
6203
- /* @__PURE__ */ jsxs(Field, {
6204
- className: "connection-field",
6205
- children: [/* @__PURE__ */ jsx(FieldLabel, {
6206
- className: "sr-only",
6207
- htmlFor: `${fieldIdPrefix}-connection`,
6208
- children: t("inspector.account.connection")
6209
- }), /* @__PURE__ */ jsx(AccountSelect, {
6210
- connections: available,
6211
- disabled,
6212
- id: `${fieldIdPrefix}-connection`,
6213
- selectedConnection: connection,
6214
- selectedId: connectionId,
6215
- onChange: (next) => void connectors.setConnection(nodeId, next),
6216
- onManage: onConfigureAccess
6217
- })]
6218
- }),
6219
- status != null && /* @__PURE__ */ jsx("p", { children: status })
6220
- ] });
6221
- }
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
- })]
6247
- })]
6248
- });
6249
- }
6250
- function TriggerConnection({ activeConnections, authorizationPending, connection, connectionError, connectionLoading, disabled, selection, onConfigureAccess, triggers }) {
6251
- const t = useTranslate();
6252
- const trigger = selection.trigger;
6253
- const providerTrigger = trigger.kind == "poll" || trigger.kind == "integration" ? trigger : void 0;
6254
- const fieldIdPrefix = `trigger-${selection.id}`;
6255
- 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,
6264
- onClick: () => onConfigureAccess?.(providerTrigger.definition.provider),
6265
- size: "xs",
6266
- type: "button",
6267
- variant: "ghost",
6268
- children: t("inspector.account.manageAccount")
6269
- })]
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,
6274
- 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
- })]
6303
- });
6304
- }
6305
- /** A persisted reference has no live account health or authorization state. */
6306
- function SavedConnectionReference({ action, connectionId }) {
6307
- 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
- })]
6325
- });
6326
- }
6327
- //#endregion
6328
6408
  //#region src/workbench/browser/runtime/editor/actionSelectionDialog.tsx
6329
- function ActionSelectionDialog({ title, entries, connectors, prepareAction, disabled, createEntry, onSave, settings, trigger, triggerHint }) {
6409
+ function ActionSelectionDialog({ title, entries, connectors, prepareAction, disabled, createEntry, onSave, notify, settings, trigger, triggerHint }) {
6330
6410
  const t = useTranslate();
6331
6411
  const [open, setOpen] = useState(false);
6332
6412
  const [root, setRoot] = useState(null);
@@ -6368,6 +6448,7 @@ function ActionSelectionDialog({ title, entries, connectors, prepareAction, disa
6368
6448
  children: t("actionPicker.description")
6369
6449
  }),
6370
6450
  /* @__PURE__ */ jsx(ActionSelectionEditor, {
6451
+ notify,
6371
6452
  entries,
6372
6453
  connectors,
6373
6454
  prepareAction,
@@ -6391,7 +6472,7 @@ function ActionSelectionDialog({ title, entries, connectors, prepareAction, disa
6391
6472
  })
6392
6473
  });
6393
6474
  }
6394
- function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, createEntry, onSave, onCancel, settings }) {
6475
+ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, createEntry, onSave, notify, onCancel, settings }) {
6395
6476
  const t = useTranslate();
6396
6477
  const [draft, setDraft] = useState(entries);
6397
6478
  const actions = useVal(connectors.$.actions);
@@ -6399,7 +6480,6 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6399
6480
  const [initialEntries] = useState(entries);
6400
6481
  const [displayOrder, setDisplayOrder] = useState(entries.length === 0 ? [] : null);
6401
6482
  const [prepared, setPrepared] = useState({});
6402
- const [error, setError] = useState();
6403
6483
  const [attempt, setAttempt] = useState(0);
6404
6484
  const [preparationErrors, setPreparationErrors] = useState({});
6405
6485
  const discovered = useRef(/* @__PURE__ */ new Map());
@@ -6492,6 +6572,7 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6492
6572
  if (preparationErrors[entry.action] != null) return 0;
6493
6573
  const resolved = prepared[entry.action];
6494
6574
  if (!resolved?.action.authenticated) return 2;
6575
+ if (entry.connectionId === "") return 2;
6495
6576
  if (entry.connectionId == null) return 1;
6496
6577
  return resolved.connections.some((account) => account.connectionId === entry.connectionId && account.status === "active") ? 2 : 0;
6497
6578
  };
@@ -6518,7 +6599,6 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6518
6599
  const refresh = async () => {
6519
6600
  setDisplayOrder((current) => current ?? draft.map((entry) => entry.action));
6520
6601
  setRefreshing(true);
6521
- setError(void 0);
6522
6602
  const controller = new AbortController();
6523
6603
  try {
6524
6604
  const services = new Set(draft.flatMap((entry) => {
@@ -6532,7 +6612,7 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6532
6612
  setPrepared({});
6533
6613
  setAttempt((value) => value + 1);
6534
6614
  } catch (cause) {
6535
- if (mounted.current) setError(cause instanceof Error ? cause.message : String(cause));
6615
+ if (mounted.current) notify(errorNotice(cause, t));
6536
6616
  } finally {
6537
6617
  if (mounted.current) setRefreshing(false);
6538
6618
  controller.abort();
@@ -6603,7 +6683,7 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6603
6683
  const action = resolved?.action ?? discovered.current.get(entry.action) ?? actions[entry.action];
6604
6684
  const accounts = resolved?.connections ?? [];
6605
6685
  const selected = connections.find((account) => account.connectionId == entry.connectionId);
6606
- const accountInvalid = resolved != null && action?.authenticated && entry.connectionId != null && !accounts.some((account) => account.connectionId == entry.connectionId && account.status == "active");
6686
+ const accountInvalid = resolved != null && action?.authenticated && entry.connectionId != null && entry.connectionId !== "" && !accounts.some((account) => account.connectionId == entry.connectionId && account.status == "active");
6607
6687
  return /* @__PURE__ */ jsxs("section", {
6608
6688
  className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-2.5 gap-y-1 py-4 first:pt-1 last:pb-1",
6609
6689
  children: [/* @__PURE__ */ jsxs("div", {
@@ -6701,7 +6781,7 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6701
6781
  selectedId: entry.connectionId,
6702
6782
  invalid: accountInvalid === true,
6703
6783
  warning: entry.connectionId == null,
6704
- addWhenEmpty: true,
6784
+ allowDeferred: true,
6705
6785
  label: t("actionPicker.accountFor", { action: action?.name ?? entry.action }),
6706
6786
  disabled,
6707
6787
  onChange: (connectionId) => {
@@ -6711,7 +6791,7 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6711
6791
  connectionId
6712
6792
  });
6713
6793
  },
6714
- onManage: resolved == null ? void 0 : () => void connectors.connect(resolved.action.serviceId).catch((cause) => setError(String(cause)))
6794
+ onManage: resolved == null ? void 0 : () => void connectors.connect(resolved.action.serviceId)
6715
6795
  })
6716
6796
  })]
6717
6797
  }, entry.id ?? entry.action);
@@ -6720,10 +6800,10 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6720
6800
  })]
6721
6801
  })]
6722
6802
  }),
6723
- (error != null || attempted && !valid) && /* @__PURE__ */ jsx("div", {
6803
+ attempted && !valid && /* @__PURE__ */ jsx("div", {
6724
6804
  role: "alert",
6725
6805
  className: "flex items-center gap-2 px-4 pb-3 text-destructive",
6726
- children: /* @__PURE__ */ jsx("span", { children: error ?? t("agent.invalidValues") })
6806
+ children: /* @__PURE__ */ jsx("span", { children: t("agent.invalidValues") })
6727
6807
  }),
6728
6808
  /* @__PURE__ */ jsx("div", { className: "mx-4 h-px shrink-0 bg-border/50" }),
6729
6809
  /* @__PURE__ */ jsxs("div", {
@@ -6744,11 +6824,10 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
6744
6824
  onClick: async () => {
6745
6825
  setAttempted(true);
6746
6826
  if (!valid) return;
6747
- setError(void 0);
6748
6827
  try {
6749
- if (!await onSave(draft)) setError(t("actionPicker.saveFailed"));
6828
+ await onSave(draft);
6750
6829
  } catch (cause) {
6751
- setError(cause instanceof Error ? cause.message : String(cause));
6830
+ notify(errorNotice(cause, t));
6752
6831
  }
6753
6832
  },
6754
6833
  children: t("common.save")
@@ -20811,11 +20890,12 @@ function PurposeField({ compact = false, ...props }) {
20811
20890
  }
20812
20891
  //#endregion
20813
20892
  //#region src/workbench/browser/runtime/editor/agentTools.tsx
20814
- function EditableAgentTools({ config, disabled, inputs, connectors, prepareAction, onSave }) {
20893
+ function EditableAgentTools({ config, disabled, inputs, connectors, prepareAction, onSave, notify }) {
20815
20894
  const t = useTranslate();
20816
20895
  const catalog = useVal(connectors.$.actions);
20817
20896
  const summary = actionSummary(config.tools, catalog, []);
20818
20897
  return /* @__PURE__ */ jsx(ActionSelectionDialog, {
20898
+ notify,
20819
20899
  title: t("agent.tools"),
20820
20900
  triggerHint: summary.count > 0 ? t("actionPicker.selectionSummary", {
20821
20901
  actions: summary.count,
@@ -20912,9 +20992,11 @@ function AgentToolSettings({ entry: tool, onChange, disabled, onValidChange, inp
20912
20992
  }
20913
20993
  function AgentTools(props) {
20914
20994
  const t = useTranslate();
20915
- if (props.connectors != null) return /* @__PURE__ */ jsx(EditableAgentTools, {
20916
- ...props,
20917
- connectors: props.connectors
20995
+ if (props.editor != null) return /* @__PURE__ */ jsx(EditableAgentTools, {
20996
+ config: props.config,
20997
+ disabled: props.disabled,
20998
+ inputs: props.inputs,
20999
+ ...props.editor
20918
21000
  });
20919
21001
  if (props.config.tools.length === 0) return null;
20920
21002
  return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
@@ -20930,7 +21012,7 @@ function AgentTools(props) {
20930
21012
  /* @__PURE__ */ jsx("summary", { children: tool.name || tool.action }),
20931
21013
  /* @__PURE__ */ jsxs("p", {
20932
21014
  className: "reference-value",
20933
- children: [tool.action, tool.connectionId == null ? "" : ` · ${tool.connectionId}`]
21015
+ children: [tool.action, tool.connectionId == null ? "" : ` · ${tool.connectionId === "" ? t("inspector.account.deferred") : tool.connectionId}`]
20934
21016
  }),
20935
21017
  /* @__PURE__ */ jsx(AgentToolSettings, {
20936
21018
  entry: tool,
@@ -21146,15 +21228,22 @@ function AgentAdvancedSettings() {
21146
21228
  function EditableAgentSettingsProvider({ children, task, nodeId, store, connectors, prepareAction, disabled, theme }) {
21147
21229
  const t = useTranslate();
21148
21230
  const [config, renderConfig] = useState(task.executor);
21149
- const [saveError, setSaveError] = useState();
21231
+ const [validationError, setValidationError] = useState();
21232
+ const [saveFailed, setSaveFailed] = useState(false);
21150
21233
  const [flowId] = useState(store.$.flowId.value);
21151
21234
  const [changes] = useState(() => new TaskExecutorChanges(task.executor, async (before, value) => {
21152
21235
  if (store.$.flowId.value != flowId) return false;
21153
21236
  const current = store.$.revision.value?.node(nodeId);
21154
21237
  const definition = current?.kind == "task" ? current.definition : void 0;
21155
- if (definition == null || !("executor" in definition) || !dequal(definition.executor, before)) return false;
21238
+ if (definition == null || !("executor" in definition) || !dequal(definition.executor, before)) {
21239
+ store.notify({
21240
+ kind: "error",
21241
+ message: t("notice.error.flowConflict")
21242
+ });
21243
+ return false;
21244
+ }
21156
21245
  const decoded = decodeRevisionContent({
21157
- modelVersion: 6,
21246
+ modelVersion: 8,
21158
21247
  modules: {},
21159
21248
  document: {
21160
21249
  bindings: {},
@@ -21184,20 +21273,22 @@ function EditableAgentSettingsProvider({ children, task, nodeId, store, connecto
21184
21273
  renderConfig(changes.value);
21185
21274
  }, [changes, task.executor]);
21186
21275
  const save = async () => {
21276
+ setSaveFailed(false);
21187
21277
  const value = changes.value;
21188
21278
  const notificationInputs = (value.kind === "agent" ? value.notification : void 0)?.inputDefinitions ?? [];
21189
21279
  if (value.kind == "agent" && (!value.model.trim() || !Number.isSafeInteger(value.maxRounds) || value.maxRounds < 1 || value.maxRounds > 100)) return false;
21190
21280
  if (!agentFixedValuesValid(value, notificationInputs)) {
21191
- setSaveError(t("agent.invalidValues"));
21281
+ setValidationError(t("agent.invalidValues"));
21192
21282
  return false;
21193
21283
  }
21194
- setSaveError(void 0);
21284
+ setValidationError(void 0);
21195
21285
  try {
21196
21286
  const saved = await changes.save();
21197
- if (!saved) setSaveError(t("agent.saveFailed"));
21287
+ setSaveFailed(!saved);
21198
21288
  return saved;
21199
21289
  } catch (cause) {
21200
- setSaveError(cause instanceof Error ? cause.message : String(cause));
21290
+ setSaveFailed(true);
21291
+ store.notify(errorNotice(cause, t));
21201
21292
  return false;
21202
21293
  }
21203
21294
  };
@@ -21213,16 +21304,33 @@ function EditableAgentSettingsProvider({ children, task, nodeId, store, connecto
21213
21304
  task,
21214
21305
  config,
21215
21306
  nodeId,
21216
- connectors,
21217
- prepareAction,
21307
+ toolsEditor: {
21308
+ connectors,
21309
+ prepareAction,
21310
+ notify: store.notify,
21311
+ onSave: async (tools) => {
21312
+ const previous = config.tools;
21313
+ setConfig((before) => before.kind == "agent" ? {
21314
+ ...before,
21315
+ tools
21316
+ } : before, false);
21317
+ const saved = await save();
21318
+ if (!saved) setConfig((before) => before.kind == "agent" && before.tools === tools ? {
21319
+ ...before,
21320
+ tools: previous
21321
+ } : before, false);
21322
+ return saved;
21323
+ }
21324
+ },
21218
21325
  disabled,
21219
21326
  theme,
21220
- saveError,
21327
+ validationError,
21221
21328
  setConfig,
21222
- save
21329
+ save,
21330
+ saveFailed
21223
21331
  });
21224
21332
  }
21225
- function AgentSettingsContent({ children, task, config, nodeId, connectors, prepareAction, disabled, theme, saveError, setConfig, save }) {
21333
+ function AgentSettingsContent({ children, task, config, nodeId, toolsEditor, disabled, theme, validationError, setConfig, save, saveFailed = false }) {
21226
21334
  const t = useTranslate();
21227
21335
  const inputs = task.inputs.filter((port) => "handle" in port);
21228
21336
  const promptSection = /* @__PURE__ */ jsxs("section", {
@@ -21237,30 +21345,16 @@ function AgentSettingsContent({ children, task, config, nodeId, connectors, prep
21237
21345
  config,
21238
21346
  disabled,
21239
21347
  inputs,
21240
- connectors,
21241
- prepareAction,
21242
- onSave: async (tools) => {
21243
- const previous = config.tools;
21244
- setConfig?.((before) => before.kind == "agent" ? {
21245
- ...before,
21246
- tools
21247
- } : before, false);
21248
- const saved = await save?.();
21249
- if (!saved) setConfig?.((before) => before.kind == "agent" && before.tools === tools ? {
21250
- ...before,
21251
- tools: previous
21252
- } : before, false);
21253
- return saved ?? false;
21254
- }
21348
+ editor: toolsEditor
21255
21349
  })]
21256
21350
  }), /* @__PURE__ */ jsxs("div", {
21257
21351
  className: "inspector-section-content",
21258
21352
  "data-inset": true,
21259
21353
  children: [/* @__PURE__ */ jsx(ValueEditorFeedback, {
21260
- error: saveError,
21354
+ error: validationError,
21261
21355
  children: (errorId) => /* @__PURE__ */ jsx(PromptEditor, {
21262
21356
  ariaDescribedBy: errorId,
21263
- invalid: saveError != null,
21357
+ invalid: validationError != null,
21264
21358
  value: config.prompt,
21265
21359
  inputs: inputs.map((port) => port.handle),
21266
21360
  disabled,
@@ -21271,7 +21365,7 @@ function AgentSettingsContent({ children, task, config, nodeId, connectors, prep
21271
21365
  } : before, false),
21272
21366
  onSave: () => void save?.()
21273
21367
  })
21274
- }), saveError != null && /* @__PURE__ */ jsx("div", {
21368
+ }), (saveFailed || validationError != null) && /* @__PURE__ */ jsx("div", {
21275
21369
  className: "form-actions code-actions",
21276
21370
  children: /* @__PURE__ */ jsx(Button$1, {
21277
21371
  type: "button",
@@ -22310,7 +22404,7 @@ function codeTyping(ports, capabilities = [], catalog = {}, providerIds = []) {
22310
22404
  const output = definition?.outputSchema == null ? "unknown" : typescriptOf(definition.outputSchema, false);
22311
22405
  const ids = declaration.connections.map((connection) => JSON.stringify(connection.connectionId)).join(" | ") || "never";
22312
22406
  const aliases = declaration.connections.flatMap((connection) => connection.alias == null ? [] : [JSON.stringify(connection.alias)]).join(" | ") || "never";
22313
- const options = permissions?.mode == "independent" ? declaration.connectionId == null ? "{ connectionId?: never }" : `{ connectionId?: ${JSON.stringify(declaration.connectionId)} }` : permissions?.mode == "shared" ? "{ connectionId?: string }" : declaration.connections.length == 0 ? dynamicOptions : `{ connectionId: ${ids}; connectionAlias?: never } | { connectionAlias: ${aliases}; connectionId?: never }`;
22407
+ const options = permissions?.mode == "independent" ? declaration.connectionId == null || declaration.connectionId === "" ? "{ connectionId?: never }" : `{ connectionId?: ${JSON.stringify(declaration.connectionId)} }` : permissions?.mode == "shared" ? "{ connectionId?: string }" : declaration.connections.length == 0 ? dynamicOptions : `{ connectionId: ${ids}; connectionAlias?: never } | { connectionAlias: ${aliases}; connectionId?: never }`;
22314
22408
  const args = declaration.connections.length > 0 && declaration.connectionId == null ? `[input: {} extends ${input} ? ${input} | undefined : ${input}, options: ${options}]` : `{} extends ${input} ? [input?: ${input}, options?: ${options}] : [input: ${input}, options?: ${options}]`;
22315
22409
  const signature = `(...args: ${args}) => Promise<${output}>`;
22316
22410
  calls.push(`(...args: [actionId: ${JSON.stringify(declaration.action)}, ...args: ${args}]): Promise<${output}>`);
@@ -22369,34 +22463,31 @@ function EditableCodeTaskSection({ connectorAccess, connectorCandidates, connect
22369
22463
  const allowSharedAction = (action) => !action.authenticated || connectorAccess?.mode == "implicit" || connectorAccess?.bindings.some((binding) => binding.status == "active" && binding.providerId == action.serviceId && connectorCandidates?.[action.serviceId]?.candidates.some((candidate) => candidate.accessBindingId == binding.accessBindingId && (candidate.permissions == null || candidate.permissions.allActions || candidate.permissions.actionIds.includes(action.actionId))));
22370
22464
  const sharedActionCatalog = Object.fromEntries(Object.entries(useVal(completionCatalog.catalog)).filter(([, action]) => allowSharedAction(action)));
22371
22465
  const t = useTranslate();
22372
- const [saveError, setSaveError] = useState();
22466
+ const [loadError, setLoadError] = useState();
22373
22467
  const [completionError, setCompletionError] = useState();
22374
22468
  const [pending, setPending] = useState(false);
22375
22469
  useEffect(() => setPermission(savedPermission), [savedPermission, selection.id]);
22376
22470
  const permissionActions = permission?.mode == "independent" ? permission.actions.map((entry) => entry.action).join(",") : "";
22377
22471
  useEffect(() => {
22472
+ setLoadError(void 0);
22378
22473
  if (permissionActions == "") return;
22379
22474
  const controller = new AbortController();
22380
22475
  Promise.all(permissionActions.split(",").map((id) => connectors.loadCodeAction(id, controller.signal))).then(() => {
22381
22476
  const services = new Set(permissionActions.split(",").map((id) => id.split(".")[0]));
22382
22477
  return Promise.all([...services].map((id) => connectors.loadCodeConnections(id, controller.signal)));
22383
22478
  }).catch((cause) => {
22384
- if (!controller.signal.aborted) setSaveError(String(cause));
22479
+ if (!controller.signal.aborted) setLoadError(String(cause));
22385
22480
  });
22386
22481
  return () => controller.abort();
22387
22482
  }, [connectors, permissionActions]);
22388
22483
  const savePermission = async (value) => {
22389
22484
  setPending(true);
22390
- setSaveError(void 0);
22391
22485
  try {
22392
- if (!await store.setCodeActions(selection.id, [value])) {
22393
- setSaveError(t("inspector.task.permissionSaveFailed"));
22394
- return false;
22395
- }
22486
+ if (!await store.setCodeActions(selection.id, [value])) return false;
22396
22487
  setPermission(value);
22397
22488
  return true;
22398
22489
  } catch (cause) {
22399
- setSaveError(cause instanceof Error ? cause.message : String(cause));
22490
+ store.notify(errorNotice(cause, t));
22400
22491
  return false;
22401
22492
  } finally {
22402
22493
  setPending(false);
@@ -22429,9 +22520,10 @@ function EditableCodeTaskSection({ connectorAccess, connectorCandidates, connect
22429
22520
  if (!("moduleId" in task)) return null;
22430
22521
  const selectedActions = permission?.mode == "independent" ? permission.actions : [];
22431
22522
  const summary = actionSummary(selectedActions, hintedCatalog, providers.data ?? []);
22432
- const actionIssue = saveError != null || diagnostics?.some((item) => item.path.includes("/task/capabilities")) || selectedActions.some((entry) => {
22523
+ const actionIssue = loadError != null || diagnostics?.some((item) => item.path.includes("/task/capabilities")) || selectedActions.some((entry) => {
22433
22524
  const action = hintedCatalog[entry.action];
22434
22525
  if (action == null || !action.authenticated) return false;
22526
+ if (entry.connectionId === "") return false;
22435
22527
  if (entry.connectionId == null) return true;
22436
22528
  const catalog = accountCatalogs[action.serviceId];
22437
22529
  return catalog != null && catalog.byId.get(entry.connectionId)?.status !== "active";
@@ -22463,6 +22555,7 @@ function EditableCodeTaskSection({ connectorAccess, connectorCandidates, connect
22463
22555
  store.saveModuleEditor();
22464
22556
  },
22465
22557
  actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [false, /* @__PURE__ */ jsx(ActionSelectionDialog, {
22558
+ notify: store.notify,
22466
22559
  title: t("actionPicker.configureActions"),
22467
22560
  triggerHint: selectedActions.length > 0 ? t("actionPicker.selectionSummary", {
22468
22561
  actions: selectedActions.length,
@@ -22500,13 +22593,13 @@ function EditableCodeTaskSection({ connectorAccess, connectorCandidates, connect
22500
22593
  })
22501
22594
  }, selection.id)] }),
22502
22595
  children: [
22503
- (saveError ?? completionError) != null && /* @__PURE__ */ jsxs("div", {
22596
+ (loadError ?? completionError) != null && /* @__PURE__ */ jsxs("div", {
22504
22597
  className: "flex flex-col gap-2",
22505
22598
  "data-inspector-section": "code-permissions",
22506
- children: [false, (saveError ?? completionError) != null && /* @__PURE__ */ jsx("p", {
22599
+ children: [false, (loadError ?? completionError) != null && /* @__PURE__ */ jsx("p", {
22507
22600
  role: "alert",
22508
22601
  className: "text-sm text-destructive",
22509
- children: saveError ?? completionError
22602
+ children: loadError ?? completionError
22510
22603
  })]
22511
22604
  }),
22512
22605
  /* @__PURE__ */ jsx(ValueEditorFeedback, {
@@ -26635,6 +26728,14 @@ if (process.env.NODE_ENV !== "production") GroupCollectionContext.displayName =
26635
26728
  function useGroupCollectionContext() {
26636
26729
  return React.useContext(GroupCollectionContext);
26637
26730
  }
26731
+ function GroupCollectionProvider(props) {
26732
+ const { children, items } = props;
26733
+ const contextValue = React.useMemo(() => ({ items }), [items]);
26734
+ return /*#__PURE__*/ jsx(GroupCollectionContext.Provider, {
26735
+ value: contextValue,
26736
+ children
26737
+ });
26738
+ }
26638
26739
  //#endregion
26639
26740
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js
26640
26741
  /**
@@ -26917,6 +27018,77 @@ var ComboboxPopup = /*#__PURE__*/ React.forwardRef(function ComboboxPopup(compon
26917
27018
  });
26918
27019
  if (process.env.NODE_ENV !== "production") ComboboxPopup.displayName = "ComboboxPopup";
26919
27020
  //#endregion
27021
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/group/ComboboxGroupContext.js
27022
+ var ComboboxGroupContext = /*#__PURE__*/ React.createContext(void 0);
27023
+ if (process.env.NODE_ENV !== "production") ComboboxGroupContext.displayName = "ComboboxGroupContext";
27024
+ function useComboboxGroupContext() {
27025
+ const context = React.useContext(ComboboxGroupContext);
27026
+ 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));
27027
+ return context;
27028
+ }
27029
+ //#endregion
27030
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/group/ComboboxGroup.js
27031
+ /**
27032
+ * Groups related items with the corresponding label.
27033
+ * Renders a `<div>` element.
27034
+ *
27035
+ * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
27036
+ */
27037
+ var ComboboxGroup = /*#__PURE__*/ React.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {
27038
+ const { render, className, style, items, ...elementProps } = componentProps;
27039
+ const [labelId, setLabelId] = React.useState();
27040
+ const contextValue = React.useMemo(() => ({
27041
+ labelId,
27042
+ setLabelId,
27043
+ items
27044
+ }), [
27045
+ labelId,
27046
+ setLabelId,
27047
+ items
27048
+ ]);
27049
+ const element = useRenderElement("div", componentProps, {
27050
+ ref: forwardedRef,
27051
+ props: [{
27052
+ role: "group",
27053
+ "aria-labelledby": labelId
27054
+ }, elementProps]
27055
+ });
27056
+ const wrappedElement = /*#__PURE__*/ jsx(ComboboxGroupContext.Provider, {
27057
+ value: contextValue,
27058
+ children: element
27059
+ });
27060
+ if (items) return /*#__PURE__*/ jsx(GroupCollectionProvider, {
27061
+ items,
27062
+ children: wrappedElement
27063
+ });
27064
+ return wrappedElement;
27065
+ });
27066
+ if (process.env.NODE_ENV !== "production") ComboboxGroup.displayName = "ComboboxGroup";
27067
+ //#endregion
27068
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/group-label/ComboboxGroupLabel.js
27069
+ /**
27070
+ * An accessible label that is automatically associated with its parent group.
27071
+ * Renders a `<div>` element.
27072
+ *
27073
+ * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
27074
+ */
27075
+ var ComboboxGroupLabel = /*#__PURE__*/ React.forwardRef(function ComboboxGroupLabel(componentProps, forwardedRef) {
27076
+ const { render, className, style, id: idProp, ...elementProps } = componentProps;
27077
+ const { setLabelId } = useComboboxGroupContext();
27078
+ const id = useBaseUiId(idProp);
27079
+ useIsoLayoutEffect(() => {
27080
+ setLabelId(id);
27081
+ return () => {
27082
+ setLabelId(void 0);
27083
+ };
27084
+ }, [id, setLabelId]);
27085
+ return useRenderElement("div", componentProps, {
27086
+ ref: forwardedRef,
27087
+ props: [{ id }, elementProps]
27088
+ });
27089
+ });
27090
+ if (process.env.NODE_ENV !== "production") ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
27091
+ //#endregion
26920
27092
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/item/ComboboxItemContext.js
26921
27093
  var ComboboxItemContext = /*#__PURE__*/ React.createContext(void 0);
26922
27094
  if (process.env.NODE_ENV !== "production") ComboboxItemContext.displayName = "ComboboxItemContext";
@@ -27419,7 +27591,7 @@ function ErrorTriggerSourcesEditor({ store, nodeId, value, disabled }) {
27419
27591
  }
27420
27592
  //#endregion
27421
27593
  //#region src/workbench/browser/runtime/createEventSourceDialog.tsx
27422
- function CreateEventSourceDialog({ client, teamId, existingNames, disabled, defaultOpen = false, className, trigger, onSelect, onCreated }) {
27594
+ function CreateEventSourceDialog({ client, notify, teamId, existingNames, disabled, defaultOpen = false, className, trigger, onSelect, onCreated }) {
27423
27595
  const t = useTranslate();
27424
27596
  const [open, setOpen] = useState(defaultOpen);
27425
27597
  const [root, setRoot] = useState(null);
@@ -27428,16 +27600,13 @@ function CreateEventSourceDialog({ client, teamId, existingNames, disabled, defa
27428
27600
  const [created, setCreated] = useState();
27429
27601
  const [selected, setSelected] = useState(false);
27430
27602
  const [pending, setPending] = useState(false);
27431
- const [error, setError] = useState();
27432
27603
  async function select(source) {
27433
27604
  setPending(true);
27434
- setError(void 0);
27435
27605
  try {
27436
27606
  const saved = await onSelect(source);
27437
27607
  setSelected(saved);
27438
- if (!saved) setError(t("eventSources.bindFailed"));
27439
27608
  } catch (cause) {
27440
- setError(errorNotice(cause, t).message);
27609
+ notify(errorNotice(cause, t));
27441
27610
  } finally {
27442
27611
  setPending(false);
27443
27612
  }
@@ -27453,7 +27622,6 @@ function CreateEventSourceDialog({ client, teamId, existingNames, disabled, defa
27453
27622
  if (value) {
27454
27623
  setCreated(void 0);
27455
27624
  setSelected(false);
27456
- setError(void 0);
27457
27625
  }
27458
27626
  },
27459
27627
  children: [/* @__PURE__ */ jsx(DialogTrigger, {
@@ -27476,6 +27644,7 @@ function CreateEventSourceDialog({ client, teamId, existingNames, disabled, defa
27476
27644
  /* @__PURE__ */ jsxs("div", {
27477
27645
  className: "min-h-0 overflow-y-auto",
27478
27646
  children: [open && created == null && /* @__PURE__ */ jsx(SourceForm, {
27647
+ notify,
27479
27648
  client,
27480
27649
  teams: [],
27481
27650
  fixedTeamId: teamId,
@@ -27495,15 +27664,11 @@ function CreateEventSourceDialog({ client, teamId, existingNames, disabled, defa
27495
27664
  children: created.name
27496
27665
  }),
27497
27666
  /* @__PURE__ */ jsx(EventSourceSetup, {
27667
+ notify,
27498
27668
  source: created,
27499
27669
  client,
27500
27670
  onChange: setCreated
27501
27671
  }),
27502
- error != null && /* @__PURE__ */ jsx("p", {
27503
- role: "alert",
27504
- className: "m-0 text-sm text-destructive",
27505
- children: error
27506
- }),
27507
27672
  /* @__PURE__ */ jsxs("div", {
27508
27673
  className: "flex justify-end gap-2",
27509
27674
  children: [!selected && /* @__PURE__ */ jsx(Button$1, {
@@ -28796,6 +28961,7 @@ function FeishuTriggerConfig({ inputs, fieldLabels, config: assignments, nodeId,
28796
28961
  }) : /* @__PURE__ */ jsxs("div", {
28797
28962
  className: "flex h-[30px] w-full items-center overflow-hidden rounded-[var(--ui-control-radius,var(--ui-radius))] border border-input bg-[var(--ui-control-background,var(--ui-muted))]",
28798
28963
  children: [/* @__PURE__ */ jsx(CreateEventSourceDialog, {
28964
+ notify: store.notify,
28799
28965
  className: "min-w-0 flex-1",
28800
28966
  trigger: /* @__PURE__ */ jsx(Button$1, {
28801
28967
  type: "button",
@@ -28982,21 +29148,25 @@ function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
28982
29148
  const controller = new AbortController();
28983
29149
  setState((previous) => ({
28984
29150
  flowId,
29151
+ source,
28985
29152
  loading: true,
28986
- bots: previous?.flowId == flowId ? previous.bots : void 0
29153
+ bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0
28987
29154
  }));
28988
29155
  source.listLeinaBots(flowId, controller.signal).then((bots) => {
28989
29156
  if (!controller.signal.aborted) setState({
28990
29157
  flowId,
29158
+ source,
28991
29159
  bots,
28992
29160
  loading: false
28993
29161
  });
28994
29162
  }, (error) => {
28995
- if (!controller.signal.aborted) setState({
29163
+ if (!controller.signal.aborted) setState((previous) => ({
28996
29164
  flowId,
29165
+ source,
29166
+ bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0,
28997
29167
  loading: false,
28998
29168
  error: error instanceof Error ? error.message : t("contextPanel.loadFailed")
28999
- });
29169
+ }));
29000
29170
  });
29001
29171
  return () => controller.abort();
29002
29172
  }, [
@@ -29005,73 +29175,82 @@ function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
29005
29175
  attempt,
29006
29176
  t
29007
29177
  ]);
29008
- const current = state?.flowId == flowId ? state : void 0;
29178
+ const current = state?.flowId == flowId && state.source == source ? state : void 0;
29009
29179
  const bots = current?.bots;
29010
- const selected = typeof value == "string" ? value : value === void 0 ? void 0 : JSON.stringify(value);
29180
+ const selected = typeof value == "string" && value.trim().length > 0 ? value : void 0;
29011
29181
  const missing = selected != null && bots != null && !bots.some((bot) => bot.leinaId == selected);
29182
+ const error = selected == null ? t("leina.select") : missing ? t("leina.unavailable", { id: selected }) : void 0;
29183
+ 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
29184
  const items = [...(bots ?? []).map((bot) => ({
29013
29185
  value: bot.leinaId,
29014
29186
  label: bot.name
29015
29187
  })), ...selected != null && !bots?.some((bot) => bot.leinaId == selected) ? [{
29016
29188
  value: selected,
29017
- label: missing ? t("leina.unavailable", { id: selected }) : selected
29189
+ label: selectedLabel
29018
29190
  }] : []];
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")
29191
+ return /* @__PURE__ */ jsx(ValueEditorFeedback, {
29192
+ error,
29193
+ children: (errorId) => /* @__PURE__ */ jsxs(Select$1, {
29194
+ items,
29195
+ value: selected ?? null,
29196
+ disabled,
29197
+ onOpenChange: (open) => {
29198
+ if (open) setAttempt((previous) => previous + 1);
29199
+ },
29200
+ onValueChange: (next) => {
29201
+ if (typeof next == "string" && bots?.some((bot) => bot.leinaId == next)) onChange(next);
29202
+ },
29203
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
29204
+ size: "field",
29205
+ className: "w-full",
29206
+ "data-field-control": true,
29207
+ "aria-label": t("leina.robot"),
29208
+ "aria-invalid": error != null || void 0,
29209
+ "aria-describedby": errorId,
29210
+ children: /* @__PURE__ */ jsx(SelectValue, {
29211
+ placeholder: t("leina.select"),
29212
+ children: selected == null ? void 0 : selectedLabel
29072
29213
  })
29073
- ]
29074
- })]
29214
+ }), /* @__PURE__ */ jsxs(SelectContent, {
29215
+ align: "start",
29216
+ alignItemWithTrigger: false,
29217
+ className: selectionMenuContentClass,
29218
+ children: [
29219
+ (current?.loading ?? true) && /* @__PURE__ */ jsx("span", {
29220
+ role: "status",
29221
+ className: "block px-1.5 py-1 text-xs leading-5 text-muted-foreground",
29222
+ children: t("leina.loading")
29223
+ }),
29224
+ bots?.map((bot) => /* @__PURE__ */ jsx(SelectItem, {
29225
+ value: bot.leinaId,
29226
+ className: selectionMenuItemClass,
29227
+ children: /* @__PURE__ */ jsx("span", {
29228
+ className: "truncate",
29229
+ children: bot.name
29230
+ })
29231
+ }, bot.leinaId)),
29232
+ missing && selected != null && /* @__PURE__ */ jsx(SelectItem, {
29233
+ value: selected,
29234
+ disabled: true,
29235
+ 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`,
29236
+ children: t("leina.unavailable", { id: selected })
29237
+ }),
29238
+ current?.error != null && /* @__PURE__ */ jsxs("span", {
29239
+ role: "alert",
29240
+ className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal break-words text-destructive",
29241
+ children: [
29242
+ t("leina.loadFailed"),
29243
+ " ",
29244
+ current.error
29245
+ ]
29246
+ }),
29247
+ bots?.length == 0 && !current?.loading && /* @__PURE__ */ jsx("span", {
29248
+ className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal text-muted-foreground",
29249
+ children: t("leina.empty")
29250
+ })
29251
+ ]
29252
+ })]
29253
+ })
29075
29254
  });
29076
29255
  }
29077
29256
  //#endregion
@@ -34046,22 +34225,26 @@ function ListenerHealth({ binding, enabled }) {
34046
34225
  }
34047
34226
  //#endregion
34048
34227
  //#region src/workbench/browser/runtime/publications/webhookEndpoint.tsx
34049
- function WebhookCopyButton({ endpointUrl, iconOnly = false }) {
34228
+ function WebhookCopyButton({ endpointUrl, notify, iconOnly = false }) {
34050
34229
  const t = useTranslate();
34051
- const [copyResult, setCopyResult] = useState();
34230
+ const [copied, setCopied] = useState(false);
34052
34231
  const [container, setContainer] = useState(null);
34053
34232
  useEffect(() => {
34054
- if (copyResult !== "copied") return;
34055
- const timer = globalThis.setTimeout(() => setCopyResult(void 0), 1500);
34233
+ if (!copied) return;
34234
+ const timer = globalThis.setTimeout(() => setCopied(false), 1500);
34056
34235
  return () => globalThis.clearTimeout(timer);
34057
- }, [copyResult]);
34058
- const label = t(copyResult === "copied" ? "publication.webhookCopied" : copyResult === "failed" ? "webhookDeployment.copyFailed" : "publication.webhookCopy");
34236
+ }, [copied]);
34237
+ const label = t(copied ? "publication.webhookCopied" : "publication.webhookCopy");
34059
34238
  const copy = async () => {
34060
34239
  try {
34061
34240
  await navigator.clipboard.writeText(endpointUrl);
34062
- setCopyResult("copied");
34241
+ setCopied(true);
34063
34242
  } catch {
34064
- setCopyResult("failed");
34243
+ setCopied(false);
34244
+ notify({
34245
+ kind: "error",
34246
+ message: t("webhookDeployment.copyFailed")
34247
+ });
34065
34248
  }
34066
34249
  };
34067
34250
  return /* @__PURE__ */ jsxs("span", {
@@ -34076,7 +34259,7 @@ function WebhookCopyButton({ endpointUrl, iconOnly = false }) {
34076
34259
  }),
34077
34260
  children: /* @__PURE__ */ jsx("i", {
34078
34261
  "aria-hidden": "true",
34079
- className: copyResult === "copied" ? "i-lucide-light:check text-base" : "i-lucide-light:copy text-base"
34262
+ className: copied ? "i-lucide-light:check text-base" : "i-lucide-light:copy text-base"
34080
34263
  })
34081
34264
  }), /* @__PURE__ */ jsx(TooltipContent, {
34082
34265
  container,
@@ -34087,26 +34270,29 @@ function WebhookCopyButton({ endpointUrl, iconOnly = false }) {
34087
34270
  size: "sm",
34088
34271
  variant: "outline",
34089
34272
  onClick: copy,
34090
- children: t(copyResult === "copied" ? "publication.webhookCopied" : "publication.webhookCopy")
34273
+ children: label
34091
34274
  }), /* @__PURE__ */ jsx("span", {
34092
- className: iconOnly || copyResult !== "failed" ? "sr-only" : "text-xs text-destructive",
34275
+ className: "sr-only",
34093
34276
  role: "status",
34094
- children: copyResult == null ? "" : label
34277
+ children: copied ? label : ""
34095
34278
  })]
34096
34279
  });
34097
34280
  }
34098
- function WebhookEndpoint({ endpointUrl }) {
34281
+ function WebhookEndpoint({ endpointUrl, notify }) {
34099
34282
  return /* @__PURE__ */ jsxs("div", {
34100
34283
  className: "flex min-w-0 items-start gap-2",
34101
34284
  children: [/* @__PURE__ */ jsx("code", {
34102
34285
  className: "min-w-0 flex-1 select-text break-all text-foreground text-xs leading-5",
34103
34286
  children: endpointUrl
34104
- }), /* @__PURE__ */ jsx(WebhookCopyButton, { endpointUrl }, endpointUrl)]
34287
+ }), /* @__PURE__ */ jsx(WebhookCopyButton, {
34288
+ notify,
34289
+ endpointUrl
34290
+ }, endpointUrl)]
34105
34291
  });
34106
34292
  }
34107
34293
  //#endregion
34108
34294
  //#region src/workbench/browser/runtime/editor/webhookDeployment.tsx
34109
- function WebhookDeployment({ binding, status, enabled, hasUnpublishedChanges, onRetry }) {
34295
+ function WebhookDeployment({ binding, status, enabled, hasUnpublishedChanges, onRetry, notify }) {
34110
34296
  const t = useTranslate();
34111
34297
  const current = binding?.currentPublicationId != null;
34112
34298
  const ready = status === "loaded" && current;
@@ -34120,6 +34306,7 @@ function WebhookDeployment({ binding, status, enabled, hasUnpublishedChanges, on
34120
34306
  enabled
34121
34307
  })]
34122
34308
  }), ready && binding.endpointUrl != null && /* @__PURE__ */ jsx(WebhookCopyButton, {
34309
+ notify,
34123
34310
  endpointUrl: binding.endpointUrl,
34124
34311
  iconOnly: true
34125
34312
  }, binding.endpointUrl)]
@@ -34489,6 +34676,294 @@ function WebhookEditor({ bodyFields, method, options, disabled, readOnly, output
34489
34676
  ] });
34490
34677
  }
34491
34678
  //#endregion
34679
+ //#region src/workbench/browser/runtime/linkContext.ts
34680
+ /** The host owns URLs for links within the deployment. */
34681
+ var WorkbenchLinkContext = createContext(void 0);
34682
+ //#endregion
34683
+ //#region src/workbench/browser/runtime/editor/workflowSection.tsx
34684
+ function OpenWorkflowLink({ flowId }) {
34685
+ const t = useTranslate();
34686
+ const hrefFor = useContext(WorkbenchLinkContext);
34687
+ if (!flowId || hrefFor == null) return null;
34688
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
34689
+ render: /* @__PURE__ */ jsx("a", {
34690
+ className: buttonVariants({
34691
+ variant: "ghost",
34692
+ size: "icon-xs",
34693
+ className: "text-muted-foreground"
34694
+ }),
34695
+ href: hrefFor({
34696
+ flowId,
34697
+ view: "design"
34698
+ }),
34699
+ target: "_blank",
34700
+ rel: "noopener noreferrer",
34701
+ "aria-label": t("workflow.open")
34702
+ }),
34703
+ children: /* @__PURE__ */ jsx("i", {
34704
+ "aria-hidden": "true",
34705
+ className: "i-lucide-light:external-link text-sm"
34706
+ })
34707
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: t("workflow.open") })] });
34708
+ }
34709
+ function useWorkflowActions(props) {
34710
+ const t = useTranslate();
34711
+ const [state, setState] = useState();
34712
+ const request = useRef();
34713
+ const nodeId = props?.nodeId;
34714
+ useEffect(() => () => request.current?.abort(), [nodeId]);
34715
+ const current = state?.nodeId == nodeId ? state : void 0;
34716
+ async function update(choice) {
34717
+ if (props == null || props.disabled || props.task.executor.kind != "workflow") return;
34718
+ const candidate = choice ?? {
34719
+ flowId: props.task.executor.flowId,
34720
+ name: props.task.name,
34721
+ problem: null
34722
+ };
34723
+ if (!candidate.flowId) return;
34724
+ request.current?.abort();
34725
+ const controller = new AbortController();
34726
+ request.current = controller;
34727
+ const set = (next) => {
34728
+ if (!controller.signal.aborted) setState({
34729
+ nodeId: props.nodeId,
34730
+ flowId: candidate.flowId,
34731
+ ...next
34732
+ });
34733
+ };
34734
+ set({
34735
+ busy: true,
34736
+ pending: choice
34737
+ });
34738
+ let contract;
34739
+ let failure;
34740
+ try {
34741
+ if (choice?.problem == null) try {
34742
+ contract = await props.load(candidate.flowId, controller.signal);
34743
+ } catch (cause) {
34744
+ failure = errorNotice(cause, t).message;
34745
+ }
34746
+ if (controller.signal.aborted) return;
34747
+ const next = workflowSelectionTask(candidate, contract, props.task);
34748
+ if ((choice != null || contract != null) && !dequal(next, props.task)) {
34749
+ if (!await props.onSave(props.task, next)) failure = void 0;
34750
+ } else if (!controller.signal.aborted) await props.onCheck();
34751
+ } catch (cause) {
34752
+ failure = errorNotice(cause, t).message;
34753
+ } finally {
34754
+ set({
34755
+ busy: false,
34756
+ error: failure
34757
+ });
34758
+ }
34759
+ }
34760
+ return {
34761
+ busy: current?.busy ?? false,
34762
+ error: props?.task.executor.kind == "workflow" && current?.flowId == props.task.executor.flowId ? current?.error : void 0,
34763
+ pending: current?.pending,
34764
+ select: (choice) => update(choice),
34765
+ recheck: () => update()
34766
+ };
34767
+ }
34768
+ function WorkflowInterfaceAlert({ actions, disabled, message, stale, flowId }) {
34769
+ const t = useTranslate();
34770
+ return /* @__PURE__ */ jsx(InspectorStatusSection, {
34771
+ title: t(stale ? "workflow.staleTitle" : "workflow.problemTitle"),
34772
+ tone: "danger",
34773
+ section: "workflow-status",
34774
+ alert: true,
34775
+ actions: /* @__PURE__ */ jsx("span", {
34776
+ className: "ml-auto",
34777
+ children: /* @__PURE__ */ jsx(OpenWorkflowLink, { flowId })
34778
+ }),
34779
+ children: /* @__PURE__ */ jsxs("div", {
34780
+ className: "inspector-status-prompt",
34781
+ children: [/* @__PURE__ */ jsx("p", { children: actions.error || message }), /* @__PURE__ */ jsx(Button$1, {
34782
+ disabled: disabled || actions.busy,
34783
+ size: "sm",
34784
+ type: "button",
34785
+ onClick: () => void actions.recheck(),
34786
+ children: t(stale ? "workflow.refresh" : "workflow.recheck")
34787
+ })]
34788
+ })
34789
+ });
34790
+ }
34791
+ function WorkflowSection({ task, disabled, actions, list }) {
34792
+ const t = useTranslate();
34793
+ const id = useId();
34794
+ const [container, setContainer] = useState(null);
34795
+ const [loading, setLoading] = useState(false);
34796
+ const [open, setOpen] = useState(false);
34797
+ const [query, setQuery] = useState("");
34798
+ const [error, setError] = useState();
34799
+ const [choices, setChoices] = useState([]);
34800
+ const request = useRef();
34801
+ useEffect(() => () => request.current?.abort(), []);
34802
+ const target = actions.pending?.flowId ?? (task.executor.kind == "workflow" ? task.executor.flowId : "");
34803
+ const selectedName = actions.pending?.name ?? choices.find((item) => item.flowId == target)?.name ?? task.name;
34804
+ const targetError = error || (!target ? t("diagnostics.messages.workflow.target-required") : void 0);
34805
+ const visible = choices.filter((item) => `${item.name} ${item.flowId}`.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()));
34806
+ async function readChoices() {
34807
+ request.current?.abort();
34808
+ const controller = new AbortController();
34809
+ request.current = controller;
34810
+ setLoading(true);
34811
+ setError(void 0);
34812
+ try {
34813
+ const result = await list(controller.signal);
34814
+ if (!controller.signal.aborted) setChoices(result);
34815
+ } catch (cause) {
34816
+ if (!controller.signal.aborted) setError(errorNotice(cause, t).message);
34817
+ } finally {
34818
+ if (!controller.signal.aborted) setLoading(false);
34819
+ }
34820
+ }
34821
+ return /* @__PURE__ */ jsxs(Field, {
34822
+ className: "inspector-field-section",
34823
+ "data-inspector-section": "task",
34824
+ children: [/* @__PURE__ */ jsxs(FieldLabel, {
34825
+ className: "inspector-section-title justify-between",
34826
+ htmlFor: id,
34827
+ children: [/* @__PURE__ */ jsx("span", { children: t("workflow.target") }), /* @__PURE__ */ jsx(OpenWorkflowLink, { flowId: target })]
34828
+ }), /* @__PURE__ */ jsx("div", {
34829
+ ref: setContainer,
34830
+ className: "node-settings",
34831
+ children: /* @__PURE__ */ jsxs(ComboboxRoot, {
34832
+ disabled: disabled || actions.busy,
34833
+ value: target || null,
34834
+ items: visible.map((item) => item.flowId),
34835
+ filter: null,
34836
+ inputValue: open ? query : target ? selectedName : "",
34837
+ onInputValueChange: setQuery,
34838
+ onValueChange: (value) => {
34839
+ const candidate = choices.find((item) => item.flowId == value);
34840
+ if (candidate != null) actions.select(candidate);
34841
+ },
34842
+ open,
34843
+ onOpenChange: (nextOpen) => {
34844
+ setOpen(nextOpen);
34845
+ setQuery("");
34846
+ if (nextOpen) readChoices();
34847
+ },
34848
+ children: [/* @__PURE__ */ jsx(ValueEditorFeedback, {
34849
+ error: open ? void 0 : targetError,
34850
+ children: (errorId) => /* @__PURE__ */ jsxs(ComboboxInputGroup, {
34851
+ render: /* @__PURE__ */ jsx(InputGroup, {}),
34852
+ children: [
34853
+ target && /* @__PURE__ */ jsx(InputGroupAddon, {
34854
+ align: "inline-start",
34855
+ children: /* @__PURE__ */ jsx("i", {
34856
+ "aria-hidden": "true",
34857
+ className: "i-lucide-light:workflow shrink-0 text-sm"
34858
+ })
34859
+ }),
34860
+ /* @__PURE__ */ jsx(ComboboxInput, {
34861
+ render: /* @__PURE__ */ jsx(InputGroupInput, {}),
34862
+ id,
34863
+ "aria-label": t("workflow.target"),
34864
+ placeholder: t(open ? "workflow.search" : "workflow.select"),
34865
+ "aria-invalid": !!targetError || void 0,
34866
+ "aria-describedby": errorId,
34867
+ "data-field-prompt": !target || void 0
34868
+ }),
34869
+ /* @__PURE__ */ jsx(InputGroupAddon, {
34870
+ align: "inline-end",
34871
+ children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
34872
+ render: /* @__PURE__ */ jsx(ComboboxTrigger, {
34873
+ render: /* @__PURE__ */ jsx(Button$1, {
34874
+ variant: "ghost",
34875
+ size: "icon-xs"
34876
+ }),
34877
+ "aria-label": t("workflow.select")
34878
+ }),
34879
+ children: /* @__PURE__ */ jsx(SelectChevron, {})
34880
+ }), /* @__PURE__ */ jsx(TooltipContent, {
34881
+ container,
34882
+ children: t("workflow.select")
34883
+ })] })
34884
+ })
34885
+ ]
34886
+ })
34887
+ }), /* @__PURE__ */ jsx(ComboboxPortal, {
34888
+ container,
34889
+ className: "contents",
34890
+ children: /* @__PURE__ */ jsx(ComboboxPositioner, {
34891
+ align: "start",
34892
+ sideOffset: 4,
34893
+ className: "isolate z-50",
34894
+ children: /* @__PURE__ */ jsx(ComboboxPopup, {
34895
+ 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}`,
34896
+ children: /* @__PURE__ */ jsxs(ComboboxList, {
34897
+ "aria-label": t("workflow.target"),
34898
+ className: "max-h-[min(50vh,360px,calc(var(--available-height)-0.5rem))] overflow-y-auto overscroll-contain",
34899
+ children: [
34900
+ [
34901
+ "published",
34902
+ "missingStart",
34903
+ "other"
34904
+ ].map((group) => {
34905
+ const items = visible.filter((item) => workflowCandidateGroup(item) == group);
34906
+ if (!items.length && group != "published") return null;
34907
+ return /* @__PURE__ */ jsxs(ComboboxGroup, { children: [
34908
+ /* @__PURE__ */ jsxs(ComboboxGroupLabel, {
34909
+ className: "flex items-center gap-2 px-2 py-1.5 text-xs text-muted-foreground",
34910
+ children: [/* @__PURE__ */ jsx("span", {
34911
+ "aria-hidden": "true",
34912
+ className: `status-dot ${group == "published" ? "success" : group == "missingStart" ? "warning" : "neutral"}`
34913
+ }), t(`workflow.groups.${group}`)]
34914
+ }),
34915
+ !items.length && !loading && !error && /* @__PURE__ */ jsx("div", {
34916
+ 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`,
34917
+ children: t(query ? "workflow.noMatches" : "workflow.empty")
34918
+ }),
34919
+ items.map((item) => /* @__PURE__ */ jsxs(ComboboxItem, {
34920
+ value: item.flowId,
34921
+ className: `flex cursor-default items-center gap-2 pr-2 pl-6 data-highlighted:bg-accent ${selectionMenuItemClass}`,
34922
+ children: [
34923
+ /* @__PURE__ */ jsx("i", {
34924
+ "aria-hidden": "true",
34925
+ className: "i-lucide-light:workflow shrink-0 text-sm"
34926
+ }),
34927
+ /* @__PURE__ */ jsx("span", {
34928
+ className: "min-w-0 flex-1 truncate",
34929
+ children: item.name
34930
+ }),
34931
+ /* @__PURE__ */ jsx(ComboboxItemIndicator, { children: /* @__PURE__ */ jsx("i", {
34932
+ "aria-hidden": "true",
34933
+ className: "i-lucide-light:check shrink-0 text-sm"
34934
+ }) })
34935
+ ]
34936
+ }, item.flowId))
34937
+ ] }, group);
34938
+ }),
34939
+ loading && /* @__PURE__ */ jsx("p", {
34940
+ role: "status",
34941
+ className: "px-2 py-2 text-xs text-muted-foreground",
34942
+ children: t("workflow.loading")
34943
+ }),
34944
+ error && /* @__PURE__ */ jsxs("div", {
34945
+ role: "alert",
34946
+ className: "flex items-center gap-2 px-2 py-2 text-xs",
34947
+ children: [/* @__PURE__ */ jsx("span", {
34948
+ className: "min-w-0 flex-1",
34949
+ children: error
34950
+ }), /* @__PURE__ */ jsx(Button$1, {
34951
+ variant: "outline",
34952
+ size: "xs",
34953
+ onClick: () => void readChoices(),
34954
+ children: t("workflow.retry")
34955
+ })]
34956
+ })
34957
+ ]
34958
+ })
34959
+ })
34960
+ })
34961
+ })]
34962
+ })
34963
+ })]
34964
+ });
34965
+ }
34966
+ //#endregion
34492
34967
  //#region src/workbench/browser/runtime/editor/nodeInspector.tsx
34493
34968
  function inspectorIcon(node) {
34494
34969
  if (node?.kind == "trigger") return "trigger";
@@ -34496,8 +34971,10 @@ function inspectorIcon(node) {
34496
34971
  if (node?.kind == "value") return "value";
34497
34972
  if (node?.kind == "approval") return "check";
34498
34973
  if (node?.kind == "wait") return "wait";
34974
+ if (node?.kind == "outputs") return "outputs";
34499
34975
  if (node?.kind == "task" && node.definition != null && "executor" in node.definition) {
34500
34976
  if (node.definition.executor.kind == "decision") return "decision";
34977
+ if (node.definition.executor.kind == "workflow") return "flow";
34501
34978
  if (node.definition.executor.kind == "openapi") return "task";
34502
34979
  return node.definition.executor.kind == "connector" ? "connection" : "llm";
34503
34980
  }
@@ -34506,6 +34983,7 @@ function inspectorIcon(node) {
34506
34983
  function nodePurposePlaceholder(selection, t, action, displays) {
34507
34984
  switch (selection.kind) {
34508
34985
  case "condition": return t("addNode.conditionDescription");
34986
+ case "outputs": return t("addNode.outputsDescription");
34509
34987
  case "value": return t("addNode.valueDescription");
34510
34988
  case "approval": return t("addNode.approvalDescription");
34511
34989
  case "wait": return t("addNode.waitDescription");
@@ -34513,6 +34991,7 @@ function nodePurposePlaceholder(selection, t, action, displays) {
34513
34991
  const node = selection.node;
34514
34992
  switch (node.kind) {
34515
34993
  case "manual": return t("addNode.manualDescription");
34994
+ case "start": return t("addNode.startDescription");
34516
34995
  case "error": return t("errorWorkflow.description");
34517
34996
  case "cron": return t("addNode.cronDescription");
34518
34997
  case "webhook": return t("addNode.webhookDescription");
@@ -34527,6 +35006,7 @@ function nodePurposePlaceholder(selection, t, action, displays) {
34527
35006
  switch (definition.executor.kind) {
34528
35007
  case "agent": return t("addNode.agentDescription");
34529
35008
  case "decision": return t("decision.description");
35009
+ case "workflow": return t("workflow.description");
34530
35010
  case "openapi": return t("openapi.description");
34531
35011
  case "connector": return action?.description;
34532
35012
  case "llm": return t(definition.executor.mode == "json" ? "addNode.llmStructuredDescription" : "addNode.llmChatDescription");
@@ -34536,7 +35016,7 @@ function nodePurposePlaceholder(selection, t, action, displays) {
34536
35016
  }
34537
35017
  function inputUpstreamSources({ revision, sourceNodeIcons, selection, store, handleName, t, triggerDisplays }) {
34538
35018
  const graph = revision.graph();
34539
- const mapping = nodeInputMappings(selection.node)[handleName];
35019
+ const mapping = revision.inputMappings(selection.node)[handleName];
34540
35020
  const sources = mapping?.kind == "sources" ? mapping.sources.filter((source) => source.kind == "node") : [];
34541
35021
  const providerDisplay = (node) => node?.kind == "integration" || node?.kind == "poll" ? triggerDisplays?.[node.definition.key] : void 0;
34542
35022
  return {
@@ -34585,10 +35065,26 @@ function NodeInspector({ webhookDeployment, variables = {
34585
35065
  const isAgent = task != null && "executor" in task && task.executor.kind == "agent";
34586
35066
  const isDecision = task != null && "executor" in task && task.executor.kind == "decision";
34587
35067
  const isOpenApi = task != null && "executor" in task && task.executor.kind == "openapi";
35068
+ const unconfiguredWorkflow = task != null && "executor" in task && task.executor.kind == "workflow" && !task.executor.flowId;
34588
35069
  const unconfiguredOpenApi = task != null && "executor" in task && task.executor.kind == "openapi" && !task.executor.path;
34589
35070
  const isLlm = task != null && "executor" in task && task.executor.kind == "llm";
34590
35071
  const connector = task != null && "executor" in task && task.executor.kind == "connector" ? task.executor : void 0;
34591
35072
  const nodeId = selection?.kind == "task" ? selection.id : void 0;
35073
+ const workflowSettings = task != null && "executor" in task && task.executor.kind == "workflow" && selection != null ? {
35074
+ task,
35075
+ nodeId: selection.id,
35076
+ onCheck: () => store?.check() ?? Promise.resolve(),
35077
+ disabled: disabled || readOnly,
35078
+ load: (flowId, signal) => store.loadWorkflowContract(flowId, signal),
35079
+ onSave: (before, value) => store?.saveTaskSettings(selection.id, {
35080
+ kind: "workflow",
35081
+ name: value.name,
35082
+ before,
35083
+ task: value
35084
+ }) ?? Promise.resolve(false)
35085
+ } : void 0;
35086
+ const workflowActions = useWorkflowActions(workflowSettings);
35087
+ const workflowIssue = diagnostics?.find((issue) => issue.code.startsWith("workflow.") && issue.code != "workflow.target-required");
34592
35088
  const locatedRequest = useRef();
34593
35089
  useEffect(() => {
34594
35090
  if (focus == null) return;
@@ -34653,6 +35149,13 @@ function NodeInspector({ webhookDeployment, variables = {
34653
35149
  loading: connectorLoading,
34654
35150
  nodeId
34655
35151
  }),
35152
+ !readOnly && workflowSettings != null && (workflowIssue != null || workflowActions.error != null) && /* @__PURE__ */ jsx(WorkflowInterfaceAlert, {
35153
+ flowId: workflowSettings.task.executor.kind == "workflow" ? workflowSettings.task.executor.flowId : "",
35154
+ actions: workflowActions,
35155
+ disabled,
35156
+ stale: workflowIssue?.code == "workflow.revision-stale" || workflowIssue?.code == "workflow.snapshot-missing",
35157
+ message: workflowIssue == null ? void 0 : diagnosticMessage(workflowIssue, t)
35158
+ }, `workflow-alert:${selection?.id}`),
34656
35159
  selection != null && /* @__PURE__ */ jsx(NodeDescription, {
34657
35160
  value: selection.node.description,
34658
35161
  placeholder: nodePurposePlaceholder(selection, t, connectorAction, triggerDisplays),
@@ -34721,7 +35224,22 @@ function NodeInspector({ webhookDeployment, variables = {
34721
35224
  value: selection.trigger.sourceFlowIds ?? [],
34722
35225
  disabled
34723
35226
  }) }),
34724
- selection?.kind === "trigger" && selection.trigger.kind !== "webhook" && /* @__PURE__ */ jsx(TriggerSummary, {
35227
+ selection?.kind === "trigger" && selection.trigger.kind === "start" && /* @__PURE__ */ jsx("section", {
35228
+ className: "inspector-port-section",
35229
+ "data-inspector-section": "outputs",
35230
+ children: /* @__PURE__ */ jsx(PortDefinitionEditor, {
35231
+ layout: "ports",
35232
+ title: t("inspector.ports.startParametersTitle"),
35233
+ output: true,
35234
+ readOnly,
35235
+ disabled,
35236
+ values: selection.trigger.inputDefs,
35237
+ onChange: (parameters, deletion) => {
35238
+ store?.saveStartInputDefs(selection.id, parameters, deletion);
35239
+ }
35240
+ })
35241
+ }),
35242
+ selection?.kind === "trigger" && selection.trigger.kind !== "webhook" && selection.trigger.kind !== "start" && /* @__PURE__ */ jsx(TriggerSummary, {
34725
35243
  trigger: selection.trigger,
34726
35244
  display: selection.trigger.kind == "integration" || selection.trigger.kind == "poll" ? triggerDisplays?.[selection.trigger.definition.key] : void 0
34727
35245
  }),
@@ -34754,10 +35272,15 @@ function NodeInspector({ webhookDeployment, variables = {
34754
35272
  task: value
34755
35273
  }, deletion) ?? Promise.resolve(false)
34756
35274
  }, `decision:${selection.id}`),
35275
+ workflowSettings != null && /* @__PURE__ */ jsx(WorkflowSection, {
35276
+ ...workflowSettings,
35277
+ actions: workflowActions,
35278
+ list: (signal) => store.listWorkflowTargets(signal)
35279
+ }, `workflow:${selection?.id}`),
34757
35280
  isOpenApi && task != null && "executor" in task && /* @__PURE__ */ jsx(OpenApiSection, {
34758
35281
  task,
34759
35282
  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];
35283
+ const mapping = revision.inputMappings(selection.node)[definition.handle];
34761
35284
  const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
34762
35285
  const binding = source?.kind === "binding" ? revision.binding(source.bindingId) : void 0;
34763
35286
  return /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: definition.handle.slice(5).replace(/^manual\./, "").replaceAll(".", " · ") }), /* @__PURE__ */ jsx(NodeInputValue, {
@@ -34802,10 +35325,10 @@ function NodeInspector({ webhookDeployment, variables = {
34802
35325
  task: value
34803
35326
  }) ?? Promise.resolve(false)
34804
35327
  }, `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];
35328
+ !unconfiguredOpenApi && !unconfiguredWorkflow && (selection?.kind === "outputs" || selection?.kind === "approval" || selection?.kind === "wait" || selection?.kind === "task") && (() => {
35329
+ const definitions = selection.kind === "outputs" ? [...selection.node.outputDefs] : selection.kind === "task" ? [...selection.definition?.inputs ?? []] : [...selection.node.inputDefinitions];
34807
35330
  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({
35331
+ 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
35332
  handle,
34810
35333
  jsonSchema: {},
34811
35334
  nullable: true
@@ -34816,7 +35339,7 @@ function NodeInspector({ webhookDeployment, variables = {
34816
35339
  ...definition,
34817
35340
  description: t("decision.targetDescription")
34818
35341
  };
34819
- const mapping = selection.node.inputs[definition.handle];
35342
+ const mapping = revision.inputMappings(selection.node)[definition.handle];
34820
35343
  const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
34821
35344
  const binding = source?.kind === "binding" ? revision.binding(source.bindingId) : void 0;
34822
35345
  return {
@@ -34838,8 +35361,9 @@ function NodeInspector({ webhookDeployment, variables = {
34838
35361
  });
34839
35362
  const fields = /* @__PURE__ */ jsx(NodeInputs, {
34840
35363
  readOnly,
34841
- allowAddGroup: selection.kind !== "wait" && selection.kind !== "approval",
34842
- title: t("inspector.ports.inputsTitle"),
35364
+ allowAddGroup: selection.kind === "task",
35365
+ title: t(selection.kind === "outputs" ? "inspector.ports.outputsTitle" : "inspector.ports.inputsTitle"),
35366
+ titleIcon: selection.kind === "outputs" ? "output" : "input",
34843
35367
  entries,
34844
35368
  fieldLabels: connector?.action == "leina.send_notification" ? {
34845
35369
  leinaId: t("leina.robot"),
@@ -34848,7 +35372,9 @@ function NodeInspector({ webhookDeployment, variables = {
34848
35372
  onReset: () => {
34849
35373
  return store?.resetInputs(selection.id, entries.flatMap((entry) => "group" in entry ? [] : [entry.definition.handle]));
34850
35374
  },
34851
- onDefinitions: selection.kind === "task" && selection.definition != null && ("moduleId" in selection.node.task || isAgent) ? (inputs, deletion, values) => {
35375
+ onDefinitions: selection.kind === "outputs" ? (outputDefinitions, deletion, values) => {
35376
+ store?.saveOutputsDefs(selection.id, outputDefinitions.filter((port) => "handle" in port), deletion, values);
35377
+ } : selection.kind === "task" && selection.definition != null && ("moduleId" in selection.node.task || isAgent) ? (inputs, deletion, values) => {
34852
35378
  store?.saveTaskPorts(selection.id, {
34853
35379
  inputs,
34854
35380
  outputs: selection.definition.outputs
@@ -34888,7 +35414,7 @@ function NodeInspector({ webhookDeployment, variables = {
34888
35414
  title: t("inspector.task.additionalInputs"),
34889
35415
  allowAddGroup: false,
34890
35416
  entries: (selection.node.additionalInputs ?? []).map((definition) => {
34891
- const mapping = selection.node.inputs[definition.handle];
35417
+ const mapping = revision.inputMappings(selection.node)[definition.handle];
34892
35418
  const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
34893
35419
  const binding = source?.kind === "binding" ? revision.binding(source.bindingId) : void 0;
34894
35420
  return {
@@ -34959,7 +35485,7 @@ function NodeInspector({ webhookDeployment, variables = {
34959
35485
  }
34960
35486
  })
34961
35487
  }),
34962
- !unconfiguredOpenApi && selection?.kind === "task" && selection.definition != null && /* @__PURE__ */ jsx("section", {
35488
+ !unconfiguredOpenApi && !unconfiguredWorkflow && selection?.kind === "task" && selection.definition != null && /* @__PURE__ */ jsx("section", {
34963
35489
  className: "inspector-port-section",
34964
35490
  children: /* @__PURE__ */ jsx(PortDefinitionEditor, {
34965
35491
  readOnly,
@@ -37992,6 +38518,7 @@ function createNodeEntry(node, contentKey, canvasStore) {
37992
38518
  const duplicateNode = (offset) => canvasStore.onDuplicate?.([node.id], offset);
37993
38519
  const types = {
37994
38520
  approval: NODE_TYPE.TaskNode,
38521
+ outputs: NODE_TYPE.TaskNode,
37995
38522
  condition: NODE_TYPE.ConditionNode,
37996
38523
  task: NODE_TYPE.TaskNode,
37997
38524
  trigger: NODE_TYPE.TriggerNode,
@@ -38003,7 +38530,7 @@ function createNodeEntry(node, contentKey, canvasStore) {
38003
38530
  onIgnore: (ignored) => canvasStore.ignoreNodes([node.id], ignored),
38004
38531
  content$,
38005
38532
  position: node.position,
38006
- duplicateNode: node.kind === "trigger" && node.presentation?.kind === "manual" ? void 0 : duplicateNode
38533
+ duplicateNode: node.kind === "outputs" || node.kind === "trigger" && (node.presentation?.kind === "manual" || node.presentation?.kind === "start") ? void 0 : duplicateNode
38007
38534
  });
38008
38535
  return {
38009
38536
  contentKey,
@@ -38313,7 +38840,7 @@ var CanvasStore = class {
38313
38840
  this.#entries = /* @__PURE__ */ new Map();
38314
38841
  this.#modelPositions = /* @__PURE__ */ new Map();
38315
38842
  this.#selectedNodeIds = /* @__PURE__ */ new Set();
38316
- this.completeLayout = () => {
38843
+ this.completeLayout = (availableWidth) => {
38317
38844
  if (this.layoutComplete) return true;
38318
38845
  const nodes = this.allLayoutNodes();
38319
38846
  if (nodes.length === 0) return true;
@@ -38326,7 +38853,7 @@ var CanvasStore = class {
38326
38853
  return true;
38327
38854
  }
38328
38855
  }
38329
- this.doRelayout();
38856
+ this.doRelayout(availableWidth);
38330
38857
  this.layoutMeasurementAttempts = 0;
38331
38858
  this.layoutComplete = true;
38332
38859
  return "relayout";
@@ -38358,9 +38885,9 @@ var CanvasStore = class {
38358
38885
  targetHandle: toManifestHandleName(targetHandle)
38359
38886
  });
38360
38887
  };
38361
- this.onRelayout = () => {
38888
+ this.onRelayout = (availableWidth) => {
38362
38889
  try {
38363
- this.doRelayout();
38890
+ this.doRelayout(availableWidth);
38364
38891
  } catch (e) {
38365
38892
  console.error(e);
38366
38893
  }
@@ -38520,7 +39047,7 @@ var CanvasStore = class {
38520
39047
  toDeselect.forEach((store) => store.$$.selected.set(false));
38521
39048
  };
38522
39049
  }
38523
- doRelayout() {
39050
+ doRelayout(availableWidth) {
38524
39051
  const nodes = this.allLayoutNodes();
38525
39052
  const g = new ie.Graph().setDefaultEdgeLabel(() => ({}));
38526
39053
  g.setGraph({
@@ -38550,9 +39077,10 @@ var CanvasStore = class {
38550
39077
  column: rank,
38551
39078
  x: x - width / 2,
38552
39079
  y: y - height / 2,
39080
+ width,
38553
39081
  height
38554
39082
  };
38555
- }));
39083
+ }), availableWidth);
38556
39084
  for (const node of nodes) node.$$.position.set(positions[node.nodeId]);
38557
39085
  this.#callbacks.onMoveNodes(positions);
38558
39086
  }
@@ -50052,34 +50580,51 @@ var CanvasNode_module_default = {
50052
50580
  valueKey: "CanvasNode_valueKey_f29c7"
50053
50581
  };
50054
50582
  var CanvasCard_module_default = {
50055
- card: "CanvasCard_card_afa5f",
50056
- value: "CanvasCard_value_afa5f",
50057
- preview: "CanvasCard_preview_afa5f",
50058
- comment: "CanvasCard_comment_afa5f",
50059
- selected: "CanvasCard_selected_afa5f",
50060
- problem: "CanvasCard_problem_afa5f",
50061
- header: "CanvasCard_header_afa5f",
50062
- icon: "CanvasCard_icon_afa5f",
50063
- identity: "CanvasCard_identity_afa5f",
50064
- indicator: "CanvasCard_indicator_afa5f",
50065
- warning: "CanvasCard_warning_afa5f",
50066
- content: "CanvasCard_content_afa5f",
50067
- footer: "CanvasCard_footer_afa5f",
50068
- afterPreview: "CanvasCard_afterPreview_afa5f",
50069
- branches: "CanvasCard_branches_afa5f",
50070
- collapse: "CanvasCard_collapse_afa5f",
50071
- collapseInner: "CanvasCard_collapseInner_afa5f",
50072
- compactIdentity: "CanvasCard_compactIdentity_afa5f",
50073
- compact: "CanvasCard_compact_afa5f",
50074
- withBody: "CanvasCard_withBody_afa5f",
50075
- compactContent: "CanvasCard_compactContent_afa5f",
50076
- singleContent: "CanvasCard_singleContent_afa5f",
50077
- subtitle: "CanvasCard_subtitle_afa5f",
50078
- fill: "CanvasCard_fill_afa5f"
50583
+ card: "CanvasCard_card_56d5c",
50584
+ value: "CanvasCard_value_56d5c",
50585
+ preview: "CanvasCard_preview_56d5c",
50586
+ comment: "CanvasCard_comment_56d5c",
50587
+ selected: "CanvasCard_selected_56d5c",
50588
+ problem: "CanvasCard_problem_56d5c",
50589
+ runningBeam: "CanvasCard_runningBeam_56d5c",
50590
+ "running-beam": "CanvasCard_running-beam_56d5c",
50591
+ header: "CanvasCard_header_56d5c",
50592
+ icon: "CanvasCard_icon_56d5c",
50593
+ identity: "CanvasCard_identity_56d5c",
50594
+ indicator: "CanvasCard_indicator_56d5c",
50595
+ warning: "CanvasCard_warning_56d5c",
50596
+ danger: "CanvasCard_danger_56d5c",
50597
+ content: "CanvasCard_content_56d5c",
50598
+ footer: "CanvasCard_footer_56d5c",
50599
+ afterPreview: "CanvasCard_afterPreview_56d5c",
50600
+ branches: "CanvasCard_branches_56d5c",
50601
+ collapse: "CanvasCard_collapse_56d5c",
50602
+ collapseInner: "CanvasCard_collapseInner_56d5c",
50603
+ compactIdentity: "CanvasCard_compactIdentity_56d5c",
50604
+ compact: "CanvasCard_compact_56d5c",
50605
+ withBody: "CanvasCard_withBody_56d5c",
50606
+ compactContent: "CanvasCard_compactContent_56d5c",
50607
+ singleContent: "CanvasCard_singleContent_56d5c",
50608
+ subtitle: "CanvasCard_subtitle_56d5c",
50609
+ fill: "CanvasCard_fill_56d5c"
50079
50610
  };
50080
50611
  //#endregion
50081
50612
  //#region src/canvas/browser/graph/Nodes/components/CanvasCard.tsx
50082
- function CanvasCard({ title, tone, titleContent, icon, subtitle, subtitleAccessory, children, preview, branches, footer, actions, problem, problemIcon, selected, fill = false, compact = false, compactContent = false, contentHidden = false, footerHidden = false }) {
50613
+ var runningBeamPathLength = 1e3;
50614
+ var runningBeamLength = 160;
50615
+ var runningBeamLayerCount = 48;
50616
+ var runningBeamPeakOpacity = .9;
50617
+ var runningBeamLayers = Array.from({ length: runningBeamLayerCount }, (_, index) => {
50618
+ const length = runningBeamLength * (1 - index / runningBeamLayerCount);
50619
+ const gap = (runningBeamPathLength - length) / 2;
50620
+ const previousOpacity = runningBeamPeakOpacity * Math.sin(index / runningBeamLayerCount * (Math.PI / 2)) ** 2;
50621
+ const opacity = runningBeamPeakOpacity * Math.sin((index + 1) / runningBeamLayerCount * (Math.PI / 2)) ** 2;
50622
+ return {
50623
+ dash: `0 ${gap} ${length} ${gap}`,
50624
+ opacity: (opacity - previousOpacity) / (1 - previousOpacity)
50625
+ };
50626
+ });
50627
+ function CanvasCard({ title, tone, titleContent, icon, subtitle, subtitleAccessory, children, preview, branches, footer, actions, problem, problemIcon, problemTone = "danger", selected, running = false, fill = false, compact = false, compactContent = false, contentHidden = false, footerHidden = false }) {
50083
50628
  const hasContent = Children.toArray(children).some((child) => typeof child != "string" || child.trim().length > 0);
50084
50629
  const hasBranches = !isEmptyReactNode(branches);
50085
50630
  const hasBody = !contentHidden && (hasContent || !isEmptyReactNode(preview)) || hasBranches || !footerHidden && !isEmptyReactNode(footer);
@@ -50087,7 +50632,7 @@ function CanvasCard({ title, tone, titleContent, icon, subtitle, subtitleAccesso
50087
50632
  title: problem,
50088
50633
  placement: "top",
50089
50634
  children: /* @__PURE__ */ jsx("span", {
50090
- className: clsx(CanvasCard_module_default.icon, CanvasCard_module_default.indicator, CanvasCard_module_default.warning),
50635
+ className: clsx(CanvasCard_module_default.icon, CanvasCard_module_default.indicator, problemTone == "warning" ? CanvasCard_module_default.warning : CanvasCard_module_default.danger),
50091
50636
  "aria-label": problem,
50092
50637
  role: "img",
50093
50638
  tabIndex: 0,
@@ -50098,67 +50643,81 @@ function CanvasCard({ title, tone, titleContent, icon, subtitle, subtitleAccesso
50098
50643
  })
50099
50644
  });
50100
50645
  return /* @__PURE__ */ jsxs("article", {
50101
- className: clsx(CanvasCard_module_default.card, fill && CanvasCard_module_default.fill, compact && CanvasCard_module_default.compact, compactContent && CanvasCard_module_default.compactContent, tone && CanvasCard_module_default[tone], selected && CanvasCard_module_default.selected, problem && CanvasCard_module_default.problem),
50102
- children: [/* @__PURE__ */ jsxs("header", {
50103
- className: clsx(CanvasCard_module_default.header, hasBody && CanvasCard_module_default.withBody),
50104
- children: [
50105
- /* @__PURE__ */ jsxs("div", {
50106
- className: CanvasCard_module_default.compactIdentity,
50107
- children: [
50108
- /* @__PURE__ */ jsx("span", {
50109
- className: CanvasCard_module_default.icon,
50110
- children: icon
50111
- }),
50112
- /* @__PURE__ */ jsx("strong", {
50646
+ className: clsx(CanvasCard_module_default.card, fill && CanvasCard_module_default.fill, compact && CanvasCard_module_default.compact, compactContent && CanvasCard_module_default.compactContent, tone && CanvasCard_module_default[tone], selected && CanvasCard_module_default.selected, problem && problemTone == "danger" && CanvasCard_module_default.problem),
50647
+ children: [
50648
+ /* @__PURE__ */ jsxs("header", {
50649
+ className: clsx(CanvasCard_module_default.header, hasBody && CanvasCard_module_default.withBody),
50650
+ children: [
50651
+ /* @__PURE__ */ jsxs("div", {
50652
+ className: CanvasCard_module_default.compactIdentity,
50653
+ children: [
50654
+ /* @__PURE__ */ jsx("span", {
50655
+ className: CanvasCard_module_default.icon,
50656
+ children: icon
50657
+ }),
50658
+ /* @__PURE__ */ jsx("strong", {
50659
+ title,
50660
+ children: title
50661
+ }),
50662
+ statusIndicator
50663
+ ]
50664
+ }),
50665
+ /* @__PURE__ */ jsx("span", {
50666
+ className: CanvasCard_module_default.icon,
50667
+ children: icon
50668
+ }),
50669
+ /* @__PURE__ */ jsxs("div", {
50670
+ className: CanvasCard_module_default.identity,
50671
+ children: [/* @__PURE__ */ jsx("strong", {
50113
50672
  title,
50114
- children: title
50115
- }),
50116
- statusIndicator
50117
- ]
50118
- }),
50119
- /* @__PURE__ */ jsx("span", {
50120
- className: CanvasCard_module_default.icon,
50121
- children: icon
50122
- }),
50123
- /* @__PURE__ */ jsxs("div", {
50124
- className: CanvasCard_module_default.identity,
50125
- children: [/* @__PURE__ */ jsx("strong", {
50126
- title,
50127
- children: titleContent ?? title
50128
- }), subtitle && /* @__PURE__ */ jsxs("span", {
50129
- className: CanvasCard_module_default.subtitle,
50130
- children: [/* @__PURE__ */ jsx("span", { children: subtitle }), subtitleAccessory]
50131
- })]
50132
- }),
50133
- statusIndicator,
50134
- actions
50135
- ]
50136
- }), /* @__PURE__ */ jsxs("div", {
50137
- className: clsx(hasBody && !hasBranches && CanvasCard_module_default.singleContent),
50138
- children: [
50139
- (hasContent || !isEmptyReactNode(preview)) && /* @__PURE__ */ jsxs(CardCollapse, {
50140
- hidden: contentHidden,
50141
- children: [hasContent && /* @__PURE__ */ jsx("div", {
50142
- className: CanvasCard_module_default.content,
50143
- children
50144
- }), !isEmptyReactNode(preview) && /* @__PURE__ */ jsx("div", {
50145
- className: CanvasCard_module_default.preview,
50146
- children: preview
50147
- })]
50148
- }),
50149
- !isEmptyReactNode(branches) && /* @__PURE__ */ jsx("div", {
50150
- className: CanvasCard_module_default.branches,
50151
- children: branches
50152
- }),
50153
- !isEmptyReactNode(footer) && /* @__PURE__ */ jsx(CardCollapse, {
50154
- hidden: footerHidden,
50155
- children: /* @__PURE__ */ jsx("footer", {
50156
- className: clsx(CanvasCard_module_default.footer, !contentHidden && !isEmptyReactNode(preview) && CanvasCard_module_default.afterPreview),
50157
- children: footer
50673
+ children: titleContent ?? title
50674
+ }), subtitle && /* @__PURE__ */ jsxs("span", {
50675
+ className: CanvasCard_module_default.subtitle,
50676
+ children: [/* @__PURE__ */ jsx("span", { children: subtitle }), subtitleAccessory]
50677
+ })]
50678
+ }),
50679
+ statusIndicator,
50680
+ actions
50681
+ ]
50682
+ }),
50683
+ /* @__PURE__ */ jsxs("div", {
50684
+ className: clsx(hasBody && !hasBranches && CanvasCard_module_default.singleContent),
50685
+ children: [
50686
+ (hasContent || !isEmptyReactNode(preview)) && /* @__PURE__ */ jsxs(CardCollapse, {
50687
+ hidden: contentHidden,
50688
+ children: [hasContent && /* @__PURE__ */ jsx("div", {
50689
+ className: CanvasCard_module_default.content,
50690
+ children
50691
+ }), !isEmptyReactNode(preview) && /* @__PURE__ */ jsx("div", {
50692
+ className: CanvasCard_module_default.preview,
50693
+ children: preview
50694
+ })]
50695
+ }),
50696
+ !isEmptyReactNode(branches) && /* @__PURE__ */ jsx("div", {
50697
+ className: CanvasCard_module_default.branches,
50698
+ children: branches
50699
+ }),
50700
+ !isEmptyReactNode(footer) && /* @__PURE__ */ jsx(CardCollapse, {
50701
+ hidden: footerHidden,
50702
+ children: /* @__PURE__ */ jsx("footer", {
50703
+ className: clsx(CanvasCard_module_default.footer, !contentHidden && !isEmptyReactNode(preview) && CanvasCard_module_default.afterPreview),
50704
+ children: footer
50705
+ })
50158
50706
  })
50159
- })
50160
- ]
50161
- })]
50707
+ ]
50708
+ }),
50709
+ running && /* @__PURE__ */ jsx("svg", {
50710
+ className: CanvasCard_module_default.runningBeam,
50711
+ "aria-hidden": "true",
50712
+ children: runningBeamLayers.map((layer, index) => /* @__PURE__ */ jsx("rect", {
50713
+ x: "0.5",
50714
+ y: "0.5",
50715
+ pathLength: runningBeamPathLength,
50716
+ strokeDasharray: layer.dash,
50717
+ strokeOpacity: layer.opacity
50718
+ }, index))
50719
+ })
50720
+ ]
50162
50721
  });
50163
50722
  }
50164
50723
  /** Retain content only while the closing transition needs it. */
@@ -50726,9 +51285,11 @@ function CanvasNode({ nodeStore, problem, branches, compact = false, compactCont
50726
51285
  const title = node.title;
50727
51286
  const { values, summary, schedules, images, inline, hidden } = nodeCardContent(node);
50728
51287
  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;
51288
+ 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
51289
  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
51290
  const runContent = node?.run == null || node.run.status == "idle" ? void 0 : /* @__PURE__ */ jsx(RunChips, { run: node.run });
51291
+ const connectionRequired = (node.kind == "task" || node.kind == "trigger") && node.connectionRequired;
51292
+ const connectionDeferred = node.kind == "task" && node.connectionDeferred && !connectionRequired && !problem;
50732
51293
  return /* @__PURE__ */ jsx("div", {
50733
51294
  className: NODE_HANDLE_CLASSNAME,
50734
51295
  children: /* @__PURE__ */ jsx(CanvasCard, {
@@ -50762,8 +51323,10 @@ function CanvasNode({ nodeStore, problem, branches, compact = false, compactCont
50762
51323
  })
50763
51324
  }) : void 0,
50764
51325
  selected,
50765
- problem: (node.kind == "task" || node.kind == "trigger") && node.connectionRequired ? t("nodeStatus.connectionRequired") : problem,
50766
- problemIcon: (node.kind == "task" || node.kind == "trigger") && node.connectionRequired ? /* @__PURE__ */ jsx("i", {
51326
+ running: node.run?.status === "running",
51327
+ problem: connectionRequired ? t("nodeStatus.connectionRequired") : problem ?? (connectionDeferred ? t("nodeStatus.connectionDeferred") : void 0),
51328
+ problemTone: connectionDeferred ? "warning" : "danger",
51329
+ problemIcon: connectionRequired || connectionDeferred ? /* @__PURE__ */ jsx("i", {
50767
51330
  "aria-hidden": "true",
50768
51331
  className: "i-lucide-light:unplug"
50769
51332
  }) : void 0,
@@ -51833,7 +52396,7 @@ var NodeLayout = /* @__PURE__ */ memo(({ canvasStore, nodeStore, visible }) => {
51833
52396
  isConnectable: editable,
51834
52397
  hintRequested
51835
52398
  }),
51836
- nodeStore.nodeType != NODE_TYPE.CommentNode && branches == null && /* @__PURE__ */ jsx(ExecutionHandle, {
52399
+ nodeStore.nodeType != NODE_TYPE.CommentNode && modelNode?.kind != "outputs" && branches == null && /* @__PURE__ */ jsx(ExecutionHandle, {
51837
52400
  id: toRFHandleName("$out"),
51838
52401
  type: "output",
51839
52402
  isConnectable: editable,
@@ -52711,6 +53274,9 @@ var GET_SIZE = (s) => ({
52711
53274
  width: s.width,
52712
53275
  height: s.height
52713
53276
  });
53277
+ function getLayoutWidth(state) {
53278
+ return state.width > 0 ? Math.max(1, state.width - 64) / state.transform[2] : void 0;
53279
+ }
52714
53280
  var isSizeEqual = (a, b) => a.width === b.width && a.height === b.height;
52715
53281
  var isRectEqual = (a, b) => isSizeEqual(a, b) && a.x === b.x && a.y === b.y;
52716
53282
  var ReactFlowContainer = (props) => {
@@ -52751,6 +53317,7 @@ var selector = (s) => ({
52751
53317
  });
52752
53318
  var FlowControls = /*#__PURE__*/ memo((props) => {
52753
53319
  const rf = useReactFlow();
53320
+ const flowState = useStoreApi();
52754
53321
  const { minZoomReached, maxZoomReached, zoom } = useStore(selector, shallowPlainObjectEqual);
52755
53322
  const nodes = useNodes();
52756
53323
  const bgId = useId().replaceAll(":", "");
@@ -52761,7 +53328,7 @@ var FlowControls = /*#__PURE__*/ memo((props) => {
52761
53328
  maxZoom: 1
52762
53329
  };
52763
53330
  const relayout = props.onRelayout == null ? void 0 : () => {
52764
- props.onRelayout?.();
53331
+ props.onRelayout?.(getLayoutWidth(flowState.getState()));
52765
53332
  props.onBeforeFitView?.();
52766
53333
  setTimeout(() => rf.fitView(fitViewOptions), 100);
52767
53334
  };
@@ -52974,7 +53541,7 @@ var ReactFlowContainerInner = (props) => {
52974
53541
  let fitTimer;
52975
53542
  let attempts = 0;
52976
53543
  const completeLayout = () => {
52977
- const result = props.onLayoutMeasured?.();
53544
+ const result = props.onLayoutMeasured?.(getLayoutWidth(flowState.getState()));
52978
53545
  if (result === false && attempts++ < 5) measurementFrame = requestAnimationFrame(completeLayout);
52979
53546
  else if (result === "relayout") {
52980
53547
  onBeforeFitView();
@@ -53009,6 +53576,7 @@ var ReactFlowContainerInner = (props) => {
53009
53576
  if (transitionTimer) clearTimeout(transitionTimer);
53010
53577
  };
53011
53578
  }, [
53579
+ flowState,
53012
53580
  onBeforeFitView,
53013
53581
  props.layoutMotion,
53014
53582
  props.onLayoutMeasured,
@@ -53813,7 +54381,7 @@ var WorkbenchCanvas = forwardRef(function WorkbenchCanvas({ nodePicker, annotati
53813
54381
  screenPosition: screenPosition(canvasPosition)
53814
54382
  });
53815
54383
  };
53816
- const manualTrigger = staticOptions.get("trigger:manual");
54384
+ const startTrigger = staticOptions.get("trigger:start");
53817
54385
  const needsTrigger = !model.nodes.some((node) => node.kind == "trigger");
53818
54386
  const addRecommended = async (option) => {
53819
54387
  if (addingRecommended.current) return;
@@ -53897,7 +54465,7 @@ var WorkbenchCanvas = forwardRef(function WorkbenchCanvas({ nodePicker, annotati
53897
54465
  disabled,
53898
54466
  onOpenNodePicker: openAddNode,
53899
54467
  runControl,
53900
- onAddTrigger: needsTrigger && model.nodes.length > 0 && manualTrigger != null ? () => void addRecommended(manualTrigger) : void 0
54468
+ onAddTrigger: needsTrigger && model.nodes.length > 0 && startTrigger != null ? () => void addRecommended(startTrigger) : void 0
53901
54469
  }),
53902
54470
  onAddNode: async (itemId, position, connection) => {
53903
54471
  const dragged = draggedNode.current.consume(itemId);
@@ -54157,7 +54725,10 @@ function LiveTriggers({ store }) {
54157
54725
  }),
54158
54726
  detail.binding.endpointUrl != null && /* @__PURE__ */ jsxs("div", {
54159
54727
  className: "trigger-webhook",
54160
- children: [/* @__PURE__ */ jsx("span", { children: t("publication.webhookUrl") }), /* @__PURE__ */ jsx(WebhookEndpoint, { endpointUrl: detail.binding.endpointUrl }, detail.binding.endpointUrl)]
54728
+ children: [/* @__PURE__ */ jsx("span", { children: t("publication.webhookUrl") }), /* @__PURE__ */ jsx(WebhookEndpoint, {
54729
+ notify: store.workspace.notify,
54730
+ endpointUrl: detail.binding.endpointUrl
54731
+ }, detail.binding.endpointUrl)]
54161
54732
  }),
54162
54733
  /* @__PURE__ */ jsxs("div", {
54163
54734
  className: "trigger-binding-detail-sections",
@@ -54843,52 +55414,6 @@ function PublicationsView({ store, onClose, theme = "light" }) {
54843
55414
  });
54844
55415
  }
54845
55416
  //#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
55417
  //#region src/workbench/browser/runtime/runs/runControl.tsx
54893
55418
  function RunControl({ disabled, inputContent, inputOpen, inputStatus, onInputOpenChange, onRun, onSelectTrigger, selectedTriggerId, starting, title, triggers }) {
54894
55419
  const t = useTranslate();
@@ -55083,6 +55608,51 @@ function AlertDescription({ className, ...props }) {
55083
55608
  });
55084
55609
  }
55085
55610
  //#endregion
55611
+ //#region src/workbench/browser/runtime/runs/errorHandling.tsx
55612
+ function ErrorHandling({ run }) {
55613
+ const t = useTranslate();
55614
+ const hrefFor = useContext(WorkbenchLinkContext);
55615
+ if (run == null || !("waits" in run) || run.errorSource == null && run.errorDispatches == null) return null;
55616
+ const link = (flowId, runId, label) => hrefFor == null ? /* @__PURE__ */ jsxs("span", { children: [
55617
+ label,
55618
+ ": ",
55619
+ runId
55620
+ ] }) : /* @__PURE__ */ jsx("a", {
55621
+ className: "text-foreground underline underline-offset-2 hover:text-muted-foreground",
55622
+ href: hrefFor({
55623
+ flowId,
55624
+ runId,
55625
+ view: "runs"
55626
+ }),
55627
+ children: label
55628
+ });
55629
+ return /* @__PURE__ */ jsxs("div", {
55630
+ className: "flex flex-col gap-1 px-4 py-2 text-sm",
55631
+ role: "status",
55632
+ children: [run.errorSource != null && link(run.errorSource.flowId, run.errorSource.runId, t("errorWorkflow.source")), run.errorDispatches?.map((dispatch) => /* @__PURE__ */ jsxs("div", { children: [
55633
+ dispatch.status == "pending" && /* @__PURE__ */ jsxs("span", {
55634
+ className: "text-muted-foreground",
55635
+ children: [
55636
+ t("errorWorkflow.pending"),
55637
+ ": ",
55638
+ dispatch.flowId
55639
+ ]
55640
+ }),
55641
+ dispatch.status == "dispatched" && link(dispatch.flowId, dispatch.runId, `${t("errorWorkflow.dispatched")}: ${dispatch.flowId}`),
55642
+ dispatch.status == "failed" && /* @__PURE__ */ jsxs("span", {
55643
+ className: "text-destructive",
55644
+ children: [
55645
+ t("errorWorkflow.failed"),
55646
+ " (",
55647
+ dispatch.flowId,
55648
+ "): ",
55649
+ dispatch.message
55650
+ ]
55651
+ })
55652
+ ] }, dispatch.flowId))]
55653
+ });
55654
+ }
55655
+ //#endregion
55086
55656
  //#region src/workbench/browser/runtime/runs/runGroups.ts
55087
55657
  function groupEvents(events) {
55088
55658
  const groups = [];
@@ -55729,6 +56299,48 @@ function RunResults({ client, runId, results }) {
55729
56299
  });
55730
56300
  }
55731
56301
  //#endregion
56302
+ //#region src/workbench/browser/runtime/runs/workflowCalls.tsx
56303
+ function WorkflowCalls({ run }) {
56304
+ const t = useTranslate();
56305
+ const hrefFor = useContext(WorkbenchLinkContext);
56306
+ if (!("waits" in run)) return null;
56307
+ const link = (flowId, runId, label) => hrefFor == null ? /* @__PURE__ */ jsxs("span", { children: [
56308
+ label,
56309
+ ": ",
56310
+ runId
56311
+ ] }) : /* @__PURE__ */ jsx("a", {
56312
+ className: "text-foreground underline underline-offset-2 hover:text-muted-foreground",
56313
+ href: hrefFor({
56314
+ flowId,
56315
+ runId,
56316
+ view: "runs"
56317
+ }),
56318
+ children: label
56319
+ });
56320
+ return /* @__PURE__ */ jsxs("div", {
56321
+ className: "flex flex-col gap-2 px-4 py-2 text-sm",
56322
+ children: [run.caller != null && /* @__PURE__ */ jsxs("div", { children: [
56323
+ link(run.caller.flowId, run.caller.runId, t("workflow.parent")),
56324
+ " · ",
56325
+ run.caller.nodeId
56326
+ ] }), run.calls?.map((call) => /* @__PURE__ */ jsxs("div", {
56327
+ className: "flex flex-wrap items-center gap-2",
56328
+ children: [
56329
+ /* @__PURE__ */ jsxs("span", { children: [
56330
+ call.nodeId,
56331
+ " → ",
56332
+ call.flowId
56333
+ ] }),
56334
+ /* @__PURE__ */ jsx("span", {
56335
+ className: "text-muted-foreground",
56336
+ children: call.status == null ? t("workflow.unavailable") : runLabel({ status: call.status }, t)
56337
+ }),
56338
+ link(call.flowId, call.runId, t("workflow.viewRun"))
56339
+ ]
56340
+ }, call.executionId))]
56341
+ });
56342
+ }
56343
+ //#endregion
55732
56344
  //#region src/workbench/browser/runtime/runs/runDrawer.tsx
55733
56345
  var RunVirtualItem = forwardRef(function RunVirtualItem({ index, ...props }, ref) {
55734
56346
  return /* @__PURE__ */ jsx("div", {
@@ -56524,6 +57136,7 @@ function RunDrawer({ resultClient, cancelDisabled, canceling, events, eventsExpi
56524
57136
  className: "run-content",
56525
57137
  children: [
56526
57138
  /* @__PURE__ */ jsx(ErrorHandling, { run }),
57139
+ run != null && /* @__PURE__ */ jsx(WorkflowCalls, { run }),
56527
57140
  run != null && /* @__PURE__ */ jsx(ActiveWait, {
56528
57141
  onLocate: onLocateWait,
56529
57142
  onResolve,
@@ -56692,7 +57305,7 @@ function Form({ onStarted, request, store, theme }) {
56692
57305
  }),
56693
57306
  request.editor && /* @__PURE__ */ jsxs("section", {
56694
57307
  className: "run-input-group",
56695
- children: [/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx("strong", { children: t("inspector.ports.outputsTitle") }) }), /* @__PURE__ */ jsx(FlowRunInputEditor, {
57308
+ 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
57309
  store: request.editor,
56697
57310
  theme,
56698
57311
  showErrors: request.attempted
@@ -57381,6 +57994,7 @@ function RunsView({ flowName, onClose, onConfigureConnector, onLocateEvent, onLo
57381
57994
  ]
57382
57995
  }),
57383
57996
  /* @__PURE__ */ jsx(ErrorHandling, { run }),
57997
+ /* @__PURE__ */ jsx(WorkflowCalls, { run }),
57384
57998
  /* @__PURE__ */ jsx(ActiveWait, {
57385
57999
  onLocate: onLocateWait,
57386
58000
  onResolve: (waitId, action, comment) => void store.runs.resolve(waitId, action, comment),
@@ -58010,7 +58624,8 @@ var NodeInspectorContainer = memo(function NodeInspectorContainer({ store, focus
58010
58624
  status: bindings.flowId === flowId ? bindings.status : "idle",
58011
58625
  enabled: live?.status == "runnable",
58012
58626
  hasUnpublishedChanges: live?.hasUnpublishedChanges ?? false,
58013
- onRetry: () => void store.publications.loadBindings(flowId)
58627
+ onRetry: () => void store.publications.loadBindings(flowId),
58628
+ notify: store.workspace.notify
58014
58629
  },
58015
58630
  variables: {
58016
58631
  enabled: store.variablesEnabled,
@@ -58065,10 +58680,10 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
58065
58680
  const checkLoading = useVal(store.workspace.$.checkLoading);
58066
58681
  const history = useVal(store.workspace.history$);
58067
58682
  const designer = useVal(store.$.designer);
58683
+ const draft = useVal(store.workspace.$.draft);
58068
58684
  const triggers = designer.nodes.filter((node) => node.kind == "trigger");
58069
- const selectedTrigger = triggers.find((node) => node.id == startId) ?? triggers[0];
58685
+ const selectedTrigger = triggers.find((node) => node.id == startId) ?? triggers.find((node) => node.presentation?.kind == "start") ?? triggers[0];
58070
58686
  const diagnosticFocus = useVal(store.workspace.$.diagnosticFocus);
58071
- const draft = useVal(store.workspace.$.draft);
58072
58687
  const live = useVal(store.workspace.$.live);
58073
58688
  const nodeFocus = useVal(store.workspace.$.nodeFocus);
58074
58689
  const flowId = useVal(store.workspace.$.flowId);
@@ -58323,7 +58938,7 @@ function FlowEditor({ navigationIsland, onRun, onRunStarted, onCloseRuns, onConf
58323
58938
  } : void 0,
58324
58939
  nodeId: singleSelected ? selectedDesignerNode?.id : void 0,
58325
58940
  nodeHeading: singleSelected && selection != null ? {
58326
- titleReadOnly: selection.kind === "trigger" && selection.trigger.kind === "manual",
58941
+ titleReadOnly: selection.kind === "trigger" && (selection.trigger.kind === "manual" || selection.trigger.kind === "start"),
58327
58942
  title: selection.node.name ?? selectedDesignerNode?.title ?? "",
58328
58943
  icon: selectedDesignerNode != null && "icon" in selectedDesignerNode ? selectedDesignerNode.icon : void 0,
58329
58944
  disabled: authoringDisabled,
@@ -58443,11 +59058,7 @@ function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConn
58443
59058
  store,
58444
59059
  view
58445
59060
  ]);
58446
- useEffect(() => store.runRequests.dismissInputs(), [
58447
- draft?.revisionId,
58448
- flowId,
58449
- store
58450
- ]);
59061
+ useEffect(() => store.runRequests.dismissInputs(), [flowId, store]);
58451
59062
  useEffect(() => {
58452
59063
  if (submitting == null || !draftReady) return;
58453
59064
  navigation.open("design");
@@ -58483,7 +59094,7 @@ function FlowWorkspace({ hrefFor, navigation, onConfigureConnector, onManageConn
58483
59094
  flowsHref: hrefFor({ view: "design" }),
58484
59095
  onOpenFlows: () => void navigation.openFlows()
58485
59096
  });
58486
- return /* @__PURE__ */ jsx(IconifyProvider, { children: /* @__PURE__ */ jsx(RunLinkContext.Provider, {
59097
+ return /* @__PURE__ */ jsx(IconifyProvider, { children: /* @__PURE__ */ jsx(WorkbenchLinkContext.Provider, {
58487
59098
  value: hrefFor,
58488
59099
  children: /* @__PURE__ */ jsxs("main", {
58489
59100
  className: "workspace",