@tutti-os/agent-gui 0.0.56 → 0.0.58

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 (63) hide show
  1. package/dist/@-lined-14px-64O2KKB4.svg +3 -0
  2. package/dist/agent-conversation/index.d.ts +2 -2
  3. package/dist/agent-conversation/index.js +9 -8
  4. package/dist/agent-conversation/index.js.map +1 -1
  5. package/dist/agent-env/index.d.ts +285 -0
  6. package/dist/agent-env/index.js +360 -0
  7. package/dist/agent-env/index.js.map +1 -0
  8. package/dist/agent-message-center/index.js +11 -11
  9. package/dist/{agentGuiNodeTypes-DCnsaqJr.d.ts → agentGuiNodeTypes-BRU6P22B.d.ts} +2 -1
  10. package/dist/app/renderer/agentactivity.css +56 -36
  11. package/dist/app/renderer/assets/icons/@-lined-14px.svg +3 -0
  12. package/dist/{chunk-EVVIWZLX.js → chunk-2WUDORCV.js} +2 -2
  13. package/dist/{chunk-5PGMLZ4W.js → chunk-5SRRKWE4.js} +2 -2
  14. package/dist/{chunk-X4C4HD6E.js → chunk-BEFNWUOZ.js} +194 -159
  15. package/dist/chunk-BEFNWUOZ.js.map +1 -0
  16. package/dist/{chunk-PQYSB2WC.js → chunk-BT5WEZO5.js} +7 -7
  17. package/dist/{chunk-4URDQNBP.js → chunk-CEMXB7LA.js} +5 -5
  18. package/dist/{chunk-S6PCOX3S.js → chunk-HVU46DDA.js} +1 -1
  19. package/dist/chunk-HVU46DDA.js.map +1 -0
  20. package/dist/{chunk-54CMFCHF.js → chunk-IS6JUDDY.js} +39 -1
  21. package/dist/chunk-IS6JUDDY.js.map +1 -0
  22. package/dist/{chunk-VOXUYDQF.js → chunk-N756UO52.js} +11 -7
  23. package/dist/chunk-N756UO52.js.map +1 -0
  24. package/dist/{chunk-MXDPRBS6.js → chunk-NX6T3DDS.js} +3 -3
  25. package/dist/{chunk-752VTG4P.js → chunk-OFMORNBO.js} +5 -5
  26. package/dist/{chunk-SITURZG6.js → chunk-OLI2A3EM.js} +2 -2
  27. package/dist/chunk-PSLAWU25.js +145 -0
  28. package/dist/chunk-PSLAWU25.js.map +1 -0
  29. package/dist/{chunk-6QFURP4M.js → chunk-SLT5Q37C.js} +6 -6
  30. package/dist/{chunk-PQYMG6PQ.js → chunk-UCCUIUGK.js} +4 -4
  31. package/dist/context-mention-palette/index.js +7 -7
  32. package/dist/i18n/index.d.ts +38 -0
  33. package/dist/i18n/index.js +2 -2
  34. package/dist/index.d.ts +59 -4
  35. package/dist/index.js +802 -99
  36. package/dist/index.js.map +1 -1
  37. package/dist/queued-prompt-runtime.d.ts +2 -2
  38. package/dist/{types-B2m7UcBb.d.ts → types-BsHvTjIZ.d.ts} +8 -1
  39. package/dist/workbench/contribution.d.ts +1 -1
  40. package/dist/workbench/contribution.js +2 -2
  41. package/dist/workbench/index.d.ts +1 -1
  42. package/dist/workbench/index.js +14 -14
  43. package/dist/workbench/launch.d.ts +1 -1
  44. package/dist/workbench/providerCatalog.d.ts +1 -1
  45. package/dist/workbench/sessionTitle.d.ts +1 -1
  46. package/dist/workbench/sessionTitle.js +3 -3
  47. package/dist/workbench/state.d.ts +1 -1
  48. package/dist/workbench/types.d.ts +1 -1
  49. package/dist/workspace-agent-generated-files.js +3 -3
  50. package/package.json +19 -12
  51. package/dist/chunk-54CMFCHF.js.map +0 -1
  52. package/dist/chunk-S6PCOX3S.js.map +0 -1
  53. package/dist/chunk-VOXUYDQF.js.map +0 -1
  54. package/dist/chunk-X4C4HD6E.js.map +0 -1
  55. /package/dist/{chunk-EVVIWZLX.js.map → chunk-2WUDORCV.js.map} +0 -0
  56. /package/dist/{chunk-5PGMLZ4W.js.map → chunk-5SRRKWE4.js.map} +0 -0
  57. /package/dist/{chunk-PQYSB2WC.js.map → chunk-BT5WEZO5.js.map} +0 -0
  58. /package/dist/{chunk-4URDQNBP.js.map → chunk-CEMXB7LA.js.map} +0 -0
  59. /package/dist/{chunk-MXDPRBS6.js.map → chunk-NX6T3DDS.js.map} +0 -0
  60. /package/dist/{chunk-752VTG4P.js.map → chunk-OFMORNBO.js.map} +0 -0
  61. /package/dist/{chunk-SITURZG6.js.map → chunk-OLI2A3EM.js.map} +0 -0
  62. /package/dist/{chunk-6QFURP4M.js.map → chunk-SLT5Q37C.js.map} +0 -0
  63. /package/dist/{chunk-PQYMG6PQ.js.map → chunk-UCCUIUGK.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  formatAgentSessionMentionText,
5
5
  normalizeAgentGUIProviderIdentity,
6
6
  resolveAgentGUIExplicitConversationTitle
7
- } from "./chunk-PQYMG6PQ.js";
7
+ } from "./chunk-UCCUIUGK.js";
8
8
 
9
9
  // workbench/sessionTitle.ts
10
10
  function formatAgentGuiSessionPlainTitle(title, options = {}) {
@@ -96,4 +96,4 @@ export {
96
96
  formatAgentGuiConversationPlainTitle,
97
97
  resolveAgentGuiWorkbenchSessionTitle
98
98
  };
99
- //# sourceMappingURL=chunk-EVVIWZLX.js.map
99
+ //# sourceMappingURL=chunk-2WUDORCV.js.map
@@ -6,7 +6,7 @@ import {
6
6
  setCurrentAgentGuiI18nRuntime,
7
7
  translate,
8
8
  translateInUiLanguage
9
- } from "./chunk-54CMFCHF.js";
9
+ } from "./chunk-IS6JUDDY.js";
10
10
 
11
11
  // i18n/index.ts
12
12
  import React, {
@@ -68,4 +68,4 @@ export {
68
68
  AgentGuiI18nProvider,
69
69
  useTranslation
70
70
  };
71
- //# sourceMappingURL=chunk-5PGMLZ4W.js.map
71
+ //# sourceMappingURL=chunk-5SRRKWE4.js.map
@@ -15,7 +15,12 @@ import {
15
15
  resolveWorkspaceFilePathCandidate,
16
16
  resolveWorkspaceLinkAction,
17
17
  useAgentTargetPresentations
18
- } from "./chunk-6QFURP4M.js";
18
+ } from "./chunk-SLT5Q37C.js";
19
+ import {
20
+ classifyFailedAgentMessage,
21
+ openAgentEnvPanel,
22
+ resolveAgentErrorPresentation
23
+ } from "./chunk-PSLAWU25.js";
19
24
  import {
20
25
  AGENT_RICH_TEXT_CARET_ANCHOR,
21
26
  attrsToMentionItem,
@@ -23,7 +28,7 @@ import {
23
28
  formatAgentMentionMarkdown,
24
29
  mentionItemToAttrs,
25
30
  parseAgentMentionMarkdown
26
- } from "./chunk-MXDPRBS6.js";
31
+ } from "./chunk-NX6T3DDS.js";
27
32
  import {
28
33
  fileChangeCountFromChanges,
29
34
  fileChangeEntriesFromChanges,
@@ -33,14 +38,14 @@ import {
33
38
  import {
34
39
  getOptionalAgentActivityRuntime,
35
40
  useOptionalAgentHostApi
36
- } from "./chunk-S6PCOX3S.js";
41
+ } from "./chunk-HVU46DDA.js";
37
42
  import {
38
43
  workspaceAgentProviderLabel
39
44
  } from "./chunk-TYGL25EL.js";
40
45
  import {
41
46
  getActiveUiLanguage,
42
47
  translate
43
- } from "./chunk-5PGMLZ4W.js";
48
+ } from "./chunk-5SRRKWE4.js";
44
49
 
45
50
  // shared/imageGenerationTool.ts
46
51
  var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
@@ -6604,133 +6609,6 @@ function hydrateAgentTargetMentionPresentations(node, agentTargets) {
6604
6609
  };
6605
6610
  }
6606
6611
 
6607
- // shared/agentEnv/agentEnvPanelStore.ts
6608
- import { useSnapshot } from "valtio";
6609
- import { proxy } from "valtio/vanilla";
6610
- var agentEnvPanelStore = proxy({
6611
- open: false,
6612
- provider: null,
6613
- focus: null,
6614
- requestSequence: 0
6615
- });
6616
- function openAgentEnvPanel(input) {
6617
- agentEnvPanelStore.open = true;
6618
- agentEnvPanelStore.provider = input?.provider ?? null;
6619
- agentEnvPanelStore.focus = input?.focus ?? null;
6620
- agentEnvPanelStore.requestSequence += 1;
6621
- }
6622
-
6623
- // shared/agentEnv/agentErrorPresentation.ts
6624
- var NO_CTA = { focus: null, actionKey: null };
6625
- var SELF_DETECT = {
6626
- messageKey: null,
6627
- focus: "detect",
6628
- actionKey: "agentHost.agentGui.visibleErrorActionDetect"
6629
- };
6630
- var PRESENTATIONS = {
6631
- // Environment problems the wizard can detect or repair → route to its step.
6632
- auth_required: {
6633
- messageKey: "agentHost.agentGui.visibleErrorAuthRequired",
6634
- focus: "auth",
6635
- actionKey: "agentHost.agentGui.visibleErrorActionRelogin"
6636
- },
6637
- cli_not_found: {
6638
- messageKey: "agentHost.agentGui.visibleErrorCliNotFound",
6639
- focus: "install",
6640
- actionKey: "agentHost.agentGui.visibleErrorActionInstall"
6641
- },
6642
- cli_version_unsupported: {
6643
- messageKey: "agentHost.agentGui.visibleErrorVersionUnsupported",
6644
- focus: "upgrade",
6645
- actionKey: "agentHost.agentGui.visibleErrorActionUpgrade"
6646
- },
6647
- network_error: {
6648
- messageKey: "agentHost.agentGui.visibleErrorNetwork",
6649
- focus: "network",
6650
- actionKey: "agentHost.agentGui.visibleErrorActionCheckNetwork"
6651
- },
6652
- runtime_unavailable: {
6653
- messageKey: "agentHost.agentGui.visibleErrorRuntimeUnavailable",
6654
- focus: "detect",
6655
- actionKey: "agentHost.agentGui.visibleErrorActionDetect"
6656
- },
6657
- // Transient / server-side failures: accurate copy, but no wizard CTA — it
6658
- // cannot fix a rate limit or a dropped stream.
6659
- request_timed_out: {
6660
- messageKey: "agentHost.agentGui.visibleErrorRequestTimedOut",
6661
- ...NO_CTA
6662
- },
6663
- provider_config_timeout: {
6664
- messageKey: "agentHost.agentGui.visibleErrorConfigTimeout",
6665
- ...NO_CTA
6666
- },
6667
- provider_stream_disconnected: {
6668
- messageKey: "agentHost.agentGui.visibleErrorStreamDisconnected",
6669
- ...NO_CTA
6670
- },
6671
- provider_concurrency_limit: {
6672
- messageKey: "agentHost.agentGui.visibleErrorConcurrencyLimit",
6673
- ...NO_CTA
6674
- },
6675
- quota_or_rate_limit: {
6676
- messageKey: "agentHost.agentGui.visibleErrorQuotaOrRateLimit",
6677
- ...NO_CTA
6678
- },
6679
- // Ambiguous hard failures → generic message + self-detect escape hatch.
6680
- process_exited: SELF_DETECT,
6681
- provider_error: SELF_DETECT,
6682
- unknown: SELF_DETECT
6683
- };
6684
- function resolveAgentErrorPresentation(code) {
6685
- if (!code) {
6686
- return null;
6687
- }
6688
- return PRESENTATIONS[code] ?? null;
6689
- }
6690
- var FAILED_MESSAGE_CODE_MARKERS = [
6691
- [
6692
- "auth_required",
6693
- [
6694
- "authentication_failed",
6695
- "invalid authentication credentials",
6696
- "401 invalid authentication",
6697
- "unauthorized",
6698
- "not logged in",
6699
- "please run /login",
6700
- "invalid api key"
6701
- ]
6702
- ],
6703
- [
6704
- "cli_version_unsupported",
6705
- ["requires a newer version", "version is too old", "unsupported version"]
6706
- ],
6707
- [
6708
- "cli_not_found",
6709
- [
6710
- "no such file or directory",
6711
- "command not found",
6712
- "enoent",
6713
- "executable file not found"
6714
- ]
6715
- ],
6716
- [
6717
- "network_error",
6718
- ["enotfound", "econnrefused", "econnreset", "getaddrinfo", "socket hang up"]
6719
- ]
6720
- ];
6721
- function classifyFailedAgentMessage(body) {
6722
- if (!body) {
6723
- return null;
6724
- }
6725
- const lower = body.toLowerCase();
6726
- for (const [code, markers] of FAILED_MESSAGE_CODE_MARKERS) {
6727
- if (markers.some((marker) => lower.includes(marker))) {
6728
- return code;
6729
- }
6730
- }
6731
- return null;
6732
- }
6733
-
6734
6612
  // shared/agentConversation/components/CollapsibleReveal.tsx
6735
6613
  import {
6736
6614
  useCallback as useCallback2,
@@ -7606,6 +7484,8 @@ var CanvasNodeGhostIconButton = forwardRef3(function CanvasNodeGhostIconButton2(
7606
7484
  import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
7607
7485
  var MESSAGE_COPY_FEEDBACK_MS = 1400;
7608
7486
  var CONTEXT_COMPACTION_NOTICE_TITLE = "Context compacted.";
7487
+ var CONTEXT_COMPACTION_IN_PROGRESS_TITLE = "Compacting context.";
7488
+ var CONTEXT_COMPACTION_INTERRUPTED_TITLE = "Context compaction interrupted.";
7609
7489
  var TRANSPORT_RETRY_PROGRESS_PATTERN = /\b(reconnect(?:ing)?(?:\s*(?:\.\.\.|…|[.。]+|:|-))?\s*\(?\d+\s*\/\s*\d+\)?)/i;
7610
7490
  var SYSTEM_NOTICE_WARNING_CLASS_NAME = "border-[color-mix(in_srgb,var(--state-warning)_14%,transparent)] bg-[color-mix(in_srgb,var(--background-fronted)_100%,var(--state-warning)_6%)]";
7611
7491
  var SYSTEM_NOTICE_ERROR_CLASS_NAME = "border-[var(--on-danger-hover)] bg-[var(--on-danger)]";
@@ -7976,29 +7856,27 @@ function AgentSystemNoticeMessage({
7976
7856
  }
7977
7857
  );
7978
7858
  }
7859
+ if (isContextCompactionProgressNotice(message, title)) {
7860
+ return /* @__PURE__ */ jsx12(
7861
+ ContextCompactionProgressDivider,
7862
+ {
7863
+ startedAtUnixMs: message.occurredAtUnixMs
7864
+ }
7865
+ );
7866
+ }
7979
7867
  if (isContextCompactionNotice(message, title)) {
7980
- return /* @__PURE__ */ jsxs7(
7981
- "div",
7868
+ return /* @__PURE__ */ jsx12(
7869
+ ContextCompactionDivider,
7982
7870
  {
7983
- role: "status",
7984
- className: "box-border flex w-full min-w-0 items-center gap-3 py-2 text-[12px] leading-4 text-[var(--text-secondary)]",
7985
- children: [
7986
- /* @__PURE__ */ jsx12(
7987
- "span",
7988
- {
7989
- "aria-hidden": "true",
7990
- className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7991
- }
7992
- ),
7993
- /* @__PURE__ */ jsx12("span", { className: "shrink-0 whitespace-nowrap", children: title }),
7994
- /* @__PURE__ */ jsx12(
7995
- "span",
7996
- {
7997
- "aria-hidden": "true",
7998
- className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7999
- }
8000
- )
8001
- ]
7871
+ text: translate("agentHost.agentGui.contextCompactionCompleted")
7872
+ }
7873
+ );
7874
+ }
7875
+ if (isContextCompactionInterruptedNotice(message, title)) {
7876
+ return /* @__PURE__ */ jsx12(
7877
+ ContextCompactionDivider,
7878
+ {
7879
+ text: translate("agentHost.agentGui.contextCompactionInterrupted")
8002
7880
  }
8003
7881
  );
8004
7882
  }
@@ -8052,6 +7930,70 @@ function isContextCompactionNotice(message, title) {
8052
7930
  const notice = message.systemNotice;
8053
7931
  return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_NOTICE_TITLE;
8054
7932
  }
7933
+ function isContextCompactionProgressNotice(message, title) {
7934
+ const notice = message.systemNotice;
7935
+ return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_IN_PROGRESS_TITLE;
7936
+ }
7937
+ function isContextCompactionInterruptedNotice(message, title) {
7938
+ const notice = message.systemNotice;
7939
+ return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_INTERRUPTED_TITLE;
7940
+ }
7941
+ function ContextCompactionDivider({ text }) {
7942
+ "use memo";
7943
+ return /* @__PURE__ */ jsxs7(
7944
+ "div",
7945
+ {
7946
+ role: "status",
7947
+ className: "box-border flex w-full min-w-0 items-center gap-3 py-2 text-[12px] leading-4 text-[var(--text-secondary)]",
7948
+ children: [
7949
+ /* @__PURE__ */ jsx12(
7950
+ "span",
7951
+ {
7952
+ "aria-hidden": "true",
7953
+ className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7954
+ }
7955
+ ),
7956
+ /* @__PURE__ */ jsx12("span", { className: "shrink-0 whitespace-nowrap", children: text }),
7957
+ /* @__PURE__ */ jsx12(
7958
+ "span",
7959
+ {
7960
+ "aria-hidden": "true",
7961
+ className: "h-px min-w-4 flex-1 bg-[var(--line-1)]"
7962
+ }
7963
+ )
7964
+ ]
7965
+ }
7966
+ );
7967
+ }
7968
+ function ContextCompactionProgressDivider({
7969
+ startedAtUnixMs
7970
+ }) {
7971
+ "use memo";
7972
+ const elapsedSeconds = useElapsedSeconds(startedAtUnixMs);
7973
+ const label = translate("agentHost.agentGui.contextCompactionInProgress");
7974
+ const text = elapsedSeconds === null ? label : `${label} \xB7 ${formatElapsedSeconds(elapsedSeconds)}`;
7975
+ return /* @__PURE__ */ jsx12(ContextCompactionDivider, { text });
7976
+ }
7977
+ function useElapsedSeconds(startUnixMs) {
7978
+ const [nowUnixMs, setNowUnixMs] = useState5(() => Date.now());
7979
+ useEffect4(() => {
7980
+ if (startUnixMs === null) {
7981
+ return;
7982
+ }
7983
+ const timer = setInterval(() => setNowUnixMs(Date.now()), 1e3);
7984
+ return () => clearInterval(timer);
7985
+ }, [startUnixMs]);
7986
+ if (startUnixMs === null) {
7987
+ return null;
7988
+ }
7989
+ return Math.max(0, Math.floor((nowUnixMs - startUnixMs) / 1e3));
7990
+ }
7991
+ function formatElapsedSeconds(seconds) {
7992
+ if (seconds < 60) {
7993
+ return `${seconds}s`;
7994
+ }
7995
+ return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
7996
+ }
8055
7997
  function AgentPlanCardMessage({
8056
7998
  message,
8057
7999
  workspaceRoot,
@@ -14110,8 +14052,12 @@ var AGENT_TRANSCRIPT_TURN_GAP_PX = 12;
14110
14052
  var AGENT_TRANSCRIPT_FALLBACK_TURN_COUNT = 3;
14111
14053
  var AGENT_MESSAGE_LOCATOR_PANEL_FADE_MS = 160;
14112
14054
  var AGENT_MESSAGE_LOCATOR_ITEM_SPACING_PX = 30;
14113
- var AGENT_MESSAGE_LOCATOR_HIT_SIZE_PX = 18;
14055
+ var AGENT_MESSAGE_LOCATOR_HIT_SIZE_PX = 36;
14114
14056
  var AGENT_MESSAGE_LOCATOR_BOTTOM_SAFE_INSET_MAX_PX = 48;
14057
+ var AGENT_MESSAGE_LOCATOR_NATIVE_SMOOTH_MAX_DISTANCE_PX = 720;
14058
+ var AGENT_MESSAGE_LOCATOR_FAST_SCROLL_SPEED_PX_PER_MS = 8;
14059
+ var AGENT_MESSAGE_LOCATOR_FAST_SCROLL_MIN_DURATION_MS = 120;
14060
+ var agentMessageLocatorScrollAnimations = /* @__PURE__ */ new WeakMap();
14115
14061
  function transcriptLabelsEqual(previous, next) {
14116
14062
  return previous === next || previous.thinkingLabel === next.thinkingLabel && previous.processing === next.processing && previous.turnSummary === next.turnSummary && previous.rawTimelineJson === next.rawTimelineJson && previous.userMessageLocator === next.userMessageLocator && previous.toolCallsLabel === next.toolCallsLabel;
14117
14063
  }
@@ -14213,10 +14159,10 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
14213
14159
  if (!renderedRow) {
14214
14160
  return false;
14215
14161
  }
14216
- renderedRow.scrollIntoView({
14217
- block: "center",
14218
- behavior: "smooth"
14219
- });
14162
+ scrollTranscriptRowIntoView(
14163
+ renderedRow,
14164
+ scrollParent ?? findMessageLocatorScrollParent(renderedRow)
14165
+ );
14220
14166
  return true;
14221
14167
  };
14222
14168
  if (scrollToRenderedRow()) {
@@ -14531,6 +14477,33 @@ function AgentMessageLocatorRail({
14531
14477
  markItemRead(item.key);
14532
14478
  onLocate(item);
14533
14479
  };
14480
+ const itemFromPointerEvent = (event) => {
14481
+ const viewport = locatorViewportRef.current;
14482
+ if (!viewport) {
14483
+ return null;
14484
+ }
14485
+ const rect = viewport.getBoundingClientRect();
14486
+ const pointerY = event.clientY - rect.top + viewport.scrollTop;
14487
+ const index = Math.round(
14488
+ (pointerY - AGENT_MESSAGE_LOCATOR_HIT_SIZE_PX / 2) / AGENT_MESSAGE_LOCATOR_ITEM_SPACING_PX
14489
+ );
14490
+ return items[Math.max(0, Math.min(items.length - 1, index))] ?? null;
14491
+ };
14492
+ const handleViewportClick = (event) => {
14493
+ if (event.target?.closest("button")) {
14494
+ return;
14495
+ }
14496
+ const item = itemFromPointerEvent(event);
14497
+ if (item) {
14498
+ handleLocateItem(item);
14499
+ }
14500
+ };
14501
+ const handleViewportMouseMove = (event) => {
14502
+ const item = itemFromPointerEvent(event);
14503
+ if (item) {
14504
+ setActiveKey(item.key);
14505
+ }
14506
+ };
14534
14507
  const openPanel = () => {
14535
14508
  if (closePanelTimeoutRef.current !== null) {
14536
14509
  window.clearTimeout(closePanelTimeoutRef.current);
@@ -14589,6 +14562,8 @@ function AgentMessageLocatorRail({
14589
14562
  ref: locatorViewportRef,
14590
14563
  className: "agent-gui-message-locator__viewport",
14591
14564
  "data-testid": "agent-message-locator-viewport",
14565
+ onClick: handleViewportClick,
14566
+ onMouseMove: handleViewportMouseMove,
14592
14567
  children: /* @__PURE__ */ jsxs44(
14593
14568
  "div",
14594
14569
  {
@@ -14681,6 +14656,67 @@ function scrollMessageLocatorViewportToIndex(viewport, selectedIndex, viewportHe
14681
14656
  viewport.scrollTop = Math.max(0, selectedBottom - viewportHeight + padding);
14682
14657
  }
14683
14658
  }
14659
+ function scrollTranscriptRowIntoView(row, scrollParent) {
14660
+ if (!scrollParent) {
14661
+ row.scrollIntoView({
14662
+ block: "center",
14663
+ behavior: "smooth"
14664
+ });
14665
+ return;
14666
+ }
14667
+ const targetScrollTop = targetScrollTopForTranscriptRow(row, scrollParent);
14668
+ const distance = Math.abs(targetScrollTop - scrollParent.scrollTop);
14669
+ if (distance <= AGENT_MESSAGE_LOCATOR_NATIVE_SMOOTH_MAX_DISTANCE_PX) {
14670
+ row.scrollIntoView({
14671
+ block: "center",
14672
+ behavior: "smooth"
14673
+ });
14674
+ return;
14675
+ }
14676
+ animateMessageLocatorScroll(scrollParent, targetScrollTop, distance);
14677
+ }
14678
+ function targetScrollTopForTranscriptRow(row, scrollParent) {
14679
+ const rowRect = row.getBoundingClientRect();
14680
+ const scrollParentRect = scrollParent.getBoundingClientRect();
14681
+ const visibleFrame = readMessageLocatorVisibleFrame(scrollParent);
14682
+ const rowCenter = rowRect.top - scrollParentRect.top + scrollParent.scrollTop + rowRect.height / 2;
14683
+ const maxScrollTop = Math.max(
14684
+ 0,
14685
+ scrollParent.scrollHeight - scrollParent.clientHeight
14686
+ );
14687
+ const targetScrollTop = rowCenter - visibleFrame.topOffsetPx - visibleFrame.heightPx / 2;
14688
+ return Math.min(maxScrollTop, Math.max(0, targetScrollTop));
14689
+ }
14690
+ function animateMessageLocatorScroll(scrollParent, targetScrollTop, distance) {
14691
+ const previousAnimation = agentMessageLocatorScrollAnimations.get(scrollParent);
14692
+ if (previousAnimation !== void 0) {
14693
+ window.cancelAnimationFrame(previousAnimation);
14694
+ }
14695
+ const startScrollTop = scrollParent.scrollTop;
14696
+ const delta = targetScrollTop - startScrollTop;
14697
+ const durationMs = Math.max(
14698
+ AGENT_MESSAGE_LOCATOR_FAST_SCROLL_MIN_DURATION_MS,
14699
+ distance / AGENT_MESSAGE_LOCATOR_FAST_SCROLL_SPEED_PX_PER_MS
14700
+ );
14701
+ const startedAt = performance.now();
14702
+ const step = (now) => {
14703
+ const progress = Math.min(1, (now - startedAt) / durationMs);
14704
+ scrollParent.scrollTop = startScrollTop + delta * progress;
14705
+ if (progress >= 1) {
14706
+ scrollParent.scrollTop = targetScrollTop;
14707
+ agentMessageLocatorScrollAnimations.delete(scrollParent);
14708
+ return;
14709
+ }
14710
+ agentMessageLocatorScrollAnimations.set(
14711
+ scrollParent,
14712
+ window.requestAnimationFrame(step)
14713
+ );
14714
+ };
14715
+ agentMessageLocatorScrollAnimations.set(
14716
+ scrollParent,
14717
+ window.requestAnimationFrame(step)
14718
+ );
14719
+ }
14684
14720
  function readMessageLocatorVisibleFrame(scrollParent) {
14685
14721
  const style = window.getComputedStyle(scrollParent);
14686
14722
  const topOffsetPx = parseCssPx(style.scrollPaddingTop);
@@ -14945,7 +14981,6 @@ export {
14945
14981
  labelForProviderSkill,
14946
14982
  promptForProviderSkills,
14947
14983
  skillDescriptionForDisplay,
14948
- openAgentEnvPanel,
14949
14984
  AgentTranscriptSkeleton,
14950
14985
  plainTextToAgentRichTextDoc,
14951
14986
  plainTextToAgentRichTextInlineContent,
@@ -14956,4 +14991,4 @@ export {
14956
14991
  AgentConversationFlow,
14957
14992
  useProjectedAgentConversation
14958
14993
  };
14959
- //# sourceMappingURL=chunk-X4C4HD6E.js.map
14994
+ //# sourceMappingURL=chunk-BEFNWUOZ.js.map