@workflow/web 5.0.0-beta.3 → 5.0.0-beta.5

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 (25) hide show
  1. package/build/client/assets/{encryption-80GMP4r0.js → encryption-CEh0YXii.js} +4 -2
  2. package/build/client/assets/{entry.client-BWsSsWQm.js → entry.client-DtOpLtMQ.js} +1 -1
  3. package/build/client/assets/{highlighted-body-B3W2YXNL-Be0uLJd8.js → highlighted-body-B3W2YXNL-L1CrwoL_.js} +2 -2
  4. package/build/client/assets/{home-Ce97yLJ7.js → home-B6UmDDP6.js} +4 -3
  5. package/build/client/assets/index-B4xuge0I.js +249 -0
  6. package/build/client/assets/{index-DQa-BExo.js → index-BsV8i_Jn.js} +20 -20
  7. package/build/client/assets/manifest-e4c1c787.js +1 -0
  8. package/build/client/assets/{mermaid-3ZIDBTTL-BSJR0c5A.js → mermaid-3ZIDBTTL-BQLU7GUr.js} +372 -208
  9. package/build/client/assets/root-C0Tu5TVN.css +1 -0
  10. package/build/client/assets/{root-DdOfCnSG.js → root-Yk3JVwUh.js} +2 -2
  11. package/build/client/assets/{run-detail-JQ32aJru.js → run-detail-DMUaWXhb.js} +444 -75
  12. package/build/client/assets/server-build-DqaxIrF0.css +1 -0
  13. package/build/client/assets/{workflow-graph-viewer-DYhMo9jl.js → workflow-graph-viewer-yqeN-U_2.js} +3 -3
  14. package/build/server/assets/{app-Bh_7yjpl.js → app-L1V62FgT.js} +1 -1
  15. package/build/server/assets/{highlighted-body-B3W2YXNL-Cdb-ypB4.js → highlighted-body-B3W2YXNL-CZjJIpdD.js} +6 -7
  16. package/build/server/assets/{index-CNvEtg5c.js → index-BwtNigf1.js} +18 -20
  17. package/build/server/assets/{mermaid-3ZIDBTTL-CE8Volk5.js → mermaid-3ZIDBTTL-Cc8IPTBj.js} +6 -7
  18. package/build/server/assets/{server-build-DztRAoMd.js → server-build-DtcOUEHS.js} +34997 -34048
  19. package/build/server/assets/{token-DMEdoEUo.js → token-DHnArVm7.js} +2 -2
  20. package/build/server/assets/{token-util-DsMisyo3.js → token-util-B3uKeZ0s.js} +2 -2
  21. package/build/server/index.js +1 -1
  22. package/package.json +8 -7
  23. package/build/client/assets/manifest-923d96a0.js +0 -1
  24. package/build/client/assets/root-DXDFWibD.css +0 -1
  25. package/build/client/assets/server-build-pZ5ucXET.css +0 -1
@@ -1,26 +1,27 @@
1
- import { j as jsxRuntimeExports, r as reactExports, f as reactDomExports, C as ReactDOM, A as useNavigate, B as useSearchParams, z as Link, w as withComponentProps, G as useParams } from "./index-DQa-BExo.js";
2
- import { N as Copy, C as CircleAlert, O as parseStepName, z as parseWorkflowName, j as ChevronRight, p as Check, Q as ErrorCard, Z as Zap, S as Send, R as ResolveHookModal, U as Circle, X, M as ErrorBoundary, H as unwrapServerActionResult, u as unwrapOrThrow, W as WorkflowWebAPIError, V as useEscapeKeydown, s as composeEventHandlers, Y as useCallbackRef, _ as useLayoutEffect2, q as useControllableState, $ as useId, a0 as createContext2, t as Presence, w as createContextScope, l as hideOthers, m as ReactRemoveScroll, a1 as useFocusGuards, a2 as LAYOUT, a3 as wakeUpRun, r as resumeHook, A as Alert, c as AlertTitle, d as AlertDescription, a as Skeleton$1, a4 as RunActionsButtons, B as StatusBadge, e as CopyableText, b as RelativeTime, T as Tabs, J as TabsList, K as TabsTrigger, L as TabsContent, x as cancelRun, a5 as recreateRun } from "./workflow-graph-viewer-DYhMo9jl.js";
3
- import { c as createLucideIcon, M as Spinner, h as useToast, N as Skeleton, O as DecryptClickContext, Y as Yr, U as isEncryptedMarker, W as formatDuration, X as DataInspector, _ as _r, Z as RunClickContext, $ as StreamClickContext, a0 as isExpiredMarker, a1 as isDoStreamStep, a2 as extractConversation, a3 as Lock, a4 as EVENT_DATA_REF_FIELDS, a5 as clsx, a6 as cn, a7 as getHighResInMs, a8 as ActiveSpanProvider, a9 as useActiveSpan, aa as useSidebarDataOptional, ab as computeRootBounds, ac as buildTimeCompression, ad as Timeline, ae as TimelineHeader, af as SidebarDataProvider, ag as hydrateResourceIOWithKey, ah as hydrateResourceIO, ai as fetchHook, l as fetchEvents, F as fetchRun, aj as fetchStep, ak as hasEncryptedFields, al as fetchStreams, am as Slot, E as useComposedRefs, an as Slottable, d as cn$1, ao as buttonVariants, ap as isEncryptedData, aq as hydrateData, ar as getWebRevivers, T as Tooltip, a as TooltipTrigger, b as TooltipContent, as as LIVE_UPDATE_INTERVAL_MS$1, u as useServerConfig, at as fetchEvent, au as getEncryptionKeyForRun, t as toast, L as LoaderCircle, av as StreamViewer } from "./mermaid-3ZIDBTTL-BSJR0c5A.js";
4
- import { decrypt, importKey } from "./encryption-80GMP4r0.js";
1
+ import { j as jsxRuntimeExports, r as reactExports, f as reactDomExports, D as ReactDOM, B as useNavigate, C as useSearchParams, A as Link, w as withComponentProps, H as useParams } from "./index-BsV8i_Jn.js";
2
+ import { N as Copy, C as CircleAlert, O as parseStepName, z as parseWorkflowName, j as ChevronRight, p as Check, Q as ErrorCard, Z as Zap, S as Send, R as ResolveHookModal, U as Circle, X, M as ErrorBoundary, H as unwrapServerActionResult, u as unwrapOrThrow, W as WorkflowWebAPIError, V as useEscapeKeydown, s as composeEventHandlers, Y as useCallbackRef, _ as useLayoutEffect2, q as useControllableState, $ as useId, a0 as createContext2, t as Presence, w as createContextScope, l as hideOthers, m as ReactRemoveScroll, a1 as useFocusGuards, a2 as LAYOUT, a3 as wakeUpRun, r as resumeHook, A as Alert, c as AlertTitle, d as AlertDescription, a as Skeleton$1, a4 as RunActionsButtons, B as StatusBadge, e as CopyableText, b as RelativeTime, T as Tabs, J as TabsList, K as TabsTrigger, L as TabsContent, x as cancelRun, a5 as recreateRun } from "./workflow-graph-viewer-yqeN-U_2.js";
3
+ import { c as createLucideIcon, M as Spinner, h as useToast, N as Skeleton, O as DecryptClickContext, Y as Yr, U as isEncryptedMarker, W as formatDuration, X as DataInspector, _ as _r, Z as RunClickContext, $ as StreamClickContext, a0 as isExpiredMarker, a1 as isDoStreamStep, a2 as extractConversation, a3 as Lock, a4 as EVENT_DATA_REF_FIELDS, a5 as clsx, a6 as cn, a7 as getSpanDurationMs, a8 as getHighResInMs, a9 as ActiveSpanProvider, aa as useActiveSpan, ab as useSidebarDataOptional, ac as computeRootBounds, ad as computeTimeMarkers, ae as TIMELINE_PADDING_PX, af as Timeline, ag as TimelineHeader, ah as SidebarDataProvider, ai as hydrateResourceIOWithKey, aj as hydrateResourceIO, ak as fetchHook, l as fetchEvents, F as fetchRun, al as fetchStep, am as hasEncryptedFields, an as fetchStreams, ao as Slot, E as useComposedRefs, ap as Slottable, d as cn$1, aq as buttonVariants, ar as isEncryptedData, as as hydrateData, at as getWebRevivers, T as Tooltip, a as TooltipTrigger, b as TooltipContent, au as LIVE_UPDATE_INTERVAL_MS$1, u as useServerConfig, av as fetchEvent, aw as getEncryptionKeyForRun, t as toast, L as LoaderCircle, ax as StreamViewer } from "./mermaid-3ZIDBTTL-BQLU7GUr.js";
4
+ import { decrypt, importKey } from "./encryption-CEh0YXii.js";
5
+ import "./index-B4xuge0I.js";
5
6
  /**
6
7
  * @license lucide-react v0.575.0 - ISC
7
8
  *
8
9
  * This source code is licensed under the ISC license.
9
10
  * See the LICENSE file in the root directory of this source tree.
10
11
  */
11
- const __iconNode$2 = [
12
+ const __iconNode$5 = [
12
13
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
13
14
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
14
15
  ["path", { d: "M12 17h.01", key: "p32p05" }]
15
16
  ];
16
- const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$2);
17
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$5);
17
18
  /**
18
19
  * @license lucide-react v0.575.0 - ISC
19
20
  *
20
21
  * This source code is licensed under the ISC license.
21
22
  * See the LICENSE file in the root directory of this source tree.
22
23
  */
23
- const __iconNode$1 = [
24
+ const __iconNode$4 = [
24
25
  ["path", { d: "M3 5h.01", key: "18ugdj" }],
25
26
  ["path", { d: "M3 12h.01", key: "nlz23k" }],
26
27
  ["path", { d: "M3 19h.01", key: "noohij" }],
@@ -28,18 +29,54 @@ const __iconNode$1 = [
28
29
  ["path", { d: "M8 12h13", key: "1za7za" }],
29
30
  ["path", { d: "M8 19h13", key: "m83p4d" }]
30
31
  ];
31
- const List = createLucideIcon("list", __iconNode$1);
32
+ const List = createLucideIcon("list", __iconNode$4);
32
33
  /**
33
34
  * @license lucide-react v0.575.0 - ISC
34
35
  *
35
36
  * This source code is licensed under the ISC license.
36
37
  * See the LICENSE file in the root directory of this source tree.
37
38
  */
38
- const __iconNode = [
39
+ const __iconNode$3 = [
40
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
41
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
42
+ ];
43
+ const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$3);
44
+ /**
45
+ * @license lucide-react v0.575.0 - ISC
46
+ *
47
+ * This source code is licensed under the ISC license.
48
+ * See the LICENSE file in the root directory of this source tree.
49
+ */
50
+ const __iconNode$2 = [
39
51
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
40
52
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
41
53
  ];
42
- const Search = createLucideIcon("search", __iconNode);
54
+ const Search = createLucideIcon("search", __iconNode$2);
55
+ /**
56
+ * @license lucide-react v0.575.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */
61
+ const __iconNode$1 = [
62
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
63
+ ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
64
+ ["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
65
+ ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
66
+ ];
67
+ const ZoomIn = createLucideIcon("zoom-in", __iconNode$1);
68
+ /**
69
+ * @license lucide-react v0.575.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */
74
+ const __iconNode = [
75
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
76
+ ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
77
+ ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
78
+ ];
79
+ const ZoomOut = createLucideIcon("zoom-out", __iconNode);
43
80
  const STYLES$2 = `.wf-decrypt-btn{appearance:none;-webkit-appearance:none;border:none;display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0 12px;border-radius:6px;font-size:14px;font-weight:500;line-height:20px;cursor:pointer;white-space:nowrap;gap:6px;transition:background 150ms}.wf-decrypt-idle{color:var(--ds-gray-1000);background:var(--ds-background-100);box-shadow:0 0 0 1px var(--ds-gray-400)}.wf-decrypt-idle:hover{background:var(--ds-gray-alpha-200)}.wf-decrypt-done{color:var(--ds-green-900);background:var(--ds-green-100);box-shadow:0 0 0 1px var(--ds-green-400);cursor:default}`;
44
81
  function DecryptButton({ decrypted = false, loading = false, onClick }) {
45
82
  return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("style", { dangerouslySetInnerHTML: { __html: STYLES$2 } }), jsxRuntimeExports.jsxs("button", { type: "button", onClick: decrypted ? void 0 : onClick, disabled: decrypted || loading, className: `wf-decrypt-btn ${decrypted ? "wf-decrypt-done" : "wf-decrypt-idle"}`, children: [loading ? jsxRuntimeExports.jsx(Spinner, { size: 14 }) : decrypted ? jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })] }) : jsxRuntimeExports.jsxs("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }), jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }), loading ? "Decrypting…" : decrypted ? "Decrypted" : "Decrypt"] })] });
@@ -47,10 +84,15 @@ function DecryptButton({ decrypted = false, loading = false, onClick }) {
47
84
  function isStructuredErrorWithStack(value) {
48
85
  return value != null && typeof value === "object" && "stack" in value && typeof value.stack === "string";
49
86
  }
87
+ function deriveTitle(message) {
88
+ const firstLine = message.split("\n").find((line) => line.trim().length > 0) ?? message;
89
+ return firstLine.trim();
90
+ }
50
91
  function ErrorStackBlock({ value }) {
51
92
  const toast2 = useToast();
52
93
  const stack = value.stack;
53
94
  const message = typeof value.message === "string" ? value.message : void 0;
95
+ const title = message ? deriveTitle(message) : void 0;
54
96
  const copyText = message ? `${message}
55
97
 
56
98
  ${stack}` : stack;
@@ -67,10 +109,18 @@ ${stack}` : stack;
67
109
  }).catch(() => {
68
110
  toast2.error("Failed to copy");
69
111
  });
70
- }, children: jsxRuntimeExports.jsx(Copy, { size: 12 }) }), message && jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 px-3 py-2.5 pr-10", style: {
112
+ }, children: jsxRuntimeExports.jsx(Copy, { size: 12 }) }), title && jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 px-3 py-2.5 pr-10", style: {
71
113
  color: "var(--ds-red-900)",
72
114
  borderBottom: "1px solid var(--ds-red-400)"
73
- }, children: [jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4 shrink-0", style: { marginTop: 1 } }), jsxRuntimeExports.jsx("p", { className: "text-xs font-semibold m-0 break-words", children: message })] }), jsxRuntimeExports.jsx("pre", { className: "px-3 py-2.5 text-xs font-mono whitespace-pre-wrap break-words overflow-auto m-0", style: {
115
+ }, children: [jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4 shrink-0" }), jsxRuntimeExports.jsx("p", {
116
+ className: "text-xs font-semibold m-0 truncate",
117
+ // The full multi-line message is in the stack body below; the
118
+ // header just shows the first line, single-line, with overflow
119
+ // ellipsised so a long title doesn't push the copy button or
120
+ // wrap into the framed hint/docs lines.
121
+ title: message,
122
+ children: title
123
+ })] }), jsxRuntimeExports.jsx("pre", { className: "px-3 py-2.5 text-xs font-mono whitespace-pre-wrap break-words overflow-auto m-0", style: {
74
124
  color: "var(--ds-red-900)",
75
125
  background: "var(--ds-red-200)"
76
126
  }, children: stack })] });
@@ -1027,17 +1077,22 @@ const waitEventsToWaitEntity = (events) => {
1027
1077
  waitId: startEvent.correlationId,
1028
1078
  runId: startEvent.runId,
1029
1079
  createdAt: startEvent.createdAt,
1030
- resumeAt: (_a = startEvent.eventData) == null ? void 0 : _a.resumeAt,
1080
+ resumeAt: ((_a = startEvent.eventData) == null ? void 0 : _a.resumeAt) ? new Date(startEvent.eventData.resumeAt) : void 0,
1031
1081
  completedAt: completedEvent == null ? void 0 : completedEvent.createdAt
1032
1082
  };
1033
1083
  };
1034
- function waitToSpan(events, maxEndTime) {
1084
+ function waitToSpan(events, maxEndTime, fallbackEndTime = maxEndTime) {
1035
1085
  const wait = waitEventsToWaitEntity(events);
1036
1086
  if (!wait) {
1037
1087
  return null;
1038
1088
  }
1039
1089
  const startTime = wait.createdAt;
1040
- const endTime = wait.completedAt ?? maxEndTime;
1090
+ const startMs = startTime.getTime();
1091
+ let endTime = wait.completedAt;
1092
+ if (!endTime) {
1093
+ const fallbackCap = wait.resumeAt && wait.resumeAt.getTime() < fallbackEndTime.getTime() ? wait.resumeAt : fallbackEndTime;
1094
+ endTime = maxEndTime.getTime() > startMs && maxEndTime.getTime() < fallbackCap.getTime() ? maxEndTime : fallbackCap;
1095
+ }
1041
1096
  const start = dateToOtelTime(startTime);
1042
1097
  const end = dateToOtelTime(endTime);
1043
1098
  const duration = calculateDuration(startTime, endTime);
@@ -1179,7 +1234,7 @@ function hookToSpan(hookEvents, maxEndTime) {
1179
1234
  const endTime = hook.disposedAt || maxEndTime;
1180
1235
  return {
1181
1236
  spanId: String(hook.hookId),
1182
- name: String(hook.hookId),
1237
+ name: hook.token ?? String(hook.hookId),
1183
1238
  kind: 1,
1184
1239
  // INTERNAL span kind
1185
1240
  resource: "hook",
@@ -1277,9 +1332,10 @@ function computeLatestKnownTime(events, run) {
1277
1332
  }
1278
1333
  function buildSpans(run, groupedEvents, now, latestKnownTime) {
1279
1334
  const childMaxEnd = latestKnownTime;
1335
+ const runMaxEnd = run.completedAt ?? now;
1280
1336
  const stepSpans = Array.from(groupedEvents.eventsByStepId.values()).map((events) => stepToSpan(events, childMaxEnd)).filter((span) => span !== null);
1281
1337
  const hookSpans = Array.from(groupedEvents.hookEvents.values()).map((events) => hookToSpan(events, childMaxEnd)).filter((span) => span !== null);
1282
- const waitSpans = Array.from(groupedEvents.timerEvents.values()).map((events) => waitToSpan(events, childMaxEnd)).filter((span) => span !== null);
1338
+ const waitSpans = Array.from(groupedEvents.timerEvents.values()).map((events) => waitToSpan(events, childMaxEnd, runMaxEnd)).filter((span) => span !== null);
1283
1339
  return {
1284
1340
  runSpan: runToSpan(run, groupedEvents.runLevelEvents, now),
1285
1341
  spans: [...stepSpans, ...hookSpans, ...waitSpans]
@@ -1686,6 +1742,7 @@ const attributeToDisplayFn = {
1686
1742
  // Hook details
1687
1743
  token: (value) => String(value),
1688
1744
  isWebhook: (value) => String(value),
1745
+ isSystem: (value) => String(value),
1689
1746
  receivedCount: (value) => String(value),
1690
1747
  lastReceivedAt: localMillisecondTimeOrNull,
1691
1748
  disposedAt: localMillisecondTimeOrNull,
@@ -1778,6 +1835,11 @@ const attributeToDisplayFn = {
1778
1835
  if (!hasDisplayContent(value))
1779
1836
  return null;
1780
1837
  return jsxRuntimeExports.jsx(DetailCard, { summary: "Event Data", children: JsonBlock(value) });
1838
+ },
1839
+ errorCode: (value) => {
1840
+ if (typeof value !== "string" || value.length === 0)
1841
+ return null;
1842
+ return String(value);
1781
1843
  }
1782
1844
  };
1783
1845
  const resolvableAttributes = [
@@ -2217,7 +2279,328 @@ function CopyButton({ copyText, ariaLabel, className }) {
2217
2279
  });
2218
2280
  }, children: jsxRuntimeExports.jsxs("div", { className: "relative w-3 h-3", children: [jsxRuntimeExports.jsx("div", { className: cn("absolute inset-0 flex items-center justify-center transition-all duration-150 ease-out", copied ? "scale-100 opacity-100" : "scale-0 opacity-0"), children: jsxRuntimeExports.jsx(Check, { className: "w-3 h-3" }) }), jsxRuntimeExports.jsx("div", { className: cn("absolute inset-0 flex items-center justify-center transition-all duration-150 ease-out", copied ? "scale-0 opacity-0" : "scale-100 opacity-100"), children: jsxRuntimeExports.jsx(Copy, { className: "w-3 h-3" }) })] }) });
2219
2281
  }
2220
- const GUTTER_PX = 9;
2282
+ const WorkflowIcon = () => {
2283
+ return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", "stroke-linejoin": "round", style: { color: "currentColor" }, viewBox: "0 0 16 16", width: "16", children: jsxRuntimeExports.jsx("path", { d: "M5.75 7L6.4209 7.33594L4.85254 10.4717C5.38789 10.771 5.75 11.3431 5.75 12V14C5.75 14.9665 4.96648 15.75 4 15.75H2C1.03352 15.75 0.25 14.9665 0.25 14V12C0.25 11.0335 1.03352 10.25 2 10.25H3.28711L5.0791 6.66504L5.75 7ZM14 10.25C14.9665 10.25 15.75 11.0335 15.75 12V14C15.75 14.9665 14.9665 15.75 14 15.75H12C11.1185 15.75 10.3909 15.098 10.2695 14.25H7V12.75H10.25V12C10.25 11.0335 11.0335 10.25 12 10.25H14ZM2 11.75C1.86192 11.75 1.75 11.8619 1.75 12V14C1.75 14.1381 1.86192 14.25 2 14.25H4C4.13808 14.25 4.25 14.1381 4.25 14V12C4.25 11.8619 4.13808 11.75 4 11.75H2ZM12 11.75C11.8619 11.75 11.75 11.8619 11.75 12V14C11.75 14.1381 11.8619 14.25 12 14.25H14C14.1381 14.25 14.25 14.1381 14.25 14V12C14.25 11.8619 14.1381 11.75 14 11.75H12ZM9 0.25C9.96649 0.25 10.75 1.03351 10.75 2V4C10.75 4.44642 10.5808 4.85197 10.3057 5.16113L12.2041 8.6416L10.8877 9.36035L8.91895 5.75H7C6.03351 5.75 5.25 4.96649 5.25 4V2C5.25 1.03351 6.03351 0.25 7 0.25H9ZM7 1.75C6.86193 1.75 6.75 1.86193 6.75 2V4C6.75 4.13807 6.86193 4.25 7 4.25H9C9.13807 4.25 9.25 4.13807 9.25 4V2C9.25 1.86193 9.13807 1.75 9 1.75H7Z", fill: "currentColor" }) });
2284
+ };
2285
+ const WebhookIcon = () => {
2286
+ return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", "stroke-linejoin": "round", viewBox: "0 0 16 16", width: "16", style: { color: "currentColor" }, children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.8349 3.24994C5.14454 4.44567 5.55423 5.97464 6.74996 6.665L7.39465 7.03721L7.02726 7.68466L5.14599 11C5.21289 11.1531 5.25 11.3222 5.25 11.5C5.25 12.1904 4.69036 12.75 4 12.75C3.30964 12.75 2.75 12.1904 2.75 11.5C2.75 10.8634 3.22584 10.338 3.84123 10.26L5.38944 7.5316C3.95909 6.30274 3.55857 4.19264 4.53586 2.49994C5.64043 0.586765 8.08679 -0.0687357 9.99996 1.03583C11.836 2.09584 12.5137 4.39156 11.5892 6.26591L10.4949 4.33754C10.4418 3.53274 10.0009 2.76843 9.24996 2.33487C8.05423 1.64452 6.52525 2.0542 5.8349 3.24994ZM9.146 4.99996C9.21289 4.84686 9.25 4.67776 9.25 4.5C9.25 3.80964 8.69036 3.25 8 3.25C7.30964 3.25 6.75 3.80964 6.75 4.5C6.75 5.13659 7.22586 5.66203 7.84127 5.74002L9.72266 9.05556L10.0956 9.71274L10.75 9.33493C11.9457 8.64458 13.4747 9.05427 14.165 10.25C14.8554 11.4457 14.4457 12.9747 13.25 13.6651C12.5047 14.0953 11.63 14.0983 10.9096 13.75H8.69252C9.85895 15.4685 12.1727 16.0191 14 14.9641C15.9131 13.8595 16.5686 11.4132 15.4641 9.5C14.4886 7.81038 12.4665 7.10169 10.6895 7.71998L9.146 4.99996ZM13.25 11.5C13.25 12.1904 12.6904 12.75 12 12.75C11.591 12.75 11.228 12.5536 10.9999 12.25H7.9298C7.57875 14.1006 5.95279 15.5 4 15.5C1.79086 15.5 0 13.7091 0 11.5C0 9.40018 1.61801 7.67826 3.67529 7.51299L2.58098 9.44147C1.92792 9.89251 1.5 10.6463 1.5 11.5C1.5 12.8807 2.61929 14 4 14C5.38071 14 6.5 12.8807 6.5 11.5V10.75H7.25H10.9999C11.228 10.4464 11.591 10.25 12 10.25C12.6904 10.25 13.25 10.8096 13.25 11.5Z", fill: "currentColor" }) });
2287
+ };
2288
+ const SleepIcon = () => {
2289
+ return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", strokeLinejoin: "round", viewBox: "0 0 16 16", width: "16", style: { color: "currentColor" }, children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.25 1.25V2.03971C5.87928 2.18571 4.62678 2.72736 3.6089 3.54824L3.03033 2.96967L2.5 2.43934L1.43934 3.5L1.96967 4.03033L2.54824 4.6089C1.57979 5.80976 1 7.33717 1 9C1 12.866 4.13401 16 8 16C11.866 16 15 12.866 15 9C15 7.33717 14.4202 5.80976 13.4518 4.6089L14.0303 4.03033L14.5607 3.5L13.5 2.43934L12.9697 2.96967L12.3911 3.54824C11.3732 2.72736 10.1207 2.18571 8.75 2.03971V1.25H9.25H10V-0.25H9.25H8.75H7.25H6.75H6V1.25H6.75H7.25ZM2.5 9C2.5 5.96243 4.96243 3.5 8 3.5C11.0376 3.5 13.5 5.96243 13.5 9C13.5 12.0376 11.0376 14.5 8 14.5C4.96243 14.5 2.5 12.0376 2.5 9ZM8.75 6.75V6H7.25V6.75V9V9.75H8.75V9V6.75Z", fill: "currentColor" }) });
2290
+ };
2291
+ const StepForwardIcon = () => {
2292
+ return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", strokeLinejoin: "round", viewBox: "0 0 16 16", width: "16", style: { color: "currentColor" }, children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.21969 12.5303L4.75002 13.0607L5.81068 12L5.28035 11.4697L1.81068 7.99999L5.28035 4.53032L5.81068 3.99999L4.75002 2.93933L4.21969 3.46966L0.39647 7.29289C0.00594562 7.68341 0.00594562 8.31658 0.39647 8.7071L4.21969 12.5303ZM11.7804 12.5303L11.25 13.0607L10.1894 12L10.7197 11.4697L14.1894 7.99999L10.7197 4.53032L10.1894 3.99999L11.25 2.93933L11.7804 3.46966L15.6036 7.29289C15.9941 7.68341 15.9941 8.31658 15.6036 8.7071L11.7804 12.5303Z", fill: "currentColor" }) });
2293
+ };
2294
+ const ELLIPSIS = "...";
2295
+ const MIN_START = 3;
2296
+ const MIN_END = 3;
2297
+ const MIN_KEPT = MIN_START + MIN_END;
2298
+ const graphemeSegmenter = typeof Intl !== "undefined" && "Segmenter" in Intl ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
2299
+ function toGraphemes(text) {
2300
+ if (graphemeSegmenter) {
2301
+ return [...graphemeSegmenter.segment(text)].map((s) => s.segment);
2302
+ }
2303
+ return Array.from(text);
2304
+ }
2305
+ function buildCandidate(graphemes, kept) {
2306
+ if (kept <= 0) {
2307
+ return {
2308
+ prefixText: "",
2309
+ prefixGraphemeCount: 0,
2310
+ suffixText: "",
2311
+ suffixGraphemeCount: 0,
2312
+ text: ELLIPSIS,
2313
+ truncated: true
2314
+ };
2315
+ }
2316
+ const suffixGraphemeCount = kept >= MIN_KEPT ? Math.max(MIN_END, Math.floor(kept / 2)) : Math.floor(kept / 2);
2317
+ const prefixGraphemeCount = kept - suffixGraphemeCount;
2318
+ const prefixText = graphemes.slice(0, prefixGraphemeCount).join("");
2319
+ const suffixText = suffixGraphemeCount > 0 ? graphemes.slice(-suffixGraphemeCount).join("") : "";
2320
+ return {
2321
+ prefixText,
2322
+ prefixGraphemeCount,
2323
+ suffixText,
2324
+ suffixGraphemeCount,
2325
+ text: prefixText + ELLIPSIS + suffixText,
2326
+ truncated: true
2327
+ };
2328
+ }
2329
+ function middleTruncate(graphemes, availableWidth, measure, fullWidth) {
2330
+ const fullText = graphemes.join("");
2331
+ const resolvedFullWidth = fullWidth ?? measure(fullText);
2332
+ if (availableWidth <= 0 || graphemes.length === 0) {
2333
+ return {
2334
+ prefixText: fullText,
2335
+ prefixGraphemeCount: graphemes.length,
2336
+ suffixText: "",
2337
+ suffixGraphemeCount: 0,
2338
+ text: fullText,
2339
+ truncated: false
2340
+ };
2341
+ }
2342
+ if (resolvedFullWidth <= availableWidth) {
2343
+ return {
2344
+ prefixText: fullText,
2345
+ prefixGraphemeCount: graphemes.length,
2346
+ suffixText: "",
2347
+ suffixGraphemeCount: 0,
2348
+ text: fullText,
2349
+ truncated: false
2350
+ };
2351
+ }
2352
+ let lo = 0;
2353
+ let hi = graphemes.length - 1;
2354
+ let best = -1;
2355
+ while (lo <= hi) {
2356
+ const mid = lo + hi >>> 1;
2357
+ const candidate = buildCandidate(graphemes, mid);
2358
+ if (measure(candidate.text) <= availableWidth) {
2359
+ best = mid;
2360
+ lo = mid + 1;
2361
+ } else {
2362
+ hi = mid - 1;
2363
+ }
2364
+ }
2365
+ if (best === -1) {
2366
+ return {
2367
+ prefixText: "",
2368
+ prefixGraphemeCount: 0,
2369
+ suffixText: "",
2370
+ suffixGraphemeCount: 0,
2371
+ text: "",
2372
+ truncated: true
2373
+ };
2374
+ }
2375
+ return buildCandidate(graphemes, best);
2376
+ }
2377
+ function getMiddleTruncateCopyText({ prefixText, selectionEnd, selectionStart, suffixText, value }) {
2378
+ const visibleText = prefixText + ELLIPSIS + suffixText;
2379
+ if (selectionStart < 0 || selectionEnd > visibleText.length || selectionStart >= selectionEnd) {
2380
+ return null;
2381
+ }
2382
+ if (selectionStart === 0 && selectionEnd === visibleText.length) {
2383
+ return value;
2384
+ }
2385
+ const ellipsisStart = prefixText.length;
2386
+ const ellipsisEnd = ellipsisStart + ELLIPSIS.length;
2387
+ if (selectionStart > ellipsisStart || selectionEnd < ellipsisEnd) {
2388
+ return null;
2389
+ }
2390
+ const originalGraphemes = toGraphemes(value);
2391
+ const selectedPrefixGraphemeCount = toGraphemes(visibleText.slice(0, selectionStart)).length;
2392
+ const selectedSuffixGraphemeCount = toGraphemes(visibleText.slice(ellipsisEnd, selectionEnd)).length;
2393
+ const suffixStart = originalGraphemes.length - toGraphemes(suffixText).length;
2394
+ return originalGraphemes.slice(selectedPrefixGraphemeCount, suffixStart + selectedSuffixGraphemeCount).join("");
2395
+ }
2396
+ function getMiddleTruncateCopyTextFromSelectionText({ prefixText, selectionText, suffixText, value }) {
2397
+ const visibleText = prefixText + ELLIPSIS + suffixText;
2398
+ const trimmedSelectionText = selectionText.trim();
2399
+ if (!trimmedSelectionText) {
2400
+ return null;
2401
+ }
2402
+ const leading = selectionText.slice(0, selectionText.length - selectionText.trimStart().length);
2403
+ const trailing = selectionText.slice(selectionText.trimEnd().length);
2404
+ if (trimmedSelectionText === visibleText) {
2405
+ return leading + value + trailing;
2406
+ }
2407
+ if (!trimmedSelectionText.includes(ELLIPSIS)) {
2408
+ return null;
2409
+ }
2410
+ const selectionStart = visibleText.indexOf(trimmedSelectionText);
2411
+ if (selectionStart === -1) {
2412
+ return null;
2413
+ }
2414
+ const selectionEnd = selectionStart + trimmedSelectionText.length;
2415
+ const mappedText = getMiddleTruncateCopyText({
2416
+ prefixText,
2417
+ selectionEnd,
2418
+ selectionStart,
2419
+ suffixText,
2420
+ value
2421
+ });
2422
+ return mappedText === null ? null : leading + mappedText + trailing;
2423
+ }
2424
+ const useIsomorphicLayoutEffect = typeof window === "undefined" ? reactExports.useEffect : reactExports.useLayoutEffect;
2425
+ function createFullState(value, graphemes) {
2426
+ return {
2427
+ displayText: value,
2428
+ isTruncated: false,
2429
+ prefixGraphemeCount: graphemes.length,
2430
+ prefixText: value,
2431
+ suffixGraphemeCount: 0,
2432
+ suffixText: ""
2433
+ };
2434
+ }
2435
+ function useMiddleTruncate(value) {
2436
+ const graphemes = reactExports.useMemo(() => toGraphemes(value), [value]);
2437
+ const fullState = reactExports.useMemo(() => createFullState(value, graphemes), [graphemes, value]);
2438
+ const ref = reactExports.useRef(null);
2439
+ const measureRef = reactExports.useRef(null);
2440
+ const [state, setState] = reactExports.useState(() => fullState);
2441
+ const rafRef = reactExports.useRef(0);
2442
+ const updateState = reactExports.useCallback((nextState) => {
2443
+ setState((currentState) => {
2444
+ if (currentState.displayText === nextState.displayText && currentState.isTruncated === nextState.isTruncated && currentState.prefixText === nextState.prefixText && currentState.prefixGraphemeCount === nextState.prefixGraphemeCount && currentState.suffixText === nextState.suffixText && currentState.suffixGraphemeCount === nextState.suffixGraphemeCount) {
2445
+ return currentState;
2446
+ }
2447
+ return nextState;
2448
+ });
2449
+ }, []);
2450
+ const recalculate = reactExports.useCallback(() => {
2451
+ const el = ref.current;
2452
+ const measureEl = measureRef.current;
2453
+ if (!el || !measureEl)
2454
+ return;
2455
+ const available = el.clientWidth;
2456
+ if (available <= 0) {
2457
+ updateState(fullState);
2458
+ return;
2459
+ }
2460
+ const measure = (text) => {
2461
+ measureEl.textContent = text;
2462
+ return measureEl.scrollWidth;
2463
+ };
2464
+ const fullWidth = measure(value);
2465
+ if (fullWidth <= available) {
2466
+ updateState(fullState);
2467
+ return;
2468
+ }
2469
+ const result = middleTruncate(graphemes, available, measure, fullWidth);
2470
+ updateState({
2471
+ displayText: result.text,
2472
+ isTruncated: result.truncated,
2473
+ prefixGraphemeCount: result.prefixGraphemeCount,
2474
+ prefixText: result.prefixText,
2475
+ suffixGraphemeCount: result.suffixGraphemeCount,
2476
+ suffixText: result.suffixText
2477
+ });
2478
+ }, [fullState, graphemes, updateState, value]);
2479
+ useIsomorphicLayoutEffect(() => {
2480
+ recalculate();
2481
+ }, [recalculate]);
2482
+ reactExports.useEffect(() => {
2483
+ var _a;
2484
+ const el = ref.current;
2485
+ if (!el)
2486
+ return;
2487
+ const debouncedRecalc = () => {
2488
+ cancelAnimationFrame(rafRef.current);
2489
+ rafRef.current = requestAnimationFrame(recalculate);
2490
+ };
2491
+ const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(debouncedRecalc) : null;
2492
+ ro == null ? void 0 : ro.observe(el);
2493
+ window.addEventListener("resize", debouncedRecalc);
2494
+ const onFontsLoaded = () => {
2495
+ debouncedRecalc();
2496
+ };
2497
+ const fontSet = "fonts" in document ? document.fonts : null;
2498
+ (_a = fontSet == null ? void 0 : fontSet.addEventListener) == null ? void 0 : _a.call(fontSet, "loadingdone", onFontsLoaded);
2499
+ return () => {
2500
+ var _a2;
2501
+ ro == null ? void 0 : ro.disconnect();
2502
+ window.removeEventListener("resize", debouncedRecalc);
2503
+ cancelAnimationFrame(rafRef.current);
2504
+ (_a2 = fontSet == null ? void 0 : fontSet.removeEventListener) == null ? void 0 : _a2.call(fontSet, "loadingdone", onFontsLoaded);
2505
+ };
2506
+ }, [recalculate]);
2507
+ return {
2508
+ ref,
2509
+ measureRef,
2510
+ displayText: state.displayText,
2511
+ isTruncated: state.isTruncated,
2512
+ prefixGraphemeCount: state.prefixGraphemeCount,
2513
+ prefixText: state.prefixText,
2514
+ suffixGraphemeCount: state.suffixGraphemeCount,
2515
+ suffixText: state.suffixText
2516
+ };
2517
+ }
2518
+ function getRangeOffsets(container, range) {
2519
+ if (!container.contains(range.startContainer) || !container.contains(range.endContainer)) {
2520
+ return null;
2521
+ }
2522
+ const startRange = document.createRange();
2523
+ startRange.selectNodeContents(container);
2524
+ startRange.setEnd(range.startContainer, range.startOffset);
2525
+ const endRange = document.createRange();
2526
+ endRange.selectNodeContents(container);
2527
+ endRange.setEnd(range.endContainer, range.endOffset);
2528
+ return {
2529
+ end: endRange.toString().length,
2530
+ start: startRange.toString().length
2531
+ };
2532
+ }
2533
+ function MiddleTruncate({ value, className, onCopy: onCopyProp, ...props }) {
2534
+ const { ref, measureRef, displayText, isTruncated, prefixText, suffixText } = useMiddleTruncate(value);
2535
+ const visibleRef = reactExports.useRef(null);
2536
+ const handleCopy = reactExports.useCallback((e) => {
2537
+ onCopyProp == null ? void 0 : onCopyProp(e);
2538
+ if (e.defaultPrevented || !isTruncated)
2539
+ return;
2540
+ const selection = window.getSelection();
2541
+ if (!selection || selection.rangeCount === 0)
2542
+ return;
2543
+ const selectionText = selection.toString();
2544
+ if (!selectionText)
2545
+ return;
2546
+ const range = selection.getRangeAt(0);
2547
+ const visibleEl = visibleRef.current;
2548
+ let copyText = null;
2549
+ if (e.currentTarget.contains(range.startContainer) && e.currentTarget.contains(range.endContainer) && visibleEl) {
2550
+ const offsets = getRangeOffsets(visibleEl, range);
2551
+ if (offsets) {
2552
+ copyText = getMiddleTruncateCopyText({
2553
+ prefixText,
2554
+ selectionEnd: offsets.end,
2555
+ selectionStart: offsets.start,
2556
+ suffixText,
2557
+ value
2558
+ });
2559
+ }
2560
+ }
2561
+ copyText ?? (copyText = getMiddleTruncateCopyTextFromSelectionText({
2562
+ prefixText,
2563
+ selectionText,
2564
+ suffixText,
2565
+ value
2566
+ }));
2567
+ if (copyText === null)
2568
+ return;
2569
+ e.preventDefault();
2570
+ e.clipboardData.setData("text/plain", copyText);
2571
+ }, [onCopyProp, isTruncated, prefixText, suffixText, value]);
2572
+ return jsxRuntimeExports.jsxs("span", { title: isTruncated ? value : void 0, ...props, ref, className: cn("relative inline-grid min-w-0 max-w-full overflow-hidden whitespace-nowrap", className), onCopy: handleCopy, children: [isTruncated && jsxRuntimeExports.jsx("span", { className: "sr-only select-none", children: value }), jsxRuntimeExports.jsx("span", { "aria-hidden": "true", className: "pointer-events-none col-start-1 row-start-1 invisible select-none whitespace-nowrap", children: value }), jsxRuntimeExports.jsx("span", { "aria-hidden": isTruncated || void 0, className: "col-start-1 row-start-1 min-w-0 overflow-hidden", ref: visibleRef, children: isTruncated ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { children: prefixText }), jsxRuntimeExports.jsx("span", { children: ELLIPSIS }), jsxRuntimeExports.jsx("span", { children: suffixText })] }) : displayText }), jsxRuntimeExports.jsx("span", { "aria-hidden": "true", className: "pointer-events-none absolute left-0 top-0 inline-block invisible select-none whitespace-nowrap", ref: measureRef })] });
2573
+ }
2574
+ const eventStyles = {
2575
+ run: { icon: WorkflowIcon, className: "text-blue-900" },
2576
+ step: { icon: StepForwardIcon, className: "text-green-900" },
2577
+ hook: { icon: WebhookIcon, className: "text-yellow-900" },
2578
+ sleep: { icon: SleepIcon, className: "text-gray-900" }
2579
+ };
2580
+ const defaultStyle = {
2581
+ icon: Circle,
2582
+ className: "text-gray-900"
2583
+ };
2584
+ const ROW_HEIGHT_CLASS = "h-10";
2585
+ function getEventStyle(resource, isErrored) {
2586
+ const style = eventStyles[resource] ?? defaultStyle;
2587
+ return {
2588
+ icon: style.icon,
2589
+ className: cn(isErrored ? "text-red-900" : style.className)
2590
+ };
2591
+ }
2592
+ const EventRow = ({ span, isSelected, onSelectSpan }) => {
2593
+ const durationMs = getSpanDurationMs(span);
2594
+ const isErrored = span.attributes.data.status === "failed";
2595
+ const { icon: Icon, className: tagClassName } = getEventStyle(span.resource, isErrored);
2596
+ return jsxRuntimeExports.jsx("li", { className: cn("relative overflow-clip group after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-gray-alpha-400", ROW_HEIGHT_CLASS), role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, onClick: () => onSelectSpan(span.spanId), children: jsxRuntimeExports.jsx("div", { className: "h-full hover:bg-gray-100 group-aria-selected:bg-gray-100 group-aria-selected:hover:bg-gray-200", children: jsxRuntimeExports.jsxs("div", { className: "flex h-full min-w-0 items-center px-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [jsxRuntimeExports.jsx("span", { className: cn("shrink-0", tagClassName), children: jsxRuntimeExports.jsx(Icon, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx("span", { className: "min-w-0 text-label-14", children: jsxRuntimeExports.jsx(MiddleTruncate, { value: span.name }) })] }), jsxRuntimeExports.jsx("div", { className: "ml-2 shrink-0", children: jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-900 tabular-nums", children: formatDuration(durationMs) }) })] }) }) });
2597
+ };
2598
+ const EventList = ({ spans, activeSpanId, onSelectSpan }) => {
2599
+ return jsxRuntimeExports.jsx("ul", { id: "event-list", role: "tree", className: "block min-h-0 overflow-visible", children: spans.map((span) => {
2600
+ return jsxRuntimeExports.jsx(EventRow, { span, isSelected: span.spanId === activeSpanId, onSelectSpan }, span.spanId);
2601
+ }) });
2602
+ };
2603
+ const GUTTER_PX = 1;
2221
2604
  const MIN_PX = 50;
2222
2605
  const DEFAULT_START_PX = 340;
2223
2606
  function SplitPane({ children, className, defaultStartWidth = DEFAULT_START_PX, startHeader, endHeader }) {
@@ -2304,58 +2687,17 @@ function SplitPane({ children, className, defaultStartWidth = DEFAULT_START_PX,
2304
2687
  const hasHeaders = startHeader != null || endHeader != null;
2305
2688
  const gutter = jsxRuntimeExports.jsx("div", { ref: gutterRef, className: "relative z-20 isolate flex shrink-0 cursor-col-resize justify-center", onPointerDown: handlePointerDown, onLostPointerCapture: handleLostPointerCapture, children: jsxRuntimeExports.jsx("span", { className: "pointer-events-none relative z-10 h-full w-px shrink-0 bg-gray-alpha-400", "aria-hidden": true }) });
2306
2689
  if (hasHeaders) {
2307
- return jsxRuntimeExports.jsxs("div", { className: cn("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: containerRef, className: cn("grid flex-1 min-h-0 content-start overflow-x-hidden overflow-y-auto", isDragging && "select-none"), style: { gridTemplateColumns: colTemplate }, children: [start, gutter, end] })] });
2690
+ return jsxRuntimeExports.jsxs("div", { className: cn("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: containerRef, className: cn("grid flex-1 min-h-0 overflow-x-hidden overflow-y-auto", isDragging && "select-none"), style: { gridTemplateColumns: colTemplate }, children: [start, gutter, end] })] });
2308
2691
  }
2309
2692
  return jsxRuntimeExports.jsxs("div", { ref: containerRef, className: cn("grid h-full min-h-0 content-start overflow-x-hidden overflow-y-auto", isDragging && "select-none", className), style: { gridTemplateColumns: colTemplate, height: "100%" }, children: [start, gutter, end] });
2310
2693
  }
2311
- const WorkflowIcon = () => {
2312
- return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", "stroke-linejoin": "round", style: { color: "currentColor" }, viewBox: "0 0 16 16", width: "16", children: jsxRuntimeExports.jsx("path", { d: "M5.75 7L6.4209 7.33594L4.85254 10.4717C5.38789 10.771 5.75 11.3431 5.75 12V14C5.75 14.9665 4.96648 15.75 4 15.75H2C1.03352 15.75 0.25 14.9665 0.25 14V12C0.25 11.0335 1.03352 10.25 2 10.25H3.28711L5.0791 6.66504L5.75 7ZM14 10.25C14.9665 10.25 15.75 11.0335 15.75 12V14C15.75 14.9665 14.9665 15.75 14 15.75H12C11.1185 15.75 10.3909 15.098 10.2695 14.25H7V12.75H10.25V12C10.25 11.0335 11.0335 10.25 12 10.25H14ZM2 11.75C1.86192 11.75 1.75 11.8619 1.75 12V14C1.75 14.1381 1.86192 14.25 2 14.25H4C4.13808 14.25 4.25 14.1381 4.25 14V12C4.25 11.8619 4.13808 11.75 4 11.75H2ZM12 11.75C11.8619 11.75 11.75 11.8619 11.75 12V14C11.75 14.1381 11.8619 14.25 12 14.25H14C14.1381 14.25 14.25 14.1381 14.25 14V12C14.25 11.8619 14.1381 11.75 14 11.75H12ZM9 0.25C9.96649 0.25 10.75 1.03351 10.75 2V4C10.75 4.44642 10.5808 4.85197 10.3057 5.16113L12.2041 8.6416L10.8877 9.36035L8.91895 5.75H7C6.03351 5.75 5.25 4.96649 5.25 4V2C5.25 1.03351 6.03351 0.25 7 0.25H9ZM7 1.75C6.86193 1.75 6.75 1.86193 6.75 2V4C6.75 4.13807 6.86193 4.25 7 4.25H9C9.13807 4.25 9.25 4.13807 9.25 4V2C9.25 1.86193 9.13807 1.75 9 1.75H7Z", fill: "currentColor" }) });
2313
- };
2314
- const WebhookIcon = () => {
2315
- return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", "stroke-linejoin": "round", viewBox: "0 0 16 16", width: "16", style: { color: "currentColor" }, children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.8349 3.24994C5.14454 4.44567 5.55423 5.97464 6.74996 6.665L7.39465 7.03721L7.02726 7.68466L5.14599 11C5.21289 11.1531 5.25 11.3222 5.25 11.5C5.25 12.1904 4.69036 12.75 4 12.75C3.30964 12.75 2.75 12.1904 2.75 11.5C2.75 10.8634 3.22584 10.338 3.84123 10.26L5.38944 7.5316C3.95909 6.30274 3.55857 4.19264 4.53586 2.49994C5.64043 0.586765 8.08679 -0.0687357 9.99996 1.03583C11.836 2.09584 12.5137 4.39156 11.5892 6.26591L10.4949 4.33754C10.4418 3.53274 10.0009 2.76843 9.24996 2.33487C8.05423 1.64452 6.52525 2.0542 5.8349 3.24994ZM9.146 4.99996C9.21289 4.84686 9.25 4.67776 9.25 4.5C9.25 3.80964 8.69036 3.25 8 3.25C7.30964 3.25 6.75 3.80964 6.75 4.5C6.75 5.13659 7.22586 5.66203 7.84127 5.74002L9.72266 9.05556L10.0956 9.71274L10.75 9.33493C11.9457 8.64458 13.4747 9.05427 14.165 10.25C14.8554 11.4457 14.4457 12.9747 13.25 13.6651C12.5047 14.0953 11.63 14.0983 10.9096 13.75H8.69252C9.85895 15.4685 12.1727 16.0191 14 14.9641C15.9131 13.8595 16.5686 11.4132 15.4641 9.5C14.4886 7.81038 12.4665 7.10169 10.6895 7.71998L9.146 4.99996ZM13.25 11.5C13.25 12.1904 12.6904 12.75 12 12.75C11.591 12.75 11.228 12.5536 10.9999 12.25H7.9298C7.57875 14.1006 5.95279 15.5 4 15.5C1.79086 15.5 0 13.7091 0 11.5C0 9.40018 1.61801 7.67826 3.67529 7.51299L2.58098 9.44147C1.92792 9.89251 1.5 10.6463 1.5 11.5C1.5 12.8807 2.61929 14 4 14C5.38071 14 6.5 12.8807 6.5 11.5V10.75H7.25H10.9999C11.228 10.4464 11.591 10.25 12 10.25C12.6904 10.25 13.25 10.8096 13.25 11.5Z", fill: "currentColor" }) });
2316
- };
2317
- const SleepIcon = () => {
2318
- return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", strokeLinejoin: "round", viewBox: "0 0 16 16", width: "16", style: { color: "currentColor" }, children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.25 1.25V2.03971C5.87928 2.18571 4.62678 2.72736 3.6089 3.54824L3.03033 2.96967L2.5 2.43934L1.43934 3.5L1.96967 4.03033L2.54824 4.6089C1.57979 5.80976 1 7.33717 1 9C1 12.866 4.13401 16 8 16C11.866 16 15 12.866 15 9C15 7.33717 14.4202 5.80976 13.4518 4.6089L14.0303 4.03033L14.5607 3.5L13.5 2.43934L12.9697 2.96967L12.3911 3.54824C11.3732 2.72736 10.1207 2.18571 8.75 2.03971V1.25H9.25H10V-0.25H9.25H8.75H7.25H6.75H6V1.25H6.75H7.25ZM2.5 9C2.5 5.96243 4.96243 3.5 8 3.5C11.0376 3.5 13.5 5.96243 13.5 9C13.5 12.0376 11.0376 14.5 8 14.5C4.96243 14.5 2.5 12.0376 2.5 9ZM8.75 6.75V6H7.25V6.75V9V9.75H8.75V9V6.75Z", fill: "currentColor" }) });
2319
- };
2320
- const StepForwardIcon = () => {
2321
- return jsxRuntimeExports.jsx("svg", { "data-testid": "geist-icon", height: "16", strokeLinejoin: "round", viewBox: "0 0 16 16", width: "16", style: { color: "currentColor" }, children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.21969 12.5303L4.75002 13.0607L5.81068 12L5.28035 11.4697L1.81068 7.99999L5.28035 4.53032L5.81068 3.99999L4.75002 2.93933L4.21969 3.46966L0.39647 7.29289C0.00594562 7.68341 0.00594562 8.31658 0.39647 8.7071L4.21969 12.5303ZM11.7804 12.5303L11.25 13.0607L10.1894 12L10.7197 11.4697L14.1894 7.99999L10.7197 4.53032L10.1894 3.99999L11.25 2.93933L11.7804 3.46966L15.6036 7.29289C15.9941 7.68341 15.9941 8.31658 15.6036 8.7071L11.7804 12.5303Z", fill: "currentColor" }) });
2322
- };
2323
- const eventStyles = {
2324
- run: { icon: WorkflowIcon, className: "text-blue-900" },
2325
- step: { icon: StepForwardIcon, className: "text-green-900" },
2326
- hook: { icon: WebhookIcon, className: "text-yellow-900" },
2327
- sleep: { icon: SleepIcon, className: "text-gray-900" }
2328
- };
2329
- const defaultStyle = {
2330
- icon: Circle,
2331
- className: "text-gray-900"
2332
- };
2333
- function getEventStyle(resource, isErrored) {
2334
- const style = eventStyles[resource] ?? defaultStyle;
2335
- return {
2336
- icon: style.icon,
2337
- className: cn(isErrored ? "text-red-900" : style.className)
2338
- };
2339
- }
2340
- const EventRow = ({ span, isSelected, onSelectSpan }) => {
2341
- const durationMs = getHighResInMs(span.duration);
2342
- const isErrored = span.attributes.data.status === "failed";
2343
- const { icon: Icon, className: tagClassName } = getEventStyle(span.resource, isErrored);
2344
- return jsxRuntimeExports.jsx("li", { className: "overflow-clip group", role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, onClick: () => onSelectSpan(span.spanId), children: jsxRuntimeExports.jsxs("div", { className: "hover:bg-gray-100 group-aria-selected:bg-gray-100 group-aria-selected:hover:bg-gray-200 hover:aria-selected:bg-gray-100 rounded-sm px-2 h-[34px] py-1.5 flex", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsx("span", { className: tagClassName, children: jsxRuntimeExports.jsx(Icon, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx("span", { className: "text-label-14", children: span.name })] }), jsxRuntimeExports.jsx("div", { className: "ml-auto", children: jsxRuntimeExports.jsx("span", { className: "text-label-14 text-gray-900 tabular-nums", children: formatDuration(durationMs) }) })] }) });
2345
- };
2346
- const EventList = ({ spans, activeSpanId, onSelectSpan }) => {
2347
- return jsxRuntimeExports.jsx("ul", { id: "event-list", role: "tree", className: "block min-h-0 overflow-visible px-2 py-2", children: spans.map((span) => {
2348
- return jsxRuntimeExports.jsx(EventRow, { span, isSelected: span.spanId === activeSpanId, onSelectSpan }, span.spanId);
2349
- }) });
2350
- };
2351
2694
  function DetailPanel({ span, rootStart, onClose }) {
2352
2695
  const startMs = getHighResInMs(span.startTime);
2353
- const durationMs = getHighResInMs(span.duration);
2696
+ const durationMs = getSpanDurationMs(span);
2354
2697
  const offsetMs = startMs - rootStart;
2355
2698
  return jsxRuntimeExports.jsxs("aside", { className: "grid h-full max-h-full grid-rows-[2.5rem_1fr] bg-background-200", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-3 border-b border-gray-alpha-400", children: [jsxRuntimeExports.jsx("span", { className: "text-sm font-medium text-gray-1000 truncate", children: span.name }), jsxRuntimeExports.jsx("button", { type: "button", className: "p-1 rounded-md text-gray-900 hover:text-gray-1000 hover:bg-gray-alpha-200 transition-colors", onClick: onClose, children: jsxRuntimeExports.jsx(X, { className: "w-4 h-4" }) })] }), jsxRuntimeExports.jsx("div", { className: "overflow-y-auto p-3 space-y-3", children: jsxRuntimeExports.jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm", children: [jsxRuntimeExports.jsx("dt", { className: "text-gray-900", children: "Resource" }), jsxRuntimeExports.jsx("dd", { className: "text-gray-1000 font-mono", children: span.resource }), jsxRuntimeExports.jsx("dt", { className: "text-gray-900", children: "Duration" }), jsxRuntimeExports.jsx("dd", { className: "text-gray-1000 tabular-nums font-mono", children: formatDuration(durationMs) }), jsxRuntimeExports.jsx("dt", { className: "text-gray-900", children: "Offset" }), jsxRuntimeExports.jsxs("dd", { className: "text-gray-1000 tabular-nums font-mono", children: ["+", formatDuration(offsetMs)] }), jsxRuntimeExports.jsx("dt", { className: "text-gray-900", children: "Status" }), jsxRuntimeExports.jsx("dd", { className: "text-gray-1000 font-mono", children: span.status.code === 2 ? "Error" : "OK" })] }) })] });
2356
2699
  }
2357
2700
  const MIN_VIEWPORT_MS = 1e-3;
2358
- const TIMELINE_PADDING = 16;
2359
2701
  function useAnimatedViewport(initial) {
2360
2702
  const [viewport, setViewportState] = reactExports.useState(initial);
2361
2703
  const animRef = reactExports.useRef(null);
@@ -2456,11 +2798,34 @@ function NewTraceViewerContent({ trace }) {
2456
2798
  prevRootRef.current = { start: newStart, end: newEnd };
2457
2799
  }, [root.startTime, root.duration]);
2458
2800
  const viewDuration = viewport.end - viewport.start;
2459
- const compression = reactExports.useMemo(() => buildTimeCompression(trace.spans, viewport.start, viewport.end), [trace.spans, viewport.start, viewport.end]);
2460
- const isZoomed = viewport.start > root.startTime + 0.01 || viewport.end < root.startTime + root.duration - 0.01;
2801
+ const timeMarkers = reactExports.useMemo(() => computeTimeMarkers(viewDuration, viewport.start - root.startTime), [viewDuration, viewport.start, root.startTime]);
2461
2802
  const resetZoom = reactExports.useCallback(() => {
2462
2803
  animateTo({ start: root.startTime, end: root.startTime + root.duration });
2463
2804
  }, [animateTo, root.startTime, root.duration]);
2805
+ const ZOOM_FACTOR = 0.5;
2806
+ const zoomBy = reactExports.useCallback((factor) => {
2807
+ const rootS = root.startTime;
2808
+ const rootE = root.startTime + root.duration;
2809
+ const rootD = root.duration;
2810
+ setViewport((prev) => {
2811
+ const prevDuration = prev.end - prev.start;
2812
+ const center = (prev.start + prev.end) / 2;
2813
+ const newDuration = Math.max(MIN_VIEWPORT_MS, Math.min(rootD, prevDuration * factor));
2814
+ let newStart = center - newDuration / 2;
2815
+ let newEnd = center + newDuration / 2;
2816
+ if (newStart < rootS) {
2817
+ newStart = rootS;
2818
+ newEnd = rootS + newDuration;
2819
+ }
2820
+ if (newEnd > rootE) {
2821
+ newEnd = rootE;
2822
+ newStart = Math.max(rootS, rootE - newDuration);
2823
+ }
2824
+ return { start: newStart, end: newEnd };
2825
+ });
2826
+ }, [setViewport, root.startTime, root.duration]);
2827
+ const zoomIn = reactExports.useCallback(() => zoomBy(ZOOM_FACTOR), [zoomBy]);
2828
+ const zoomOut = reactExports.useCallback(() => zoomBy(1 / ZOOM_FACTOR), [zoomBy]);
2464
2829
  const handleSelectSpan = reactExports.useCallback((spanId) => {
2465
2830
  if (spanId === activeSpanId) {
2466
2831
  clearActiveSpan();
@@ -2538,20 +2903,19 @@ function NewTraceViewerContent({ trace }) {
2538
2903
  const hoverInfo = reactExports.useMemo(() => {
2539
2904
  if (hoverFraction == null)
2540
2905
  return null;
2541
- const absTime = compression.fromVisual(hoverFraction);
2906
+ const absTime = viewport.start + hoverFraction * viewDuration;
2542
2907
  const offset = absTime - root.startTime;
2543
2908
  return { fraction: hoverFraction, label: formatDuration(offset, true) };
2544
- }, [hoverFraction, compression, root.startTime]);
2909
+ }, [hoverFraction, viewport.start, viewDuration, root.startTime]);
2545
2910
  const handleTimelineMouseMove = reactExports.useCallback((e) => {
2546
2911
  const el = timelineRef.current;
2547
2912
  if (!el)
2548
2913
  return;
2549
2914
  const rect = el.getBoundingClientRect();
2550
- const padding = 8;
2551
- const contentWidth = rect.width - padding * 2;
2915
+ const contentWidth = rect.width - TIMELINE_PADDING_PX * 2;
2552
2916
  if (contentWidth <= 0)
2553
2917
  return;
2554
- const fraction = Math.max(0, Math.min(1, (e.clientX - rect.left - padding) / contentWidth));
2918
+ const fraction = Math.max(0, Math.min(1, (e.clientX - rect.left - TIMELINE_PADDING_PX) / contentWidth));
2555
2919
  setHoverFraction(fraction);
2556
2920
  }, []);
2557
2921
  const handleTimelineMouseLeave = reactExports.useCallback(() => {
@@ -2573,14 +2937,14 @@ function NewTraceViewerContent({ trace }) {
2573
2937
  return;
2574
2938
  e.preventDefault();
2575
2939
  const rect = el.getBoundingClientRect();
2576
- const contentWidth = rect.width - TIMELINE_PADDING * 2;
2940
+ const contentWidth = rect.width - TIMELINE_PADDING_PX * 2;
2577
2941
  if (contentWidth <= 0)
2578
2942
  return;
2579
2943
  if (isZoomGesture) {
2580
2944
  let dy = e.deltaY;
2581
2945
  if (e.deltaMode === 1)
2582
2946
  dy *= 16;
2583
- const cursorFraction = Math.max(0, Math.min(1, (e.clientX - rect.left - TIMELINE_PADDING) / contentWidth));
2947
+ const cursorFraction = Math.max(0, Math.min(1, (e.clientX - rect.left - TIMELINE_PADDING_PX) / contentWidth));
2584
2948
  const scaleFactor = Math.pow(2, dy / 200);
2585
2949
  setViewport((prev) => {
2586
2950
  const prevDuration = prev.end - prev.start;
@@ -2627,18 +2991,24 @@ function NewTraceViewerContent({ trace }) {
2627
2991
  if (!(selectedSpan == null ? void 0 : selectedSpan.data))
2628
2992
  return "Details";
2629
2993
  const data = selectedSpan.data;
2994
+ if (selectedSpan.resource === "hook") {
2995
+ return data.token ?? data.hookId;
2996
+ }
2630
2997
  const stepName = data.stepName;
2631
2998
  const workflowName = data.workflowName;
2632
2999
  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";
2633
- }, [selectedSpan == null ? void 0 : selectedSpan.data]);
3000
+ }, [selectedSpan == null ? void 0 : selectedSpan.data, selectedSpan == null ? void 0 : selectedSpan.resource]);
2634
3001
  const selectedResource = selectedSpan == null ? void 0 : selectedSpan.resource;
2635
3002
  const selectedResourceId = reactExports.useMemo(() => {
2636
3003
  if (!(selectedSpan == null ? void 0 : selectedSpan.data))
2637
3004
  return void 0;
2638
3005
  const data = selectedSpan.data;
3006
+ if (selectedSpan.resource === "hook") {
3007
+ return data.hookId ?? selectedSpan.spanId;
3008
+ }
2639
3009
  return data.stepId ?? data.runId ?? data.hookId ?? selectedSpan.spanId;
2640
- }, [selectedSpan == null ? void 0 : selectedSpan.data, selectedSpan == null ? void 0 : selectedSpan.spanId]);
2641
- return jsxRuntimeExports.jsxs("div", { "data-pane": "pane-root", "data-has-detail": activeSpan ? "" : void 0, className: "grid w-full h-full max-h-full grid-cols-[minmax(100px,1fr)] data-[has-detail]:grid-cols-[minmax(100px,1fr)_clamp(280px,420px,100%)]", children: [jsxRuntimeExports.jsx("div", { id: "trace-parent", className: "grid grid-rows-[1fr] h-full min-h-0 overflow-hidden relative bg-background-100", children: jsxRuntimeExports.jsxs(SplitPane, { startHeader: jsxRuntimeExports.jsxs("div", { className: "bg-background-100 border-b border-gray-alpha-400 h-10 min-h-10 flex items-center px-2 gap-1.5", children: [jsxRuntimeExports.jsx(Search, { className: "w-3.5 h-3.5 shrink-0 text-gray-800" }), jsxRuntimeExports.jsx("input", { id: "trace-viewer-search", name: "trace-viewer-search", type: "text", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search spans...", "aria-label": "Search spans", className: "flex-1 min-w-0 bg-transparent text-sm text-gray-1000 placeholder:text-gray-800 outline-none" }), searchQuery && jsxRuntimeExports.jsx("button", { type: "button", onClick: () => setSearchQuery(""), className: "shrink-0 p-0.5 rounded-sm text-gray-800 hover:text-gray-1000 hover:bg-gray-200 transition-colors", children: jsxRuntimeExports.jsx(X, { className: "w-3 h-3" }) })] }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { viewStart: viewport.start, viewDuration, rootStart: root.startTime, compression, isZoomed, onResetZoom: resetZoom, hoverInfo }), children: [jsxRuntimeExports.jsx("div", { className: "block overflow-visible", children: jsxRuntimeExports.jsx(EventList, { spans: filteredSpans, activeSpanId, onSelectSpan: handleSelectSpan }) }), jsxRuntimeExports.jsx("div", { ref: timelineRef, className: "block min-h-0 overflow-visible relative px-2", onDoubleClick: resetZoom, onMouseMove: handleTimelineMouseMove, onMouseLeave: handleTimelineMouseLeave, children: jsxRuntimeExports.jsx(Timeline, { spans: filteredSpans, compression, selectedId: activeSpanId, onSelect: handleSelectSpan, hoverFraction, altHeld }) })] }) }), activeSpan && sidebar ? jsxRuntimeExports.jsxs("aside", { className: "flex flex-col h-full max-h-full bg-background-100 border-l border-gray-alpha-400 overflow-auto", children: [jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 px-4 pt-4 pb-3", children: jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [jsxRuntimeExports.jsx("span", { className: "text-[15px] font-semibold text-gray-1000 truncate block", children: selectedSpanName }), selectedResourceId && jsxRuntimeExports.jsxs("div", { className: "mt-1 flex items-center gap-2", children: [selectedResource && jsxRuntimeExports.jsx("span", { className: `inline-flex items-center rounded-md px-1.5 py-0.5 text-[11px] font-medium leading-none shrink-0 ${selectedResource === "step" ? "bg-green-200 text-green-900" : selectedResource === "run" ? "bg-blue-200 text-blue-900" : selectedResource === "hook" ? "bg-yellow-200 text-yellow-900" : "bg-gray-200 text-gray-900"}`, children: selectedResource.charAt(0).toUpperCase() + selectedResource.slice(1) }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 text-[13px] font-mono text-gray-700 min-w-0", title: selectedResourceId, children: [jsxRuntimeExports.jsx("span", { className: "truncate", children: selectedResourceId }), jsxRuntimeExports.jsx(CopyButton, { copyText: selectedResourceId, ariaLabel: "Copy ID", className: "shrink-0" })] })] })] }), jsxRuntimeExports.jsx("button", { type: "button", className: "p-1 rounded-md text-gray-900 hover:text-gray-1000 hover:bg-gray-alpha-200 transition-colors shrink-0", onClick: clearActiveSpan, children: jsxRuntimeExports.jsx(X, { className: "w-4 h-4" }) })] }) }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: jsxRuntimeExports.jsx(ErrorBoundary, { children: jsxRuntimeExports.jsx(EntityDetailPanel, { run: sidebar.run, onStreamClick: sidebar.onStreamClick, onRunClick: sidebar.onRunClick, spanDetailData: sidebar.spanDetailData, spanDetailError: sidebar.spanDetailError, spanDetailLoading: sidebar.spanDetailLoading, onSpanSelect: sidebar.onSpanSelect, onWakeUpSleep: sidebar.onWakeUpSleep, onLoadEventData: sidebar.onLoadEventData, onResolveHook: sidebar.onResolveHook, encryptionKey: sidebar.encryptionKey, onDecrypt: sidebar.onDecrypt, isDecrypting: sidebar.isDecrypting, selectedSpan }) }) })] }) : activeSpan ? jsxRuntimeExports.jsx(DetailPanel, { span: activeSpan, rootStart: root.startTime, onClose: clearActiveSpan }) : null] });
3010
+ }, [selectedSpan == null ? void 0 : selectedSpan.data, selectedSpan == null ? void 0 : selectedSpan.resource, selectedSpan == null ? void 0 : selectedSpan.spanId]);
3011
+ return jsxRuntimeExports.jsxs("div", { "data-pane": "pane-root", "data-has-detail": activeSpan ? "" : void 0, className: "grid w-full h-full max-h-full grid-cols-[minmax(100px,1fr)] data-[has-detail]:grid-cols-[minmax(100px,1fr)_clamp(280px,420px,100%)]", children: [jsxRuntimeExports.jsxs("div", { id: "trace-parent", className: "grid grid-rows-[1fr] h-full min-h-0 overflow-hidden relative bg-background-100", children: [jsxRuntimeExports.jsxs(SplitPane, { startHeader: jsxRuntimeExports.jsxs("div", { className: "bg-background-100 border-b border-gray-alpha-400 h-10 min-h-10 flex items-center px-2 gap-1.5", children: [jsxRuntimeExports.jsx(Search, { className: "w-3.5 h-3.5 shrink-0 text-gray-800" }), jsxRuntimeExports.jsx("input", { id: "trace-viewer-search", name: "trace-viewer-search", type: "text", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search spans...", "aria-label": "Search spans", className: "flex-1 min-w-0 bg-transparent text-sm text-gray-1000 placeholder:text-gray-800 outline-none" }), searchQuery && jsxRuntimeExports.jsx("button", { type: "button", onClick: () => setSearchQuery(""), className: "shrink-0 p-0.5 rounded-sm text-gray-800 hover:text-gray-1000 hover:bg-gray-200 transition-colors", children: jsxRuntimeExports.jsx(X, { className: "w-3 h-3" }) })] }), endHeader: jsxRuntimeExports.jsx(TimelineHeader, { markers: timeMarkers, hoverInfo }), children: [jsxRuntimeExports.jsx("div", { className: "block overflow-visible", children: jsxRuntimeExports.jsx(EventList, { spans: filteredSpans, activeSpanId, onSelectSpan: handleSelectSpan }) }), jsxRuntimeExports.jsx("div", { ref: timelineRef, className: "block min-h-0 overflow-visible relative", onDoubleClick: resetZoom, onMouseMove: handleTimelineMouseMove, onMouseLeave: handleTimelineMouseLeave, children: jsxRuntimeExports.jsx(Timeline, { spans: filteredSpans, viewStart: viewport.start, viewEnd: viewport.end, markers: timeMarkers, selectedId: activeSpanId, onSelect: handleSelectSpan, hoverFraction, altHeld }) })] }), jsxRuntimeExports.jsxs("div", { className: "absolute right-3 bottom-3 z-[5] flex items-center border border-gray-alpha-400 rounded-lg bg-background-100 shadow-sm overflow-hidden divide-x divide-gray-alpha-400", children: [jsxRuntimeExports.jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 text-gray-900 cursor-pointer transition-colors duration-[120ms] ease-in-out hover:text-gray-1000 hover:bg-gray-alpha-100", onClick: zoomOut, "aria-label": "Zoom out", children: jsxRuntimeExports.jsx(ZoomOut, { className: "w-4 h-4" }) }), jsxRuntimeExports.jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 text-gray-900 cursor-pointer transition-colors duration-[120ms] ease-in-out hover:text-gray-1000 hover:bg-gray-alpha-100", onClick: resetZoom, "aria-label": "Reset zoom", children: jsxRuntimeExports.jsx(RotateCcw, { className: "w-3.5 h-3.5" }) }), jsxRuntimeExports.jsx("button", { type: "button", className: "flex items-center justify-center w-8 h-8 text-gray-900 cursor-pointer transition-colors duration-[120ms] ease-in-out hover:text-gray-1000 hover:bg-gray-alpha-100", onClick: zoomIn, "aria-label": "Zoom in", children: jsxRuntimeExports.jsx(ZoomIn, { className: "w-4 h-4" }) })] })] }), activeSpan && sidebar ? jsxRuntimeExports.jsxs("aside", { className: "flex flex-col h-full max-h-full bg-background-100 border-l border-gray-alpha-400 overflow-auto", children: [jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 px-4 pt-4 pb-3", children: jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [jsxRuntimeExports.jsx("span", { className: "text-[15px] font-semibold text-gray-1000 truncate block", children: selectedSpanName }), selectedResourceId && jsxRuntimeExports.jsxs("div", { className: "mt-1 flex items-center gap-2", children: [selectedResource && jsxRuntimeExports.jsx("span", { className: `inline-flex items-center rounded-md px-1.5 py-0.5 text-[11px] font-medium leading-none shrink-0 ${selectedResource === "step" ? "bg-green-200 text-green-900" : selectedResource === "run" ? "bg-blue-200 text-blue-900" : selectedResource === "hook" ? "bg-yellow-200 text-yellow-900" : "bg-gray-200 text-gray-900"}`, children: selectedResource.charAt(0).toUpperCase() + selectedResource.slice(1) }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 text-[13px] font-mono text-gray-700 min-w-0", title: selectedResourceId, children: [jsxRuntimeExports.jsx("span", { className: "truncate", children: selectedResourceId }), jsxRuntimeExports.jsx(CopyButton, { copyText: selectedResourceId, ariaLabel: "Copy ID", className: "shrink-0" })] })] })] }), jsxRuntimeExports.jsx("button", { type: "button", className: "p-1 rounded-md text-gray-900 hover:text-gray-1000 hover:bg-gray-alpha-200 transition-colors shrink-0", onClick: clearActiveSpan, children: jsxRuntimeExports.jsx(X, { className: "w-4 h-4" }) })] }) }), jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: jsxRuntimeExports.jsx(ErrorBoundary, { children: jsxRuntimeExports.jsx(EntityDetailPanel, { run: sidebar.run, onStreamClick: sidebar.onStreamClick, onRunClick: sidebar.onRunClick, spanDetailData: sidebar.spanDetailData, spanDetailError: sidebar.spanDetailError, spanDetailLoading: sidebar.spanDetailLoading, onSpanSelect: sidebar.onSpanSelect, onWakeUpSleep: sidebar.onWakeUpSleep, onLoadEventData: sidebar.onLoadEventData, onResolveHook: sidebar.onResolveHook, encryptionKey: sidebar.encryptionKey, onDecrypt: sidebar.onDecrypt, isDecrypting: sidebar.isDecrypting, selectedSpan }) }) })] }) : activeSpan ? jsxRuntimeExports.jsx(DetailPanel, { span: activeSpan, rootStart: root.startTime, onClose: clearActiveSpan }) : null] });
2642
3012
  }
2643
3013
  const NewTraceViewer = ({ run, events, sidebarData }) => {
2644
3014
  const traceWithMeta = reactExports.useMemo(() => {
@@ -4791,7 +5161,6 @@ function RunDetailView({
4791
5161
  return;
4792
5162
  }
4793
5163
  setEncryptionKey(keyResult);
4794
- toast.success("Run data decrypted successfully");
4795
5164
  } finally {
4796
5165
  setIsDecrypting(false);
4797
5166
  }
@@ -5026,7 +5395,7 @@ function RunDetailView({
5026
5395
  "Streams"
5027
5396
  ] })
5028
5397
  ] }),
5029
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "trace", className: "mt-0 flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { title: "Failed to load trace viewer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full -mx-6 pl-6 bg-background-100 border-t border-gray-alpha-400 overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
5398
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "trace", className: "mt-0 flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { title: "Failed to load trace viewer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full -mx-6 bg-background-100 border-t border-gray-alpha-400 overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
5030
5399
  NewTraceViewer,
5031
5400
  {
5032
5401
  run,