@workflow/web 5.3.2 → 5.4.0

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 (37) hide show
  1. package/build/client/assets/app-Czi_mceE.css +1 -0
  2. package/build/client/assets/arrow-up-right-74VYxbbA.js +9 -0
  3. package/build/client/assets/{entry.client-xzxVCL3o.js → entry.client-BqbaswKw.js} +13 -35
  4. package/build/client/assets/{highlighted-body-JLMTFACH-1yzOVKg0.js → highlighted-body-JLMTFACH-D51eQJbG.js} +2 -2
  5. package/build/client/assets/{home--wf0CrF6.js → home-DLo3pUJ2.js} +104 -167
  6. package/build/client/assets/{index-wl5l5E8H.js → index-BUQuaV5X.js} +78 -149
  7. package/build/client/assets/{manifest-7b81d8d4.js → manifest-67b853ed.js} +1 -1
  8. package/build/client/assets/mermaid-WFAXDIZX-Bd_l_owX.css +1 -0
  9. package/build/client/assets/{mermaid-WFAXDIZX-CB__BxYb.js → mermaid-WFAXDIZX-CCgeQ0jh.js} +2044 -2169
  10. package/build/client/assets/{root-C1XwTNUK.js → root-D8difEo9.js} +8 -33
  11. package/build/client/assets/root-d42YLYYg.css +1 -0
  12. package/build/client/assets/{rpc-client-SbyXJdFV.js → rpc-client-DL_nSX36.js} +3 -4
  13. package/build/client/assets/{run-detail-2CnpdXm1.js → run-detail-DcpR_rST.js} +234 -445
  14. package/build/client/assets/run-detail-DmVxTs86.css +1 -0
  15. package/build/client/assets/{run-usage-C3aywyqa.js → run-usage-0JrO5fG2.js} +5 -5
  16. package/build/client/assets/{run-usage-DRV6lopZ.js → run-usage-CK_ia-7k.js} +36 -53
  17. package/build/client/assets/{skeleton-DMLgjvZZ.js → skeleton-B2Cf2UXN.js} +3 -21
  18. package/build/client/assets/{url-state-JAVaNZ_m.js → url-state-n9DuWtVx.js} +521 -779
  19. package/build/client/assets/{zstd-browser-decoder-Z5736ep5.js → zstd-browser-decoder-CqZHDp17.js} +2 -2
  20. package/build/server/assets/{app-C4Vf0mu1.js → app-DLSid73Q.js} +13263 -14020
  21. package/build/server/assets/{esm-CETb4fkq.js → esm-BzrGWk7J.js} +2 -2
  22. package/build/server/assets/{highlighted-body-JLMTFACH-CF_5tt3-.js → highlighted-body-JLMTFACH-CtQ_zvjG.js} +1 -1
  23. package/build/server/assets/{index-BrYeW--s.js → index-BI8sdTIq.js} +398 -490
  24. package/build/server/assets/{mermaid-WFAXDIZX-BHZz_uL6.js → mermaid-WFAXDIZX-BlWV_MqD.js} +1 -1
  25. package/build/server/assets/{token-k0na1G9v.js → token-BE7-D9Dt.js} +6 -6
  26. package/build/server/assets/{token-B94O3LuJ.js → token-DOXFZxpM.js} +5 -5
  27. package/build/server/assets/{token-util-DFlzY9Hw.js → token-util-DjnKfD7P.js} +2 -2
  28. package/build/server/assets/{token-util-DgTmPzWb.js → token-util-V29s95lj.js} +1 -1
  29. package/build/server/assets/{wrapper-BEqyNEir.js → wrapper-DBwRVVUb.js} +2 -2
  30. package/build/server/assets/{zstd-browser-decoder-LnaKiDUZ.js → zstd-browser-decoder-Crq3t_fM.js} +1 -1
  31. package/build/server/index.js +1 -1
  32. package/package.json +8 -8
  33. package/build/client/assets/app-BHCSMHev.css +0 -1
  34. package/build/client/assets/arrow-up-right-DyaB_ak4.js +0 -15
  35. package/build/client/assets/mermaid-WFAXDIZX-D8CjRQta.css +0 -1
  36. package/build/client/assets/root-C3ED6Dwc.css +0 -1
  37. package/build/client/assets/run-detail-CWoGxu_0.css +0 -1
@@ -1,102 +1,38 @@
1
- import { j as jsxRuntimeExports, r as reactExports, L as Link, B as useNavigate, E as useOutlet, w as withComponentProps, G as useParams, C as useSearchParams } from "./index-wl5l5E8H.js";
2
- import { U as findStartHookCreation, q as ChevronUp, X, x as CircleX, V as Wrench, Y as ErrorCard, _ as format, R as ResolveHookModal, Q as ErrorBoundary, u as unwrapOrThrow, W as WorkflowWebAPIError, K as unwrapServerActionResult, $ as useInfiniteList, e as getErrorMessage, A as Alert, b as AlertTitle, d as AlertDescription, I as DialogPortal, J as DialogOverlay, a0 as createDialogScope, z as Dialog, a1 as DialogTrigger, B as DialogContent, G as DialogTitle, H as DialogDescription, F as DialogClose, a2 as LIVE_UPDATE_INTERVAL_MS$1, a3 as LAYOUT, a4 as tabsListClassName, a5 as tabsTriggerClassName, M as useOptimisticSearchParams, a6 as wakeUpRun, r as resumeHook, c as getErrorTitle, a7 as RunActionsButtons, w as StatusBadge, C as CopyableText, a as RelativeTime, T as Tabs, N as TabsList, O as TabsTrigger, P as TabsContent, a8 as cancelRun, a9 as recreateRun } from "./url-state-JAVaNZ_m.js";
3
- import { c as createLucideIcon, Q as isSlotEventId, U as classifyEntityEvent, X as TERMINAL_EVENT_CLASSES, Y as isSealedNoopEvent$1, j as formatDurationPrecise, Z as isStepEventType, $ as isWaitEventType, a0 as isHookLifecycleEventType, a1 as isEncryptedMarker, a2 as isTerminalStepEventType, a3 as isRunCreationEvent, a as cn, a4 as CopyButton, a5 as CopyableDataBlock, a6 as CollapsibleRoot, a7 as CollapsibleTrigger, a8 as CollapsibleContent, O as cva, a9 as RESERVED_ATTRIBUTE_KEY_PREFIX, T as Tooltip, d as TooltipTrigger, aa as IconButton, e as TooltipContent, L as ChevronDown, B as Button, ab as Lock, ac as getEventDataRefFields, ad as Collapsible, ae as Skeleton, af as DecryptClickContext, ag as DataInspector, ah as serializeForClipboard, ai as TooltipProvider, aj as TimestampTooltip, ak as ContextCardProvider, al as es, am as Ui, n as Check, an as RunClickContext, ao as StreamClickContext, ap as isExpiredMarker, aq as isDoStreamStep, ar as extractConversation, as as EncryptedDataBlock, S as Spinner, at as hasEncryptedFields, m as useToast, au as useSidebarDataOptional, av as isTerminalWorkflowRunStatus, aw as useActiveSpan, ax as useSidebarData, ay as ActiveSpanProvider, az as useReducedMotion, aA as searchSpans, aB as computeRootBounds, aC as computeTimeMarkers, aD as clampViewportToRoot, aE as getHighResInMs, aF as scrollRowIntoView, aG as TIMELINE_PADDING_PX, b as ROW_HEIGHT_PX, aH as Minimap, aI as Timeline, aJ as TimelineHeader, aK as wheelZoomScaleFactor, aL as wheelDeltaToPixels, aM as SidebarDataProvider, aN as hydrateResourceIOAsync, aO as createStateResolver, aP as deriveRunPayloadKeys, aQ as decodePayloadWithKey, aR as stateSourceId, aS as getWebRevivers, aT as hydrateResourceIO, y as createContextScope, p as useComposedRefs, A as composeEventHandlers, aU as buttonVariants, aV as Slot, C as ChevronRight, aW as isEncryptedData, aX as hydrateData, aY as decrypt, aZ as getStreamImageType, a_ as SerializationFormat, t as toast, a$ as StreamViewerSkeleton, b0 as StreamViewer } from "./mermaid-WFAXDIZX-CB__BxYb.js";
4
- import { p as parseStepName, a as parseWorkflowName, b as CircleAlert, S as Skeleton$1 } from "./skeleton-DMLgjvZZ.js";
5
- import { M as MiddleTruncate, a as ResourceIcon, E as EventList, r as runUsagePath, b as runPath, c as RunUsageHeaderStats, C as CircleQuestionMark, u as usageVisible } from "./run-usage-DRV6lopZ.js";
6
- import { A as ArrowUpRight } from "./arrow-up-right-DyaB_ak4.js";
7
- import { d as fetchHook, a as fetchEvents, b as fetchRun, e as fetchStep, g as fetchStreams, h as apiBase, i as fetchEvent, j as fetchEventsByCorrelationId, k as fetchRunUsage, u as useServerConfig, l as getEncryptionKeyForRun } from "./rpc-client-SbyXJdFV.js";
8
- /**
9
- * @license lucide-react v0.575.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */
14
- const __iconNode$9 = [
15
- ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
16
- ["path", { d: "M18 17V9", key: "2bz60n" }],
17
- ["path", { d: "M13 17V5", key: "1frdt8" }],
18
- ["path", { d: "M8 17v-3", key: "17ska0" }]
19
- ];
20
- const ChartColumn = createLucideIcon("chart-column", __iconNode$9);
21
- /**
22
- * @license lucide-react v0.575.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */
27
- const __iconNode$8 = [
1
+ import { j as jsxRuntimeExports, r as reactExports, L as Link, B as useNavigate, E as useOutlet, w as withComponentProps, G as useParams, C as useSearchParams } from "./index-BUQuaV5X.js";
2
+ import { P as findStartHookCreation, o as ChevronUp, X, v as CircleX, Q as Wrench, U as ErrorCard, V as format, R as ResolveHookModal, O as ErrorBoundary, u as unwrapOrThrow, W as WorkflowWebAPIError, I as unwrapServerActionResult, Y as useInfiniteList, d as getErrorMessage, A as Alert, b as AlertTitle, c as AlertDescription, G as DialogPortal, H as DialogOverlay, _ as createDialogScope, x as Dialog, $ as DialogTrigger, y as DialogContent, B as DialogTitle, F as DialogDescription, z as DialogClose, a0 as LAYOUT, a1 as tabsListClassName, a2 as tabsTriggerClassName, K as useOptimisticSearchParams, a3 as wakeUpRun, r as resumeHook, g as getErrorTitle, a4 as RunActionsButtons, t as StatusBadge, C as CopyableText, a as RelativeTime, T as Tabs, L as TabsList, M as TabsTrigger, N as TabsContent, a5 as cancelRun, a6 as recreateRun } from "./url-state-n9DuWtVx.js";
3
+ import { c as createLucideIcon, Y as isSlotEventId, Z as classifyEntityEvent, $ as TERMINAL_EVENT_CLASSES, a0 as isSealedNoopEvent$1, l as formatDurationPrecise, a1 as isStepEventType, a2 as isWaitEventType, a3 as isHookLifecycleEventType, a4 as isEncryptedMarker, a5 as isTerminalStepEventType, a6 as isRunCreationEvent, a as cn, a7 as CopyButton, a8 as CopyableDataBlock, a9 as CollapsibleRoot, aa as CollapsibleTrigger, ab as CollapsibleContent, X as cva, ac as RESERVED_ATTRIBUTE_KEY_PREFIX, T as Tooltip, e as TooltipTrigger, ad as IconButton, f as TooltipContent, N as ChevronDown, B as Button, ae as Lock, af as getEventDataRefFields, ag as Collapsible, ah as Skeleton, U as STATUS_DOT, ai as DecryptClickContext, aj as DataInspector, ak as serializeForClipboard, al as TooltipProvider, am as TimestampTooltip, an as ContextCardProvider, ao as es, ap as Ui, p as Check, aq as RunClickContext, ar as StreamClickContext, as as isExpiredMarker, at as isDoStreamStep, au as extractConversation, av as EncryptedDataBlock, S as Spinner, aw as hasEncryptedFields, o as useToast, ax as useSidebarDataOptional, ay as isTerminalWorkflowRunStatus, az as useActiveSpan, aA as useSidebarData, aB as ActiveSpanProvider, aC as useReducedMotion, aD as searchSpans, aE as computeRootBounds, aF as computeTimeMarkers, aG as clampViewportToRoot, aH as getHighResInMs, aI as scrollRowIntoView, aJ as TIMELINE_PADDING_PX, b as ROW_HEIGHT_PX, aK as Minimap, aL as Timeline, aM as TimelineHeader, aN as wheelZoomScaleFactor, aO as wheelDeltaToPixels, aP as SidebarDataProvider, aQ as hydrateResourceIOAsync, aR as createStateResolver, aS as deriveRunPayloadKeys, aT as decodePayloadWithKey, aU as stateSourceId, aV as getWebRevivers, aW as hydrateResourceIO, A as createContextScope, s as useComposedRefs, E as composeEventHandlers, aX as buttonVariants, aY as Slot, C as ChevronRight, aZ as isEncryptedData, a_ as hydrateData, a$ as decrypt, b0 as getStreamImageType, b1 as SerializationFormat, t as toast, b2 as StreamViewerSkeleton, b3 as StreamViewer } from "./mermaid-WFAXDIZX-CCgeQ0jh.js";
4
+ import { p as parseStepName, a as parseWorkflowName, b as CircleAlert, S as Skeleton$1 } from "./skeleton-B2Cf2UXN.js";
5
+ import { M as MiddleTruncate, a as ResourceIcon, E as EventList, r as runUsagePath, b as runPath, c as RunUsageHeaderStats, C as CircleQuestionMark, u as usageVisible } from "./run-usage-CK_ia-7k.js";
6
+ import { A as ArrowUpRight } from "./arrow-up-right-74VYxbbA.js";
7
+ import { d as fetchHook, a as fetchEvents, b as fetchRun, e as fetchStep, g as fetchStreams, h as apiBase, i as fetchEvent, j as fetchEventsByCorrelationId, k as fetchRunUsage, u as useServerConfig, l as getEncryptionKeyForRun } from "./rpc-client-DL_nSX36.js";
8
+ const __iconNode$7 = [
28
9
  ["path", { d: "M10 6h8", key: "zvc2xc" }],
29
10
  ["path", { d: "M12 16h6", key: "yi5mkt" }],
30
11
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
31
12
  ["path", { d: "M8 11h7", key: "wz2hg0" }]
32
13
  ];
33
- const ChartGantt = createLucideIcon("chart-gantt", __iconNode$8);
34
- /**
35
- * @license lucide-react v0.575.0 - ISC
36
- *
37
- * This source code is licensed under the ISC license.
38
- * See the LICENSE file in the root directory of this source tree.
39
- */
40
- const __iconNode$7 = [
14
+ const ChartGantt = createLucideIcon("chart-gantt", __iconNode$7);
15
+ const __iconNode$6 = [
41
16
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
42
17
  ["path", { d: "M12 16v-4", key: "1dtifu" }],
43
18
  ["path", { d: "M12 8h.01", key: "e9boi3" }]
44
19
  ];
45
- const Info = createLucideIcon("info", __iconNode$7);
46
- /**
47
- * @license lucide-react v0.575.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */
52
- const __iconNode$6 = [
53
- ["path", { d: "M3 5h.01", key: "18ugdj" }],
54
- ["path", { d: "M3 12h.01", key: "nlz23k" }],
55
- ["path", { d: "M3 19h.01", key: "noohij" }],
56
- ["path", { d: "M8 5h13", key: "1pao27" }],
57
- ["path", { d: "M8 12h13", key: "1za7za" }],
58
- ["path", { d: "M8 19h13", key: "m83p4d" }]
59
- ];
60
- const List = createLucideIcon("list", __iconNode$6);
61
- /**
62
- * @license lucide-react v0.575.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */
20
+ const Info = createLucideIcon("info", __iconNode$6);
67
21
  const __iconNode$5 = [
68
22
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
69
23
  ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1", key: "1mm8w8" }]
70
24
  ];
71
25
  const LockOpen = createLucideIcon("lock-open", __iconNode$5);
72
- /**
73
- * @license lucide-react v0.575.0 - ISC
74
- *
75
- * This source code is licensed under the ISC license.
76
- * See the LICENSE file in the root directory of this source tree.
77
- */
78
26
  const __iconNode$4 = [
79
27
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
80
28
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
81
29
  ];
82
30
  const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$4);
83
- /**
84
- * @license lucide-react v0.575.0 - ISC
85
- *
86
- * This source code is licensed under the ISC license.
87
- * See the LICENSE file in the root directory of this source tree.
88
- */
89
31
  const __iconNode$3 = [
90
32
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
91
33
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
92
34
  ];
93
35
  const Search = createLucideIcon("search", __iconNode$3);
94
- /**
95
- * @license lucide-react v0.575.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */
100
36
  const __iconNode$2 = [
101
37
  [
102
38
  "path",
@@ -109,12 +45,6 @@ const __iconNode$2 = [
109
45
  ["path", { d: "M12 17h.01", key: "p32p05" }]
110
46
  ];
111
47
  const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$2);
112
- /**
113
- * @license lucide-react v0.575.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */
118
48
  const __iconNode$1 = [
119
49
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
120
50
  ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
@@ -122,12 +52,6 @@ const __iconNode$1 = [
122
52
  ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
123
53
  ];
124
54
  const ZoomIn = createLucideIcon("zoom-in", __iconNode$1);
125
- /**
126
- * @license lucide-react v0.575.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */
131
55
  const __iconNode = [
132
56
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
133
57
  ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
@@ -226,7 +150,7 @@ function formatClock(value) {
226
150
  const date = parseEventDate(value);
227
151
  return date ? formatTimestampParts(date).clock : null;
228
152
  }
229
- function formatSinceStart(ms) {
153
+ function formatElapsed(ms) {
230
154
  return ms <= 0 ? "0ms" : `+${formatDurationPrecise(ms)}`;
231
155
  }
232
156
  function sortEventsByTime(events, order) {
@@ -278,14 +202,13 @@ function getEventResource(event, entity) {
278
202
  return entity.kind === "wait" ? "sleep" : entity.kind;
279
203
  }
280
204
  function buildNameMaps(events, run) {
281
- var _a, _b, _c;
282
205
  const correlationNameMap = /* @__PURE__ */ new Map();
283
206
  const hookNameMap = /* @__PURE__ */ new Map();
284
207
  for (const event of events ?? []) {
285
208
  if (!event.correlationId)
286
209
  continue;
287
210
  if (event.eventType === "hook_created") {
288
- const token = (_a = event.eventData) == null ? void 0 : _a.token;
211
+ const token = event.eventData?.token;
289
212
  if (typeof token === "string")
290
213
  hookNameMap.set(event.correlationId, token);
291
214
  continue;
@@ -293,16 +216,16 @@ function buildNameMaps(events, run) {
293
216
  if (event.eventType !== "step_created" && event.eventType !== "step_started") {
294
217
  continue;
295
218
  }
296
- const stepName = (_b = event.eventData) == null ? void 0 : _b.stepName;
219
+ const stepName = event.eventData?.stepName;
297
220
  if (typeof stepName !== "string")
298
221
  continue;
299
222
  if (event.eventType === "step_started" && correlationNameMap.has(event.correlationId)) {
300
223
  continue;
301
224
  }
302
225
  const parsed = parseStepName(stepName) ?? parseWorkflowName(stepName);
303
- correlationNameMap.set(event.correlationId, (parsed == null ? void 0 : parsed.shortName) ?? stepName);
226
+ correlationNameMap.set(event.correlationId, parsed?.shortName ?? stepName);
304
227
  }
305
- const workflowName = (run == null ? void 0 : run.workflowName) ? ((_c = parseWorkflowName(run.workflowName)) == null ? void 0 : _c.shortName) ?? run.workflowName : null;
228
+ const workflowName = run?.workflowName ? parseWorkflowName(run.workflowName)?.shortName ?? run.workflowName : null;
306
229
  return { correlationNameMap, hookNameMap, workflowName };
307
230
  }
308
231
  function getEventName(entity, names) {
@@ -339,7 +262,7 @@ function buildEventTiming(events, duplicateEventIds = /* @__PURE__ */ new Set())
339
262
  switch (type) {
340
263
  case "step_created":
341
264
  case "run_created":
342
- clock.createdAt ?? (clock.createdAt = ts);
265
+ clock.createdAt ??= ts;
343
266
  break;
344
267
  case "step_started":
345
268
  if (clock.attempt === 0 && clock.createdAt !== void 0) {
@@ -443,28 +366,14 @@ function getEventMessage(event, queuedMs) {
443
366
  return "";
444
367
  }
445
368
  }
446
- function getRunStartMs(events, run) {
447
- const created = parseEventDate(run == null ? void 0 : run.createdAt);
448
- if (created)
449
- return created.getTime();
450
- let min;
451
- for (const event of events) {
452
- const t = getEffectiveEventTime(event);
453
- if (min === void 0 || t < min)
454
- min = t;
455
- }
456
- return min;
457
- }
458
369
  function buildEventLookups(events, run, duplicateEventIds) {
459
370
  return {
460
371
  names: buildNameMaps(events, run),
461
372
  timing: buildEventTiming(events, duplicateEventIds),
462
- runStartMs: getRunStartMs(events, run),
463
373
  duplicateEventIds
464
374
  };
465
375
  }
466
376
  function buildEventRow(event, lookups) {
467
- var _a;
468
377
  const entity = getEventEntity(event);
469
378
  const segments = entity.key === null ? [] : lookups.timing.stepSegments.get(entity.key) ?? [];
470
379
  const ignored = lookups.duplicateEventIds.has(event.eventId) ? {
@@ -480,11 +389,10 @@ function buildEventRow(event, lookups) {
480
389
  level: ignored ? "muted" : getEventLevel(event),
481
390
  resource: getEventResource(event, entity),
482
391
  name: getEventName(entity, lookups.names),
483
- message: (ignored == null ? void 0 : ignored.message) ?? getEventMessage(event, (_a = segments.find((segment) => segment.kind === "queued")) == null ? void 0 : _a.ms),
484
- notice: ignored == null ? void 0 : ignored.notice,
392
+ message: ignored?.message ?? getEventMessage(event, segments.find((segment) => segment.kind === "queued")?.ms),
393
+ notice: ignored?.notice,
485
394
  segments,
486
- durationMs: lookups.timing.eventDurations.get(event.eventId),
487
- sinceStartMs: lookups.runStartMs === void 0 ? void 0 : getEffectiveEventTime(event) - lookups.runStartMs
395
+ durationMs: lookups.timing.eventDurations.get(event.eventId)
488
396
  };
489
397
  }
490
398
  const IDLE_GAP_MS = 3e4;
@@ -499,6 +407,8 @@ function describeGap(later, hookNameMap) {
499
407
  }
500
408
  function buildListItems(rows, options) {
501
409
  const items = [];
410
+ const isNewestFirst = rows.length > 1 && getEffectiveEventTime(rows[0].event) > getEffectiveEventTime(rows[rows.length - 1].event);
411
+ const previousOffset = isNewestFirst ? 1 : -1;
502
412
  rows.forEach((row, index) => {
503
413
  if (options.showGaps && index > 0) {
504
414
  const prev = rows[index - 1].event;
@@ -516,7 +426,13 @@ function buildListItems(rows, options) {
516
426
  });
517
427
  }
518
428
  }
519
- items.push({ kind: "event", row, index });
429
+ const previous = rows[index + previousOffset];
430
+ items.push({
431
+ kind: "event",
432
+ row,
433
+ index,
434
+ sincePreviousMs: previous ? getEffectiveEventTime(row.event) - getEffectiveEventTime(previous.event) : void 0
435
+ });
520
436
  });
521
437
  return items;
522
438
  }
@@ -565,12 +481,6 @@ function getFooterLabel(search, counts) {
565
481
  return `${countEvents(total)}${hasMoreEvents ? " loaded" : ""}`;
566
482
  }
567
483
  }
568
- function shouldShowVerticalLine(eventType) {
569
- if (isHookLifecycleEventType(eventType)) {
570
- return true;
571
- }
572
- return false;
573
- }
574
484
  function dateToOtelTime(date) {
575
485
  if (typeof date === "string") {
576
486
  date = new Date(date);
@@ -621,7 +531,7 @@ const MARKER_EVENT_TYPES = /* @__PURE__ */ new Set([
621
531
  "attr_set"
622
532
  ]);
623
533
  const getEventTimestamp = (event) => {
624
- const value = (event == null ? void 0 : event.occurredAt) ?? (event == null ? void 0 : event.createdAt);
534
+ const value = event?.occurredAt ?? event?.createdAt;
625
535
  if (!value)
626
536
  return void 0;
627
537
  const date = value instanceof Date ? value : new Date(value);
@@ -637,11 +547,10 @@ function convertEventsToSpanEvents(events, filterTypes = true, options = {}) {
637
547
  eventData: "eventData" in event ? event.eventData : void 0
638
548
  },
639
549
  // Control whether to show vertical line in timeline
640
- showVerticalLine: shouldShowVerticalLine(event.eventType)
550
+ showVerticalLine: isHookLifecycleEventType(event.eventType)
641
551
  }));
642
552
  }
643
553
  const waitEventsToWaitEntity = (events) => {
644
- var _a;
645
554
  const startEvent = events.find((event) => event.eventType === "wait_created");
646
555
  if (!startEvent) {
647
556
  return null;
@@ -651,7 +560,7 @@ const waitEventsToWaitEntity = (events) => {
651
560
  waitId: startEvent.correlationId,
652
561
  runId: startEvent.runId,
653
562
  createdAt: getEventTimestamp(startEvent) ?? startEvent.createdAt,
654
- resumeAt: ((_a = startEvent.eventData) == null ? void 0 : _a.resumeAt) ? new Date(startEvent.eventData.resumeAt) : void 0,
563
+ resumeAt: startEvent.eventData?.resumeAt ? new Date(startEvent.eventData.resumeAt) : void 0,
655
564
  completedAt: getEventTimestamp(completedEvent)
656
565
  };
657
566
  };
@@ -693,7 +602,6 @@ function waitToSpan(events, maxEndTime, fallbackEndTime = maxEndTime) {
693
602
  };
694
603
  }
695
604
  const stepEventsToStepEntity = (events) => {
696
- var _a, _b;
697
605
  const createdEvent = events.find((event) => event.eventType === "step_created");
698
606
  const anchorEvent = createdEvent ?? events[0];
699
607
  const firstStartedEvent = events.find((event) => event.eventType === "step_started");
@@ -733,11 +641,11 @@ const stepEventsToStepEntity = (events) => {
733
641
  return {
734
642
  stepId: anchorEvent.correlationId ?? "",
735
643
  runId: anchorEvent.runId,
736
- stepName: ((_a = createdEvent == null ? void 0 : createdEvent.eventData) == null ? void 0 : _a.stepName) ?? ((_b = firstStartedEvent == null ? void 0 : firstStartedEvent.eventData) == null ? void 0 : _b.stepName) ?? "",
644
+ stepName: createdEvent?.eventData?.stepName ?? firstStartedEvent?.eventData?.stepName ?? "",
737
645
  status,
738
646
  attempt,
739
647
  createdAt: getEventTimestamp(anchorEvent) ?? anchorEvent.createdAt,
740
- updatedAt: getEventTimestamp(lastEvent) ?? (lastEvent == null ? void 0 : lastEvent.createdAt) ?? anchorEvent.createdAt,
648
+ updatedAt: getEventTimestamp(lastEvent) ?? lastEvent?.createdAt ?? anchorEvent.createdAt,
741
649
  startedAt,
742
650
  completedAt,
743
651
  specVersion: anchorEvent.specVersion
@@ -752,7 +660,7 @@ function stepToSpan(stepEvents, maxEndTime, getStepAttributes) {
752
660
  const attributes = {
753
661
  resource: "step",
754
662
  data: {
755
- ...getStepAttributes == null ? void 0 : getStepAttributes(stepEvents),
663
+ ...getStepAttributes?.(stepEvents),
756
664
  // Canonical event-derived fields cannot be overridden by extensions.
757
665
  ...step
758
666
  }
@@ -775,7 +683,7 @@ function stepToSpan(stepEvents, maxEndTime, getStepAttributes) {
775
683
  }
776
684
  return {
777
685
  spanId: String(step.stepId),
778
- name: (parsedName == null ? void 0 : parsedName.shortName) ?? String(step.stepName),
686
+ name: parsedName?.shortName ?? String(step.stepName),
779
687
  kind: 1,
780
688
  // INTERNAL span kind
781
689
  resource,
@@ -793,12 +701,11 @@ function stepToSpan(stepEvents, maxEndTime, getStepAttributes) {
793
701
  };
794
702
  }
795
703
  const hookEventsToHookEntity = (events, startHook) => {
796
- var _a;
797
704
  const createdEvent = events.find((event) => event.eventType === "hook_created");
798
705
  const creation = createdEvent ? {
799
706
  hookId: createdEvent.correlationId,
800
707
  runId: createdEvent.runId,
801
- token: (_a = createdEvent.eventData) == null ? void 0 : _a.token,
708
+ token: createdEvent.eventData?.token,
802
709
  createdAt: getEventTimestamp(createdEvent) ?? createdEvent.createdAt
803
710
  } : startHook && events.every((event) => event.correlationId === startHook.hookId) ? startHook : void 0;
804
711
  if (!creation) {
@@ -845,7 +752,6 @@ function hookToSpan(hookEvents, maxEndTime, startHook) {
845
752
  };
846
753
  }
847
754
  function runToSpan(run, runEvents, nowTime) {
848
- var _a, _b;
849
755
  const now = nowTime ?? /* @__PURE__ */ new Date();
850
756
  const runCreatedEvent = runEvents.find(isRunCreationEvent);
851
757
  const runStartedEvent = runEvents.find((event) => event.eventType === "run_started");
@@ -854,8 +760,8 @@ function runToSpan(run, runEvents, nowTime) {
854
760
  const activeStartTime = getEventTimestamp(runStartedEvent) ?? (run.startedAt ? new Date(run.startedAt) : void 0);
855
761
  const completedAt = getEventTimestamp(terminalEvent) ?? run.completedAt ?? void 0;
856
762
  const endTime = completedAt ?? now;
857
- const wasCancelled = run.status === "cancelled" || (terminalEvent == null ? void 0 : terminalEvent.eventType) === "run_cancelled";
858
- const cancelReason = (terminalEvent == null ? void 0 : terminalEvent.eventType) === "run_cancelled" && typeof ((_a = terminalEvent.eventData) == null ? void 0 : _a.cancelReason) === "string" ? terminalEvent.eventData.cancelReason : null;
763
+ const wasCancelled = run.status === "cancelled" || terminalEvent?.eventType === "run_cancelled";
764
+ const cancelReason = terminalEvent?.eventType === "run_cancelled" && typeof terminalEvent.eventData?.cancelReason === "string" ? terminalEvent.eventData.cancelReason : null;
859
765
  const { input: _i, output: _o, error: _e, ...runIdentity } = run;
860
766
  const attributes = {
861
767
  resource: "run",
@@ -872,7 +778,7 @@ function runToSpan(run, runEvents, nowTime) {
872
778
  });
873
779
  return {
874
780
  spanId: String(run.runId),
875
- name: String(((_b = parseWorkflowName(run.workflowName)) == null ? void 0 : _b.shortName) ?? "?"),
781
+ name: String(parseWorkflowName(run.workflowName)?.shortName ?? "?"),
876
782
  kind: 1,
877
783
  // INTERNAL span kind
878
784
  resource: "run",
@@ -954,7 +860,7 @@ function buildSpans(run, groupedEvents, now, latestKnownTime, startHook, getStep
954
860
  if (startHook && !hookEventGroups.has(startHook.hookId)) {
955
861
  hookEventGroups.set(startHook.hookId, []);
956
862
  }
957
- const hookSpans = Array.from(hookEventGroups).map(([hookId, events]) => hookToSpan(events, childMaxEnd, hookId === (startHook == null ? void 0 : startHook.hookId) ? startHook : void 0)).filter((span) => span !== null);
863
+ const hookSpans = Array.from(hookEventGroups).map(([hookId, events]) => hookToSpan(events, childMaxEnd, hookId === startHook?.hookId ? startHook : void 0)).filter((span) => span !== null);
958
864
  const waitSpans = Array.from(groupedEvents.timerEvents.values()).map((events) => waitToSpan(events, childMaxEnd, runMaxEnd)).filter((span) => span !== null);
959
865
  return {
960
866
  runSpan: runToSpan(run, groupedEvents.runLevelEvents, now),
@@ -1008,22 +914,22 @@ function buildTrace(run, events, now, { isCompleteHistory = false, getStepAttrib
1008
914
  function isReservedAttributeKey(key) {
1009
915
  return key.startsWith(RESERVED_ATTRIBUTE_KEY_PREFIX);
1010
916
  }
1011
- const rowValueVariants = cva("min-w-0 flex-1 truncate text-right text-copy-13 text-gray-1000", {
917
+ const rowValueVariants = cva("min-w-0 flex-1 truncate text-right text-gray-1000", {
1012
918
  variants: {
1013
919
  variant: {
1014
- default: "",
1015
- mono: "font-mono"
920
+ default: "text-copy-13",
921
+ mono: "text-copy-13-mono"
1016
922
  }
1017
923
  },
1018
924
  defaultVariants: {
1019
925
  variant: "default"
1020
926
  }
1021
927
  });
1022
- const rowCopyValueVariants = cva("flex min-w-0 flex-1 items-center justify-end gap-1 overflow-hidden text-copy-13 text-gray-1000", {
928
+ const rowCopyValueVariants = cva("flex min-w-0 flex-1 items-center justify-end gap-1 overflow-hidden text-gray-1000", {
1023
929
  variants: {
1024
930
  variant: {
1025
- default: "",
1026
- mono: "font-mono"
931
+ default: "text-copy-13",
932
+ mono: "text-copy-13-mono"
1027
933
  }
1028
934
  },
1029
935
  defaultVariants: {
@@ -1031,8 +937,7 @@ const rowCopyValueVariants = cva("flex min-w-0 flex-1 items-center justify-end g
1031
937
  }
1032
938
  });
1033
939
  function DetailKeyValueRowBase({ label, value, copyText, href, removed = false, variant }) {
1034
- const stringValue = typeof value === "string" ? value : void 0;
1035
- return jsxRuntimeExports.jsxs("div", { className: "px-1.5 hover:bg-gray-100 flex justify-between gap-3 -mx-1.5 py-0.5 rounded items-center", children: [jsxRuntimeExports.jsx("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-label-13 text-gray-900", children: label }), removed ? jsxRuntimeExports.jsx("span", { className: "shrink-0 text-copy-13 italic text-gray-700", children: "removed" }) : copyText ? jsxRuntimeExports.jsxs("div", { className: cn(rowCopyValueVariants({ variant })), title: copyText, children: [href ? jsxRuntimeExports.jsxs("a", { href, target: "_blank", rel: "noreferrer", className: cn(rowValueVariants({ variant }), "flex min-w-0 items-center gap-0.5 hover:underline"), children: [jsxRuntimeExports.jsx(MiddleTruncate, { value: copyText, className: "min-w-0 grid-cols-[minmax(0,1fr)] text-right" }), jsxRuntimeExports.jsx(ArrowUpRight, { "aria-hidden": true, className: "h-3 w-3 shrink-0" })] }) : jsxRuntimeExports.jsx(MiddleTruncate, { value: copyText, className: cn(rowValueVariants({ variant, className: "text-right" }), "grid-cols-[minmax(0,1fr)]") }), jsxRuntimeExports.jsx(CopyButton, { textToCopy: copyText, "aria-label": `Copy ${label}`, size: "small", className: "-my-0.5 -mr-1" })] }) : jsxRuntimeExports.jsx("span", { className: cn(rowValueVariants({ variant })), title: stringValue, children: href ? jsxRuntimeExports.jsx("a", { href, target: "_blank", rel: "noreferrer", className: "hover:underline", children: value }) : value })] });
940
+ return jsxRuntimeExports.jsxs("div", { className: "px-1.5 hover:bg-gray-100 flex justify-between gap-3 -mx-1.5 py-0.5 rounded items-center", children: [jsxRuntimeExports.jsx("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-label-13 text-gray-900", children: label }), removed ? jsxRuntimeExports.jsx("span", { className: "shrink-0 text-copy-13 italic text-gray-700", children: "removed" }) : copyText ? jsxRuntimeExports.jsxs("div", { className: cn(rowCopyValueVariants({ variant })), children: [href ? jsxRuntimeExports.jsxs("a", { href, target: "_blank", rel: "noreferrer", className: cn(rowValueVariants({ variant }), "flex min-w-0 items-center gap-0.5 hover:underline"), children: [jsxRuntimeExports.jsx(MiddleTruncate, { value: copyText, className: "min-w-0 grid-cols-[minmax(0,1fr)] text-right" }), jsxRuntimeExports.jsx(ArrowUpRight, { "aria-hidden": true, className: "h-3 w-3 shrink-0" })] }) : jsxRuntimeExports.jsx(MiddleTruncate, { value: copyText, className: cn(rowValueVariants({ variant, className: "text-right" }), "grid-cols-[minmax(0,1fr)]") }), jsxRuntimeExports.jsx(CopyButton, { textToCopy: copyText, "aria-label": `Copy ${label}`, size: "small", className: "-my-0.5 -mr-1" })] }) : jsxRuntimeExports.jsx("span", { className: cn(rowValueVariants({ variant })), children: href ? jsxRuntimeExports.jsx("a", { href, target: "_blank", rel: "noreferrer", className: "hover:underline", children: value }) : value })] });
1036
941
  }
1037
942
  function DetailKeyValueRow(props) {
1038
943
  return jsxRuntimeExports.jsx(DetailKeyValueRowBase, { ...props });
@@ -1112,13 +1017,13 @@ function AttrSetEventBlock({ data }) {
1112
1017
  const kbdVariants = cva("inline-flex items-center justify-center rounded px-1 text-center font-sans", {
1113
1018
  variants: {
1114
1019
  variant: {
1115
- subtle: "bg-background-100/20",
1116
- outline: "border border-gray-alpha-400 bg-background-100 font-medium text-gray-900"
1020
+ subtle: "bg-gray-400",
1021
+ outline: "bg-background-100 font-medium text-gray-900 shadow-[0_0_0_1px_var(--ds-gray-alpha-400)]"
1117
1022
  },
1118
1023
  size: {
1119
1024
  default: "h-5 min-w-5 text-label-12 leading-none",
1120
- compact: "h-4 min-h-4 min-w-4 text-[11px] leading-none",
1121
- search: "h-5 min-h-5 min-w-5 text-label-13 leading-[1.7em]"
1025
+ compact: "h-5 min-h-5 min-w-5 text-label-12",
1026
+ search: "h-5 min-h-5 min-w-5 text-label-12"
1122
1027
  }
1123
1028
  },
1124
1029
  defaultVariants: {
@@ -1249,7 +1154,7 @@ function DraggableBorder({ element, position, onWidthChange, onReset, "aria-labe
1249
1154
  if (movedRef.current || performance.now() - lastDragEndAtRef.current < 500) {
1250
1155
  return;
1251
1156
  }
1252
- onReset == null ? void 0 : onReset();
1157
+ onReset?.();
1253
1158
  };
1254
1159
  const handleKeyDown = (e) => {
1255
1160
  const el = element.current;
@@ -1337,19 +1242,18 @@ function DetailPanelShell({ id, width, title, itemLabel, actions, onPrev, onNext
1337
1242
  return jsxRuntimeExports.jsxs("aside", { ref: asideRef, id, className: "relative flex flex-col h-full max-h-full shrink-0 bg-background-100 border-l border-gray-alpha-400", style: { width: width.width }, children: [jsxRuntimeExports.jsx(DraggableBorder, { element: asideRef, position: "left", onWidthChange: width.resize, onReset: () => width.resize(PANEL_DEFAULT_WIDTH), "aria-label": `Resize ${itemLabel} details panel`, "aria-controls": id, "aria-valuemin": PANEL_MIN_WIDTH, "aria-valuemax": width.maxWidth, "aria-valuenow": Math.min(Math.max(Math.round(width.width), PANEL_MIN_WIDTH), width.maxWidth) }), jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 shrink-0 px-4 py-[7.5px]", children: [jsxRuntimeExports.jsx("div", { className: "flex min-w-0 items-center gap-2 text-label-14 font-medium text-gray-1000", children: title }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0.5 shrink-0", children: [actions, jsxRuntimeExports.jsxs(Tooltip, { children: [jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate up", "aria-keyshortcuts": "K", onClick: onPrev, disabled: !onPrev, children: jsxRuntimeExports.jsx(ChevronUp, { className: "w-4 h-4" }) }) }), onPrev ? jsxRuntimeExports.jsxs(TooltipContent, { children: ["Navigate up", jsxRuntimeExports.jsx(Kbd, { children: "K" })] }) : null] }), jsxRuntimeExports.jsxs(Tooltip, { children: [jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: jsxRuntimeExports.jsx(IconButton, { "aria-label": "Navigate down", "aria-keyshortcuts": "J", onClick: onNext, disabled: !onNext, children: jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" }) }) }), onNext ? jsxRuntimeExports.jsxs(TooltipContent, { children: ["Navigate down", jsxRuntimeExports.jsx(Kbd, { children: "J" })] }) : null] }), jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "w-px h-4 bg-gray-alpha-400 mx-1" }), jsxRuntimeExports.jsx(IconButton, { "aria-label": `Close ${itemLabel} details`, "aria-keyshortcuts": "Escape", onClick: onClose, children: jsxRuntimeExports.jsx(X, { className: "w-4 h-4" }) })] })] }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children })] });
1338
1243
  }
1339
1244
  function DecryptButton({ decrypted = false, loading = false, disabled = false, disabledReason, onClick }) {
1340
- return jsxRuntimeExports.jsx(Button, {
1245
+ return jsxRuntimeExports.jsxs(Tooltip, { children: [jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: jsxRuntimeExports.jsx("span", { children: jsxRuntimeExports.jsx(Button, {
1341
1246
  variant: "secondary",
1342
1247
  size: "small",
1343
1248
  onClick: decrypted ? void 0 : onClick,
1344
1249
  loading,
1345
1250
  disabled: decrypted || disabled,
1346
- title: disabled ? disabledReason : void 0,
1347
1251
  prefix: decrypted ? jsxRuntimeExports.jsx(LockOpen, {}) : jsxRuntimeExports.jsx(Lock, {}),
1348
1252
  // Decrypted is a success state rather than an unavailable one, so it
1349
1253
  // keeps the green fill instead of the disabled gray.
1350
1254
  className: decrypted ? "disabled:cursor-default disabled:bg-green-100 disabled:text-green-900 disabled:[--themed-border:_var(--ds-green-400)] disabled:hover:bg-green-100" : void 0,
1351
1255
  children: decrypted ? "Decrypted" : "Decrypt"
1352
- });
1256
+ }) }) }), disabled && disabledReason ? jsxRuntimeExports.jsx(TooltipContent, { children: disabledReason }) : null] });
1353
1257
  }
1354
1258
  function isStructuredError(value) {
1355
1259
  return value != null && typeof value === "object" && (typeof value.message === "string" || typeof value.stack === "string");
@@ -1372,15 +1276,7 @@ ${stack}` : body;
1372
1276
  }, children: [jsxRuntimeExports.jsx(CopyButton, { textToCopy: copyText, "aria-label": "Copy error", className: "absolute right-2 top-2 border border-red-400 text-red-900 enabled:hover:bg-red-200 enabled:hover:text-red-900 focus-visible:text-red-900" }), title && jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 px-3 py-2.5 pr-10", style: {
1373
1277
  color: "var(--ds-red-900)",
1374
1278
  borderBottom: "1px solid var(--ds-red-400)"
1375
- }, children: [jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4 shrink-0" }), jsxRuntimeExports.jsx("p", {
1376
- className: "text-label-12 font-semibold m-0 truncate",
1377
- // The full message or stack is in the body below; the header
1378
- // shows the first line, single-line, with overflow
1379
- // ellipsised so a long title doesn't push the copy button or
1380
- // wrap into the framed hint/docs lines.
1381
- title: message,
1382
- children: title
1383
- })] }), body && jsxRuntimeExports.jsx("pre", { className: "px-3 py-2.5 text-label-12-mono whitespace-pre-wrap break-words overflow-auto m-0", style: {
1279
+ }, children: [jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4 shrink-0" }), jsxRuntimeExports.jsx("p", { className: "text-label-12 font-semibold m-0 truncate", children: title })] }), body && jsxRuntimeExports.jsx("pre", { className: "px-3 py-2.5 text-label-12-mono whitespace-pre-wrap break-words overflow-auto m-0", style: {
1384
1280
  color: "var(--ds-red-900)",
1385
1281
  background: "var(--ds-red-200)"
1386
1282
  }, children: body })] });
@@ -1430,10 +1326,10 @@ function extractStructuredError(data, eventType) {
1430
1326
  return null;
1431
1327
  }
1432
1328
  const SEGMENT_COLOR = {
1433
- queued: "bg-gray-400",
1434
- failed: "bg-amber-700",
1435
- backoff: "bg-amber-300",
1436
- ok: "bg-green-700"
1329
+ queued: STATUS_DOT.queued,
1330
+ failed: STATUS_DOT.failed,
1331
+ backoff: STATUS_DOT.retrying,
1332
+ ok: STATUS_DOT.succeeded
1437
1333
  };
1438
1334
  function PayloadView({ data, eventType, encrypted }) {
1439
1335
  const decrypt2 = reactExports.useContext(DecryptClickContext);
@@ -1513,18 +1409,17 @@ function SearchInput({ value, onValueChange, label, className, id, onKeyDown, on
1513
1409
  };
1514
1410
  }, []);
1515
1411
  const clear = () => {
1516
- var _a;
1517
1412
  onValueChange("");
1518
- (_a = inputRef.current) == null ? void 0 : _a.focus();
1413
+ inputRef.current?.focus();
1519
1414
  };
1520
1415
  return jsxRuntimeExports.jsxs("div", { className: cn("@container flex h-10 min-h-10 shrink-0 items-center gap-1.5 border-b border-gray-alpha-400 bg-background-100 pr-2", focusVisible && "[outline:var(--ds-focus-ring-outline,2px_solid_var(--ds-focus-color))] -outline-offset-2", className), children: [jsxRuntimeExports.jsx("label", { htmlFor: inputId, className: "sr-only", children: label }), jsxRuntimeExports.jsx(Search, { "aria-hidden": true, className: "size-3.5 shrink-0 text-gray-800" }), jsxRuntimeExports.jsx("input", { ...props, ref: inputRef, id: inputId, type: "search", autoComplete: "off", spellCheck: false, value, onChange: (e) => onValueChange(e.target.value), onFocus: (e) => {
1521
- onFocus == null ? void 0 : onFocus(e);
1416
+ onFocus?.(e);
1522
1417
  setFocusVisible(lastInputRef.current === "keyboard");
1523
1418
  }, onBlur: (e) => {
1524
- onBlur == null ? void 0 : onBlur(e);
1419
+ onBlur?.(e);
1525
1420
  setFocusVisible(false);
1526
1421
  }, onKeyDown: (e) => {
1527
- onKeyDown == null ? void 0 : onKeyDown(e);
1422
+ onKeyDown?.(e);
1528
1423
  if (e.defaultPrevented)
1529
1424
  return;
1530
1425
  if (e.key === "Escape" && value) {
@@ -1552,15 +1447,14 @@ function EventListToolbar({ query, hint: hint2, onQueryChange }) {
1552
1447
  function EventNoticeTooltip({ notice, children }) {
1553
1448
  if (!notice)
1554
1449
  return children;
1555
- return jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: jsxRuntimeExports.jsxs(Tooltip, { children: [jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children }), jsxRuntimeExports.jsx(TooltipContent, { className: "max-w-[264px] leading-snug", collisionPadding: 8, side: "top", children: notice })] }) });
1450
+ return jsxRuntimeExports.jsx(TooltipProvider, { children: jsxRuntimeExports.jsxs(Tooltip, { children: [jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children }), jsxRuntimeExports.jsx(TooltipContent, { collisionPadding: 8, side: "top", children: notice })] }) });
1556
1451
  }
1557
1452
  const COL = {
1558
1453
  level: "w-6 justify-center",
1559
1454
  time: "w-[172px]",
1560
- since: "w-[100px]",
1455
+ since: "w-[100px] justify-end pr-4",
1561
1456
  event: "w-[136px]",
1562
- name: "w-[280px]",
1563
- duration: "w-[96px] justify-end"
1457
+ name: "w-[280px]"
1564
1458
  };
1565
1459
  const CELL = "flex h-full shrink-0 items-center overflow-hidden px-1.5";
1566
1460
  const LEVEL_ROW_CLASS = {
@@ -1599,12 +1493,12 @@ function SortIndicator({ order }) {
1599
1493
  }
1600
1494
  function EventListHeader({ showOccurred, sortOrder, onSortOrderChange }) {
1601
1495
  const sortButton = (label) => jsxRuntimeExports.jsxs("button", { type: "button", "aria-label": `${label}, ${sortOrder === "asc" ? "oldest" : "newest"} first`, onClick: () => onSortOrderChange(sortOrder === "asc" ? "desc" : "asc"), className: cn(CELL, COL.time, "cursor-pointer gap-1.5 border-0 bg-transparent text-left font-sans text-label-14 text-gray-900 hover:text-gray-1000"), children: [label, jsxRuntimeExports.jsx(SortIndicator, { order: sortOrder })] });
1602
- return jsxRuntimeExports.jsxs("div", { role: "row", className: "flex h-10 shrink-0 items-center border-b border-gray-alpha-400 px-1 font-sans text-label-14 text-gray-900", children: [jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.level) }), showOccurred ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [sortButton("Occurred"), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.time), children: "Created" })] }) : sortButton("Time"), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.since) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.name), children: "Name" }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.event), children: "Event" }), jsxRuntimeExports.jsx("div", { className: cn(CELL, "min-w-0 flex-1 h-3.5 border-l border-gray-400"), children: "Message" }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.duration), children: "Duration" })] });
1496
+ return jsxRuntimeExports.jsxs("div", { role: "row", className: "flex h-10 shrink-0 items-center border-b border-gray-alpha-400 px-1 font-sans text-label-14 text-gray-900", children: [jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.level) }), showOccurred ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [sortButton("Occurred"), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.time), children: "Created" })] }) : sortButton("Time"), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.since), children: jsxRuntimeExports.jsxs(Tooltip, { children: [jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: jsxRuntimeExports.jsx("span", { children: "Delta" }) }), jsxRuntimeExports.jsx(TooltipContent, { side: "top", children: "Time since the previous event" })] }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.name), children: "Name" }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.event), children: "Event" }), jsxRuntimeExports.jsx("div", { className: cn(CELL, "min-w-0 flex-1 h-3.5 border-l border-gray-400"), children: "Message" })] });
1603
1497
  }
1604
1498
  function IdleGapRow({ ms, reason }) {
1605
1499
  return jsxRuntimeExports.jsxs("div", { className: "mx-1 mt-px flex h-6 items-center gap-2.5 pl-[30px] pr-2 font-mono text-label-12-mono text-gray-700", children: [jsxRuntimeExports.jsx("span", { className: "h-px w-3 shrink-0 bg-gray-400" }), jsxRuntimeExports.jsxs("span", { className: "shrink-0", children: [formatDurationPrecise(ms), " idle", reason ? ` · ${reason}` : ""] }), jsxRuntimeExports.jsx("span", { className: "h-px flex-1 bg-gray-400" })] });
1606
1500
  }
1607
- function EventRow({ row, index, isSelected, isTabStop, relation, onSelect, showSeparateEventOccurrenceTimestamps = false }) {
1501
+ function EventRow({ row, index, sincePreviousMs, isSelected, isTabStop, relation, onSelect, showSeparateEventOccurrenceTimestamps = false }) {
1608
1502
  const { event, level, name, message, notice } = row;
1609
1503
  const occurredAt = parseEventDate(event.occurredAt);
1610
1504
  const displayedAt = showSeparateEventOccurrenceTimestamps ? new Date(event.createdAt) : getEffectiveEventDate$1(event);
@@ -1617,13 +1511,13 @@ function EventRow({ row, index, isSelected, isTabStop, relation, onSelect, showS
1617
1511
  e.preventDefault();
1618
1512
  onSelect(event);
1619
1513
  }
1620
- }, className: cn("mx-1 mt-px flex h-6 cursor-pointer items-center rounded-md font-mono text-[13px] leading-5 outline-none focus-visible:relative focus-visible:z-10 focus-visible:shadow-[0_0_0_2px_var(--ds-focus-color)]", LEVEL_ROW_CLASS[level], !isTinted && !relation && index % 2 === 1 && "bg-background-200", isRelated && !isTinted && "bg-blue-300/50 hover:bg-blue-300/75", isMuted && "text-gray-700 [&_svg]:text-gray-700", isSelected && LEVEL_SELECTED_CLASS[level]), children: [jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.level), children: jsxRuntimeExports.jsx(LevelIcon, { level }) }), showSeparateEventOccurrenceTimestamps && (occurredAt ? jsxRuntimeExports.jsx(TimestampCell, { date: occurredAt, secondaryClass }) : jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.time, secondaryClass), children: "—" })), jsxRuntimeExports.jsx(TimestampCell, { date: displayedAt, secondaryClass }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.since, "tabular-nums", secondaryClass), children: row.sinceStartMs !== void 0 ? formatSinceStart(row.sinceStartMs) : "" }), jsxRuntimeExports.jsxs("div", { className: cn(CELL, COL.name, "gap-2"), title: name || void 0, children: [jsxRuntimeExports.jsx(ResourceIcon, { resource: row.resource, isErrored: level === "error", isCancelled: event.eventType === "run_cancelled" }), name ? jsxRuntimeExports.jsx("span", { className: cn("-mx-1 truncate rounded px-1", isRelated && "text-blue-900", isRelated && isTinted && "bg-blue-100"), children: name }) : null] }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.event), children: jsxRuntimeExports.jsx(EventNoticeTooltip, { notice, children: jsxRuntimeExports.jsx("span", { className: cn("truncate", notice && "line-through"), title: event.eventType, children: event.eventType }) }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, "min-w-0 flex-1 h-3.5 border-l", LEVEL_SEPARATOR_CLASS[level]), title: message || void 0, children: jsxRuntimeExports.jsx("span", { className: "truncate", children: message }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.duration, "tabular-nums"), children: row.durationMs !== void 0 ? formatDurationPrecise(row.durationMs) : "" })] });
1514
+ }, className: cn("mx-1 mt-px flex h-6 cursor-pointer items-center rounded-md font-mono text-[13px] leading-5 outline-none focus-visible:relative focus-visible:z-10 focus-visible:shadow-[0_0_0_2px_var(--ds-focus-color)]", LEVEL_ROW_CLASS[level], !isTinted && !relation && index % 2 === 1 && "bg-background-200", isRelated && !isTinted && "bg-blue-300/50 hover:bg-blue-300/75", isMuted && "text-gray-700 [&_svg]:text-gray-700", isSelected && LEVEL_SELECTED_CLASS[level]), children: [jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.level), children: jsxRuntimeExports.jsx(LevelIcon, { level }) }), showSeparateEventOccurrenceTimestamps && (occurredAt ? jsxRuntimeExports.jsx(TimestampCell, { date: occurredAt, secondaryClass }) : jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.time, secondaryClass), children: "—" })), jsxRuntimeExports.jsx(TimestampCell, { date: displayedAt, secondaryClass }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.since, "tabular-nums", secondaryClass), children: sincePreviousMs !== void 0 ? formatElapsed(sincePreviousMs) : "" }), jsxRuntimeExports.jsxs("div", { className: cn(CELL, COL.name, "gap-2"), children: [jsxRuntimeExports.jsx(ResourceIcon, { resource: row.resource, isErrored: level === "error", isCancelled: event.eventType === "run_cancelled" }), name ? jsxRuntimeExports.jsxs(Tooltip, { children: [jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: jsxRuntimeExports.jsx("span", { className: cn("-mx-1 truncate rounded px-1", isRelated && "text-blue-900", isRelated && isTinted && "bg-blue-100"), children: name }) }), jsxRuntimeExports.jsx(TooltipContent, { children: name })] }) : null] }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.event), children: jsxRuntimeExports.jsx(EventNoticeTooltip, { notice, children: jsxRuntimeExports.jsx("span", { className: cn("truncate", notice && "line-through"), children: event.eventType }) }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, "min-w-0 flex-1 h-3.5 border-l", LEVEL_SEPARATOR_CLASS[level]), children: jsxRuntimeExports.jsx("span", { className: "truncate", children: message }) })] });
1621
1515
  }
1622
1516
  const SKELETON_MESSAGE_WIDTHS = ["40%", "0%", "25%", "55%", "0%", "30%"];
1623
1517
  function EventRowsSkeleton() {
1624
1518
  return jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-hidden pt-px", children: Array.from({ length: 18 }, (_, i) => jsxRuntimeExports.jsxs("div", { className: cn("mx-1 mt-px flex h-6 items-center rounded-md", i % 2 === 1 && "bg-background-200"), children: [jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.level) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.time), children: jsxRuntimeExports.jsx(Skeleton, { className: "h-3 w-[136px]" }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.since), children: jsxRuntimeExports.jsx(Skeleton, { className: "h-3 w-12" }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.name), children: jsxRuntimeExports.jsx(Skeleton, { className: "h-3 w-24" }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.event), children: jsxRuntimeExports.jsx(Skeleton, { className: "h-3 w-[104px]" }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, "min-w-0 flex-1"), children: jsxRuntimeExports.jsx(Skeleton, { className: "h-3", style: {
1625
1519
  width: SKELETON_MESSAGE_WIDTHS[i % SKELETON_MESSAGE_WIDTHS.length]
1626
- } }) }), jsxRuntimeExports.jsx("div", { className: cn(CELL, COL.duration) })] }, i)) });
1520
+ } }) })] }, i)) });
1627
1521
  }
1628
1522
  const WORKFLOW_ULID_BODY = "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}";
1629
1523
  const STEP_ID_PATTERN = new RegExp(`^step_(${WORKFLOW_ULID_BODY})$`, "i");
@@ -1692,7 +1586,7 @@ function useEventSearch(onExactIdSearch) {
1692
1586
  }
1693
1587
  if (!onExactIdSearch)
1694
1588
  return { status: "unavailable", query: trimmed };
1695
- if ((outcome == null ? void 0 : outcome.query) !== trimmed || outcome.attempt !== attempt) {
1589
+ if (outcome?.query !== trimmed || outcome.attempt !== attempt) {
1696
1590
  return { status: "loading", query: trimmed, id: parsed };
1697
1591
  }
1698
1592
  return { ...outcome.answer, query: trimmed, id: parsed };
@@ -1709,7 +1603,7 @@ function useElementWidth(ref, enabled = true) {
1709
1603
  return;
1710
1604
  setWidth(Math.round(el.getBoundingClientRect().width));
1711
1605
  const observer = new ResizeObserver(([entry]) => {
1712
- setWidth(Math.round((entry == null ? void 0 : entry.contentRect.width) ?? 0));
1606
+ setWidth(Math.round(entry?.contentRect.width ?? 0));
1713
1607
  });
1714
1608
  observer.observe(el);
1715
1609
  return () => observer.disconnect();
@@ -1764,7 +1658,7 @@ function EventListViewInner({ events, run, onLoadEventData, hasMoreEvents = fals
1764
1658
  const event = knownEvents.find((e) => e.eventId === selectedEventId);
1765
1659
  return event ? buildEventRow(event, lookups) : void 0;
1766
1660
  }, [selectedEventId, knownEvents, lookups]);
1767
- const relatedKey = search.status === "ok" ? search.id.kind === "event" ? getEventEntity(search.events[0]).key : search.id.id : (selectedRow == null ? void 0 : selectedRow.entity.key) ?? null;
1661
+ const relatedKey = search.status === "ok" ? search.id.kind === "event" ? getEventEntity(search.events[0]).key : search.id.id : selectedRow?.entity.key ?? null;
1768
1662
  const [visibleRange, setVisibleRange] = reactExports.useState({
1769
1663
  startIndex: 0,
1770
1664
  endIndex: 0
@@ -1772,14 +1666,11 @@ function EventListViewInner({ events, run, onLoadEventData, hasMoreEvents = fals
1772
1666
  const relatedIndexes = reactExports.useMemo(() => listItems.flatMap((item, i) => item.kind === "event" && item.row.entity.key === relatedKey ? [i] : []), [listItems, relatedKey]);
1773
1667
  const relatedAbove = relatedIndexes.filter((i) => i < visibleRange.startIndex);
1774
1668
  const relatedBelow = relatedIndexes.filter((i) => i > visibleRange.endIndex);
1775
- const scrollToItem = (index) => {
1776
- var _a;
1777
- return (_a = virtuosoRef.current) == null ? void 0 : _a.scrollToIndex({
1778
- index,
1779
- align: "center",
1780
- behavior: "smooth"
1781
- });
1782
- };
1669
+ const scrollToItem = (index) => virtuosoRef.current?.scrollToIndex({
1670
+ index,
1671
+ align: "center",
1672
+ behavior: "smooth"
1673
+ });
1783
1674
  const eventDataCacheRef = reactExports.useRef(/* @__PURE__ */ new Map());
1784
1675
  const cacheEventData = reactExports.useCallback((eventId, data) => {
1785
1676
  eventDataCacheRef.current.set(eventId, data);
@@ -1792,7 +1683,6 @@ function EventListViewInner({ events, run, onLoadEventData, hasMoreEvents = fals
1792
1683
  const isRefetching = isLoading && hasHadEventsRef.current && sortedEvents.length === 0;
1793
1684
  const selectedIndex = selectedEventId ? rows.findIndex((row) => row.event.eventId === selectedEventId) : -1;
1794
1685
  const moveSelection = reactExports.useCallback((delta) => {
1795
- var _a;
1796
1686
  if (rows.length === 0)
1797
1687
  return;
1798
1688
  const nextIndex = selectedIndex === -1 ? 0 : Math.min(Math.max(selectedIndex + delta, 0), rows.length - 1);
@@ -1800,11 +1690,10 @@ function EventListViewInner({ events, run, onLoadEventData, hasMoreEvents = fals
1800
1690
  setSelectedEventId(next.eventId);
1801
1691
  const itemIndex = listItems.findIndex((item) => item.kind === "event" && item.row.event.eventId === next.eventId);
1802
1692
  if (itemIndex >= 0) {
1803
- (_a = virtuosoRef.current) == null ? void 0 : _a.scrollIntoView({ index: itemIndex });
1693
+ virtuosoRef.current?.scrollIntoView({ index: itemIndex });
1804
1694
  }
1805
1695
  requestAnimationFrame(() => {
1806
- var _a2, _b;
1807
- (_b = (_a2 = bodyRef.current) == null ? void 0 : _a2.querySelector(`[data-event-id="${CSS.escape(next.eventId)}"]`)) == null ? void 0 : _b.focus();
1696
+ bodyRef.current?.querySelector(`[data-event-id="${CSS.escape(next.eventId)}"]`)?.focus();
1808
1697
  });
1809
1698
  }, [selectedIndex, rows, listItems]);
1810
1699
  const handleListKeyDown = reactExports.useCallback((e) => {
@@ -1830,7 +1719,7 @@ function EventListViewInner({ events, run, onLoadEventData, hasMoreEvents = fals
1830
1719
  return item.kind === "gap" ? item.key : item.row.event.eventId;
1831
1720
  }, endReached: () => {
1832
1721
  if (list.hasMore && !isLoadingMoreEvents) {
1833
- void (onLoadMoreEvents == null ? void 0 : onLoadMoreEvents());
1722
+ void onLoadMoreEvents?.();
1834
1723
  }
1835
1724
  }, components: { Footer: () => jsxRuntimeExports.jsx("div", { className: "h-2" }) }, itemContent: (i) => {
1836
1725
  const item = listItems[i];
@@ -1839,11 +1728,11 @@ function EventListViewInner({ events, run, onLoadEventData, hasMoreEvents = fals
1839
1728
  }
1840
1729
  const { row } = item;
1841
1730
  const isSelected = selectedEventId === row.event.eventId;
1842
- return jsxRuntimeExports.jsx(EventRow, { row, index: item.index, isSelected, isTabStop: selectedIndex === -1 ? item.index === 0 : isSelected, relation: relatedKey === null ? void 0 : row.entity.key === relatedKey ? "related" : "unrelated", onSelect: toggleSelectedEvent, showSeparateEventOccurrenceTimestamps });
1731
+ return jsxRuntimeExports.jsx(EventRow, { row, index: item.index, sincePreviousMs: item.sincePreviousMs, isSelected, isTabStop: selectedIndex === -1 ? item.index === 0 : isSelected, relation: relatedKey === null ? void 0 : row.entity.key === relatedKey ? "related" : "unrelated", onSelect: toggleSelectedEvent, showSeparateEventOccurrenceTimestamps });
1843
1732
  }, style: { flex: 1, minHeight: 0 } }), relatedAbove.length > 0 && jsxRuntimeExports.jsx(RelatedHint, { direction: "above", count: relatedAbove.length, onClick: () => scrollToItem(relatedAbove.at(-1) ?? 0) }), relatedBelow.length > 0 && jsxRuntimeExports.jsx(RelatedHint, { direction: "below", count: relatedBelow.length, onClick: () => scrollToItem(relatedBelow[0]) })] }), jsxRuntimeExports.jsxs("div", { className: "relative flex h-10 shrink-0 items-center border-t border-gray-alpha-400 px-4 text-label-13 text-gray-900", children: [jsxRuntimeExports.jsx("span", { children: getFooterLabel(search, {
1844
1733
  total: sortedEvents.length,
1845
1734
  hasMoreEvents
1846
- }) }), list.hasMore && jsxRuntimeExports.jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto", children: jsxRuntimeExports.jsx(Button, { variant: "secondary", loading: isLoadingMoreEvents, onClick: () => void (onLoadMoreEvents == null ? void 0 : onLoadMoreEvents()), children: "Load more" }) }) })] })] }), selectedRow ? jsxRuntimeExports.jsx(EventDetailsPanel, { row: selectedRow, onLoadEventData, cachedEventData: eventDataCacheRef.current.get(selectedRow.event.eventId) ?? null, onCacheEventData: cacheEventData, encryptionKey, width: panelWidth, onPrev: selectedIndex > 0 ? () => moveSelection(-1) : void 0, onNext: selectedIndex >= 0 && selectedIndex < rows.length - 1 ? () => moveSelection(1) : void 0, onClose: () => setSelectedEventId(void 0), onViewInTrace }) : null] })] }) });
1735
+ }) }), list.hasMore && jsxRuntimeExports.jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto", children: jsxRuntimeExports.jsx(Button, { variant: "secondary", loading: isLoadingMoreEvents, onClick: () => void onLoadMoreEvents?.(), children: "Load more" }) }) })] })] }), selectedRow ? jsxRuntimeExports.jsx(EventDetailsPanel, { row: selectedRow, onLoadEventData, cachedEventData: eventDataCacheRef.current.get(selectedRow.event.eventId) ?? null, onCacheEventData: cacheEventData, encryptionKey, width: panelWidth, onPrev: selectedIndex > 0 ? () => moveSelection(-1) : void 0, onNext: selectedIndex >= 0 && selectedIndex < rows.length - 1 ? () => moveSelection(1) : void 0, onClose: () => setSelectedEventId(void 0), onViewInTrace }) : null] })] }) });
1847
1736
  }
1848
1737
  function RelatedHint({ direction, count, onClick }) {
1849
1738
  const label = `${count} related ${count === 1 ? "event" : "events"}`;
@@ -1851,7 +1740,7 @@ function RelatedHint({ direction, count, onClick }) {
1851
1740
  return jsxRuntimeExports.jsxs("button", { type: "button", "aria-label": `${label} ${direction}`, onClick, className: cn("group absolute inset-x-0 z-10 flex h-10 cursor-pointer justify-end px-3 py-2 outline-none transition-opacity duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] focus-visible:shadow-[inset_0_0_0_2px_var(--ds-focus-color)] starting:opacity-0", direction === "above" ? "top-0 items-start" : "bottom-0 items-end"), children: [jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: cn(layer, "bg-[linear-gradient(to_top,color-mix(in_oklab,var(--ds-background-100)_70%,transparent),30%,transparent)]") }), jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: cn(layer, "bg-[linear-gradient(to_top,color-mix(in_oklab,var(--ds-blue-500)_60%,transparent),30%,transparent)] opacity-45 transition-opacity duration-300 ease-[ease] group-hover:opacity-100 group-hover:duration-150 group-focus-visible:opacity-100 group-active:opacity-75 group-active:duration-75") }), jsxRuntimeExports.jsx("span", { className: "relative font-medium text-label-12 text-blue-900", children: label })] });
1852
1741
  }
1853
1742
  function EventListView(props) {
1854
- return jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: jsxRuntimeExports.jsx(ContextCardProvider, { children: jsxRuntimeExports.jsx(EventListViewInner, { ...props }) }) });
1743
+ return jsxRuntimeExports.jsx(TooltipProvider, { children: jsxRuntimeExports.jsx(ContextCardProvider, { children: jsxRuntimeExports.jsx(EventListViewInner, { ...props }) }) });
1855
1744
  }
1856
1745
  const ROWS = [
1857
1746
  {
@@ -1914,13 +1803,13 @@ const ROWS = [
1914
1803
  const HEADER_MARKERS = ["m0", "m1", "m2", "m3"];
1915
1804
  const HeaderDivider = () => jsxRuntimeExports.jsx("div", { className: "flex justify-center", children: jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "h-full w-px bg-gray-alpha-400" }) });
1916
1805
  function TraceViewerSkeleton() {
1917
- return jsxRuntimeExports.jsxs("output", { "aria-busy": "true", "aria-label": "Loading trace", className: "flex flex-col w-full h-full min-h-0 bg-background-100", children: [jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Loading trace…" }), jsxRuntimeExports.jsx("div", { className: "relative h-10 min-h-10 shrink-0 border-b border-gray-alpha-400", children: jsxRuntimeExports.jsx("div", { className: "absolute inset-x-4 top-[6px]", children: ROWS.map((row) => jsxRuntimeExports.jsx(Skeleton, { className: `absolute h-[3px] rounded-full ${row.offsetClassName} ${row.barClassName} ${row.topClassName}` }, row.id)) }) }), jsxRuntimeExports.jsxs("div", { className: "grid shrink-0 grid-cols-[340px_1px_minmax(50px,1fr)]", children: [jsxRuntimeExports.jsxs("div", { className: "h-10 min-h-10 flex items-center border-b border-gray-alpha-400 pl-4 pr-2 gap-1.5", children: [jsxRuntimeExports.jsx(Skeleton, { className: "w-3.5 h-3.5 shrink-0 rounded-sm" }), jsxRuntimeExports.jsx(Skeleton, { className: "h-3.5 w-40" })] }), jsxRuntimeExports.jsx(HeaderDivider, {}), jsxRuntimeExports.jsx("div", { className: "h-10 min-h-10 flex items-end border-b border-gray-alpha-400 px-4 pb-1 gap-2", children: jsxRuntimeExports.jsx("div", { className: "relative flex-1 flex items-end justify-between", children: HEADER_MARKERS.map((id) => jsxRuntimeExports.jsx(Skeleton, { className: "h-3.5 w-9" }, id)) }) })] }), jsxRuntimeExports.jsxs("div", { className: "grid min-h-0 flex-1 grid-cols-[340px_1px_minmax(50px,1fr)] overflow-hidden", children: [jsxRuntimeExports.jsx("div", { className: "block overflow-visible", children: jsxRuntimeExports.jsx("ul", { className: "block divide-y divide-gray-alpha-400 border-b border-gray-alpha-400", children: ROWS.map((row) => jsxRuntimeExports.jsxs("li", { className: "h-10 flex items-center pl-4 pr-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [jsxRuntimeExports.jsx(Skeleton, { className: "w-4 h-4 shrink-0 rounded-sm" }), jsxRuntimeExports.jsx(Skeleton, { className: `h-3.5 ${row.nameClassName}` })] }), jsxRuntimeExports.jsx(Skeleton, { className: "ml-2 h-3.5 w-10 shrink-0" })] }, row.id)) }) }), jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "h-full w-px bg-gray-alpha-400" }), jsxRuntimeExports.jsx("div", { className: "relative min-h-0", children: ROWS.map((row) => jsxRuntimeExports.jsx("div", { className: "relative h-10", children: jsxRuntimeExports.jsx("div", { className: "absolute inset-x-4 inset-y-0", children: jsxRuntimeExports.jsx(Skeleton, { className: `absolute top-1/2 h-6 -translate-y-1/2 rounded-[0.25rem] ${row.offsetClassName} ${row.barClassName}` }) }) }, row.id)) })] })] });
1806
+ return jsxRuntimeExports.jsxs("output", { "aria-busy": "true", "aria-label": "Loading trace", className: "flex flex-col w-full h-full min-h-0 bg-background-100", children: [jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Loading trace…" }), jsxRuntimeExports.jsx("div", { className: "relative h-10 min-h-10 shrink-0 border-b border-gray-alpha-400", children: jsxRuntimeExports.jsx("div", { className: "absolute inset-x-4 top-1.5", children: ROWS.map((row) => jsxRuntimeExports.jsx(Skeleton, { className: `absolute h-[3px] rounded-full ${row.offsetClassName} ${row.barClassName} ${row.topClassName}` }, row.id)) }) }), jsxRuntimeExports.jsxs("div", { className: "grid shrink-0 grid-cols-[340px_1px_minmax(50px,1fr)]", children: [jsxRuntimeExports.jsxs("div", { className: "h-10 min-h-10 flex items-center border-b border-gray-alpha-400 pl-4 pr-2 gap-1.5", children: [jsxRuntimeExports.jsx(Skeleton, { className: "w-3.5 h-3.5 shrink-0 rounded-sm" }), jsxRuntimeExports.jsx(Skeleton, { className: "h-3.5 w-40" })] }), jsxRuntimeExports.jsx(HeaderDivider, {}), jsxRuntimeExports.jsx("div", { className: "h-10 min-h-10 flex items-end border-b border-gray-alpha-400 px-4 pb-1 gap-2", children: jsxRuntimeExports.jsx("div", { className: "relative flex-1 flex items-end justify-between", children: HEADER_MARKERS.map((id) => jsxRuntimeExports.jsx(Skeleton, { className: "h-3.5 w-9" }, id)) }) })] }), jsxRuntimeExports.jsxs("div", { className: "grid min-h-0 flex-1 grid-cols-[340px_1px_minmax(50px,1fr)] overflow-hidden", children: [jsxRuntimeExports.jsx("div", { className: "block overflow-visible", children: jsxRuntimeExports.jsx("ul", { className: "block divide-y divide-gray-alpha-400 border-b border-gray-alpha-400", children: ROWS.map((row) => jsxRuntimeExports.jsxs("li", { className: "h-10 flex items-center pl-4 pr-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [jsxRuntimeExports.jsx(Skeleton, { className: "w-4 h-4 shrink-0 rounded-sm" }), jsxRuntimeExports.jsx(Skeleton, { className: `h-3.5 ${row.nameClassName}` })] }), jsxRuntimeExports.jsx(Skeleton, { className: "ml-2 h-3.5 w-10 shrink-0" })] }, row.id)) }) }), jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "h-full w-px bg-gray-alpha-400" }), jsxRuntimeExports.jsx("div", { className: "relative min-h-0", children: ROWS.map((row) => jsxRuntimeExports.jsx("div", { className: "relative h-10", children: jsxRuntimeExports.jsx("div", { className: "absolute inset-x-4 inset-y-0", children: jsxRuntimeExports.jsx(Skeleton, { className: `absolute top-1/2 h-6 -translate-y-1/2 rounded-sm ${row.offsetClassName} ${row.barClassName}` }) }) }, row.id)) })] })] });
1918
1807
  }
1919
1808
  function useIntersectionObserver(elementRef, { threshold = 0, rootRef, rootMargin = "0%", freezeOnceVisible = false } = {}) {
1920
1809
  const [entry, setEntry] = reactExports.useState();
1921
- const frozen = (entry == null ? void 0 : entry.isIntersecting) && freezeOnceVisible;
1810
+ const frozen = entry?.isIntersecting && freezeOnceVisible;
1922
1811
  reactExports.useEffect(() => {
1923
- const node = elementRef == null ? void 0 : elementRef.current;
1812
+ const node = elementRef?.current;
1924
1813
  const hasIOSupport = !!window.IntersectionObserver;
1925
1814
  if (!hasIOSupport || frozen || !node)
1926
1815
  return;
@@ -1929,7 +1818,7 @@ function useIntersectionObserver(elementRef, { threshold = 0, rootRef, rootMargi
1929
1818
  };
1930
1819
  const observer = new IntersectionObserver(updateEntry, {
1931
1820
  threshold,
1932
- root: (rootRef == null ? void 0 : rootRef.current) ?? null,
1821
+ root: rootRef?.current ?? null,
1933
1822
  rootMargin
1934
1823
  });
1935
1824
  observer.observe(node);
@@ -1945,10 +1834,10 @@ function useLoadMoreOnScroll(loadMore, { hasMore, isLoadingMore, rootRef, rootMa
1945
1834
  loadMoreRef.current = loadMore;
1946
1835
  }, [loadMore]);
1947
1836
  reactExports.useEffect(() => {
1948
- if ((entry == null ? void 0 : entry.isIntersecting) && hasMore && !isLoadingMore) {
1837
+ if (entry?.isIntersecting && hasMore && !isLoadingMore) {
1949
1838
  loadMoreRef.current();
1950
1839
  }
1951
- }, [entry == null ? void 0 : entry.isIntersecting, hasMore, isLoadingMore]);
1840
+ }, [entry?.isIntersecting, hasMore, isLoadingMore]);
1952
1841
  return sentinelRef;
1953
1842
  }
1954
1843
  function ConversationView({ messages }) {
@@ -2018,17 +1907,17 @@ function parseContent(content) {
2018
1907
  if (typeof part === "string") {
2019
1908
  return { type: "text", text: part };
2020
1909
  }
2021
- if ((part == null ? void 0 : part.type) === "text") {
1910
+ if (part?.type === "text") {
2022
1911
  return { type: "text", text: String(part.text ?? "") };
2023
1912
  }
2024
- if ((part == null ? void 0 : part.type) === "tool-call") {
1913
+ if (part?.type === "tool-call") {
2025
1914
  return {
2026
1915
  type: "tool-call",
2027
1916
  toolName: part.toolName,
2028
1917
  input: part.input
2029
1918
  };
2030
1919
  }
2031
- if ((part == null ? void 0 : part.type) === "tool-result") {
1920
+ if (part?.type === "tool-result") {
2032
1921
  return {
2033
1922
  type: "tool-result",
2034
1923
  toolName: part.toolName,
@@ -2041,20 +1930,7 @@ function parseContent(content) {
2041
1930
  return [];
2042
1931
  }
2043
1932
  function TabButton({ active, onClick, children }) {
2044
- return jsxRuntimeExports.jsx("button", { type: "button", role: "tab", "aria-selected": active, tabIndex: active ? 0 : -1, onClick, className: "px-3 py-1.5 text-[11px] font-medium transition-colors -mb-px", style: {
2045
- // Explicit styles to prevent app-level button overrides when web-shared
2046
- // is embedded in a self-hosted app.
2047
- backgroundColor: "transparent",
2048
- borderTop: "none",
2049
- borderLeft: "none",
2050
- borderRight: "none",
2051
- borderBottom: `2px solid ${active ? "var(--ds-blue-600)" : "transparent"}`,
2052
- borderRadius: 0,
2053
- outline: "none",
2054
- boxShadow: "none",
2055
- cursor: "pointer",
2056
- color: active ? "var(--ds-gray-1000)" : "var(--ds-gray-600)"
2057
- }, children });
1933
+ return jsxRuntimeExports.jsx("button", { type: "button", role: "tab", "aria-selected": active, tabIndex: active ? 0 : -1, onClick, className: cn("px-3 py-1.5 text-[11px] font-medium transition-colors -mb-px cursor-pointer rounded-none border-0 border-b-2 bg-transparent shadow-none outline-none", active ? "border-blue-600 text-gray-1000" : "border-transparent text-gray-600"), children });
2058
1934
  }
2059
1935
  function TabbedContainer({ tabs, activeTab, onTabChange, ariaLabel, children }) {
2060
1936
  const handleKeyDown = reactExports.useCallback((event) => {
@@ -2065,13 +1941,7 @@ function TabbedContainer({ tabs, activeTab, onTabChange, ariaLabel, children })
2065
1941
  const nextIndex = event.key === "ArrowRight" ? (currentIndex + 1) % tabs.length : (currentIndex - 1 + tabs.length) % tabs.length;
2066
1942
  onTabChange(tabs[nextIndex].id);
2067
1943
  }, [tabs, activeTab, onTabChange]);
2068
- return jsxRuntimeExports.jsxs("div", { className: "rounded-md border", style: {
2069
- borderColor: "var(--ds-gray-300)",
2070
- backgroundColor: "transparent"
2071
- }, children: [jsxRuntimeExports.jsx("div", { className: "flex gap-1 border-b", role: "tablist", "aria-label": ariaLabel, onKeyDown: handleKeyDown, style: {
2072
- borderColor: "var(--ds-gray-300)",
2073
- backgroundColor: "transparent"
2074
- }, children: tabs.map((tab) => jsxRuntimeExports.jsx(TabButton, { active: activeTab === tab.id, onClick: () => onTabChange(tab.id), children: tab.label }, tab.id)) }), jsxRuntimeExports.jsx("div", { role: "tabpanel", children })] });
1944
+ return jsxRuntimeExports.jsxs("div", { className: "rounded-md border border-gray-300", children: [jsxRuntimeExports.jsx("div", { className: "flex gap-1 border-b border-gray-300", role: "tablist", "aria-label": ariaLabel, onKeyDown: handleKeyDown, children: tabs.map((tab) => jsxRuntimeExports.jsx(TabButton, { active: activeTab === tab.id, onClick: () => onTabChange(tab.id), children: tab.label }, tab.id)) }), jsxRuntimeExports.jsx("div", { role: "tabpanel", children })] });
2075
1945
  }
2076
1946
  const conversationTabs = [
2077
1947
  { id: "conversation", label: "Conversation" },
@@ -2085,11 +1955,7 @@ function EncryptedFieldBlock() {
2085
1955
  return jsxRuntimeExports.jsx(EncryptedDataBlock, {});
2086
1956
  }
2087
1957
  function ExpiredFieldBlock() {
2088
- return jsxRuntimeExports.jsx("div", { className: "flex items-center gap-1.5 rounded-md border px-3 py-2 text-label-12", style: {
2089
- borderColor: "var(--ds-gray-300)",
2090
- backgroundColor: "var(--ds-gray-100)",
2091
- color: "var(--ds-gray-700)"
2092
- }, children: jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Data expired" }) });
1958
+ return jsxRuntimeExports.jsx("div", { className: "flex items-center gap-1.5 rounded-md border border-gray-300 bg-gray-100 px-3 py-2 text-label-12 text-gray-700", children: jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Data expired" }) });
2093
1959
  }
2094
1960
  function JsonBlock(value) {
2095
1961
  return jsxRuntimeExports.jsx(CopyableDataBlock, { data: value });
@@ -2255,7 +2121,7 @@ const attributeToDisplayFn = {
2255
2121
  // A force-claimed hook (`experimental_force`): the run whose token it took.
2256
2122
  claimedFrom: (value) => {
2257
2123
  const from = value;
2258
- return typeof (from == null ? void 0 : from.runId) === "string" ? from.runId : null;
2124
+ return typeof from?.runId === "string" ? from.runId : null;
2259
2125
  },
2260
2126
  isWebhook: (value) => String(value),
2261
2127
  isSystem: (value) => String(value),
@@ -2313,7 +2179,7 @@ const attributeToDisplayFn = {
2313
2179
  },
2314
2180
  input: (value, context) => {
2315
2181
  if (isEncryptedMarker(value)) {
2316
- return jsxRuntimeExports.jsx(Collapsible, { label: "Input", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2182
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Input", defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2317
2183
  }
2318
2184
  if (isExpiredMarker(value))
2319
2185
  return jsxRuntimeExports.jsx(ExpiredFieldBlock, {});
@@ -2322,31 +2188,31 @@ const attributeToDisplayFn = {
2322
2188
  const hasClosureVars = hasDisplayContent(closureVars);
2323
2189
  const hasThisVal = hasDisplayContent(thisVal);
2324
2190
  const hasArgs = hasDisplayContent(args);
2325
- if ((context == null ? void 0 : context.stepName) && isDoStreamStep(context.stepName)) {
2191
+ if (context?.stepName && isDoStreamStep(context.stepName)) {
2326
2192
  const conversation = extractConversation(args);
2327
2193
  if (conversation && conversation.length > 0) {
2328
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(ConversationWithTabs, { conversation, args, defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange }), hasClosureVars && jsxRuntimeExports.jsx(Collapsible, { label: "Closure Variables", children: JsonBlock(closureVars) }), hasThisVal && jsxRuntimeExports.jsx(Collapsible, { label: "This Value", children: JsonBlock(thisVal) })] });
2194
+ return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(ConversationWithTabs, { conversation, args, defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange }), hasClosureVars && jsxRuntimeExports.jsx(Collapsible, { label: "Closure Variables", children: JsonBlock(closureVars) }), hasThisVal && jsxRuntimeExports.jsx(Collapsible, { label: "This Value", children: JsonBlock(thisVal) })] });
2329
2195
  }
2330
2196
  }
2331
2197
  if (!hasArgs && !hasClosureVars && !hasThisVal) {
2332
2198
  return jsxRuntimeExports.jsx(Collapsible, { label: "Input (no data)", disabled: true });
2333
2199
  }
2334
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Collapsible, { label: "Input", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: Array.isArray(args) ? args.map((v, i) => jsxRuntimeExports.jsx("div", { className: "mt-2 first:mt-0", children: JsonBlock(v) }, i)) : JsonBlock(args) }), hasClosureVars && jsxRuntimeExports.jsx(Collapsible, { label: "Closure Variables", children: JsonBlock(closureVars) }), hasThisVal && jsxRuntimeExports.jsx(Collapsible, { label: "Context", children: JsonBlock(thisVal) })] });
2200
+ return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Collapsible, { label: "Input", defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange, children: Array.isArray(args) ? args.map((v, i) => jsxRuntimeExports.jsx("div", { className: "mt-2 first:mt-0", children: JsonBlock(v) }, i)) : JsonBlock(args) }), hasClosureVars && jsxRuntimeExports.jsx(Collapsible, { label: "Closure Variables", children: JsonBlock(closureVars) }), hasThisVal && jsxRuntimeExports.jsx(Collapsible, { label: "Context", children: JsonBlock(thisVal) })] });
2335
2201
  }
2336
2202
  if (!hasDisplayContent(value)) {
2337
2203
  return jsxRuntimeExports.jsx(Collapsible, { label: "Input (no data)", disabled: true });
2338
2204
  }
2339
- return jsxRuntimeExports.jsx(Collapsible, { label: "Input", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: Array.isArray(value) ? value.map((v, i) => jsxRuntimeExports.jsx("div", { className: "mt-2 first:mt-0", children: JsonBlock(v) }, i)) : JsonBlock(value) });
2205
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Input", defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange, children: Array.isArray(value) ? value.map((v, i) => jsxRuntimeExports.jsx("div", { className: "mt-2 first:mt-0", children: JsonBlock(v) }, i)) : JsonBlock(value) });
2340
2206
  },
2341
2207
  output: (value, context) => {
2342
2208
  if (isEncryptedMarker(value)) {
2343
- return jsxRuntimeExports.jsx(Collapsible, { label: "Output", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2209
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Output", defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2344
2210
  }
2345
2211
  if (!hasDisplayContent(value))
2346
2212
  return null;
2347
2213
  if (isExpiredMarker(value))
2348
2214
  return jsxRuntimeExports.jsx(ExpiredFieldBlock, {});
2349
- return jsxRuntimeExports.jsx(Collapsible, { label: "Output", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: JsonBlock(value) });
2215
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Output", defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange, children: JsonBlock(value) });
2350
2216
  },
2351
2217
  error: (value) => {
2352
2218
  if (isEncryptedMarker(value)) {
@@ -2382,7 +2248,7 @@ const attributeToDisplayFn = {
2382
2248
  encryptionPublicKey: (_value) => null,
2383
2249
  // The token of the Hook `start({ experimental_hook })` created: the run's idempotency key.
2384
2250
  startHook: (value) => {
2385
- const token = value == null ? void 0 : value.token;
2251
+ const token = value?.token;
2386
2252
  return typeof token === "string" && token.length > 0 ? token : null;
2387
2253
  },
2388
2254
  // A dynamic run's own workflow code — the code the run actually executed,
@@ -2395,13 +2261,13 @@ const attributeToDisplayFn = {
2395
2261
  // decrypt flow is the gate on reading it.
2396
2262
  dynamicWorkflowCode: (value, context) => {
2397
2263
  if (isEncryptedMarker(value)) {
2398
- return jsxRuntimeExports.jsx(Collapsible, { label: "Workflow Code", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2264
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Workflow Code", defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2399
2265
  }
2400
2266
  if (isExpiredMarker(value))
2401
2267
  return jsxRuntimeExports.jsx(ExpiredFieldBlock, {});
2402
2268
  if (typeof value !== "string" || value.trim().length === 0)
2403
2269
  return null;
2404
- return jsxRuntimeExports.jsx(Collapsible, { label: "Workflow Code", defaultOpen: context == null ? void 0 : context.sectionOpen, onOpenChange: context == null ? void 0 : context.onSectionOpenChange, children: jsxRuntimeExports.jsx(CopyableDataBlock, { data: value }) });
2270
+ return jsxRuntimeExports.jsx(Collapsible, { label: "Workflow Code", defaultOpen: context?.sectionOpen, onOpenChange: context?.onSectionOpenChange, children: jsxRuntimeExports.jsx(CopyableDataBlock, { data: value }) });
2405
2271
  }
2406
2272
  };
2407
2273
  const resolvableAttributes = [
@@ -2422,11 +2288,7 @@ const selfHeaderedAttributes = /* @__PURE__ */ new Set([
2422
2288
  "eventData",
2423
2289
  "dynamicWorkflowCode"
2424
2290
  ]);
2425
- const ExpiredDataMessage = () => jsxRuntimeExports.jsx("div", { className: "text-label-12 rounded-md border p-4 my-2", style: {
2426
- borderColor: "var(--ds-gray-300)",
2427
- backgroundColor: "var(--ds-gray-100)",
2428
- color: "var(--ds-gray-700)"
2429
- }, children: jsxRuntimeExports.jsx("span", { children: "The data for this run has expired and is no longer available." }) });
2291
+ const ExpiredDataMessage = () => jsxRuntimeExports.jsx("div", { className: "text-label-12 rounded-md border border-gray-300 bg-gray-100 p-4 my-2 text-gray-700", children: jsxRuntimeExports.jsx("span", { children: "The data for this run has expired and is no longer available." }) });
2430
2292
  const copyableBasicAttributes = /* @__PURE__ */ new Set([
2431
2293
  "stepId",
2432
2294
  "hookId",
@@ -2451,7 +2313,7 @@ const AttributeBlock = ({ attribute, value, isLoading, inline = false, context }
2451
2313
  }, []);
2452
2314
  const label = loadingSectionLabels[attribute];
2453
2315
  if (isLoading && label && !hasDisplayContent(value)) {
2454
- if (decryptCtx == null ? void 0 : decryptCtx.hasEncryptedData) {
2316
+ if (decryptCtx?.hasEncryptedData) {
2455
2317
  return jsxRuntimeExports.jsx(Collapsible, { label, defaultOpen: attribute === "eventData" || sectionOpenRef.current, onOpenChange: handleSectionOpenChange, children: jsxRuntimeExports.jsx(EncryptedFieldBlock, {}) });
2456
2318
  }
2457
2319
  return jsxRuntimeExports.jsx(Collapsible, { label });
@@ -2469,21 +2331,21 @@ const AttributeBlock = ({ attribute, value, isLoading, inline = false, context }
2469
2331
  return null;
2470
2332
  }
2471
2333
  if (inline) {
2472
- return jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5", children: [jsxRuntimeExports.jsx("span", { className: "text-[11px] font-medium", style: { color: "var(--ds-gray-700)" }, children: attribute }), jsxRuntimeExports.jsx("span", { className: "text-[11px]", style: { color: "var(--ds-gray-1000)" }, children: displayValue })] });
2334
+ return jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5", children: [jsxRuntimeExports.jsx("span", { className: "text-[11px] font-medium text-gray-700", children: attribute }), jsxRuntimeExports.jsx("span", { className: "text-[11px] text-gray-1000", children: displayValue })] });
2473
2335
  }
2474
2336
  if (selfHeaderedAttributes.has(attribute)) {
2475
2337
  return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: displayValue });
2476
2338
  }
2477
- return jsxRuntimeExports.jsxs("div", { className: "relative", children: [typeof isLoading === "boolean" && isLoading && jsxRuntimeExports.jsx("div", { className: "absolute top-9 right-4", children: jsxRuntimeExports.jsx(Spinner, { size: "md" }) }), jsxRuntimeExports.jsxs("div", { className: "my-2 flex flex-col gap-0", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-1000 font-medium first-letter:uppercase", children: attribute }), jsxRuntimeExports.jsx("span", { className: "text-label-12", style: { color: "var(--ds-gray-1000)" }, children: displayValue })] }, attribute)] });
2339
+ return jsxRuntimeExports.jsxs("div", { className: "relative", children: [typeof isLoading === "boolean" && isLoading && jsxRuntimeExports.jsx("div", { className: "absolute top-9 right-4", children: jsxRuntimeExports.jsx(Spinner, { size: "md" }) }), jsxRuntimeExports.jsxs("div", { className: "my-2 flex flex-col gap-0", children: [jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-1000 font-medium first-letter:uppercase", children: attribute }), jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-1000", children: displayValue })] }, attribute)] });
2478
2340
  };
2479
2341
  const AttributePanel = ({ data, moduleSpecifier, moduleSourceUrl, isLoading, error, expiredAt, onStreamClick, onRunClick, onDecrypt, isDecrypting = false, isDecryptDisabled = false, decryptDisabledReason, resource }) => {
2480
2342
  const displayData = reactExports.useMemo(() => {
2481
2343
  const result = { ...data };
2482
2344
  const execCtx = data.executionContext;
2483
- if (execCtx == null ? void 0 : execCtx.workflowCoreVersion) {
2345
+ if (execCtx?.workflowCoreVersion) {
2484
2346
  result.workflowCoreVersion = execCtx.workflowCoreVersion;
2485
2347
  }
2486
- if (typeof (execCtx == null ? void 0 : execCtx.workflowVm) === "string") {
2348
+ if (typeof execCtx?.workflowVm === "string") {
2487
2349
  result.workflowVm = execCtx.workflowVm;
2488
2350
  }
2489
2351
  if (moduleSpecifier) {
@@ -2547,11 +2409,10 @@ const AttributePanel = ({ data, moduleSpecifier, moduleSourceUrl, isLoading, err
2547
2409
  isDecrypting,
2548
2410
  isDecryptDisabled,
2549
2411
  decryptDisabledReason,
2550
- hasEncryptedData: outerDecryptCtx == null ? void 0 : outerDecryptCtx.hasEncryptedData
2412
+ hasEncryptedData: outerDecryptCtx?.hasEncryptedData
2551
2413
  } : outerDecryptCtx;
2552
2414
  return jsxRuntimeExports.jsx(ContextCardProvider, { children: jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: jsxRuntimeExports.jsxs(DecryptClickContext.Provider, { value: decryptValue, children: [visibleBasicAttributes.length > 0 && jsxRuntimeExports.jsxs(CollapsibleRoot, { defaultOpen: true, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { children: "Metadata" }), jsxRuntimeExports.jsx(CollapsibleContent, { className: "mt-0 mb-2", children: jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [orderedBasicAttributes.map((attribute) => {
2553
- var _a;
2554
- const displayValue = (_a = attributeToDisplayFn[attribute]) == null ? void 0 : _a.call(attributeToDisplayFn, displayData[attribute]);
2415
+ const displayValue = attributeToDisplayFn[attribute]?.(displayData[attribute]);
2555
2416
  const isCopyableBasicAttribute = copyableBasicAttributes.has(attribute) && typeof displayValue === "string";
2556
2417
  const label = getAttributeDisplayName(attribute);
2557
2418
  return jsxRuntimeExports.jsx(DetailMonoKeyValueRow, { label, value: displayValue, copyText: isCopyableBasicAttribute ? displayValue : void 0, href: attribute === "moduleSpecifier" ? moduleSourceUrl : void 0 }, attribute);
@@ -2626,7 +2487,7 @@ function EventItem({ event, onLoadEventData, encryptionKey, showSeparateEventOcc
2626
2487
  return jsxRuntimeExports.jsxs(CollapsibleRoot, { variant: "card", onOpenChange: canHaveData ? (open) => {
2627
2488
  if (open)
2628
2489
  handleExpand();
2629
- } : void 0, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { className: "px-3 py-2", children: jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between gap-3", children: [jsxRuntimeExports.jsx(EventNoticeTooltip, { notice: rowNotice, children: jsxRuntimeExports.jsx("span", { className: `text-label-12 font-mono ${rowNotice ? "text-gray-700" : "text-gray-1000"}`, children: event.eventType }) }), jsxRuntimeExports.jsx("span", { className: "shrink-0 text-label-13 text-gray-900", children: displayedCreatedAtTime })] }) }), jsxRuntimeExports.jsxs(CollapsibleContent, { children: [jsxRuntimeExports.jsxs("div", { className: "flex flex-col bg-background-200 [&:has(+_*)]:border-b [&:has(+_*)]:border-gray-alpha-400", children: [showSeparateEventOccurrenceTimestamps && occurredAt && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Occurred" }), jsxRuntimeExports.jsx(TimestampTooltip, { date: occurredAt, children: jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: formatEventTimestamp(occurredAt) }) })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Event ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: event.eventId })] }), event.correlationId && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Correlation ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12 font-mono", children: event.correlationId })] })] }), isLoading && jsxRuntimeExports.jsxs("div", { className: "p-3", children: [jsxRuntimeExports.jsx(Skeleton, { className: "h-4 w-[35%]" }), jsxRuntimeExports.jsx(Skeleton, { className: "mt-2 h-4 w-[90%]" }), jsxRuntimeExports.jsx(Skeleton, { className: "mt-2 h-4 w-[75%]" })] }), loadError && jsxRuntimeExports.jsx(ErrorCard, { title: "Failed to load event data", details: loadError, className: "mt-2" }), displayPayload != null && event.eventType !== "run_cancelled" && jsxRuntimeExports.jsx("div", { className: "[&>div]:border-none [&>div]:rounded-none", children: jsxRuntimeExports.jsx(EventDataBlock, { eventType: event.eventType, data: displayPayload }) })] })] });
2490
+ } : void 0, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { className: "px-3 py-2", children: jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between gap-3", children: [jsxRuntimeExports.jsx(EventNoticeTooltip, { notice: rowNotice, children: jsxRuntimeExports.jsx("span", { className: `text-label-12-mono ${rowNotice ? "text-gray-700" : "text-gray-1000"}`, children: event.eventType }) }), jsxRuntimeExports.jsx("span", { className: "shrink-0 text-label-13 text-gray-900", children: displayedCreatedAtTime })] }) }), jsxRuntimeExports.jsxs(CollapsibleContent, { children: [jsxRuntimeExports.jsxs("div", { className: "flex flex-col bg-background-200 [&:has(+_*)]:border-b [&:has(+_*)]:border-gray-alpha-400", children: [showSeparateEventOccurrenceTimestamps && occurredAt && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Occurred" }), jsxRuntimeExports.jsx(TimestampTooltip, { date: occurredAt, children: jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12-mono", children: formatEventTimestamp(occurredAt) }) })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Event ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12-mono", children: event.eventId })] }), event.correlationId && jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2 py-2 px-3", children: [jsxRuntimeExports.jsx("span", { className: "text-label-12 text-gray-900", children: "Correlation ID" }), jsxRuntimeExports.jsx("span", { className: "max-w-[70%] truncate text-right text-label-12-mono", children: event.correlationId })] })] }), isLoading && jsxRuntimeExports.jsxs("div", { className: "p-3", children: [jsxRuntimeExports.jsx(Skeleton, { className: "h-4 w-[35%]" }), jsxRuntimeExports.jsx(Skeleton, { className: "mt-2 h-4 w-[90%]" }), jsxRuntimeExports.jsx(Skeleton, { className: "mt-2 h-4 w-3/4" })] }), loadError && jsxRuntimeExports.jsx(ErrorCard, { title: "Failed to load event data", details: loadError, className: "mt-2" }), displayPayload != null && event.eventType !== "run_cancelled" && jsxRuntimeExports.jsx("div", { className: "[&>div]:border-none [&>div]:rounded-none", children: jsxRuntimeExports.jsx(EventDataBlock, { eventType: event.eventType, data: displayPayload }) })] })] });
2630
2491
  }
2631
2492
  function hasOnlyExpiredFields(data, eventType) {
2632
2493
  if (data === null || typeof data !== "object" || Array.isArray(data)) {
@@ -2639,11 +2500,7 @@ function hasOnlyExpiredFields(data, eventType) {
2639
2500
  }
2640
2501
  function EventDataBlock({ eventType, data }) {
2641
2502
  if (isExpiredMarker(data) || hasOnlyExpiredFields(data, eventType)) {
2642
- return jsxRuntimeExports.jsx("div", { className: "flex items-center gap-1.5 rounded-md border px-3 py-2 text-label-12", style: {
2643
- borderColor: "var(--ds-gray-300)",
2644
- backgroundColor: "var(--ds-gray-100)",
2645
- color: "var(--ds-gray-700)"
2646
- }, children: jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Data expired" }) });
2503
+ return jsxRuntimeExports.jsx("div", { className: "flex items-center gap-1.5 rounded-md border border-gray-300 bg-gray-100 px-3 py-2 text-label-12 text-gray-700", children: jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Data expired" }) });
2647
2504
  }
2648
2505
  if (hasEncryptedFields({ eventType, eventData: data })) {
2649
2506
  return jsxRuntimeExports.jsx(EncryptedDataBlock, {});
@@ -2668,7 +2525,7 @@ function EventsList({ events, isLoading = false, error, onLoadEventData, onStrea
2668
2525
  if (!hasEvents && !isLoading) {
2669
2526
  return jsxRuntimeExports.jsx(Collapsible, { label: "Events", disabled: true });
2670
2527
  }
2671
- return jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: jsxRuntimeExports.jsxs(CollapsibleRoot, { defaultOpen: true, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { children: "Events" }), jsxRuntimeExports.jsx(CollapsibleContent, { className: "mb-0", children: isLoading ? jsxRuntimeExports.jsx("div", { className: "flex flex-col -mx-4", children: [0, 1, 2].map((i) => jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3 bg-background-200 px-4 py-2", children: [jsxRuntimeExports.jsx(Skeleton, { className: "h-4 w-32 rounded" }), jsxRuntimeExports.jsx(Skeleton, { className: "h-3 w-16 rounded" })] }, i)) }) : jsxRuntimeExports.jsx("div", { className: "flex flex-col -mx-4", children: sortedEvents.map((event) => jsxRuntimeExports.jsx(EventItem, { event, onLoadEventData, encryptionKey, showSeparateEventOccurrenceTimestamps, isDuplicate: duplicateEventIds == null ? void 0 : duplicateEventIds.has(event.eventId) }, event.eventId)) }) })] }) }) });
2528
+ return jsxRuntimeExports.jsx(RunClickContext.Provider, { value: onRunClick, children: jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: jsxRuntimeExports.jsxs(CollapsibleRoot, { defaultOpen: true, children: [jsxRuntimeExports.jsx(CollapsibleTrigger, { children: "Events" }), jsxRuntimeExports.jsx(CollapsibleContent, { className: "mb-0", children: isLoading ? jsxRuntimeExports.jsx("div", { className: "flex flex-col -mx-4", children: [0, 1, 2].map((i) => jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3 bg-background-200 px-4 py-2", children: [jsxRuntimeExports.jsx(Skeleton, { className: "h-4 w-32 rounded" }), jsxRuntimeExports.jsx(Skeleton, { className: "h-3 w-16 rounded" })] }, i)) }) : jsxRuntimeExports.jsx("div", { className: "flex flex-col -mx-4", children: sortedEvents.map((event) => jsxRuntimeExports.jsx(EventItem, { event, onLoadEventData, encryptionKey, showSeparateEventOccurrenceTimestamps, isDuplicate: duplicateEventIds?.has(event.eventId) }, event.eventId)) }) })] }) }) });
2672
2529
  }
2673
2530
  const hasField = (value, key) => key in value;
2674
2531
  const RESOURCES_WITH_FETCHED_DETAIL = /* @__PURE__ */ new Set(["run", "step", "sleep"]);
@@ -2761,16 +2618,16 @@ function deriveSpanSelection(selectedSpan) {
2761
2618
  return {
2762
2619
  resource: "sleep",
2763
2620
  resourceId: selectedSpan.spanId,
2764
- runId: waitData == null ? void 0 : waitData.runId
2621
+ runId: waitData?.runId
2765
2622
  };
2766
2623
  }
2767
2624
  return null;
2768
2625
  }
2769
2626
  function useSelectedSpanDetail(selectedSpan, fetchSpanDetail) {
2770
2627
  const selection = reactExports.useMemo(() => deriveSpanSelection(selectedSpan), [selectedSpan]);
2771
- const resource = selection == null ? void 0 : selection.resource;
2772
- const resourceId = selection == null ? void 0 : selection.resourceId;
2773
- const runId = selection == null ? void 0 : selection.runId;
2628
+ const resource = selection?.resource;
2629
+ const resourceId = selection?.resourceId;
2630
+ const runId = selection?.runId;
2774
2631
  const selectionKey = resource && resourceId ? `${resource}:${resourceId}` : null;
2775
2632
  const needsFetch = resourceNeedsFetchedDetail(resource);
2776
2633
  const [fetched, setFetched] = reactExports.useState({ detail: null, error: null, errorKey: null });
@@ -2804,10 +2661,10 @@ function useSelectedSpanDetail(selectedSpan, fetchSpanDetail) {
2804
2661
  const view = reactExports.useMemo(() => deriveSpanDetailView({
2805
2662
  resource,
2806
2663
  resourceId,
2807
- inlineData: selectedSpan == null ? void 0 : selectedSpan.data,
2664
+ inlineData: selectedSpan?.data,
2808
2665
  fetchedDetail: fetched.detail,
2809
2666
  fetchedError: scopedError
2810
- }), [resource, resourceId, selectedSpan == null ? void 0 : selectedSpan.data, fetched.detail, scopedError]);
2667
+ }), [resource, resourceId, selectedSpan?.data, fetched.detail, scopedError]);
2811
2668
  return {
2812
2669
  status: view.status,
2813
2670
  resource,
@@ -2828,10 +2685,10 @@ function EntityDetailPanel({ run, onStreamClick, onRunClick, fetchSpanDetail, on
2828
2685
  const [resolvingHook, setResolvingHook] = reactExports.useState(false);
2829
2686
  const [resolvedHookIds, setResolvedHookIds] = reactExports.useState(/* @__PURE__ */ new Set());
2830
2687
  const sidebar = useSidebarDataOptional();
2831
- const hasEncryptedData = Boolean((sidebar == null ? void 0 : sidebar.hasEncryptedData) && !encryptionKey);
2832
- const data = selectedSpan == null ? void 0 : selectedSpan.data;
2833
- const rawEvents = selectedSpan == null ? void 0 : selectedSpan.rawEvents;
2834
- const rawEventsLength = (rawEvents == null ? void 0 : rawEvents.length) ?? 0;
2688
+ const hasEncryptedData = Boolean(sidebar?.hasEncryptedData && !encryptionKey);
2689
+ const data = selectedSpan?.data;
2690
+ const rawEvents = selectedSpan?.rawEvents;
2691
+ const rawEventsLength = rawEvents?.length ?? 0;
2835
2692
  const { status, resource, resourceId, displayData, detail: matchedSpanDetailData, error } = useSelectedSpanDetail(selectedSpan, fetchSpanDetail);
2836
2693
  const loading = status === "loading";
2837
2694
  const canWakeUp = reactExports.useMemo(() => {
@@ -2886,7 +2743,7 @@ function EntityDetailPanel({ run, onStreamClick, onRunClick, fetchSpanDetail, on
2886
2743
  if (stoppingSleep || !resourceId)
2887
2744
  return;
2888
2745
  if (!onWakeUpSleep) {
2889
- toast2.error("Unable to wake up sleep", {
2746
+ toast2.error("Failed to wake up run", {
2890
2747
  description: "No wake-up handler provided."
2891
2748
  });
2892
2749
  return;
@@ -2906,7 +2763,7 @@ function EntityDetailPanel({ run, onStreamClick, onRunClick, fetchSpanDetail, on
2906
2763
  } catch (err) {
2907
2764
  console.error("Failed to wake up run:", err);
2908
2765
  toast2.error("Failed to wake up run", {
2909
- description: err instanceof Error ? err.message : "An unknown error occurred"
2766
+ description: err instanceof Error ? err.message : "Try again."
2910
2767
  });
2911
2768
  } finally {
2912
2769
  setStoppingSleep(false);
@@ -2916,14 +2773,14 @@ function EntityDetailPanel({ run, onStreamClick, onRunClick, fetchSpanDetail, on
2916
2773
  if (resolvingHook)
2917
2774
  return;
2918
2775
  if (!onResolveHook) {
2919
- toast2.error("Unable to resolve hook", {
2776
+ toast2.error("Failed to resolve hook", {
2920
2777
  description: "No resolve handler provided."
2921
2778
  });
2922
2779
  return;
2923
2780
  }
2924
2781
  if (!hookToken) {
2925
- toast2.error("Unable to resolve hook", {
2926
- description: "Missing hook token. Try refreshing the run data and retry."
2782
+ toast2.error("Failed to resolve hook", {
2783
+ description: "The hook token is missing. Reload the page, then try again."
2927
2784
  });
2928
2785
  return;
2929
2786
  }
@@ -2942,7 +2799,7 @@ function EntityDetailPanel({ run, onStreamClick, onRunClick, fetchSpanDetail, on
2942
2799
  } catch (err) {
2943
2800
  console.error("Failed to resolve hook:", err);
2944
2801
  toast2.error("Failed to resolve hook", {
2945
- description: err instanceof Error ? err.message : "An unknown error occurred"
2802
+ description: err instanceof Error ? err.message : "Try again."
2946
2803
  });
2947
2804
  } finally {
2948
2805
  setResolvingHook(false);
@@ -2985,20 +2842,19 @@ function EntityDetailPanel({ run, onStreamClick, onRunClick, fetchSpanDetail, on
2985
2842
  isDecryptDisabled,
2986
2843
  decryptDisabledReason,
2987
2844
  hasEncryptedData
2988
- } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto px-4 pb-8", children: [hasPendingActions && jsxRuntimeExports.jsxs("div", { className: "mb-4 flex flex-col gap-2", children: [resource === "sleep" && canWakeUp && jsxRuntimeExports.jsx(Button, { variant: "secondary", size: "small", className: "w-full", onClick: handleWakeUp, loading: stoppingSleep, children: "Wake Up Sleep" }), resource === "hook" && canResolveHook && jsxRuntimeExports.jsx(Button, { variant: "secondary", size: "small", className: "w-full", onClick: () => setShowResolveHookModal(true), loading: resolvingHook, children: "Resolve Hook" })] }), jsxRuntimeExports.jsx(AttributePanel, { data: displayData, moduleSpecifier, moduleSourceUrl, expiredAt: run.expiredAt, isLoading: loading, error: error ?? void 0, onStreamClick, onRunClick, onDecrypt, isDecrypting, isDecryptDisabled, decryptDisabledReason, resource }), rawEvents && jsxRuntimeExports.jsx(EventsList, { events: rawEvents, onLoadEventData, onStreamClick, onRunClick, encryptionKey, showSeparateEventOccurrenceTimestamps, duplicateEventIds: selectedSpan == null ? void 0 : selectedSpan.duplicateEventIds })] }) }), jsxRuntimeExports.jsx(ResolveHookModal, { isOpen: showResolveHookModal, onClose: () => setShowResolveHookModal(false), onSubmit: handleResolveHook, isSubmitting: resolvingHook })] });
2845
+ } : void 0, children: jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto px-4 pb-8", children: [hasPendingActions && jsxRuntimeExports.jsxs("div", { className: "mb-4 flex flex-col gap-2", children: [resource === "sleep" && canWakeUp && jsxRuntimeExports.jsx(Button, { variant: "secondary", size: "small", className: "w-full", onClick: handleWakeUp, loading: stoppingSleep, children: "Wake Up Sleep" }), resource === "hook" && canResolveHook && jsxRuntimeExports.jsx(Button, { variant: "secondary", size: "small", className: "w-full", onClick: () => setShowResolveHookModal(true), loading: resolvingHook, children: "Resolve Hook" })] }), jsxRuntimeExports.jsx(AttributePanel, { data: displayData, moduleSpecifier, moduleSourceUrl, expiredAt: run.expiredAt, isLoading: loading, error: error ?? void 0, onStreamClick, onRunClick, onDecrypt, isDecrypting, isDecryptDisabled, decryptDisabledReason, resource }), rawEvents && jsxRuntimeExports.jsx(EventsList, { events: rawEvents, onLoadEventData, onStreamClick, onRunClick, encryptionKey, showSeparateEventOccurrenceTimestamps, duplicateEventIds: selectedSpan?.duplicateEventIds })] }) }), jsxRuntimeExports.jsx(ResolveHookModal, { isOpen: showResolveHookModal, onClose: () => setShowResolveHookModal(false), onSubmit: handleResolveHook, isSubmitting: resolvingHook })] });
2989
2846
  }
2990
2847
  const DETAIL_PANEL_ID = "trace-detail-panel";
2991
2848
  function useSelectedSpanInfo() {
2992
2849
  const { activeSpan } = useActiveSpan();
2993
2850
  const sidebar = useSidebarData();
2994
2851
  return reactExports.useMemo(() => {
2995
- var _a, _b;
2996
2852
  if (!activeSpan)
2997
2853
  return null;
2998
- const resource = (_a = activeSpan.attributes) == null ? void 0 : _a.resource;
2854
+ const resource = activeSpan.attributes?.resource;
2999
2855
  const rawEvents = filterSpanRawEvents(sidebar.events, resource, activeSpan.spanId);
3000
2856
  return {
3001
- data: (_b = activeSpan.attributes) == null ? void 0 : _b.data,
2857
+ data: activeSpan.attributes?.data,
3002
2858
  resource,
3003
2859
  spanId: activeSpan.spanId,
3004
2860
  rawEvents,
@@ -3012,15 +2868,14 @@ function TraceDetailPanel({ containerRef, onNavigateToSpan, onClose }) {
3012
2868
  const selectedSpan = useSelectedSpanInfo();
3013
2869
  const panelWidth = useDetailPanelWidth(containerRef, Boolean(activeSpan));
3014
2870
  const { prevSpanId, nextSpanId } = reactExports.useMemo(() => {
3015
- var _a, _b;
3016
2871
  if (!activeSpanId)
3017
2872
  return { prevSpanId: null, nextSpanId: null };
3018
2873
  const i = spans.findIndex((s) => s.spanId === activeSpanId);
3019
2874
  if (i === -1)
3020
2875
  return { prevSpanId: null, nextSpanId: null };
3021
2876
  return {
3022
- prevSpanId: ((_a = spans[i - 1]) == null ? void 0 : _a.spanId) ?? null,
3023
- nextSpanId: ((_b = spans[i + 1]) == null ? void 0 : _b.spanId) ?? null
2877
+ prevSpanId: spans[i - 1]?.spanId ?? null,
2878
+ nextSpanId: spans[i + 1]?.spanId ?? null
3024
2879
  };
3025
2880
  }, [activeSpanId, spans]);
3026
2881
  const handleSelectPrev = reactExports.useCallback(() => {
@@ -3032,8 +2887,7 @@ function TraceDetailPanel({ containerRef, onNavigateToSpan, onClose }) {
3032
2887
  onNavigateToSpan(nextSpanId);
3033
2888
  }, [nextSpanId, onNavigateToSpan]);
3034
2889
  const selectedSpanName = reactExports.useMemo(() => {
3035
- var _a, _b;
3036
- if (!(selectedSpan == null ? void 0 : selectedSpan.data))
2890
+ if (!selectedSpan?.data)
3037
2891
  return "Details";
3038
2892
  const data = selectedSpan.data;
3039
2893
  if (selectedSpan.resource === "hook") {
@@ -3041,11 +2895,11 @@ function TraceDetailPanel({ containerRef, onNavigateToSpan, onClose }) {
3041
2895
  }
3042
2896
  const stepName = data.stepName;
3043
2897
  const workflowName = data.workflowName;
3044
- return (stepName ? (_a = parseStepName(stepName)) == null ? void 0 : _a.shortName : void 0) ?? (workflowName ? (_b = parseWorkflowName(workflowName)) == null ? void 0 : _b.shortName : void 0) ?? stepName ?? workflowName ?? data.hookId ?? "Details";
3045
- }, [selectedSpan == null ? void 0 : selectedSpan.data, selectedSpan == null ? void 0 : selectedSpan.resource]);
2898
+ return (stepName ? parseStepName(stepName)?.shortName : void 0) ?? (workflowName ? parseWorkflowName(workflowName)?.shortName : void 0) ?? stepName ?? workflowName ?? data.hookId ?? "Details";
2899
+ }, [selectedSpan?.data, selectedSpan?.resource]);
3046
2900
  if (!activeSpan)
3047
2901
  return null;
3048
- return jsxRuntimeExports.jsx(DetailPanelShell, { id: DETAIL_PANEL_ID, width: panelWidth, title: jsxRuntimeExports.jsx("span", { className: "truncate block", children: selectedSpanName }), itemLabel: "span", onPrev: prevSpanId ? handleSelectPrev : void 0, onNext: nextSpanId ? handleSelectNext : void 0, onClose, children: jsxRuntimeExports.jsx(ErrorBoundary, { children: jsxRuntimeExports.jsx(EntityDetailPanel, { run: sidebar.run, onStreamClick: sidebar.onStreamClick, onRunClick: sidebar.onRunClick, fetchSpanDetail: sidebar.fetchSpanDetail, onWakeUpSleep: sidebar.onWakeUpSleep, onLoadEventData: sidebar.onLoadEventData, onResolveHook: sidebar.onResolveHook, encryptionKey: sidebar.encryptionKey, onDecrypt: sidebar.onDecrypt, isDecrypting: sidebar.isDecrypting, isDecryptDisabled: sidebar.isDecryptDisabled, decryptDisabledReason: sidebar.decryptDisabledReason, selectedSpan, showSeparateEventOccurrenceTimestamps: sidebar.showSeparateEventOccurrenceTimestamps, getModuleSourceUrl: sidebar.getModuleSourceUrl }) }) });
2902
+ return jsxRuntimeExports.jsx(DetailPanelShell, { id: DETAIL_PANEL_ID, width: panelWidth, title: jsxRuntimeExports.jsx("span", { className: "truncate block", children: selectedSpanName }), itemLabel: "span", onPrev: prevSpanId ? handleSelectPrev : void 0, onNext: nextSpanId ? handleSelectNext : void 0, onClose, children: jsxRuntimeExports.jsx(ErrorBoundary, { title: "Failed to load span details", children: jsxRuntimeExports.jsx(EntityDetailPanel, { run: sidebar.run, onStreamClick: sidebar.onStreamClick, onRunClick: sidebar.onRunClick, fetchSpanDetail: sidebar.fetchSpanDetail, onWakeUpSleep: sidebar.onWakeUpSleep, onLoadEventData: sidebar.onLoadEventData, onResolveHook: sidebar.onResolveHook, encryptionKey: sidebar.encryptionKey, onDecrypt: sidebar.onDecrypt, isDecrypting: sidebar.isDecrypting, isDecryptDisabled: sidebar.isDecryptDisabled, decryptDisabledReason: sidebar.decryptDisabledReason, selectedSpan, showSeparateEventOccurrenceTimestamps: sidebar.showSeparateEventOccurrenceTimestamps, getModuleSourceUrl: sidebar.getModuleSourceUrl }) }) });
3049
2903
  }
3050
2904
  const GUTTER_PX = 1;
3051
2905
  const MIN_PX = 50;
@@ -3085,7 +2939,7 @@ function SplitPane({ children, className, startHeader, endHeader, scrollContaine
3085
2939
  return jsxRuntimeExports.jsxs("div", { className: cn("relative flex flex-col h-full min-h-0", className), children: [jsxRuntimeExports.jsxs("div", { className: "shrink-0 grid", style: { gridTemplateColumns: colTemplate }, children: [jsxRuntimeExports.jsx("div", { children: startHeader }), jsxRuntimeExports.jsx("div", { className: "flex justify-center", children: jsxRuntimeExports.jsx("span", { className: "h-full w-px bg-gray-alpha-400", "aria-hidden": true }) }), jsxRuntimeExports.jsx("div", { children: endHeader })] }), jsxRuntimeExports.jsxs("div", { ref: setContainerRef, className: "grid flex-1 min-h-0 overflow-x-hidden overflow-y-auto", style: { gridTemplateColumns: colTemplate }, children: [jsxRuntimeExports.jsx("div", { ref: startRef, id: SPLIT_PANE_START_ID, className: "min-w-0", children: start }), jsxRuntimeExports.jsxs("div", { className: "relative z-20 isolate flex shrink-0 justify-center", children: [jsxRuntimeExports.jsx("span", { className: "pointer-events-none relative z-10 h-full w-px shrink-0 bg-gray-alpha-400", "aria-hidden": true }), jsxRuntimeExports.jsx(DraggableBorder, { element: startRef, position: "right", onWidthChange: handleWidthChange, onReset: handleReset, "aria-label": "Resize event list", "aria-controls": SPLIT_PANE_START_ID, "aria-valuemin": MIN_PX, "aria-valuemax": maxStartPx, "aria-valuenow": Math.min(Math.max(Math.round(effectiveStartPx), MIN_PX), maxStartPx) })] }), end] }), jsxRuntimeExports.jsxs("div", { className: "pointer-events-none absolute inset-x-0 bottom-3 z-[5] grid", style: { gridTemplateColumns: colTemplate }, children: [jsxRuntimeExports.jsx("div", {}), jsxRuntimeExports.jsx("div", {}), jsxRuntimeExports.jsx("div", { className: "flex min-w-0 items-center justify-between gap-3 pl-4 pr-3", children: endOverlay })] })] });
3086
2940
  }
3087
2941
  const hint = "_hint_1dmsq_3";
3088
- const styles = {
2942
+ const styles$1 = {
3089
2943
  hint
3090
2944
  };
3091
2945
  const DISMISSALS_KEY = "workflow-step-shortcut-helper-dismissals";
@@ -3133,8 +2987,12 @@ function TraceShortcutHelper({ hasMultipleSpans, reducedMotion }) {
3133
2987
  }
3134
2988
  setVisible(false);
3135
2989
  };
3136
- return jsxRuntimeExports.jsxs("div", { className: "group pointer-events-auto hidden h-8 w-fit items-center gap-1 text-label-12 leading-none text-gray-900 @min-[480px]:flex", children: [jsxRuntimeExports.jsx("span", { "aria-live": "polite", "aria-atomic": "true", className: "inline-flex items-center whitespace-nowrap", children: reducedMotion ? jsxRuntimeExports.jsx(AltHint, {}) : jsxRuntimeExports.jsx("span", { className: `inline-flex items-center ${styles.hint}`, children: index === 0 ? jsxRuntimeExports.jsx(AltHint, {}) : jsxRuntimeExports.jsx(NavHint, {}) }, index) }), jsxRuntimeExports.jsx("button", { type: "button", className: "inline-flex h-5 w-5 items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 motion-reduce:transition-none", onClick: dismiss, "aria-label": "Dismiss trace shortcuts helper", children: jsxRuntimeExports.jsx(X, { className: "h-3 w-3" }) })] });
2990
+ return jsxRuntimeExports.jsxs("div", { className: "group pointer-events-auto hidden h-8 w-fit items-center gap-1 text-label-12 leading-none text-gray-900 @min-[480px]:flex", children: [jsxRuntimeExports.jsx("span", { "aria-live": "polite", "aria-atomic": "true", className: "inline-flex items-center whitespace-nowrap", children: reducedMotion ? jsxRuntimeExports.jsx(AltHint, {}) : jsxRuntimeExports.jsx("span", { className: `inline-flex items-center ${styles$1.hint}`, children: index === 0 ? jsxRuntimeExports.jsx(AltHint, {}) : jsxRuntimeExports.jsx(NavHint, {}) }, index) }), jsxRuntimeExports.jsx("button", { type: "button", className: "inline-flex h-5 w-5 items-center justify-center rounded text-gray-900 opacity-0 transition-opacity hover:bg-gray-alpha-100 hover:text-gray-1000 group-hover:opacity-100 focus-visible:opacity-100 motion-reduce:transition-none", onClick: dismiss, "aria-label": "Dismiss trace shortcuts helper", children: jsxRuntimeExports.jsx(X, { className: "h-3 w-3" }) })] });
3137
2991
  }
2992
+ const landing = "_landing_bcyo3_16";
2993
+ const styles = {
2994
+ landing
2995
+ };
3138
2996
  const MIN_VIEWPORT_MS = 1e-3;
3139
2997
  const ZOOM_DEBOUNCE_MS = 150;
3140
2998
  function useAnimatedViewport(initial) {
@@ -3190,7 +3048,7 @@ function useAnimatedViewport(initial) {
3190
3048
  return { viewport, setViewport, animateTo };
3191
3049
  }
3192
3050
  function TraceViewer$1({ trace, onLoadMore, hasMore, isLoadingMore, initialSelectedSpanId }) {
3193
- return jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: jsxRuntimeExports.jsx(ActiveSpanProvider, { spans: trace.spans, initialSelectedSpanId, children: jsxRuntimeExports.jsx(TraceViewerContent, { trace, onLoadMore, hasMore, isLoadingMore }) }) });
3051
+ return jsxRuntimeExports.jsx(TooltipProvider, { children: jsxRuntimeExports.jsx(ActiveSpanProvider, { spans: trace.spans, initialSelectedSpanId, children: jsxRuntimeExports.jsx(TraceViewerContent, { trace, onLoadMore, hasMore, isLoadingMore }) }) });
3194
3052
  }
3195
3053
  function TraceViewerContent({ trace, onLoadMore, hasMore, isLoadingMore }) {
3196
3054
  const { activeSpanId, setActiveSpan, clearActiveSpan } = useActiveSpan();
@@ -3207,7 +3065,7 @@ function TraceViewerContent({ trace, onLoadMore, hasMore, isLoadingMore }) {
3207
3065
  const root = reactExports.useMemo(() => computeRootBounds(trace.spans), [trace.spans]);
3208
3066
  const scrollContainerRef = reactExports.useRef(null);
3209
3067
  const loadMore = reactExports.useCallback(() => {
3210
- void (onLoadMore == null ? void 0 : onLoadMore());
3068
+ void onLoadMore?.();
3211
3069
  }, [onLoadMore]);
3212
3070
  const loadMoreSentinelRef = useLoadMoreOnScroll(loadMore, {
3213
3071
  hasMore: Boolean(onLoadMore && hasMore),
@@ -3294,11 +3152,10 @@ function TraceViewerContent({ trace, onLoadMore, hasMore, isLoadingMore }) {
3294
3152
  clampToRoot
3295
3153
  ]);
3296
3154
  const scrollSpanIntoView = reactExports.useCallback((spanId) => {
3297
- var _a;
3298
3155
  const index = trace.spans.findIndex((s) => s.spanId === spanId);
3299
3156
  if (index === -1)
3300
3157
  return;
3301
- const list = ((_a = scrollContainerRef.current) == null ? void 0 : _a.querySelector("#event-list")) ?? null;
3158
+ const list = scrollContainerRef.current?.querySelector("#event-list") ?? null;
3302
3159
  scrollRowIntoView(list, index, ROW_HEIGHT_PX, {
3303
3160
  behavior: reducedMotion ? "auto" : "smooth"
3304
3161
  });
@@ -3406,11 +3263,11 @@ function TraceViewerContent({ trace, onLoadMore, hasMore, isLoadingMore }) {
3406
3263
  el.addEventListener("wheel", onWheel, { passive: false });
3407
3264
  return () => el.removeEventListener("wheel", onWheel);
3408
3265
  }, [root.duration, setViewport, clampToRoot]);
3409
- return jsxRuntimeExports.jsxs("div", { ref: paneRootRef, "data-pane": "pane-root", className: "relative flex w-full h-full max-h-full", children: [jsxRuntimeExports.jsxs("div", { id: "trace-parent", "data-span-landing": isLanding || void 0, className: "@container flex-1 min-w-0 grid grid-rows-[auto_1fr] h-full min-h-0 overflow-hidden relative bg-background-100", children: [jsxRuntimeExports.jsx(Minimap, { spans: trace.spans, root, viewport, minViewportMs: MIN_VIEWPORT_MS, onViewportChange: setViewport, onAnimateTo: animateTo }), jsxRuntimeExports.jsxs(SplitPane, { scrollContainerRef, startHeader: jsxRuntimeExports.jsx(SearchInput, { id: "trace-viewer-search", name: "trace-viewer-search", label: "Search spans", placeholder: "Search spans…", value: searchQuery, onValueChange: setSearchQuery, className: "pl-4" }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { markers: timeMarkers, hoverInfo }), children: [jsxRuntimeExports.jsxs("div", { className: "block overflow-visible", children: [jsxRuntimeExports.jsx(EventList, { spans: trace.spans, activeSpanId, searchResult, onSelectSpan: handleSelectSpan }), jsxRuntimeExports.jsx("div", { ref: loadMoreSentinelRef, className: "flex justify-center", children: isLoadingMore ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-label-14 text-gray-800", children: [jsxRuntimeExports.jsx(Spinner, { size: "md" }), jsxRuntimeExports.jsx("span", { children: "Loading spans…" })] }) : null })] }), jsxRuntimeExports.jsx("div", { ref: timelineRef, id: "trace-timeline", className: "@container block min-h-0 overflow-visible relative", onDoubleClick: resetZoom, onMouseMove: handleTimelineMouseMove, onMouseLeave: handleTimelineMouseLeave, children: jsxRuntimeExports.jsx(Timeline, { spans: trace.spans, viewStart: viewport.start, viewEnd: viewport.end, markers: timeMarkers, selectedId: activeSpanId, searchResult, onSelect: handleSelectSpan, onRevealTime: handleRevealTime, hover, altHeld }) }), jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TraceShortcutHelper, { hasMultipleSpans: trace.spans.length > 1, reducedMotion }), jsxRuntimeExports.jsxs("div", { className: "pointer-events-auto flex items-center border border-gray-alpha-400 rounded-md bg-background-100 shadow-sm overflow-hidden divide-x divide-gray-alpha-400", children: [jsxRuntimeExports.jsx(IconButton, { size: "small", onClick: zoomOut, disabled: isAtMinZoom, "aria-label": "Zoom out", children: jsxRuntimeExports.jsx(ZoomOut, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx(IconButton, { size: "small", onClick: resetZoom, "aria-label": "Reset zoom", children: jsxRuntimeExports.jsx(RotateCcw, { className: "w-3.5 h-3.5" }) }), jsxRuntimeExports.jsx(IconButton, { size: "small", onClick: zoomIn, disabled: isAtMaxZoom, "aria-label": "Zoom in", children: jsxRuntimeExports.jsx(ZoomIn, { className: "w-4 h-4" }) })] })] })] })] }), jsxRuntimeExports.jsx(TraceDetailPanel, { containerRef: paneRootRef, onNavigateToSpan: navigateToSpan, onClose: handleClearActiveSpan })] });
3266
+ return jsxRuntimeExports.jsxs("div", { ref: paneRootRef, "data-pane": "pane-root", className: "relative flex w-full h-full max-h-full", children: [jsxRuntimeExports.jsxs("div", { id: "trace-parent", className: cn("@container flex-1 min-w-0 grid grid-rows-[auto_1fr] h-full min-h-0 overflow-hidden relative bg-background-100", isLanding && styles.landing), children: [jsxRuntimeExports.jsx(Minimap, { spans: trace.spans, root, viewport, minViewportMs: MIN_VIEWPORT_MS, onViewportChange: setViewport, onAnimateTo: animateTo }), jsxRuntimeExports.jsxs(SplitPane, { scrollContainerRef, startHeader: jsxRuntimeExports.jsx(SearchInput, { id: "trace-viewer-search", name: "trace-viewer-search", label: "Search spans", placeholder: "Search spans…", value: searchQuery, onValueChange: setSearchQuery, className: "pl-4" }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { markers: timeMarkers, hoverInfo }), children: [jsxRuntimeExports.jsxs("div", { className: "block overflow-visible", children: [jsxRuntimeExports.jsx(EventList, { spans: trace.spans, activeSpanId, searchResult, onSelectSpan: handleSelectSpan }), jsxRuntimeExports.jsx("div", { ref: loadMoreSentinelRef, className: "flex justify-center", children: isLoadingMore ? jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-label-14 text-gray-800", children: [jsxRuntimeExports.jsx(Spinner, { size: "md" }), jsxRuntimeExports.jsx("span", { children: "Loading spans…" })] }) : null })] }), jsxRuntimeExports.jsx("div", { ref: timelineRef, id: "trace-timeline", className: "@container block min-h-0 overflow-visible relative", onDoubleClick: resetZoom, onMouseMove: handleTimelineMouseMove, onMouseLeave: handleTimelineMouseLeave, children: jsxRuntimeExports.jsx(Timeline, { spans: trace.spans, viewStart: viewport.start, viewEnd: viewport.end, markers: timeMarkers, selectedId: activeSpanId, searchResult, onSelect: handleSelectSpan, onRevealTime: handleRevealTime, hover, altHeld }) }), jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TraceShortcutHelper, { hasMultipleSpans: trace.spans.length > 1, reducedMotion }), jsxRuntimeExports.jsxs("div", { className: "pointer-events-auto flex items-center border border-gray-alpha-400 rounded-md bg-background-100 shadow-sm overflow-hidden divide-x divide-gray-alpha-400", children: [jsxRuntimeExports.jsx(IconButton, { size: "small", onClick: zoomOut, disabled: isAtMinZoom, "aria-label": "Zoom out", children: jsxRuntimeExports.jsx(ZoomOut, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx(IconButton, { size: "small", onClick: resetZoom, "aria-label": "Reset zoom", children: jsxRuntimeExports.jsx(RotateCcw, { className: "w-3.5 h-3.5" }) }), jsxRuntimeExports.jsx(IconButton, { size: "small", onClick: zoomIn, disabled: isAtMaxZoom, "aria-label": "Zoom in", children: jsxRuntimeExports.jsx(ZoomIn, { className: "w-4 h-4" }) })] })] })] })] }), jsxRuntimeExports.jsx(TraceDetailPanel, { containerRef: paneRootRef, onNavigateToSpan: navigateToSpan, onClose: handleClearActiveSpan })] });
3410
3267
  }
3411
3268
  const TraceViewer = ({ run, events, sidebarData, onLoadMore, hasMore, isLoadingMore, loading = false, getStepAttributes, initialSelectedSpanId }) => {
3412
3269
  const trace = reactExports.useMemo(() => {
3413
- if (!(run == null ? void 0 : run.runId)) {
3270
+ if (!run?.runId) {
3414
3271
  return void 0;
3415
3272
  }
3416
3273
  return buildTrace(run, events, /* @__PURE__ */ new Date(), {
@@ -3418,7 +3275,7 @@ const TraceViewer = ({ run, events, sidebarData, onLoadMore, hasMore, isLoadingM
3418
3275
  getStepAttributes
3419
3276
  });
3420
3277
  }, [run, events, hasMore, getStepAttributes]);
3421
- const sidebarValue = reactExports.useMemo(() => ({ ...sidebarData, duplicateEventIds: trace == null ? void 0 : trace.duplicateEventIds }), [sidebarData, trace]);
3278
+ const sidebarValue = reactExports.useMemo(() => ({ ...sidebarData, duplicateEventIds: trace?.duplicateEventIds }), [sidebarData, trace]);
3422
3279
  if (!trace || loading && events.length === 0) {
3423
3280
  return jsxRuntimeExports.jsx(TraceViewerSkeleton, {});
3424
3281
  }
@@ -3430,8 +3287,8 @@ const DOCS_BASE_URL = "https://workflow-sdk.dev/err";
3430
3287
  function readVmPolicy(run) {
3431
3288
  const ctx = run.executionContext && typeof run.executionContext === "object" ? run.executionContext : void 0;
3432
3289
  return {
3433
- workflowVm: run.workflowVm ?? (ctx == null ? void 0 : ctx.workflowVm),
3434
- snapshotThreshold: run.snapshotThreshold ?? (ctx == null ? void 0 : ctx.snapshotThreshold)
3290
+ workflowVm: run.workflowVm ?? ctx?.workflowVm,
3291
+ snapshotThreshold: run.snapshotThreshold ?? ctx?.snapshotThreshold
3435
3292
  };
3436
3293
  }
3437
3294
  function isQuickJSSnapshotRun(run) {
@@ -3518,7 +3375,7 @@ function createRunStateHydrator(options) {
3518
3375
  for (let pages = 0; pages < MAX_PAGES; pages++) {
3519
3376
  const page = await options.loadEvents(current.cursor);
3520
3377
  for (const event of page.data) {
3521
- const id = event == null ? void 0 : event.eventId;
3378
+ const id = event?.eventId;
3522
3379
  if (typeof id === "string") {
3523
3380
  if (current.seen.has(id))
3524
3381
  continue;
@@ -3740,7 +3597,7 @@ function useWorkflowTraceViewerData(env, runId, options = {}) {
3740
3597
  }
3741
3598
  if (!runResult.error) {
3742
3599
  const ctx = runResult.result.executionContext;
3743
- if ((ctx == null ? void 0 : ctx.features) && ctx.features.encryption) {
3600
+ if (ctx?.features && ctx.features.encryption) {
3744
3601
  setHasEncryptedData(true);
3745
3602
  } else {
3746
3603
  unwrapServerActionResult(
@@ -3804,7 +3661,7 @@ function useWorkflowTraceViewerData(env, runId, options = {}) {
3804
3661
  loadMoreTraceData();
3805
3662
  }, [events.length, loadMoreTraceData]);
3806
3663
  const pollRun = reactExports.useCallback(async () => {
3807
- if (run == null ? void 0 : run.completedAt) {
3664
+ if (run?.completedAt) {
3808
3665
  return false;
3809
3666
  }
3810
3667
  const { error: error2, result } = await unwrapServerActionResult(
@@ -3817,7 +3674,7 @@ function useWorkflowTraceViewerData(env, runId, options = {}) {
3817
3674
  setError(null);
3818
3675
  setRun(hydrateResourceIO(result));
3819
3676
  return true;
3820
- }, [env, runId, run == null ? void 0 : run.completedAt]);
3677
+ }, [env, runId, run?.completedAt]);
3821
3678
  const pollEvents = reactExports.useCallback(
3822
3679
  () => pollResource({
3823
3680
  fetchFn: () => unwrapServerActionResult(
@@ -3859,7 +3716,7 @@ function useWorkflowTraceViewerData(env, runId, options = {}) {
3859
3716
  };
3860
3717
  }, []);
3861
3718
  reactExports.useEffect(() => {
3862
- if (!live || !initialLoadCompleted || (run == null ? void 0 : run.completedAt)) {
3719
+ if (!live || !initialLoadCompleted || run?.completedAt) {
3863
3720
  return;
3864
3721
  }
3865
3722
  const interval = setInterval(() => {
@@ -3868,7 +3725,7 @@ function useWorkflowTraceViewerData(env, runId, options = {}) {
3868
3725
  return () => {
3869
3726
  clearInterval(interval);
3870
3727
  };
3871
- }, [live, initialLoadCompleted, update, run == null ? void 0 : run.completedAt]);
3728
+ }, [live, initialLoadCompleted, update, run?.completedAt]);
3872
3729
  return {
3873
3730
  run: run ?? {},
3874
3731
  events,
@@ -3976,8 +3833,7 @@ const PAGE_SIZE = 100;
3976
3833
  const MAX_CORRELATION_SEARCH_PAGES = 5;
3977
3834
  const getEventId = (event) => event.eventId;
3978
3835
  function toSearchFailure(error) {
3979
- var _a;
3980
- return ((_a = error.request) == null ? void 0 : _a.status) === 404 ? { status: "not_found" } : { status: "error", message: getErrorMessage(error) };
3836
+ return error.request?.status === 404 ? { status: "not_found" } : { status: "error", message: getErrorMessage(error) };
3981
3837
  }
3982
3838
  function useEventsListData(env, runId, options = {}) {
3983
3839
  const { sortOrder = "asc", encryptionKey } = options;
@@ -4006,7 +3862,7 @@ function useEventsListData(env, runId, options = {}) {
4006
3862
  );
4007
3863
  const searchByExactId = reactExports.useCallback(
4008
3864
  async (id, kind, signal) => {
4009
- if (signal == null ? void 0 : signal.aborted) {
3865
+ if (signal?.aborted) {
4010
3866
  throw new DOMException("Aborted", "AbortError");
4011
3867
  }
4012
3868
  if (kind === "event") {
@@ -4016,18 +3872,18 @@ function useEventsListData(env, runId, options = {}) {
4016
3872
  if (fetchError) {
4017
3873
  return toSearchFailure(fetchError);
4018
3874
  }
4019
- if (signal == null ? void 0 : signal.aborted) {
3875
+ if (signal?.aborted) {
4020
3876
  throw new DOMException("Aborted", "AbortError");
4021
3877
  }
4022
3878
  const [event] = await hydrateEvents([result]);
4023
- return (event == null ? void 0 : event.runId) === runId ? { status: "ok", events: [event] } : { status: "not_found" };
3879
+ return event?.runId === runId ? { status: "ok", events: [event] } : { status: "not_found" };
4024
3880
  }
4025
3881
  const matched = [];
4026
3882
  let nextCursor;
4027
3883
  let pagesFetched = 0;
4028
3884
  let truncated = false;
4029
3885
  do {
4030
- if (signal == null ? void 0 : signal.aborted) {
3886
+ if (signal?.aborted) {
4031
3887
  throw new DOMException("Aborted", "AbortError");
4032
3888
  }
4033
3889
  const { error: fetchError, result } = await unwrapServerActionResult(
@@ -4042,7 +3898,7 @@ function useEventsListData(env, runId, options = {}) {
4042
3898
  if (fetchError) {
4043
3899
  return toSearchFailure(fetchError);
4044
3900
  }
4045
- if (signal == null ? void 0 : signal.aborted) {
3901
+ if (signal?.aborted) {
4046
3902
  throw new DOMException("Aborted", "AbortError");
4047
3903
  }
4048
3904
  pagesFetched += 1;
@@ -4168,9 +4024,8 @@ var AlertDialogContent$1 = reactExports.forwardRef(
4168
4024
  ...contentProps,
4169
4025
  ref: composedRefs,
4170
4026
  onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
4171
- var _a;
4172
4027
  event.preventDefault();
4173
- (_a = cancelRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
4028
+ cancelRef.current?.focus({ preventScroll: true });
4174
4029
  }),
4175
4030
  onPointerDownOutside: (event) => event.preventDefault(),
4176
4031
  onInteractOutside: (event) => event.preventDefault(),
@@ -4251,7 +4106,7 @@ function AlertDialogContent({
4251
4106
  ),
4252
4107
  onSubmit: (e) => {
4253
4108
  e.preventDefault();
4254
- onSubmit == null ? void 0 : onSubmit(e);
4109
+ onSubmit?.(e);
4255
4110
  },
4256
4111
  ...props
4257
4112
  }
@@ -4413,12 +4268,11 @@ function BreadcrumbSeparator({
4413
4268
  );
4414
4269
  }
4415
4270
  function getCancellationReason(events) {
4416
- var _a, _b;
4417
4271
  if (!events) return void 0;
4418
4272
  for (let index = events.length - 1; index >= 0; index -= 1) {
4419
4273
  const event = events[index];
4420
4274
  if (event.eventType !== "run_cancelled") continue;
4421
- const reason = (_b = (_a = event.eventData) == null ? void 0 : _a.cancelReason) == null ? void 0 : _b.trim();
4275
+ const reason = event.eventData?.cancelReason?.trim();
4422
4276
  if (reason) return reason;
4423
4277
  }
4424
4278
  return void 0;
@@ -4504,7 +4358,7 @@ function useRunUsage(env, runId, {
4504
4358
  if (enabled && wasLive && !live) void read();
4505
4359
  }, [enabled, live, read]);
4506
4360
  const unsupported = usage === null;
4507
- const polling = live || (usage == null ? void 0 : usage.inProgress) === true;
4361
+ const polling = live || usage?.inProgress === true;
4508
4362
  reactExports.useEffect(() => {
4509
4363
  if (!enabled || !polling || unsupported) return;
4510
4364
  if (!refreshInterval || refreshInterval <= 0) return;
@@ -4562,9 +4416,8 @@ function concatBytes(parts) {
4562
4416
  return joined;
4563
4417
  }
4564
4418
  function hasSameImageBytes(previous, next) {
4565
- var _a, _b;
4566
- const before = (_a = previous[0]) == null ? void 0 : _a.value;
4567
- const after = (_b = next[0]) == null ? void 0 : _b.value;
4419
+ const before = previous[0]?.value;
4420
+ const after = next[0]?.value;
4568
4421
  return previous.length === 1 && next.length === 1 && before instanceof Uint8Array && after instanceof Uint8Array && before.length === after.length && before.every((byte, index) => byte === after[index]);
4569
4422
  }
4570
4423
  function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
@@ -4654,9 +4507,9 @@ function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
4654
4507
  streamId,
4655
4508
  runId,
4656
4509
  abortController.signal,
4657
- isImageStream ? void 0 : (options == null ? void 0 : options.cursor) ?? void 0
4510
+ isImageStream ? void 0 : options?.cursor ?? void 0
4658
4511
  );
4659
- const skipFrames = isImageStream ? 0 : (options == null ? void 0 : options.skipFrames) ?? 0;
4512
+ const skipFrames = isImageStream ? 0 : options?.skipFrames ?? 0;
4660
4513
  const reader = streamResponse.body.getReader();
4661
4514
  const decoder = new TextDecoder();
4662
4515
  let buffer = new Uint8Array(0);
@@ -4680,7 +4533,7 @@ function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
4680
4533
  if (encoding === "legacy") textRemainder = decoder.decode(buffer);
4681
4534
  }
4682
4535
  if (encoding === "image") {
4683
- imageChunkId ?? (imageChunkId = chunkIdRef.current++);
4536
+ imageChunkId ??= chunkIdRef.current++;
4684
4537
  frameIndex++;
4685
4538
  targetBuffer.push({
4686
4539
  id: imageChunkId,
@@ -4780,7 +4633,7 @@ function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
4780
4633
  }
4781
4634
  buffer = buffer.slice(offset);
4782
4635
  }
4783
- isImageStream || (isImageStream = encoding === "image");
4636
+ isImageStream ||= encoding === "image";
4784
4637
  return {
4785
4638
  encrypted: false,
4786
4639
  image: isImageStream,
@@ -4876,26 +4729,6 @@ function useStreamReader(env, streamId, runId, encryptionKey, runStatus) {
4876
4729
  }, [runStatus]);
4877
4730
  return { chunks, isLive, isInitialLoading, error };
4878
4731
  }
4879
- function LiveStatus({ hasError, errorMessage }) {
4880
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
4881
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5", children: [
4882
- /* @__PURE__ */ jsxRuntimeExports.jsx(
4883
- "div",
4884
- {
4885
- className: `w-2 h-2 rounded-full ${hasError ? "bg-red-500" : "bg-green-500 animate-pulse"}`
4886
- }
4887
- ),
4888
- /* @__PURE__ */ jsxRuntimeExports.jsx(
4889
- "span",
4890
- {
4891
- className: `text-xs ${hasError ? "text-red-600" : "text-muted-foreground"}`,
4892
- children: hasError ? "Error" : "Live"
4893
- }
4894
- )
4895
- ] }) }),
4896
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: hasError ? `Error updating data: ${errorMessage}` : `Content updates every ${LIVE_UPDATE_INTERVAL_MS$1 / 1e3} seconds` }) })
4897
- ] }) });
4898
- }
4899
4732
  ({
4900
4733
  ...LAYOUT
4901
4734
  });
@@ -4905,7 +4738,7 @@ const RUN_TABS = [
4905
4738
  { value: "streams", label: "Streams" }
4906
4739
  ];
4907
4740
  function focusRunViewItem(root, item) {
4908
- const target = root == null ? void 0 : root.querySelector(
4741
+ const target = root?.querySelector(
4909
4742
  `[data-run-view-item="${item}"]:is([aria-current="page"], [data-state="active"])`
4910
4743
  );
4911
4744
  if (!(target instanceof HTMLElement)) return false;
@@ -4920,25 +4753,22 @@ function UsageNavLink({
4920
4753
  current = false,
4921
4754
  onNavigate
4922
4755
  }) {
4923
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
4756
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
4924
4757
  Link,
4925
4758
  {
4926
4759
  to: runUsagePath(runId),
4927
- className: cn(tabsTriggerClassName, "gap-2"),
4760
+ className: tabsTriggerClassName,
4928
4761
  "aria-current": current ? "page" : void 0,
4929
4762
  "data-testid": "run-usage-nav-link",
4930
4763
  "data-run-view-item": "usage",
4931
- onClick: () => onNavigate == null ? void 0 : onNavigate("usage"),
4932
- children: [
4933
- /* @__PURE__ */ jsxRuntimeExports.jsx(ChartColumn, { className: "h-4 w-4", "aria-hidden": "true" }),
4934
- "Usage"
4935
- ]
4764
+ onClick: () => onNavigate?.("usage"),
4765
+ children: "Usage"
4936
4766
  }
4937
4767
  );
4938
4768
  }
4939
4769
  const RUN_VIEW_ROW_CLASS = cn(
4940
4770
  tabsListClassName,
4941
- "mb-4 max-w-full flex-none max-sm:[&_svg]:hidden"
4771
+ "mb-4 max-w-full flex-none"
4942
4772
  );
4943
4773
  function RunViewNav({
4944
4774
  runId,
@@ -4946,17 +4776,14 @@ function RunViewNav({
4946
4776
  onNavigate
4947
4777
  }) {
4948
4778
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("nav", { "aria-label": "Run views", className: RUN_VIEW_ROW_CLASS, children: [
4949
- RUN_TABS.map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
4779
+ RUN_TABS.map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsx(
4950
4780
  Link,
4951
4781
  {
4952
4782
  to: runTabPath(runId, tab.value),
4953
- className: cn(tabsTriggerClassName, "gap-2"),
4783
+ className: tabsTriggerClassName,
4954
4784
  "data-run-view-item": tab.value,
4955
- onClick: () => onNavigate == null ? void 0 : onNavigate(tab.value),
4956
- children: [
4957
- /* @__PURE__ */ jsxRuntimeExports.jsx(List, { className: "h-4 w-4", "aria-hidden": "true" }),
4958
- tab.label
4959
- ]
4785
+ onClick: () => onNavigate?.(tab.value),
4786
+ children: tab.label
4960
4787
  },
4961
4788
  tab.value
4962
4789
  )),
@@ -4967,7 +4794,6 @@ function RunDetailView({
4967
4794
  runId,
4968
4795
  selectedId: _selectedId
4969
4796
  }) {
4970
- var _a, _b;
4971
4797
  const navigate = useNavigate();
4972
4798
  const [searchParams, updateSearchParams] = useOptimisticSearchParams();
4973
4799
  const { serverConfig } = useServerConfig();
@@ -5167,7 +4993,7 @@ function RunDetailView({
5167
4993
  setCancelling(false);
5168
4994
  }
5169
4995
  };
5170
- const isDynamicRun = Boolean((_a = run.executionContext) == null ? void 0 : _a.dynamicWorkflow);
4996
+ const isDynamicRun = Boolean(run.executionContext?.dynamicWorkflow);
5171
4997
  const handleRerunClick = () => {
5172
4998
  if (isDynamicRun) return;
5173
4999
  setShowRerunDialog(true);
@@ -5199,9 +5025,7 @@ function RunDetailView({
5199
5025
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: getErrorMessage(error) })
5200
5026
  ] });
5201
5027
  }
5202
- const workflowName = (_b = parseWorkflowName(run.workflowName)) == null ? void 0 : _b.shortName;
5203
- const hasError = false;
5204
- const errorMessage = "";
5028
+ const workflowName = parseWorkflowName(run.workflowName)?.shortName;
5205
5029
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
5206
5030
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialog, { open: showCancelDialog, onOpenChange: setShowCancelDialog, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { children: [
5207
5031
  /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogHeader, { children: [
@@ -5249,27 +5073,24 @@ function RunDetailView({
5249
5073
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 p-6 border rounded-lg", children: [
5250
5074
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-2", children: [
5251
5075
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-xl font-semibold", children: workflowName ? workflowName : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "w-[260px] h-[28px]" }) }) }),
5252
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
5253
- /* @__PURE__ */ jsxRuntimeExports.jsx(LiveStatus, { hasError, errorMessage }),
5254
- /* @__PURE__ */ jsxRuntimeExports.jsx(
5255
- RunActionsButtons,
5256
- {
5257
- env,
5258
- runId,
5259
- runStatus: run.status,
5260
- events: allEvents,
5261
- eventsLoading: loading,
5262
- loading,
5263
- replayDisabledReason: isDynamicRun ? "Dynamic runs cannot be replayed as a new run." : void 0,
5264
- onRerunClick: handleRerunClick,
5265
- onCancelClick: handleCancelClick,
5266
- callbacks: { onSuccess: update }
5267
- }
5268
- )
5269
- ] })
5076
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
5077
+ RunActionsButtons,
5078
+ {
5079
+ env,
5080
+ runId,
5081
+ runStatus: run.status,
5082
+ events: allEvents,
5083
+ eventsLoading: loading,
5084
+ loading,
5085
+ replayDisabledReason: isDynamicRun ? "Dynamic runs cannot be replayed as a new run." : void 0,
5086
+ onRerunClick: handleRerunClick,
5087
+ onCancelClick: handleCancelClick,
5088
+ callbacks: { onSuccess: update }
5089
+ }
5090
+ ) })
5270
5091
  ] }),
5271
5092
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-start gap-x-8 gap-y-4", children: [
5272
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
5093
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1 min-w-[76px]", children: [
5273
5094
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Status" }),
5274
5095
  run.status ? /* @__PURE__ */ jsxRuntimeExports.jsx(
5275
5096
  StatusBadge,
@@ -5277,7 +5098,7 @@ function RunDetailView({
5277
5098
  status: run.status,
5278
5099
  context: { error: run.error, cancelReason }
5279
5100
  }
5280
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "w-[55px] h-[24px]" })
5101
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-4" })
5281
5102
  ] }),
5282
5103
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
5283
5104
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Duration" }),
@@ -5293,23 +5114,23 @@ function RunDetailView({
5293
5114
  const hours = Math.floor(minutes / 60);
5294
5115
  const remainingMinutes = minutes % 60;
5295
5116
  return remainingMinutes > 0 ? `${hours}h ${remainingMinutes}m` : `${hours}h`;
5296
- })() : "-" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "w-[60px] h-[20px]" }) })
5117
+ })() : "-" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-4" }) })
5297
5118
  ] }),
5298
5119
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
5299
5120
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Run ID" }),
5300
- run.runId ? /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: run.runId, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs mt-0.5 font-mono", children: run.runId }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "w-[280px] h-[20px]" })
5121
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CopyableText, { text: runId, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs mt-0.5 font-mono", children: runId }) })
5301
5122
  ] }),
5302
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
5123
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1 min-w-[104px]", children: [
5303
5124
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Queued" }),
5304
- run.createdAt ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.createdAt }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "w-[110px] h-[20px]" })
5125
+ run.createdAt ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.createdAt }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-4" })
5305
5126
  ] }),
5306
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
5127
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1 min-w-[104px]", children: [
5307
5128
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Started" }),
5308
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs", children: run.runId ? run.startedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.startedAt }) : "-" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "w-[110px] h-[20px]" }) })
5129
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs", children: run.runId ? run.startedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.startedAt }) : "-" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-4" }) })
5309
5130
  ] }),
5310
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
5131
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1 min-w-[104px]", children: [
5311
5132
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Completed" }),
5312
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs", children: run.runId ? run.completedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.completedAt }) : "-" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "w-[110px] h-[20px]" }) })
5133
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs", children: run.runId ? run.completedAt ? /* @__PURE__ */ jsxRuntimeExports.jsx(RelativeTime, { date: run.completedAt }) : "-" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-4" }) })
5313
5134
  ] }),
5314
5135
  showUsage && /* @__PURE__ */ jsxRuntimeExports.jsx(
5315
5136
  RunUsageHeaderStats,
@@ -5354,43 +5175,10 @@ function RunDetailView({
5354
5175
  children: [
5355
5176
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: RUN_VIEW_ROW_CLASS, children: [
5356
5177
  /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList, { className: "h-auto border-0 bg-transparent p-0", children: [
5357
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
5358
- TabsTrigger,
5359
- {
5360
- value: "trace",
5361
- className: "gap-2",
5362
- "data-run-view-item": "trace",
5363
- children: [
5364
- /* @__PURE__ */ jsxRuntimeExports.jsx(List, { className: "h-4 w-4" }),
5365
- "Trace"
5366
- ]
5367
- }
5368
- ),
5178
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "trace", "data-run-view-item": "trace", children: "Trace" }),
5369
5179
  false,
5370
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
5371
- TabsTrigger,
5372
- {
5373
- value: "events",
5374
- className: "gap-2",
5375
- "data-run-view-item": "events",
5376
- children: [
5377
- /* @__PURE__ */ jsxRuntimeExports.jsx(List, { className: "h-4 w-4" }),
5378
- "Events"
5379
- ]
5380
- }
5381
- ),
5382
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
5383
- TabsTrigger,
5384
- {
5385
- value: "streams",
5386
- className: "gap-2",
5387
- "data-run-view-item": "streams",
5388
- children: [
5389
- /* @__PURE__ */ jsxRuntimeExports.jsx(List, { className: "h-4 w-4" }),
5390
- "Streams"
5391
- ]
5392
- }
5393
- )
5180
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "events", "data-run-view-item": "events", children: "Events" }),
5181
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "streams", "data-run-view-item": "streams", children: "Streams" })
5394
5182
  ] }),
5395
5183
  showUsage && /* @__PURE__ */ jsxRuntimeExports.jsx(
5396
5184
  UsageNavLink,
@@ -5441,19 +5229,20 @@ function RunDetailView({
5441
5229
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-10 min-h-10 items-center pl-4 pr-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3.5 w-24" }) }),
5442
5230
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-10 min-h-10 items-center pl-4 pr-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3.5 w-32" }) }),
5443
5231
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-10 min-h-10 items-center pl-4 pr-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, { className: "h-3.5 w-20" }) })
5444
- ] }) : streamsError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 py-2 text-label-12 text-red-900", children: streamsError.message }) : streams.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-10 min-h-10 items-center px-4 text-label-12 text-gray-900", children: "No streams found for this run" }) : streams.map((streamId) => /* @__PURE__ */ jsxRuntimeExports.jsx(
5445
- "button",
5446
- {
5447
- type: "button",
5448
- onClick: () => setSelectedStreamId(streamId),
5449
- className: `flex h-10 min-h-10 w-full min-w-0 items-center truncate pl-4 pr-2 text-left text-label-14 transition-colors ${selectedStreamId === streamId ? "bg-gray-100 text-gray-1000 hover:bg-gray-200 active:bg-gray-200" : "bg-transparent text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100 focus-visible:text-gray-1000"}`,
5450
- title: streamId,
5451
- children: streamId
5452
- },
5453
- streamId
5454
- )) })
5232
+ ] }) : streamsError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 py-2 text-label-12 text-red-900", children: streamsError.message }) : streams.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-10 min-h-10 items-center px-4 text-label-12 text-gray-900", children: "No streams found for this run" }) : streams.map((streamId) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
5233
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
5234
+ "button",
5235
+ {
5236
+ type: "button",
5237
+ onClick: () => setSelectedStreamId(streamId),
5238
+ className: `flex h-10 min-h-10 w-full min-w-0 items-center truncate pl-4 pr-2 text-left text-label-14 transition-colors ${selectedStreamId === streamId ? "bg-gray-100 text-gray-1000 hover:bg-gray-200 active:bg-gray-200" : "bg-transparent text-gray-900 hover:bg-gray-100 hover:text-gray-1000 focus-visible:bg-gray-100 focus-visible:text-gray-1000"}`,
5239
+ children: streamId
5240
+ }
5241
+ ) }),
5242
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: streamId })
5243
+ ] }, streamId)) })
5455
5244
  ] }),
5456
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-w-0 flex-1 flex-col overflow-hidden bg-background-100", children: streamsLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(StreamViewerSkeleton, {}) }) : selectedStreamId ? (streamError == null ? void 0 : streamError.includes("encrypted")) && !encryptionKey ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
5245
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-w-0 flex-1 flex-col overflow-hidden bg-background-100", children: streamsLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(StreamViewerSkeleton, {}) }) : selectedStreamId ? streamError?.includes("encrypted") && !encryptionKey ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
5457
5246
  /* @__PURE__ */ jsxRuntimeExports.jsx(Lock, { className: "h-8 w-8 text-gray-700" }),
5458
5247
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
5459
5248
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-label-14 font-medium text-gray-1000", children: "Encrypted Stream" }),
@@ -5473,7 +5262,7 @@ function RunDetailView({
5473
5262
  chunks: streamChunks,
5474
5263
  isLive: streamIsLive,
5475
5264
  isLoading: streamIsInitialLoading,
5476
- error: (streamError == null ? void 0 : streamError.includes("encrypted")) ? null : streamError
5265
+ error: streamError?.includes("encrypted") ? null : streamError
5477
5266
  }
5478
5267
  ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-label-14 text-gray-600", children: streams.length > 0 ? "Select a stream to view its data" : "No streams available" }) }) })
5479
5268
  ] }) }) }),