@workflow/web 4.1.33 → 4.1.35

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 (33) hide show
  1. package/README.md +11 -34
  2. package/build/client/assets/{encryption-Cu4jq70Y.js → encryption-BhH0xZid.js} +2 -2
  3. package/build/client/assets/{entry.client-C7XgFTHI.js → entry.client-CaUKWFDB.js} +13 -35
  4. package/build/client/assets/{highlighted-body-B3W2YXNL-CK5bxjZc.js → highlighted-body-B3W2YXNL-D5wXP22M.js} +2 -2
  5. package/build/client/assets/{home-vGjXNC_q.js → home-CjokEfcx.js} +92 -164
  6. package/build/client/assets/{index-BQ-Xa8kF.js → index-BbkkdbNz.js} +78 -149
  7. package/build/client/assets/{index-CXBr7N7m.js → index-DY3Cy2uF.js} +20 -23
  8. package/build/client/assets/{manifest-5d325d67.js → manifest-cbe27963.js} +1 -1
  9. package/build/client/assets/{mermaid-3ZIDBTTL-CCVNMOf9.js → mermaid-3ZIDBTTL-8p93TMNC.js} +315 -479
  10. package/build/client/assets/mermaid-3ZIDBTTL-DHICBbcE.css +1 -0
  11. package/build/client/assets/{root-DjobWPwY.js → root-D-ZCwNhI.js} +5 -35
  12. package/build/client/assets/root-DzrclYrK.css +1 -0
  13. package/build/client/assets/{run-detail-nLEl00wq.js → run-detail-H0o7UsyU.js} +141 -205
  14. package/build/client/assets/server-build-DMZyIeNn.css +1 -0
  15. package/build/client/assets/{worker-CqHKTA7D.js → worker-DxRAeS-i.js} +2 -2
  16. package/build/client/assets/{workflow-graph-viewer-CTw33ANm.js → workflow-graph-viewer-C-MZ2XPV.js} +466 -723
  17. package/build/server/assets/{app-DFeBwpXW.js → app-BX9dMsx4.js} +67 -153
  18. package/build/server/assets/{highlighted-body-B3W2YXNL-DucHV668.js → highlighted-body-B3W2YXNL-CHc9_Xzp.js} +2 -2
  19. package/build/server/assets/{index-BUlN7QFn.js → index-BC_EEwAS.js} +2 -2
  20. package/build/server/assets/{index-DOJ452m_.js → index-BNN2zck_.js} +3 -3
  21. package/build/server/assets/{index-CMfOrLiJ.js → index-C-y3EhAf.js} +25 -32
  22. package/build/server/assets/{mermaid-3ZIDBTTL-DCNPJ1qb.js → mermaid-3ZIDBTTL-CP_u5jLd.js} +2 -2
  23. package/build/server/assets/{server-build-D0sUavwG.js → server-build-C0EUGBN0.js} +6483 -7670
  24. package/build/server/assets/{token-v98bLjzH.js → token-DYdYwRhs.js} +6 -6
  25. package/build/server/assets/{token-util-BoIjkgfM.js → token-util-BZHkMK_T.js} +2 -2
  26. package/build/server/index.js +1 -1
  27. package/host-guard.js +176 -0
  28. package/package.json +5 -4
  29. package/server.d.ts +15 -1
  30. package/server.js +28 -3
  31. package/build/client/assets/mermaid-3ZIDBTTL-yyHEMZs4.css +0 -1
  32. package/build/client/assets/root-BOS11TzD.css +0 -1
  33. package/build/client/assets/server-build-CNEy-GiI.css +0 -1
@@ -1,23 +1,16 @@
1
- import { r as reactExports, D as ReactDOM, j as jsxRuntimeExports, A as Link, f as reactDomExports, C as useSearchParams, B as useNavigate, E as useLocation, w as withComponentProps } from "./index-BQ-Xa8kF.js";
2
- import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as ChevronUp, q as Check, X, s as useControllableState$1, P as Primitive$1, t as composeEventHandlers$1, v as Presence, w as useSize, x as createContextScope$1, y as cancelRun, z as reenqueueRun, B as parseWorkflowName, F as StatusBadge, Z as Zap, G as CircleX, H as RunActionsDropdownItems, I as unwrapServerActionResult, J as WorkflowGraphViewer, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, N as ErrorBoundary } from "./workflow-graph-viewer-CTw33ANm.js";
3
- import { g as useLayoutEffect2, P as Primitive, c as createLucideIcon, h as useToast, d as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, A as Anchor, o as composeEventHandlers, p as useId, q as createPopperScope, s as DismissableLayer, v as createContextScope, w as createSlot, C as Content$1, x as useControllableState, y as Root2$1, V as VISUALLY_HIDDEN_STYLES, z as Arrow, E as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, F as fetchRun, G as cva, H as Presence$1, I as createContext2, J as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-CCVNMOf9.js";
4
- import "./index-CXBr7N7m.js";
1
+ import { r as reactExports, D as ReactDOM, j as jsxRuntimeExports, A as Link, f as reactDomExports, C as useSearchParams, B as useNavigate, E as useLocation, w as withComponentProps } from "./index-BbkkdbNz.js";
2
+ import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as ChevronUp, q as Check, X, s as useControllableState$1, P as Primitive$1, t as composeEventHandlers$1, v as Presence, w as useSize, x as createContextScope$1, y as cancelRun, z as reenqueueRun, B as parseWorkflowName, F as StatusBadge, Z as Zap, G as CircleX, H as RunActionsDropdownItems, I as unwrapServerActionResult, J as WorkflowGraphViewer, T as Tabs, K as TabsList, L as TabsTrigger, M as TabsContent, N as ErrorBoundary } from "./workflow-graph-viewer-C-MZ2XPV.js";
3
+ import { g as useLayoutEffect2, P as Primitive, c as createLucideIcon, h as useToast, d as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, A as Anchor, o as composeEventHandlers, p as useId, q as createPopperScope, s as DismissableLayer, v as createContextScope, w as createSlot, C as Content$1, x as useControllableState, y as Root2$1, V as VISUALLY_HIDDEN_STYLES, z as Arrow, E as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, F as fetchRun, G as cva, H as Presence$1, I as createContext2, J as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-8p93TMNC.js";
4
+ import "./index-DY3Cy2uF.js";
5
5
  var PORTAL_NAME$2 = "Portal";
6
6
  var Portal$2 = reactExports.forwardRef((props, forwardedRef) => {
7
- var _a;
8
7
  const { container: containerProp, ...portalProps } = props;
9
8
  const [mounted, setMounted] = reactExports.useState(false);
10
9
  useLayoutEffect2(() => setMounted(true), []);
11
- const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
10
+ const container = containerProp || mounted && globalThis?.document?.body;
12
11
  return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
13
12
  });
14
13
  Portal$2.displayName = PORTAL_NAME$2;
15
- /**
16
- * @license lucide-react v0.575.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
14
  const __iconNode$6 = [
22
15
  ["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
23
16
  ["path", { d: "M7 20V4", key: "1yoxec" }],
@@ -26,12 +19,6 @@ const __iconNode$6 = [
26
19
  ["path", { d: "M15 14h5l-5 6h5", key: "ur5jdg" }]
27
20
  ];
28
21
  const ArrowDownAZ = createLucideIcon("arrow-down-a-z", __iconNode$6);
29
- /**
30
- * @license lucide-react v0.575.0 - ISC
31
- *
32
- * This source code is licensed under the ISC license.
33
- * See the LICENSE file in the root directory of this source tree.
34
- */
35
22
  const __iconNode$5 = [
36
23
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
37
24
  ["path", { d: "M7 4v16", key: "1glfcx" }],
@@ -40,40 +27,16 @@ const __iconNode$5 = [
40
27
  ["path", { d: "M15 14h5l-5 6h5", key: "ur5jdg" }]
41
28
  ];
42
29
  const ArrowUpAZ = createLucideIcon("arrow-up-a-z", __iconNode$5);
43
- /**
44
- * @license lucide-react v0.575.0 - ISC
45
- *
46
- * This source code is licensed under the ISC license.
47
- * See the LICENSE file in the root directory of this source tree.
48
- */
49
30
  const __iconNode$4 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
50
31
  const ChevronLeft = createLucideIcon("chevron-left", __iconNode$4);
51
- /**
52
- * @license lucide-react v0.575.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */
57
32
  const __iconNode$3 = [
58
33
  ["path", { d: "M15 6a9 9 0 0 0-9 9V3", key: "1cii5b" }],
59
34
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
60
35
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }]
61
36
  ];
62
37
  const GitBranch = createLucideIcon("git-branch", __iconNode$3);
63
- /**
64
- * @license lucide-react v0.575.0 - ISC
65
- *
66
- * This source code is licensed under the ISC license.
67
- * See the LICENSE file in the root directory of this source tree.
68
- */
69
38
  const __iconNode$2 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
70
39
  const Minus = createLucideIcon("minus", __iconNode$2);
71
- /**
72
- * @license lucide-react v0.575.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */
77
40
  const __iconNode$1 = [
78
41
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
79
42
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
@@ -81,12 +44,6 @@ const __iconNode$1 = [
81
44
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
82
45
  ];
83
46
  const RefreshCw = createLucideIcon("refresh-cw", __iconNode$1);
84
- /**
85
- * @license lucide-react v0.575.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */
90
47
  const __iconNode = [
91
48
  ["rect", { width: "8", height: "8", x: "3", y: "3", rx: "2", key: "by2w9f" }],
92
49
  ["path", { d: "M7 11v4a2 2 0 0 0 2 2h4", key: "xkn7yn" }],
@@ -104,7 +61,6 @@ function useHookActions({ onResolve, callbacks }) {
104
61
  setSelectedHook(null);
105
62
  }, []);
106
63
  const handleResolve = reactExports.useCallback(async (payload) => {
107
- var _a;
108
64
  if (isResolving || !selectedHook)
109
65
  return;
110
66
  try {
@@ -114,7 +70,7 @@ function useHookActions({ onResolve, callbacks }) {
114
70
  description: "The payload has been sent and the hook resolved."
115
71
  });
116
72
  setSelectedHook(null);
117
- (_a = callbacks == null ? void 0 : callbacks.onSuccess) == null ? void 0 : _a.call(callbacks);
73
+ callbacks?.onSuccess?.();
118
74
  } catch (err) {
119
75
  console.error("Failed to resolve hook:", err);
120
76
  toast2.error("Failed to resolve hook", {
@@ -392,7 +348,6 @@ function pluralize(singular, plural, count2) {
392
348
  return count2 === 1 ? singular : plural;
393
349
  }
394
350
  function usePaginatedList(fetchFn) {
395
- var _a;
396
351
  const [cursor, setCursor] = reactExports.useState(void 0);
397
352
  const [hasMore, setHasMore] = reactExports.useState(false);
398
353
  const [currentPage, setCurrentPage] = reactExports.useState(0);
@@ -406,10 +361,9 @@ function usePaginatedList(fetchFn) {
406
361
  async (pageIndex, pageCursor, force = false) => {
407
362
  const cacheKey = pageCursor ?? "initial";
408
363
  setAllPageResults((prev) => {
409
- var _a2;
410
364
  const newMap = new Map(prev);
411
365
  newMap.set(pageIndex, {
412
- data: ((_a2 = prev.get(pageIndex)) == null ? void 0 : _a2.data) ?? null,
366
+ data: prev.get(pageIndex)?.data ?? null,
413
367
  isLoading: true,
414
368
  error: null
415
369
  });
@@ -453,10 +407,9 @@ function usePaginatedList(fetchFn) {
453
407
  } catch (err) {
454
408
  const error = err instanceof Error ? err : new WorkflowWebAPIError(String(err), { layer: "client" });
455
409
  setAllPageResults((prev) => {
456
- var _a2;
457
410
  const newMap = new Map(prev);
458
411
  newMap.set(pageIndex, {
459
- data: ((_a2 = prev.get(pageIndex)) == null ? void 0 : _a2.data) ?? null,
412
+ data: prev.get(pageIndex)?.data ?? null,
460
413
  isLoading: false,
461
414
  error
462
415
  });
@@ -514,7 +467,7 @@ function usePaginatedList(fetchFn) {
514
467
  isLoading: true,
515
468
  error: null
516
469
  };
517
- const globalError = ((_a = Array.from(allPageResults.values()).find((p) => p.error)) == null ? void 0 : _a.error) ?? null;
470
+ const globalError = Array.from(allPageResults.values()).find((p) => p.error)?.error ?? null;
518
471
  const globalLoading = Array.from(allPageResults.values()).some(
519
472
  (p) => p.isLoading
520
473
  );
@@ -718,7 +671,7 @@ function HooksTable({
718
671
  "No active hooks found. ",
719
672
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
720
673
  /* @__PURE__ */ jsxRuntimeExports.jsx(DocsLink, { href: "https://useworkflow.dev/docs/api-reference/workflow/create-hook", children: "Learn how to create a hook" })
721
- ] }) : loading && !(data == null ? void 0 : data.data) ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableSkeleton, { variant: "hooks" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
674
+ ] }) : loading && !data?.data ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableSkeleton, { variant: "hooks" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
722
675
  /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "overflow-hidden mt-4 bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "p-0 max-h-[calc(100vh-280px)] overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
723
676
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
724
677
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "sticky top-0 bg-background z-10 border-b shadow-sm h-10", children: "Hook ID" }),
@@ -1005,15 +958,14 @@ function createFocusScopesStack() {
1005
958
  add(focusScope) {
1006
959
  const activeFocusScope = stack[0];
1007
960
  if (focusScope !== activeFocusScope) {
1008
- activeFocusScope == null ? void 0 : activeFocusScope.pause();
961
+ activeFocusScope?.pause();
1009
962
  }
1010
963
  stack = arrayRemove(stack, focusScope);
1011
964
  stack.unshift(focusScope);
1012
965
  },
1013
966
  remove(focusScope) {
1014
- var _a;
1015
967
  stack = arrayRemove(stack, focusScope);
1016
- (_a = stack[0]) == null ? void 0 : _a.resume();
968
+ stack[0]?.resume();
1017
969
  }
1018
970
  };
1019
971
  }
@@ -1330,10 +1282,10 @@ var SelectContentImpl = reactExports.forwardRef(
1330
1282
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
1331
1283
  for (const candidate of candidates) {
1332
1284
  if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
1333
- candidate == null ? void 0 : candidate.scrollIntoView({ block: "nearest" });
1285
+ candidate?.scrollIntoView({ block: "nearest" });
1334
1286
  if (candidate === firstItem && viewport) viewport.scrollTop = 0;
1335
1287
  if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;
1336
- candidate == null ? void 0 : candidate.focus();
1288
+ candidate?.focus();
1337
1289
  if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
1338
1290
  }
1339
1291
  },
@@ -1353,10 +1305,9 @@ var SelectContentImpl = reactExports.forwardRef(
1353
1305
  if (content) {
1354
1306
  let pointerMoveDelta = { x: 0, y: 0 };
1355
1307
  const handlePointerMove = (event) => {
1356
- var _a, _b;
1357
1308
  pointerMoveDelta = {
1358
- x: Math.abs(Math.round(event.pageX) - (((_a = triggerPointerDownPosRef.current) == null ? void 0 : _a.x) ?? 0)),
1359
- y: Math.abs(Math.round(event.pageY) - (((_b = triggerPointerDownPosRef.current) == null ? void 0 : _b.y) ?? 0))
1309
+ x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),
1310
+ y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))
1360
1311
  };
1361
1312
  };
1362
1313
  const handlePointerUp = (event) => {
@@ -1408,7 +1359,7 @@ var SelectContentImpl = reactExports.forwardRef(
1408
1359
  },
1409
1360
  [context.value]
1410
1361
  );
1411
- const handleItemLeave = reactExports.useCallback(() => content == null ? void 0 : content.focus(), [content]);
1362
+ const handleItemLeave = reactExports.useCallback(() => content?.focus(), [content]);
1412
1363
  const itemTextRefCallback = reactExports.useCallback(
1413
1364
  (node, value, disabled) => {
1414
1365
  const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
@@ -1457,8 +1408,7 @@ var SelectContentImpl = reactExports.forwardRef(
1457
1408
  event.preventDefault();
1458
1409
  },
1459
1410
  onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {
1460
- var _a;
1461
- (_a = context.trigger) == null ? void 0 : _a.focus({ preventScroll: true });
1411
+ context.trigger?.focus({ preventScroll: true });
1462
1412
  event.preventDefault();
1463
1413
  }),
1464
1414
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -1616,7 +1566,7 @@ var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) =>
1616
1566
  contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;
1617
1567
  contentWrapper.style.minHeight = minContentHeight + "px";
1618
1568
  contentWrapper.style.maxHeight = availableHeight + "px";
1619
- onPlaced == null ? void 0 : onPlaced();
1569
+ onPlaced?.();
1620
1570
  requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);
1621
1571
  }
1622
1572
  }, [
@@ -1640,7 +1590,7 @@ var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) =>
1640
1590
  (node) => {
1641
1591
  if (node && shouldRepositionRef.current === true) {
1642
1592
  position();
1643
- focusSelectedItem == null ? void 0 : focusSelectedItem();
1593
+ focusSelectedItem?.();
1644
1594
  shouldRepositionRef.current = false;
1645
1595
  }
1646
1596
  },
@@ -1760,7 +1710,7 @@ var SelectViewport = reactExports.forwardRef(
1760
1710
  onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {
1761
1711
  const viewport = event.currentTarget;
1762
1712
  const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
1763
- if ((shouldExpandOnScrollRef == null ? void 0 : shouldExpandOnScrollRef.current) && contentWrapper) {
1713
+ if (shouldExpandOnScrollRef?.current && contentWrapper) {
1764
1714
  const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
1765
1715
  if (scrolledBy > 0) {
1766
1716
  const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
@@ -1824,10 +1774,7 @@ var SelectItem$1 = reactExports.forwardRef(
1824
1774
  const [isFocused, setIsFocused] = reactExports.useState(false);
1825
1775
  const composedRefs = useComposedRefs(
1826
1776
  forwardedRef,
1827
- (node) => {
1828
- var _a;
1829
- return (_a = contentContext.itemRefCallback) == null ? void 0 : _a.call(contentContext, node, value, disabled);
1830
- }
1777
+ (node) => contentContext.itemRefCallback?.(node, value, disabled)
1831
1778
  );
1832
1779
  const textId = useId();
1833
1780
  const pointerTypeRef = reactExports.useRef("touch");
@@ -1851,7 +1798,7 @@ var SelectItem$1 = reactExports.forwardRef(
1851
1798
  textId,
1852
1799
  isSelected,
1853
1800
  onItemTextChange: reactExports.useCallback((node) => {
1854
- setTextValue((prevTextValue) => prevTextValue || ((node == null ? void 0 : node.textContent) ?? "").trim());
1801
+ setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
1855
1802
  }, []),
1856
1803
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1857
1804
  Collection.ItemSlot,
@@ -1885,23 +1832,20 @@ var SelectItem$1 = reactExports.forwardRef(
1885
1832
  pointerTypeRef.current = event.pointerType;
1886
1833
  }),
1887
1834
  onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {
1888
- var _a;
1889
1835
  pointerTypeRef.current = event.pointerType;
1890
1836
  if (disabled) {
1891
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
1837
+ contentContext.onItemLeave?.();
1892
1838
  } else if (pointerTypeRef.current === "mouse") {
1893
1839
  event.currentTarget.focus({ preventScroll: true });
1894
1840
  }
1895
1841
  }),
1896
1842
  onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {
1897
- var _a;
1898
1843
  if (event.currentTarget === document.activeElement) {
1899
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
1844
+ contentContext.onItemLeave?.();
1900
1845
  }
1901
1846
  }),
1902
1847
  onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {
1903
- var _a;
1904
- const isTypingAhead = ((_a = contentContext.searchRef) == null ? void 0 : _a.current) !== "";
1848
+ const isTypingAhead = contentContext.searchRef?.current !== "";
1905
1849
  if (isTypingAhead && event.key === " ") return;
1906
1850
  if (SELECTION_KEYS.includes(event.key)) handleSelect();
1907
1851
  if (event.key === " ") event.preventDefault();
@@ -1928,12 +1872,9 @@ var SelectItemText = reactExports.forwardRef(
1928
1872
  forwardedRef,
1929
1873
  (node) => setItemTextNode(node),
1930
1874
  itemContext.onItemTextChange,
1931
- (node) => {
1932
- var _a;
1933
- return (_a = contentContext.itemTextRefCallback) == null ? void 0 : _a.call(contentContext, node, itemContext.value, itemContext.disabled);
1934
- }
1875
+ (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
1935
1876
  );
1936
- const textContent = itemTextNode == null ? void 0 : itemTextNode.textContent;
1877
+ const textContent = itemTextNode?.textContent;
1937
1878
  const nativeOption = reactExports.useMemo(
1938
1879
  () => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
1939
1880
  [itemContext.disabled, itemContext.value, textContent]
@@ -2041,9 +1982,8 @@ var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
2041
1982
  return () => clearAutoScrollTimer();
2042
1983
  }, [clearAutoScrollTimer]);
2043
1984
  useLayoutEffect2(() => {
2044
- var _a;
2045
1985
  const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
2046
- (_a = activeItem == null ? void 0 : activeItem.ref.current) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
1986
+ activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
2047
1987
  }, [getItems]);
2048
1988
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
2049
1989
  Primitive.div,
@@ -2058,8 +1998,7 @@ var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
2058
1998
  }
2059
1999
  }),
2060
2000
  onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {
2061
- var _a;
2062
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
2001
+ contentContext.onItemLeave?.();
2063
2002
  if (autoScrollTimerRef.current === null) {
2064
2003
  autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
2065
2004
  }
@@ -2475,7 +2414,7 @@ var Checkbox$1 = reactExports.forwardRef(
2475
2414
  });
2476
2415
  const initialCheckedStateRef = reactExports.useRef(checked);
2477
2416
  reactExports.useEffect(() => {
2478
- const form2 = button == null ? void 0 : button.form;
2417
+ const form2 = button?.form;
2479
2418
  if (form2) {
2480
2419
  const reset = () => setChecked(initialCheckedStateRef.current);
2481
2420
  form2.addEventListener("reset", reset);
@@ -2611,7 +2550,7 @@ const Checkbox = reactExports.forwardRef(({ className, checked, indeterminate, o
2611
2550
  id: checkboxId,
2612
2551
  checked: checkedState,
2613
2552
  onCheckedChange: (state) => {
2614
- onCheckedChange == null ? void 0 : onCheckedChange(state === true);
2553
+ onCheckedChange?.(state === true);
2615
2554
  },
2616
2555
  className: cn(
2617
2556
  "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow",
@@ -2639,7 +2578,7 @@ function RunActionsDropdownContentInner({
2639
2578
  const [events, setEvents] = reactExports.useState(void 0);
2640
2579
  const [isLoading, setIsLoading] = reactExports.useState(true);
2641
2580
  const [run, setRun] = reactExports.useState(void 0);
2642
- const status = (run == null ? void 0 : run.status) || runStatus;
2581
+ const status = run?.status || runStatus;
2643
2582
  reactExports.useEffect(() => {
2644
2583
  setIsLoading(true);
2645
2584
  Promise.all([
@@ -2778,10 +2717,7 @@ function FilterControls({
2778
2717
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-[180px] h-9", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Filter by workflow" }) }),
2779
2718
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
2780
2719
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "all", children: "All Workflows" }),
2781
- Array.from(seenWorkflowNames).sort().map((name) => {
2782
- var _a;
2783
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: name, children: ((_a = parseWorkflowName(name)) == null ? void 0 : _a.shortName) || name }, name);
2784
- })
2720
+ Array.from(seenWorkflowNames).sort().map((name) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: name, children: parseWorkflowName(name)?.shortName || name }, name))
2785
2721
  ] })
2786
2722
  ]
2787
2723
  }
@@ -2850,7 +2786,6 @@ function FilterControls({
2850
2786
  ] });
2851
2787
  }
2852
2788
  function RunsTable({ onRunClick }) {
2853
- var _a, _b, _c, _d;
2854
2789
  const [searchParams] = useSearchParams();
2855
2790
  const handleWorkflowFilter = useWorkflowFilter();
2856
2791
  const handleStatusFilter = useStatusFilter();
@@ -2866,9 +2801,9 @@ function RunsTable({ onRunClick }) {
2866
2801
  const [hasLoadedOnce, setHasLoadedOnce] = reactExports.useState(false);
2867
2802
  const env = reactExports.useMemo(() => ({}), []);
2868
2803
  const isLocal = serverConfig.backendId === "local" || serverConfig.backendId === "@workflow/world-local";
2869
- const localDataDirPath = (_a = serverConfig.displayInfo) == null ? void 0 : _a["local.dataDirPath"];
2870
- const localShortName = (_b = serverConfig.displayInfo) == null ? void 0 : _b["local.shortName"];
2871
- const statusFilterRequiresWorkflowNameFilter = ((_c = serverConfig.backendId) == null ? void 0 : _c.includes("vercel")) || false;
2804
+ const localDataDirPath = serverConfig.displayInfo?.["local.dataDirPath"];
2805
+ const localShortName = serverConfig.displayInfo?.["local.shortName"];
2806
+ const statusFilterRequiresWorkflowNameFilter = serverConfig.backendId?.includes("vercel") || false;
2872
2807
  const [seenWorkflowNames, setSeenWorkflowNames] = reactExports.useState(
2873
2808
  /* @__PURE__ */ new Set()
2874
2809
  );
@@ -2893,7 +2828,7 @@ function RunsTable({ onRunClick }) {
2893
2828
  const runs = data.data ?? [];
2894
2829
  const [isBulkCancelling, setIsBulkCancelling] = reactExports.useState(false);
2895
2830
  const [isBulkReenqueuing, setIsBulkReenqueuing] = reactExports.useState(false);
2896
- const isLocalAndHasMissingData = isLocal && (!localDataDirPath || !((_d = data == null ? void 0 : data.data) == null ? void 0 : _d.length));
2831
+ const isLocalAndHasMissingData = isLocal && (!localDataDirPath || !data?.data?.length);
2897
2832
  reactExports.useEffect(() => {
2898
2833
  if (data.data && data.data.length > 0) {
2899
2834
  const newNames = new Set(data.data.map((run) => run.workflowName));
@@ -3071,49 +3006,46 @@ function RunsTable({ onRunClick }) {
3071
3006
  "."
3072
3007
  ] }),
3073
3008
  isLocalAndHasMissingData && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm flex items-center gap-2", children: "This view will update once you run a workflow." })
3074
- ] }) }) }) : runs.map((run) => {
3075
- var _a2;
3076
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
3077
- TableRow,
3078
- {
3079
- className: "cursor-pointer group relative",
3080
- onClick: () => onRunClick(run.runId),
3081
- "data-selected": selection.isSelected(run),
3082
- children: [
3083
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3084
- Checkbox,
3085
- {
3086
- checked: selection.isSelected(run),
3087
- onCheckedChange: () => selection.toggleSelection(run),
3088
- "aria-label": `Select run ${run.runId}`
3089
- }
3090
- ) }),
3091
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.workflowName, overlay: true, children: ((_a2 = parseWorkflowName(run.workflowName)) == null ? void 0 : _a2.shortName) || "?" }) }),
3092
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "font-mono text-xs py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.runId, overlay: true, children: run.runId }) }),
3093
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3094
- StatusBadge,
3095
- {
3096
- status: run.status,
3097
- context: run,
3098
- durationMs: run.startedAt ? (run.completedAt ? new Date(run.completedAt).getTime() : Date.now()) - new Date(run.startedAt).getTime() : void 0
3099
- }
3100
- ) }),
3101
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.startedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.startedAt }) : "-" }),
3102
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.completedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.completedAt }) : "-" }),
3103
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3104
- LazyDropdownMenu,
3105
- {
3106
- env,
3107
- runId: run.runId,
3108
- runStatus: run.status,
3109
- onSuccess: onReload
3110
- }
3111
- ) })
3112
- ]
3113
- },
3114
- run.runId
3115
- );
3116
- }) })
3009
+ ] }) }) }) : runs.map((run) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
3010
+ TableRow,
3011
+ {
3012
+ className: "cursor-pointer group relative",
3013
+ onClick: () => onRunClick(run.runId),
3014
+ "data-selected": selection.isSelected(run),
3015
+ children: [
3016
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3017
+ Checkbox,
3018
+ {
3019
+ checked: selection.isSelected(run),
3020
+ onCheckedChange: () => selection.toggleSelection(run),
3021
+ "aria-label": `Select run ${run.runId}`
3022
+ }
3023
+ ) }),
3024
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.workflowName, overlay: true, children: parseWorkflowName(run.workflowName)?.shortName || "?" }) }),
3025
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "font-mono text-xs py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.runId, overlay: true, children: run.runId }) }),
3026
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3027
+ StatusBadge,
3028
+ {
3029
+ status: run.status,
3030
+ context: run,
3031
+ durationMs: run.startedAt ? (run.completedAt ? new Date(run.completedAt).getTime() : Date.now()) - new Date(run.startedAt).getTime() : void 0
3032
+ }
3033
+ ) }),
3034
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.startedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.startedAt }) : "-" }),
3035
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.completedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.completedAt }) : "-" }),
3036
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3037
+ LazyDropdownMenu,
3038
+ {
3039
+ env,
3040
+ runId: run.runId,
3041
+ runStatus: run.status,
3042
+ onSuccess: onReload
3043
+ }
3044
+ ) })
3045
+ ]
3046
+ },
3047
+ run.runId
3048
+ )) })
3117
3049
  ] }) }) }),
3118
3050
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mt-4", children: [
3119
3051
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-muted-foreground", children: pageInfo }),
@@ -3338,9 +3270,8 @@ var DialogContentModal = reactExports.forwardRef(
3338
3270
  trapFocus: context.open,
3339
3271
  disableOutsidePointerEvents: true,
3340
3272
  onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
3341
- var _a;
3342
3273
  event.preventDefault();
3343
- (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
3274
+ context.triggerRef.current?.focus();
3344
3275
  }),
3345
3276
  onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
3346
3277
  const originalEvent = event.detail.originalEvent;
@@ -3369,18 +3300,16 @@ var DialogContentNonModal = reactExports.forwardRef(
3369
3300
  trapFocus: false,
3370
3301
  disableOutsidePointerEvents: false,
3371
3302
  onCloseAutoFocus: (event) => {
3372
- var _a, _b;
3373
- (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
3303
+ props.onCloseAutoFocus?.(event);
3374
3304
  if (!event.defaultPrevented) {
3375
- if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
3305
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
3376
3306
  event.preventDefault();
3377
3307
  }
3378
3308
  hasInteractedOutsideRef.current = false;
3379
3309
  hasPointerDownOutsideRef.current = false;
3380
3310
  },
3381
3311
  onInteractOutside: (event) => {
3382
- var _a, _b;
3383
- (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
3312
+ props.onInteractOutside?.(event);
3384
3313
  if (!event.defaultPrevented) {
3385
3314
  hasInteractedOutsideRef.current = true;
3386
3315
  if (event.detail.originalEvent.type === "pointerdown") {
@@ -3388,7 +3317,7 @@ var DialogContentNonModal = reactExports.forwardRef(
3388
3317
  }
3389
3318
  }
3390
3319
  const target = event.target;
3391
- const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
3320
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
3392
3321
  if (targetIsTrigger) event.preventDefault();
3393
3322
  if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
3394
3323
  event.preventDefault();
@@ -3500,8 +3429,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
3500
3429
  const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
3501
3430
  const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
3502
3431
  reactExports.useEffect(() => {
3503
- var _a;
3504
- const describedById = (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby");
3432
+ const describedById = contentRef.current?.getAttribute("aria-describedby");
3505
3433
  if (descriptionId && describedById) {
3506
3434
  const hasDescription = document.getElementById(descriptionId);
3507
3435
  if (!hasDescription) console.warn(MESSAGE);
@@ -3711,14 +3639,14 @@ function calculateNodePositions(rawNodes, edges) {
3711
3639
  }
3712
3640
  function adaptManifest(raw) {
3713
3641
  const workflows = {};
3714
- console.log("[adaptManifest] Raw manifest version:", raw == null ? void 0 : raw.version);
3642
+ console.log("[adaptManifest] Raw manifest version:", raw?.version);
3715
3643
  console.log(
3716
3644
  "[adaptManifest] Raw workflows keys:",
3717
- Object.keys((raw == null ? void 0 : raw.workflows) || {})
3645
+ Object.keys(raw?.workflows || {})
3718
3646
  );
3719
- if (!(raw == null ? void 0 : raw.workflows)) {
3647
+ if (!raw?.workflows) {
3720
3648
  console.log("[adaptManifest] No workflows in manifest, returning empty");
3721
- return { version: (raw == null ? void 0 : raw.version) || "1.0.0", workflows: {} };
3649
+ return { version: raw?.version || "1.0.0", workflows: {} };
3722
3650
  }
3723
3651
  for (const [filePath, workflowsInFile] of Object.entries(raw.workflows)) {
3724
3652
  for (const [workflowName, entry] of Object.entries(workflowsInFile)) {
@@ -3773,7 +3701,7 @@ function useWorkflowGraphManifest() {
3773
3701
  );
3774
3702
  console.log(
3775
3703
  "[useWorkflowGraphManifest] Workflows in raw:",
3776
- Object.keys((rawManifest == null ? void 0 : rawManifest.workflows) || {})
3704
+ Object.keys(rawManifest?.workflows || {})
3777
3705
  );
3778
3706
  const adaptedManifest = adaptManifest(rawManifest);
3779
3707
  console.log(
@@ -3819,13 +3747,13 @@ function WorkflowsList({ onWorkflowSelect }) {
3819
3747
  [workflows]
3820
3748
  );
3821
3749
  const selectedWorkflowStepCount = reactExports.useMemo(
3822
- () => (selectedWorkflow == null ? void 0 : selectedWorkflow.nodes.filter((node) => node.data.nodeKind === "step").length) ?? 0,
3750
+ () => selectedWorkflow?.nodes.filter((node) => node.data.nodeKind === "step").length ?? 0,
3823
3751
  [selectedWorkflow]
3824
3752
  );
3825
3753
  const handleViewWorkflow = (workflow) => {
3826
3754
  setSelectedWorkflow(workflow);
3827
3755
  setSheetOpen(true);
3828
- onWorkflowSelect == null ? void 0 : onWorkflowSelect(workflow.workflowName);
3756
+ onWorkflowSelect?.(workflow.workflowName);
3829
3757
  };
3830
3758
  if (loading) {
3831
3759
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TableSkeleton, { variant: "workflows", rows: 6 });
@@ -3884,7 +3812,7 @@ function WorkflowsList({ onWorkflowSelect }) {
3884
3812
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SheetHeader, { children: [
3885
3813
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SheetTitle, { className: "flex items-center gap-2", children: [
3886
3814
  /* @__PURE__ */ jsxRuntimeExports.jsx(Workflow, { className: "h-5 w-5" }),
3887
- selectedWorkflow == null ? void 0 : selectedWorkflow.workflowName
3815
+ selectedWorkflow?.workflowName
3888
3816
  ] }),
3889
3817
  selectedWorkflow && /* @__PURE__ */ jsxRuntimeExports.jsx(SheetDescription, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
3890
3818
  /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "text-xs", children: selectedWorkflow.filePath }),