@tutti-os/agent-gui 0.0.166 → 0.0.168

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 (61) hide show
  1. package/README.md +5 -2
  2. package/dist/{AgentRichTextReadonly-PLUYTH5Y.js → AgentRichTextReadonly-WOIEQ673.js} +5 -5
  3. package/dist/agent-conversation/index.d.ts +2 -2
  4. package/dist/agent-conversation/index.js +7 -7
  5. package/dist/agent-gui.d.ts +3 -2
  6. package/dist/agent-gui.js +15 -15
  7. package/dist/agent-message-center/index.js +6 -6
  8. package/dist/{agentGuiNodeTypes-BXaOdqzS.d.ts → agentGuiNodeTypes-CXL3ISqC.d.ts} +1 -1
  9. package/dist/agents.d.ts +1 -1
  10. package/dist/agents.js +1 -1
  11. package/dist/{chunk-W3EI5EWM.js → chunk-42KTGN4W.js} +2 -2
  12. package/dist/{chunk-GJBSQWIA.js → chunk-42W6JENH.js} +52 -72
  13. package/dist/chunk-42W6JENH.js.map +1 -0
  14. package/dist/{chunk-T7DN6RYO.js → chunk-5EHKHIFG.js} +3 -3
  15. package/dist/{chunk-7W4WEFAY.js → chunk-7M6STXDS.js} +111 -88
  16. package/dist/chunk-7M6STXDS.js.map +1 -0
  17. package/dist/{chunk-HIPSKKXB.js → chunk-BHLX4ZFU.js} +2 -2
  18. package/dist/{chunk-YB5DZYLI.js → chunk-C7RY5XMJ.js} +61 -16
  19. package/dist/chunk-C7RY5XMJ.js.map +1 -0
  20. package/dist/{chunk-66JZ7BQM.js → chunk-CX6XXG6R.js} +4 -1
  21. package/dist/chunk-CX6XXG6R.js.map +1 -0
  22. package/dist/{chunk-TK3MIDHE.js → chunk-ES5LNRP4.js} +95 -115
  23. package/dist/chunk-ES5LNRP4.js.map +1 -0
  24. package/dist/{chunk-W4UPFP2N.js → chunk-EZ6E3LVP.js} +2 -2
  25. package/dist/{chunk-A6UMKVKW.js → chunk-GMALB4L6.js} +4 -4
  26. package/dist/{chunk-OXCWE3B5.js → chunk-J4RQ2RTM.js} +3 -1
  27. package/dist/chunk-J4RQ2RTM.js.map +1 -0
  28. package/dist/{chunk-MJNX2SC6.js → chunk-JQUFRZ2P.js} +4 -4
  29. package/dist/{chunk-FVACDLAJ.js → chunk-KDRU3NBW.js} +4 -4
  30. package/dist/{chunk-ZEYVTTUK.js → chunk-OUOVA353.js} +4 -4
  31. package/dist/{chunk-KUTB4EGX.js → chunk-QEOAZW53.js} +2 -2
  32. package/dist/context-mention-palette/index.js +7 -7
  33. package/dist/{contribution--lqIXGqn.d.ts → contribution-DfA5SxBL.d.ts} +2 -0
  34. package/dist/i18n/index.d.ts +2 -0
  35. package/dist/i18n/index.js +2 -2
  36. package/dist/index.d.ts +8 -0
  37. package/dist/index.js +15 -15
  38. package/dist/mention-search.js +5 -5
  39. package/dist/{types-DVmB_kyD.d.ts → types-CWFDZVkv.d.ts} +3 -0
  40. package/dist/workbench/contribution.d.ts +1 -1
  41. package/dist/workbench/contribution.js +4 -4
  42. package/dist/workbench/index.d.ts +2 -2
  43. package/dist/workbench/index.js +4 -4
  44. package/dist/workbench/sessionTitle.js +2 -2
  45. package/package.json +17 -15
  46. package/dist/chunk-66JZ7BQM.js.map +0 -1
  47. package/dist/chunk-7W4WEFAY.js.map +0 -1
  48. package/dist/chunk-GJBSQWIA.js.map +0 -1
  49. package/dist/chunk-OXCWE3B5.js.map +0 -1
  50. package/dist/chunk-TK3MIDHE.js.map +0 -1
  51. package/dist/chunk-YB5DZYLI.js.map +0 -1
  52. /package/dist/{AgentRichTextReadonly-PLUYTH5Y.js.map → AgentRichTextReadonly-WOIEQ673.js.map} +0 -0
  53. /package/dist/{chunk-W3EI5EWM.js.map → chunk-42KTGN4W.js.map} +0 -0
  54. /package/dist/{chunk-T7DN6RYO.js.map → chunk-5EHKHIFG.js.map} +0 -0
  55. /package/dist/{chunk-HIPSKKXB.js.map → chunk-BHLX4ZFU.js.map} +0 -0
  56. /package/dist/{chunk-W4UPFP2N.js.map → chunk-EZ6E3LVP.js.map} +0 -0
  57. /package/dist/{chunk-A6UMKVKW.js.map → chunk-GMALB4L6.js.map} +0 -0
  58. /package/dist/{chunk-MJNX2SC6.js.map → chunk-JQUFRZ2P.js.map} +0 -0
  59. /package/dist/{chunk-FVACDLAJ.js.map → chunk-KDRU3NBW.js.map} +0 -0
  60. /package/dist/{chunk-ZEYVTTUK.js.map → chunk-OUOVA353.js.map} +0 -0
  61. /package/dist/{chunk-KUTB4EGX.js.map → chunk-QEOAZW53.js.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  AgentRichTextReadonly,
3
3
  promptForProviderSkills,
4
4
  skillTriggerForPrefix
5
- } from "./chunk-GJBSQWIA.js";
5
+ } from "./chunk-42W6JENH.js";
6
6
  import {
7
7
  classifyRecoverableAgentMessage,
8
8
  isProviderPlanLimitMessage,
@@ -27,7 +27,7 @@ import {
27
27
  agentPromptFileBlocks,
28
28
  agentPromptPastedTextBlocks,
29
29
  materializeAgentComposerFileMentions
30
- } from "./chunk-7W4WEFAY.js";
30
+ } from "./chunk-7M6STXDS.js";
31
31
  import {
32
32
  AGENT_PASTED_TEXT_BLOCK_KIND,
33
33
  AGENT_PASTED_TEXT_MENTION_KIND
@@ -47,7 +47,7 @@ import {
47
47
  resolveWorkspaceFileLinkAction,
48
48
  resolveWorkspaceFilePathCandidate,
49
49
  resolveWorkspaceLinkAction
50
- } from "./chunk-T7DN6RYO.js";
50
+ } from "./chunk-5EHKHIFG.js";
51
51
  import {
52
52
  cn
53
53
  } from "./chunk-ZVYUTXQJ.js";
@@ -55,7 +55,7 @@ import {
55
55
  useOptionalAgentActivityRuntime,
56
56
  useOptionalAgentHostApi,
57
57
  workspaceAgentProviderLabel
58
- } from "./chunk-KUTB4EGX.js";
58
+ } from "./chunk-QEOAZW53.js";
59
59
  import {
60
60
  fileChangeCountFromChanges,
61
61
  fileChangeEntriesFromChanges,
@@ -65,7 +65,7 @@ import {
65
65
  getActiveUiLanguage,
66
66
  translate,
67
67
  useTranslation
68
- } from "./chunk-W4UPFP2N.js";
68
+ } from "./chunk-EZ6E3LVP.js";
69
69
  import {
70
70
  normalizeAgentTitleText
71
71
  } from "./chunk-MIJXEELH.js";
@@ -13904,7 +13904,8 @@ var agentMessageLocatorScrollAnimations = /* @__PURE__ */ new WeakMap();
13904
13904
  function AgentMessageLocatorRail({
13905
13905
  items,
13906
13906
  label,
13907
- onLocate
13907
+ onLocate,
13908
+ virtualSelectionSource
13908
13909
  }) {
13909
13910
  const locatorRef = useRef10(null);
13910
13911
  const locatorViewportRef = useRef10(null);
@@ -13916,6 +13917,7 @@ function AgentMessageLocatorRail({
13916
13917
  const previousAgentResponseByKeyRef = useRef10(null);
13917
13918
  const [unreadAgentResponseKeys, setUnreadAgentResponseKeys] = useState22(/* @__PURE__ */ new Set());
13918
13919
  const [visibleFrame, setVisibleFrame] = useState22(null);
13920
+ const virtualSelectionReady = !virtualSelectionSource || virtualSelectionSource.scrollOffset !== null && virtualSelectionSource.scrollRect !== null;
13919
13921
  useEffect13(() => {
13920
13922
  if (isPanelOpen) {
13921
13923
  setShouldRenderPanel(true);
@@ -13937,9 +13939,18 @@ function AgentMessageLocatorRail({
13937
13939
  );
13938
13940
  useEffect13(() => {
13939
13941
  if (selectedKey && !items.some((item) => item.key === selectedKey)) {
13940
- setSelectedKey(null);
13942
+ const locator = locatorRef.current;
13943
+ const scrollParent = locator ? findMessageLocatorScrollParent(locator) : null;
13944
+ const nextSelectedKey = virtualSelectionSource ? selectVirtualizedMessageLocatorItemAtViewportCenter(
13945
+ virtualSelectionSource,
13946
+ items,
13947
+ scrollParent?.scrollTop ?? virtualSelectionSource.scrollOffset
13948
+ ) : null;
13949
+ setSelectedKey(
13950
+ items.some((item) => item.key === nextSelectedKey) ? nextSelectedKey : null
13951
+ );
13941
13952
  }
13942
- }, [items, selectedKey]);
13953
+ }, [items, selectedKey, virtualSelectionSource]);
13943
13954
  useEffect13(() => {
13944
13955
  const previousAgentResponseByKey = previousAgentResponseByKeyRef.current;
13945
13956
  const currentKeys = new Set(items.map((item) => item.key));
@@ -14024,12 +14035,15 @@ function AgentMessageLocatorRail({
14024
14035
  let animationFrame = null;
14025
14036
  const updateSelectedFromScroll = () => {
14026
14037
  animationFrame = null;
14027
- const nextSelectedKey = selectMessageLocatorItemAtViewportCenter(
14028
- scrollParent,
14029
- items
14030
- );
14038
+ const nextSelectedKey = virtualSelectionSource ? selectVirtualizedMessageLocatorItemAtViewportCenter(
14039
+ virtualSelectionSource,
14040
+ items,
14041
+ scrollParent.scrollTop
14042
+ ) : selectMessageLocatorItemAtViewportCenter(scrollParent, items);
14031
14043
  if (nextSelectedKey) {
14032
- setSelectedKey(nextSelectedKey);
14044
+ setSelectedKey(
14045
+ (currentKey) => currentKey === nextSelectedKey ? currentKey : nextSelectedKey
14046
+ );
14033
14047
  }
14034
14048
  };
14035
14049
  const scheduleUpdate = () => {
@@ -14046,7 +14060,7 @@ function AgentMessageLocatorRail({
14046
14060
  window.cancelAnimationFrame(animationFrame);
14047
14061
  }
14048
14062
  };
14049
- }, [items]);
14063
+ }, [items, virtualSelectionReady, virtualSelectionSource]);
14050
14064
  useLayoutEffect3(() => {
14051
14065
  const selectedIndex = selectedKey ? items.findIndex((item) => item.key === selectedKey) : -1;
14052
14066
  const viewport = locatorViewportRef.current;
@@ -14203,6 +14217,7 @@ function AgentMessageLocatorRail({
14203
14217
  "aria-label": item.summary,
14204
14218
  title: item.summary,
14205
14219
  "data-selected": item.key === selectedKey ? "true" : void 0,
14220
+ "data-agent-message-locator-turn-group-index": item.turnGroupIndex,
14206
14221
  "data-unread-agent-response": unreadAgentResponseKeys.has(item.key) ? "true" : void 0,
14207
14222
  onClick: () => handleLocateItem(item),
14208
14223
  onFocus: () => setActiveKey(item.key),
@@ -14382,6 +14397,35 @@ function selectMessageLocatorItemAtViewportCenter(scrollParent, items) {
14382
14397
  }
14383
14398
  return nearest?.key ?? null;
14384
14399
  }
14400
+ function selectVirtualizedMessageLocatorItemAtViewportCenter(source, items, observedScrollOffset = source.scrollOffset) {
14401
+ const viewportHeight = source.scrollRect?.height;
14402
+ if (observedScrollOffset === null || viewportHeight === void 0) {
14403
+ return null;
14404
+ }
14405
+ const virtualTurn = source.getVirtualItemForOffset(
14406
+ observedScrollOffset + viewportHeight / 2
14407
+ );
14408
+ if (!virtualTurn) {
14409
+ return null;
14410
+ }
14411
+ let start = 0;
14412
+ let end = items.length - 1;
14413
+ let matchedIndex = -1;
14414
+ while (start <= end) {
14415
+ const middle = Math.floor((start + end) / 2);
14416
+ const item = items[middle];
14417
+ if (!item) {
14418
+ break;
14419
+ }
14420
+ if (item.turnGroupIndex <= virtualTurn.index) {
14421
+ matchedIndex = middle;
14422
+ start = middle + 1;
14423
+ } else {
14424
+ end = middle - 1;
14425
+ }
14426
+ }
14427
+ return items[matchedIndex < 0 ? 0 : matchedIndex]?.key ?? null;
14428
+ }
14385
14429
 
14386
14430
  // shared/agentConversation/components/useTurnDisclosureMotion.ts
14387
14431
  var TurnDisclosureMotionController = class {
@@ -14718,7 +14762,8 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
14718
14762
  {
14719
14763
  items: userMessageLocatorItems,
14720
14764
  label: labels.userMessageLocator,
14721
- onLocate: handleLocateUserMessage
14765
+ onLocate: handleLocateUserMessage,
14766
+ virtualSelectionSource: rowVirtualizer
14722
14767
  }
14723
14768
  ),
14724
14769
  /* @__PURE__ */ jsx66(
@@ -14872,4 +14917,4 @@ export {
14872
14917
  AgentConversationFlow,
14873
14918
  useProjectedAgentConversation
14874
14919
  };
14875
- //# sourceMappingURL=chunk-YB5DZYLI.js.map
14920
+ //# sourceMappingURL=chunk-C7RY5XMJ.js.map