@tutti-os/agent-gui 0.0.190 → 0.0.192

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 (91) hide show
  1. package/dist/AgentRichTextReadonly-HJQQ4KAL.js +19 -0
  2. package/dist/agent-conversation/index.d.ts +29 -15
  3. package/dist/agent-conversation/index.js +11 -11
  4. package/dist/agent-env/index.js +1 -1
  5. package/dist/agent-gui.d.ts +310 -11
  6. package/dist/agent-gui.js +23 -23
  7. package/dist/agent-message-center/index.d.ts +4 -7
  8. package/dist/agent-message-center/index.js +9 -9
  9. package/dist/{agentGuiNodeTypes-RL1iNmSe.d.ts → agentGuiNodeTypes-B23ubO8n.d.ts} +8 -3
  10. package/dist/agents.d.ts +2 -1
  11. package/dist/app/renderer/agentactivity.css +16 -0
  12. package/dist/{chunk-DCZTHKWI.js → chunk-4CHBM3G3.js} +9 -3
  13. package/dist/chunk-4CHBM3G3.js.map +1 -0
  14. package/dist/{chunk-4ZCSXKK5.js → chunk-5VECGOBU.js} +3 -3
  15. package/dist/{chunk-F2U7LSJN.js → chunk-AFUVWWQY.js} +2 -2
  16. package/dist/{chunk-MHOYBRCY.js → chunk-CBMWHQ7P.js} +1 -1
  17. package/dist/chunk-CBMWHQ7P.js.map +1 -0
  18. package/dist/{chunk-2TPRBVDM.js → chunk-CUIJXYHG.js} +3566 -786
  19. package/dist/chunk-CUIJXYHG.js.map +1 -0
  20. package/dist/{chunk-THBCAUBR.js → chunk-CXC3ROXQ.js} +2 -2
  21. package/dist/{chunk-THBCAUBR.js.map → chunk-CXC3ROXQ.js.map} +1 -1
  22. package/dist/{chunk-44IFVKLS.js → chunk-DKGFEIZ7.js} +2 -2
  23. package/dist/{chunk-HH5PLD7L.js → chunk-DNHDR2YC.js} +3 -3
  24. package/dist/{chunk-V3VPKWVK.js → chunk-FGD2K7AB.js} +3 -3
  25. package/dist/chunk-FGD2K7AB.js.map +1 -0
  26. package/dist/{chunk-CFWR4C36.js → chunk-G7DS23D4.js} +2 -2
  27. package/dist/{chunk-AHDJFZAC.js → chunk-I4ICM3U4.js} +175 -33
  28. package/dist/chunk-I4ICM3U4.js.map +1 -0
  29. package/dist/{chunk-ML53N3II.js → chunk-KDN6SLJM.js} +2 -2
  30. package/dist/{chunk-RSFK6YRS.js → chunk-L3YCXXMA.js} +9 -9
  31. package/dist/{chunk-RWUYIHO3.js → chunk-M6HTOCQK.js} +3 -3
  32. package/dist/{chunk-UCDLFE2I.js → chunk-MGSRWYRN.js} +2 -2
  33. package/dist/{chunk-EWS7OGQK.js → chunk-O433KXLK.js} +2 -2
  34. package/dist/chunk-O433KXLK.js.map +1 -0
  35. package/dist/{chunk-2CZIBPST.js → chunk-PFTST5V6.js} +4 -4
  36. package/dist/{chunk-6YRJ4OPB.js → chunk-S7OROGUS.js} +2 -2
  37. package/dist/{chunk-HOT2PJ6T.js → chunk-SQZIKBOM.js} +4 -7
  38. package/dist/{chunk-HOT2PJ6T.js.map → chunk-SQZIKBOM.js.map} +1 -1
  39. package/dist/{chunk-FJ4A3A6W.js → chunk-TYQTSC7Y.js} +5 -5
  40. package/dist/{chunk-HD2TXBXU.js → chunk-U6TH4RJJ.js} +228 -43
  41. package/dist/chunk-U6TH4RJJ.js.map +1 -0
  42. package/dist/{chunk-KE3UYJMW.js → chunk-Z5Y3RB2U.js} +2 -2
  43. package/dist/{chunk-QKCSWK7Y.js → chunk-ZE6VLLFC.js} +51 -4
  44. package/dist/chunk-ZE6VLLFC.js.map +1 -0
  45. package/dist/context-mention-palette/index.js +10 -10
  46. package/dist/context-mention-provider.d.ts +1 -0
  47. package/dist/conversation-rail-runtime.d.ts +4 -1
  48. package/dist/dock-icons.js +2 -2
  49. package/dist/i18n/index.d.ts +280 -154
  50. package/dist/i18n/index.js +2 -2
  51. package/dist/index.d.ts +1285 -835
  52. package/dist/index.js +23 -23
  53. package/dist/index.js.map +1 -1
  54. package/dist/mention-search.js +8 -8
  55. package/dist/planImplementationPresentation-BxVOLt6A.d.ts +24 -0
  56. package/dist/provider-identity.js +1 -1
  57. package/dist/{types-izfKbJ8v.d.ts → types-CWKbqBmi.d.ts} +4 -0
  58. package/dist/workbench/contribution.js +10 -10
  59. package/dist/workbench/index.js +10 -10
  60. package/dist/workbench/launch.d.ts +4 -0
  61. package/dist/workbench/launch.js +4 -4
  62. package/dist/workbench/providerCatalog.js +2 -2
  63. package/dist/workbench/sessionTitle.js +3 -3
  64. package/dist/workbench/state.js +3 -3
  65. package/dist/workbench/types.d.ts +3 -0
  66. package/dist/workbench/types.js +1 -1
  67. package/package.json +14 -14
  68. package/dist/AgentRichTextReadonly-UZQ5VSGO.js +0 -19
  69. package/dist/chunk-2TPRBVDM.js.map +0 -1
  70. package/dist/chunk-AHDJFZAC.js.map +0 -1
  71. package/dist/chunk-DCZTHKWI.js.map +0 -1
  72. package/dist/chunk-EWS7OGQK.js.map +0 -1
  73. package/dist/chunk-HD2TXBXU.js.map +0 -1
  74. package/dist/chunk-MHOYBRCY.js.map +0 -1
  75. package/dist/chunk-QKCSWK7Y.js.map +0 -1
  76. package/dist/chunk-V3VPKWVK.js.map +0 -1
  77. package/dist/{AgentRichTextReadonly-UZQ5VSGO.js.map → AgentRichTextReadonly-HJQQ4KAL.js.map} +0 -0
  78. package/dist/{chunk-4ZCSXKK5.js.map → chunk-5VECGOBU.js.map} +0 -0
  79. package/dist/{chunk-F2U7LSJN.js.map → chunk-AFUVWWQY.js.map} +0 -0
  80. package/dist/{chunk-44IFVKLS.js.map → chunk-DKGFEIZ7.js.map} +0 -0
  81. package/dist/{chunk-HH5PLD7L.js.map → chunk-DNHDR2YC.js.map} +0 -0
  82. package/dist/{chunk-CFWR4C36.js.map → chunk-G7DS23D4.js.map} +0 -0
  83. package/dist/{chunk-ML53N3II.js.map → chunk-KDN6SLJM.js.map} +0 -0
  84. package/dist/{chunk-RSFK6YRS.js.map → chunk-L3YCXXMA.js.map} +0 -0
  85. package/dist/{chunk-RWUYIHO3.js.map → chunk-M6HTOCQK.js.map} +0 -0
  86. package/dist/{chunk-UCDLFE2I.js.map → chunk-MGSRWYRN.js.map} +0 -0
  87. package/dist/{chunk-2CZIBPST.js.map → chunk-PFTST5V6.js.map} +0 -0
  88. package/dist/{chunk-6YRJ4OPB.js.map → chunk-S7OROGUS.js.map} +0 -0
  89. package/dist/{chunk-FJ4A3A6W.js.map → chunk-TYQTSC7Y.js.map} +0 -0
  90. package/dist/{chunk-KE3UYJMW.js.map → chunk-Z5Y3RB2U.js.map} +0 -0
  91. package/dist/{agentConversationVM-Bn5s1UMx.d.ts → workspaceLinkActions-BmVLZszV.d.ts} +72 -72
@@ -5,7 +5,7 @@ import {
5
5
  agentMentionFilterLabel,
6
6
  agentMentionGroupLabel,
7
7
  mentionGroupExpandCount
8
- } from "./chunk-HOT2PJ6T.js";
8
+ } from "./chunk-SQZIKBOM.js";
9
9
  import {
10
10
  resolveAgentMentionFileThumbnailUrl,
11
11
  resolveAgentMentionFileVisualKind
@@ -13,13 +13,13 @@ import {
13
13
  import {
14
14
  userAvatarPlaceholderUrl,
15
15
  workspaceAgentActivityStatusLabel
16
- } from "./chunk-KE3UYJMW.js";
16
+ } from "./chunk-Z5Y3RB2U.js";
17
17
  import {
18
18
  managedAgentRoundedIconUrl
19
- } from "./chunk-RWUYIHO3.js";
19
+ } from "./chunk-M6HTOCQK.js";
20
20
  import {
21
21
  translate
22
- } from "./chunk-44IFVKLS.js";
22
+ } from "./chunk-DKGFEIZ7.js";
23
23
 
24
24
  // agent-gui/agentGuiNode/AgentFileMentionPalette.tsx
25
25
  import {
@@ -517,4 +517,4 @@ export {
517
517
  AgentFileMentionPalette,
518
518
  AgentContextMentionPalette
519
519
  };
520
- //# sourceMappingURL=chunk-FJ4A3A6W.js.map
520
+ //# sourceMappingURL=chunk-TYQTSC7Y.js.map
@@ -2,13 +2,13 @@ import {
2
2
  AgentRichTextReadonly,
3
3
  promptForProviderSkills,
4
4
  skillTriggerForPrefix
5
- } from "./chunk-6YRJ4OPB.js";
5
+ } from "./chunk-S7OROGUS.js";
6
6
  import {
7
7
  classifyRecoverableAgentMessage,
8
8
  isProviderPlanLimitMessage,
9
9
  resolveAgentErrorPresentation,
10
10
  useOpenAgentEnvPanel
11
- } from "./chunk-THBCAUBR.js";
11
+ } from "./chunk-CXC3ROXQ.js";
12
12
  import {
13
13
  isWorkspaceAgentSyntheticControlMessage
14
14
  } from "./chunk-XJ34OIEQ.js";
@@ -27,7 +27,7 @@ import {
27
27
  agentPromptFileBlocks,
28
28
  agentPromptPastedTextBlocks,
29
29
  materializeAgentComposerFileMentions
30
- } from "./chunk-4ZCSXKK5.js";
30
+ } from "./chunk-5VECGOBU.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-2CZIBPST.js";
50
+ } from "./chunk-PFTST5V6.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-V3VPKWVK.js";
58
+ } from "./chunk-FGD2K7AB.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-44IFVKLS.js";
68
+ } from "./chunk-DKGFEIZ7.js";
69
69
  import {
70
70
  normalizeAgentTitleText
71
71
  } from "./chunk-MIJXEELH.js";
@@ -4786,6 +4786,31 @@ function isSingleCompactFailureNoticeRow(row) {
4786
4786
  function isSinglePlainAssistantMessageRow(row) {
4787
4787
  return row.kind === "message" && row.speaker === "assistant" && row.thinking.length === 0 && row.messages.length === 1 && !row.messages[0]?.visibleError && !row.messages[0]?.systemNotice;
4788
4788
  }
4789
+ function latestAssistantMessageText(conversation) {
4790
+ if (!conversation) {
4791
+ return null;
4792
+ }
4793
+ for (let rowIndex = conversation.rows.length - 1; rowIndex >= 0; rowIndex--) {
4794
+ const row = conversation.rows[rowIndex];
4795
+ if (row?.kind !== "message" || row.speaker !== "assistant") {
4796
+ continue;
4797
+ }
4798
+ for (let messageIndex = row.messages.length - 1; messageIndex >= 0; messageIndex--) {
4799
+ const message = row.messages[messageIndex];
4800
+ if (!message || message.visibleError || message.systemNotice) {
4801
+ continue;
4802
+ }
4803
+ if (message.contentKind && message.contentKind !== "text") {
4804
+ continue;
4805
+ }
4806
+ const body = message.body.trim();
4807
+ if (body) {
4808
+ return body;
4809
+ }
4810
+ }
4811
+ }
4812
+ return null;
4813
+ }
4789
4814
  function reconcileProjectedAgentConversationVM(previous, next) {
4790
4815
  if (!previous) {
4791
4816
  return next;
@@ -5562,10 +5587,10 @@ function AgentTranscriptSkeleton({
5562
5587
  import {
5563
5588
  Fragment as Fragment7,
5564
5589
  memo as memo4,
5565
- useCallback as useCallback14,
5590
+ useCallback as useCallback15,
5566
5591
  useLayoutEffect as useLayoutEffect4,
5567
- useMemo as useMemo7,
5568
- useRef as useRef12,
5592
+ useMemo as useMemo8,
5593
+ useRef as useRef13,
5569
5594
  useState as useState25
5570
5595
  } from "react";
5571
5596
  import { useVirtualizer } from "@tanstack/react-virtual";
@@ -15054,8 +15079,133 @@ function useTurnDisclosureMotion() {
15054
15079
  return [active, setTurnMotionActive];
15055
15080
  }
15056
15081
 
15082
+ // shared/agentConversation/components/useAgentTranscriptTurnAttachments.tsx
15083
+ import {
15084
+ useCallback as useCallback14,
15085
+ useImperativeHandle as useImperativeHandle6,
15086
+ useMemo as useMemo7,
15087
+ useRef as useRef12
15088
+ } from "react";
15089
+ import { jsx as jsx68 } from "react/jsx-runtime";
15090
+ function useAgentTranscriptTurnAttachments(input) {
15091
+ const projection = useMemo7(() => {
15092
+ const lastGroupIndexByTurnId = /* @__PURE__ */ new Map();
15093
+ input.turnGroups.forEach((group, groupIndex) => {
15094
+ if (group.turnId) lastGroupIndexByTurnId.set(group.turnId, groupIndex);
15095
+ });
15096
+ const byGroupIndex = /* @__PURE__ */ new Map();
15097
+ const trailing = [];
15098
+ for (const attachment of input.attachments) {
15099
+ const groupIndex = attachment.anchorTurnId ? lastGroupIndexByTurnId.get(attachment.anchorTurnId) : void 0;
15100
+ if (groupIndex === void 0) {
15101
+ trailing.push(attachment);
15102
+ continue;
15103
+ }
15104
+ const groupAttachments = byGroupIndex.get(groupIndex) ?? [];
15105
+ groupAttachments.push(attachment);
15106
+ byGroupIndex.set(groupIndex, groupAttachments);
15107
+ }
15108
+ const groupIndexByAttachmentId = /* @__PURE__ */ new Map();
15109
+ byGroupIndex.forEach((attachments, groupIndex) => {
15110
+ attachments.forEach(
15111
+ (attachment) => groupIndexByAttachmentId.set(attachment.id, groupIndex)
15112
+ );
15113
+ });
15114
+ return { byGroupIndex, groupIndexByAttachmentId, trailing };
15115
+ }, [input.attachments, input.turnGroups]);
15116
+ const attachmentElementsRef = useRef12(/* @__PURE__ */ new Map());
15117
+ const attachmentObserverRef = useRef12(null);
15118
+ const onElementChange = useCallback14(
15119
+ (attachmentId, element) => {
15120
+ const previous = attachmentElementsRef.current.get(attachmentId);
15121
+ if (previous && previous !== element) {
15122
+ attachmentObserverRef.current?.unobserve(previous);
15123
+ }
15124
+ if (!element) {
15125
+ attachmentElementsRef.current.delete(attachmentId);
15126
+ input.onVisibilityChange?.(attachmentId, false);
15127
+ if (attachmentElementsRef.current.size === 0) {
15128
+ attachmentObserverRef.current?.disconnect();
15129
+ attachmentObserverRef.current = null;
15130
+ }
15131
+ return;
15132
+ }
15133
+ attachmentElementsRef.current.set(attachmentId, element);
15134
+ if (!attachmentObserverRef.current && input.onVisibilityChange && typeof IntersectionObserver === "function") {
15135
+ attachmentObserverRef.current = new IntersectionObserver((entries) => {
15136
+ for (const entry of entries) {
15137
+ const id = entry.target.dataset.agentTranscriptAttachment;
15138
+ if (id) input.onVisibilityChange?.(id, entry.isIntersecting);
15139
+ }
15140
+ });
15141
+ }
15142
+ attachmentObserverRef.current?.observe(element);
15143
+ },
15144
+ [input.onVisibilityChange]
15145
+ );
15146
+ const locateAttachment = useCallback14(
15147
+ (attachmentId) => {
15148
+ const scrollParent = input.virtualizerHostRef.current ? findMessageLocatorScrollParent(input.virtualizerHostRef.current) : null;
15149
+ const scrollToRenderedAttachment = () => {
15150
+ const renderedAttachment = attachmentElementsRef.current.get(attachmentId);
15151
+ if (!renderedAttachment) return false;
15152
+ scrollTranscriptRowIntoView(
15153
+ renderedAttachment,
15154
+ scrollParent ?? findMessageLocatorScrollParent(renderedAttachment)
15155
+ );
15156
+ renderedAttachment.animate?.(
15157
+ [
15158
+ { boxShadow: "0 0 0 2px var(--tutti-purple)" },
15159
+ { boxShadow: "0 0 0 2px transparent" }
15160
+ ],
15161
+ { duration: 1400, easing: "ease-out" }
15162
+ );
15163
+ return true;
15164
+ };
15165
+ if (scrollToRenderedAttachment()) return;
15166
+ const groupIndex = projection.groupIndexByAttachmentId.get(attachmentId);
15167
+ if (input.shouldVirtualize && groupIndex !== void 0) {
15168
+ input.rowVirtualizer.scrollToIndex(groupIndex, { align: "center" });
15169
+ requestAnimationFrame(scrollToRenderedAttachment);
15170
+ }
15171
+ },
15172
+ [
15173
+ input.rowVirtualizer,
15174
+ input.shouldVirtualize,
15175
+ input.virtualizerHostRef,
15176
+ projection.groupIndexByAttachmentId
15177
+ ]
15178
+ );
15179
+ useImperativeHandle6(input.locatorRef ?? null, () => locateAttachment, [
15180
+ locateAttachment
15181
+ ]);
15182
+ return {
15183
+ byGroupIndex: projection.byGroupIndex,
15184
+ onElementChange,
15185
+ trailing: projection.trailing
15186
+ };
15187
+ }
15188
+ function AgentTranscriptAttachmentView({
15189
+ attachment,
15190
+ onElementChange
15191
+ }) {
15192
+ const handleRef = useCallback14(
15193
+ (element) => onElementChange(attachment.id, element),
15194
+ [attachment.id, onElementChange]
15195
+ );
15196
+ return /* @__PURE__ */ jsx68(
15197
+ "div",
15198
+ {
15199
+ ref: handleRef,
15200
+ className: "agent-gui-transcript-attachment",
15201
+ "data-agent-transcript-attachment": attachment.id,
15202
+ children: attachment.content
15203
+ }
15204
+ );
15205
+ }
15206
+
15057
15207
  // shared/agentConversation/components/AgentTranscriptView.tsx
15058
- import { Fragment as Fragment8, jsx as jsx68, jsxs as jsxs48 } from "react/jsx-runtime";
15208
+ import { Fragment as Fragment8, jsx as jsx69, jsxs as jsxs48 } from "react/jsx-runtime";
15059
15209
  var AGENT_TRANSCRIPT_VIRTUALIZATION_OVERSCAN = 6;
15060
15210
  var AGENT_TRANSCRIPT_ESTIMATED_TURN_HEIGHT_PX = 280;
15061
15211
  var AGENT_TRANSCRIPT_DISCLOSURE_TURN_GAP_PX = 24;
@@ -15087,10 +15237,13 @@ function areAgentTranscriptViewPropsEqual(previous, next) {
15087
15237
  return transcriptConversationRenderInputEquals(
15088
15238
  previous.conversation,
15089
15239
  next.conversation
15090
- ) && previous.onLinkAction === next.onLinkAction && previous.onAuthLogin === next.onAuthLogin && previous.availableSkills === next.availableSkills && previous.workspaceAppIcons === next.workspaceAppIcons && previous.previewMode === next.previewMode && previous.showRawTimelineJson === next.showRawTimelineJson && transcriptLabelsEqual(previous.labels, next.labels);
15240
+ ) && previous.onLinkAction === next.onLinkAction && previous.onAuthLogin === next.onAuthLogin && previous.availableSkills === next.availableSkills && previous.workspaceAppIcons === next.workspaceAppIcons && previous.turnAttachments === next.turnAttachments && previous.turnAttachmentLocatorRef === next.turnAttachmentLocatorRef && previous.onTurnAttachmentVisibilityChange === next.onTurnAttachmentVisibilityChange && previous.previewMode === next.previewMode && previous.showRawTimelineJson === next.showRawTimelineJson && transcriptLabelsEqual(previous.labels, next.labels);
15091
15241
  }
15092
15242
  var AgentTranscriptView = memo4(function AgentTranscriptView2({
15093
15243
  conversation,
15244
+ turnAttachments = [],
15245
+ turnAttachmentLocatorRef,
15246
+ onTurnAttachmentVisibilityChange,
15094
15247
  onLinkAction,
15095
15248
  onAuthLogin,
15096
15249
  availableSkills,
@@ -15103,21 +15256,21 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15103
15256
  const [expandedToolRows, setExpandedToolRows] = useState25({});
15104
15257
  const [hasMovingTurnDisclosure, handleDisclosureMotionChange] = useTurnDisclosureMotion();
15105
15258
  const turnDisclosureStore = useAgentTurnDisclosureStore();
15106
- const virtualizerHostRef = useRef12(null);
15259
+ const virtualizerHostRef = useRef13(null);
15107
15260
  const [virtualScrollElement, setVirtualScrollElement] = useState25(null);
15108
- const rowKeys = useMemo7(
15261
+ const rowKeys = useMemo8(
15109
15262
  () => conversation.rows.map(transcriptRowKey),
15110
15263
  [conversation.rows]
15111
15264
  );
15112
- const turnGroups = useMemo7(
15265
+ const turnGroups = useMemo8(
15113
15266
  () => buildAgentTranscriptTurnGroups(conversation.rows, rowKeys),
15114
15267
  [conversation.rows, rowKeys]
15115
15268
  );
15116
- const turnGroupIndexByRowIndex = useMemo7(
15269
+ const turnGroupIndexByRowIndex = useMemo8(
15117
15270
  () => buildTurnGroupIndexByRowIndex(turnGroups),
15118
15271
  [turnGroups]
15119
15272
  );
15120
- const userMessageLocatorItems = useMemo7(
15273
+ const userMessageLocatorItems = useMemo8(
15121
15274
  () => buildUserMessageLocatorItems(
15122
15275
  conversation.rows,
15123
15276
  rowKeys,
@@ -15126,7 +15279,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15126
15279
  [conversation.rows, rowKeys, turnGroupIndexByRowIndex]
15127
15280
  );
15128
15281
  const enteringRowKeys = useEnteringTranscriptRows(rowKeys);
15129
- const handleToolGroupExpandedChange = useCallback14(
15282
+ const handleToolGroupExpandedChange = useCallback15(
15130
15283
  (key, expanded) => {
15131
15284
  setExpandedToolRows((previous) => {
15132
15285
  if (previous[key] === expanded) {
@@ -15140,13 +15293,13 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15140
15293
  },
15141
15294
  []
15142
15295
  );
15143
- const turnIndexById = useMemo7(
15296
+ const turnIndexById = useMemo8(
15144
15297
  () => new Map(
15145
15298
  conversation.sourceDetail.turns.map((turn, index) => [turn.id, index])
15146
15299
  ),
15147
15300
  [conversation.sourceDetail.turns]
15148
15301
  );
15149
- const dividerRowIndexes = useMemo7(
15302
+ const dividerRowIndexes = useMemo8(
15150
15303
  () => findTurnDividerRowIndexes(turnIndexById, conversation.rows),
15151
15304
  [conversation.rows, turnIndexById]
15152
15305
  );
@@ -15175,7 +15328,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15175
15328
  const basePath = conversation.sourceDetail.cwd;
15176
15329
  const workspaceRoot = conversation.workspaceRoot;
15177
15330
  const provider = conversation.activity.agentProvider;
15178
- const shouldVirtualize = useMemo7(
15331
+ const shouldVirtualize = useMemo8(
15179
15332
  () => assessAgentTranscriptComplexity(turnGroups).shouldVirtualize,
15180
15333
  [turnGroups]
15181
15334
  );
@@ -15189,7 +15342,16 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15189
15342
  scrollEndThreshold: 24
15190
15343
  });
15191
15344
  rowVirtualizer.shouldAdjustScrollPositionOnItemSizeChange = shouldVirtualize && hasMovingTurnDisclosure ? preventVirtualScrollAdjustment : void 0;
15192
- const handleLocateUserMessage = useCallback14(
15345
+ const attachmentProjection = useAgentTranscriptTurnAttachments({
15346
+ attachments: turnAttachments,
15347
+ locatorRef: turnAttachmentLocatorRef,
15348
+ onVisibilityChange: onTurnAttachmentVisibilityChange,
15349
+ rowVirtualizer,
15350
+ shouldVirtualize,
15351
+ turnGroups,
15352
+ virtualizerHostRef
15353
+ });
15354
+ const handleLocateUserMessage = useCallback15(
15193
15355
  (item) => {
15194
15356
  const scrollParent = virtualizerHostRef.current ? findMessageLocatorScrollParent(virtualizerHostRef.current) : null;
15195
15357
  const scrollToRenderedRow = () => {
@@ -15228,7 +15390,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15228
15390
  const renderRow = (row, rowIndex, renderKey) => {
15229
15391
  const rowKey = renderKey ?? (conversation.rows[rowIndex] === row ? rowKeys[rowIndex] ?? transcriptRowKey(row) : transcriptRowKey(row));
15230
15392
  const shouldAnimateEnter = row.kind !== "processing" && enteringRowKeys.has(rowKey);
15231
- return /* @__PURE__ */ jsx68(
15393
+ return /* @__PURE__ */ jsx69(
15232
15394
  "div",
15233
15395
  {
15234
15396
  className: "agent-gui-transcript-row",
@@ -15236,7 +15398,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15236
15398
  "data-agent-transcript-row-kind": row.kind,
15237
15399
  "data-agent-transcript-row-index": rowIndex,
15238
15400
  "data-agent-transcript-row-enter": shouldAnimateEnter ? "true" : void 0,
15239
- children: /* @__PURE__ */ jsx68(
15401
+ children: /* @__PURE__ */ jsx69(
15240
15402
  AgentTranscriptItemView,
15241
15403
  {
15242
15404
  workspaceRoot,
@@ -15259,10 +15421,10 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15259
15421
  rowKey
15260
15422
  );
15261
15423
  };
15262
- const renderLegacyTurnGroup = (group) => /* @__PURE__ */ jsx68(Fragment7, { children: group.rows.map(({ row, rowIndex }) => {
15424
+ const renderLegacyTurnGroup = (group) => /* @__PURE__ */ jsx69(Fragment7, { children: group.rows.map(({ row, rowIndex }) => {
15263
15425
  const rowKey = rowKeys[rowIndex] ?? transcriptRowKey(row);
15264
15426
  return /* @__PURE__ */ jsxs48(Fragment7, { children: [
15265
- dividerRowIndexes.has(rowIndex) ? /* @__PURE__ */ jsx68(
15427
+ dividerRowIndexes.has(rowIndex) ? /* @__PURE__ */ jsx69(
15266
15428
  "div",
15267
15429
  {
15268
15430
  className: "h-px w-full flex-none bg-[var(--line-2,var(--tutti-line-2))]",
@@ -15278,7 +15440,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15278
15440
  if (!model) {
15279
15441
  return renderLegacyTurnGroup(group);
15280
15442
  }
15281
- return /* @__PURE__ */ jsx68(
15443
+ return /* @__PURE__ */ jsx69(
15282
15444
  AgentTurnWorkSection,
15283
15445
  {
15284
15446
  model,
@@ -15294,6 +15456,14 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15294
15456
  group.key
15295
15457
  );
15296
15458
  };
15459
+ const renderAttachment = (attachment) => /* @__PURE__ */ jsx69(
15460
+ AgentTranscriptAttachmentView,
15461
+ {
15462
+ attachment,
15463
+ onElementChange: attachmentProjection.onElementChange
15464
+ },
15465
+ attachment.id
15466
+ );
15297
15467
  if (shouldVirtualize) {
15298
15468
  const virtualItems = virtualScrollElement === null ? turnGroups.slice(-AGENT_TRANSCRIPT_FALLBACK_TURN_COUNT).map((group, fallbackIndex) => ({
15299
15469
  index: turnGroups.length - Math.min(
@@ -15307,7 +15477,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15307
15477
  ) + fallbackIndex) * AGENT_TRANSCRIPT_ESTIMATED_TURN_HEIGHT_PX
15308
15478
  })) : rowVirtualizer.getVirtualItems();
15309
15479
  return /* @__PURE__ */ jsxs48(Fragment8, { children: [
15310
- /* @__PURE__ */ jsx68(
15480
+ /* @__PURE__ */ jsx69(
15311
15481
  AgentMessageLocatorRail,
15312
15482
  {
15313
15483
  items: userMessageLocatorItems,
@@ -15316,7 +15486,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15316
15486
  virtualSelectionSource: rowVirtualizer
15317
15487
  }
15318
15488
  ),
15319
- /* @__PURE__ */ jsx68(
15489
+ /* @__PURE__ */ jsx69(
15320
15490
  "div",
15321
15491
  {
15322
15492
  ref: virtualizerHostRef,
@@ -15328,7 +15498,7 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15328
15498
  if (!group) {
15329
15499
  return null;
15330
15500
  }
15331
- return /* @__PURE__ */ jsx68(
15501
+ return /* @__PURE__ */ jsxs48(
15332
15502
  "div",
15333
15503
  {
15334
15504
  ref: rowVirtualizer.measureElement,
@@ -15339,17 +15509,21 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15339
15509
  paddingBottom: `${turnWorkSectionModelByKey.get(group.key) ? AGENT_TRANSCRIPT_DISCLOSURE_TURN_GAP_PX : AGENT_TRANSCRIPT_LEGACY_TURN_GAP_PX}px`,
15340
15510
  transform: `translateY(${virtualTurn.start}px)`
15341
15511
  },
15342
- children: renderTurnGroup(group)
15512
+ children: [
15513
+ renderTurnGroup(group),
15514
+ attachmentProjection.byGroupIndex.get(virtualTurn.index)?.map(renderAttachment)
15515
+ ]
15343
15516
  },
15344
15517
  virtualTurn.key
15345
15518
  );
15346
15519
  })
15347
15520
  }
15348
- )
15521
+ ),
15522
+ attachmentProjection.trailing.map(renderAttachment)
15349
15523
  ] });
15350
15524
  }
15351
15525
  return /* @__PURE__ */ jsxs48(Fragment8, { children: [
15352
- /* @__PURE__ */ jsx68(
15526
+ /* @__PURE__ */ jsx69(
15353
15527
  AgentMessageLocatorRail,
15354
15528
  {
15355
15529
  items: userMessageLocatorItems,
@@ -15357,15 +15531,22 @@ var AgentTranscriptView = memo4(function AgentTranscriptView2({
15357
15531
  onLocate: handleLocateUserMessage
15358
15532
  }
15359
15533
  ),
15360
- turnGroups.map(renderTurnGroup)
15534
+ turnGroups.map((group, groupIndex) => /* @__PURE__ */ jsxs48(Fragment7, { children: [
15535
+ renderTurnGroup(group),
15536
+ attachmentProjection.byGroupIndex.get(groupIndex)?.map(renderAttachment)
15537
+ ] }, group.key)),
15538
+ attachmentProjection.trailing.map(renderAttachment)
15361
15539
  ] });
15362
15540
  }, areAgentTranscriptViewPropsEqual);
15363
15541
 
15364
15542
  // shared/agentConversation/components/AgentConversationFlow.tsx
15365
15543
  import { memo as memo5 } from "react";
15366
- import { Fragment as Fragment9, jsx as jsx69 } from "react/jsx-runtime";
15544
+ import { Fragment as Fragment9, jsx as jsx70 } from "react/jsx-runtime";
15367
15545
  var AgentConversationFlow = memo5(function AgentConversationFlow2({
15368
15546
  conversation,
15547
+ turnAttachments,
15548
+ turnAttachmentLocatorRef,
15549
+ onTurnAttachmentVisibilityChange,
15369
15550
  isLoading,
15370
15551
  loadingLabel,
15371
15552
  loadingTestId,
@@ -15381,14 +15562,17 @@ var AgentConversationFlow = memo5(function AgentConversationFlow2({
15381
15562
  "use memo";
15382
15563
  let content;
15383
15564
  if (isLoading) {
15384
- content = /* @__PURE__ */ jsx69(AgentTranscriptSkeleton, { label: loadingLabel, testId: loadingTestId });
15385
- } else if (!conversation || conversation.rows.length === 0) {
15386
- content = /* @__PURE__ */ jsx69(Fragment9, { children: empty });
15565
+ content = /* @__PURE__ */ jsx70(AgentTranscriptSkeleton, { label: loadingLabel, testId: loadingTestId });
15566
+ } else if (!conversation || conversation.rows.length === 0 && !turnAttachments?.length) {
15567
+ content = /* @__PURE__ */ jsx70(Fragment9, { children: empty });
15387
15568
  } else {
15388
- content = /* @__PURE__ */ jsx69(
15569
+ content = /* @__PURE__ */ jsx70(
15389
15570
  AgentTranscriptView,
15390
15571
  {
15391
15572
  conversation,
15573
+ turnAttachments,
15574
+ turnAttachmentLocatorRef,
15575
+ onTurnAttachmentVisibilityChange,
15392
15576
  onLinkAction,
15393
15577
  onAuthLogin,
15394
15578
  availableSkills,
@@ -15399,18 +15583,18 @@ var AgentConversationFlow = memo5(function AgentConversationFlow2({
15399
15583
  }
15400
15584
  );
15401
15585
  }
15402
- return /* @__PURE__ */ jsx69(AgentTurnDisclosureProvider, { children: content });
15586
+ return /* @__PURE__ */ jsx70(AgentTurnDisclosureProvider, { children: content });
15403
15587
  });
15404
15588
 
15405
15589
  // shared/agentConversation/projection/useProjectedAgentConversation.ts
15406
- import { useMemo as useMemo8, useRef as useRef13 } from "react";
15590
+ import { useMemo as useMemo9, useRef as useRef14 } from "react";
15407
15591
  function useProjectedAgentConversation({
15408
15592
  conversation,
15409
15593
  detail,
15410
15594
  avoidGroupingEdits = false
15411
15595
  }) {
15412
- const previousConversationRef = useRef13(null);
15413
- return useMemo8(() => {
15596
+ const previousConversationRef = useRef14(null);
15597
+ return useMemo9(() => {
15414
15598
  if (!conversation && !detail) {
15415
15599
  previousConversationRef.current = null;
15416
15600
  return null;
@@ -15457,6 +15641,7 @@ export {
15457
15641
  textPromptContent,
15458
15642
  materializePastedTextInstructions,
15459
15643
  projectAgentConversationVM,
15644
+ latestAssistantMessageText,
15460
15645
  reconcileProjectedAgentConversationVM,
15461
15646
  getAppErrorCode,
15462
15647
  toLocalShortDateTime,
@@ -15467,4 +15652,4 @@ export {
15467
15652
  AgentConversationFlow,
15468
15653
  useProjectedAgentConversation
15469
15654
  };
15470
- //# sourceMappingURL=chunk-HD2TXBXU.js.map
15655
+ //# sourceMappingURL=chunk-U6TH4RJJ.js.map