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

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 (20) hide show
  1. package/build/client/assets/{highlighted-body-B3W2YXNL-Be0uLJd8.js → highlighted-body-B3W2YXNL-B7T9pqeb.js} +1 -1
  2. package/build/client/assets/{home-Ce97yLJ7.js → home-BIQJMe_Q.js} +2 -2
  3. package/build/client/assets/{manifest-923d96a0.js → manifest-77894282.js} +1 -1
  4. package/build/client/assets/{mermaid-3ZIDBTTL-BSJR0c5A.js → mermaid-3ZIDBTTL-w46Kr90n.js} +148 -164
  5. package/build/client/assets/root-C0Tu5TVN.css +1 -0
  6. package/build/client/assets/{root-DdOfCnSG.js → root-sXuXrryl.js} +1 -1
  7. package/build/client/assets/{run-detail-JQ32aJru.js → run-detail-7Pj2mQLs.js} +411 -67
  8. package/build/client/assets/server-build-DqaxIrF0.css +1 -0
  9. package/build/client/assets/{workflow-graph-viewer-DYhMo9jl.js → workflow-graph-viewer-De9JQkZc.js} +1 -1
  10. package/build/server/assets/{app-Bh_7yjpl.js → app-CtOg8_v5.js} +1 -1
  11. package/build/server/assets/{highlighted-body-B3W2YXNL-Cdb-ypB4.js → highlighted-body-B3W2YXNL-uaucauLI.js} +2 -2
  12. package/build/server/assets/{index-CNvEtg5c.js → index-D02biwxV.js} +3 -3
  13. package/build/server/assets/{mermaid-3ZIDBTTL-CE8Volk5.js → mermaid-3ZIDBTTL-DrZ5V6uv.js} +2 -2
  14. package/build/server/assets/{server-build-DztRAoMd.js → server-build-DT0Hg0Yf.js} +666 -340
  15. package/build/server/assets/{token-DMEdoEUo.js → token-D7_Lld85.js} +2 -2
  16. package/build/server/assets/{token-util-DsMisyo3.js → token-util-CfY4anoc.js} +2 -2
  17. package/build/server/index.js +1 -1
  18. package/package.json +5 -5
  19. package/build/client/assets/root-DXDFWibD.css +0 -1
  20. package/build/client/assets/server-build-pZ5ucXET.css +0 -1
@@ -1,6 +1,6 @@
1
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";
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-De9JQkZc.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-w46Kr90n.js";
4
4
  import { decrypt, importKey } from "./encryption-80GMP4r0.js";
5
5
  /**
6
6
  * @license lucide-react v0.575.0 - ISC
@@ -8,19 +8,19 @@ import { decrypt, importKey } from "./encryption-80GMP4r0.js";
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
10
10
  */
11
- const __iconNode$2 = [
11
+ const __iconNode$5 = [
12
12
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
13
13
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
14
14
  ["path", { d: "M12 17h.01", key: "p32p05" }]
15
15
  ];
16
- const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$2);
16
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$5);
17
17
  /**
18
18
  * @license lucide-react v0.575.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
22
  */
23
- const __iconNode$1 = [
23
+ const __iconNode$4 = [
24
24
  ["path", { d: "M3 5h.01", key: "18ugdj" }],
25
25
  ["path", { d: "M3 12h.01", key: "nlz23k" }],
26
26
  ["path", { d: "M3 19h.01", key: "noohij" }],
@@ -28,18 +28,54 @@ const __iconNode$1 = [
28
28
  ["path", { d: "M8 12h13", key: "1za7za" }],
29
29
  ["path", { d: "M8 19h13", key: "m83p4d" }]
30
30
  ];
31
- const List = createLucideIcon("list", __iconNode$1);
31
+ const List = createLucideIcon("list", __iconNode$4);
32
32
  /**
33
33
  * @license lucide-react v0.575.0 - ISC
34
34
  *
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
37
  */
38
- const __iconNode = [
38
+ const __iconNode$3 = [
39
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
40
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
41
+ ];
42
+ const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$3);
43
+ /**
44
+ * @license lucide-react v0.575.0 - ISC
45
+ *
46
+ * This source code is licensed under the ISC license.
47
+ * See the LICENSE file in the root directory of this source tree.
48
+ */
49
+ const __iconNode$2 = [
39
50
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
40
51
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
41
52
  ];
42
- const Search = createLucideIcon("search", __iconNode);
53
+ const Search = createLucideIcon("search", __iconNode$2);
54
+ /**
55
+ * @license lucide-react v0.575.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */
60
+ const __iconNode$1 = [
61
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
62
+ ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
63
+ ["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
64
+ ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
65
+ ];
66
+ const ZoomIn = createLucideIcon("zoom-in", __iconNode$1);
67
+ /**
68
+ * @license lucide-react v0.575.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */
73
+ const __iconNode = [
74
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
75
+ ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
76
+ ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
77
+ ];
78
+ const ZoomOut = createLucideIcon("zoom-out", __iconNode);
43
79
  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
80
  function DecryptButton({ decrypted = false, loading = false, onClick }) {
45
81
  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"] })] });
@@ -1027,17 +1063,22 @@ const waitEventsToWaitEntity = (events) => {
1027
1063
  waitId: startEvent.correlationId,
1028
1064
  runId: startEvent.runId,
1029
1065
  createdAt: startEvent.createdAt,
1030
- resumeAt: (_a = startEvent.eventData) == null ? void 0 : _a.resumeAt,
1066
+ resumeAt: ((_a = startEvent.eventData) == null ? void 0 : _a.resumeAt) ? new Date(startEvent.eventData.resumeAt) : void 0,
1031
1067
  completedAt: completedEvent == null ? void 0 : completedEvent.createdAt
1032
1068
  };
1033
1069
  };
1034
- function waitToSpan(events, maxEndTime) {
1070
+ function waitToSpan(events, maxEndTime, fallbackEndTime = maxEndTime) {
1035
1071
  const wait = waitEventsToWaitEntity(events);
1036
1072
  if (!wait) {
1037
1073
  return null;
1038
1074
  }
1039
1075
  const startTime = wait.createdAt;
1040
- const endTime = wait.completedAt ?? maxEndTime;
1076
+ const startMs = startTime.getTime();
1077
+ let endTime = wait.completedAt;
1078
+ if (!endTime) {
1079
+ const fallbackCap = wait.resumeAt && wait.resumeAt.getTime() < fallbackEndTime.getTime() ? wait.resumeAt : fallbackEndTime;
1080
+ endTime = maxEndTime.getTime() > startMs && maxEndTime.getTime() < fallbackCap.getTime() ? maxEndTime : fallbackCap;
1081
+ }
1041
1082
  const start = dateToOtelTime(startTime);
1042
1083
  const end = dateToOtelTime(endTime);
1043
1084
  const duration = calculateDuration(startTime, endTime);
@@ -1277,9 +1318,10 @@ function computeLatestKnownTime(events, run) {
1277
1318
  }
1278
1319
  function buildSpans(run, groupedEvents, now, latestKnownTime) {
1279
1320
  const childMaxEnd = latestKnownTime;
1321
+ const runMaxEnd = run.completedAt ?? now;
1280
1322
  const stepSpans = Array.from(groupedEvents.eventsByStepId.values()).map((events) => stepToSpan(events, childMaxEnd)).filter((span) => span !== null);
1281
1323
  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);
1324
+ const waitSpans = Array.from(groupedEvents.timerEvents.values()).map((events) => waitToSpan(events, childMaxEnd, runMaxEnd)).filter((span) => span !== null);
1283
1325
  return {
1284
1326
  runSpan: runToSpan(run, groupedEvents.runLevelEvents, now),
1285
1327
  spans: [...stepSpans, ...hookSpans, ...waitSpans]
@@ -2217,7 +2259,328 @@ function CopyButton({ copyText, ariaLabel, className }) {
2217
2259
  });
2218
2260
  }, 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
2261
  }
2220
- const GUTTER_PX = 9;
2262
+ const WorkflowIcon = () => {
2263
+ 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" }) });
2264
+ };
2265
+ const WebhookIcon = () => {
2266
+ 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" }) });
2267
+ };
2268
+ const SleepIcon = () => {
2269
+ 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" }) });
2270
+ };
2271
+ const StepForwardIcon = () => {
2272
+ 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" }) });
2273
+ };
2274
+ const ELLIPSIS = "...";
2275
+ const MIN_START = 3;
2276
+ const MIN_END = 3;
2277
+ const MIN_KEPT = MIN_START + MIN_END;
2278
+ const graphemeSegmenter = typeof Intl !== "undefined" && "Segmenter" in Intl ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
2279
+ function toGraphemes(text) {
2280
+ if (graphemeSegmenter) {
2281
+ return [...graphemeSegmenter.segment(text)].map((s) => s.segment);
2282
+ }
2283
+ return Array.from(text);
2284
+ }
2285
+ function buildCandidate(graphemes, kept) {
2286
+ if (kept <= 0) {
2287
+ return {
2288
+ prefixText: "",
2289
+ prefixGraphemeCount: 0,
2290
+ suffixText: "",
2291
+ suffixGraphemeCount: 0,
2292
+ text: ELLIPSIS,
2293
+ truncated: true
2294
+ };
2295
+ }
2296
+ const suffixGraphemeCount = kept >= MIN_KEPT ? Math.max(MIN_END, Math.floor(kept / 2)) : Math.floor(kept / 2);
2297
+ const prefixGraphemeCount = kept - suffixGraphemeCount;
2298
+ const prefixText = graphemes.slice(0, prefixGraphemeCount).join("");
2299
+ const suffixText = suffixGraphemeCount > 0 ? graphemes.slice(-suffixGraphemeCount).join("") : "";
2300
+ return {
2301
+ prefixText,
2302
+ prefixGraphemeCount,
2303
+ suffixText,
2304
+ suffixGraphemeCount,
2305
+ text: prefixText + ELLIPSIS + suffixText,
2306
+ truncated: true
2307
+ };
2308
+ }
2309
+ function middleTruncate(graphemes, availableWidth, measure, fullWidth) {
2310
+ const fullText = graphemes.join("");
2311
+ const resolvedFullWidth = fullWidth ?? measure(fullText);
2312
+ if (availableWidth <= 0 || graphemes.length === 0) {
2313
+ return {
2314
+ prefixText: fullText,
2315
+ prefixGraphemeCount: graphemes.length,
2316
+ suffixText: "",
2317
+ suffixGraphemeCount: 0,
2318
+ text: fullText,
2319
+ truncated: false
2320
+ };
2321
+ }
2322
+ if (resolvedFullWidth <= availableWidth) {
2323
+ return {
2324
+ prefixText: fullText,
2325
+ prefixGraphemeCount: graphemes.length,
2326
+ suffixText: "",
2327
+ suffixGraphemeCount: 0,
2328
+ text: fullText,
2329
+ truncated: false
2330
+ };
2331
+ }
2332
+ let lo = 0;
2333
+ let hi = graphemes.length - 1;
2334
+ let best = -1;
2335
+ while (lo <= hi) {
2336
+ const mid = lo + hi >>> 1;
2337
+ const candidate = buildCandidate(graphemes, mid);
2338
+ if (measure(candidate.text) <= availableWidth) {
2339
+ best = mid;
2340
+ lo = mid + 1;
2341
+ } else {
2342
+ hi = mid - 1;
2343
+ }
2344
+ }
2345
+ if (best === -1) {
2346
+ return {
2347
+ prefixText: "",
2348
+ prefixGraphemeCount: 0,
2349
+ suffixText: "",
2350
+ suffixGraphemeCount: 0,
2351
+ text: "",
2352
+ truncated: true
2353
+ };
2354
+ }
2355
+ return buildCandidate(graphemes, best);
2356
+ }
2357
+ function getMiddleTruncateCopyText({ prefixText, selectionEnd, selectionStart, suffixText, value }) {
2358
+ const visibleText = prefixText + ELLIPSIS + suffixText;
2359
+ if (selectionStart < 0 || selectionEnd > visibleText.length || selectionStart >= selectionEnd) {
2360
+ return null;
2361
+ }
2362
+ if (selectionStart === 0 && selectionEnd === visibleText.length) {
2363
+ return value;
2364
+ }
2365
+ const ellipsisStart = prefixText.length;
2366
+ const ellipsisEnd = ellipsisStart + ELLIPSIS.length;
2367
+ if (selectionStart > ellipsisStart || selectionEnd < ellipsisEnd) {
2368
+ return null;
2369
+ }
2370
+ const originalGraphemes = toGraphemes(value);
2371
+ const selectedPrefixGraphemeCount = toGraphemes(visibleText.slice(0, selectionStart)).length;
2372
+ const selectedSuffixGraphemeCount = toGraphemes(visibleText.slice(ellipsisEnd, selectionEnd)).length;
2373
+ const suffixStart = originalGraphemes.length - toGraphemes(suffixText).length;
2374
+ return originalGraphemes.slice(selectedPrefixGraphemeCount, suffixStart + selectedSuffixGraphemeCount).join("");
2375
+ }
2376
+ function getMiddleTruncateCopyTextFromSelectionText({ prefixText, selectionText, suffixText, value }) {
2377
+ const visibleText = prefixText + ELLIPSIS + suffixText;
2378
+ const trimmedSelectionText = selectionText.trim();
2379
+ if (!trimmedSelectionText) {
2380
+ return null;
2381
+ }
2382
+ const leading = selectionText.slice(0, selectionText.length - selectionText.trimStart().length);
2383
+ const trailing = selectionText.slice(selectionText.trimEnd().length);
2384
+ if (trimmedSelectionText === visibleText) {
2385
+ return leading + value + trailing;
2386
+ }
2387
+ if (!trimmedSelectionText.includes(ELLIPSIS)) {
2388
+ return null;
2389
+ }
2390
+ const selectionStart = visibleText.indexOf(trimmedSelectionText);
2391
+ if (selectionStart === -1) {
2392
+ return null;
2393
+ }
2394
+ const selectionEnd = selectionStart + trimmedSelectionText.length;
2395
+ const mappedText = getMiddleTruncateCopyText({
2396
+ prefixText,
2397
+ selectionEnd,
2398
+ selectionStart,
2399
+ suffixText,
2400
+ value
2401
+ });
2402
+ return mappedText === null ? null : leading + mappedText + trailing;
2403
+ }
2404
+ const useIsomorphicLayoutEffect = typeof window === "undefined" ? reactExports.useEffect : reactExports.useLayoutEffect;
2405
+ function createFullState(value, graphemes) {
2406
+ return {
2407
+ displayText: value,
2408
+ isTruncated: false,
2409
+ prefixGraphemeCount: graphemes.length,
2410
+ prefixText: value,
2411
+ suffixGraphemeCount: 0,
2412
+ suffixText: ""
2413
+ };
2414
+ }
2415
+ function useMiddleTruncate(value) {
2416
+ const graphemes = reactExports.useMemo(() => toGraphemes(value), [value]);
2417
+ const fullState = reactExports.useMemo(() => createFullState(value, graphemes), [graphemes, value]);
2418
+ const ref = reactExports.useRef(null);
2419
+ const measureRef = reactExports.useRef(null);
2420
+ const [state, setState] = reactExports.useState(() => fullState);
2421
+ const rafRef = reactExports.useRef(0);
2422
+ const updateState = reactExports.useCallback((nextState) => {
2423
+ setState((currentState) => {
2424
+ 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) {
2425
+ return currentState;
2426
+ }
2427
+ return nextState;
2428
+ });
2429
+ }, []);
2430
+ const recalculate = reactExports.useCallback(() => {
2431
+ const el = ref.current;
2432
+ const measureEl = measureRef.current;
2433
+ if (!el || !measureEl)
2434
+ return;
2435
+ const available = el.clientWidth;
2436
+ if (available <= 0) {
2437
+ updateState(fullState);
2438
+ return;
2439
+ }
2440
+ const measure = (text) => {
2441
+ measureEl.textContent = text;
2442
+ return measureEl.scrollWidth;
2443
+ };
2444
+ const fullWidth = measure(value);
2445
+ if (fullWidth <= available) {
2446
+ updateState(fullState);
2447
+ return;
2448
+ }
2449
+ const result = middleTruncate(graphemes, available, measure, fullWidth);
2450
+ updateState({
2451
+ displayText: result.text,
2452
+ isTruncated: result.truncated,
2453
+ prefixGraphemeCount: result.prefixGraphemeCount,
2454
+ prefixText: result.prefixText,
2455
+ suffixGraphemeCount: result.suffixGraphemeCount,
2456
+ suffixText: result.suffixText
2457
+ });
2458
+ }, [fullState, graphemes, updateState, value]);
2459
+ useIsomorphicLayoutEffect(() => {
2460
+ recalculate();
2461
+ }, [recalculate]);
2462
+ reactExports.useEffect(() => {
2463
+ var _a;
2464
+ const el = ref.current;
2465
+ if (!el)
2466
+ return;
2467
+ const debouncedRecalc = () => {
2468
+ cancelAnimationFrame(rafRef.current);
2469
+ rafRef.current = requestAnimationFrame(recalculate);
2470
+ };
2471
+ const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(debouncedRecalc) : null;
2472
+ ro == null ? void 0 : ro.observe(el);
2473
+ window.addEventListener("resize", debouncedRecalc);
2474
+ const onFontsLoaded = () => {
2475
+ debouncedRecalc();
2476
+ };
2477
+ const fontSet = "fonts" in document ? document.fonts : null;
2478
+ (_a = fontSet == null ? void 0 : fontSet.addEventListener) == null ? void 0 : _a.call(fontSet, "loadingdone", onFontsLoaded);
2479
+ return () => {
2480
+ var _a2;
2481
+ ro == null ? void 0 : ro.disconnect();
2482
+ window.removeEventListener("resize", debouncedRecalc);
2483
+ cancelAnimationFrame(rafRef.current);
2484
+ (_a2 = fontSet == null ? void 0 : fontSet.removeEventListener) == null ? void 0 : _a2.call(fontSet, "loadingdone", onFontsLoaded);
2485
+ };
2486
+ }, [recalculate]);
2487
+ return {
2488
+ ref,
2489
+ measureRef,
2490
+ displayText: state.displayText,
2491
+ isTruncated: state.isTruncated,
2492
+ prefixGraphemeCount: state.prefixGraphemeCount,
2493
+ prefixText: state.prefixText,
2494
+ suffixGraphemeCount: state.suffixGraphemeCount,
2495
+ suffixText: state.suffixText
2496
+ };
2497
+ }
2498
+ function getRangeOffsets(container, range) {
2499
+ if (!container.contains(range.startContainer) || !container.contains(range.endContainer)) {
2500
+ return null;
2501
+ }
2502
+ const startRange = document.createRange();
2503
+ startRange.selectNodeContents(container);
2504
+ startRange.setEnd(range.startContainer, range.startOffset);
2505
+ const endRange = document.createRange();
2506
+ endRange.selectNodeContents(container);
2507
+ endRange.setEnd(range.endContainer, range.endOffset);
2508
+ return {
2509
+ end: endRange.toString().length,
2510
+ start: startRange.toString().length
2511
+ };
2512
+ }
2513
+ function MiddleTruncate({ value, className, onCopy: onCopyProp, ...props }) {
2514
+ const { ref, measureRef, displayText, isTruncated, prefixText, suffixText } = useMiddleTruncate(value);
2515
+ const visibleRef = reactExports.useRef(null);
2516
+ const handleCopy = reactExports.useCallback((e) => {
2517
+ onCopyProp == null ? void 0 : onCopyProp(e);
2518
+ if (e.defaultPrevented || !isTruncated)
2519
+ return;
2520
+ const selection = window.getSelection();
2521
+ if (!selection || selection.rangeCount === 0)
2522
+ return;
2523
+ const selectionText = selection.toString();
2524
+ if (!selectionText)
2525
+ return;
2526
+ const range = selection.getRangeAt(0);
2527
+ const visibleEl = visibleRef.current;
2528
+ let copyText = null;
2529
+ if (e.currentTarget.contains(range.startContainer) && e.currentTarget.contains(range.endContainer) && visibleEl) {
2530
+ const offsets = getRangeOffsets(visibleEl, range);
2531
+ if (offsets) {
2532
+ copyText = getMiddleTruncateCopyText({
2533
+ prefixText,
2534
+ selectionEnd: offsets.end,
2535
+ selectionStart: offsets.start,
2536
+ suffixText,
2537
+ value
2538
+ });
2539
+ }
2540
+ }
2541
+ copyText ?? (copyText = getMiddleTruncateCopyTextFromSelectionText({
2542
+ prefixText,
2543
+ selectionText,
2544
+ suffixText,
2545
+ value
2546
+ }));
2547
+ if (copyText === null)
2548
+ return;
2549
+ e.preventDefault();
2550
+ e.clipboardData.setData("text/plain", copyText);
2551
+ }, [onCopyProp, isTruncated, prefixText, suffixText, value]);
2552
+ 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 })] });
2553
+ }
2554
+ const eventStyles = {
2555
+ run: { icon: WorkflowIcon, className: "text-blue-900" },
2556
+ step: { icon: StepForwardIcon, className: "text-green-900" },
2557
+ hook: { icon: WebhookIcon, className: "text-yellow-900" },
2558
+ sleep: { icon: SleepIcon, className: "text-gray-900" }
2559
+ };
2560
+ const defaultStyle = {
2561
+ icon: Circle,
2562
+ className: "text-gray-900"
2563
+ };
2564
+ const ROW_HEIGHT_CLASS = "h-10";
2565
+ function getEventStyle(resource, isErrored) {
2566
+ const style = eventStyles[resource] ?? defaultStyle;
2567
+ return {
2568
+ icon: style.icon,
2569
+ className: cn(isErrored ? "text-red-900" : style.className)
2570
+ };
2571
+ }
2572
+ const EventRow = ({ span, isSelected, onSelectSpan }) => {
2573
+ const durationMs = getSpanDurationMs(span);
2574
+ const isErrored = span.attributes.data.status === "failed";
2575
+ const { icon: Icon, className: tagClassName } = getEventStyle(span.resource, isErrored);
2576
+ 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) }) })] }) }) });
2577
+ };
2578
+ const EventList = ({ spans, activeSpanId, onSelectSpan }) => {
2579
+ return jsxRuntimeExports.jsx("ul", { id: "event-list", role: "tree", className: "block min-h-0 overflow-visible", children: spans.map((span) => {
2580
+ return jsxRuntimeExports.jsx(EventRow, { span, isSelected: span.spanId === activeSpanId, onSelectSpan }, span.spanId);
2581
+ }) });
2582
+ };
2583
+ const GUTTER_PX = 1;
2221
2584
  const MIN_PX = 50;
2222
2585
  const DEFAULT_START_PX = 340;
2223
2586
  function SplitPane({ children, className, defaultStartWidth = DEFAULT_START_PX, startHeader, endHeader }) {
@@ -2304,58 +2667,17 @@ function SplitPane({ children, className, defaultStartWidth = DEFAULT_START_PX,
2304
2667
  const hasHeaders = startHeader != null || endHeader != null;
2305
2668
  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
2669
  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] })] });
2670
+ 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
2671
  }
2309
2672
  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
2673
  }
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
2674
  function DetailPanel({ span, rootStart, onClose }) {
2352
2675
  const startMs = getHighResInMs(span.startTime);
2353
- const durationMs = getHighResInMs(span.duration);
2676
+ const durationMs = getSpanDurationMs(span);
2354
2677
  const offsetMs = startMs - rootStart;
2355
2678
  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
2679
  }
2357
2680
  const MIN_VIEWPORT_MS = 1e-3;
2358
- const TIMELINE_PADDING = 16;
2359
2681
  function useAnimatedViewport(initial) {
2360
2682
  const [viewport, setViewportState] = reactExports.useState(initial);
2361
2683
  const animRef = reactExports.useRef(null);
@@ -2456,11 +2778,34 @@ function NewTraceViewerContent({ trace }) {
2456
2778
  prevRootRef.current = { start: newStart, end: newEnd };
2457
2779
  }, [root.startTime, root.duration]);
2458
2780
  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;
2781
+ const timeMarkers = reactExports.useMemo(() => computeTimeMarkers(viewDuration, viewport.start - root.startTime), [viewDuration, viewport.start, root.startTime]);
2461
2782
  const resetZoom = reactExports.useCallback(() => {
2462
2783
  animateTo({ start: root.startTime, end: root.startTime + root.duration });
2463
2784
  }, [animateTo, root.startTime, root.duration]);
2785
+ const ZOOM_FACTOR = 0.5;
2786
+ const zoomBy = reactExports.useCallback((factor) => {
2787
+ const rootS = root.startTime;
2788
+ const rootE = root.startTime + root.duration;
2789
+ const rootD = root.duration;
2790
+ setViewport((prev) => {
2791
+ const prevDuration = prev.end - prev.start;
2792
+ const center = (prev.start + prev.end) / 2;
2793
+ const newDuration = Math.max(MIN_VIEWPORT_MS, Math.min(rootD, prevDuration * factor));
2794
+ let newStart = center - newDuration / 2;
2795
+ let newEnd = center + newDuration / 2;
2796
+ if (newStart < rootS) {
2797
+ newStart = rootS;
2798
+ newEnd = rootS + newDuration;
2799
+ }
2800
+ if (newEnd > rootE) {
2801
+ newEnd = rootE;
2802
+ newStart = Math.max(rootS, rootE - newDuration);
2803
+ }
2804
+ return { start: newStart, end: newEnd };
2805
+ });
2806
+ }, [setViewport, root.startTime, root.duration]);
2807
+ const zoomIn = reactExports.useCallback(() => zoomBy(ZOOM_FACTOR), [zoomBy]);
2808
+ const zoomOut = reactExports.useCallback(() => zoomBy(1 / ZOOM_FACTOR), [zoomBy]);
2464
2809
  const handleSelectSpan = reactExports.useCallback((spanId) => {
2465
2810
  if (spanId === activeSpanId) {
2466
2811
  clearActiveSpan();
@@ -2538,20 +2883,19 @@ function NewTraceViewerContent({ trace }) {
2538
2883
  const hoverInfo = reactExports.useMemo(() => {
2539
2884
  if (hoverFraction == null)
2540
2885
  return null;
2541
- const absTime = compression.fromVisual(hoverFraction);
2886
+ const absTime = viewport.start + hoverFraction * viewDuration;
2542
2887
  const offset = absTime - root.startTime;
2543
2888
  return { fraction: hoverFraction, label: formatDuration(offset, true) };
2544
- }, [hoverFraction, compression, root.startTime]);
2889
+ }, [hoverFraction, viewport.start, viewDuration, root.startTime]);
2545
2890
  const handleTimelineMouseMove = reactExports.useCallback((e) => {
2546
2891
  const el = timelineRef.current;
2547
2892
  if (!el)
2548
2893
  return;
2549
2894
  const rect = el.getBoundingClientRect();
2550
- const padding = 8;
2551
- const contentWidth = rect.width - padding * 2;
2895
+ const contentWidth = rect.width - TIMELINE_PADDING_PX * 2;
2552
2896
  if (contentWidth <= 0)
2553
2897
  return;
2554
- const fraction = Math.max(0, Math.min(1, (e.clientX - rect.left - padding) / contentWidth));
2898
+ const fraction = Math.max(0, Math.min(1, (e.clientX - rect.left - TIMELINE_PADDING_PX) / contentWidth));
2555
2899
  setHoverFraction(fraction);
2556
2900
  }, []);
2557
2901
  const handleTimelineMouseLeave = reactExports.useCallback(() => {
@@ -2573,14 +2917,14 @@ function NewTraceViewerContent({ trace }) {
2573
2917
  return;
2574
2918
  e.preventDefault();
2575
2919
  const rect = el.getBoundingClientRect();
2576
- const contentWidth = rect.width - TIMELINE_PADDING * 2;
2920
+ const contentWidth = rect.width - TIMELINE_PADDING_PX * 2;
2577
2921
  if (contentWidth <= 0)
2578
2922
  return;
2579
2923
  if (isZoomGesture) {
2580
2924
  let dy = e.deltaY;
2581
2925
  if (e.deltaMode === 1)
2582
2926
  dy *= 16;
2583
- const cursorFraction = Math.max(0, Math.min(1, (e.clientX - rect.left - TIMELINE_PADDING) / contentWidth));
2927
+ const cursorFraction = Math.max(0, Math.min(1, (e.clientX - rect.left - TIMELINE_PADDING_PX) / contentWidth));
2584
2928
  const scaleFactor = Math.pow(2, dy / 200);
2585
2929
  setViewport((prev) => {
2586
2930
  const prevDuration = prev.end - prev.start;
@@ -2638,7 +2982,7 @@ function NewTraceViewerContent({ trace }) {
2638
2982
  const data = selectedSpan.data;
2639
2983
  return data.stepId ?? data.runId ?? data.hookId ?? selectedSpan.spanId;
2640
2984
  }, [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] });
2985
+ 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
2986
  }
2643
2987
  const NewTraceViewer = ({ run, events, sidebarData }) => {
2644
2988
  const traceWithMeta = reactExports.useMemo(() => {
@@ -5026,7 +5370,7 @@ function RunDetailView({
5026
5370
  "Streams"
5027
5371
  ] })
5028
5372
  ] }),
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(
5373
+ /* @__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
5374
  NewTraceViewer,
5031
5375
  {
5032
5376
  run,