@mgamadeus/ddd-agents 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +76 -0
  2. package/dist/admin.js +2 -2
  3. package/dist/chat.js +1303 -409
  4. package/dist/chat.js.map +1 -1
  5. package/dist/chunks/{agents-http-trace-mappers-LWNi-3a4.js → agents-http-trace-mappers-juBx_kw5.js} +64 -22
  6. package/dist/chunks/agents-http-trace-mappers-juBx_kw5.js.map +1 -0
  7. package/dist/chunks/{canvas-title-slot-context-BRGnFzYP.js → canvas-label-context-B54MYVLF.js} +16 -4
  8. package/dist/chunks/canvas-label-context-B54MYVLF.js.map +1 -0
  9. package/dist/chunks/{content-from-unified-diff-CovnmG2Q.js → content-from-unified-diff-lgH6CejC.js} +77 -46
  10. package/dist/chunks/content-from-unified-diff-lgH6CejC.js.map +1 -0
  11. package/dist/chunks/{contract-886XjdID.js → contract-CIXLnSqL.js} +2 -1
  12. package/dist/chunks/{contract-886XjdID.js.map → contract-CIXLnSqL.js.map} +1 -1
  13. package/dist/chunks/conversation-B7-evdj_.js.map +1 -1
  14. package/dist/chunks/conversation-trace-fVeh6Lg6.js +6 -0
  15. package/dist/chunks/conversation-trace-fVeh6Lg6.js.map +1 -0
  16. package/dist/chunks/index-DZovGMpG.js.map +1 -1
  17. package/dist/client.js +13 -8
  18. package/dist/client.js.map +1 -1
  19. package/dist/contract.js +3 -1
  20. package/dist/contract.js.map +1 -1
  21. package/dist/files/i18n-keys.json +496 -12
  22. package/dist/files/styles/_surfaces.scss +5 -0
  23. package/dist/renderer.js +10 -8
  24. package/dist/styles.css +920 -39
  25. package/dist/types/chat/CanvasResizeHandle/CanvasResizeHandle.d.ts +2 -0
  26. package/dist/types/chat/CanvasResizeHandle/use-canvas-resize.d.ts +4 -2
  27. package/dist/types/chat/ConversationMessage/ConversationCallMarkerChip/ConversationCallMarkerChip.d.ts +6 -1
  28. package/dist/types/chat/ConversationMessageList/ConversationMessageList.d.ts +8 -1
  29. package/dist/types/chat/ConversationMessageList/message-times.d.ts +55 -0
  30. package/dist/types/chat/ConversationView.d.ts +3 -0
  31. package/dist/types/chat/ConversationViewBody/ConversationViewBody.d.ts +3 -0
  32. package/dist/types/chat/canvas-layout.d.ts +13 -0
  33. package/dist/types/chat/controller/AgentChatController.d.ts +7 -0
  34. package/dist/types/chat/trace/TaskPlanDrawer.d.ts +45 -0
  35. package/dist/types/chat/trace/TaskPlanPane.d.ts +21 -12
  36. package/dist/types/chat/trace/ToolStepGroup.d.ts +2 -0
  37. package/dist/types/chat/trace/TraceViewModeSwitch.d.ts +10 -2
  38. package/dist/types/chat/trace/index.d.ts +4 -1
  39. package/dist/types/chat/trace/task-plan-tree.d.ts +55 -0
  40. package/dist/types/chat/trace/trace-collect.d.ts +15 -0
  41. package/dist/types/chat/trace/trace-types.d.ts +20 -0
  42. package/dist/types/chat/trace/trace-view-policy.d.ts +17 -0
  43. package/dist/types/client/http/agents-http-trace-mappers.d.ts +8 -1
  44. package/dist/types/client/http/agents-http-trace-wire.d.ts +27 -0
  45. package/dist/types/client/http/agents-http-wire.d.ts +4 -0
  46. package/dist/types/contract/conversation-trace.d.ts +63 -1
  47. package/dist/types/contract/conversation.d.ts +11 -0
  48. package/dist/types/entries/chat.d.ts +1 -0
  49. package/dist/types/entries/renderer.d.ts +1 -0
  50. package/dist/types/provider/components/types.d.ts +5 -0
  51. package/dist/types/provider/environment.d.ts +26 -0
  52. package/dist/types/provider/index.d.ts +1 -1
  53. package/dist/types/renderer/canvas/canvas-label-context.d.ts +10 -0
  54. package/package.json +1 -1
  55. package/public-api.json +40 -0
  56. package/dist/chunks/agents-http-trace-mappers-LWNi-3a4.js.map +0 -1
  57. package/dist/chunks/canvas-title-slot-context-BRGnFzYP.js.map +0 -1
  58. package/dist/chunks/content-from-unified-diff-CovnmG2Q.js.map +0 -1
package/dist/chat.js CHANGED
@@ -3,38 +3,38 @@ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
3
3
  import { useRef, useEffect, useMemo, useState, useImperativeHandle, useLayoutEffect, memo, useCallback, Fragment, useReducer, useSyncExternalStore } from "react";
4
4
  import { u as useAgentsConversationClient, a as useOptionalAgentsConversationClient, A as AgentsConversationClientProvider } from "./chunks/AgentsConversationClientContext-B_UJSLXU.js";
5
5
  import { w as withPollingChangeSubscription } from "./chunks/withPollingChangeSubscription-XvCpjGmd.js";
6
- import { r as Text, E as classNames, I as Icon, a9 as useAgentsTexts, G as GlowFrame, u as Tooltip, B as Button, m as Skeleton, i as Markdown, J as getAgentDisplayName, a2 as useAgentsBudgetLimit, a4 as useAgentsEnvironment, g as InteractiveSurface, L as LoadingSpinner, a0 as translateText, o as SplitView, Z as reportRunningTurn, a1 as useAgentsActiveAgentSpaceKey, P as ProgressBar } from "./chunks/index-DZovGMpG.js";
6
+ import { r as Text, E as classNames, I as Icon, a9 as useAgentsTexts, G as GlowFrame, u as Tooltip, B as Button, m as Skeleton, i as Markdown, a0 as translateText, a6 as useAgentsOwnerSettings, J as getAgentDisplayName, a2 as useAgentsBudgetLimit, a4 as useAgentsEnvironment, g as InteractiveSurface, L as LoadingSpinner, o as SplitView, Z as reportRunningTurn, a1 as useAgentsActiveAgentSpaceKey, P as ProgressBar } from "./chunks/index-DZovGMpG.js";
7
7
  import { i as isAgentsClientError, A as AgentsClientError } from "./chunks/conversation-B7-evdj_.js";
8
8
  import { n as normalizeServerMessageToMarkdown, V as VoiceBarsIcon, b as ConversationMessageHeader, a as ConversationMessageUser, C as ConversationMessageWidgets } from "./chunks/VoiceBarsIcon-y3mgSqbn.js";
9
- import { a1 as useConversationWidgetContext, j as canvasBehaviourOf, J as canvasKindOpenerWidgetNamesOf, p as payloadHashOfInstanceId, A as buildWidgetAgentSpaceKeyProps, t as CHAT_COLUMN_MIN_WIDTH_PX, q as CANVAS_MIN_WIDTH_PX, bg as useCanvasViable, D as DEFAULT_CANVAS_WIDTH_PERCENT, K as canvasWidthPercentOf, C as CANVAS_BOXED_INSET_PX, aq as ElementWidthCanvasViability, ae as CanvasViabilityContext } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
9
+ import { a1 as useConversationWidgetContext, j as canvasBehaviourOf, J as canvasKindOpenerWidgetNamesOf, p as payloadHashOfInstanceId, A as buildWidgetAgentSpaceKeyProps, C as CANVAS_BOXED_INSET_PX, t as CHAT_COLUMN_MIN_WIDTH_PX, q as CANVAS_MIN_WIDTH_PX, bg as useCanvasViable, D as DEFAULT_CANVAS_WIDTH_PERCENT, K as canvasWidthPercentOf, aq as ElementWidthCanvasViability, ae as CanvasViabilityContext } from "./chunks/WebSearchResultsConversationWidget-l9Aek_lG.js";
10
10
  import { j as conversationWidgetRegistry, n as findWidgetFencesInMarkdown, o as ConversationWidgetErrorBoundary, p as ConversationWidgetFeatureGate, T as parseWidgetJsonObject, F as resolveCanonicalWidgetName, W as WIDGET_FENCE_LANG, y as getConversationWidgetRegistryRevision, U as BARE_WIDGET_LINE_GLOBAL, G as resolveWidgetName, t as closestWidgetNames } from "./chunks/widget-name-resolver-DS3zH_5W.js";
11
11
  import { r as readStoredCanvas, c as clearStoredCanvas } from "./chunks/canvasStorage-DSspwRMg.js";
12
- import { r as resolveDeepLinkableWidget, i as isWidgetClickSignalSource, C as CanvasTitleSlotContext } from "./chunks/canvas-title-slot-context-BRGnFzYP.js";
12
+ import { r as resolveDeepLinkableWidget, i as isWidgetClickSignalSource, a as CanvasTitleSlotContext, C as CanvasLabelContext } from "./chunks/canvas-label-context-B54MYVLF.js";
13
13
  import { b as ConversationErrorType, a as ConversationMessageInputComposerWidgets, C as ConversationWidgetProvider, c as createAgentsChatStore } from "./chunks/ConversationMessageInputComposerWidgets-TchR1lPj.js";
14
14
  import { A, E, I, r, d } from "./chunks/ConversationMessageInputComposerWidgets-TchR1lPj.js";
15
15
  import { c as buildMessageTextWithComposerWidgets, e as WidgetWindowRootContext, f as findBalancedJsonObjectEnd, d as buildWidgetRenderReportSignal, W as WIDGET_RENDER_REPORT_SIGNAL_SOURCE, g as createWidgetRenderReportCollector, h as WidgetRenderReportCollectorContext } from "./chunks/ConversationMarkdown-DlvwT3Qk.js";
16
- import { l as lastWireMessageIsUnansweredUserMessage, P as PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES, b as buildChangedMessagesRequest, S as SIGNAL_SOURCES_THAT_OWE_NO_WORK, d as deriveAgentActivity } from "./chunks/contract-886XjdID.js";
16
+ import { S as SIGNAL_SOURCES_THAT_OWE_NO_WORK, P as PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES, l as lastWireMessageIsUnansweredUserMessage, b as buildChangedMessagesRequest, d as deriveAgentActivity } from "./chunks/contract-CIXLnSqL.js";
17
17
  import { t as textKey } from "./chunks/text-key-DnoZ4lAk.js";
18
+ import { r as readTraceMoment, s as styles$m, u as useTraceFormat, a as useTraceNow, b as agentStyles, T as TraceStateIcon, f as formatTraceClock, c as readTraceStateLabel, d as styles$n, F as FileChangesSummary, e as readTraceFileChangeLetter, g as readTraceFileChangeWord, h as TracePath, i as TraceMountChip, j as TraceLink, k as FileEditBlock, E as EntityChip, l as selectVisibleTraceSteps, m as TraceStepRow, n as TaskPlanRow$1, o as readTaskPlanCountsOfStep, p as buildTaskPlanItems, q as describeStepCount, M as MIN_SHOWN_TURN_DURATION_MS, t as TurnMetaLine, v as ToolStepGroup, w as readTaskPlanCounts, x as describeTaskPlanProgress, y as isTraceBackgroundJobLabel, z as readTraceSubAgentState, A as describeTraceBackgroundJob, B as readTraceStepState } from "./chunks/content-from-unified-diff-lgH6CejC.js";
19
+ import { C, D, L, S, G, H, I as I2, J, K, N, O, P, Q, R, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar } from "./chunks/content-from-unified-diff-lgH6CejC.js";
18
20
  import { c as canvasBodies } from "./chunks/canvasBodies-BjXypuHf.js";
19
21
  import { a as canvasFeatureFlagOf } from "./chunks/canvas-feature-flags-Cn8xBliA.js";
20
22
  import { flushSync } from "react-dom";
21
23
  import { u as useAgentsChatSelector, a as useOptionalAgentsChatStore } from "./chunks/use-agents-chat-store-CuIkCz9v.js";
22
24
  import { A as A2, b, c } from "./chunks/use-agents-chat-store-CuIkCz9v.js";
23
- import { s as styles$l, u as useTraceFormat, a as useTraceNow, b as agentStyles, T as TraceStateIcon, r as readTraceMoment, f as formatTraceClock, c as readTraceStateLabel, d as styles$m, F as FileChangesSummary, e as readTraceFileChangeLetter, g as readTraceFileChangeWord, h as TracePath, i as TraceMountChip, j as TraceLink, k as FileEditBlock, E as EntityChip, l as selectVisibleTraceSteps, m as TraceStepRow, n as TaskPlanRow, o as readTaskPlanCountsOfStep, p as buildTaskPlanItems, q as describeStepCount, t as TurnMetaLine, v as ToolStepGroup, w as readTaskPlanCounts, x as describeTaskPlanProgress, y as isTraceBackgroundJobLabel, z as readTraceSubAgentState, A as describeTraceBackgroundJob, B as readTraceStepState } from "./chunks/content-from-unified-diff-CovnmG2Q.js";
24
- import { C, D, L, S, G, H, I as I2, J, K, M, N, O, P, Q, R, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak } from "./chunks/content-from-unified-diff-CovnmG2Q.js";
25
25
  const history = "agents_history_BIbikt";
26
- const styles$k = {
26
+ const styles$l = {
27
27
  history
28
28
  };
29
29
  const AgentChatActivityHistory = (props) => {
30
30
  const { turn } = props;
31
31
  if (turn === null || turn.lines.length === 0) return null;
32
- return /* @__PURE__ */ jsx("div", { className: styles$k.history, "data-testid": "agent-chat-activity-history", children: turn.lines.map((line2) => /* @__PURE__ */ jsx(Text, { role: "help", color: "--agents-fg-light", translate: false, children: line2.line }, `${line2.toolCallMessageId}-${line2.state}`)) });
32
+ return /* @__PURE__ */ jsx("div", { className: styles$l.history, "data-testid": "agent-chat-activity-history", children: turn.lines.map((line2) => /* @__PURE__ */ jsx(Text, { role: "help", color: "--agents-fg-light", translate: false, children: line2.line }, `${line2.toolCallMessageId}-${line2.state}`)) });
33
33
  };
34
34
  const dots = "agents_dots_ndE4a-";
35
35
  const bounce = "agents_bounce_rAVWhT";
36
36
  const pulse = "agents_pulse_r0EheQ";
37
- const styles$j = {
37
+ const styles$k = {
38
38
  dots,
39
39
  bounce,
40
40
  pulse
@@ -42,7 +42,7 @@ const styles$j = {
42
42
  const AgentChatActivityDots = ({ variant = "bounce" }) => /* @__PURE__ */ jsxs(
43
43
  "div",
44
44
  {
45
- className: classNames(styles$j.dots, variant === "pulse" ? styles$j.pulse : styles$j.bounce),
45
+ className: classNames(styles$k.dots, variant === "pulse" ? styles$k.pulse : styles$k.bounce),
46
46
  "aria-hidden": "true",
47
47
  "data-agents-activity-dots": variant,
48
48
  children: [
@@ -53,7 +53,7 @@ const AgentChatActivityDots = ({ variant = "bounce" }) => /* @__PURE__ */ jsxs(
53
53
  }
54
54
  );
55
55
  const activity = "agents_activity_Gv-0ee";
56
- const styles$i = {
56
+ const styles$j = {
57
57
  activity
58
58
  };
59
59
  const AgentChatActivityIndicator = (props) => {
@@ -62,20 +62,20 @@ const AgentChatActivityIndicator = (props) => {
62
62
  if (!isWorking) return null;
63
63
  const currentLines = activityTicker.currentTurn?.lines ?? [];
64
64
  const currentLine = currentLines.length > 0 ? currentLines[currentLines.length - 1].line : null;
65
- return /* @__PURE__ */ jsxs("div", { className: styles$i.activity, role: "status", "aria-live": "polite", "data-testid": "agent-chat-activity", children: [
65
+ return /* @__PURE__ */ jsxs("div", { className: styles$j.activity, role: "status", "aria-live": "polite", "data-testid": "agent-chat-activity", children: [
66
66
  /* @__PURE__ */ jsx(AgentChatActivityDots, { variant: dotsVariant }),
67
67
  currentLine !== null ? /* @__PURE__ */ jsx(Text, { role: "help", color: "--agents-fg-light", translate: false, children: currentLine }) : /* @__PURE__ */ jsx(Text, { role: "help", color: "--agents-fg-light", children: "Working on it…" })
68
68
  ] });
69
69
  };
70
70
  const bar = "agents_bar_DAkgRp";
71
- const styles$h = {
71
+ const styles$i = {
72
72
  bar
73
73
  };
74
74
  const ConversationClosedBar = (props) => {
75
- const { text = "This conversation is closed." } = props;
76
- return /* @__PURE__ */ jsxs("div", { className: styles$h.bar, "data-testid": "agent-chat-closed-bar", children: [
75
+ const { text: text2 = "This conversation is closed." } = props;
76
+ return /* @__PURE__ */ jsxs("div", { className: styles$i.bar, "data-testid": "agent-chat-closed-bar", children: [
77
77
  /* @__PURE__ */ jsx(Icon, { name: "check", color: "--agents-success-500" }),
78
- /* @__PURE__ */ jsx(Text, { children: text })
78
+ /* @__PURE__ */ jsx(Text, { children: text2 })
79
79
  ] });
80
80
  };
81
81
  const anchorMessageCarriesCanvasWidget = (pointer, anchorMessage) => {
@@ -157,7 +157,7 @@ const input = "agents_input_GCtiXU";
157
157
  const inputReplacement = "agents_inputReplacement_EAhjsv";
158
158
  const inputInCategory = "agents_inputInCategory_RDuOYA";
159
159
  const olderLoading = "agents_olderLoading_5X7nMg";
160
- const styles$g = {
160
+ const styles$h = {
161
161
  chat,
162
162
  genericChat,
163
163
  customBg,
@@ -192,7 +192,7 @@ const compactTopSlot = "agents_compactTopSlot_x57yOL";
192
192
  const compactActionsStart = "agents_compactActionsStart_3SeY5C";
193
193
  const collapsed = "agents_collapsed_v3Ekqz";
194
194
  const collapsedPillSizer = "agents_collapsedPillSizer_aqw7WI";
195
- const styles$f = {
195
+ const styles$g = {
196
196
  inputContainer,
197
197
  aiGlow,
198
198
  editableInput,
@@ -262,10 +262,10 @@ const ConversationMessageInput = (props) => {
262
262
  sel?.removeAllRanges();
263
263
  sel?.addRange(range);
264
264
  };
265
- const setInputText = (text) => {
266
- setInputValue(text);
265
+ const setInputText = (text2) => {
266
+ setInputValue(text2);
267
267
  if (inputRef.current) {
268
- inputRef.current.textContent = text;
268
+ inputRef.current.textContent = text2;
269
269
  focusInputAtEnd();
270
270
  }
271
271
  };
@@ -352,17 +352,17 @@ const ConversationMessageInput = (props) => {
352
352
  useEffect(() => {
353
353
  const handlePasteEvent = (e) => {
354
354
  e.preventDefault();
355
- const text = e.clipboardData?.getData("text/plain");
356
- if (!text) {
355
+ const text2 = e.clipboardData?.getData("text/plain");
356
+ if (!text2) {
357
357
  return;
358
358
  }
359
359
  if (document.queryCommandSupported?.("insertText")) {
360
- document.execCommand("insertText", false, text);
360
+ document.execCommand("insertText", false, text2);
361
361
  } else {
362
362
  const sel = window.getSelection();
363
363
  if (!sel || sel.rangeCount === 0) return;
364
364
  sel.deleteFromDocument();
365
- sel.getRangeAt(0).insertNode(document.createTextNode(text));
365
+ sel.getRangeAt(0).insertNode(document.createTextNode(text2));
366
366
  sel.collapseToEnd();
367
367
  }
368
368
  setInputValue(inputRef.current?.textContent || "");
@@ -378,7 +378,7 @@ const ConversationMessageInput = (props) => {
378
378
  /* @__PURE__ */ jsx(
379
379
  GlowFrame,
380
380
  {
381
- className: classNames(styles$f.aiGlow),
381
+ className: classNames(styles$g.aiGlow),
382
382
  color: isMessageTooLong ? "var(--agents-danger-500)" : void 0,
383
383
  borderRadius: compact2 ? COMPACT_INPUT_RADIUS_PX : void 0,
384
384
  borderWidth: 2,
@@ -387,20 +387,20 @@ const ConversationMessageInput = (props) => {
387
387
  "div",
388
388
  {
389
389
  className: classNames(
390
- styles$f.inputContainer,
390
+ styles$g.inputContainer,
391
391
  {
392
- [styles$f.compact]: compact2,
393
- [styles$f.compactStacked]: isCompactStacked,
394
- [styles$f.compactWithActionsStart]: isCompactStacked && !!actionsSlotStart,
395
- [styles$f.collapsed]: compact2 && collapsed2
392
+ [styles$g.compact]: compact2,
393
+ [styles$g.compactStacked]: isCompactStacked,
394
+ [styles$g.compactWithActionsStart]: isCompactStacked && !!actionsSlotStart,
395
+ [styles$g.collapsed]: compact2 && collapsed2
396
396
  },
397
397
  inputContainerClassName
398
398
  ),
399
399
  onMouseDown: handleContainerMouseDown,
400
400
  children: [
401
- isCompactStacked && !!topSlot && /* @__PURE__ */ jsx("div", { className: styles$f.compactTopSlot, children: topSlot }),
401
+ isCompactStacked && !!topSlot && /* @__PURE__ */ jsx("div", { className: styles$g.compactTopSlot, children: topSlot }),
402
402
  !isCompactStacked && topSlot,
403
- isCompactStacked && !!actionsSlotStart && /* @__PURE__ */ jsx("div", { className: styles$f.compactActionsStart, children: actionsSlotStart }),
403
+ isCompactStacked && !!actionsSlotStart && /* @__PURE__ */ jsx("div", { className: styles$g.compactActionsStart, children: actionsSlotStart }),
404
404
  /* @__PURE__ */ jsx(
405
405
  "span",
406
406
  {
@@ -410,26 +410,26 @@ const ConversationMessageInput = (props) => {
410
410
  onCompositionStart: handleCompositionStart,
411
411
  onCompositionEnd: handleCompositionEnd,
412
412
  onKeyDown: handleKeyPress,
413
- className: `${styles$f.editableInput} ${!inputValue ? styles$f.showPlaceholder : ""}`,
413
+ className: `${styles$g.editableInput} ${!inputValue ? styles$g.showPlaceholder : ""}`,
414
414
  "data-placeholder": translatedPlaceholder,
415
415
  "data-testid": `${testId}-textarea`
416
416
  }
417
417
  ),
418
- inputValue.length >= CHARACTER_COUNTER_SHOWN_FROM_LENGTH && /* @__PURE__ */ jsx("div", { className: styles$f.statusRow, children: /* @__PURE__ */ jsx(
418
+ inputValue.length >= CHARACTER_COUNTER_SHOWN_FROM_LENGTH && /* @__PURE__ */ jsx("div", { className: styles$g.statusRow, children: /* @__PURE__ */ jsx(
419
419
  Text,
420
420
  {
421
421
  role: "caption",
422
422
  translate: false,
423
423
  color: isMessageTooLong ? "var(--agents-danger-500)" : "var(--agents-fg-lightest)",
424
- className: styles$f.characterCounter,
424
+ className: styles$g.characterCounter,
425
425
  testId: `${testId}-character-counter`,
426
426
  children: `${inputValue.length.toLocaleString()} / ${MAX_MESSAGE_LENGTH.toLocaleString()}`
427
427
  }
428
428
  ) }),
429
- /* @__PURE__ */ jsxs("div", { className: styles$f.actions, children: [
430
- !isCompactStacked && !!actionsSlotStart && /* @__PURE__ */ jsx("div", { className: styles$f.actionsStart, children: actionsSlotStart }),
429
+ /* @__PURE__ */ jsxs("div", { className: styles$g.actions, children: [
430
+ !isCompactStacked && !!actionsSlotStart && /* @__PURE__ */ jsx("div", { className: styles$g.actionsStart, children: actionsSlotStart }),
431
431
  actionsSlot,
432
- sendReplacementWhenEmpty && !hasSendableContent ? sendReplacementWhenEmpty : /* @__PURE__ */ jsx("div", { className: classNames(styles$f.ownAction, { [styles$f.sendBlocked]: isMessageTooLong }), children: /* @__PURE__ */ jsx(
432
+ sendReplacementWhenEmpty && !hasSendableContent ? sendReplacementWhenEmpty : /* @__PURE__ */ jsx("div", { className: classNames(styles$g.ownAction, { [styles$g.sendBlocked]: isMessageTooLong }), children: /* @__PURE__ */ jsx(
433
433
  Tooltip,
434
434
  {
435
435
  text: isMessageTooLong ? "Your message is over the %maxLength% character limit" : void 0,
@@ -456,7 +456,7 @@ const ConversationMessageInput = (props) => {
456
456
  )
457
457
  }
458
458
  ),
459
- measuresCollapsedPillWidth && /* @__PURE__ */ jsx("span", { ref: collapsedPillSizerRef, className: styles$f.collapsedPillSizer, "aria-hidden": "true", children: translatedPlaceholder })
459
+ measuresCollapsedPillWidth && /* @__PURE__ */ jsx("span", { ref: collapsedPillSizerRef, className: styles$g.collapsedPillSizer, "aria-hidden": "true", children: translatedPlaceholder })
460
460
  ] });
461
461
  };
462
462
  const canvasReopenControl = "agents_canvasReopenControl_7vGS8F";
@@ -488,7 +488,7 @@ const classes$1 = {
488
488
  assistantMessageBesideAvatar
489
489
  };
490
490
  const avatar = "agents_avatar_Vlh0Vn";
491
- const title$1 = "agents_title_j4BUnD";
491
+ const title$2 = "agents_title_j4BUnD";
492
492
  const subtitle = "agents_subtitle_IyTssG";
493
493
  const suggestionCard$1 = "agents_suggestionCard_62jhTV";
494
494
  const userBubble = "agents_userBubble_-P9Wwm";
@@ -498,7 +498,7 @@ const messageAuthor = "agents_messageAuthor_2HTGU1";
498
498
  const messageBody = "agents_messageBody_orq0Pr";
499
499
  const loadingStyles = {
500
500
  avatar,
501
- title: title$1,
501
+ title: title$2,
502
502
  subtitle,
503
503
  suggestionCard: suggestionCard$1,
504
504
  userBubble,
@@ -579,22 +579,22 @@ const assistantMessageHasRenderableMarkdown = (message) => {
579
579
  return markdown !== "" && !isBareUnknownTypeJson(markdown);
580
580
  };
581
581
  const responseContainer$1 = "agents_responseContainer_LFzKoO";
582
- const styles$e = {
582
+ const styles$f = {
583
583
  responseContainer: responseContainer$1
584
584
  };
585
585
  const responseHeaderLayout = "agents_responseHeaderLayout_WuoaNs";
586
586
  const iconContainer = "agents_iconContainer_C1c9yQ";
587
587
  const responseHeader = "agents_responseHeader_-CQw8U";
588
- const styles$d = {
588
+ const styles$e = {
589
589
  responseHeaderLayout,
590
590
  iconContainer,
591
591
  responseHeader
592
592
  };
593
593
  const ConversationMessageSystemHeader = memo((props) => {
594
594
  const { aiPromptExtensionCategory, aiPromptExtension, isContentExpanded, onExpandContentClick } = props;
595
- return /* @__PURE__ */ jsxs("div", { className: styles$d.responseHeaderLayout, children: [
596
- /* @__PURE__ */ jsxs("div", { className: styles$d.responseHeader, children: [
597
- /* @__PURE__ */ jsx("span", { className: styles$d.iconContainer, children: /* @__PURE__ */ jsx(Icon, { color: "var(--agents-fg-on-accent)", name: "wizard" }) }),
595
+ return /* @__PURE__ */ jsxs("div", { className: styles$e.responseHeaderLayout, children: [
596
+ /* @__PURE__ */ jsxs("div", { className: styles$e.responseHeader, children: [
597
+ /* @__PURE__ */ jsx("span", { className: styles$e.iconContainer, children: /* @__PURE__ */ jsx(Icon, { color: "var(--agents-fg-on-accent)", name: "wizard" }) }),
598
598
  /* @__PURE__ */ jsxs("div", { children: [
599
599
  /* @__PURE__ */ jsx(Text, { role: "help", weight: "bold", children: aiPromptExtension?.name ?? "AI Extensions" }),
600
600
  aiPromptExtensionCategory !== void 0 ? /* @__PURE__ */ jsxs(Text, { role: "caption", children: [
@@ -604,7 +604,7 @@ const ConversationMessageSystemHeader = memo((props) => {
604
604
  aiPromptExtensionCategory === void 0 ? /* @__PURE__ */ jsx(Text, { role: "caption", children: "System" }) : null
605
605
  ] })
606
606
  ] }),
607
- /* @__PURE__ */ jsx("div", { className: styles$d.responseHeaderAction, children: /* @__PURE__ */ jsx(
607
+ /* @__PURE__ */ jsx("div", { className: styles$e.responseHeaderAction, children: /* @__PURE__ */ jsx(
608
608
  Button,
609
609
  {
610
610
  variant: "muted",
@@ -617,7 +617,7 @@ const ConversationMessageSystemHeader = memo((props) => {
617
617
  const ConversationMessageSystem = memo((props) => {
618
618
  const { aiPromptExtensionCategory, aiPromptExtension, message } = props;
619
619
  const [isContentExpanded, setIsContentExpanded] = useState(false);
620
- return /* @__PURE__ */ jsxs("div", { className: styles$e.responseContainer, children: [
620
+ return /* @__PURE__ */ jsxs("div", { className: styles$f.responseContainer, children: [
621
621
  /* @__PURE__ */ jsx(
622
622
  ConversationMessageSystemHeader,
623
623
  {
@@ -627,24 +627,138 @@ const ConversationMessageSystem = memo((props) => {
627
627
  isContentExpanded
628
628
  }
629
629
  ),
630
- /* @__PURE__ */ jsx("div", { style: { display: isContentExpanded ? void 0 : "none" }, children: /* @__PURE__ */ jsx("div", { className: styles$e.responseMessage, children: /* @__PURE__ */ jsx(Markdown, { markdown: message }) }) })
630
+ /* @__PURE__ */ jsx("div", { style: { display: isContentExpanded ? void 0 : "none" }, children: /* @__PURE__ */ jsx("div", { className: styles$f.responseMessage, children: /* @__PURE__ */ jsx(Markdown, { markdown: message }) }) })
631
631
  ] });
632
632
  });
633
633
  const markerRow = "agents_markerRow_zl8Pcg";
634
634
  const markerChip = "agents_markerChip_u9Z-aO";
635
635
  const markerIcon = "agents_markerIcon_En-miz";
636
636
  const markerDuration = "agents_markerDuration_Nbff92";
637
- const styles$c = {
637
+ const styles$d = {
638
638
  markerRow,
639
639
  markerChip,
640
640
  markerIcon,
641
641
  markerDuration
642
642
  };
643
- const formatCallDuration = (durationSeconds) => {
644
- if (durationSeconds < 60) return `${durationSeconds}s`;
645
- const minutes = Math.floor(durationSeconds / 60);
646
- const seconds = durationSeconds % 60;
647
- return `${minutes}:${String(seconds).padStart(2, "0")} min`;
643
+ const isTurnInitiatorMessage = (message) => {
644
+ if (message.messageType === "ERROR" || message.messageType === "CHECKPOINT" || message.messageType === "TOOL_MESSAGE") {
645
+ return false;
646
+ }
647
+ if (message.messageType === "SIGNAL") return !SIGNAL_SOURCES_THAT_OWE_NO_WORK.includes(message.signalSource ?? "");
648
+ if (message.role !== "USER") return false;
649
+ if (message.messageType === "TOOL_CALL") return false;
650
+ return !(message.message ?? "").startsWith("/toolresult ");
651
+ };
652
+ const isAssistantAnswer = (message) => message.role === "ASSISTANT" && (message.messageType === "TEXT" || message.messageType == null) && assistantMessageHasRenderableMarkdown(message.message);
653
+ const NO_TURN_IN_FLIGHT = { liveTurnMessageId: null, queuedMessages: [] };
654
+ const findTurnsInFlight = (messages, isTurnRunning, namedTurnMessageId) => {
655
+ if (!isTurnRunning || !messages?.length) return NO_TURN_IN_FLIGHT;
656
+ let firstIndexAfterNewestAnswer = 0;
657
+ for (let index = messages.length - 1; index >= 0; index -= 1) {
658
+ if (isAssistantAnswer(messages[index])) {
659
+ firstIndexAfterNewestAnswer = index + 1;
660
+ break;
661
+ }
662
+ }
663
+ const candidates = messages.slice(firstIndexAfterNewestAnswer).filter(isTurnInitiatorMessage);
664
+ if (candidates.length === 0 && namedTurnMessageId === null) {
665
+ const newestInitiator = messages.slice(0, firstIndexAfterNewestAnswer).filter(isTurnInitiatorMessage).at(-1);
666
+ return { liveTurnMessageId: typeof newestInitiator?.id === "number" ? newestInitiator.id : null, queuedMessages: [] };
667
+ }
668
+ const namedPosition = namedTurnMessageId === null ? -1 : candidates.findIndex((candidate) => candidate.id === namedTurnMessageId);
669
+ const isNamedBeforeCandidates = namedTurnMessageId !== null && namedPosition === -1;
670
+ const livePosition = isNamedBeforeCandidates ? -1 : Math.max(namedPosition, 0);
671
+ const liveCandidate = isNamedBeforeCandidates ? void 0 : candidates[livePosition];
672
+ const liveTurnMessageId = isNamedBeforeCandidates ? namedTurnMessageId : typeof liveCandidate?.id === "number" ? liveCandidate.id : null;
673
+ return {
674
+ liveTurnMessageId,
675
+ // Only the owner's own words show as queued; a signal behind the running turn has no bubble.
676
+ queuedMessages: candidates.slice(livePosition + 1).filter((candidate) => candidate.role === "USER" && candidate.messageType !== "SIGNAL")
677
+ };
678
+ };
679
+ const MESSAGE_TIME_PAUSE_MS = 20 * 60 * 1e3;
680
+ const isCallMarkerMessage = (message) => message.messageType === "SIGNAL" && PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES.includes(message.signalSource ?? "");
681
+ const buildMessageTimeMarks = (messages, isShown, dayKeyOf, isTurnRunning) => {
682
+ const marks = messages.map((message) => ({ moment: readTraceMoment(message.createdAt) }));
683
+ let previousMoment = null;
684
+ let previousDayKey = null;
685
+ let turnStartedAt = null;
686
+ let lastAnswerIndexOfTurn = null;
687
+ const closeTurn = () => {
688
+ if (turnStartedAt === null || lastAnswerIndexOfTurn === null) return;
689
+ const answeredAt = marks[lastAnswerIndexOfTurn].moment;
690
+ if (answeredAt !== null && answeredAt - turnStartedAt > MESSAGE_TIME_PAUSE_MS) marks[lastAnswerIndexOfTurn].finishedAt = answeredAt;
691
+ };
692
+ messages.forEach((message, index) => {
693
+ const moment = marks[index].moment;
694
+ if (moment === null) return;
695
+ const isCallMarker = isCallMarkerMessage(message);
696
+ const startsTurn = isTurnInitiatorMessage(message);
697
+ const shown = isShown(message);
698
+ if (shown || startsTurn || isCallMarker) {
699
+ const dayKey = dayKeyOf(moment);
700
+ if (dayKey !== previousDayKey) {
701
+ marks[index].daySeparator = { withTime: !isCallMarker };
702
+ previousDayKey = dayKey;
703
+ } else if ((startsTurn || isCallMarker) && previousMoment !== null && moment - previousMoment > MESSAGE_TIME_PAUSE_MS) {
704
+ if (!isCallMarker) marks[index].timeHead = true;
705
+ }
706
+ }
707
+ if (startsTurn) {
708
+ closeTurn();
709
+ turnStartedAt = moment;
710
+ lastAnswerIndexOfTurn = null;
711
+ }
712
+ if (shown && message.role === "ASSISTANT" && turnStartedAt !== null) lastAnswerIndexOfTurn = index;
713
+ previousMoment = moment;
714
+ });
715
+ if (!isTurnRunning) closeTurn();
716
+ return marks;
717
+ };
718
+ const DAY_MS = 24 * 60 * 60 * 1e3;
719
+ const createMessageTimeFormat = (locale, timeZone, now = Date.now) => {
720
+ const localeOrDefault = locale ?? void 0;
721
+ const zone = timeZone ?? void 0;
722
+ const clock2 = new Intl.DateTimeFormat(localeOrDefault, { hour: "2-digit", minute: "2-digit", timeZone: zone });
723
+ const exactFormat = new Intl.DateTimeFormat(localeOrDefault, {
724
+ weekday: "short",
725
+ day: "numeric",
726
+ month: "short",
727
+ year: "numeric",
728
+ hour: "2-digit",
729
+ minute: "2-digit",
730
+ second: "2-digit",
731
+ timeZoneName: "short",
732
+ timeZone: zone
733
+ });
734
+ const dayOfThisYear = new Intl.DateTimeFormat(localeOrDefault, { weekday: "short", day: "numeric", month: "short", timeZone: zone });
735
+ const dayOfAnotherYear = new Intl.DateTimeFormat(localeOrDefault, { day: "numeric", month: "short", year: "numeric", timeZone: zone });
736
+ const dayKeyParts = new Intl.DateTimeFormat("en-CA", { year: "numeric", month: "2-digit", day: "2-digit", timeZone: zone });
737
+ const dayKey = (moment) => dayKeyParts.format(moment);
738
+ const yearOf = (moment) => dayKey(moment).slice(0, 4);
739
+ return {
740
+ time: (moment) => clock2.format(moment),
741
+ exact: (moment) => exactFormat.format(moment),
742
+ dayKey,
743
+ day: (moment) => {
744
+ const today = now();
745
+ const key = dayKey(moment);
746
+ if (key === dayKey(today)) return translateText("Today");
747
+ if (key === dayKey(today - DAY_MS)) return translateText("Yesterday", void 0, "chat-day");
748
+ return yearOf(moment) === yearOf(today) ? dayOfThisYear.format(moment) : dayOfAnotherYear.format(moment);
749
+ },
750
+ finished: (moment) => translateText("finished %time%", { time: clock2.format(moment) }, "chat-turn-end")
751
+ };
752
+ };
753
+ const useMessageTimeFormat = () => {
754
+ const { locale, dateLocale, timeZone } = useAgentsOwnerSettings();
755
+ const shownLocale = dateLocale ?? locale;
756
+ return useMemo(() => createMessageTimeFormat(shownLocale, timeZone), [shownLocale, timeZone]);
757
+ };
758
+ const formatCallLength = (durationSeconds) => {
759
+ const safeSeconds = Math.max(0, Math.round(durationSeconds));
760
+ const clock2 = `${Math.floor(safeSeconds / 60)}:${String(safeSeconds % 60).padStart(2, "0")}`;
761
+ return translateText("%clock% min", { clock: clock2 }, "voice-call-length");
648
762
  };
649
763
  const MARKER_LABELS = {
650
764
  started: { inApp: textKey("Voice chat started"), phoneLine: textKey("Phone call started") },
@@ -660,22 +774,24 @@ const callMarkerStateOf = (isCallEnd, endReason) => {
660
774
  if (endReason === "FAILED") return "notConnected";
661
775
  return "ended";
662
776
  };
663
- const ConversationCallMarkerChip = memo(({ signalSource, signalText }) => {
777
+ const ConversationCallMarkerChip = memo(({ signalSource, signalText, moment = null }) => {
778
+ const timeFormat = useMessageTimeFormat();
664
779
  const isCallEnd = signalSource === "PHONE_CALL_ENDED";
665
780
  const isInAppCall = signalText.startsWith("In-app call");
666
781
  const endReason = /reason ([A-Za-z_-]+)/.exec(signalText)?.[1];
667
782
  const durationSeconds = /(\d+)s\b/.exec(signalText)?.[1];
668
783
  const markerState = callMarkerStateOf(isCallEnd, endReason);
669
784
  const markerLabel = isInAppCall ? MARKER_LABELS[markerState].inApp : MARKER_LABELS[markerState].phoneLine;
670
- return /* @__PURE__ */ jsx("div", { className: styles$c.markerRow, "data-testid": "conversation-call-marker", children: /* @__PURE__ */ jsxs("span", { className: styles$c.markerChip, "data-state": markerState, children: [
671
- /* @__PURE__ */ jsx("span", { className: styles$c.markerIcon, children: isInAppCall ? /* @__PURE__ */ jsx(VoiceBarsIcon, { size: 16 }) : /* @__PURE__ */ jsx(Icon, { name: "phone" }) }),
785
+ return /* @__PURE__ */ jsx("div", { className: styles$d.markerRow, "data-testid": "conversation-call-marker", children: /* @__PURE__ */ jsxs("span", { className: styles$d.markerChip, "data-state": markerState, children: [
786
+ /* @__PURE__ */ jsx("span", { className: styles$d.markerIcon, children: isInAppCall ? /* @__PURE__ */ jsx(VoiceBarsIcon, { size: 16 }) : /* @__PURE__ */ jsx(Icon, { name: "phone" }) }),
672
787
  /* @__PURE__ */ jsx(Text, { role: "caption", replacements: { agentName: getAgentDisplayName() }, children: markerLabel }),
673
- markerState === "ended" && durationSeconds != null && /* @__PURE__ */ jsx("span", { className: styles$c.markerDuration, children: /* @__PURE__ */ jsx(Text, { role: "caption", translate: false, children: formatCallDuration(Number(durationSeconds)) }) })
788
+ markerState === "ended" && durationSeconds != null && /* @__PURE__ */ jsx("span", { className: styles$d.markerDuration, children: /* @__PURE__ */ jsx(Text, { role: "caption", translate: false, children: formatCallLength(Number(durationSeconds)) }) }),
789
+ markerState !== "ended" && moment !== null && /* @__PURE__ */ jsx("time", { className: styles$d.markerDuration, dateTime: new Date(moment).toISOString(), title: timeFormat.exact(moment), children: /* @__PURE__ */ jsx(Text, { role: "caption", translate: false, children: timeFormat.time(moment) }) })
674
790
  ] }) });
675
791
  });
676
792
  const disclosure = "agents_disclosure_rVPB-y";
677
793
  const instructionPanel = "agents_instructionPanel_G2fM1K";
678
- const styles$b = {
794
+ const styles$c = {
679
795
  disclosure,
680
796
  instructionPanel
681
797
  };
@@ -683,15 +799,15 @@ const ConversationTaskInstructionDisclosure = ({
683
799
  instructionText
684
800
  }) => {
685
801
  const [expanded, setExpanded] = useState(false);
686
- return /* @__PURE__ */ jsxs("div", { className: styles$b.disclosure, children: [
687
- expanded ? /* @__PURE__ */ jsx("div", { className: styles$b.instructionPanel, children: /* @__PURE__ */ jsx(Text, { role: "caption", color: "var(--agents-fg-light)", allowNewLines: true, translate: false, children: instructionText }) }) : null,
802
+ return /* @__PURE__ */ jsxs("div", { className: styles$c.disclosure, children: [
803
+ expanded ? /* @__PURE__ */ jsx("div", { className: styles$c.instructionPanel, children: /* @__PURE__ */ jsx(Text, { role: "caption", color: "var(--agents-fg-light)", allowNewLines: true, translate: false, children: instructionText }) }) : null,
688
804
  /* @__PURE__ */ jsx(Button, { variant: "muted", onClick: () => setExpanded((wasExpanded) => !wasExpanded), children: expanded ? "Hide task instruction" : "Show task instruction" })
689
805
  ] });
690
806
  };
691
807
  const responseContainer = "agents_responseContainer_DP5-nh";
692
808
  const thinkingMessage = "agents_thinkingMessage_8Z3pN0";
693
809
  const thinkingDots = "agents_thinkingDots_9rZMzX";
694
- const styles$a = {
810
+ const styles$b = {
695
811
  responseContainer,
696
812
  thinkingMessage,
697
813
  thinkingDots
@@ -713,7 +829,7 @@ const ConversationMessageThinking = memo((props) => {
713
829
  }, 2500);
714
830
  return () => clearInterval(interval);
715
831
  }, []);
716
- return /* @__PURE__ */ jsxs("div", { className: styles$a.responseContainer, children: [
832
+ return /* @__PURE__ */ jsxs("div", { className: styles$b.responseContainer, children: [
717
833
  /* @__PURE__ */ jsx(
718
834
  ConversationMessageHeader,
719
835
  {
@@ -721,8 +837,8 @@ const ConversationMessageThinking = memo((props) => {
721
837
  aiPromptExtension
722
838
  }
723
839
  ),
724
- /* @__PURE__ */ jsxs("div", { className: styles$a.thinkingMessage, children: [
725
- /* @__PURE__ */ jsxs("div", { className: styles$a.thinkingDots, children: [
840
+ /* @__PURE__ */ jsxs("div", { className: styles$b.thinkingMessage, children: [
841
+ /* @__PURE__ */ jsxs("div", { className: styles$b.thinkingDots, children: [
726
842
  /* @__PURE__ */ jsx("span", {}),
727
843
  /* @__PURE__ */ jsx("span", {}),
728
844
  /* @__PURE__ */ jsx("span", {})
@@ -733,7 +849,7 @@ const ConversationMessageThinking = memo((props) => {
733
849
  });
734
850
  const errorMessageContainer = "agents_errorMessageContainer_SW0BKU";
735
851
  const errorMessageTitle = "agents_errorMessageTitle_c--G2K";
736
- const styles$9 = {
852
+ const styles$a = {
737
853
  errorMessageContainer,
738
854
  errorMessageTitle
739
855
  };
@@ -804,9 +920,9 @@ const ConversationErrorWidget = (props) => {
804
920
  replacements: replacements2
805
921
  };
806
922
  }, [errorType, isUpSellPossible, rateLimitRetryAfterSeconds, showFairUsageMessage, canRetry]);
807
- return /* @__PURE__ */ jsxs("div", { className: styles$9.errorMessageContainer, children: [
923
+ return /* @__PURE__ */ jsxs("div", { className: styles$a.errorMessageContainer, children: [
808
924
  /* @__PURE__ */ jsxs("div", { children: [
809
- /* @__PURE__ */ jsxs("div", { className: styles$9.errorMessageTitle, children: [
925
+ /* @__PURE__ */ jsxs("div", { className: styles$a.errorMessageTitle, children: [
810
926
  /* @__PURE__ */ jsx(Icon, { name: icon }),
811
927
  /* @__PURE__ */ jsx(Text, { weight: "bold", children: title2 })
812
928
  ] }),
@@ -816,6 +932,36 @@ const ConversationErrorWidget = (props) => {
816
932
  canRetry ? /* @__PURE__ */ jsx(Button, { size: "extraLarge", onClick: handleRetry, variant: "shimmer", disabled: retrying, children: "Retry" }) : null
817
933
  ] });
818
934
  };
935
+ const daySeparator = "agents_daySeparator_8fIwQz";
936
+ const daySeparatorDay = "agents_daySeparatorDay_z66M-P";
937
+ const daySeparatorLabel = "agents_daySeparatorLabel_ZHjgrd";
938
+ const timeHead = "agents_timeHead_ZaIl5w";
939
+ const clock = "agents_clock_bJqxT4";
940
+ const timedRow = "agents_timedRow_G4v1IT";
941
+ const exactTime = "agents_exactTime_qEAir0";
942
+ const tappedTime = "agents_tappedTime_VEvRD0";
943
+ const quietTime = "agents_quietTime_SXYrWM";
944
+ const finished = "agents_finished_DeKI6I";
945
+ const timeStyles = {
946
+ daySeparator,
947
+ daySeparatorDay,
948
+ daySeparatorLabel,
949
+ timeHead,
950
+ clock,
951
+ timedRow,
952
+ exactTime,
953
+ tappedTime,
954
+ quietTime,
955
+ finished
956
+ };
957
+ const INTERACTIVE_SELECTOR = "a, button, input, textarea, select, summary, label, [role='button'], [contenteditable='true']";
958
+ const isMessageShownAsRow = (message, isDebugMode) => {
959
+ if (message.messageType === "SIGNAL") return PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES.includes(message.signalSource ?? "");
960
+ if (message.messageType === "ERROR") return false;
961
+ if (message.role === "USER") return !(message.message ?? "").startsWith("/toolresult ");
962
+ if (message.role === "ASSISTANT") return assistantMessageHasRenderableMarkdown(message.message);
963
+ return message.role === "SYSTEM" && isDebugMode;
964
+ };
819
965
  const WIDGET_VISIBILITY_WINDOW = 15;
820
966
  const widgetNamesOfMessage = (message) => message.role === "ASSISTANT" ? widgetNamesInMarkdown(normalizeServerMessageToMarkdown(message.message)) : [];
821
967
  const findUnansweredWidgetMessageId = (messages) => {
@@ -863,9 +1009,16 @@ const ConversationMessageList = ({
863
1009
  taskInstructionMessageId,
864
1010
  renderAfterMessage,
865
1011
  renderAssistantAvatar,
866
- isConversationClosed = false
1012
+ isConversationClosed = false,
1013
+ messageTimes = null
867
1014
  }) => {
868
1015
  const list = messages ?? [];
1016
+ const timeFormat = useMessageTimeFormat();
1017
+ const timeMarks = useMemo(
1018
+ () => messageTimes === null ? null : buildMessageTimeMarks(messages ?? [], (message) => isMessageShownAsRow(message, isDebugMode), timeFormat.dayKey, aiThinking),
1019
+ [messageTimes, messages, isDebugMode, timeFormat, aiThinking]
1020
+ );
1021
+ const [tappedTimeMessageKey, setTappedTimeMessageKey] = useState(null);
869
1022
  const hideWidgetsBeforeIndex = Math.max(0, list.length - WIDGET_VISIBILITY_WINDOW);
870
1023
  const userTheme = userMessageTheme ?? (aiPromptExtension === void 0 ? "light" : "default");
871
1024
  const reloadReopenMessageIdRef = useRef(void 0);
@@ -880,7 +1033,8 @@ const ConversationMessageList = ({
880
1033
  ConversationCallMarkerChip,
881
1034
  {
882
1035
  signalSource: message.signalSource ?? "",
883
- signalText: message.message ?? ""
1036
+ signalText: message.message ?? "",
1037
+ moment: timeMarks?.[index]?.moment ?? null
884
1038
  },
885
1039
  message.id ?? index
886
1040
  );
@@ -925,25 +1079,63 @@ const ConversationMessageList = ({
925
1079
  );
926
1080
  }
927
1081
  if (messageNode === null) return null;
928
- return /* @__PURE__ */ jsx(
1082
+ const rowKey = message.id ?? `pending-${message.role}-${index}`;
1083
+ const marks = timeMarks?.[index];
1084
+ const moment = marks?.moment ?? null;
1085
+ const isTimed = moment !== null && message.role !== "SYSTEM";
1086
+ const isTimeTapped = isTimed && tappedTimeMessageKey === rowKey;
1087
+ const handleRowClick = isTimed ? (event) => {
1088
+ if (typeof window === "undefined" || !window.matchMedia?.("(hover: none)").matches) return;
1089
+ if (event.target.closest?.(INTERACTIVE_SELECTOR)) return;
1090
+ if (window.getSelection?.()?.toString()) return;
1091
+ setTappedTimeMessageKey((current) => current === rowKey ? null : rowKey);
1092
+ } : void 0;
1093
+ return /* @__PURE__ */ jsxs(
929
1094
  "div",
930
1095
  {
931
- className: classes$1.messageRow,
1096
+ className: classNames(classes$1.messageRow, isTimed && timeStyles.timedRow),
932
1097
  "data-message-id": message.id ?? void 0,
933
1098
  "data-message-role": message.role,
934
- children: messageNode
1099
+ onClick: handleRowClick,
1100
+ children: [
1101
+ messageNode,
1102
+ isTimed && moment !== null ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
1103
+ /* @__PURE__ */ jsx("time", { className: timeStyles.exactTime, dateTime: new Date(moment).toISOString(), children: timeFormat.exact(moment) }),
1104
+ isTimeTapped ? /* @__PURE__ */ jsx("span", { className: timeStyles.tappedTime, "aria-hidden": true, children: timeFormat.exact(moment) }) : messageTimes === "everyMessage" ? /* @__PURE__ */ jsx("span", { className: timeStyles.quietTime, "aria-hidden": true, children: timeFormat.time(moment) }) : null,
1105
+ marks?.finishedAt !== void 0 ? /* @__PURE__ */ jsx("span", { className: timeStyles.finished, "aria-hidden": true, children: timeFormat.finished(marks.finishedAt) }) : null
1106
+ ] }) : null
1107
+ ]
935
1108
  },
936
- message.id ?? `pending-${message.role}-${index}`
1109
+ rowKey
937
1110
  );
938
1111
  };
1112
+ const renderTimeBefore = (index) => {
1113
+ const marks = timeMarks?.[index];
1114
+ if (!marks || marks.moment === null) return null;
1115
+ const moment = marks.moment;
1116
+ if (marks.daySeparator) {
1117
+ return /* @__PURE__ */ jsx("div", { className: timeStyles.daySeparator, role: "separator", "data-testid": "conversation-day-separator", children: /* @__PURE__ */ jsxs("span", { className: timeStyles.daySeparatorLabel, children: [
1118
+ /* @__PURE__ */ jsx("span", { className: timeStyles.daySeparatorDay, children: timeFormat.day(moment) }),
1119
+ marks.daySeparator.withTime ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
1120
+ /* @__PURE__ */ jsx("span", { className: timeStyles.daySeparatorDot, "aria-hidden": true, children: "·" }),
1121
+ /* @__PURE__ */ jsx("span", { className: timeStyles.clock, children: timeFormat.time(moment) })
1122
+ ] }) : null
1123
+ ] }) });
1124
+ }
1125
+ if (marks.timeHead) {
1126
+ return /* @__PURE__ */ jsx("div", { className: classNames(timeStyles.timeHead, timeStyles.clock), role: "separator", "data-testid": "conversation-time-head", children: timeFormat.time(moment) });
1127
+ }
1128
+ return null;
1129
+ };
939
1130
  return /* @__PURE__ */ jsxs("div", { className: classNames(classes$1.chatMessages, className), ref: messagesListRef, children: [
940
1131
  list.map(
941
- (message, index) => renderAfterMessage ? (
1132
+ (message, index) => renderAfterMessage || timeMarks !== null ? (
942
1133
  // Keyed like the row itself and present for every row, so a node that appears after a message never
943
1134
  // changes the row's position in the tree (and never remounts the message and its widgets).
944
1135
  /* @__PURE__ */ jsxs(Fragment, { children: [
1136
+ renderTimeBefore(index),
945
1137
  renderMessageRow(message, index),
946
- renderAfterMessage(message)
1138
+ renderAfterMessage?.(message)
947
1139
  ] }, message.id ?? `pending-${message.role}-${index}`)
948
1140
  ) : renderMessageRow(message, index)
949
1141
  ),
@@ -968,7 +1160,7 @@ const ConversationMessageList = ({
968
1160
  const suggestionCard = "agents_suggestionCard_mrCOnL";
969
1161
  const suggestionCardButton = "agents_suggestionCardButton_Vs0fh3";
970
1162
  const arrowIcon = "agents_arrowIcon_KmN-nZ";
971
- const styles$8 = {
1163
+ const styles$9 = {
972
1164
  suggestionCard,
973
1165
  suggestionCardButton,
974
1166
  arrowIcon
@@ -976,7 +1168,7 @@ const styles$8 = {
976
1168
  const ConversationSuggestionWidget = (props) => {
977
1169
  const { suggestion, onClick, testId } = props;
978
1170
  const { AssistantIconBadge } = useAgentsEnvironment();
979
- return /* @__PURE__ */ jsx(InteractiveSurface, { hoverable: true, className: classNames(styles$8.suggestionCard), testId, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$8.suggestionCardButton, onClick, children: [
1171
+ return /* @__PURE__ */ jsx(InteractiveSurface, { hoverable: true, className: classNames(styles$9.suggestionCard), testId, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$9.suggestionCardButton, onClick, children: [
980
1172
  AssistantIconBadge ? /* @__PURE__ */ jsx(
981
1173
  AssistantIconBadge,
982
1174
  {
@@ -989,7 +1181,7 @@ const ConversationSuggestionWidget = (props) => {
989
1181
  /* @__PURE__ */ jsx(Text, { role: "help", weight: "bold", color: "var(--agents-fg-on-accent)", children: suggestion.name }),
990
1182
  /* @__PURE__ */ jsx(Text, { role: "caption", color: "var(--agents-fg-on-accent)", children: suggestion.description })
991
1183
  ] }),
992
- /* @__PURE__ */ jsx(Icon, { color: "var(--agents-fg-on-accent)", className: styles$8.arrowIcon, name: "arrowRight" })
1184
+ /* @__PURE__ */ jsx(Icon, { color: "var(--agents-fg-on-accent)", className: styles$9.arrowIcon, name: "arrowRight" })
993
1185
  ] }) });
994
1186
  };
995
1187
  const ConversationIntroWidget = ({
@@ -1041,14 +1233,14 @@ const ConversationIntroWidget = ({
1041
1233
  };
1042
1234
  const scrollToLatest = "agents_scrollToLatest_j2xJO9";
1043
1235
  const visible = "agents_visible_bwj0Gp";
1044
- const styles$7 = {
1236
+ const styles$8 = {
1045
1237
  scrollToLatest,
1046
1238
  visible
1047
1239
  };
1048
1240
  const ConversationScrollToLatestMessageButton = (props) => {
1049
1241
  const { visible: visible2, onClick } = props;
1050
1242
  const texts = useAgentsTexts();
1051
- return /* @__PURE__ */ jsx("div", { className: classNames(styles$7.scrollToLatest, visible2 ? styles$7.visible : void 0), children: /* @__PURE__ */ jsx(
1243
+ return /* @__PURE__ */ jsx("div", { className: classNames(styles$8.scrollToLatest, visible2 ? styles$8.visible : void 0), children: /* @__PURE__ */ jsx(
1052
1244
  Button,
1053
1245
  {
1054
1246
  variant: "muted",
@@ -1196,6 +1388,7 @@ const ConversationViewBody = (props) => {
1196
1388
  renderAfterMessage,
1197
1389
  renderAssistantAvatar,
1198
1390
  isConversationClosed,
1391
+ messageTimes,
1199
1392
  onSuggestionClick,
1200
1393
  onSendMessage
1201
1394
  } = props;
@@ -1218,7 +1411,7 @@ const ConversationViewBody = (props) => {
1218
1411
  );
1219
1412
  const { readAssistantThemeClassName, AssistantBackground } = useAgentsEnvironment();
1220
1413
  const colorPalette = useMemo(
1221
- () => currentCategory?.alias ? readAssistantThemeClassName?.(currentCategory.alias) ?? styles$g.genericChat : styles$g.genericChat,
1414
+ () => currentCategory?.alias ? readAssistantThemeClassName?.(currentCategory.alias) ?? styles$h.genericChat : styles$h.genericChat,
1222
1415
  [currentCategory, readAssistantThemeClassName]
1223
1416
  );
1224
1417
  const isMessageListVisible = !!messages && (!!conversationId || !!showMessagesWithoutConversation) || startingNewConversation || !!error && error !== ConversationErrorType.CONVERSATION_NOT_FOUND;
@@ -1423,7 +1616,7 @@ const ConversationViewBody = (props) => {
1423
1616
  const messageColumn = /* @__PURE__ */ jsxs(
1424
1617
  "div",
1425
1618
  {
1426
- className: styles$g.contentWrapper,
1619
+ className: styles$h.contentWrapper,
1427
1620
  "data-agents-chat-scroll": "",
1428
1621
  "data-testid": "chat-messages-scroll",
1429
1622
  ref: handleContentWrapperRef,
@@ -1441,11 +1634,11 @@ const ConversationViewBody = (props) => {
1441
1634
  onSuggestionClick
1442
1635
  }
1443
1636
  ) : null,
1444
- !!loadingOlder ? /* @__PURE__ */ jsx("span", { className: styles$g.olderLoading, children: /* @__PURE__ */ jsx(Text, { children: "Loading older messages…" }) }) : null,
1637
+ !!loadingOlder ? /* @__PURE__ */ jsx("span", { className: styles$h.olderLoading, children: /* @__PURE__ */ jsx(Text, { children: "Loading older messages…" }) }) : null,
1445
1638
  isMessageListVisible ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(WidgetWindowRootContext.Provider, { value: scrollContainer, children: /* @__PURE__ */ jsx(
1446
1639
  ConversationMessageList,
1447
1640
  {
1448
- className: enablePinQuestionAndRevealAnswer && (conversationId || startingNewConversation || aiThinking || error) ? styles$g.topAlignedMessages : void 0,
1641
+ className: enablePinQuestionAndRevealAnswer && (conversationId || startingNewConversation || aiThinking || error) ? styles$h.topAlignedMessages : void 0,
1449
1642
  messages,
1450
1643
  currentCategory,
1451
1644
  aiPromptExtension,
@@ -1463,7 +1656,8 @@ const ConversationViewBody = (props) => {
1463
1656
  taskInstructionMessageId,
1464
1657
  renderAfterMessage,
1465
1658
  renderAssistantAvatar,
1466
- isConversationClosed
1659
+ isConversationClosed,
1660
+ messageTimes
1467
1661
  }
1468
1662
  ) }) }) : null
1469
1663
  ]
@@ -1473,41 +1667,41 @@ const ConversationViewBody = (props) => {
1473
1667
  "div",
1474
1668
  {
1475
1669
  className: classNames(
1476
- styles$g.chat,
1477
- background || backgroundPaintedByHost2 ? styles$g.customBg : colorPalette,
1478
- backgroundPaintedByHost2 ? styles$g.backgroundPaintedByHost : void 0,
1479
- isCompact ? styles$g.chatCompact : void 0,
1480
- confineTopBlurBandToChatPane2 ? styles$g.confineTopBlurBandToChatPane : void 0
1670
+ styles$h.chat,
1671
+ background || backgroundPaintedByHost2 ? styles$h.customBg : colorPalette,
1672
+ backgroundPaintedByHost2 ? styles$h.backgroundPaintedByHost : void 0,
1673
+ isCompact ? styles$h.chatCompact : void 0,
1674
+ confineTopBlurBandToChatPane2 ? styles$h.confineTopBlurBandToChatPane : void 0
1481
1675
  ),
1482
1676
  children: [
1483
- background ? /* @__PURE__ */ jsx("div", { className: styles$g.backgroundLayer, children: background }) : backgroundPaintedByHost2 ? null : AssistantBackground ? /* @__PURE__ */ jsx(AssistantBackground, { category: currentCategory, categoryAlias: currentCategory?.alias ?? void 0 }) : null,
1677
+ background ? /* @__PURE__ */ jsx("div", { className: styles$h.backgroundLayer, children: background }) : backgroundPaintedByHost2 ? null : AssistantBackground ? /* @__PURE__ */ jsx(AssistantBackground, { category: currentCategory, categoryAlias: currentCategory?.alias ?? void 0 }) : null,
1484
1678
  progressStepperSlot,
1485
1679
  fileDropHintSlot,
1486
- contentOverlaySlot !== void 0 ? /* @__PURE__ */ jsxs("div", { className: styles$g.contentLayers, "data-overlay-shown": isContentOverlayShown || void 0, children: [
1680
+ contentOverlaySlot !== void 0 ? /* @__PURE__ */ jsxs("div", { className: styles$h.contentLayers, "data-overlay-shown": isContentOverlayShown || void 0, children: [
1487
1681
  messageColumn,
1488
1682
  /* @__PURE__ */ jsx(
1489
1683
  "div",
1490
1684
  {
1491
- className: styles$g.contentOverlay,
1685
+ className: styles$h.contentOverlay,
1492
1686
  "aria-hidden": !isContentOverlayShown || void 0,
1493
1687
  inert: !isContentOverlayShown || void 0,
1494
1688
  children: contentOverlaySlot
1495
1689
  }
1496
1690
  )
1497
1691
  ] }) : messageColumn,
1498
- enablePinQuestionAndRevealAnswer && /* @__PURE__ */ jsx("div", { className: styles$g.scrollToLatestAnchor, children: /* @__PURE__ */ jsx(
1692
+ enablePinQuestionAndRevealAnswer && /* @__PURE__ */ jsx("div", { className: styles$h.scrollToLatestAnchor, children: /* @__PURE__ */ jsx(
1499
1693
  ConversationScrollToLatestMessageButton,
1500
1694
  {
1501
1695
  visible: isMessagesBottomOutOfView,
1502
1696
  onClick: scrollToLatestMessage
1503
1697
  }
1504
1698
  ) }),
1505
- inputReplacementSlot ? /* @__PURE__ */ jsx("div", { className: styles$g.inputReplacement, children: inputReplacementSlot }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
1699
+ inputReplacementSlot ? /* @__PURE__ */ jsx("div", { className: styles$h.inputReplacement, children: inputReplacementSlot }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
1506
1700
  inputBandSlot,
1507
1701
  /* @__PURE__ */ jsx(
1508
1702
  ConversationMessageInput,
1509
1703
  {
1510
- className: classNames(styles$g.input, currentCategory?.alias ? styles$g.inputInCategory : void 0),
1704
+ className: classNames(styles$h.input, currentCategory?.alias ? styles$h.inputInCategory : void 0),
1511
1705
  isProcessing: allowSendWhileAiThinking ? !!startingNewConversation : aiThinking,
1512
1706
  onSendMessage,
1513
1707
  actionsSlot: inputActionsSlot,
@@ -1532,8 +1726,18 @@ const ConversationViewBody = (props) => {
1532
1726
  }
1533
1727
  );
1534
1728
  };
1729
+ const resolveCanvasLayout = (layout2) => ({
1730
+ showsCloseButton: layout2?.showsCloseButton ?? true,
1731
+ showsDividerToggle: layout2?.showsDividerToggle ?? true,
1732
+ showsNarrowReopenControl: layout2?.showsNarrowReopenControl ?? true,
1733
+ chatColumnMinWidthPx: Math.max(0, layout2?.chatColumnMinWidthPx ?? CHAT_COLUMN_MIN_WIDTH_PX),
1734
+ boxedInsetPx: Math.max(0, layout2?.boxedInsetPx ?? CANVAS_BOXED_INSET_PX),
1735
+ paneSurface: layout2?.paneSurface ?? "card"
1736
+ });
1737
+ const useCanvasLayout = () => resolveCanvasLayout(useAgentsEnvironment().canvasLayout);
1535
1738
  const root = "agents_root_1zXxaE";
1536
1739
  const rootBoxed = "agents_rootBoxed_WyFSTZ";
1740
+ const rootSurfaceByHost = "agents_rootSurfaceByHost_CfkCje";
1537
1741
  const closeButtonRow = "agents_closeButtonRow_Ra3aXk";
1538
1742
  const titleSlot = "agents_titleSlot_ZFjpZe";
1539
1743
  const rootFullBleedContent = "agents_rootFullBleedContent_-D9E-y";
@@ -1543,6 +1747,7 @@ const openingLoader = "agents_openingLoader_64saRx";
1543
1747
  const classes = {
1544
1748
  root,
1545
1749
  rootBoxed,
1750
+ rootSurfaceByHost,
1546
1751
  closeButtonRow,
1547
1752
  titleSlot,
1548
1753
  rootFullBleedContent,
@@ -1559,6 +1764,7 @@ const OpeningLoader = () => (
1559
1764
  const CanvasPane = ({ messages, boxed = false }) => {
1560
1765
  const CanvasBodyContainer = useAgentsEnvironment().CanvasBodyContainer ?? Fragment;
1561
1766
  const { canvas, closeCanvas, chatAgentSpaceKey } = useConversationWidgetContext();
1767
+ const { showsCloseButton, paneSurface } = useCanvasLayout();
1562
1768
  const mountGeneration = canvas?.mountGeneration;
1563
1769
  const [contentReady, setContentReady] = useState(false);
1564
1770
  const [titleSlot2, setTitleSlot] = useState(null);
@@ -1576,22 +1782,25 @@ const CanvasPane = ({ messages, boxed = false }) => {
1576
1782
  const anchor = canvas.anchor;
1577
1783
  const anchorMessage = anchor.kind === "message" ? (messages ?? []).find((message) => message.id === anchor.messageId) : void 0;
1578
1784
  const anchorMessageMarkdown = anchorMessage !== void 0 ? normalizeServerMessageToMarkdown(anchorMessage.message) : null;
1785
+ const hasTitleSlot = !!behaviour?.titleBesideCloseButton;
1786
+ const surfaceByHost = paneSurface === "none";
1579
1787
  const body = /* @__PURE__ */ jsx(Body, { canvas, agentSpaceKey: chatAgentSpaceKey, anchorMessageMarkdown });
1580
1788
  return /* @__PURE__ */ jsxs(
1581
1789
  "div",
1582
1790
  {
1583
1791
  className: classNames(
1584
1792
  classes.root,
1585
- boxed ? classes.rootBoxed : "",
1793
+ surfaceByHost ? classes.rootSurfaceByHost : "",
1794
+ boxed && !surfaceByHost ? classes.rootBoxed : "",
1586
1795
  behaviour?.fullBleed ? classes.rootFullBleedContent : "",
1587
1796
  behaviour?.overlayCloseButton ? classes.rootOverlayCloseButton : ""
1588
1797
  ),
1589
1798
  "data-testid": "chat-canvas-pane",
1590
1799
  "data-canvas-id": canvas.canvasId,
1591
1800
  children: [
1592
- /* @__PURE__ */ jsxs("div", { className: classes.closeButtonRow, children: [
1593
- behaviour?.titleBesideCloseButton && /* @__PURE__ */ jsx("div", { ref: setTitleSlot, className: classes.titleSlot }),
1594
- /* @__PURE__ */ jsx(
1801
+ showsCloseButton || hasTitleSlot ? /* @__PURE__ */ jsxs("div", { className: classes.closeButtonRow, children: [
1802
+ hasTitleSlot && /* @__PURE__ */ jsx("div", { ref: setTitleSlot, className: classes.titleSlot }),
1803
+ showsCloseButton ? /* @__PURE__ */ jsx(
1595
1804
  Button,
1596
1805
  {
1597
1806
  variant: "muted",
@@ -1604,11 +1813,11 @@ const CanvasPane = ({ messages, boxed = false }) => {
1604
1813
  onClick: () => closeCanvas(true),
1605
1814
  children: "Close canvas"
1606
1815
  }
1607
- )
1608
- ] }),
1816
+ ) : null
1817
+ ] }) : null,
1609
1818
  /* @__PURE__ */ jsx("div", { className: classes.content, children: contentReady ? (
1610
1819
  // The app's wrapper of a canvas body (host application: canvas-hosted list pages must not rewrite the page URL).
1611
- /* @__PURE__ */ jsx(CanvasBodyContainer, { children: /* @__PURE__ */ jsx(CanvasTitleSlotContext.Provider, { value: behaviour?.titleBesideCloseButton ? titleSlot2 : null, children: /* @__PURE__ */ jsx(ConversationWidgetErrorBoundary, { widgetName: `canvas:${canvas.canvasId}`, children: featureFlag ? (
1820
+ /* @__PURE__ */ jsx(CanvasBodyContainer, { children: /* @__PURE__ */ jsx(CanvasTitleSlotContext.Provider, { value: hasTitleSlot ? titleSlot2 : null, children: /* @__PURE__ */ jsx(ConversationWidgetErrorBoundary, { widgetName: `canvas:${canvas.canvasId}`, children: featureFlag ? (
1612
1821
  // The canvas owns its gate (not inherited from an opener): a restored or page-opened canvas has no
1613
1822
  // widget mount to inherit it from. A page anchor's agent space is the gate's agent space.
1614
1823
  /* @__PURE__ */ jsx(
@@ -1638,16 +1847,17 @@ const CLOSE_PULL_PX = 64;
1638
1847
  const ARM_DELAY_MS = 350;
1639
1848
  const LEAN_REST_MS = 150;
1640
1849
  const rubberBand = (distance) => Math.sign(distance) * RUBBER_MAX_PX * (1 - Math.exp(-Math.abs(distance) / RUBBER_K));
1641
- const canvasWidthLimits = (rootWidth, inset) => {
1850
+ const canvasWidthLimits = (rootWidth, inset, chatColumnMinWidthPx = CHAT_COLUMN_MIN_WIDTH_PX) => {
1642
1851
  const min = CANVAS_MIN_WIDTH_PX + inset * 2;
1643
- return { min, max: Math.max(min, rootWidth - CHAT_COLUMN_MIN_WIDTH_PX) };
1852
+ return { min, max: Math.max(min, rootWidth - chatColumnMinWidthPx) };
1644
1853
  };
1645
- const clampCanvasWidth = (width, rootWidth, inset) => {
1646
- const { min, max } = canvasWidthLimits(rootWidth, inset);
1854
+ const clampCanvasWidth = (width, rootWidth, inset, chatColumnMinWidthPx = CHAT_COLUMN_MIN_WIDTH_PX) => {
1855
+ const { min, max } = canvasWidthLimits(rootWidth, inset, chatColumnMinWidthPx);
1647
1856
  return Math.round(Math.min(max, Math.max(min, width)));
1648
1857
  };
1649
1858
  const useCanvasResize = (options) => {
1650
1859
  const { rootRef, inset, width, onWidthChange, onClose } = options;
1860
+ const chatColumnMinWidthPx = options.chatColumnMinWidthPx ?? CHAT_COLUMN_MIN_WIDTH_PX;
1651
1861
  const handleRef = useRef(null);
1652
1862
  const [isHovered, setIsHovered] = useState(false);
1653
1863
  const [isDragging, setIsDragging] = useState(false);
@@ -1655,8 +1865,8 @@ const useCanvasResize = (options) => {
1655
1865
  const [tabX, setTabX] = useState(0);
1656
1866
  const isDraggingRef = useRef(false);
1657
1867
  const timers = useRef({ arm: 0, lean: 0 });
1658
- const latest = useRef({ inset, onWidthChange, onClose });
1659
- latest.current = { inset, onWidthChange, onClose };
1868
+ const latest = useRef({ inset, chatColumnMinWidthPx, onWidthChange, onClose });
1869
+ latest.current = { inset, chatColumnMinWidthPx, onWidthChange, onClose };
1660
1870
  useEffect(() => {
1661
1871
  const root2 = rootRef.current;
1662
1872
  const pendingTimers = timers.current;
@@ -1723,7 +1933,7 @@ const useCanvasResize = (options) => {
1723
1933
  handle2.setPointerCapture(event.pointerId);
1724
1934
  } catch {
1725
1935
  }
1726
- const { min: min2, max: max2 } = canvasWidthLimits(rootWidth(), latest.current.inset);
1936
+ const { min: min2, max: max2 } = canvasWidthLimits(rootWidth(), latest.current.inset, latest.current.chatColumnMinWidthPx);
1727
1937
  const grabOffset = event.clientX - handle2.getBoundingClientRect().left - handle2.offsetWidth / 2;
1728
1938
  let lastX = event.clientX;
1729
1939
  let lean = 0;
@@ -1731,7 +1941,7 @@ const useCanvasResize = (options) => {
1731
1941
  let draggedWidth = null;
1732
1942
  isDraggingRef.current = true;
1733
1943
  setIsDragging(true);
1734
- root2.style.setProperty("--agents-canvas-width-drag", `${clampCanvasWidth(currentWidth(), rootWidth(), latest.current.inset)}px`);
1944
+ root2.style.setProperty("--agents-canvas-width-drag", `${clampCanvasWidth(currentWidth(), rootWidth(), latest.current.inset, latest.current.chatColumnMinWidthPx)}px`);
1735
1945
  root2.dataset.resizing = "true";
1736
1946
  const disarm = () => {
1737
1947
  window.clearTimeout(timers.current.arm);
@@ -1745,7 +1955,7 @@ const useCanvasResize = (options) => {
1745
1955
  const move = (moveEvent) => {
1746
1956
  magnetise(null, moveEvent.clientY, DRAG_TRAVEL_PX);
1747
1957
  const desired = root2.getBoundingClientRect().right - (moveEvent.clientX - grabOffset) + latest.current.inset;
1748
- const next = clampCanvasWidth(desired, rootWidth(), latest.current.inset);
1958
+ const next = clampCanvasWidth(desired, rootWidth(), latest.current.inset, latest.current.chatColumnMinWidthPx);
1749
1959
  draggedWidth = next;
1750
1960
  root2.style.setProperty("--agents-canvas-width-drag", `${next}px`);
1751
1961
  const beyond = Math.min(max2, Math.max(min2, desired)) - desired;
@@ -1796,14 +2006,14 @@ const useCanvasResize = (options) => {
1796
2006
  handle2.addEventListener("pointercancel", finish);
1797
2007
  };
1798
2008
  const onKeyDown = (event) => {
1799
- const { min: min2, max: max2 } = canvasWidthLimits(rootWidth(), inset);
2009
+ const { min: min2, max: max2 } = canvasWidthLimits(rootWidth(), inset, chatColumnMinWidthPx);
1800
2010
  const next = event.key === "ArrowLeft" ? currentWidth() + KEY_STEP_PX : event.key === "ArrowRight" ? currentWidth() - KEY_STEP_PX : event.key === "Home" ? max2 : event.key === "End" ? min2 : null;
1801
2011
  if (next === null) return;
1802
2012
  event.preventDefault();
1803
- onWidthChange(clampCanvasWidth(next, rootWidth(), inset));
2013
+ onWidthChange(clampCanvasWidth(next, rootWidth(), inset, chatColumnMinWidthPx));
1804
2014
  };
1805
2015
  const tab2 = isArmed ? "armed" : isDragging ? "drag" : isHovered ? "hover" : "idle";
1806
- const { min, max } = canvasWidthLimits(rootWidth(), inset);
2016
+ const { min, max } = canvasWidthLimits(rootWidth(), inset, chatColumnMinWidthPx);
1807
2017
  return {
1808
2018
  tab: tab2,
1809
2019
  tabX,
@@ -1828,7 +2038,7 @@ const tab = "agents_tab_XzVXlj";
1828
2038
  const tabTop = "agents_tabTop_mAtOHf";
1829
2039
  const tabBottom = "agents_tabBottom_JLQcsf";
1830
2040
  const tabCircle = "agents_tabCircle_J5jxeo";
1831
- const styles$6 = {
2041
+ const styles$7 = {
1832
2042
  handle,
1833
2043
  tab,
1834
2044
  tabTop,
@@ -1836,19 +2046,19 @@ const styles$6 = {
1836
2046
  tabCircle
1837
2047
  };
1838
2048
  const CanvasResizeHandle = (props) => {
1839
- const { rootRef, inset, width, onWidthChange, onClose } = props;
1840
- const { tab: tab2, tabX, handleProps } = useCanvasResize({ rootRef, inset, width, onWidthChange, onClose });
2049
+ const { rootRef, inset, chatColumnMinWidthPx, width, onWidthChange, onClose } = props;
2050
+ const { tab: tab2, tabX, handleProps } = useCanvasResize({ rootRef, inset, chatColumnMinWidthPx, width, onWidthChange, onClose });
1841
2051
  return /* @__PURE__ */ jsx(
1842
2052
  "div",
1843
2053
  {
1844
2054
  ...handleProps,
1845
- className: styles$6.handle,
2055
+ className: styles$7.handle,
1846
2056
  "data-tab": tab2,
1847
2057
  "aria-label": translateText("Resize canvas"),
1848
- children: /* @__PURE__ */ jsxs("span", { className: styles$6.tab, style: { "--agents-resize-tab-x": `${tabX}px` }, "aria-hidden": "true", children: [
1849
- /* @__PURE__ */ jsx("span", { className: styles$6.tabCircle }),
1850
- /* @__PURE__ */ jsx("span", { className: styles$6.tabTop }),
1851
- /* @__PURE__ */ jsx("span", { className: styles$6.tabBottom })
2058
+ children: /* @__PURE__ */ jsxs("span", { className: styles$7.tab, style: { "--agents-resize-tab-x": `${tabX}px` }, "aria-hidden": "true", children: [
2059
+ /* @__PURE__ */ jsx("span", { className: styles$7.tabCircle }),
2060
+ /* @__PURE__ */ jsx("span", { className: styles$7.tabTop }),
2061
+ /* @__PURE__ */ jsx("span", { className: styles$7.tabBottom })
1852
2062
  ] })
1853
2063
  }
1854
2064
  );
@@ -1873,6 +2083,9 @@ const ConversationView = (props) => {
1873
2083
  const { enableCanvasToggle, boxCanvasBelowTopBar, onSendMessage, conversationId, messages } = props;
1874
2084
  const { canvas, lastClosedCanvas, closeCanvas, reopenLastClosedCanvas, resetCanvasForNewTurn } = useConversationWidgetContext();
1875
2085
  const canvasViable = useCanvasViable();
2086
+ const canvasLayout = useCanvasLayout();
2087
+ const chatColumnMinWidthPx = canvasLayout.chatColumnMinWidthPx;
2088
+ const [canvasLabel, setCanvasLabel] = useState(null);
1876
2089
  const canvasBehaviour = canvas ? canvasBehaviourOf(canvas.canvasId) ?? null : null;
1877
2090
  const isCanvasOpen = canvas !== null;
1878
2091
  useCanvasShellTransitions({ conversationId, canvasViable });
@@ -1884,7 +2097,7 @@ const ConversationView = (props) => {
1884
2097
  if (canvasBehaviour) lastCanvasWidthPercentRef.current = canvasWidthPercentOf(canvasBehaviour);
1885
2098
  const canvasWidthPercent = lastCanvasWidthPercentRef.current;
1886
2099
  const boxCanvas = !!boxCanvasBelowTopBar && canvasViable;
1887
- const canvasInset = boxCanvas ? CANVAS_BOXED_INSET_PX : 0;
2100
+ const canvasInset = boxCanvas ? canvasLayout.boxedInsetPx : 0;
1888
2101
  const splitViewRootRef = useRef(null);
1889
2102
  const lastCanvasIdRef = useRef(null);
1890
2103
  if (canvas) lastCanvasIdRef.current = canvas.canvasId;
@@ -1893,14 +2106,17 @@ const ConversationView = (props) => {
1893
2106
  const setPulledCanvasWidth = (width) => setPulledCanvas(width !== null && lastCanvasIdRef.current ? { canvasId: lastCanvasIdRef.current, width } : null);
1894
2107
  const canvasResizable = canvasBehaviour?.layout === "split" && canvasViable && !props.isCompact;
1895
2108
  const splitViewRootStyle = {
1896
- "--agents-canvas-width-set": pulledCanvasWidth === null ? `${canvasWidthPercent}%` : `clamp(${CANVAS_MIN_WIDTH_PX + canvasInset * 2}px, ${pulledCanvasWidth}px, calc(100% - ${CHAT_COLUMN_MIN_WIDTH_PX}px))`,
2109
+ "--agents-canvas-width-set": pulledCanvasWidth === null ? canvasLayout.chatColumnMinWidthPx === CHAT_COLUMN_MIN_WIDTH_PX ? `${canvasWidthPercent}%` : (
2110
+ // a host's own chat minimum also caps the default split (the package's minimum is met by every viable split)
2111
+ `min(${canvasWidthPercent}%, calc(100% - ${chatColumnMinWidthPx}px))`
2112
+ ) : `clamp(${CANVAS_MIN_WIDTH_PX + canvasInset * 2}px, ${pulledCanvasWidth}px, calc(100% - ${chatColumnMinWidthPx}px))`,
1897
2113
  "--agents-canvas-inset": `${canvasInset}px`
1898
2114
  };
1899
2115
  const toggleCanvas = () => {
1900
2116
  if (canvas) closeCanvas(true);
1901
2117
  else reopenLastClosedCanvas();
1902
2118
  };
1903
- const showsNarrowReopenControl = !!enableCanvasToggle && !canvasViable && !isCanvasOpen && lastClosedCanvas !== null;
2119
+ const showsNarrowReopenControl = !!enableCanvasToggle && canvasLayout.showsNarrowReopenControl && !canvasViable && !isCanvasOpen && lastClosedCanvas !== null;
1904
2120
  if (props.disableSplitView) {
1905
2121
  return /* @__PURE__ */ jsx(ConversationViewBody, { ...props });
1906
2122
  }
@@ -1923,15 +2139,16 @@ const ConversationView = (props) => {
1923
2139
  {
1924
2140
  isSideOpen: isCanvasOpen,
1925
2141
  coversBelowWidth: 850,
1926
- sideToggle: enableCanvasToggle && !canvasResizable && (isCanvasOpen || lastClosedCanvas !== null) ? {
2142
+ sideToggle: enableCanvasToggle && canvasLayout.showsDividerToggle && !canvasResizable && (isCanvasOpen || lastClosedCanvas !== null) ? {
1927
2143
  onToggle: toggleCanvas,
1928
2144
  // Centered vertically on the divider.
1929
2145
  verticalPositionPercent: 50,
1930
2146
  // The chat's own re-open control is shown: the split view adds no second one while it covers.
1931
2147
  mainPaneShowsReopen: showsNarrowReopenControl,
1932
2148
  // The canvas pane carries its own close button: no floating toggle over it while it covers the chat.
1933
- sidePaneShowsClose: true
2149
+ sidePaneShowsClose: canvasLayout.showsCloseButton
1934
2150
  } : void 0,
2151
+ sideLabel: isCanvasOpen && canvasLabel !== null ? canvasLabel : void 0,
1935
2152
  main: {
1936
2153
  width: "100%",
1937
2154
  narrowedWidth: "calc(100% - var(--agents-canvas-width))",
@@ -1944,7 +2161,16 @@ const ConversationView = (props) => {
1944
2161
  narrowedWidth: "var(--agents-canvas-width)",
1945
2162
  content: (
1946
2163
  // Boxed only while side-split: below 850px the canvas is a full-screen overlay and stays full-bleed.
1947
- /* @__PURE__ */ jsx("div", { className: classNames(classes$1.splitViewPane, boxCanvas ? classes$1.splitViewPaneBoxed : ""), children: /* @__PURE__ */ jsx(CanvasPane, { messages, boxed: boxCanvas }) })
2164
+ /* @__PURE__ */ jsx(
2165
+ "div",
2166
+ {
2167
+ className: classNames(
2168
+ classes$1.splitViewPane,
2169
+ boxCanvas && canvasLayout.paneSurface === "card" ? classes$1.splitViewPaneBoxed : ""
2170
+ ),
2171
+ children: /* @__PURE__ */ jsx(CanvasLabelContext.Provider, { value: setCanvasLabel, children: /* @__PURE__ */ jsx(CanvasPane, { messages, boxed: boxCanvas }) })
2172
+ }
2173
+ )
1948
2174
  )
1949
2175
  }
1950
2176
  }
@@ -1954,6 +2180,7 @@ const ConversationView = (props) => {
1954
2180
  {
1955
2181
  rootRef: splitViewRootRef,
1956
2182
  inset: canvasInset,
2183
+ chatColumnMinWidthPx,
1957
2184
  width: pulledCanvasWidth,
1958
2185
  onWidthChange: setPulledCanvasWidth,
1959
2186
  onClose: () => closeCanvas(true)
@@ -2719,48 +2946,12 @@ const useConversationMessagePages = (chatStore, client, pageSize = CONVERSATION_
2719
2946
  [readConversationMetadata, fetchOpeningPage, refetchChangedTail, loadOlder, loadingOlder]
2720
2947
  );
2721
2948
  };
2722
- const isTurnInitiatorMessage = (message) => {
2723
- if (message.messageType === "ERROR" || message.messageType === "CHECKPOINT" || message.messageType === "TOOL_MESSAGE") {
2724
- return false;
2725
- }
2726
- if (message.messageType === "SIGNAL") return !SIGNAL_SOURCES_THAT_OWE_NO_WORK.includes(message.signalSource ?? "");
2727
- if (message.role !== "USER") return false;
2728
- if (message.messageType === "TOOL_CALL") return false;
2729
- return !(message.message ?? "").startsWith("/toolresult ");
2730
- };
2731
- const isAssistantAnswer = (message) => message.role === "ASSISTANT" && (message.messageType === "TEXT" || message.messageType == null) && assistantMessageHasRenderableMarkdown(message.message);
2732
- const NO_TURN_IN_FLIGHT = { liveTurnMessageId: null, queuedMessages: [] };
2733
- const findTurnsInFlight = (messages, isTurnRunning, namedTurnMessageId) => {
2734
- if (!isTurnRunning || !messages?.length) return NO_TURN_IN_FLIGHT;
2735
- let firstIndexAfterNewestAnswer = 0;
2736
- for (let index = messages.length - 1; index >= 0; index -= 1) {
2737
- if (isAssistantAnswer(messages[index])) {
2738
- firstIndexAfterNewestAnswer = index + 1;
2739
- break;
2740
- }
2741
- }
2742
- const candidates = messages.slice(firstIndexAfterNewestAnswer).filter(isTurnInitiatorMessage);
2743
- if (candidates.length === 0 && namedTurnMessageId === null) {
2744
- const newestInitiator = messages.slice(0, firstIndexAfterNewestAnswer).filter(isTurnInitiatorMessage).at(-1);
2745
- return { liveTurnMessageId: typeof newestInitiator?.id === "number" ? newestInitiator.id : null, queuedMessages: [] };
2746
- }
2747
- const namedPosition = namedTurnMessageId === null ? -1 : candidates.findIndex((candidate) => candidate.id === namedTurnMessageId);
2748
- const isNamedBeforeCandidates = namedTurnMessageId !== null && namedPosition === -1;
2749
- const livePosition = isNamedBeforeCandidates ? -1 : Math.max(namedPosition, 0);
2750
- const liveCandidate = isNamedBeforeCandidates ? void 0 : candidates[livePosition];
2751
- const liveTurnMessageId = isNamedBeforeCandidates ? namedTurnMessageId : typeof liveCandidate?.id === "number" ? liveCandidate.id : null;
2752
- return {
2753
- liveTurnMessageId,
2754
- // Only the owner's own words show as queued; a signal behind the running turn has no bubble.
2755
- queuedMessages: candidates.slice(livePosition + 1).filter((candidate) => candidate.role === "USER" && candidate.messageType !== "SIGNAL")
2756
- };
2757
- };
2758
2949
  const QueuedMessageChip = (props) => {
2759
- const { text, isCompact = false, wasTakenUp = false, className } = props;
2950
+ const { text: text2, isCompact = false, wasTakenUp = false, className } = props;
2760
2951
  if (wasTakenUp) {
2761
- return /* @__PURE__ */ jsxs("div", { className: classNames(styles$l.queued, styles$l.queuedTakenUp, className), "data-testid": "trace-queued-message-taken-up", "data-compact": isCompact || void 0, title: text ?? void 0, children: [
2952
+ return /* @__PURE__ */ jsxs("div", { className: classNames(styles$m.queued, styles$m.queuedTakenUp, className), "data-testid": "trace-queued-message-taken-up", "data-compact": isCompact || void 0, title: text2 ?? void 0, children: [
2762
2953
  /* @__PURE__ */ jsx(Icon, { name: "stepDone", pixelSize: 12 }),
2763
- /* @__PURE__ */ jsxs("span", { className: styles$l.queuedText, children: [
2954
+ /* @__PURE__ */ jsxs("span", { className: styles$m.queuedText, children: [
2764
2955
  translateText("Sent during the run"),
2765
2956
  isCompact ? null : /* @__PURE__ */ jsxs(Fragment$1, { children: [
2766
2957
  " · ",
@@ -2772,16 +2963,16 @@ const QueuedMessageChip = (props) => {
2772
2963
  return /* @__PURE__ */ jsxs(
2773
2964
  "div",
2774
2965
  {
2775
- className: classNames(styles$l.queued, !text && styles$l.queuedInThread, className),
2966
+ className: classNames(styles$m.queued, !text2 && styles$m.queuedInThread, className),
2776
2967
  role: "status",
2777
2968
  "data-testid": "trace-queued-message",
2778
2969
  "data-compact": isCompact || void 0,
2779
2970
  children: [
2780
2971
  /* @__PURE__ */ jsx(Icon, { name: "stepWaiting", pixelSize: 13 }),
2781
- /* @__PURE__ */ jsx("span", { className: styles$l.queuedText, children: text ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
2972
+ /* @__PURE__ */ jsx("span", { className: styles$m.queuedText, children: text2 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
2782
2973
  translateText("Queued:"),
2783
2974
  " ",
2784
- /* @__PURE__ */ jsx("span", { className: styles$l.queuedQuote, children: text }),
2975
+ /* @__PURE__ */ jsx("span", { className: styles$m.queuedQuote, children: text2 }),
2785
2976
  isCompact ? null : /* @__PURE__ */ jsxs(Fragment$1, { children: [
2786
2977
  " · ",
2787
2978
  translateText("read at the next step")
@@ -3142,6 +3333,7 @@ const AgentChatController = (props) => {
3142
3333
  ActivityHistory,
3143
3334
  TurnTrace,
3144
3335
  showsQueuedMessages = false,
3336
+ messageTimes = null,
3145
3337
  children,
3146
3338
  disableSplitView = false,
3147
3339
  hostHasCanvasSurface = !disableSplitView,
@@ -3153,7 +3345,7 @@ const AgentChatController = (props) => {
3153
3345
  useImperativeHandle(
3154
3346
  composerRef,
3155
3347
  () => ({
3156
- setComposerDraft: (text) => conversationMessageInputApiRef.current?.insertTextIntoInput(text),
3348
+ setComposerDraft: (text2) => conversationMessageInputApiRef.current?.insertTextIntoInput(text2),
3157
3349
  focusComposer: () => conversationMessageInputApiRef.current?.focusInput?.()
3158
3350
  }),
3159
3351
  []
@@ -3413,7 +3605,7 @@ const AgentChatController = (props) => {
3413
3605
  // Message-only for widgets; resolves true only once the send was accepted (a widget locks on it).
3414
3606
  sendMessageToChat: (message) => Promise.resolve(handleSendMessage(message, {}) === true),
3415
3607
  injectSignal: handleInjectSignal,
3416
- prefillComposer: (text) => conversationMessageInputApiRef.current?.insertTextIntoInput(text),
3608
+ prefillComposer: (text2) => conversationMessageInputApiRef.current?.insertTextIntoInput(text2),
3417
3609
  attachLibraryFilesToComposer,
3418
3610
  chatAgentSpaceKey: agentSpaceKey,
3419
3611
  conversationId: liveConversationId,
@@ -3593,6 +3785,7 @@ const AgentChatController = (props) => {
3593
3785
  hostComposerWidgets,
3594
3786
  taskInstructionMessageId,
3595
3787
  isConversationClosed: isConversationRunEnded,
3788
+ messageTimes,
3596
3789
  conversationMessageInputApiRef,
3597
3790
  onSuggestionClick: () => {
3598
3791
  },
@@ -3606,7 +3799,7 @@ const AgentChatController = (props) => {
3606
3799
  const chatArea = "agents_chatArea_4XiCda";
3607
3800
  const chatAreaWithTopBlurBand = "agents_chatAreaWithTopBlurBand_W-AdU0";
3608
3801
  const chatWrap = "agents_chatWrap_yS-zs5";
3609
- const styles$5 = {
3802
+ const styles$6 = {
3610
3803
  chatArea,
3611
3804
  chatAreaWithTopBlurBand,
3612
3805
  chatWrap
@@ -3625,7 +3818,7 @@ const AgentChat = (props) => {
3625
3818
  onNewConversation,
3626
3819
  inputReplacementSlot,
3627
3820
  chatAreaClassName,
3628
- chatWrapClassName = styles$5.chatWrap,
3821
+ chatWrapClassName = styles$6.chatWrap,
3629
3822
  showsTopBlurBand = false,
3630
3823
  confineTopBlurBandToChatPane: confineTopBlurBandToChatPane2 = showsTopBlurBand,
3631
3824
  ...controllerProps
@@ -3675,7 +3868,7 @@ const AgentChat = (props) => {
3675
3868
  ThinkingIndicator,
3676
3869
  ActivityHistory,
3677
3870
  inputReplacementSlot: inputReplacementSlot ?? (isConversationRunEnded ? /* @__PURE__ */ jsx(ConversationClosedBar, {}) : void 0),
3678
- chatAreaClassName: chatAreaClassName ?? classNames(styles$5.chatArea, showsTopBlurBand ? styles$5.chatAreaWithTopBlurBand : void 0),
3871
+ chatAreaClassName: chatAreaClassName ?? classNames(styles$6.chatArea, showsTopBlurBand ? styles$6.chatAreaWithTopBlurBand : void 0),
3679
3872
  chatWrapClassName
3680
3873
  }
3681
3874
  ) });
@@ -3719,10 +3912,10 @@ const BackgroundTasksList = (props) => {
3719
3912
  ] });
3720
3913
  };
3721
3914
  const OPERATION_CLASS_NAMES = {
3722
- ADDED: styles$m.operationAdded,
3723
- MODIFIED: styles$m.operationModified,
3724
- DELETED: styles$m.operationDeleted,
3725
- RENAMED: styles$m.operationRenamed
3915
+ ADDED: styles$n.operationAdded,
3916
+ MODIFIED: styles$n.operationModified,
3917
+ DELETED: styles$n.operationDeleted,
3918
+ RENAMED: styles$n.operationRenamed
3726
3919
  };
3727
3920
  const ChangedFilesPane = (props) => {
3728
3921
  const {
@@ -3755,12 +3948,12 @@ const ChangedFilesPane = (props) => {
3755
3948
  const describeExtra = (fileChange) => {
3756
3949
  if (fileChange.linesAdded != null || fileChange.linesRemoved != null) {
3757
3950
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
3758
- /* @__PURE__ */ jsxs("span", { className: styles$m.added, children: [
3951
+ /* @__PURE__ */ jsxs("span", { className: styles$n.added, children: [
3759
3952
  "+",
3760
3953
  format.number(fileChange.linesAdded ?? 0)
3761
3954
  ] }),
3762
3955
  " ",
3763
- /* @__PURE__ */ jsxs("span", { className: styles$m.removed, children: [
3956
+ /* @__PURE__ */ jsxs("span", { className: styles$n.removed, children: [
3764
3957
  "−",
3765
3958
  format.number(fileChange.linesRemoved ?? 0)
3766
3959
  ] })
@@ -3770,37 +3963,37 @@ const ChangedFilesPane = (props) => {
3770
3963
  if (fileChange.sizeAfter != null) return format.bytes(fileChange.sizeAfter);
3771
3964
  return null;
3772
3965
  };
3773
- return /* @__PURE__ */ jsxs("div", { className: classNames(styles$m.pane, className), "data-testid": "trace-changed-files", children: [
3774
- /* @__PURE__ */ jsxs("div", { className: styles$m.paneHead, children: [
3775
- title2 !== void 0 && title2 !== null ? /* @__PURE__ */ jsx("span", { className: styles$m.paneTitle, children: title2 }) : null,
3966
+ return /* @__PURE__ */ jsxs("div", { className: classNames(styles$n.pane, className), "data-testid": "trace-changed-files", children: [
3967
+ /* @__PURE__ */ jsxs("div", { className: styles$n.paneHead, children: [
3968
+ title2 !== void 0 && title2 !== null ? /* @__PURE__ */ jsx("span", { className: styles$n.paneTitle, children: title2 }) : null,
3776
3969
  /* @__PURE__ */ jsx(FileChangesSummary, { fileCount, linesAdded, linesRemoved }),
3777
- /* @__PURE__ */ jsx("span", { className: styles$m.grow }),
3970
+ /* @__PURE__ */ jsx("span", { className: styles$n.grow }),
3778
3971
  headerActions
3779
3972
  ] }),
3780
- fileChanges.length === 0 ? /* @__PURE__ */ jsx("div", { className: styles$m.paneEmpty, children: translateText("No files were changed.") }) : /* @__PURE__ */ jsx("ul", { className: styles$m.paneList, children: fileChanges.map((fileChange, index) => {
3973
+ fileChanges.length === 0 ? /* @__PURE__ */ jsx("div", { className: styles$n.paneEmpty, children: translateText("No files were changed.") }) : /* @__PURE__ */ jsx("ul", { className: styles$n.paneList, children: fileChanges.map((fileChange, index) => {
3781
3974
  const changeType = fileChange.changeType ?? "MODIFIED";
3782
3975
  const extra = describeExtra(fileChange);
3783
3976
  const sandboxHref = buildSandboxHref?.(fileChange) ?? null;
3784
- return /* @__PURE__ */ jsxs("li", { className: sandboxHref !== null ? styles$m.paneFileRow : void 0, children: [
3977
+ return /* @__PURE__ */ jsxs("li", { className: sandboxHref !== null ? styles$n.paneFileRow : void 0, children: [
3785
3978
  /* @__PURE__ */ jsxs(
3786
3979
  "button",
3787
3980
  {
3788
3981
  type: "button",
3789
- className: classNames(styles$m.paneFile, index === shownSelectedIndex && styles$m.paneFileOn),
3982
+ className: classNames(styles$n.paneFile, index === shownSelectedIndex && styles$n.paneFileOn),
3790
3983
  "aria-current": index === shownSelectedIndex ? "true" : void 0,
3791
3984
  onClick: () => select(index),
3792
3985
  children: [
3793
3986
  /* @__PURE__ */ jsx(
3794
3987
  "span",
3795
3988
  {
3796
- className: classNames(styles$m.operation, styles$m.operationLetter, OPERATION_CLASS_NAMES[changeType]),
3989
+ className: classNames(styles$n.operation, styles$n.operationLetter, OPERATION_CLASS_NAMES[changeType]),
3797
3990
  title: readTraceFileChangeWord(changeType),
3798
3991
  "aria-label": readTraceFileChangeWord(changeType),
3799
3992
  children: readTraceFileChangeLetter(changeType)
3800
3993
  }
3801
3994
  ),
3802
3995
  /* @__PURE__ */ jsx(TracePath, { path: fileChange.path, isMonospaced: true, isRemoved: changeType === "DELETED" }),
3803
- /* @__PURE__ */ jsx("span", { className: styles$m.grow }),
3996
+ /* @__PURE__ */ jsx("span", { className: styles$n.grow }),
3804
3997
  /* @__PURE__ */ jsx(
3805
3998
  TraceMountChip,
3806
3999
  {
@@ -3810,17 +4003,17 @@ const ChangedFilesPane = (props) => {
3810
4003
  describeMount
3811
4004
  }
3812
4005
  ),
3813
- extra !== null ? /* @__PURE__ */ jsx("span", { className: styles$m.paneFileExtra, children: extra }) : null
4006
+ extra !== null ? /* @__PURE__ */ jsx("span", { className: styles$n.paneFileExtra, children: extra }) : null
3814
4007
  ]
3815
4008
  }
3816
4009
  ),
3817
4010
  sandboxHref !== null ? (
3818
4011
  // Beside the row's button, never inside it: a link in a button is no valid markup.
3819
- /* @__PURE__ */ jsx(TraceLink, { href: sandboxHref, linkComponent, className: styles$m.paneFileLink, title: translateText("Show this file in the sandbox"), children: /* @__PURE__ */ jsx(Icon, { name: "terminal", pixelSize: 13 }) })
4012
+ /* @__PURE__ */ jsx(TraceLink, { href: sandboxHref, linkComponent, className: styles$n.paneFileLink, title: translateText("Show this file in the sandbox"), children: /* @__PURE__ */ jsx(Icon, { name: "terminal", pixelSize: 13 }) })
3820
4013
  ) : null
3821
4014
  ] }, `${fileChange.id ?? index}:${fileChange.path}`);
3822
4015
  }) }),
3823
- selectedFileChange ? /* @__PURE__ */ jsx("div", { className: styles$m.paneDetail, children: /* @__PURE__ */ jsx(
4016
+ selectedFileChange ? /* @__PURE__ */ jsx("div", { className: styles$n.paneDetail, children: /* @__PURE__ */ jsx(
3824
4017
  FileEditBlock,
3825
4018
  {
3826
4019
  ...fileEditProps,
@@ -3848,11 +4041,11 @@ const ChangeSetCard = (props) => {
3848
4041
  };
3849
4042
  return /* @__PURE__ */ jsxs("div", { className: classNames(agentStyles.changeSet, isUndone && agentStyles.changeSetPending, className), "data-testid": "trace-change-set", "data-undone": isUndone || void 0, children: [
3850
4043
  /* @__PURE__ */ jsxs("div", { className: agentStyles.changeSetHead, children: [
3851
- /* @__PURE__ */ jsx(Icon, { name: icon, pixelSize: 15, className: styles$l.rowIcon }),
4044
+ /* @__PURE__ */ jsx(Icon, { name: icon, pixelSize: 15, className: styles$m.rowIcon }),
3852
4045
  /* @__PURE__ */ jsx("span", { className: agentStyles.changeSetTitle, children: title2 }),
3853
4046
  entity,
3854
4047
  /* @__PURE__ */ jsx("span", { className: agentStyles.changeSetGrow }),
3855
- isUndone ? /* @__PURE__ */ jsx("span", { className: styles$l.badge, children: translateText("Undone") }) : null
4048
+ isUndone ? /* @__PURE__ */ jsx("span", { className: styles$m.badge, children: translateText("Undone") }) : null
3856
4049
  ] }),
3857
4050
  /* @__PURE__ */ jsx("dl", { className: agentStyles.changes, children: changes.map((change, index) => {
3858
4051
  const hasBefore = change.before != null && change.before !== "";
@@ -3860,7 +4053,7 @@ const ChangeSetCard = (props) => {
3860
4053
  return /* @__PURE__ */ jsxs("div", { style: { display: "contents" }, "data-testid": "trace-change", children: [
3861
4054
  /* @__PURE__ */ jsx("dt", { className: agentStyles.changeName, children: change.label }),
3862
4055
  /* @__PURE__ */ jsx("dd", { className: classNames(agentStyles.changeValue, hasBefore ? agentStyles.changeOld : agentStyles.changeUnchanged), children: hasBefore ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
3863
- /* @__PURE__ */ jsxs("span", { className: styles$l.visuallyHidden, children: [
4056
+ /* @__PURE__ */ jsxs("span", { className: styles$m.visuallyHidden, children: [
3864
4057
  translateText("Before:"),
3865
4058
  " "
3866
4059
  ] }),
@@ -3868,7 +4061,7 @@ const ChangeSetCard = (props) => {
3868
4061
  ] }) : "—" }),
3869
4062
  /* @__PURE__ */ jsx("dd", { className: classNames(agentStyles.changeValue, agentStyles.changeArrow), "aria-hidden": true, children: "→" }),
3870
4063
  /* @__PURE__ */ jsx("dd", { className: classNames(agentStyles.changeValue, hasAfter ? agentStyles.changeNew : agentStyles.changeUnchanged), children: hasAfter ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
3871
- /* @__PURE__ */ jsxs("span", { className: styles$l.visuallyHidden, children: [
4064
+ /* @__PURE__ */ jsxs("span", { className: styles$m.visuallyHidden, children: [
3872
4065
  translateText("After:"),
3873
4066
  " "
3874
4067
  ] }),
@@ -3880,32 +4073,18 @@ const ChangeSetCard = (props) => {
3880
4073
  note2 ? /* @__PURE__ */ jsx("span", { className: agentStyles.changeSetNote, children: note2 }) : null,
3881
4074
  /* @__PURE__ */ jsx("span", { className: agentStyles.changeSetGrow }),
3882
4075
  actions2,
3883
- onUndo && !isUndone ? /* @__PURE__ */ jsxs("button", { type: "button", className: styles$l.stopButton, disabled: isUndoPending, onClick: () => void handleUndo(), children: [
4076
+ onUndo && !isUndone ? /* @__PURE__ */ jsxs("button", { type: "button", className: styles$m.stopButton, disabled: isUndoPending, onClick: () => void handleUndo(), children: [
3884
4077
  /* @__PURE__ */ jsx(Icon, { name: "undo", pixelSize: 13 }),
3885
4078
  translateText("Undo")
3886
4079
  ] }) : null
3887
4080
  ] }) : null
3888
4081
  ] });
3889
4082
  };
3890
- const plan = "agents_plan_fUk0Cn";
3891
- const head = "agents_head_ei8NJQ";
3892
- const title = "agents_title_5Puazk";
3893
- const titleClamped = "agents_titleClamped_aVu5aw";
3894
- const quiet = "agents_quiet_-57i6u";
3895
- const grow = "agents_grow_-Ny7Qu";
3896
- const meter = "agents_meter_GbJSox";
3897
- const meterFill = "agents_meterFill_crRsRr";
3898
- const items = "agents_items_5iP2dV";
3899
- const item = "agents_item_hMmGsa";
3900
- const itemDone = "agents_itemDone_Zx6jhT";
3901
- const itemNext = "agents_itemNext_d9RLRd";
3902
- const box = "agents_box_uNFF6C";
3903
- const itemSkipped = "agents_itemSkipped_1TqmwX";
3904
- const itemBlocked = "agents_itemBlocked_tGu3mM";
3905
- const number = "agents_number_sa8-dA";
3906
- const itemText = "agents_itemText_o93Of0";
3907
- const itemLink = "agents_itemLink_sVVPi-";
3908
- const mark = "agents_mark_6Xg7Dz";
4083
+ const head$1 = "agents_head_ei8NJQ";
4084
+ const title$1 = "agents_title_5Puazk";
4085
+ const quiet$1 = "agents_quiet_-57i6u";
4086
+ const grow$1 = "agents_grow_-Ny7Qu";
4087
+ const mark$1 = "agents_mark_6Xg7Dz";
3909
4088
  const markWarning = "agents_markWarning_OkUqju";
3910
4089
  const markDanger = "agents_markDanger_A9kQOI";
3911
4090
  const markDelete = "agents_markDelete_K9mc-B";
@@ -3923,26 +4102,12 @@ const markCreated = "agents_markCreated_h3npcj";
3923
4102
  const recordChangeSets = "agents_recordChangeSets_DULh2V";
3924
4103
  const recordLink = "agents_recordLink_a4Fnwz";
3925
4104
  const note = "agents_note_1xkyAQ";
3926
- const styles$4 = {
3927
- plan,
3928
- head,
3929
- title,
3930
- titleClamped,
3931
- quiet,
3932
- grow,
3933
- meter,
3934
- meterFill,
3935
- items,
3936
- item,
3937
- itemDone,
3938
- itemNext,
3939
- box,
3940
- itemSkipped,
3941
- itemBlocked,
3942
- number,
3943
- itemText,
3944
- itemLink,
3945
- mark,
4105
+ const styles$5 = {
4106
+ head: head$1,
4107
+ title: title$1,
4108
+ quiet: quiet$1,
4109
+ grow: grow$1,
4110
+ mark: mark$1,
3946
4111
  markWarning,
3947
4112
  markDanger,
3948
4113
  markDelete,
@@ -3976,13 +4141,13 @@ const ChangedRecordsList = (props) => {
3976
4141
  const { records: records2, title: title2, describeEntity, buildEntityHref, buildStepHref, linkComponent, note: note2, describeRecord, className } = props;
3977
4142
  const format = useTraceFormat();
3978
4143
  if (records2.length === 0) return null;
3979
- return /* @__PURE__ */ jsxs("div", { className: classNames(styles$4.records, className), "data-testid": "trace-changed-records", children: [
3980
- /* @__PURE__ */ jsxs("div", { className: styles$4.head, children: [
3981
- /* @__PURE__ */ jsx("span", { className: styles$4.title, children: title2 || translateText("Records changed") }),
3982
- /* @__PURE__ */ jsx("span", { className: styles$4.grow }),
3983
- /* @__PURE__ */ jsx("span", { className: styles$4.quiet, children: format.number(records2.length) })
4144
+ return /* @__PURE__ */ jsxs("div", { className: classNames(styles$5.records, className), "data-testid": "trace-changed-records", children: [
4145
+ /* @__PURE__ */ jsxs("div", { className: styles$5.head, children: [
4146
+ /* @__PURE__ */ jsx("span", { className: styles$5.title, children: title2 || translateText("Records changed") }),
4147
+ /* @__PURE__ */ jsx("span", { className: styles$5.grow }),
4148
+ /* @__PURE__ */ jsx("span", { className: styles$5.quiet, children: format.number(records2.length) })
3984
4149
  ] }),
3985
- /* @__PURE__ */ jsx("ul", { className: styles$4.recordsList, children: records2.map((record2) => {
4150
+ /* @__PURE__ */ jsx("ul", { className: styles$5.recordsList, children: records2.map((record2) => {
3986
4151
  const startedAt = readTraceMoment(record2.startedAt);
3987
4152
  const words = record2.toolNameInWords || record2.toolName || translateText("Used a tool");
3988
4153
  const stepHref = buildStepHref?.(record2) ?? null;
@@ -4002,27 +4167,27 @@ const ChangedRecordsList = (props) => {
4002
4167
  },
4003
4168
  `${reference.argumentName}:${reference.id}`
4004
4169
  );
4005
- }).filter((chip) => chip !== null);
4170
+ }).filter((chip2) => chip2 !== null);
4006
4171
  const isQuiet = record2.state === "failed" || record2.state === "waiting" || record2.state === "cancelled";
4007
4172
  return /* @__PURE__ */ jsxs(
4008
4173
  "li",
4009
4174
  {
4010
- className: classNames(styles$4.record, isQuiet && styles$4.recordQuiet),
4175
+ className: classNames(styles$5.record, isQuiet && styles$5.recordQuiet),
4011
4176
  "data-record-effect": record2.effect,
4012
4177
  "data-record-state": record2.state,
4013
4178
  children: [
4014
- /* @__PURE__ */ jsxs("div", { className: styles$4.recordHead, children: [
4015
- /* @__PURE__ */ jsx(Icon, { name: record2.effect === "DELETE" ? "trash" : "toolWrite", pixelSize: 14, className: styles$4.recordIcon }),
4016
- /* @__PURE__ */ jsx("span", { className: styles$4.recordTitle, title: record2.toolName ?? void 0, children: words }),
4017
- record2.effect === "DELETE" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.mark, styles$4.markDelete), children: translateText("deletes data", void 0, "tool-effect") }) : null,
4018
- record2.state === "waiting" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.mark, styles$4.markWarning), children: translateText("waits for approval") }) : null,
4019
- record2.state === "failed" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.mark, styles$4.markDanger), children: readTraceStateLabel("failed") }) : null,
4020
- record2.state === "running" || record2.state === "cancelled" ? /* @__PURE__ */ jsx("span", { className: styles$4.mark, children: readTraceStateLabel(record2.state) }) : null,
4021
- /* @__PURE__ */ jsx("span", { className: styles$4.grow }),
4022
- startedAt !== null ? /* @__PURE__ */ jsx("span", { className: styles$4.recordTime, children: format.time(startedAt) }) : null
4179
+ /* @__PURE__ */ jsxs("div", { className: styles$5.recordHead, children: [
4180
+ /* @__PURE__ */ jsx(Icon, { name: record2.effect === "DELETE" ? "trash" : "toolWrite", pixelSize: 14, className: styles$5.recordIcon }),
4181
+ /* @__PURE__ */ jsx("span", { className: styles$5.recordTitle, title: record2.toolName ?? void 0, children: words }),
4182
+ record2.effect === "DELETE" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$5.mark, styles$5.markDelete), children: translateText("deletes data", void 0, "tool-effect") }) : null,
4183
+ record2.state === "waiting" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$5.mark, styles$5.markWarning), children: translateText("waits for approval") }) : null,
4184
+ record2.state === "failed" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$5.mark, styles$5.markDanger), children: readTraceStateLabel("failed") }) : null,
4185
+ record2.state === "running" || record2.state === "cancelled" ? /* @__PURE__ */ jsx("span", { className: styles$5.mark, children: readTraceStateLabel(record2.state) }) : null,
4186
+ /* @__PURE__ */ jsx("span", { className: styles$5.grow }),
4187
+ startedAt !== null ? /* @__PURE__ */ jsx("span", { className: styles$5.recordTime, children: format.time(startedAt) }) : null
4023
4188
  ] }),
4024
- record2.line && record2.line !== words ? /* @__PURE__ */ jsx("div", { className: styles$4.recordLine, children: record2.line }) : null,
4025
- record2.recordChanges.length > 0 || record2.omittedRecordChangeCount > 0 ? /* @__PURE__ */ jsxs("div", { className: styles$4.recordChangeSets, children: [
4189
+ record2.line && record2.line !== words ? /* @__PURE__ */ jsx("div", { className: styles$5.recordLine, children: record2.line }) : null,
4190
+ record2.recordChanges.length > 0 || record2.omittedRecordChangeCount > 0 ? /* @__PURE__ */ jsxs("div", { className: styles$5.recordChangeSets, children: [
4026
4191
  record2.recordChanges.map((recordChange, recordIndex) => /* @__PURE__ */ jsx(
4027
4192
  ChangeSetCard,
4028
4193
  {
@@ -4032,9 +4197,9 @@ const ChangedRecordsList = (props) => {
4032
4197
  "span",
4033
4198
  {
4034
4199
  className: classNames(
4035
- styles$4.mark,
4036
- recordChange.operation === "CREATED" && styles$4.markCreated,
4037
- recordChange.operation === "DELETED" && styles$4.markDelete
4200
+ styles$5.mark,
4201
+ recordChange.operation === "CREATED" && styles$5.markCreated,
4202
+ recordChange.operation === "DELETED" && styles$5.markDelete
4038
4203
  ),
4039
4204
  children: readRecordOperationLabel(recordChange.operation)
4040
4205
  }
@@ -4049,11 +4214,11 @@ const ChangedRecordsList = (props) => {
4049
4214
  },
4050
4215
  `${recordChange.tableName}:${recordChange.recordId ?? `new-${recordIndex}`}`
4051
4216
  )),
4052
- record2.omittedRecordChangeCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$4.recordLine, children: translateText("%count% more records", { count: format.number(record2.omittedRecordChangeCount) }) }) : null
4217
+ record2.omittedRecordChangeCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$5.recordLine, children: translateText("%count% more records", { count: format.number(record2.omittedRecordChangeCount) }) }) : null
4053
4218
  ] }) : null,
4054
- chips.length > 0 || stepHref !== null ? /* @__PURE__ */ jsxs("div", { className: styles$4.recordFoot, children: [
4219
+ chips.length > 0 || stepHref !== null ? /* @__PURE__ */ jsxs("div", { className: styles$5.recordFoot, children: [
4055
4220
  chips,
4056
- stepHref !== null ? /* @__PURE__ */ jsxs(TraceLink, { href: stepHref, linkComponent, className: styles$4.recordLink, title: translateText("Open this step in the analysis"), children: [
4221
+ stepHref !== null ? /* @__PURE__ */ jsxs(TraceLink, { href: stepHref, linkComponent, className: styles$5.recordLink, title: translateText("Open this step in the analysis"), children: [
4057
4222
  /* @__PURE__ */ jsx(Icon, { name: "external", pixelSize: 12 }),
4058
4223
  translateText("Open in analysis")
4059
4224
  ] }) : null
@@ -4063,7 +4228,7 @@ const ChangedRecordsList = (props) => {
4063
4228
  record2.key
4064
4229
  );
4065
4230
  }) }),
4066
- note2 ? /* @__PURE__ */ jsx("p", { className: styles$4.note, children: note2 }) : null
4231
+ note2 ? /* @__PURE__ */ jsx("p", { className: styles$5.note, children: note2 }) : null
4067
4232
  ] });
4068
4233
  };
4069
4234
  const ContextRing = (props) => {
@@ -4079,12 +4244,12 @@ const ContextRing = (props) => {
4079
4244
  total: format.count(contextWindowTokens)
4080
4245
  }) : translateText("Context %percent% % full", { percent: shownPercent });
4081
4246
  const content2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
4082
- /* @__PURE__ */ jsxs("svg", { className: styles$l.ringSvg, width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-hidden": true, children: [
4083
- /* @__PURE__ */ jsx("circle", { className: styles$l.ringTrack, cx: size / 2, cy: size / 2, r: radius, strokeWidth }),
4247
+ /* @__PURE__ */ jsxs("svg", { className: styles$m.ringSvg, width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-hidden": true, children: [
4248
+ /* @__PURE__ */ jsx("circle", { className: styles$m.ringTrack, cx: size / 2, cy: size / 2, r: radius, strokeWidth }),
4084
4249
  /* @__PURE__ */ jsx(
4085
4250
  "circle",
4086
4251
  {
4087
- className: classNames(styles$l.ringArc, shownPercent >= 95 ? styles$l.ringArcFull : shownPercent >= 80 && styles$l.ringArcHigh),
4252
+ className: classNames(styles$m.ringArc, shownPercent >= 95 ? styles$m.ringArcFull : shownPercent >= 80 && styles$m.ringArcHigh),
4088
4253
  cx: size / 2,
4089
4254
  cy: size / 2,
4090
4255
  r: radius,
@@ -4103,7 +4268,7 @@ const ContextRing = (props) => {
4103
4268
  "button",
4104
4269
  {
4105
4270
  type: "button",
4106
- className: classNames(styles$l.ring, styles$l.ringInteractive, className),
4271
+ className: classNames(styles$m.ring, styles$m.ringInteractive, className),
4107
4272
  "aria-label": label,
4108
4273
  title: label,
4109
4274
  onClick,
@@ -4112,7 +4277,7 @@ const ContextRing = (props) => {
4112
4277
  }
4113
4278
  );
4114
4279
  }
4115
- return /* @__PURE__ */ jsx("span", { className: classNames(styles$l.ring, className), role: "img", "aria-label": label, title: label, "data-testid": "trace-context-ring", children: content2 });
4280
+ return /* @__PURE__ */ jsx("span", { className: classNames(styles$m.ring, className), role: "img", "aria-label": label, title: label, "data-testid": "trace-context-ring", children: content2 });
4116
4281
  };
4117
4282
  const DEFAULT_PAGE_SIZE = 20;
4118
4283
  const DEFAULT_POLL_INTERVAL_MS = 1500;
@@ -4455,16 +4620,16 @@ const ConversationChildTrace = (props) => {
4455
4620
  if (rows.length === 0) {
4456
4621
  return /* @__PURE__ */ jsx("div", { className: agentStyles.quiet, children: state.isRunLive ? translateText("No steps so far.") : translateText("This run recorded no steps.") });
4457
4622
  }
4458
- return /* @__PURE__ */ jsx("div", { className: classNames(styles$l.steps, isCompact && styles$l.compact), "data-testid": "trace-child-steps", children: rows.map((row) => /* @__PURE__ */ jsx(
4623
+ return /* @__PURE__ */ jsx("div", { className: classNames(styles$m.steps, isCompact && styles$m.compact), "data-testid": "trace-child-steps", children: rows.map((row2) => /* @__PURE__ */ jsx(
4459
4624
  TraceStepRow,
4460
4625
  {
4461
- step: row.step,
4626
+ step: row2.step,
4462
4627
  viewMode: viewMode === "summary" ? "normal" : viewMode,
4463
4628
  host,
4464
4629
  conversationId,
4465
4630
  isCompact
4466
4631
  },
4467
- row.key
4632
+ row2.key
4468
4633
  )) });
4469
4634
  };
4470
4635
  const ConsentRequestCard = (props) => {
@@ -4484,13 +4649,13 @@ const ConsentRequestCard = (props) => {
4484
4649
  );
4485
4650
  };
4486
4651
  const heading = calls.length === 1 ? translateText("Approve: %action%?", { action: calls[0].title }) : translateText("Approve %count% actions?", { count: calls.length });
4487
- return /* @__PURE__ */ jsxs("div", { className: classNames(styles$l.consentCard, isCompact && styles$l.consentCardCompact), "data-testid": "trace-consent-request", children: [
4488
- /* @__PURE__ */ jsxs("div", { className: styles$l.consentHead, children: [
4652
+ return /* @__PURE__ */ jsxs("div", { className: classNames(styles$m.consentCard, isCompact && styles$m.consentCardCompact), "data-testid": "trace-consent-request", children: [
4653
+ /* @__PURE__ */ jsxs("div", { className: styles$m.consentHead, children: [
4489
4654
  /* @__PURE__ */ jsx(Icon, { name: "stepWaiting", pixelSize: 14 }),
4490
- /* @__PURE__ */ jsx("span", { className: styles$l.consentTitle, children: heading }),
4491
- /* @__PURE__ */ jsx("span", { className: classNames(styles$l.badge, styles$l.badgeWarning), children: translateText("waits for you") })
4655
+ /* @__PURE__ */ jsx("span", { className: styles$m.consentTitle, children: heading }),
4656
+ /* @__PURE__ */ jsx("span", { className: classNames(styles$m.badge, styles$m.badgeWarning), children: translateText("waits for you") })
4492
4657
  ] }),
4493
- calls.some((call) => call.line) ? /* @__PURE__ */ jsx("ul", { className: styles$l.consentCalls, children: calls.map((call, position) => (
4658
+ calls.some((call) => call.line) ? /* @__PURE__ */ jsx("ul", { className: styles$m.consentCalls, children: calls.map((call, position) => (
4494
4659
  // biome-ignore lint/suspicious/noArrayIndexKey: the calls of one turn keep their order
4495
4660
  /* @__PURE__ */ jsxs("li", { children: [
4496
4661
  calls.length > 1 ? /* @__PURE__ */ jsxs("b", { children: [
@@ -4500,10 +4665,10 @@ const ConsentRequestCard = (props) => {
4500
4665
  call.line
4501
4666
  ] }, position)
4502
4667
  )) }) : null,
4503
- /* @__PURE__ */ jsxs("div", { className: styles$l.consentActions, children: [
4504
- /* @__PURE__ */ jsx("button", { type: "button", className: styles$l.consentApprove, disabled: sentAnswer !== null, onClick: () => answer("yes"), children: translateText("Approve") }),
4505
- /* @__PURE__ */ jsx("button", { type: "button", className: styles$l.consentDecline, disabled: sentAnswer !== null, onClick: () => answer("no"), children: translateText("Don't run it") }),
4506
- /* @__PURE__ */ jsx("span", { className: styles$l.consentNote, children: sentAnswer === null ? translateText("Runs only after your approval.") : translateText("Your answer was sent.") })
4668
+ /* @__PURE__ */ jsxs("div", { className: styles$m.consentActions, children: [
4669
+ /* @__PURE__ */ jsx("button", { type: "button", className: styles$m.consentApprove, disabled: sentAnswer !== null, onClick: () => answer("yes"), children: translateText("Approve") }),
4670
+ /* @__PURE__ */ jsx("button", { type: "button", className: styles$m.consentDecline, disabled: sentAnswer !== null, onClick: () => answer("no"), children: translateText("Don't run it") }),
4671
+ /* @__PURE__ */ jsx("span", { className: styles$m.consentNote, children: sentAnswer === null ? translateText("Runs only after your approval.") : translateText("Your answer was sent.") })
4507
4672
  ] })
4508
4673
  ] });
4509
4674
  };
@@ -4529,16 +4694,16 @@ const RunStatusLine = (props) => {
4529
4694
  setIsStopPending(false);
4530
4695
  }
4531
4696
  };
4532
- return /* @__PURE__ */ jsxs("div", { className: classNames(styles$l.statusLine, className), role: "status", "data-testid": "trace-run-status", children: [
4533
- /* @__PURE__ */ jsx("span", { className: styles$l.spinner, "aria-hidden": true }),
4534
- /* @__PURE__ */ jsxs("span", { className: styles$l.statusText, children: [
4535
- /* @__PURE__ */ jsx("span", { className: styles$l.statusWord, children: showsStopping ? translateText("Stopping…") : statusText ?? translateText("Working") }),
4697
+ return /* @__PURE__ */ jsxs("div", { className: classNames(styles$m.statusLine, className), role: "status", "data-testid": "trace-run-status", children: [
4698
+ /* @__PURE__ */ jsx("span", { className: styles$m.spinner, "aria-hidden": true }),
4699
+ /* @__PURE__ */ jsxs("span", { className: styles$m.statusText, children: [
4700
+ /* @__PURE__ */ jsx("span", { className: styles$m.statusWord, children: showsStopping ? translateText("Stopping…") : statusText ?? translateText("Working") }),
4536
4701
  figures.length > 0 ? ` · ${figures.join(" · ")}` : null
4537
4702
  ] }),
4538
- /* @__PURE__ */ jsx("span", { className: styles$l.metaGrow }),
4703
+ /* @__PURE__ */ jsx("span", { className: styles$m.metaGrow }),
4539
4704
  children,
4540
- onStop ? /* @__PURE__ */ jsxs("button", { type: "button", className: styles$l.stopButton, disabled: showsStopping, onClick: () => void handleStop(), children: [
4541
- /* @__PURE__ */ jsx("span", { className: styles$l.stopSquare, "aria-hidden": true }),
4705
+ onStop ? /* @__PURE__ */ jsxs("button", { type: "button", className: styles$m.stopButton, disabled: showsStopping, onClick: () => void handleStop(), children: [
4706
+ /* @__PURE__ */ jsx("span", { className: styles$m.stopSquare, "aria-hidden": true }),
4542
4707
  translateText("Stop")
4543
4708
  ] }) : null
4544
4709
  ] });
@@ -4678,8 +4843,8 @@ const ConversationTurnTrace = (props) => {
4678
4843
  }
4679
4844
  ) : null;
4680
4845
  const newestPlanStep = isLive ? findNewestTaskPlanStep(steps) : null;
4681
- const planRow = !isLive ? null : taskPlan && taskPlan.items.length > 0 ? /* @__PURE__ */ jsx(TaskPlanRow, { title: taskPlan.title, items: taskPlan.items, defaultOpen: !isCompact }) : newestPlanStep !== null ? /* @__PURE__ */ jsx(
4682
- TaskPlanRow,
4846
+ const planRow = !isLive ? null : taskPlan && taskPlan.items.length > 0 ? /* @__PURE__ */ jsx(TaskPlanRow$1, { title: taskPlan.title, items: taskPlan.items, defaultOpen: !isCompact }) : newestPlanStep !== null ? /* @__PURE__ */ jsx(
4847
+ TaskPlanRow$1,
4683
4848
  {
4684
4849
  title: newestPlanStep.taskPlanTitle,
4685
4850
  items: buildTaskPlanItems(newestPlanStep.taskPlanItems),
@@ -4692,19 +4857,19 @@ const ConversationTurnTrace = (props) => {
4692
4857
  const consentCard = consentCalls.length > 0 && numericTurnMessageId !== null ? /* @__PURE__ */ jsx(ConsentRequestCard, { conversationId, turnMessageId: numericTurnMessageId, calls: consentCalls, isCompact }) : null;
4693
4858
  if (shownViewMode === "summary" && !isSummaryOpened) {
4694
4859
  if (isLive) {
4695
- return /* @__PURE__ */ jsx("div", { className: classNames(styles$l.turnTrace, isCompact && styles$l.turnTraceCompact, className), "data-testid": "conversation-turn-trace", "data-view-mode": "summary", "data-phase": phase, children: statusLine });
4860
+ return /* @__PURE__ */ jsx("div", { className: classNames(styles$m.turnTrace, isCompact && styles$m.turnTraceCompact, className), "data-testid": "conversation-turn-trace", "data-view-mode": "summary", "data-phase": phase, children: statusLine });
4696
4861
  }
4697
4862
  if (readerSteps.length === 0) return null;
4698
4863
  const summaryParts = [
4699
4864
  describeStepCount(readerSteps.length, format),
4700
- totals?.durationMs != null ? format.duration(totals.durationMs) : null
4701
- ].filter((part) => part !== null);
4702
- return /* @__PURE__ */ jsxs("div", { className: classNames(styles$l.turnTrace, isCompact && styles$l.turnTraceCompact, className), "data-testid": "conversation-turn-trace", "data-view-mode": "summary", "data-phase": phase, children: [
4865
+ totals?.durationMs != null && totals.durationMs >= MIN_SHOWN_TURN_DURATION_MS ? format.duration(totals.durationMs) : null
4866
+ ].filter((part2) => part2 !== null);
4867
+ return /* @__PURE__ */ jsxs("div", { className: classNames(styles$m.turnTrace, isCompact && styles$m.turnTraceCompact, className), "data-testid": "conversation-turn-trace", "data-view-mode": "summary", "data-phase": phase, children: [
4703
4868
  /* @__PURE__ */ jsxs(
4704
4869
  "button",
4705
4870
  {
4706
4871
  type: "button",
4707
- className: styles$l.summaryChip,
4872
+ className: styles$m.summaryChip,
4708
4873
  "aria-expanded": false,
4709
4874
  title: translateText("Show the steps"),
4710
4875
  onClick: () => setIsSummaryOpened(true),
@@ -4739,7 +4904,7 @@ const ConversationTurnTrace = (props) => {
4739
4904
  return /* @__PURE__ */ jsxs(
4740
4905
  "div",
4741
4906
  {
4742
- className: classNames(styles$l.turnTrace, styles$l.anchor, isCompact && styles$l.turnTraceCompact, className),
4907
+ className: classNames(styles$m.turnTrace, styles$m.anchor, isCompact && styles$m.turnTraceCompact, className),
4743
4908
  "data-testid": "conversation-turn-trace",
4744
4909
  "data-view-mode": shownViewMode,
4745
4910
  "data-phase": phase,
@@ -4768,90 +4933,782 @@ const ConversationTurnTrace = (props) => {
4768
4933
  }
4769
4934
  );
4770
4935
  };
4771
- const readItemState = (status, isFirstOpen) => {
4772
- if (status === "done") return "done";
4773
- if (status === "not_applicable") return "skipped";
4936
+ const CLOSED_STATES = ["done", "skipped"];
4937
+ const readShownStatus = (item) => (item.shownStatus ?? item.status ?? "open").toLowerCase();
4938
+ const readBaseState = (status) => {
4939
+ if (status === "done" || status === "completed") return "done";
4940
+ if (status === "not_applicable" || status === "skipped" || status === "cancelled") return "skipped";
4774
4941
  if (status === "blocked") return "blocked";
4775
- return isFirstOpen ? "next" : "open";
4942
+ return "open";
4943
+ };
4944
+ const buildTaskPlanTree = (items) => {
4945
+ const roots = [];
4946
+ const nodes = [];
4947
+ const byKey = /* @__PURE__ */ new Map();
4948
+ const stack2 = [];
4949
+ items.forEach((item, position) => {
4950
+ const depth = Math.max(0, item.depth ?? 0);
4951
+ while (stack2.length > 0 && stack2[stack2.length - 1].depth >= depth) stack2.pop();
4952
+ const parent = stack2.length > 0 ? stack2[stack2.length - 1] : null;
4953
+ const key = item.key || item.numberPath || String(position);
4954
+ const node = {
4955
+ item,
4956
+ key,
4957
+ depth: parent ? parent.depth + 1 : 0,
4958
+ parent,
4959
+ children: [],
4960
+ state: readBaseState(readShownStatus(item)),
4961
+ closedLeafCount: 0,
4962
+ leafCount: 0
4963
+ };
4964
+ (parent ? parent.children : roots).push(node);
4965
+ nodes.push(node);
4966
+ if (!byKey.has(key)) byKey.set(key, node);
4967
+ stack2.push(node);
4968
+ });
4969
+ const settle = (node) => {
4970
+ if (node.children.length === 0) {
4971
+ node.leafCount = 1;
4972
+ node.closedLeafCount = CLOSED_STATES.includes(node.state) ? 1 : 0;
4973
+ return;
4974
+ }
4975
+ node.children.forEach(settle);
4976
+ node.leafCount = node.children.reduce((sum, child) => sum + child.leafCount, 0);
4977
+ node.closedLeafCount = node.children.reduce((sum, child) => sum + child.closedLeafCount, 0);
4978
+ if (node.item.shownStatus != null || node.state !== "open") return;
4979
+ const childStates = node.children.map((child) => child.state);
4980
+ if (childStates.every((state) => CLOSED_STATES.includes(state))) {
4981
+ node.state = childStates.includes("done") ? "done" : "skipped";
4982
+ } else if (childStates.includes("blocked") && !childStates.includes("open")) {
4983
+ node.state = "blocked";
4984
+ }
4985
+ };
4986
+ const cover = (node) => {
4987
+ for (const child of node.children) {
4988
+ if ((node.state === "blocked" || node.state === "skipped") && child.state === "open" && child.item.shownStatus == null) child.state = node.state;
4989
+ cover(child);
4990
+ }
4991
+ };
4992
+ roots.forEach(cover);
4993
+ roots.forEach(settle);
4994
+ const running = nodes.find((node) => node.children.length === 0 && node.state === "open") ?? null;
4995
+ for (let node = running; node !== null; node = node.parent) {
4996
+ if (node.state === "open") node.state = "running";
4997
+ }
4998
+ const leaves = nodes.filter((node) => node.children.length === 0);
4999
+ const openTopLevelPosition = roots.findIndex((root2) => !CLOSED_STATES.includes(root2.state));
5000
+ return {
5001
+ roots,
5002
+ nodes,
5003
+ byKey,
5004
+ running,
5005
+ leafCount: leaves.length,
5006
+ closedLeafCount: leaves.filter((node) => CLOSED_STATES.includes(node.state)).length,
5007
+ blockedLeafCount: leaves.filter((node) => node.state === "blocked").length,
5008
+ skippedLeafCount: leaves.filter((node) => node.state === "skipped").length,
5009
+ currentTopLevelPosition: openTopLevelPosition === -1 ? roots.length : openTopLevelPosition + 1
5010
+ };
4776
5011
  };
4777
- const ITEM_STATE_LABELS = {
5012
+ const readDefaultExpandedKeys = (tree2) => new Set(tree2.nodes.filter((node) => node.children.length > 0 && !CLOSED_STATES.includes(node.state)).map((node) => node.key));
5013
+ const readVisibleNodes = (tree2, expandedKeys) => {
5014
+ const visible2 = [];
5015
+ const walk = (level) => {
5016
+ for (const node of level) {
5017
+ visible2.push(node);
5018
+ if (node.children.length > 0 && expandedKeys.has(node.key)) walk(node.children);
5019
+ }
5020
+ };
5021
+ walk(tree2.roots);
5022
+ return visible2;
5023
+ };
5024
+ const readNeighbours = (tree2, key) => {
5025
+ const position = tree2.nodes.findIndex((node) => node.key === key);
5026
+ if (position === -1) return { previous: null, next: null };
5027
+ return { previous: tree2.nodes[position - 1] ?? null, next: tree2.nodes[position + 1] ?? null };
5028
+ };
5029
+ const pane = "agents_pane_1cbEwM";
5030
+ const layout = "agents_layout_m-lkKD";
5031
+ const layoutWithDetail = "agents_layoutWithDetail_x4cywv";
5032
+ const main = "agents_main_y1mVM1";
5033
+ const head = "agents_head_Nl9cv4";
5034
+ const headText = "agents_headText_i5ujiW";
5035
+ const title = "agents_title_G020cN";
5036
+ const sub = "agents_sub_kQ25sW";
5037
+ const pill = "agents_pill_qGlON0";
5038
+ const pillOn = "agents_pillOn_LZaNVp";
5039
+ const pillSquare = "agents_pillSquare_PPtU9m";
5040
+ const progress = "agents_progress_18i7Sz";
5041
+ const progressLine = "agents_progressLine_8I2z4A";
5042
+ const quiet = "agents_quiet_ETPXic";
5043
+ const grow = "agents_grow_-OlbA9";
5044
+ const segments = "agents_segments_IfDuaf";
5045
+ const segmentsSmall = "agents_segmentsSmall_xVMc9m";
5046
+ const segment = "agents_segment_itcvPo";
5047
+ const segmentDone = "agents_segmentDone_OpbLJk";
5048
+ const segmentSkipped = "agents_segmentSkipped_mKU97b";
5049
+ const segmentBlocked = "agents_segmentBlocked_ZxeJHM";
5050
+ const segmentRunning = "agents_segmentRunning_mMwKwH";
5051
+ const mark = "agents_mark_KkhMEo";
5052
+ const markDone = "agents_markDone_0-cEM2";
5053
+ const markSkipped = "agents_markSkipped_v9F7jt";
5054
+ const markBlocked = "agents_markBlocked_G5Ct9Q";
5055
+ const markRunning = "agents_markRunning_uRF93b";
5056
+ const markPart = "agents_markPart_lPT4my";
5057
+ const chip = "agents_chip_TUqSkP";
5058
+ const chipRunning = "agents_chipRunning_WJTf1d";
5059
+ const chipDone = "agents_chipDone_oDJg8m";
5060
+ const chipBlocked = "agents_chipBlocked_2Sdd1e";
5061
+ const chipOwner = "agents_chipOwner_NYywTI";
5062
+ const chipDebug = "agents_chipDebug_IDjHJz";
5063
+ const tree = "agents_tree_rFMlPp";
5064
+ const row = "agents_row_weT3rc";
5065
+ const rowRunning = "agents_rowRunning_e56qgB";
5066
+ const rowBlocked = "agents_rowBlocked_36zH-P";
5067
+ const rowSelected = "agents_rowSelected_zuOfWc";
5068
+ const guide = "agents_guide_1SqVaU";
5069
+ const toggle = "agents_toggle_bkcWqQ";
5070
+ const toggleSpacer = "agents_toggleSpacer_xD2cPm";
5071
+ const rowButton = "agents_rowButton_7gV-2M";
5072
+ const number = "agents_number_JfizoN";
5073
+ const rowText = "agents_rowText_GmB9CR";
5074
+ const rowTitle = "agents_rowTitle_iZsy4N";
5075
+ const rowNote = "agents_rowNote_I-B7v5";
5076
+ const rowClosed = "agents_rowClosed_-EmPVY";
5077
+ const rowSkipped = "agents_rowSkipped_x8JrMm";
5078
+ const part = "agents_part_HWX7NH";
5079
+ const go = "agents_go_EcxHHR";
5080
+ const detail = "agents_detail_Tdjktn";
5081
+ const detailNav = "agents_detailNav_P96ORg";
5082
+ const detailHead = "agents_detailHead_yiJVxX";
5083
+ const eyebrow = "agents_eyebrow_v5kj03";
5084
+ const eyebrowLink = "agents_eyebrowLink_5Ej7YC";
5085
+ const detailTitle = "agents_detailTitle_QP0pCX";
5086
+ const section = "agents_section_1e0qjf";
5087
+ const sectionRunning = "agents_sectionRunning_sZV3KW";
5088
+ const sectionCriterion = "agents_sectionCriterion_cr3F-h";
5089
+ const sectionBlocked = "agents_sectionBlocked_Ei7-78";
5090
+ const sectionDone = "agents_sectionDone_oHFD2P";
5091
+ const sectionHead = "agents_sectionHead_gVE-r2";
5092
+ const text = "agents_text_5CFetP";
5093
+ const mono = "agents_mono_NJifBc";
5094
+ const flags = "agents_flags_gmlGbJ";
5095
+ const facts = "agents_facts_gopB9z";
5096
+ const link = "agents_link_GeOiPK";
5097
+ const miniList = "agents_miniList_nkgMyx";
5098
+ const miniRow = "agents_miniRow_ysHQnX";
5099
+ const miniTitle = "agents_miniTitle_g3mBQR";
5100
+ const miniState = "agents_miniState_DxZE6X";
5101
+ const outcome = "agents_outcome_yTUrZr";
5102
+ const ring = "agents_ring_bW6wP9";
5103
+ const rejection = "agents_rejection_OySO2K";
5104
+ const styles$4 = {
5105
+ pane,
5106
+ layout,
5107
+ layoutWithDetail,
5108
+ main,
5109
+ head,
5110
+ headText,
5111
+ title,
5112
+ sub,
5113
+ pill,
5114
+ pillOn,
5115
+ pillSquare,
5116
+ progress,
5117
+ progressLine,
5118
+ quiet,
5119
+ grow,
5120
+ segments,
5121
+ segmentsSmall,
5122
+ segment,
5123
+ segmentDone,
5124
+ segmentSkipped,
5125
+ segmentBlocked,
5126
+ segmentRunning,
5127
+ mark,
5128
+ markDone,
5129
+ markSkipped,
5130
+ markBlocked,
5131
+ markRunning,
5132
+ markPart,
5133
+ chip,
5134
+ chipRunning,
5135
+ chipDone,
5136
+ chipBlocked,
5137
+ chipOwner,
5138
+ chipDebug,
5139
+ tree,
5140
+ row,
5141
+ rowRunning,
5142
+ rowBlocked,
5143
+ rowSelected,
5144
+ guide,
5145
+ toggle,
5146
+ toggleSpacer,
5147
+ rowButton,
5148
+ number,
5149
+ rowText,
5150
+ rowTitle,
5151
+ rowNote,
5152
+ rowClosed,
5153
+ rowSkipped,
5154
+ part,
5155
+ go,
5156
+ detail,
5157
+ detailNav,
5158
+ detailHead,
5159
+ eyebrow,
5160
+ eyebrowLink,
5161
+ detailTitle,
5162
+ section,
5163
+ sectionRunning,
5164
+ sectionCriterion,
5165
+ sectionBlocked,
5166
+ sectionDone,
5167
+ sectionHead,
5168
+ text,
5169
+ mono,
5170
+ flags,
5171
+ facts,
5172
+ link,
5173
+ miniList,
5174
+ miniRow,
5175
+ miniTitle,
5176
+ miniState,
5177
+ outcome,
5178
+ ring,
5179
+ rejection
5180
+ };
5181
+ const STATE_LABELS = {
4778
5182
  done: () => translateText("Done"),
4779
5183
  skipped: () => translateText("Does not apply", void 0, "plan-item-state"),
4780
5184
  blocked: () => translateText("Blocked", void 0, "plan-item-state"),
4781
- next: () => translateText("Up next", void 0, "plan-item-state"),
5185
+ running: () => translateText("In progress"),
4782
5186
  open: () => translateText("Not started")
4783
5187
  };
4784
- const ITEM_CLASS_NAMES = {
4785
- done: styles$4.itemDone,
4786
- skipped: classNames(styles$4.itemDone, styles$4.itemSkipped),
4787
- blocked: styles$4.itemBlocked,
4788
- next: styles$4.itemNext,
4789
- open: void 0
5188
+ const TaskPlanMark = ({ node }) => {
5189
+ const { state } = node;
5190
+ const isPart = node.children.length > 0 && state === "open" && node.closedLeafCount > 0;
5191
+ const style = isPart ? { "--agents-task-plan-part": `${Math.round(node.closedLeafCount / node.leafCount * 100)}%` } : void 0;
5192
+ return /* @__PURE__ */ jsxs(
5193
+ "span",
5194
+ {
5195
+ className: classNames(
5196
+ styles$4.mark,
5197
+ state === "done" && styles$4.markDone,
5198
+ state === "skipped" && styles$4.markSkipped,
5199
+ state === "blocked" && styles$4.markBlocked,
5200
+ state === "running" && styles$4.markRunning,
5201
+ isPart && styles$4.markPart
5202
+ ),
5203
+ style,
5204
+ role: "img",
5205
+ "aria-label": STATE_LABELS[state](),
5206
+ children: [
5207
+ state === "done" ? /* @__PURE__ */ jsx(Icon, { name: "stepDone", pixelSize: 11 }) : null,
5208
+ state === "skipped" ? /* @__PURE__ */ jsx(Icon, { name: "dash", pixelSize: 11 }) : null,
5209
+ state === "blocked" ? /* @__PURE__ */ jsx(Icon, { name: "exclamation", pixelSize: 11 }) : null
5210
+ ]
5211
+ }
5212
+ );
5213
+ };
5214
+ const TaskPlanSegments = ({ nodes, isSmall }) => {
5215
+ const leaves = [];
5216
+ const collect = (level) => level.forEach((node) => node.children.length > 0 ? collect(node.children) : leaves.push(node));
5217
+ collect(nodes);
5218
+ return /* @__PURE__ */ jsx("span", { className: classNames(styles$4.segments, isSmall && styles$4.segmentsSmall), "aria-hidden": "true", children: leaves.map((leaf) => /* @__PURE__ */ jsx(
5219
+ "span",
5220
+ {
5221
+ className: classNames(
5222
+ styles$4.segment,
5223
+ leaf.state === "done" && styles$4.segmentDone,
5224
+ leaf.state === "skipped" && styles$4.segmentSkipped,
5225
+ leaf.state === "blocked" && styles$4.segmentBlocked,
5226
+ leaf.state === "running" && styles$4.segmentRunning
5227
+ )
5228
+ },
5229
+ leaf.key
5230
+ )) });
4790
5231
  };
4791
- const TaskPlanPane = (props) => {
4792
- const { title: title2, items: items2, note: note2, itemSources, onSelectItem, className } = props;
5232
+ const Section = (props) => /* @__PURE__ */ jsxs(
5233
+ "section",
5234
+ {
5235
+ className: classNames(
5236
+ styles$4.section,
5237
+ props.tone === "running" && styles$4.sectionRunning,
5238
+ props.tone === "blocked" && styles$4.sectionBlocked,
5239
+ props.tone === "done" && styles$4.sectionDone,
5240
+ props.tone === "criterion" && styles$4.sectionCriterion
5241
+ ),
5242
+ children: [
5243
+ /* @__PURE__ */ jsxs("h4", { className: styles$4.sectionHead, children: [
5244
+ props.icon ? /* @__PURE__ */ jsx(Icon, { name: props.icon, pixelSize: 13 }) : null,
5245
+ props.title,
5246
+ props.isDebug ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, styles$4.chipDebug), children: translateText("Debug") }) : null,
5247
+ props.extra
5248
+ ] }),
5249
+ props.children
5250
+ ]
5251
+ }
5252
+ );
5253
+ const useDescribeSource = () => {
4793
5254
  const format = useTraceFormat();
4794
- const counts = readTaskPlanCounts({ itemCount: props.itemCount, doneItemCount: props.doneCount, blockedItemCount: props.blockedCount, items: items2 });
4795
- const itemCount = counts.total;
4796
- const doneCount = counts.done;
4797
- const progressText = describeTaskPlanProgress(counts, format);
4798
- const firstOpenIndex = items2.findIndex((item2) => item2.status !== "done" && item2.status !== "not_applicable" && item2.status !== "blocked");
4799
- return /* @__PURE__ */ jsxs("div", { className: classNames(styles$4.plan, className), "data-testid": "trace-task-plan-pane", children: [
4800
- /* @__PURE__ */ jsxs("div", { className: styles$4.head, children: [
4801
- /* @__PURE__ */ jsx("span", { className: classNames(styles$4.title, styles$4.titleClamped), title: title2 ?? void 0, children: title2 ? `${translateText("Plan")} · ${title2}` : translateText("Plan") }),
4802
- /* @__PURE__ */ jsx("span", { className: styles$4.grow }),
4803
- itemCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$4.quiet, children: progressText }) : null
5255
+ return (source) => {
5256
+ const moment = readTraceMoment(source.startedAt ?? null);
5257
+ return moment === null ? translateText("Turn %number%", { number: format.number(source.turnNumber) }) : translateText("Turn %number% · %time%", { number: format.number(source.turnNumber), time: format.time(moment) });
5258
+ };
5259
+ };
5260
+ const readStateNote = (node) => {
5261
+ const note2 = node.item.statusNote ?? null;
5262
+ if (note2) return note2;
5263
+ if (node.children.length > 0) {
5264
+ const leaf = findLeafInState(node, "blocked") ?? findLeafInState(node, "running");
5265
+ if (leaf) return `${leaf.item.numberPath ?? leaf.key} ${leaf.item.title}${leaf.item.statusNote ? `: ${leaf.item.statusNote}` : ""}`;
5266
+ }
5267
+ if (node.state === "running") return translateText("The agent works on this step now.");
5268
+ if (node.state === "open") return translateText("Not started yet.");
5269
+ return null;
5270
+ };
5271
+ const findLeafInState = (node, state) => {
5272
+ if (node.children.length === 0) return node.state === state ? node : null;
5273
+ for (const child of node.children) {
5274
+ const leaf = findLeafInState(child, state);
5275
+ if (leaf) return leaf;
5276
+ }
5277
+ return null;
5278
+ };
5279
+ const STATE_NOTE_TITLES = {
5280
+ done: () => translateText("Result"),
5281
+ skipped: () => translateText("Why it does not apply"),
5282
+ blocked: () => translateText("Reason"),
5283
+ running: () => translateText("Now"),
5284
+ open: () => translateText("Status")
5285
+ };
5286
+ const ItemDetail = (props) => {
5287
+ const { node, onNavigate, itemSources, itemFirstSources, rejections, onShowSource } = props;
5288
+ const describeSource = useDescribeSource();
5289
+ const { item } = node;
5290
+ const note2 = readStateNote(node);
5291
+ const tone = node.state === "running" ? "running" : node.state === "blocked" ? "blocked" : node.state === "done" ? "done" : void 0;
5292
+ const firstSource = itemFirstSources?.[node.key];
5293
+ const lastSource = itemSources?.[node.key];
5294
+ const itemRejections = (rejections ?? []).filter((rejection2) => rejection2.itemKey === node.key || rejection2.itemKey === item.numberPath);
5295
+ const isDebugShown = item.instruction != null || (item.declarations?.length ?? 0) > 0 || (item.skillNames?.length ?? 0) > 0 || itemRejections.length > 0;
5296
+ const subtaskCount = node.children.length;
5297
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
5298
+ /* @__PURE__ */ jsxs("div", { className: styles$4.detailHead, children: [
5299
+ /* @__PURE__ */ jsxs("span", { className: styles$4.eyebrow, children: [
5300
+ translateText("Step %number%", { number: item.numberPath ?? node.key }),
5301
+ node.parent ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5302
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "·" }),
5303
+ /* @__PURE__ */ jsx("span", { children: translateText("part of") }),
5304
+ /* @__PURE__ */ jsx("button", { type: "button", className: styles$4.eyebrowLink, onClick: () => onNavigate({ kind: "item", key: node.parent.key }), children: `${node.parent.item.numberPath ?? node.parent.key} ${node.parent.item.title}` })
5305
+ ] }) : null,
5306
+ subtaskCount > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5307
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "·" }),
5308
+ /* @__PURE__ */ jsx("span", { children: subtaskCount === 1 ? translateText("%count% subtasks", { count: subtaskCount }, "plan-subtasks-one") : translateText("%count% subtasks", { count: subtaskCount }, "plan-subtasks-other") })
5309
+ ] }) : null
5310
+ ] }),
5311
+ /* @__PURE__ */ jsx("h3", { className: styles$4.detailTitle, "data-testid": "trace-task-plan-detail-title", children: item.title })
4804
5312
  ] }),
4805
- itemCount > 0 ? /* @__PURE__ */ jsx(
4806
- "div",
5313
+ /* @__PURE__ */ jsxs(Section, { title: `${STATE_LABELS[node.state]()} · ${STATE_NOTE_TITLES[node.state]()}`, tone, children: [
5314
+ note2 ? /* @__PURE__ */ jsx("p", { className: styles$4.text, children: note2 }) : null,
5315
+ item.requiresUserAction || item.retryable || item.isPreResolvedAtSeed ? /* @__PURE__ */ jsxs("div", { className: styles$4.flags, children: [
5316
+ item.requiresUserAction ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, styles$4.chipOwner), children: translateText("Waits for you") }) : null,
5317
+ item.retryable ? /* @__PURE__ */ jsx("span", { className: styles$4.chip, children: translateText("Can be tried again") }) : null,
5318
+ item.isPreResolvedAtSeed ? /* @__PURE__ */ jsx("span", { className: styles$4.chip, children: translateText("Already done at the start") }) : null
5319
+ ] }) : null
5320
+ ] }),
5321
+ subtaskCount > 0 ? /* @__PURE__ */ jsxs(
5322
+ Section,
4807
5323
  {
4808
- className: styles$4.meter,
4809
- role: "progressbar",
4810
- "aria-valuemin": 0,
4811
- "aria-valuemax": itemCount,
4812
- "aria-valuenow": doneCount,
4813
- "aria-label": progressText,
4814
- children: /* @__PURE__ */ jsx("span", { className: styles$4.meterFill, style: { width: `${doneCount / itemCount * 100}%` } })
5324
+ icon: "steps",
5325
+ title: translateText("Subtasks"),
5326
+ extra: /* @__PURE__ */ jsx("span", { className: styles$4.chip, children: `${node.closedLeafCount}/${node.leafCount}` }),
5327
+ children: [
5328
+ /* @__PURE__ */ jsx(TaskPlanSegments, { nodes: node.children }),
5329
+ /* @__PURE__ */ jsx("ul", { className: styles$4.miniList, children: node.children.map((child) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$4.miniRow, onClick: () => onNavigate({ kind: "item", key: child.key }), children: [
5330
+ /* @__PURE__ */ jsx(TaskPlanMark, { node: child }),
5331
+ /* @__PURE__ */ jsx("span", { className: styles$4.number, children: child.item.numberPath ?? child.key }),
5332
+ /* @__PURE__ */ jsx("span", { className: styles$4.miniTitle, children: child.item.title }),
5333
+ /* @__PURE__ */ jsx("span", { className: styles$4.miniState, children: child.children.length > 0 ? `${child.closedLeafCount}/${child.leafCount}` : STATE_LABELS[child.state]() })
5334
+ ] }) }, child.key)) })
5335
+ ]
4815
5336
  }
4816
5337
  ) : null,
4817
- note2 ? /* @__PURE__ */ jsx("div", { className: styles$4.quiet, children: note2 }) : null,
4818
- items2.length > 0 ? /* @__PURE__ */ jsx("ol", { className: styles$4.items, children: items2.map((item2, index) => {
4819
- const state = readItemState(item2.status, index === firstOpenIndex);
4820
- const source = item2.key ? itemSources?.[item2.key] : void 0;
4821
- return /* @__PURE__ */ jsxs(
4822
- "li",
4823
- {
4824
- className: classNames(styles$4.item, ITEM_CLASS_NAMES[state]),
4825
- style: { paddingLeft: `${Math.max(0, item2.depth ?? 0) * 18}px` },
4826
- "data-plan-item-state": state,
4827
- "aria-current": state === "next" ? "step" : void 0,
4828
- children: [
4829
- /* @__PURE__ */ jsxs("span", { className: styles$4.box, role: "img", "aria-label": ITEM_STATE_LABELS[state](), children: [
4830
- state === "done" ? /* @__PURE__ */ jsx(Icon, { name: "stepDone", pixelSize: 11 }) : null,
4831
- state === "skipped" ? /* @__PURE__ */ jsx(Icon, { name: "dash", pixelSize: 11 }) : null,
4832
- state === "blocked" ? /* @__PURE__ */ jsx(Icon, { name: "exclamation", pixelSize: 11 }) : null
4833
- ] }),
4834
- item2.numberPath ? /* @__PURE__ */ jsx("span", { className: styles$4.number, children: item2.numberPath }) : null,
4835
- source !== void 0 && onSelectItem !== void 0 ? /* @__PURE__ */ jsx(
5338
+ /* @__PURE__ */ jsxs(
5339
+ Section,
5340
+ {
5341
+ icon: "check",
5342
+ title: translateText("Done when"),
5343
+ tone: "criterion",
5344
+ extra: node.children.length === 0 && item.closesItself ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, styles$4.chipRunning), children: translateText("Closes itself") }) : null,
5345
+ children: [
5346
+ /* @__PURE__ */ jsx("p", { className: styles$4.text, children: node.children.length > 0 ? translateText("every subtask is done or does not apply. The step then closes itself.") : item.closesItself ? translateText("the record shows it: a completed call, a widget or a delivered answer. The platform ticks it off, not the agent.") : translateText("the agent ticks it off with what it produced.") }),
5347
+ item.doneCriterion ? /* @__PURE__ */ jsxs("dl", { className: styles$4.facts, children: [
5348
+ /* @__PURE__ */ jsx("dt", { children: translateText("Criterion") }),
5349
+ /* @__PURE__ */ jsx("dd", { className: styles$4.mono, children: item.doneCriterion })
5350
+ ] }) : null
5351
+ ]
5352
+ }
5353
+ ),
5354
+ /* @__PURE__ */ jsx(Section, { icon: "clock", title: translateText("Origin and times"), children: /* @__PURE__ */ jsxs("dl", { className: styles$4.facts, children: [
5355
+ /* @__PURE__ */ jsx("dt", { children: translateText("Origin", void 0, "task-plan-origin") }),
5356
+ /* @__PURE__ */ jsx("dd", { children: item.isSeeded ? translateText("Seeded from the purpose") : translateText("Added by the agent") }),
5357
+ item.customerProgressStepKey ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5358
+ /* @__PURE__ */ jsx("dt", { children: translateText("Customer step") }),
5359
+ /* @__PURE__ */ jsx("dd", { className: styles$4.mono, children: item.customerProgressStepKey })
5360
+ ] }) : null,
5361
+ firstSource ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5362
+ /* @__PURE__ */ jsx("dt", { children: translateText("Created") }),
5363
+ /* @__PURE__ */ jsx("dd", { children: describeSource(firstSource) })
5364
+ ] }) : null,
5365
+ lastSource ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5366
+ /* @__PURE__ */ jsx("dt", { children: translateText("Last changed") }),
5367
+ /* @__PURE__ */ jsxs("dd", { children: [
5368
+ describeSource(lastSource),
5369
+ onShowSource ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5370
+ " · ",
5371
+ /* @__PURE__ */ jsx(
4836
5372
  "button",
4837
5373
  {
4838
5374
  type: "button",
4839
- className: classNames(styles$4.itemText, styles$4.itemLink),
4840
- title: translateText("Show the step that last changed this item"),
5375
+ className: styles$4.link,
4841
5376
  "data-testid": "trace-task-plan-item-link",
4842
- onClick: () => onSelectItem(item2, source),
4843
- children: item2.title
5377
+ title: translateText("Show the step that last changed this item"),
5378
+ onClick: () => onShowSource(node, lastSource),
5379
+ children: translateText("in the trace")
4844
5380
  }
4845
- ) : /* @__PURE__ */ jsx("span", { className: styles$4.itemText, children: item2.title }),
4846
- state === "blocked" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.mark, styles$4.markWarning), children: ITEM_STATE_LABELS.blocked() }) : null,
4847
- state === "skipped" ? /* @__PURE__ */ jsx("span", { className: styles$4.mark, children: ITEM_STATE_LABELS.skipped() }) : null
5381
+ )
5382
+ ] }) : null
5383
+ ] })
5384
+ ] }) : null,
5385
+ item.wasClosedByPlatform ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5386
+ /* @__PURE__ */ jsx("dt", { children: translateText("Closed by") }),
5387
+ /* @__PURE__ */ jsx("dd", { children: translateText("the platform") })
5388
+ ] }) : null
5389
+ ] }) }),
5390
+ isDebugShown ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5391
+ item.instruction ? /* @__PURE__ */ jsx(Section, { icon: "ai", title: translateText("Instruction to the agent"), isDebug: true, children: /* @__PURE__ */ jsx("p", { className: classNames(styles$4.text, styles$4.mono), children: item.instruction }) }) : null,
5392
+ (item.declarations?.length ?? 0) > 0 || (item.skillNames?.length ?? 0) > 0 || item.evidenceMessageIndex != null || item.platformResolvedAtMessageIndex != null ? /* @__PURE__ */ jsx(Section, { icon: "code", title: translateText("Fields"), isDebug: true, children: /* @__PURE__ */ jsxs("dl", { className: styles$4.facts, children: [
5393
+ (item.declarations ?? []).map((declaration) => /* @__PURE__ */ jsx(FactRow, { name: declaration.name, value: declaration.value }, declaration.name)),
5394
+ (item.skillNames?.length ?? 0) > 0 ? /* @__PURE__ */ jsx(FactRow, { name: "skillNames", value: (item.skillNames ?? []).join(", ") }) : null,
5395
+ item.evidenceMessageIndex != null ? /* @__PURE__ */ jsx(FactRow, { name: "evidenceMessageIndex", value: String(item.evidenceMessageIndex) }) : null,
5396
+ item.platformResolvedAtMessageIndex != null ? /* @__PURE__ */ jsx(FactRow, { name: "platformResolvedAtMessageIndex", value: String(item.platformResolvedAtMessageIndex) }) : null
5397
+ ] }) }) : null,
5398
+ itemRejections.length > 0 ? /* @__PURE__ */ jsx(RejectionsSection, { rejections: itemRejections }) : null
5399
+ ] }) : null
5400
+ ] });
5401
+ };
5402
+ const FactRow = ({ name, value }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
5403
+ /* @__PURE__ */ jsx("dt", { className: styles$4.mono, children: name }),
5404
+ /* @__PURE__ */ jsx("dd", { className: styles$4.mono, children: value })
5405
+ ] });
5406
+ const RejectionsSection = ({ rejections }) => {
5407
+ const describeSource = useDescribeSource();
5408
+ return /* @__PURE__ */ jsx(Section, { icon: "exclamation", title: translateText("Rejected plan changes"), isDebug: true, children: rejections.map((rejection2, position) => /* @__PURE__ */ jsxs("div", { className: styles$4.rejection, children: [
5409
+ /* @__PURE__ */ jsx("span", { className: styles$4.quiet, children: [describeSource(rejection2.source), rejection2.toolName].filter(Boolean).join(" · ") }),
5410
+ /* @__PURE__ */ jsx("span", { className: classNames(styles$4.text, styles$4.mono), children: rejection2.line })
5411
+ ] }, `${rejection2.source.stepKey}:${position}`)) });
5412
+ };
5413
+ const PlanDetail = (props) => {
5414
+ const { tree: tree2, title: title2, onNavigate, itemFirstSources, itemSources, rejections } = props;
5415
+ const format = useTraceFormat();
5416
+ const describeSource = useDescribeSource();
5417
+ const isFinished = tree2.leafCount > 0 && tree2.closedLeafCount + tree2.blockedLeafCount === tree2.leafCount && tree2.blockedLeafCount === 0;
5418
+ const openCount = tree2.leafCount - tree2.closedLeafCount - tree2.blockedLeafCount;
5419
+ const doneCount = tree2.closedLeafCount - tree2.skippedLeafCount;
5420
+ const sources = Object.values(itemFirstSources ?? {});
5421
+ const firstSource = sources.reduce(
5422
+ (earliest, source) => earliest === null || source.turnNumber < earliest.turnNumber ? source : earliest,
5423
+ null
5424
+ );
5425
+ const lastSource = Object.values(itemSources ?? {}).reduce(
5426
+ (latest, source) => latest === null || source.turnNumber >= latest.turnNumber ? source : latest,
5427
+ null
5428
+ );
5429
+ const seededCount = tree2.nodes.filter((node) => node.item.isSeeded).length;
5430
+ const addedNodes = seededCount > 0 ? tree2.nodes.filter((node) => !node.item.isSeeded) : [];
5431
+ const leaves = tree2.nodes.filter((node) => node.children.length === 0);
5432
+ const share = tree2.leafCount > 0 ? Math.round(tree2.closedLeafCount / tree2.leafCount * 100) : 0;
5433
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
5434
+ /* @__PURE__ */ jsxs("div", { className: styles$4.detailHead, children: [
5435
+ /* @__PURE__ */ jsx("span", { className: styles$4.eyebrow, children: translateText("Work plan") }),
5436
+ /* @__PURE__ */ jsx("h3", { className: styles$4.detailTitle, "data-testid": "trace-task-plan-detail-title", children: title2 || translateText("Plan") })
5437
+ ] }),
5438
+ /* @__PURE__ */ jsxs("section", { className: styles$4.section, children: [
5439
+ /* @__PURE__ */ jsxs("div", { className: styles$4.head, children: [
5440
+ /* @__PURE__ */ jsx("span", { className: styles$4.ring, style: { "--agents-task-plan-part": `${share}%` }, children: /* @__PURE__ */ jsx("b", { children: `${tree2.closedLeafCount}/${tree2.leafCount}` }) }),
5441
+ /* @__PURE__ */ jsxs("div", { className: styles$4.headText, style: { gap: "0.375rem" }, children: [
5442
+ /* @__PURE__ */ jsx("b", { children: translateText("%done% of %total% steps", { done: format.number(tree2.closedLeafCount), total: format.number(tree2.leafCount) }) }),
5443
+ /* @__PURE__ */ jsxs("div", { className: styles$4.flags, children: [
5444
+ /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, isFinished ? styles$4.chipDone : tree2.blockedLeafCount > 0 ? styles$4.chipBlocked : styles$4.chipRunning), children: isFinished ? translateText("Finished") : tree2.blockedLeafCount > 0 ? STATE_LABELS.blocked() : STATE_LABELS.running() }),
5445
+ doneCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$4.chip, children: translateText("%count% done", { count: format.number(doneCount) }) }) : null,
5446
+ tree2.skippedLeafCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$4.chip, children: translateText("%count% do not apply", { count: format.number(tree2.skippedLeafCount) }) }) : null,
5447
+ openCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$4.chip, children: translateText("%count% open", { count: format.number(openCount) }) }) : null
5448
+ ] })
5449
+ ] })
5450
+ ] }),
5451
+ /* @__PURE__ */ jsx(TaskPlanSegments, { nodes: tree2.roots })
5452
+ ] }),
5453
+ isFinished ? /* @__PURE__ */ jsx(Section, { icon: "check", title: translateText("Result"), children: leaves.map((leaf) => /* @__PURE__ */ jsxs("div", { className: styles$4.outcome, children: [
5454
+ /* @__PURE__ */ jsx(TaskPlanMark, { node: leaf }),
5455
+ /* @__PURE__ */ jsxs("span", { children: [
5456
+ /* @__PURE__ */ jsx("b", { children: leaf.item.title }),
5457
+ leaf.item.statusNote ? /* @__PURE__ */ jsx("span", { className: styles$4.quiet, children: ` · ${leaf.item.statusNote}` }) : null
5458
+ ] })
5459
+ ] }, leaf.key)) }) : /* @__PURE__ */ jsx(Section, { icon: "steps", title: translateText("Steps"), children: /* @__PURE__ */ jsx("ul", { className: styles$4.miniList, children: tree2.roots.map((root2) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$4.miniRow, onClick: () => onNavigate({ kind: "item", key: root2.key }), children: [
5460
+ /* @__PURE__ */ jsx(TaskPlanMark, { node: root2 }),
5461
+ /* @__PURE__ */ jsx("span", { className: styles$4.number, children: root2.item.numberPath ?? root2.key }),
5462
+ /* @__PURE__ */ jsx("span", { className: styles$4.miniTitle, children: root2.item.title }),
5463
+ /* @__PURE__ */ jsx("span", { className: styles$4.miniState, children: root2.children.length > 0 ? `${root2.closedLeafCount}/${root2.leafCount}` : STATE_LABELS[root2.state]() })
5464
+ ] }) }, root2.key)) }) }),
5465
+ /* @__PURE__ */ jsx(Section, { icon: "clock", title: translateText("Times and origin"), children: /* @__PURE__ */ jsxs("dl", { className: styles$4.facts, children: [
5466
+ firstSource ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5467
+ /* @__PURE__ */ jsx("dt", { children: translateText("Created") }),
5468
+ /* @__PURE__ */ jsx("dd", { children: describeSource(firstSource) })
5469
+ ] }) : null,
5470
+ lastSource ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5471
+ /* @__PURE__ */ jsx("dt", { children: translateText("Last changed") }),
5472
+ /* @__PURE__ */ jsx("dd", { children: describeSource(lastSource) })
5473
+ ] }) : null,
5474
+ /* @__PURE__ */ jsx("dt", { children: translateText("Origin", void 0, "task-plan-origin") }),
5475
+ /* @__PURE__ */ jsx("dd", { children: seededCount > 0 ? translateText("Seeded from the purpose: %seeded% of %total% items", { seeded: format.number(seededCount), total: format.number(tree2.nodes.length) }) : translateText("Made by the agent") }),
5476
+ addedNodes.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5477
+ /* @__PURE__ */ jsx("dt", { children: translateText("Added by the agent") }),
5478
+ /* @__PURE__ */ jsx("dd", { children: addedNodes.map((node) => `${node.item.numberPath ?? node.key} ${node.item.title}`).join(", ") })
5479
+ ] }) : null
5480
+ ] }) }),
5481
+ (rejections?.length ?? 0) > 0 ? /* @__PURE__ */ jsx(RejectionsSection, { rejections: rejections ?? [] }) : null
5482
+ ] });
5483
+ };
5484
+ const TaskPlanDrawer = (props) => {
5485
+ const { target, tree: tree2, onNavigate, onClose } = props;
5486
+ const node = target.kind === "item" ? tree2.byKey.get(target.key) ?? null : null;
5487
+ const neighbours = node ? readNeighbours(tree2, node.key) : { previous: null, next: null };
5488
+ return /* @__PURE__ */ jsxs("aside", { className: styles$4.detail, "data-testid": "trace-task-plan-detail", "aria-label": translateText("Details"), children: [
5489
+ /* @__PURE__ */ jsxs("div", { className: styles$4.detailNav, children: [
5490
+ node ? /* @__PURE__ */ jsxs("button", { type: "button", className: styles$4.pill, onClick: () => onNavigate({ kind: "plan" }), children: [
5491
+ /* @__PURE__ */ jsx(Icon, { name: "arrowLeft", pixelSize: 13 }),
5492
+ translateText("Plan")
5493
+ ] }) : null,
5494
+ /* @__PURE__ */ jsx("span", { className: styles$4.grow }),
5495
+ node?.parent ? /* @__PURE__ */ jsxs(
5496
+ "button",
5497
+ {
5498
+ type: "button",
5499
+ className: styles$4.pill,
5500
+ title: translateText("Parent step"),
5501
+ onClick: () => onNavigate({ kind: "item", key: node.parent.key }),
5502
+ children: [
5503
+ /* @__PURE__ */ jsx(Icon, { name: "arrowUp", pixelSize: 13 }),
5504
+ node.parent.item.numberPath ?? node.parent.key
4848
5505
  ]
4849
- },
4850
- item2.key || index
4851
- );
4852
- }) }) : null
5506
+ }
5507
+ ) : null,
5508
+ node ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5509
+ /* @__PURE__ */ jsx(
5510
+ "button",
5511
+ {
5512
+ type: "button",
5513
+ className: classNames(styles$4.pill, styles$4.pillSquare),
5514
+ title: translateText("Previous step"),
5515
+ "aria-label": translateText("Previous step"),
5516
+ disabled: neighbours.previous === null,
5517
+ onClick: () => neighbours.previous && onNavigate({ kind: "item", key: neighbours.previous.key }),
5518
+ children: /* @__PURE__ */ jsx(Icon, { name: "caretUp", pixelSize: 13 })
5519
+ }
5520
+ ),
5521
+ /* @__PURE__ */ jsx(
5522
+ "button",
5523
+ {
5524
+ type: "button",
5525
+ className: classNames(styles$4.pill, styles$4.pillSquare),
5526
+ title: translateText("Next step"),
5527
+ "aria-label": translateText("Next step"),
5528
+ disabled: neighbours.next === null,
5529
+ onClick: () => neighbours.next && onNavigate({ kind: "item", key: neighbours.next.key }),
5530
+ children: /* @__PURE__ */ jsx(Icon, { name: "caretDown", pixelSize: 13 })
5531
+ }
5532
+ )
5533
+ ] }) : null,
5534
+ /* @__PURE__ */ jsx(
5535
+ "button",
5536
+ {
5537
+ type: "button",
5538
+ className: classNames(styles$4.pill, styles$4.pillSquare),
5539
+ title: translateText("Close"),
5540
+ "aria-label": translateText("Close"),
5541
+ onClick: onClose,
5542
+ children: /* @__PURE__ */ jsx(Icon, { name: "close", pixelSize: 13 })
5543
+ }
5544
+ )
5545
+ ] }),
5546
+ node ? /* @__PURE__ */ jsx(ItemDetail, { ...props, node }) : /* @__PURE__ */ jsx(PlanDetail, { ...props })
4853
5547
  ] });
4854
5548
  };
5549
+ const ROW_STATE_ATTRIBUTES = { done: "done", skipped: "skipped", blocked: "blocked", running: "next", open: "open" };
5550
+ const TaskPlanRow = (props) => {
5551
+ const { node, isExpanded, isSelected, waitsForOwner, onToggle, onOpen } = props;
5552
+ const { item, state } = node;
5553
+ const isContainer = node.children.length > 0;
5554
+ const indent = node.depth * 22;
5555
+ const note2 = !isContainer && (state === "running" || state === "blocked") ? item.statusNote : isContainer && !isExpanded ? item.statusNote : null;
5556
+ return /* @__PURE__ */ jsxs(
5557
+ "li",
5558
+ {
5559
+ className: classNames(
5560
+ styles$4.row,
5561
+ !isContainer && state === "running" && styles$4.rowRunning,
5562
+ !isContainer && state === "blocked" && styles$4.rowBlocked,
5563
+ (state === "done" || state === "skipped") && styles$4.rowClosed,
5564
+ state === "skipped" && styles$4.rowSkipped,
5565
+ isSelected && styles$4.rowSelected
5566
+ ),
5567
+ style: { paddingLeft: `${indent}px` },
5568
+ "data-plan-item-state": ROW_STATE_ATTRIBUTES[state],
5569
+ "data-plan-item-key": node.key,
5570
+ "aria-current": state === "running" && !isContainer ? "step" : void 0,
5571
+ children: [
5572
+ Array.from({ length: node.depth }, (_2, level) => /* @__PURE__ */ jsx("span", { className: styles$4.guide, style: { left: `${level * 22 + 11}px` }, "aria-hidden": "true" }, level)),
5573
+ isContainer ? /* @__PURE__ */ jsx(
5574
+ "button",
5575
+ {
5576
+ type: "button",
5577
+ className: styles$4.toggle,
5578
+ "aria-expanded": isExpanded,
5579
+ "aria-label": isExpanded ? translateText("Fold the subtasks") : translateText("Show the subtasks"),
5580
+ onClick: () => onToggle(node.key),
5581
+ children: /* @__PURE__ */ jsx(Icon, { name: isExpanded ? "chevronDown" : "chevronRight", pixelSize: 13 })
5582
+ }
5583
+ ) : /* @__PURE__ */ jsx("span", { className: styles$4.toggleSpacer }),
5584
+ /* @__PURE__ */ jsxs("button", { type: "button", className: styles$4.rowButton, onClick: () => onOpen(node.key), "data-testid": "trace-task-plan-row", children: [
5585
+ /* @__PURE__ */ jsx(TaskPlanMark, { node }),
5586
+ item.numberPath ? /* @__PURE__ */ jsx("span", { className: styles$4.number, children: item.numberPath }) : null,
5587
+ /* @__PURE__ */ jsxs("span", { className: styles$4.rowText, children: [
5588
+ /* @__PURE__ */ jsx("span", { className: styles$4.rowTitle, children: item.title }),
5589
+ note2 ? /* @__PURE__ */ jsx("span", { className: styles$4.rowNote, children: note2 }) : null
5590
+ ] }),
5591
+ isContainer ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
5592
+ /* @__PURE__ */ jsx("span", { className: styles$4.part, children: `${node.closedLeafCount}/${node.leafCount}` }),
5593
+ /* @__PURE__ */ jsx(TaskPlanSegments, { nodes: node.children, isSmall: true })
5594
+ ] }) : null,
5595
+ !isContainer && state === "running" ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, styles$4.chipRunning), children: waitsForOwner ? translateText("Up next", void 0, "plan-item-state") : translateText("In progress") }) : null,
5596
+ !isContainer && state === "blocked" && item.requiresUserAction ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, styles$4.chipOwner), children: translateText("Waits for you") }) : null,
5597
+ !isContainer && state === "blocked" && !item.requiresUserAction ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, styles$4.chipBlocked), children: translateText("Blocked", void 0, "plan-item-state") }) : null,
5598
+ !isContainer && state === "skipped" ? /* @__PURE__ */ jsx("span", { className: styles$4.chip, children: translateText("Does not apply", void 0, "plan-item-state") }) : null,
5599
+ /* @__PURE__ */ jsx(Icon, { name: "chevronRight", pixelSize: 12, className: styles$4.go })
5600
+ ] })
5601
+ ]
5602
+ }
5603
+ );
5604
+ };
5605
+ const TaskPlanPane = (props) => {
5606
+ const { title: title2, items, note: note2, itemSources, itemFirstSources, onSelectItem, rejections, className } = props;
5607
+ const format = useTraceFormat();
5608
+ const tree2 = useMemo(() => buildTaskPlanTree(items), [items]);
5609
+ const defaultExpandedKeys = useMemo(() => readDefaultExpandedKeys(tree2), [tree2]);
5610
+ const [toggledKeys, setToggledKeys] = useState(() => /* @__PURE__ */ new Set());
5611
+ const [detail2, setDetail] = useState(props.defaultDetail ?? null);
5612
+ const expandedKeys = useMemo(() => {
5613
+ const keys = new Set(defaultExpandedKeys);
5614
+ toggledKeys.forEach((key) => keys.has(key) ? keys.delete(key) : keys.add(key));
5615
+ return keys;
5616
+ }, [defaultExpandedKeys, toggledKeys]);
5617
+ useEffect(() => {
5618
+ if (detail2?.kind === "item" && !tree2.byKey.has(detail2.key)) setDetail(null);
5619
+ }, [detail2, tree2]);
5620
+ const counts = items.length > 0 ? { total: tree2.leafCount, done: tree2.closedLeafCount, blocked: tree2.blockedLeafCount, open: tree2.leafCount - tree2.closedLeafCount - tree2.blockedLeafCount } : readTaskPlanCounts({ itemCount: props.itemCount, doneItemCount: props.doneCount, blockedItemCount: props.blockedCount, items });
5621
+ const progressText = describeTaskPlanProgress(counts, format);
5622
+ const visibleNodes = readVisibleNodes(tree2, expandedKeys);
5623
+ const waitsForOwner = tree2.nodes.some((node) => node.children.length === 0 && node.state === "blocked" && node.item.requiresUserAction);
5624
+ const selectedKey = detail2?.kind === "item" ? detail2.key : null;
5625
+ const isFinished = counts.total > 0 && counts.done === counts.total;
5626
+ const toggle2 = (key) => setToggledKeys((previous) => {
5627
+ const next = new Set(previous);
5628
+ if (next.has(key)) next.delete(key);
5629
+ else next.add(key);
5630
+ return next;
5631
+ });
5632
+ const openItem = (key) => {
5633
+ setDetail({ kind: "item", key });
5634
+ const node = tree2.byKey.get(key);
5635
+ const foldedAncestors = [];
5636
+ for (let ancestor = node?.parent ?? null; ancestor !== null; ancestor = ancestor.parent) {
5637
+ if (!expandedKeys.has(ancestor.key)) foldedAncestors.push(ancestor.key);
5638
+ }
5639
+ if (foldedAncestors.length === 0) return;
5640
+ setToggledKeys((previous) => {
5641
+ const next = new Set(previous);
5642
+ foldedAncestors.forEach((ancestorKey) => next.has(ancestorKey) ? next.delete(ancestorKey) : next.add(ancestorKey));
5643
+ return next;
5644
+ });
5645
+ };
5646
+ return /* @__PURE__ */ jsx("div", { className: classNames(styles$4.pane, className), "data-testid": "trace-task-plan-pane", children: /* @__PURE__ */ jsxs("div", { className: classNames(styles$4.layout, detail2 !== null && styles$4.layoutWithDetail), children: [
5647
+ /* @__PURE__ */ jsxs("div", { className: styles$4.main, children: [
5648
+ /* @__PURE__ */ jsxs("div", { className: styles$4.head, children: [
5649
+ /* @__PURE__ */ jsxs("div", { className: styles$4.headText, children: [
5650
+ /* @__PURE__ */ jsx("span", { className: styles$4.title, title: title2 ?? void 0, children: title2 || translateText("Plan") }),
5651
+ note2 ? /* @__PURE__ */ jsx("span", { className: styles$4.sub, children: note2 }) : null
5652
+ ] }),
5653
+ /* @__PURE__ */ jsxs(
5654
+ "button",
5655
+ {
5656
+ type: "button",
5657
+ className: classNames(styles$4.pill, detail2?.kind === "plan" && styles$4.pillOn),
5658
+ "aria-pressed": detail2?.kind === "plan",
5659
+ onClick: () => setDetail(detail2?.kind === "plan" ? null : { kind: "plan" }),
5660
+ "data-testid": "trace-task-plan-details",
5661
+ children: [
5662
+ /* @__PURE__ */ jsx(Icon, { name: "details", pixelSize: 14 }),
5663
+ translateText("Plan details")
5664
+ ]
5665
+ }
5666
+ )
5667
+ ] }),
5668
+ counts.total > 0 ? /* @__PURE__ */ jsxs("div", { className: styles$4.progress, children: [
5669
+ /* @__PURE__ */ jsxs("div", { className: styles$4.progressLine, children: [
5670
+ /* @__PURE__ */ jsx("span", { children: progressText }),
5671
+ tree2.roots.length > 1 ? /* @__PURE__ */ jsxs("span", { className: styles$4.quiet, children: [
5672
+ "· ",
5673
+ isFinished ? translateText("Finished") : translateText("step %current% of %total%", {
5674
+ current: format.number(Math.min(tree2.currentTopLevelPosition, tree2.roots.length)),
5675
+ total: format.number(tree2.roots.length)
5676
+ })
5677
+ ] }) : null,
5678
+ /* @__PURE__ */ jsx("span", { className: styles$4.grow }),
5679
+ waitsForOwner ? /* @__PURE__ */ jsx("span", { className: classNames(styles$4.chip, styles$4.chipOwner), children: translateText("Waits for you") }) : null
5680
+ ] }),
5681
+ items.length > 0 ? /* @__PURE__ */ jsx("div", { role: "progressbar", "aria-valuemin": 0, "aria-valuemax": counts.total, "aria-valuenow": counts.done, "aria-label": progressText, children: /* @__PURE__ */ jsx(TaskPlanSegments, { nodes: tree2.roots }) }) : null
5682
+ ] }) : null,
5683
+ visibleNodes.length > 0 ? /* @__PURE__ */ jsx("ol", { className: styles$4.tree, children: visibleNodes.map((node) => /* @__PURE__ */ jsx(
5684
+ TaskPlanRow,
5685
+ {
5686
+ node,
5687
+ isExpanded: expandedKeys.has(node.key),
5688
+ isSelected: node.key === selectedKey,
5689
+ waitsForOwner,
5690
+ onToggle: toggle2,
5691
+ onOpen: openItem
5692
+ },
5693
+ node.key
5694
+ )) }) : null
5695
+ ] }),
5696
+ detail2 !== null ? /* @__PURE__ */ jsx(
5697
+ TaskPlanDrawer,
5698
+ {
5699
+ target: detail2,
5700
+ tree: tree2,
5701
+ title: title2,
5702
+ itemSources,
5703
+ itemFirstSources,
5704
+ rejections,
5705
+ onNavigate: (target) => target.kind === "item" ? openItem(target.key) : setDetail(target),
5706
+ onClose: () => setDetail(null),
5707
+ onShowSource: onSelectItem ? (node, source) => onSelectItem(node.item, source) : void 0
5708
+ }
5709
+ ) : null
5710
+ ] }) });
5711
+ };
4855
5712
  const TRACE_STEP_ANCHOR_ATTRIBUTE = "data-trace-step-anchor";
4856
5713
  const TRACE_TURN_ANCHOR_ATTRIBUTE = "data-trace-turn-number";
4857
5714
  const TRACE_HIGHLIGHT_ATTRIBUTE = "data-trace-highlighted";
@@ -4926,19 +5783,34 @@ const collectTraceBackgroundTasks = (turns) => {
4926
5783
  };
4927
5784
  const collectTaskPlanItemSources = (turns) => {
4928
5785
  const sources = {};
5786
+ const firstSources = {};
5787
+ const rejections = [];
4929
5788
  const previousStateByKey = /* @__PURE__ */ new Map();
5789
+ const titleByKey = /* @__PURE__ */ new Map();
4930
5790
  for (const turn of turns) {
4931
5791
  for (const step of turn.steps) {
4932
5792
  if (step.kind !== "TASK_PLAN") continue;
4933
- for (const item2 of step.taskPlanItems) {
4934
- const state = `${item2.status ?? ""}\0${item2.title}`;
4935
- if (previousStateByKey.get(item2.key) === state) continue;
4936
- previousStateByKey.set(item2.key, state);
4937
- sources[item2.key] = { turnNumber: turn.turnNumber, turnMessageId: turn.turnMessageId, stepKey: step.key, stepId: step.stepId ?? null };
5793
+ const source = {
5794
+ turnNumber: turn.turnNumber,
5795
+ turnMessageId: turn.turnMessageId,
5796
+ stepKey: step.key,
5797
+ stepId: step.stepId ?? null,
5798
+ startedAt: step.startedAt ?? null
5799
+ };
5800
+ for (const rejection2 of step.taskPlanRejections ?? []) {
5801
+ rejections.push({ line: rejection2.line, itemKey: rejection2.itemKey, toolName: step.toolName ?? null, source });
5802
+ }
5803
+ for (const item of step.taskPlanItems) {
5804
+ if (titleByKey.get(item.key) !== item.title) firstSources[item.key] = source;
5805
+ titleByKey.set(item.key, item.title);
5806
+ const state = `${item.shownStatus ?? item.status ?? ""}\0${item.title}\0${item.statusNote ?? ""}`;
5807
+ if (previousStateByKey.get(item.key) === state) continue;
5808
+ previousStateByKey.set(item.key, state);
5809
+ sources[item.key] = source;
4938
5810
  }
4939
5811
  }
4940
5812
  }
4941
- return sources;
5813
+ return { sources, firstSources, rejections };
4942
5814
  };
4943
5815
  const collectTraceTaskPlan = (turns) => {
4944
5816
  for (let turnPosition = turns.length - 1; turnPosition >= 0; turnPosition -= 1) {
@@ -4946,26 +5818,29 @@ const collectTraceTaskPlan = (turns) => {
4946
5818
  for (let stepPosition = turn.steps.length - 1; stepPosition >= 0; stepPosition -= 1) {
4947
5819
  const step = turn.steps[stepPosition];
4948
5820
  if (step.kind !== "TASK_PLAN") continue;
4949
- const items2 = step.taskPlanItems;
4950
- if (items2.length === 0 && (step.taskPlanItemCount === null || step.taskPlanItemCount <= 0)) continue;
5821
+ const items = step.taskPlanItems;
5822
+ if (items.length === 0 && (step.taskPlanItemCount === null || step.taskPlanItemCount <= 0)) continue;
5823
+ const itemHistory = collectTaskPlanItemSources(turns);
4951
5824
  const counts = readTaskPlanCounts({
4952
5825
  itemCount: step.taskPlanItemCount,
4953
5826
  openItemCount: step.taskPlanOpenItemCount,
4954
5827
  doneItemCount: step.taskPlanDoneItemCount,
4955
5828
  blockedItemCount: step.taskPlanBlockedItemCount,
4956
- items: items2
5829
+ items
4957
5830
  });
4958
5831
  return {
4959
5832
  turnNumber: turn.turnNumber,
4960
5833
  turnMessageId: turn.turnMessageId,
4961
5834
  stepKey: step.key,
4962
5835
  title: step.taskPlanTitle,
4963
- items: items2,
5836
+ items,
4964
5837
  itemCount: counts.total,
4965
5838
  doneCount: counts.done,
4966
5839
  blockedCount: counts.blocked,
4967
5840
  updatedAt: step.startedAt,
4968
- itemSources: collectTaskPlanItemSources(turns)
5841
+ itemSources: itemHistory.sources,
5842
+ itemFirstSources: itemHistory.firstSources,
5843
+ rejections: itemHistory.rejections
4969
5844
  };
4970
5845
  }
4971
5846
  }
@@ -5369,6 +6244,7 @@ export {
5369
6244
  I as INITIAL_AGENTS_CHAT_STATE,
5370
6245
  L as LoadedSkillsDisclosure,
5371
6246
  MAX_MESSAGE_LENGTH,
6247
+ MESSAGE_TIME_PAUSE_MS,
5372
6248
  PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES,
5373
6249
  QueuedMessageChip,
5374
6250
  RunStatusLine,
@@ -5380,83 +6256,100 @@ export {
5380
6256
  I2 as SubAgentStepGroup,
5381
6257
  J as SubAgentStepRow,
5382
6258
  K as TRACE_CONTEXT_SEGMENT_LABELS,
5383
- M as TRACE_DECISION_SITE_LABELS,
6259
+ N as TRACE_DECISION_SITE_LABELS,
5384
6260
  TRACE_HIGHLIGHT_ATTRIBUTE,
5385
- N as TRACE_SIGNAL_SOURCE_LABELS,
5386
- O as TRACE_SIGNAL_TAG_LABELS,
6261
+ O as TRACE_SIGNAL_SOURCE_LABELS,
6262
+ P as TRACE_SIGNAL_TAG_LABELS,
5387
6263
  TRACE_STEP_ANCHOR_ATTRIBUTE,
5388
6264
  TRACE_TURN_ANCHOR_ATTRIBUTE,
5389
- P as TRACE_WAKE_CONDITION_LABELS,
6265
+ Q as TRACE_VIEW_MODE_OF_LEVEL,
6266
+ R as TRACE_WAKE_CONDITION_LABELS,
6267
+ TaskPlanDrawer,
6268
+ TaskPlanMark,
5390
6269
  TaskPlanPane,
5391
- TaskPlanRow,
5392
- Q as TaskPlanStepDetail,
5393
- R as TerminalBlock,
5394
- U as ThinkingBlock,
5395
- V as ToolStepDetail,
6270
+ TaskPlanRow$1 as TaskPlanRow,
6271
+ TaskPlanSegments,
6272
+ U as TaskPlanStepDetail,
6273
+ V as TerminalBlock,
6274
+ W as ThinkingBlock,
6275
+ X as ToolStepDetail,
5396
6276
  ToolStepGroup,
5397
- W as ToolStepRow,
5398
- X as TraceCodePanel,
5399
- Y as TraceCopyButton,
6277
+ Y as ToolStepRow,
6278
+ Z as TraceCodePanel,
6279
+ _ as TraceCopyButton,
5400
6280
  TraceMountChip,
5401
6281
  TracePath,
5402
6282
  TraceStateIcon,
5403
6283
  TraceStepRow,
5404
- Z as TraceViewModeSwitch,
6284
+ $ as TraceViewModeSwitch,
5405
6285
  TurnMetaLine,
5406
- _ as WidgetDetail,
5407
- $ as buildSideBySideDiffRows,
6286
+ a0 as WidgetDetail,
6287
+ buildMessageTimeMarks,
6288
+ a1 as buildSideBySideDiffRows,
5408
6289
  buildTaskPlanItems,
6290
+ buildTaskPlanTree,
6291
+ a2 as clampTraceViewMode,
5409
6292
  collectTraceBackgroundTasks,
5410
6293
  collectTraceChangedRecords,
5411
6294
  collectTraceFileChangesByTurn,
5412
6295
  collectTraceTaskPlan,
5413
6296
  createAgentsChatStore,
5414
- a0 as createTraceFormat,
6297
+ createMessageTimeFormat,
6298
+ a3 as createTraceFormat,
6299
+ a4 as defaultTraceViewModeOfPolicy,
5415
6300
  deriveAgentActivity,
5416
6301
  describeChangedFieldName,
5417
6302
  describeChangedRecord,
5418
- a1 as describeSubAgentCounts,
6303
+ a5 as describeSubAgentCounts,
5419
6304
  describeTraceBackgroundJob,
5420
- a2 as describeTraceCompaction,
5421
- a3 as describeTraceContextSegment,
5422
- a4 as describeTraceDecision,
5423
- a5 as describeTraceDecisionSite,
5424
- a6 as describeTraceDecisionStatus,
5425
- a7 as describeTraceModelName,
5426
- a8 as describeTraceMount,
5427
- a9 as describeTraceSignal,
5428
- aa as describeTraceSkillCause,
5429
- ab as describeTraceWakeCondition,
6305
+ a6 as describeTraceCompaction,
6306
+ a7 as describeTraceContextSegment,
6307
+ a8 as describeTraceDecision,
6308
+ a9 as describeTraceDecisionSite,
6309
+ aa as describeTraceDecisionStatus,
6310
+ ab as describeTraceModelName,
6311
+ ac as describeTraceMount,
6312
+ ad as describeTraceSignal,
6313
+ ae as describeTraceSkillCause,
6314
+ af as describeTraceWakeCondition,
5430
6315
  findTurnsInFlight,
5431
6316
  findUnansweredWidgetMessageId,
5432
6317
  focusTraceStep,
6318
+ formatCallLength,
5433
6319
  formatElapsedClock,
5434
- ac as formatShortSha256,
6320
+ ag as formatShortSha256,
5435
6321
  formatTraceClock,
5436
6322
  getConversationTraceLoader,
5437
6323
  isStepStillRunning,
5438
6324
  isTraceBackgroundJobLabel,
5439
6325
  isTurnInitiatorMessage,
5440
6326
  normalizeServerMessageToMarkdown,
5441
- ad as parseUnifiedDiff,
5442
- ae as prettyPrintTraceJson,
5443
- af as readContentFromUnifiedDiff,
6327
+ ah as parseUnifiedDiff,
6328
+ ai as prettyPrintTraceJson,
6329
+ aj as readContentFromUnifiedDiff,
5444
6330
  r as readConversationErrorTypeOfRefusedSend,
5445
- ag as readTraceFileChangeIcon,
6331
+ readDefaultExpandedKeys,
6332
+ readNeighbours,
6333
+ readShownStatus,
6334
+ ak as readTraceFileChangeIcon,
5446
6335
  readTraceFileChangeLetter,
5447
6336
  readTraceFileChangeWord,
5448
- ah as readTraceIdInWords,
6337
+ al as readTraceIdInWords,
5449
6338
  readTraceMoment,
5450
- ai as readTraceRunResultText,
6339
+ am as readTraceRunResultText,
5451
6340
  readTraceStateLabel,
5452
- aj as readTraceStateOfStatus,
5453
- ak as readTraceStepIcon,
6341
+ an as readTraceStateOfStatus,
6342
+ ao as readTraceStepIcon,
5454
6343
  readTraceStepState,
5455
6344
  readTraceSubAgentState,
6345
+ readVisibleNodes,
5456
6346
  d as reduceAgentsChatState,
5457
6347
  releaseConversationTraceLoaders,
5458
6348
  resolveAgentChatActivityTiming,
6349
+ ap as resolveAllowedTraceViewModes,
5459
6350
  selectVisibleTraceSteps,
6351
+ aq as traceLevelOfViewMode,
6352
+ ar as traceViewModesOfPolicy,
5460
6353
  useActivityTicker,
5461
6354
  useAgentsChatSelector,
5462
6355
  b as useAgentsChatState,
@@ -5468,6 +6361,7 @@ export {
5468
6361
  useConversationTraces,
5469
6362
  useConversationTurnTrace,
5470
6363
  useConversationsSearch,
6364
+ useMessageTimeFormat,
5471
6365
  useOptionalAgentsChatStore,
5472
6366
  useOptionalAgentsConversationClient,
5473
6367
  useTraceFormat