@workflow/web 5.3.1 → 5.3.3

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 (43) hide show
  1. package/README.md +11 -34
  2. package/build/client/assets/app-CmaRLUwS.css +1 -0
  3. package/build/client/assets/arrow-up-right-AHTyWXU2.js +9 -0
  4. package/build/client/assets/{entry.client-DDsh88VE.js → entry.client-BqbaswKw.js} +13 -35
  5. package/build/client/assets/{highlighted-body-JLMTFACH-CWHg5f-6.js → highlighted-body-JLMTFACH-_kzpqYmW.js} +2 -2
  6. package/build/client/assets/{home-DZqYMSiD.js → home-DjUPTrY5.js} +91 -159
  7. package/build/client/assets/{index-BS6T0Zjc.js → index-BUQuaV5X.js} +108 -174
  8. package/build/client/assets/manifest-9126df65.js +1 -0
  9. package/build/client/assets/{mermaid-WFAXDIZX-BLO7Z8RE.js → mermaid-WFAXDIZX-CNo_0yWo.js} +1499 -4067
  10. package/build/client/assets/mermaid-WFAXDIZX-F88p7PFX.css +1 -0
  11. package/build/client/assets/meta-9cjJ0pVb.js +6 -0
  12. package/build/client/assets/{root-wdKzRZGT.js → root-Bh-E5He-.js} +17 -35
  13. package/build/client/assets/root-kJB77No4.css +1 -0
  14. package/build/client/assets/rpc-client-DL_nSX36.js +2481 -0
  15. package/build/client/assets/{run-detail-DyXpnv9C.js → run-detail-5dPVsaSm.js} +533 -807
  16. package/build/client/assets/run-usage-BEswHGKU.js +1252 -0
  17. package/build/client/assets/run-usage-C_wyncgV.js +33 -0
  18. package/build/client/assets/skeleton-DE14mNQw.js +76 -0
  19. package/build/client/assets/{url-state-DhOv2zv0.js → url-state-5GKQwo-f.js} +546 -857
  20. package/build/client/assets/{zstd-browser-decoder-BNeg7hxG.js → zstd-browser-decoder-CbTMLAMd.js} +2 -2
  21. package/build/server/assets/{app-CNGxG3wL.js → app-C-e60j14.js} +13627 -12777
  22. package/build/server/assets/{esm-CETb4fkq.js → esm-BzrGWk7J.js} +2 -2
  23. package/build/server/assets/{highlighted-body-JLMTFACH-Bj8JsfUl.js → highlighted-body-JLMTFACH-B7y0X_Kn.js} +1 -1
  24. package/build/server/assets/{index-DGn_6xEN.js → index-DRDsjR--.js} +398 -490
  25. package/build/server/assets/{mermaid-WFAXDIZX-C_v93dNU.js → mermaid-WFAXDIZX-MsPxEM1Y.js} +1 -1
  26. package/build/server/assets/{token-b1ZjKN2Q.js → token-CKgyaeCJ.js} +5 -5
  27. package/build/server/assets/{token-5fcfNNDG.js → token-DXh0TnqB.js} +6 -6
  28. package/build/server/assets/{token-util-BJhEZw83.js → token-util-CCc0uYVy.js} +2 -2
  29. package/build/server/assets/{token-util-spPPOelu.js → token-util-DOHYMq7D.js} +1 -1
  30. package/build/server/assets/{wrapper-Cc-ChiPM.js → wrapper-BzLz38Oh.js} +2 -2
  31. package/build/server/assets/{zstd-browser-decoder-y4X_FyMk.js → zstd-browser-decoder-BSSEC3XP.js} +1 -1
  32. package/build/server/index.js +1 -1
  33. package/handler.d.ts +9 -0
  34. package/handler.js +16 -2
  35. package/host-guard.js +179 -0
  36. package/package.json +9 -8
  37. package/server.d.ts +15 -1
  38. package/server.js +14 -1
  39. package/build/client/assets/app-BE8uqS_d.css +0 -1
  40. package/build/client/assets/arrow-up-right-CNHh1bh2.js +0 -15
  41. package/build/client/assets/manifest-f2e93220.js +0 -1
  42. package/build/client/assets/mermaid-WFAXDIZX-D8CjRQta.css +0 -1
  43. package/build/client/assets/root-BBptRWmF.css +0 -1
@@ -1,12 +1,8 @@
1
- import { r as reactExports, j as jsxRuntimeExports, z as Link, f as reactDomExports, B as useSearchParams, A as useNavigate, C as useLocation, w as withComponentProps } from "./index-BS6T0Zjc.js";
2
- import { R as ResolveHookModal, S as Send, u as unwrapOrThrow, W as WorkflowWebAPIError, g as getPaginationDisplay, f as fetchHookToken, D as DEFAULT_PAGE_SIZE, a as Skeleton, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as getErrorTitle, e as AlertDescription, h as getErrorMessage, i as CopyableText, j as DropdownMenu, k as DropdownMenuTrigger, E as Ellipsis, l as DropdownMenuContent, m as DropdownMenuItem, r as resumeHook, n as useDirection, o as createCollection, p as hideOthers, q as useFocusGuards, s as ReactRemoveScroll, t as ChevronUp, X, v as useWorkflowRunsInfinite, w as bulkCancelRuns, x as reenqueueRun, y as parseWorkflowName, z as StatusBadge, Z as Zap, B as CircleX, F as RunActionsDropdownItems, G as Dialog, H as DialogContent, I as DialogClose, J as DialogTitle, K as DialogDescription, L as DialogPortal, M as DialogOverlay, N as unwrapServerActionResult, O as WorkflowGraphViewer, P as useOptimisticSearchParams, T as Tabs, Q as TabsList, U as TabsTrigger, V as TabsContent, Y as ErrorBoundary } from "./url-state-DhOv2zv0.js";
3
- import { c as createLucideIcon, h as useToast, e as cn, i as fetchHooks, T as Tooltip, a as TooltipTrigger, j as Spinner, C as Check, k as Copy, b as TooltipContent, B as Button, l as ChevronRight, m as fetchEvents, n as useComposedRefs, o as useLayoutEffect2, P as Primitive, p as useControllableState, q as useId, s as Popper, V as VISUALLY_HIDDEN_STYLES, v as createPopperScope, w as createContextScope, x as PopperAnchor, y as composeEventHandlers, z as Portal, A as Presence, F as FocusScope, D as DismissableLayer, E as PopperContent, G as useCallbackRef, H as createSlot, J as ChevronDown, K as useSize, u as useServerConfig, L as BULK_CANCEL_MAX_RUN_IDS, t as toast, M as fetchRun, N as cva, O as fetchWorkflowsManifest } from "./mermaid-WFAXDIZX-BLO7Z8RE.js";
4
- /**
5
- * @license lucide-react v0.575.0 - ISC
6
- *
7
- * This source code is licensed under the ISC license.
8
- * See the LICENSE file in the root directory of this source tree.
9
- */
1
+ import { r as reactExports, j as jsxRuntimeExports, L as Link, g as reactDomExports, C as useSearchParams, B as useNavigate, D as useLocation, w as withComponentProps } from "./index-BUQuaV5X.js";
2
+ import { R as ResolveHookModal, S as Send, u as unwrapOrThrow, W as WorkflowWebAPIError, g as getPaginationDisplay, f as fetchHookToken, D as DEFAULT_PAGE_SIZE, a as RelativeTime, A as Alert, b as AlertTitle, c as getErrorTitle, d as AlertDescription, e as getErrorMessage, C as CopyableText, h as DropdownMenu, i as DropdownMenuTrigger, E as Ellipsis, j as DropdownMenuContent, k as DropdownMenuItem, r as resumeHook, l as useDirection, m as createCollection, n as hideOthers, o as useFocusGuards, p as ReactRemoveScroll, q as ChevronUp, X, s as useWorkflowRunsInfinite, t as bulkCancelRuns, v as reenqueueRun, w as StatusBadge, Z as Zap, x as CircleX, y as RunActionsDropdownItems, z as Dialog, B as DialogContent, F as DialogClose, G as DialogTitle, H as DialogDescription, I as DialogPortal, J as DialogOverlay, K as unwrapServerActionResult, L as WorkflowGraphViewer, M as useOptimisticSearchParams, T as Tabs, N as TabsList, O as TabsTrigger, P as TabsContent, Q as ErrorBoundary } from "./url-state-5GKQwo-f.js";
3
+ import { c as createLucideIcon, m as useToast, a as cn, T as Tooltip, d as TooltipTrigger, S as Spinner, n as Check, o as Copy, e as TooltipContent, B as Button, C as ChevronRight, p as useComposedRefs, q as useLayoutEffect2, P as Primitive, s as useControllableState, v as useId, w as Popper, V as VISUALLY_HIDDEN_STYLES, x as createPopperScope, y as createContextScope, z as PopperAnchor, A as composeEventHandlers, D as Portal, E as Presence, F as FocusScope, G as DismissableLayer, H as PopperContent, J as useCallbackRef, K as createSlot, L as ChevronDown, M as useSize, N as BULK_CANCEL_MAX_RUN_IDS, t as toast, O as cva } from "./mermaid-WFAXDIZX-CNo_0yWo.js";
4
+ import { f as fetchHooks, a as fetchEvents, u as useServerConfig, b as fetchRun, c as fetchWorkflowsManifest } from "./rpc-client-DL_nSX36.js";
5
+ import { S as Skeleton, b as CircleAlert, a as parseWorkflowName } from "./skeleton-DE14mNQw.js";
10
6
  const __iconNode$6 = [
11
7
  ["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
12
8
  ["path", { d: "M7 20V4", key: "1yoxec" }],
@@ -15,12 +11,6 @@ const __iconNode$6 = [
15
11
  ["path", { d: "M15 14h5l-5 6h5", key: "ur5jdg" }]
16
12
  ];
17
13
  const ArrowDownAZ = createLucideIcon("arrow-down-a-z", __iconNode$6);
18
- /**
19
- * @license lucide-react v0.575.0 - ISC
20
- *
21
- * This source code is licensed under the ISC license.
22
- * See the LICENSE file in the root directory of this source tree.
23
- */
24
14
  const __iconNode$5 = [
25
15
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
26
16
  ["path", { d: "M7 4v16", key: "1glfcx" }],
@@ -29,40 +19,16 @@ const __iconNode$5 = [
29
19
  ["path", { d: "M15 14h5l-5 6h5", key: "ur5jdg" }]
30
20
  ];
31
21
  const ArrowUpAZ = createLucideIcon("arrow-up-a-z", __iconNode$5);
32
- /**
33
- * @license lucide-react v0.575.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */
38
22
  const __iconNode$4 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
39
23
  const ChevronLeft = createLucideIcon("chevron-left", __iconNode$4);
40
- /**
41
- * @license lucide-react v0.575.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */
46
24
  const __iconNode$3 = [
47
25
  ["path", { d: "M15 6a9 9 0 0 0-9 9V3", key: "1cii5b" }],
48
26
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
49
27
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }]
50
28
  ];
51
29
  const GitBranch = createLucideIcon("git-branch", __iconNode$3);
52
- /**
53
- * @license lucide-react v0.575.0 - ISC
54
- *
55
- * This source code is licensed under the ISC license.
56
- * See the LICENSE file in the root directory of this source tree.
57
- */
58
30
  const __iconNode$2 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
59
31
  const Minus = createLucideIcon("minus", __iconNode$2);
60
- /**
61
- * @license lucide-react v0.575.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */
66
32
  const __iconNode$1 = [
67
33
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
68
34
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
@@ -70,12 +36,6 @@ const __iconNode$1 = [
70
36
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
71
37
  ];
72
38
  const RefreshCw = createLucideIcon("refresh-cw", __iconNode$1);
73
- /**
74
- * @license lucide-react v0.575.0 - ISC
75
- *
76
- * This source code is licensed under the ISC license.
77
- * See the LICENSE file in the root directory of this source tree.
78
- */
79
39
  const __iconNode = [
80
40
  ["rect", { width: "8", height: "8", x: "3", y: "3", rx: "2", key: "by2w9f" }],
81
41
  ["path", { d: "M7 11v4a2 2 0 0 0 2 2h4", key: "xkn7yn" }],
@@ -96,7 +56,6 @@ function useHookActions({ onResolve, callbacks }) {
96
56
  setSelectedHook(null);
97
57
  }, []);
98
58
  const handleResolve = reactExports.useCallback(async (payload) => {
99
- var _a;
100
59
  if (isResolving || !selectedHook)
101
60
  return;
102
61
  try {
@@ -106,7 +65,7 @@ function useHookActions({ onResolve, callbacks }) {
106
65
  description: "The payload has been sent and the hook resolved."
107
66
  });
108
67
  setSelectedHook(null);
109
- (_a = callbacks == null ? void 0 : callbacks.onSuccess) == null ? void 0 : _a.call(callbacks);
68
+ callbacks?.onSuccess?.();
110
69
  } catch (err) {
111
70
  console.error("Failed to resolve hook:", err);
112
71
  toast2.error("Failed to resolve hook", {
@@ -318,7 +277,6 @@ function useLoadMoreOnScroll(loadMore, {
318
277
  return sentinelRef;
319
278
  }
320
279
  function usePaginatedList(fetchFn) {
321
- var _a;
322
280
  const [cursor, setCursor] = reactExports.useState(void 0);
323
281
  const [hasMore, setHasMore] = reactExports.useState(false);
324
282
  const [currentPage, setCurrentPage] = reactExports.useState(0);
@@ -332,10 +290,9 @@ function usePaginatedList(fetchFn) {
332
290
  async (pageIndex, pageCursor, force = false) => {
333
291
  const cacheKey = pageCursor ?? "initial";
334
292
  setAllPageResults((prev) => {
335
- var _a2;
336
293
  const newMap = new Map(prev);
337
294
  newMap.set(pageIndex, {
338
- data: ((_a2 = prev.get(pageIndex)) == null ? void 0 : _a2.data) ?? null,
295
+ data: prev.get(pageIndex)?.data ?? null,
339
296
  isLoading: true,
340
297
  error: null
341
298
  });
@@ -382,10 +339,9 @@ function usePaginatedList(fetchFn) {
382
339
  } catch (err) {
383
340
  const error = err instanceof Error ? err : new WorkflowWebAPIError(String(err), { layer: "client" });
384
341
  setAllPageResults((prev) => {
385
- var _a2;
386
342
  const newMap = new Map(prev);
387
343
  newMap.set(pageIndex, {
388
- data: ((_a2 = prev.get(pageIndex)) == null ? void 0 : _a2.data) ?? null,
344
+ data: prev.get(pageIndex)?.data ?? null,
389
345
  isLoading: false,
390
346
  error
391
347
  });
@@ -443,7 +399,7 @@ function usePaginatedList(fetchFn) {
443
399
  isLoading: true,
444
400
  error: null
445
401
  };
446
- const globalError = ((_a = Array.from(allPageResults.values()).find((p) => p.error)) == null ? void 0 : _a.error) ?? null;
402
+ const globalError = Array.from(allPageResults.values()).find((p) => p.error)?.error ?? null;
447
403
  const globalLoading = Array.from(allPageResults.values()).some(
448
404
  (p) => p.isLoading
449
405
  );
@@ -776,7 +732,7 @@ function HooksTable({
776
732
  "No active hooks found. ",
777
733
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
778
734
  /* @__PURE__ */ jsxRuntimeExports.jsx(DocsLink, { href: "https://workflow-sdk.dev/docs/api-reference/workflow/create-hook", children: "Learn how to create a hook" })
779
- ] }) : loading && !(data == null ? void 0 : data.data) ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableSkeleton, { variant: "hooks" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
735
+ ] }) : loading && !data?.data ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableSkeleton, { variant: "hooks" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
780
736
  /* @__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: [
781
737
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
782
738
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "sticky top-0 bg-background z-10 border-b shadow-sm h-10", children: "Hook ID" }),
@@ -936,7 +892,7 @@ function SelectProvider(props) {
936
892
  }, "handleUserSelect");
937
893
  const initialValueRef = reactExports.useRef(value);
938
894
  reactExports.useEffect(() => {
939
- const associatedForm = form ? trigger == null ? void 0 : trigger.ownerDocument.getElementById(form) : trigger == null ? void 0 : trigger.form;
895
+ const associatedForm = form ? trigger?.ownerDocument.getElementById(form) : trigger?.form;
940
896
  if (associatedForm instanceof HTMLFormElement) {
941
897
  const reset = /* @__PURE__ */ __name$1(() => setValue(initialValueRef.current), "reset");
942
898
  associatedForm.addEventListener("reset", reset);
@@ -1203,10 +1159,10 @@ var SelectContentImpl = /* @__PURE__ */ reactExports.forwardRef(
1203
1159
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
1204
1160
  for (const candidate of candidates) {
1205
1161
  if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
1206
- candidate == null ? void 0 : candidate.scrollIntoView({ block: "nearest" });
1162
+ candidate?.scrollIntoView({ block: "nearest" });
1207
1163
  if (candidate === firstItem && viewport) viewport.scrollTop = 0;
1208
1164
  if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;
1209
- candidate == null ? void 0 : candidate.focus();
1165
+ candidate?.focus();
1210
1166
  if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
1211
1167
  }
1212
1168
  },
@@ -1226,10 +1182,9 @@ var SelectContentImpl = /* @__PURE__ */ reactExports.forwardRef(
1226
1182
  if (content) {
1227
1183
  let pointerMoveDelta = { x: 0, y: 0 };
1228
1184
  const handlePointerMove = /* @__PURE__ */ __name$1((event) => {
1229
- var _a, _b;
1230
1185
  pointerMoveDelta = {
1231
- x: Math.abs(Math.round(event.pageX) - (((_a = triggerPointerDownPosRef.current) == null ? void 0 : _a.x) ?? 0)),
1232
- y: Math.abs(Math.round(event.pageY) - (((_b = triggerPointerDownPosRef.current) == null ? void 0 : _b.y) ?? 0))
1186
+ x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),
1187
+ y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))
1233
1188
  };
1234
1189
  }, "handlePointerMove");
1235
1190
  const handlePointerUp = /* @__PURE__ */ __name$1((event) => {
@@ -1267,10 +1222,7 @@ var SelectContentImpl = /* @__PURE__ */ reactExports.forwardRef(
1267
1222
  const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);
1268
1223
  const nextItem = findNextItem(enabledItems, search, currentItem);
1269
1224
  if (nextItem) {
1270
- setTimeout(() => {
1271
- var _a;
1272
- return (_a = nextItem.ref.current) == null ? void 0 : _a.focus();
1273
- });
1225
+ setTimeout(() => nextItem.ref.current?.focus());
1274
1226
  }
1275
1227
  });
1276
1228
  const itemRefCallback = reactExports.useCallback(
@@ -1288,7 +1240,7 @@ var SelectContentImpl = /* @__PURE__ */ reactExports.forwardRef(
1288
1240
  },
1289
1241
  [context.value]
1290
1242
  );
1291
- const handleItemLeave = reactExports.useCallback(() => content == null ? void 0 : content.focus(), [content]);
1243
+ const handleItemLeave = reactExports.useCallback(() => content?.focus(), [content]);
1292
1244
  const itemTextRefCallback = reactExports.useCallback(
1293
1245
  (node, value, disabled) => {
1294
1246
  if (!node) return;
@@ -1342,8 +1294,7 @@ var SelectContentImpl = /* @__PURE__ */ reactExports.forwardRef(
1342
1294
  event.preventDefault();
1343
1295
  },
1344
1296
  onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {
1345
- var _a;
1346
- (_a = context.trigger) == null ? void 0 : _a.focus({ preventScroll: true });
1297
+ context.trigger?.focus({ preventScroll: true });
1347
1298
  event.preventDefault();
1348
1299
  }),
1349
1300
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -1499,7 +1450,7 @@ var SelectItemAlignedPosition = /* @__PURE__ */ reactExports.forwardRef(/* @__PU
1499
1450
  contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;
1500
1451
  contentWrapper.style.minHeight = minContentHeight + "px";
1501
1452
  contentWrapper.style.maxHeight = availableHeight + "px";
1502
- onPlaced == null ? void 0 : onPlaced();
1453
+ onPlaced?.();
1503
1454
  requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);
1504
1455
  }
1505
1456
  }, [
@@ -1523,7 +1474,7 @@ var SelectItemAlignedPosition = /* @__PURE__ */ reactExports.forwardRef(/* @__PU
1523
1474
  (node) => {
1524
1475
  if (node && shouldRepositionRef.current === true) {
1525
1476
  position();
1526
- focusSelectedItem == null ? void 0 : focusSelectedItem();
1477
+ focusSelectedItem?.();
1527
1478
  shouldRepositionRef.current = false;
1528
1479
  }
1529
1480
  },
@@ -1640,7 +1591,7 @@ var SelectViewport = /* @__PURE__ */ reactExports.forwardRef(
1640
1591
  onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {
1641
1592
  const viewport = event.currentTarget;
1642
1593
  const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
1643
- if ((shouldExpandOnScrollRef == null ? void 0 : shouldExpandOnScrollRef.current) && contentWrapper) {
1594
+ if (shouldExpandOnScrollRef?.current && contentWrapper) {
1644
1595
  const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
1645
1596
  if (scrolledBy > 0) {
1646
1597
  const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
@@ -1693,10 +1644,7 @@ var SelectItem$1 = /* @__PURE__ */ reactExports.forwardRef(
1693
1644
  const [textValue, setTextValue] = reactExports.useState(textValueProp ?? "");
1694
1645
  const [isFocused, setIsFocused] = reactExports.useState(false);
1695
1646
  const handleItemRefCallback = useCallbackRef(
1696
- (node) => {
1697
- var _a;
1698
- return (_a = contentContext.itemRefCallback) == null ? void 0 : _a.call(contentContext, node, value, disabled);
1699
- }
1647
+ (node) => contentContext.itemRefCallback?.(node, value, disabled)
1700
1648
  );
1701
1649
  const composedRefs = useComposedRefs(forwardedRef, handleItemRefCallback);
1702
1650
  const textId = useId();
@@ -1716,7 +1664,7 @@ var SelectItem$1 = /* @__PURE__ */ reactExports.forwardRef(
1716
1664
  textId,
1717
1665
  isSelected,
1718
1666
  onItemTextChange: reactExports.useCallback((node) => {
1719
- setTextValue((prevTextValue) => prevTextValue || ((node == null ? void 0 : node.textContent) ?? "").trim());
1667
+ setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
1720
1668
  }, []),
1721
1669
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1722
1670
  Collection.ItemSlot,
@@ -1760,26 +1708,23 @@ var SelectItem$1 = /* @__PURE__ */ reactExports.forwardRef(
1760
1708
  pointerTypeRef.current = event.pointerType;
1761
1709
  }),
1762
1710
  onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {
1763
- var _a;
1764
1711
  pointerTypeRef.current = event.pointerType;
1765
1712
  if (disabled) {
1766
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
1713
+ contentContext.onItemLeave?.();
1767
1714
  } else if (pointerTypeRef.current === "mouse") {
1768
1715
  event.currentTarget.focus({ preventScroll: true });
1769
1716
  }
1770
1717
  }),
1771
1718
  onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {
1772
- var _a;
1773
1719
  if (event.currentTarget === document.activeElement) {
1774
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
1720
+ contentContext.onItemLeave?.();
1775
1721
  }
1776
1722
  }),
1777
1723
  onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {
1778
- var _a;
1779
1724
  if (disabled || event.target !== event.currentTarget) {
1780
1725
  return;
1781
1726
  }
1782
- const isTypingAhead = ((_a = contentContext.searchRef) == null ? void 0 : _a.current) !== "";
1727
+ const isTypingAhead = contentContext.searchRef?.current !== "";
1783
1728
  if (isTypingAhead && event.key === " ") {
1784
1729
  return;
1785
1730
  }
@@ -1808,10 +1753,7 @@ var SelectItemText = /* @__PURE__ */ reactExports.forwardRef(
1808
1753
  const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
1809
1754
  const [itemTextNode, setItemTextNode] = reactExports.useState(null);
1810
1755
  const handleItemTextRefCallback = useCallbackRef(
1811
- (node) => {
1812
- var _a;
1813
- return (_a = contentContext.itemTextRefCallback) == null ? void 0 : _a.call(contentContext, node, itemContext.value, itemContext.disabled);
1814
- }
1756
+ (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
1815
1757
  );
1816
1758
  const composedRefs = useComposedRefs(
1817
1759
  forwardedRef,
@@ -1819,7 +1761,7 @@ var SelectItemText = /* @__PURE__ */ reactExports.forwardRef(
1819
1761
  itemContext.onItemTextChange,
1820
1762
  handleItemTextRefCallback
1821
1763
  );
1822
- const textContent = itemTextNode == null ? void 0 : itemTextNode.textContent;
1764
+ const textContent = itemTextNode?.textContent;
1823
1765
  const nativeOption = reactExports.useMemo(
1824
1766
  () => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
1825
1767
  [itemContext.disabled, itemContext.value, textContent]
@@ -1926,9 +1868,8 @@ var SelectScrollButtonImpl = /* @__PURE__ */ reactExports.forwardRef(/* @__PURE_
1926
1868
  return () => clearAutoScrollTimer();
1927
1869
  }, [clearAutoScrollTimer]);
1928
1870
  useLayoutEffect2(() => {
1929
- var _a;
1930
1871
  const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
1931
- (_a = activeItem == null ? void 0 : activeItem.ref.current) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
1872
+ activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
1932
1873
  }, [getItems]);
1933
1874
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1934
1875
  Primitive.div,
@@ -1943,8 +1884,7 @@ var SelectScrollButtonImpl = /* @__PURE__ */ reactExports.forwardRef(/* @__PURE_
1943
1884
  }
1944
1885
  }),
1945
1886
  onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {
1946
- var _a;
1947
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
1887
+ contentContext.onItemLeave?.();
1948
1888
  if (autoScrollTimerRef.current === null) {
1949
1889
  autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
1950
1890
  }
@@ -2335,14 +2275,13 @@ function useTableSelection({
2335
2275
  );
2336
2276
  }
2337
2277
  function getRunReplayDisabledReason(run, runIdentityLoading) {
2338
- var _a;
2339
2278
  if (runIdentityLoading) {
2340
2279
  return "Loading run identity...";
2341
2280
  }
2342
2281
  if (!run) {
2343
2282
  return "Unable to verify whether this run can be replayed.";
2344
2283
  }
2345
- if ((_a = run.executionContext) == null ? void 0 : _a.dynamicWorkflow) {
2284
+ if (run.executionContext?.dynamicWorkflow) {
2346
2285
  return "Dynamic runs cannot be replayed as a new run.";
2347
2286
  }
2348
2287
  return void 0;
@@ -2470,7 +2409,7 @@ var CheckboxTrigger = /* @__PURE__ */ reactExports.forwardRef(
2470
2409
  const composedRefs = useComposedRefs(forwardedRef, setControl);
2471
2410
  const initialCheckedStateRef = reactExports.useRef(checked);
2472
2411
  reactExports.useEffect(() => {
2473
- const form = control == null ? void 0 : control.form;
2412
+ const form = control?.form;
2474
2413
  if (form) {
2475
2414
  const reset = /* @__PURE__ */ __name(() => setChecked(initialCheckedStateRef.current), "reset");
2476
2415
  form.addEventListener("reset", reset);
@@ -2628,7 +2567,7 @@ var CheckboxBubbleInput = /* @__PURE__ */ reactExports.forwardRef(
2628
2567
  } else if (checkedChanged) {
2629
2568
  const pendingUserClick = pendingUserClickRef.current;
2630
2569
  pendingUserClickRef.current = null;
2631
- const isPendingUserChange = (pendingUserClick == null ? void 0 : pendingUserClick.requestedChecked) === checked;
2570
+ const isPendingUserChange = pendingUserClick?.requestedChecked === checked;
2632
2571
  shouldStopClickPropagationRef.current = true;
2633
2572
  input.indeterminate = isIndeterminate(checked);
2634
2573
  setChecked.call(input, isIndeterminate(checked) ? false : checked);
@@ -2708,7 +2647,7 @@ const Checkbox = reactExports.forwardRef(({ className, checked, indeterminate, o
2708
2647
  id: checkboxId,
2709
2648
  checked: checkedState,
2710
2649
  onCheckedChange: (state) => {
2711
- onCheckedChange == null ? void 0 : onCheckedChange(state === true);
2650
+ onCheckedChange?.(state === true);
2712
2651
  },
2713
2652
  className: cn(
2714
2653
  "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow",
@@ -2737,7 +2676,7 @@ function RunActionsDropdownContentInner({
2737
2676
  const [eventsLoading, setEventsLoading] = reactExports.useState(true);
2738
2677
  const [run, setRun] = reactExports.useState(void 0);
2739
2678
  const [runIdentityLoading, setRunIdentityLoading] = reactExports.useState(true);
2740
- const status = (run == null ? void 0 : run.status) || runStatus;
2679
+ const status = run?.status || runStatus;
2741
2680
  reactExports.useEffect(() => {
2742
2681
  setRun(void 0);
2743
2682
  setRunIdentityLoading(true);
@@ -2948,10 +2887,7 @@ function FilterControls({
2948
2887
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-[180px] h-9", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Filter by workflow" }) }),
2949
2888
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
2950
2889
  /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "all", children: "All Workflows" }),
2951
- Array.from(seenWorkflowNames).sort().map((name) => {
2952
- var _a;
2953
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: name, children: ((_a = parseWorkflowName(name)) == null ? void 0 : _a.shortName) || name }, name);
2954
- })
2890
+ Array.from(seenWorkflowNames).sort().map((name) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: name, children: parseWorkflowName(name)?.shortName || name }, name))
2955
2891
  ] })
2956
2892
  ]
2957
2893
  }
@@ -3016,7 +2952,6 @@ function FilterControls({
3016
2952
  ] });
3017
2953
  }
3018
2954
  function RunsTable({ onRunClick }) {
3019
- var _a, _b, _c;
3020
2955
  const [searchParams] = useSearchParams();
3021
2956
  const handleWorkflowFilter = useWorkflowFilter();
3022
2957
  const handleStatusFilter = useStatusFilter();
@@ -3036,12 +2971,12 @@ function RunsTable({ onRunClick }) {
3036
2971
  const [hasLoadedOnce, setHasLoadedOnce] = reactExports.useState(false);
3037
2972
  const env = reactExports.useMemo(() => ({}), []);
3038
2973
  const isLocal = serverConfig.backendId === "local" || serverConfig.backendId === "@workflow/world-local";
3039
- const localDataDirPath = (_a = serverConfig.displayInfo) == null ? void 0 : _a["local.dataDirPath"];
3040
- const localShortName = (_b = serverConfig.displayInfo) == null ? void 0 : _b["local.shortName"];
2974
+ const localDataDirPath = serverConfig.displayInfo?.["local.dataDirPath"];
2975
+ const localShortName = serverConfig.displayInfo?.["local.shortName"];
3041
2976
  const [seenWorkflowNames, setSeenWorkflowNames] = reactExports.useState(
3042
2977
  /* @__PURE__ */ new Set()
3043
2978
  );
3044
- const isVercelBackend = ((_c = serverConfig.backendId) == null ? void 0 : _c.includes("vercel")) ?? false;
2979
+ const isVercelBackend = serverConfig.backendId?.includes("vercel") ?? false;
3045
2980
  const [listingWindow, setListingWindow] = reactExports.useState(
3046
2981
  () => isVercelBackend ? getListingWindow(period, periodPreset.ms) : void 0
3047
2982
  );
@@ -3068,8 +3003,8 @@ function RunsTable({ onRunClick }) {
3068
3003
  sortOrder,
3069
3004
  workflowName: workflowNameFilter === "all" ? void 0 : workflowNameFilter,
3070
3005
  status: status === "all" ? void 0 : status,
3071
- startTime: listingWindow == null ? void 0 : listingWindow.startTime,
3072
- endTime: listingWindow == null ? void 0 : listingWindow.endTime
3006
+ startTime: listingWindow?.startTime,
3007
+ endTime: listingWindow?.endTime
3073
3008
  });
3074
3009
  const [planInfo, setPlanInfo] = reactExports.useState(void 0);
3075
3010
  reactExports.useEffect(() => {
@@ -3243,7 +3178,7 @@ function RunsTable({ onRunClick }) {
3243
3178
  period,
3244
3179
  showPeriodPicker: isVercelBackend,
3245
3180
  planWindowMs,
3246
- planUpgradeAvailable: (planInfo == null ? void 0 : planInfo.upgradeAvailable) ?? false,
3181
+ planUpgradeAvailable: planInfo?.upgradeAvailable ?? false,
3247
3182
  onWorkflowChange: handleWorkflowFilter,
3248
3183
  onStatusChange: handleStatusFilter,
3249
3184
  onPeriodChange: handlePeriodFilter,
@@ -3292,49 +3227,46 @@ function RunsTable({ onRunClick }) {
3292
3227
  "."
3293
3228
  ] }),
3294
3229
  isLocalAndHasMissingData && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm flex items-center gap-2", children: "This view will update once you run a workflow." })
3295
- ] }) }) }) : runs.map((run) => {
3296
- var _a2;
3297
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
3298
- TableRow,
3299
- {
3300
- className: "cursor-pointer group relative",
3301
- onClick: () => onRunClick(run.runId),
3302
- "data-selected": selection.isSelected(run),
3303
- children: [
3304
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3305
- Checkbox,
3306
- {
3307
- checked: selection.isSelected(run),
3308
- onCheckedChange: () => selection.toggleSelection(run),
3309
- "aria-label": `Select run ${run.runId}`
3310
- }
3311
- ) }),
3312
- /* @__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) || "?" }) }),
3313
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "font-mono text-xs py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.runId, overlay: true, children: run.runId }) }),
3314
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3315
- StatusBadge,
3316
- {
3317
- status: run.status,
3318
- context: run,
3319
- durationMs: run.startedAt ? (run.completedAt ? new Date(run.completedAt).getTime() : Date.now()) - new Date(run.startedAt).getTime() : void 0
3320
- }
3321
- ) }),
3322
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.startedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.startedAt }) : "-" }),
3323
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.completedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.completedAt }) : "-" }),
3324
- /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3325
- LazyDropdownMenu,
3326
- {
3327
- env,
3328
- runId: run.runId,
3329
- runStatus: run.status,
3330
- onSuccess: onReload
3331
- }
3332
- ) })
3333
- ]
3334
- },
3335
- run.runId
3336
- );
3337
- }),
3230
+ ] }) }) }) : runs.map((run) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
3231
+ TableRow,
3232
+ {
3233
+ className: "cursor-pointer group relative",
3234
+ onClick: () => onRunClick(run.runId),
3235
+ "data-selected": selection.isSelected(run),
3236
+ children: [
3237
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3238
+ Checkbox,
3239
+ {
3240
+ checked: selection.isSelected(run),
3241
+ onCheckedChange: () => selection.toggleSelection(run),
3242
+ "aria-label": `Select run ${run.runId}`
3243
+ }
3244
+ ) }),
3245
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.workflowName, overlay: true, children: parseWorkflowName(run.workflowName)?.shortName || "?" }) }),
3246
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "font-mono text-xs py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.runId, overlay: true, children: run.runId }) }),
3247
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3248
+ StatusBadge,
3249
+ {
3250
+ status: run.status,
3251
+ context: run,
3252
+ durationMs: run.startedAt ? (run.completedAt ? new Date(run.completedAt).getTime() : Date.now()) - new Date(run.startedAt).getTime() : void 0
3253
+ }
3254
+ ) }),
3255
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.startedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.startedAt }) : "-" }),
3256
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2 text-muted-foreground text-xs", children: run.completedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.completedAt }) : "-" }),
3257
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3258
+ LazyDropdownMenu,
3259
+ {
3260
+ env,
3261
+ runId: run.runId,
3262
+ runStatus: run.status,
3263
+ onSuccess: onReload
3264
+ }
3265
+ ) })
3266
+ ]
3267
+ },
3268
+ run.runId
3269
+ )),
3338
3270
  isLoadingMore && /* @__PURE__ */ jsxRuntimeExports.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { colSpan: 7, className: "py-3", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3339
3271
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, { size: "md" }),
3340
3272
  "Loading more runs…"
@@ -3355,7 +3287,7 @@ function RunsTable({ onRunClick }) {
3355
3287
  ] }) }),
3356
3288
  isVercelBackend && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
3357
3289
  periodPreset.label,
3358
- (planInfo == null ? void 0 : planInfo.upgradeAvailable) ? ` · plan window ${planInfo.currentLookbackDays} day${planInfo.currentLookbackDays === 1 ? "" : "s"}` : ""
3290
+ planInfo?.upgradeAvailable ? ` · plan window ${planInfo.currentLookbackDays} day${planInfo.currentLookbackDays === 1 ? "" : "s"}` : ""
3359
3291
  ] })
3360
3292
  ] }),
3361
3293
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -3621,14 +3553,14 @@ function calculateNodePositions(rawNodes, edges) {
3621
3553
  }
3622
3554
  function adaptManifest(raw) {
3623
3555
  const workflows = {};
3624
- console.log("[adaptManifest] Raw manifest version:", raw == null ? void 0 : raw.version);
3556
+ console.log("[adaptManifest] Raw manifest version:", raw?.version);
3625
3557
  console.log(
3626
3558
  "[adaptManifest] Raw workflows keys:",
3627
- Object.keys((raw == null ? void 0 : raw.workflows) || {})
3559
+ Object.keys(raw?.workflows || {})
3628
3560
  );
3629
- if (!(raw == null ? void 0 : raw.workflows)) {
3561
+ if (!raw?.workflows) {
3630
3562
  console.log("[adaptManifest] No workflows in manifest, returning empty");
3631
- return { version: (raw == null ? void 0 : raw.version) || "1.0.0", workflows: {} };
3563
+ return { version: raw?.version || "1.0.0", workflows: {} };
3632
3564
  }
3633
3565
  for (const [filePath, workflowsInFile] of Object.entries(raw.workflows)) {
3634
3566
  for (const [workflowName, entry] of Object.entries(workflowsInFile)) {
@@ -3683,7 +3615,7 @@ function useWorkflowGraphManifest() {
3683
3615
  );
3684
3616
  console.log(
3685
3617
  "[useWorkflowGraphManifest] Workflows in raw:",
3686
- Object.keys((rawManifest == null ? void 0 : rawManifest.workflows) || {})
3618
+ Object.keys(rawManifest?.workflows || {})
3687
3619
  );
3688
3620
  const adaptedManifest = adaptManifest(rawManifest);
3689
3621
  console.log(
@@ -3729,13 +3661,13 @@ function WorkflowsList({ onWorkflowSelect }) {
3729
3661
  [workflows]
3730
3662
  );
3731
3663
  const selectedWorkflowStepCount = reactExports.useMemo(
3732
- () => (selectedWorkflow == null ? void 0 : selectedWorkflow.nodes.filter((node) => node.data.nodeKind === "step").length) ?? 0,
3664
+ () => selectedWorkflow?.nodes.filter((node) => node.data.nodeKind === "step").length ?? 0,
3733
3665
  [selectedWorkflow]
3734
3666
  );
3735
3667
  const handleViewWorkflow = (workflow) => {
3736
3668
  setSelectedWorkflow(workflow);
3737
3669
  setSheetOpen(true);
3738
- onWorkflowSelect == null ? void 0 : onWorkflowSelect(workflow.workflowName);
3670
+ onWorkflowSelect?.(workflow.workflowName);
3739
3671
  };
3740
3672
  if (loading) {
3741
3673
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TableSkeleton, { variant: "workflows", rows: 6 });
@@ -3794,7 +3726,7 @@ function WorkflowsList({ onWorkflowSelect }) {
3794
3726
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SheetHeader, { children: [
3795
3727
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SheetTitle, { className: "flex items-center gap-2", children: [
3796
3728
  /* @__PURE__ */ jsxRuntimeExports.jsx(Workflow, { className: "h-5 w-5" }),
3797
- selectedWorkflow == null ? void 0 : selectedWorkflow.workflowName
3729
+ selectedWorkflow?.workflowName
3798
3730
  ] }),
3799
3731
  selectedWorkflow && /* @__PURE__ */ jsxRuntimeExports.jsx(SheetDescription, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
3800
3732
  /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "text-xs", children: selectedWorkflow.filePath }),