@adecore/agents-react 0.53.2 → 0.54.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 (355) hide show
  1. package/dist/agents/AgentIcon.js +1 -1
  2. package/dist/agents/AgentModelLabel.js +1 -1
  3. package/dist/agents/accounts.js +1 -1
  4. package/dist/chat/attachments.js +1 -1
  5. package/dist/chat/forks.js +1 -1
  6. package/dist/chat/logic/limit.js +1 -1
  7. package/dist/chat/logic/scrubber.js +1 -1
  8. package/dist/chat/logic/selection-switch.d.ts +6 -0
  9. package/dist/chat/logic/selection-switch.js +42 -0
  10. package/dist/chat/logic/timeline-target.d.ts +1 -1
  11. package/dist/chat/logic/timeline.d.ts +6 -1
  12. package/dist/chat/logic/timeline.js +16 -2
  13. package/dist/chat/logic/tool-looks.js +1 -1
  14. package/dist/chat/logic/tools.js +1 -1
  15. package/dist/chat/logic/workflow.js +1 -1
  16. package/dist/chat/preferences.js +1 -1
  17. package/dist/chat/runtime-modes.js +1 -1
  18. package/dist/chat/send-key.js +1 -1
  19. package/dist/chat/stash.js +2 -2
  20. package/dist/chat/subagent-list.js +1 -1
  21. package/dist/chat/ui/AccountPill.js +3 -3
  22. package/dist/chat/ui/BookmarkMarker.js +6 -6
  23. package/dist/chat/ui/BookmarkSubmenu.js +5 -5
  24. package/dist/chat/ui/ChatActivity.js +15 -14
  25. package/dist/chat/ui/CodeBlock.js +9 -7
  26. package/dist/chat/ui/Composer.js +13 -13
  27. package/dist/chat/ui/ComposerInput.d.ts +1 -1
  28. package/dist/chat/ui/ComposerInput.js +35 -18
  29. package/dist/chat/ui/DiffPool.js +1 -1
  30. package/dist/chat/ui/EditDiff.js +2 -2
  31. package/dist/chat/ui/GoalDock.js +5 -5
  32. package/dist/chat/ui/ImageView.js +4 -4
  33. package/dist/chat/ui/LimitState.js +12 -12
  34. package/dist/chat/ui/Markdown.d.ts +1 -1
  35. package/dist/chat/ui/Markdown.js +11 -10
  36. package/dist/chat/ui/MermaidBlock.js +7 -6
  37. package/dist/chat/ui/MessageActions.js +7 -7
  38. package/dist/chat/ui/ModelMarks.js +2 -2
  39. package/dist/chat/ui/Pickers.d.ts +1 -1
  40. package/dist/chat/ui/Pickers.js +32 -27
  41. package/dist/chat/ui/PromptComposer.d.ts +1 -1
  42. package/dist/chat/ui/PromptComposer.js +5 -5
  43. package/dist/chat/ui/PromptEditor.js +3 -3
  44. package/dist/chat/ui/QuoteButton.js +2 -2
  45. package/dist/chat/ui/ReferenceChip.js +3 -3
  46. package/dist/chat/ui/ReferenceTrail.js +2 -2
  47. package/dist/chat/ui/ResumeCompactionDock.js +3 -3
  48. package/dist/chat/ui/RunSettings.js +11 -11
  49. package/dist/chat/ui/Scrubber.js +4 -4
  50. package/dist/chat/ui/SessionLine.js +2 -2
  51. package/dist/chat/ui/ShellCommand.d.ts +1 -1
  52. package/dist/chat/ui/ShellCommand.js +2 -2
  53. package/dist/chat/ui/SubagentControls.js +3 -3
  54. package/dist/chat/ui/SubagentInfo.js +5 -5
  55. package/dist/chat/ui/SubagentStopButton.js +2 -2
  56. package/dist/chat/ui/SubagentTimeline.js +18 -16
  57. package/dist/chat/ui/Timeline.js +231 -145
  58. package/dist/chat/ui/TimelineMenu.js +7 -7
  59. package/dist/chat/ui/UnifiedDiff.js +2 -2
  60. package/dist/chat/ui/VisualDialogs.js +1 -1
  61. package/dist/chat/ui/VisualFrame.js +4 -4
  62. package/dist/chat/ui/WorkflowAgentLine.d.ts +1 -1
  63. package/dist/chat/ui/WorkflowAgentLine.js +3 -3
  64. package/dist/chat/ui/chip-clipboard.d.ts +1 -1
  65. package/dist/chat/ui/composer/ComposerControls.d.ts +1 -1
  66. package/dist/chat/ui/composer/ComposerControls.js +4 -4
  67. package/dist/chat/ui/composer/ComposerMenu.js +5 -4
  68. package/dist/chat/ui/composer/DraftParts.js +2 -2
  69. package/dist/chat/ui/composer/QueuedMessages.js +2 -2
  70. package/dist/chat/ui/composer/chip-paste.d.ts +1 -1
  71. package/dist/chat/ui/composer/chips.d.ts +1 -1
  72. package/dist/chat/ui/composer/chips.js +2 -2
  73. package/dist/chat/ui/composer/key-handler.js +1 -1
  74. package/dist/chat/ui/composer/placeholder.js +1 -1
  75. package/dist/chat/ui/composer/use-composer-menus.d.ts +1 -1
  76. package/dist/chat/ui/composer/use-composer-menus.js +1 -1
  77. package/dist/chat/ui/composer/use-composer-submit.d.ts +1 -1
  78. package/dist/chat/ui/composer/use-draft-files.d.ts +2 -2
  79. package/dist/chat/ui/composer/use-draft-files.js +1 -1
  80. package/dist/chat/ui/composer/use-effort-stepper.js +1 -1
  81. package/dist/chat/ui/composer/use-prompt-menus.d.ts +2 -2
  82. package/dist/chat/ui/composer/use-prompt-menus.js +1 -1
  83. package/dist/chat/ui/diff/ApprovalReview.js +2 -2
  84. package/dist/chat/ui/diff/DiffOmitted.js +1 -1
  85. package/dist/chat/ui/diff/DiffStack.js +2 -2
  86. package/dist/chat/ui/diff/EditorEditDiff.d.ts +1 -1
  87. package/dist/chat/ui/diff/EditorEditDiff.js +5 -5
  88. package/dist/chat/ui/diff/EditorPatchDiff.d.ts +1 -1
  89. package/dist/chat/ui/diff/EditorPatchDiff.js +1 -1
  90. package/dist/chat/ui/diff/LegacyEditDiff.js +47 -31
  91. package/dist/chat/ui/diff/LegacyUnifiedDiff.js +93 -69
  92. package/dist/chat/ui/diff/RawDiff.js +54 -35
  93. package/dist/chat/ui/diff/syntax-runtime.d.ts +1 -1
  94. package/dist/chat/ui/highlighter.d.ts +1 -1
  95. package/dist/chat/ui/highlighter.js +1 -1
  96. package/dist/chat/ui/icons.js +1 -1
  97. package/dist/chat/ui/intelligent-ui/UiBlockFrame.d.ts +1 -1
  98. package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +4 -4
  99. package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +2 -2
  100. package/dist/chat/ui/intelligent-ui/UiReply.d.ts +2 -2
  101. package/dist/chat/ui/intelligent-ui/UiReply.js +8 -8
  102. package/dist/chat/ui/intelligent-ui/node-text.d.ts +1 -1
  103. package/dist/chat/ui/intelligent-ui/render-context.d.ts +1 -1
  104. package/dist/chat/ui/intelligent-ui/renderers/chart.js +28 -15
  105. package/dist/chat/ui/intelligent-ui/renderers/choices.js +4 -4
  106. package/dist/chat/ui/intelligent-ui/renderers/content.js +6 -6
  107. package/dist/chat/ui/intelligent-ui/renderers/data.js +104 -87
  108. package/dist/chat/ui/intelligent-ui/renderers/inputs.js +3 -3
  109. package/dist/chat/ui/intelligent-ui/renderers/links.js +2 -2
  110. package/dist/chat/ui/intelligent-ui/renderers/map-view.js +4 -4
  111. package/dist/chat/ui/intelligent-ui/renderers/map.js +3 -3
  112. package/dist/chat/ui/intelligent-ui/renderers/structure.js +2 -2
  113. package/dist/chat/ui/intelligent-ui/renderers/text.js +5 -5
  114. package/dist/chat/ui/intelligent-ui/tones.d.ts +1 -1
  115. package/dist/chat/ui/intelligent-ui/use-ui-links.d.ts +1 -1
  116. package/dist/chat/ui/intelligent-ui/use-ui-links.js +2 -2
  117. package/dist/chat/ui/intelligent-ui/use-ui-queries.js +1 -1
  118. package/dist/chat/ui/reference-icons.d.ts +1 -1
  119. package/dist/chat/ui/reference-icons.js +2 -2
  120. package/dist/chat/ui/reply-context.d.ts +1 -1
  121. package/dist/chat/ui/rows/ForksRow.js +3 -3
  122. package/dist/chat/ui/rows/GeneratedImageRow.js +5 -5
  123. package/dist/chat/ui/rows/MessageRows.d.ts +6 -1
  124. package/dist/chat/ui/rows/MessageRows.js +151 -22
  125. package/dist/chat/ui/rows/Rows.js +39 -21
  126. package/dist/chat/ui/rows/SubagentRow.js +16 -16
  127. package/dist/chat/ui/rows/TaskRow.js +3 -3
  128. package/dist/chat/ui/rows/VisualRow.js +2 -2
  129. package/dist/chat/ui/rows/WorkRows.d.ts +2 -2
  130. package/dist/chat/ui/rows/WorkRows.js +37 -25
  131. package/dist/chat/ui/rows/WorkflowRow.js +8 -8
  132. package/dist/chat/ui/use-diff-source-tokens.js +1 -1
  133. package/dist/chat/ui/visual-theme.d.ts +1 -1
  134. package/dist/chat/ui/visual-theme.js +2 -2
  135. package/dist/chat/workflow-list.js +1 -1
  136. package/dist/host.d.ts +4 -4
  137. package/dist/host.js +1 -1
  138. package/dist/lazy.js +1 -1
  139. package/dist/locales/en/agent-chat.d.ts +4 -0
  140. package/dist/locales/en/agent-chat.js +4 -0
  141. package/dist/locales/nl/agent-chat.d.ts +4 -0
  142. package/dist/locales/nl/agent-chat.js +4 -0
  143. package/dist/port-transport.js +1 -1
  144. package/dist/prompts/logic/subjects.d.ts +1 -1
  145. package/dist/prompts/ui/ApprovalBody.js +16 -7
  146. package/dist/prompts/ui/PromptActions.js +2 -2
  147. package/dist/prompts/ui/PromptCard.js +5 -4
  148. package/dist/prompts/ui/PromptView.js +1 -1
  149. package/dist/prompts/ui/QuestionBody.js +4 -4
  150. package/dist/providers/AccountDetail.js +4 -4
  151. package/dist/providers/AccountOrderList.js +2 -2
  152. package/dist/providers/AccountVariables.js +3 -3
  153. package/dist/providers/AddAccountForm.js +6 -6
  154. package/dist/providers/CliDetail.js +8 -8
  155. package/dist/providers/InstallPage.js +3 -3
  156. package/dist/providers/ProviderList.js +2 -2
  157. package/dist/providers/ProvidersPane.d.ts +1 -1
  158. package/dist/providers/ProvidersPane.js +5 -5
  159. package/dist/providers/install-steps.d.ts +1 -1
  160. package/dist/settings/sections.d.ts +2 -2
  161. package/dist/state/chats.js +1 -1
  162. package/dist/state/usage.js +2 -2
  163. package/dist/theme.css +4 -4
  164. package/dist/transport.d.ts +1 -1
  165. package/dist/usage/LimitsList.js +4 -4
  166. package/dist/usage/UsageBreakdown.js +5 -5
  167. package/dist/usage/UsageChart.js +1 -1
  168. package/dist/usage/UsageDialog.js +1 -1
  169. package/dist/usage/UsageLimits.js +6 -6
  170. package/dist/usage/UsageLimitsCard.js +2 -2
  171. package/dist/usage/UsagePage.js +200 -189
  172. package/dist/usage/UsagePane.js +2 -2
  173. package/dist/usage/UsageSummary.js +1 -1
  174. package/dist/usage/UsageTiles.js +1 -1
  175. package/dist/usage/limit-groups.js +2 -2
  176. package/dist/usage/summary.js +1 -1
  177. package/package.json +9 -8
  178. package/src/agents/AgentIcon.tsx +1 -1
  179. package/src/agents/AgentModelLabel.tsx +2 -2
  180. package/src/agents/ProviderLogo.tsx +1 -1
  181. package/src/agents/accounts.ts +1 -1
  182. package/src/agents/option-words.ts +1 -1
  183. package/src/chat/attachments.ts +1 -1
  184. package/src/chat/bookmarks.ts +1 -1
  185. package/src/chat/drafts.ts +1 -1
  186. package/src/chat/forks.ts +1 -1
  187. package/src/chat/logic/fork.ts +1 -1
  188. package/src/chat/logic/limit.ts +1 -1
  189. package/src/chat/logic/scrubber.ts +1 -1
  190. package/src/chat/logic/selection-switch.ts +47 -0
  191. package/src/chat/logic/timeline-copy.ts +1 -1
  192. package/src/chat/logic/timeline-target.ts +1 -1
  193. package/src/chat/logic/timeline.ts +28 -4
  194. package/src/chat/logic/tool-looks.ts +1 -1
  195. package/src/chat/logic/tools.ts +1 -1
  196. package/src/chat/logic/workflow.ts +1 -1
  197. package/src/chat/pending-prompts.ts +1 -1
  198. package/src/chat/preferences.ts +1 -1
  199. package/src/chat/reading-width.ts +1 -1
  200. package/src/chat/runtime-modes.ts +1 -1
  201. package/src/chat/send-key.ts +1 -1
  202. package/src/chat/stash.ts +2 -2
  203. package/src/chat/subagent-conversation.ts +1 -1
  204. package/src/chat/subagent-list.ts +1 -1
  205. package/src/chat/subagent-view.ts +1 -1
  206. package/src/chat/thumbnails.ts +1 -1
  207. package/src/chat/ui/AccountPill.tsx +4 -4
  208. package/src/chat/ui/BookmarkMarker.tsx +6 -6
  209. package/src/chat/ui/BookmarkSubmenu.tsx +5 -5
  210. package/src/chat/ui/ChatActivity.tsx +15 -15
  211. package/src/chat/ui/CodeBlock.tsx +10 -8
  212. package/src/chat/ui/Composer.tsx +13 -13
  213. package/src/chat/ui/ComposerInput.tsx +10 -2
  214. package/src/chat/ui/DiffPool.tsx +1 -1
  215. package/src/chat/ui/EditDiff.tsx +3 -4
  216. package/src/chat/ui/GoalDock.tsx +6 -6
  217. package/src/chat/ui/ImageView.tsx +4 -4
  218. package/src/chat/ui/LimitState.tsx +13 -13
  219. package/src/chat/ui/Markdown.tsx +12 -12
  220. package/src/chat/ui/MermaidBlock.tsx +6 -6
  221. package/src/chat/ui/MessageActions.tsx +7 -7
  222. package/src/chat/ui/ModelMarks.tsx +2 -2
  223. package/src/chat/ui/Pickers.tsx +10 -10
  224. package/src/chat/ui/PromptComposer.tsx +6 -6
  225. package/src/chat/ui/PromptEditor.tsx +4 -4
  226. package/src/chat/ui/QuoteButton.tsx +2 -2
  227. package/src/chat/ui/ReferenceChip.tsx +3 -3
  228. package/src/chat/ui/ReferenceTrail.tsx +2 -2
  229. package/src/chat/ui/ResumeCompactionDock.tsx +3 -3
  230. package/src/chat/ui/RunSettings.tsx +13 -13
  231. package/src/chat/ui/Scrubber.tsx +4 -4
  232. package/src/chat/ui/SessionLine.tsx +2 -2
  233. package/src/chat/ui/ShellCommand.tsx +2 -2
  234. package/src/chat/ui/SubagentControls.tsx +3 -3
  235. package/src/chat/ui/SubagentInfo.tsx +5 -5
  236. package/src/chat/ui/SubagentStopButton.tsx +3 -3
  237. package/src/chat/ui/SubagentTimeline.tsx +20 -17
  238. package/src/chat/ui/Timeline.tsx +232 -143
  239. package/src/chat/ui/TimelineMenu.tsx +7 -7
  240. package/src/chat/ui/UnifiedDiff.tsx +3 -3
  241. package/src/chat/ui/VisualDialogs.tsx +2 -2
  242. package/src/chat/ui/VisualFrame.tsx +4 -4
  243. package/src/chat/ui/WorkflowAgentLine.tsx +4 -4
  244. package/src/chat/ui/chip-clipboard.ts +1 -1
  245. package/src/chat/ui/composer/ComposerControls.tsx +4 -4
  246. package/src/chat/ui/composer/ComposerMenu.tsx +6 -6
  247. package/src/chat/ui/composer/DraftParts.tsx +2 -2
  248. package/src/chat/ui/composer/QueuedMessages.tsx +2 -2
  249. package/src/chat/ui/composer/chip-paste.ts +1 -1
  250. package/src/chat/ui/composer/chips.ts +2 -2
  251. package/src/chat/ui/composer/key-handler.ts +2 -2
  252. package/src/chat/ui/composer/placeholder.ts +1 -1
  253. package/src/chat/ui/composer/use-chat-controls.ts +1 -1
  254. package/src/chat/ui/composer/use-compaction-offer.ts +1 -1
  255. package/src/chat/ui/composer/use-composer-menus.ts +2 -2
  256. package/src/chat/ui/composer/use-composer-submit.ts +2 -2
  257. package/src/chat/ui/composer/use-draft-files.ts +3 -3
  258. package/src/chat/ui/composer/use-effort-stepper.ts +2 -2
  259. package/src/chat/ui/composer/use-pending-requests.ts +1 -1
  260. package/src/chat/ui/composer/use-prompt-menus.ts +3 -3
  261. package/src/chat/ui/composer/use-take-back.ts +1 -1
  262. package/src/chat/ui/diff/ApprovalReview.tsx +3 -3
  263. package/src/chat/ui/diff/DiffOmitted.tsx +1 -1
  264. package/src/chat/ui/diff/DiffStack.tsx +2 -2
  265. package/src/chat/ui/diff/EditorEditDiff.tsx +5 -5
  266. package/src/chat/ui/diff/EditorPatchDiff.tsx +1 -1
  267. package/src/chat/ui/diff/LegacyDiffPool.tsx +1 -1
  268. package/src/chat/ui/diff/LegacyEditDiff.tsx +18 -9
  269. package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +24 -13
  270. package/src/chat/ui/diff/RawDiff.tsx +8 -5
  271. package/src/chat/ui/diff/syntax-runtime.ts +1 -1
  272. package/src/chat/ui/highlighter.ts +1 -1
  273. package/src/chat/ui/icons.tsx +2 -2
  274. package/src/chat/ui/intelligent-ui/UiBlockFrame.tsx +5 -5
  275. package/src/chat/ui/intelligent-ui/UiFallbackPart.tsx +2 -2
  276. package/src/chat/ui/intelligent-ui/UiReply.tsx +18 -18
  277. package/src/chat/ui/intelligent-ui/node-text.ts +1 -1
  278. package/src/chat/ui/intelligent-ui/render-context.ts +1 -1
  279. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +15 -7
  280. package/src/chat/ui/intelligent-ui/renderers/choices.tsx +4 -4
  281. package/src/chat/ui/intelligent-ui/renderers/content.tsx +7 -7
  282. package/src/chat/ui/intelligent-ui/renderers/data.tsx +8 -7
  283. package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +3 -3
  284. package/src/chat/ui/intelligent-ui/renderers/links.tsx +4 -4
  285. package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +4 -4
  286. package/src/chat/ui/intelligent-ui/renderers/map.tsx +5 -5
  287. package/src/chat/ui/intelligent-ui/renderers/structure.tsx +3 -3
  288. package/src/chat/ui/intelligent-ui/renderers/text.tsx +5 -5
  289. package/src/chat/ui/intelligent-ui/tones.ts +1 -1
  290. package/src/chat/ui/intelligent-ui/use-ui-links.ts +2 -2
  291. package/src/chat/ui/intelligent-ui/use-ui-queries.ts +1 -1
  292. package/src/chat/ui/reference-icons.ts +2 -2
  293. package/src/chat/ui/reply-context.ts +1 -1
  294. package/src/chat/ui/rows/ForksRow.tsx +3 -3
  295. package/src/chat/ui/rows/GeneratedImageRow.tsx +7 -7
  296. package/src/chat/ui/rows/MessageRows.tsx +57 -33
  297. package/src/chat/ui/rows/RowContainer.tsx +1 -1
  298. package/src/chat/ui/rows/Rows.tsx +7 -4
  299. package/src/chat/ui/rows/SubagentRow.tsx +16 -16
  300. package/src/chat/ui/rows/TaskRow.tsx +4 -4
  301. package/src/chat/ui/rows/VisualRow.tsx +2 -2
  302. package/src/chat/ui/rows/WorkRows.tsx +44 -32
  303. package/src/chat/ui/rows/WorkflowRow.tsx +9 -9
  304. package/src/chat/ui/rows/row-rhythm.ts +1 -1
  305. package/src/chat/ui/use-diff-source-tokens.ts +1 -1
  306. package/src/chat/ui/visual-theme.ts +2 -2
  307. package/src/chat/workflow-list.ts +1 -1
  308. package/src/host.ts +6 -6
  309. package/src/lazy.tsx +1 -1
  310. package/src/locales/en/agent-chat.ts +4 -0
  311. package/src/locales/nl/agent-chat.ts +4 -0
  312. package/src/port-transport.ts +1 -1
  313. package/src/prompts/logic/subjects.ts +1 -1
  314. package/src/prompts/ui/ApprovalBody.tsx +19 -9
  315. package/src/prompts/ui/PromptActions.tsx +2 -2
  316. package/src/prompts/ui/PromptCard.tsx +4 -4
  317. package/src/prompts/ui/PromptView.tsx +1 -1
  318. package/src/prompts/ui/QuestionBody.tsx +5 -5
  319. package/src/providers/AccountDetail.tsx +5 -5
  320. package/src/providers/AccountOrderList.tsx +2 -2
  321. package/src/providers/AccountVariables.tsx +4 -4
  322. package/src/providers/AddAccountForm.tsx +7 -7
  323. package/src/providers/CliDetail.tsx +9 -9
  324. package/src/providers/InstallPage.tsx +4 -4
  325. package/src/providers/ProviderList.tsx +4 -4
  326. package/src/providers/ProvidersPane.tsx +7 -7
  327. package/src/providers/account-actions.ts +1 -1
  328. package/src/providers/install-steps.ts +1 -1
  329. package/src/providers/parts.tsx +1 -1
  330. package/src/providers/provider-abilities.ts +1 -1
  331. package/src/providers/provider-groups.ts +1 -1
  332. package/src/providers/variables.ts +1 -1
  333. package/src/settings/sections.ts +2 -2
  334. package/src/state/chats.ts +2 -2
  335. package/src/state/provider-accounts.ts +1 -1
  336. package/src/state/providers.ts +1 -1
  337. package/src/state/usage.ts +2 -2
  338. package/src/theme.css +4 -4
  339. package/src/transport.ts +1 -1
  340. package/src/usage/LimitsList.tsx +5 -5
  341. package/src/usage/UsageBreakdown.tsx +6 -6
  342. package/src/usage/UsageChart.tsx +2 -2
  343. package/src/usage/UsageDialog.tsx +2 -2
  344. package/src/usage/UsageLimits.tsx +7 -7
  345. package/src/usage/UsageLimitsCard.tsx +2 -2
  346. package/src/usage/UsagePage.tsx +5 -5
  347. package/src/usage/UsagePane.tsx +2 -2
  348. package/src/usage/UsageSummary.tsx +2 -2
  349. package/src/usage/UsageTiles.tsx +1 -1
  350. package/src/usage/limit-groups.ts +2 -2
  351. package/src/usage/limits.ts +1 -1
  352. package/src/usage/summary.ts +1 -1
  353. package/dist/chat/logic/json.d.ts +0 -1
  354. package/dist/chat/logic/json.js +0 -4
  355. package/src/chat/logic/json.ts +0 -4
@@ -1,6 +1,7 @@
1
1
  import type { ChatAssistantItem, ChatUserItem } from '@adecore/agent-contracts';
2
2
  import { copyText } from '@adecore/ui';
3
3
  import { referenceTokens } from '../chat-references';
4
+ import type { TimelineRow } from '../logic/timeline';
4
5
  import {
5
6
  clipboardChipsOf,
6
7
  hasClipboardChips,
@@ -10,7 +11,6 @@ import {
10
11
  type ChipSegment,
11
12
  type ClipboardChips
12
13
  } from '../mentions';
13
- import type { TimelineRow } from '../logic/timeline';
14
14
  import type { ReferenceLookup } from './reference-lookup';
15
15
 
16
16
  /* The chips a copy of a whole message carries: what the person picked, or what a reply names. */
@@ -1,9 +1,9 @@
1
- import { useRef, useState, type Ref } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
- import clsx from 'clsx';
4
- import { ArrowUp, ChevronDown, Play, Plus, Square } from 'lucide-react';
5
1
  import { holdsConversation, type ChatInfo } from '@adecore/agent-contracts';
6
2
  import { Button, ErrorBoundary, Icon, Menu, Tooltip, type Shortcut } from '@adecore/ui';
3
+ import clsx from 'clsx';
4
+ import { ArrowUp, ChevronDown, Play, Plus, Square } from 'lucide-react';
5
+ import { useRef, useState, type Ref } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { useChatHost, type ComposerSendAction, type ComposerSendDraft } from '../../../host';
8
8
  import { useChatScope } from '../../../scope';
9
9
  import { useProviders } from '../../../state/providers';
@@ -1,13 +1,13 @@
1
- import type { ReactNode } from 'react';
2
- import { useTranslation } from 'react-i18next';
1
+ import { FileIcon, Icon, Menu, MiddleTruncate, ScrollArea } from '@adecore/ui';
3
2
  import clsx from 'clsx';
4
3
  import { SquareSlash, Zap } from 'lucide-react';
5
- import { FileIcon, Icon, Menu, MiddleTruncate } from '@adecore/ui';
4
+ import type { ReactNode } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import { useChatHost } from '../../../host';
7
7
  import type { Referable } from '../../chat-references';
8
8
  import { referenceGlyph } from '../reference-icons';
9
- import type { ComposerMenus as Menus } from './use-composer-menus';
10
9
  import { optionIdOf } from './menu-aria';
10
+ import type { ComposerMenus as Menus } from './use-composer-menus';
11
11
 
12
12
  function splitPath(path: string): { name: string; dir: string } {
13
13
  const slash = path.lastIndexOf('/');
@@ -121,7 +121,7 @@ function ReferenceMenu({ menus }: { menus: Menus }) {
121
121
  }
122
122
 
123
123
  return (
124
- <div className="max-h-96 overflow-y-auto border-b border-border px-1.5 py-1.5">
124
+ <ScrollArea className="max-h-96 border-b border-border" viewportClassName="px-1.5 py-1.5">
125
125
  {referenceMatches.length > 0 ? (
126
126
  <div id={listId} role="listbox" aria-label={t('composer.menu.references')}>
127
127
  {[...groups].map(([key, items]) => (
@@ -161,7 +161,7 @@ function ReferenceMenu({ menus }: { menus: Menus }) {
161
161
  ) : (
162
162
  <div className="px-2 py-1 text-xs text-text-faint">{t('composer.references.noMatch')}</div>
163
163
  )}
164
- </div>
164
+ </ScrollArea>
165
165
  );
166
166
  }
167
167
 
@@ -1,7 +1,7 @@
1
- import { useTranslation } from 'react-i18next';
2
- import { Paperclip, X } from 'lucide-react';
3
1
  import type { ChatAttachmentUpload } from '@adecore/agent-contracts';
4
2
  import { Icon, IconButton, Tooltip } from '@adecore/ui';
3
+ import { Paperclip, X } from 'lucide-react';
4
+ import { useTranslation } from 'react-i18next';
5
5
  import { useChatScope } from '../../../scope';
6
6
  import { formatBytes, isImageAttachment, uploadBytes } from '../../attachments';
7
7
  import { jumpToTimelineItem } from '../../timeline-scroll';
@@ -1,7 +1,7 @@
1
- import { useTranslation } from 'react-i18next';
2
- import { Clock, Copy, FastForward, Pencil, X } from 'lucide-react';
3
1
  import type { ChatQueuedMessage } from '@adecore/agent-contracts';
4
2
  import { ButtonGroup, ContextMenu, copyText, Icon, IconButton } from '@adecore/ui';
3
+ import { Clock, Copy, FastForward, Pencil, X } from 'lucide-react';
4
+ import { useTranslation } from 'react-i18next';
5
5
  import { useChatActions } from '../../actions';
6
6
  import { scrollTimelineToEnd } from '../../timeline-scroll';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import type { EditorView } from '@codemirror/view';
2
- import type { ChatDraft } from '../../drafts';
3
2
  import type { Referable } from '../../chat-references';
3
+ import type { ChatDraft } from '../../drafts';
4
4
  import {
5
5
  chipRanges,
6
6
  clipboardChipsOf,
@@ -1,8 +1,8 @@
1
- import { createElement, Fragment, type ComponentType } from 'react';
2
- import { createRoot, type Root } from 'react-dom/client';
3
1
  import { syntaxTree } from '@codemirror/language';
4
2
  import { Facet, StateField, type EditorState, type Extension, type Range } from '@codemirror/state';
5
3
  import { Decoration, EditorView, WidgetType, type DecorationSet } from '@codemirror/view';
4
+ import { createElement, Fragment, type ComponentType } from 'react';
5
+ import { createRoot, type Root } from 'react-dom/client';
6
6
  import type { ReferenceIconProps } from '../../../host';
7
7
  import type { ReferableKind, ReferenceStep } from '../../chat-references';
8
8
  import { chipRanges, type ReferenceToken } from '../../mentions';
@@ -1,15 +1,15 @@
1
+ import { isModHeld, matchesShortcut } from '@adecore/ui';
1
2
  import { indentLess, indentMore, insertNewline } from '@codemirror/commands';
2
3
  import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
3
4
  import type { EditorView } from '@codemirror/view';
4
- import { isModHeld, matchesShortcut } from '@adecore/ui';
5
5
  import type { ChatHost } from '../../../host';
6
6
  import type { ComposerSend } from '../../composer-send';
7
7
  import type { ChatSendKey } from '../../send-key';
8
8
  import { STASH_SHORTCUT } from '../../stash';
9
9
  import { pageTimeline } from '../../timeline-scroll';
10
+ import { enterAction, inCode, inFenceBody, inOpenFence, listItemAt, recallDirection, tabSpaces } from './keys';
10
11
  import type { ComposerMenus } from './use-composer-menus';
11
12
  import type { PromptHistory } from './use-prompt-history';
12
- import { enterAction, inCode, inFenceBody, inOpenFence, listItemAt, recallDirection, tabSpaces } from './keys';
13
13
 
14
14
  const SEND_HOW: Readonly<Record<'send' | 'send-alternate' | 'send-and-new', ComposerSend>> = {
15
15
  send: 'default',
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
- import { useChatScope } from '../../../scope';
4
3
  import { useHostComposerPlaceholder } from '../../../host-hooks';
4
+ import { useChatScope } from '../../../scope';
5
5
 
6
6
  /* The empty box names its sigils as key caps, so they read as keys to press rather than as punctuation. */
7
7
  function hintedPlaceholder(lead: string, joiner: string, hints: ReadonlyArray<{ key: string; label: string }>): HTMLElement {
@@ -1,6 +1,6 @@
1
+ import type { AgentKind, ChatInfo, ModelSelection, RuntimeMode } from '@adecore/agent-contracts';
1
2
  import { useRef, useState } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
- import type { AgentKind, ChatInfo, ModelSelection, RuntimeMode } from '@adecore/agent-contracts';
4
4
  import { useChatHost } from '../../../host';
5
5
  import { useHostCanReorderAccounts } from '../../../host-hooks';
6
6
  import { useChatScope } from '../../../scope';
@@ -1,5 +1,5 @@
1
- import { useEffect, useState } from 'react';
2
1
  import type { ChatInfo, ChatItem, ProviderCapabilities } from '@adecore/agent-contracts';
2
+ import { useEffect, useState } from 'react';
3
3
  import { useChatRow } from '../../../state/chats';
4
4
  import { RESUME_COMPACTION_TOKENS, resumeCompactionDueAt, resumeCompactionOffer, watchDueAt, type DueClock } from '../../logic/resume-compaction';
5
5
  import { useResumeCompactionDismissal } from '../../resume-compaction-dismissals';
@@ -1,11 +1,11 @@
1
+ import type { ChatInfo, ChatSkill, ProviderCapabilities } from '@adecore/agent-contracts';
1
2
  import { useEffect, useState, type RefObject } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
- import type { ChatInfo, ChatSkill, ProviderCapabilities } from '@adecore/agent-contracts';
4
+ import { useHostReferables } from '../../../host-hooks';
4
5
  import { useChatScope } from '../../../scope';
5
6
  import type { ComposerInputHandle } from '../ComposerInput';
6
7
  import type { ComposerDraft } from './use-composer-draft';
7
8
  import { usePromptMenus, type PromptMenus } from './use-prompt-menus';
8
- import { useHostReferables } from '../../../host-hooks';
9
9
 
10
10
  export type { ComposerCommand } from './use-prompt-menus';
11
11
 
@@ -6,17 +6,17 @@ import { checkAttachmentLimits, uploadBytes } from '../../attachments';
6
6
  import type { ChatSendExtras } from '../../chat-client';
7
7
  import { registerComposerSender, type ComposerSend } from '../../composer-send';
8
8
  import { isEmptyDraft } from '../../drafts';
9
- import { CONTINUE_PROMPT } from '../../logic/continue-after-stop';
10
9
  import type { PromptGuard } from '../../guards';
10
+ import { CONTINUE_PROMPT } from '../../logic/continue-after-stop';
11
11
  import { presentMentions, presentReferences, presentSkills } from '../../mentions';
12
12
  import { withQuote } from '../../quote';
13
13
  import { restorableChats, stashDraft, useStash, type StashedPrompt } from '../../stash';
14
14
  import { scrollTimelineToEnd } from '../../timeline-scroll';
15
15
  import type { ComposerInputHandle } from '../ComposerInput';
16
16
  import type { ChatControls } from './use-chat-controls';
17
- import type { NoticeTone } from './use-notice';
18
17
  import type { ComposerDraft } from './use-composer-draft';
19
18
  import type { ComposerMenus } from './use-composer-menus';
19
+ import type { NoticeTone } from './use-notice';
20
20
  import type { PromptHistory } from './use-prompt-history';
21
21
  import type { ComposerPromptHold } from './use-prompt-hold';
22
22
 
@@ -1,11 +1,11 @@
1
+ import type { ProviderCapabilities } from '@adecore/agent-contracts';
2
+ import { EditorView } from '@codemirror/view';
1
3
  import { useRef, useState, type DragEvent, type RefObject } from 'react';
2
4
  import { useTranslation } from 'react-i18next';
3
- import { EditorView } from '@codemirror/view';
4
- import type { ProviderCapabilities } from '@adecore/agent-contracts';
5
5
  import { useChatHost } from '../../../host';
6
6
  import { checkAttachmentLimits, filesOf, readAttachments, uploadBytes } from '../../attachments';
7
- import { pasteBecomesAttachment, pastedTextName } from '../../guards';
8
7
  import type { Referable } from '../../chat-references';
8
+ import { pasteBecomesAttachment, pastedTextName } from '../../guards';
9
9
  import { carriesMentions, droppedMentions, pastedMentions, readClipboardChips, type ReferenceToken } from '../../mentions';
10
10
  import type { ComposerInputHandle } from '../ComposerInput';
11
11
  import { copyWithChipsFromEditor, pasteWithChips, withPastedChips, type PasteChoices } from './chip-paste';
@@ -1,8 +1,8 @@
1
+ import type { ChatInfo, ModelInfo } from '@adecore/agent-contracts';
1
2
  import { useEffect, useRef } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
- import type { ChatInfo, ModelInfo } from '@adecore/agent-contracts';
4
- import { useChatScope } from '../../../scope';
5
4
  import { choiceWord } from '../../../agents/option-words';
5
+ import { useChatScope } from '../../../scope';
6
6
  import { registerEffortStepper } from '../../composer-effort';
7
7
  import { EFFORT_OPTION, stepEffort, type EffortStep } from '../../logic/effort';
8
8
  import type { ChatControls } from './use-chat-controls';
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
- import { useChatScope } from '../../../scope';
3
2
  import type { PromptSubject } from '../../../prompts/logic/subjects';
3
+ import { useChatScope } from '../../../scope';
4
4
  import { ChatPromptFeed } from '../../pending-prompts';
5
5
 
6
6
  export function usePendingRequests(chatId: string): PromptSubject[] {
@@ -1,8 +1,8 @@
1
- import { useEffect, useId, useState, type Dispatch, type RefObject, type SetStateAction } from 'react';
2
- import { useTranslation } from 'react-i18next';
1
+ import type { ChatSkill } from '@adecore/agent-contracts';
3
2
  import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
4
3
  import type { EditorState } from '@codemirror/state';
5
- import type { ChatSkill } from '@adecore/agent-contracts';
4
+ import { useEffect, useId, useState, type Dispatch, type RefObject, type SetStateAction } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import { useChatHost } from '../../../host';
7
7
  import { useHostExpandingCommands } from '../../../host-hooks';
8
8
  import { useChatScope } from '../../../scope';
@@ -1,6 +1,6 @@
1
+ import type { ChatAttachmentUpload, ChatQueuedMessage } from '@adecore/agent-contracts';
1
2
  import { useState } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
- import type { ChatAttachmentUpload, ChatQueuedMessage } from '@adecore/agent-contracts';
4
4
  import { useChatHost } from '../../../host';
5
5
  import { useChatScope } from '../../../scope';
6
6
  import { errorCode, errorMessage } from '../../../transport';
@@ -1,9 +1,9 @@
1
- import { useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
1
  import { Button } from '@adecore/ui';
4
2
  import { formatNumber } from '@adecore/ui/format';
5
- import { ReviewDiff } from './ReviewDiff';
3
+ import { useState } from 'react';
4
+ import { useTranslation } from 'react-i18next';
6
5
  import type { ReviewEntry } from './review-plan';
6
+ import { ReviewDiff } from './ReviewDiff';
7
7
 
8
8
  export function ApprovalReview({ entries, maxHeight }: { entries: readonly ReviewEntry[]; maxHeight: number }) {
9
9
  const { t } = useTranslation('agent-prompts');
@@ -1,5 +1,5 @@
1
- import { useReviewSettled } from './review-settle';
2
1
  import { useTranslation } from 'react-i18next';
2
+ import { useReviewSettled } from './review-settle';
3
3
 
4
4
  export function DiffOmitted({ path }: { path: string }) {
5
5
  useReviewSettled();
@@ -1,8 +1,8 @@
1
- import { useTranslation } from 'react-i18next';
2
1
  import { Button } from '@adecore/ui';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { reviewSize, type ReviewEntry } from './review-plan';
3
4
  import { ReviewSettleContext } from './review-settle';
4
5
  import { ReviewDiff } from './ReviewDiff';
5
- import { reviewSize, type ReviewEntry } from './review-plan';
6
6
  import { useReviewStack, type ReviewStack } from './use-review-stack';
7
7
 
8
8
  export function ReviewStackView({ entries, stack }: { entries: readonly ReviewEntry[]; stack: ReviewStack }) {
@@ -1,16 +1,16 @@
1
- import { useReviewSettled } from './review-settle';
2
- import { useEffect, useState, type ReactNode } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import { getFiletypeFromFileName } from '@pierre/diffs';
5
1
  import type { EditorEngine } from '@adecore/editor';
6
2
  import { DiffView, type DiffSource } from '@adecore/editor-react';
7
3
  import { diffDocument, patchOf, type DiffDocument } from '@adecore/merge';
4
+ import { getFiletypeFromFileName } from '@pierre/diffs';
5
+ import { useEffect, useState, type ReactNode } from 'react';
6
+ import { useTranslation } from 'react-i18next';
7
+ import { useHostCodeMode, useHostCodeThemes } from '../../../host-hooks';
8
8
  import { diffTexts, type FileChange } from '../../logic/tools';
9
9
  import { useDiffSourceTokens } from '../use-diff-source-tokens';
10
10
  import { diffSourceBudget } from './diff-source-budget';
11
11
  import { DiffOmitted } from './DiffOmitted';
12
12
  import { canRenderEditorDiff, EDITOR_DIFF_LIMITS, EDITOR_DIFF_WORK } from './editor-edit-model';
13
- import { useHostCodeMode, useHostCodeThemes } from '../../../host-hooks';
13
+ import { useReviewSettled } from './review-settle';
14
14
 
15
15
  type EngineLoader = () => Promise<EditorEngine>;
16
16
 
@@ -1,8 +1,8 @@
1
- import { useMemo, type ReactNode } from 'react';
2
1
  import type { ChatFileChange } from '@adecore/agent-contracts';
3
2
  import type { EditorEngine } from '@adecore/editor';
4
3
  import type { DiffSource } from '@adecore/editor-react';
5
4
  import { diffDocument, parsePatch } from '@adecore/merge';
5
+ import { useMemo, type ReactNode } from 'react';
6
6
  import type { DiffContents } from '../full-diff';
7
7
  import { diffSourceBudget, patchSourceBudget } from './diff-source-budget';
8
8
  import { DiffOmitted } from './DiffOmitted';
@@ -1,5 +1,5 @@
1
- import type { ReactNode } from 'react';
2
1
  import { useWorkerPool } from '@pierre/diffs/react';
2
+ import type { ReactNode } from 'react';
3
3
  import { useChatHost } from '../../../host';
4
4
  import DiffPool from '../DiffPool';
5
5
 
@@ -1,9 +1,10 @@
1
- import { LegacyDiffPool } from './LegacyDiffPool';
2
- import { useReviewSettled } from './review-settle';
1
+ import { ScrollArea } from '@adecore/ui';
3
2
  import { MultiFileDiff } from '@pierre/diffs/react';
4
- import { useDiffTheme } from '../diff-theme';
5
- import { diffTexts, type FileChange } from '../../logic/tools';
6
3
  import { useHostCodeMode } from '../../../host-hooks';
4
+ import { diffTexts, type FileChange } from '../../logic/tools';
5
+ import { useDiffTheme } from '../diff-theme';
6
+ import { LegacyDiffPool } from './LegacyDiffPool';
7
+ import { useReviewSettled } from './review-settle';
7
8
 
8
9
  export default function LegacyEditDiff({ change, maxHeight }: { change: FileChange; maxHeight?: number }) {
9
10
  useReviewSettled();
@@ -23,11 +24,19 @@ export default function LegacyEditDiff({ change, maxHeight }: { change: FileChan
23
24
  hunkSeparators: 'simple' as const
24
25
  };
25
26
 
27
+ const body = (
28
+ <LegacyDiffPool>
29
+ <MultiFileDiff oldFile={oldFile} newFile={newFile} options={options} />
30
+ </LegacyDiffPool>
31
+ );
32
+
33
+ if (maxHeight === undefined) {
34
+ return <div className="chat-diff select-text">{body}</div>;
35
+ }
36
+
26
37
  return (
27
- <div className="chat-diff select-text" style={maxHeight === undefined ? undefined : { maxHeight, overflow: 'auto' }}>
28
- <LegacyDiffPool>
29
- <MultiFileDiff oldFile={oldFile} newFile={newFile} options={options} />
30
- </LegacyDiffPool>
31
- </div>
38
+ <ScrollArea axis="both" className="chat-diff select-text" style={{ maxHeight }}>
39
+ {body}
40
+ </ScrollArea>
32
41
  );
33
42
  }
@@ -1,12 +1,13 @@
1
- import { LegacyDiffPool } from './LegacyDiffPool';
2
- import { useReviewSettled } from './review-settle';
3
- import clsx from 'clsx';
4
- import { FileDiff, PatchDiff } from '@pierre/diffs/react';
5
1
  import type { ChatFileChange } from '@adecore/agent-contracts';
2
+ import { ScrollArea } from '@adecore/ui';
3
+ import { FileDiff, PatchDiff } from '@pierre/diffs/react';
4
+ import clsx from 'clsx';
5
+ import { useHostCodeMode } from '../../../host-hooks';
6
6
  import { useDiffTheme } from '../diff-theme';
7
7
  import { fullFileDiff } from '../full-diff';
8
8
  import type { UnifiedDiffProps } from './diff-props';
9
- import { useHostCodeMode } from '../../../host-hooks';
9
+ import { LegacyDiffPool } from './LegacyDiffPool';
10
+ import { useReviewSettled } from './review-settle';
10
11
 
11
12
  /*
12
13
  * A patch the CLI reported itself. The renderer needs a file header, which a CLI that only sends hunks
@@ -70,7 +71,12 @@ export default function LegacyUnifiedDiff({ change, overflow = 'wrap', diffStyle
70
71
 
71
72
  if (patch === null) {
72
73
  return (
73
- <pre className="max-h-64 overflow-auto px-3 py-2 font-mono text-code select-text" style={fill ? undefined : { maxHeight }}>
74
+ <ScrollArea
75
+ axis="both"
76
+ render={<pre />}
77
+ viewportClassName="max-h-64 px-3 py-2 font-mono text-code select-text"
78
+ style={fill ? undefined : { maxHeight }}
79
+ >
74
80
  {change.diff
75
81
  .replace(/\n$/, '')
76
82
  .split('\n')
@@ -79,16 +85,21 @@ export default function LegacyUnifiedDiff({ change, overflow = 'wrap', diffStyle
79
85
  {line}
80
86
  </div>
81
87
  ))}
82
- </pre>
88
+ </ScrollArea>
83
89
  );
84
90
  }
85
91
 
92
+ const body = (
93
+ <LegacyDiffPool>{full === null ? <PatchDiff patch={patch} options={options} /> : <FileDiff fileDiff={full} options={options} />}</LegacyDiffPool>
94
+ );
95
+
96
+ if (fill || maxHeight === undefined) {
97
+ return <div className={clsx('chat-diff select-text', fill && 'flex grow flex-col')}>{body}</div>;
98
+ }
99
+
86
100
  return (
87
- <div
88
- className={clsx('chat-diff select-text', fill && 'flex grow flex-col')}
89
- style={fill || maxHeight === undefined ? undefined : { maxHeight, overflow: 'auto' }}
90
- >
91
- <LegacyDiffPool>{full === null ? <PatchDiff patch={patch} options={options} /> : <FileDiff fileDiff={full} options={options} />}</LegacyDiffPool>
92
- </div>
101
+ <ScrollArea axis="both" className="chat-diff select-text" style={{ maxHeight }}>
102
+ {body}
103
+ </ScrollArea>
93
104
  );
94
105
  }
@@ -1,3 +1,4 @@
1
+ import { ScrollArea } from '@adecore/ui';
1
2
  import clsx from 'clsx';
2
3
  import { useReviewSettled } from './review-settle';
3
4
 
@@ -5,16 +6,18 @@ export function RawDiff({ text, overflow, fill, maxHeight }: { text: string; ove
5
6
  useReviewSettled();
6
7
 
7
8
  return (
8
- <pre
9
+ <ScrollArea
10
+ axis="both"
11
+ render={<pre />}
9
12
  data-diff-raw
10
- className={clsx(
11
- 'overflow-auto px-3 py-2 font-mono text-code text-text-muted select-text',
12
- fill && 'h-full min-h-0',
13
+ className={clsx(fill && 'h-full')}
14
+ viewportClassName={clsx(
15
+ 'px-3 py-2 font-mono text-code text-text-muted select-text',
13
16
  overflow === 'wrap' ? 'whitespace-pre-wrap' : 'whitespace-pre'
14
17
  )}
15
18
  style={fill ? undefined : { maxHeight: maxHeight ?? 256 }}
16
19
  >
17
20
  {text.replace(/\n$/, '')}
18
- </pre>
21
+ </ScrollArea>
19
22
  );
20
23
  }
@@ -1,4 +1,3 @@
1
- import type { Highlighter, ThemeRegistration } from 'shiki';
2
1
  import {
3
2
  createSyntaxService,
4
3
  type DiffSyntaxDocument,
@@ -7,6 +6,7 @@ import {
7
6
  type DiffSyntaxService,
8
7
  type DiffSyntaxTokens
9
8
  } from '@adecore/editor/shiki-worker';
9
+ import type { Highlighter, ThemeRegistration } from 'shiki';
10
10
  import type { ChatHost } from '../../../host';
11
11
 
12
12
  interface Pending {
@@ -1,7 +1,7 @@
1
1
  import type { CSSProperties } from 'react';
2
2
  import type { BundledLanguage, BundledTheme, Highlighter, ThemeRegistration } from 'shiki';
3
- import { TokenCache, type CodeToken, type Tokenize } from './code-lines';
4
3
  import { useChatHost, type ChatHost } from '../../host';
4
+ import { TokenCache, type CodeToken, type Tokenize } from './code-lines';
5
5
  import { shikiThemeOf } from './code-theme';
6
6
 
7
7
  export type { Highlighter };
@@ -1,7 +1,7 @@
1
- import type { ReactNode } from 'react';
1
+ import { Icon } from '@adecore/ui';
2
2
  import { Hammer, Wrench } from 'lucide-react';
3
+ import type { ReactNode } from 'react';
3
4
  import { toolEntry } from '../logic/tool-catalog';
4
- import { Icon } from '@adecore/ui';
5
5
 
6
6
  const SIZE = 12;
7
7
 
@@ -1,11 +1,11 @@
1
- import { useId, useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode, type RefObject } from 'react';
2
- import clsx from 'clsx';
3
- import { useTranslation } from 'react-i18next';
4
1
  import type { UiViewNode } from '@adecore/intelligent-ui';
5
- import { Info, Lock, Radio, TriangleAlert } from 'lucide-react';
6
2
  import { Icon, KEY_SHORTCUTS, matchesShortcut, Skeleton, Spinner, Tooltip, useTickingText } from '@adecore/ui';
7
- import { useChatHost } from '../../../host';
8
3
  import { formatAgo, formatMoment } from '@adecore/ui/format';
4
+ import clsx from 'clsx';
5
+ import { Info, Lock, Radio, TriangleAlert } from 'lucide-react';
6
+ import { useId, useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode, type RefObject } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { useChatHost } from '../../../host';
9
9
  import { uiBlockHead, uiReasonText } from './node-text';
10
10
  import { UiHeadContext, type UiLiveStatus } from './render-context';
11
11
  import { useLater } from './use-later';
@@ -1,6 +1,6 @@
1
- import { useTranslation } from 'react-i18next';
2
- import { Info } from 'lucide-react';
3
1
  import { Icon } from '@adecore/ui';
2
+ import { Info } from 'lucide-react';
3
+ import { useTranslation } from 'react-i18next';
4
4
  import { Markdown } from '../Markdown';
5
5
 
6
6
  /* Why a part is drawn as its text: a component this version does not know, or one it could not draw. */
@@ -1,3 +1,15 @@
1
+ import type { ChatUiAnswer, ChatUiQueryState } from '@adecore/agent-contracts';
2
+ import {
3
+ evaluateUiBlock,
4
+ uiInputValues,
5
+ isUiComponent,
6
+ UI_CATALOG_VERSION,
7
+ UiState,
8
+ type UiBlock,
9
+ type UiNode,
10
+ type UiViewNode
11
+ } from '@adecore/intelligent-ui';
12
+ import { ErrorBoundary, Tooltip } from '@adecore/ui';
1
13
  import {
2
14
  Component,
3
15
  createContext,
@@ -12,34 +24,22 @@ import {
12
24
  type ComponentProps,
13
25
  type ReactNode
14
26
  } from 'react';
15
- import ReactMarkdown, { type Components } from 'react-markdown';
16
27
  import { useTranslation } from 'react-i18next';
17
- import {
18
- evaluateUiBlock,
19
- uiInputValues,
20
- isUiComponent,
21
- UI_CATALOG_VERSION,
22
- UiState,
23
- type UiBlock,
24
- type UiNode,
25
- type UiViewNode
26
- } from '@adecore/intelligent-ui';
27
- import { ErrorBoundary, Tooltip } from '@adecore/ui';
28
- import type { ChatUiAnswer, ChatUiQueryState } from '@adecore/agent-contracts';
28
+ import ReactMarkdown, { type Components } from 'react-markdown';
29
29
  import { useChatHost } from '../../../host';
30
- import { UiReplyNavigationContext } from '../reply-context';
31
30
  import { ReplyMarkdown } from '../Markdown';
32
31
  import { rehypeFadeWords } from '../rehype-fade';
32
+ import { UiReplyNavigationContext } from '../reply-context';
33
+ import { UiPageMemory } from './block-local';
34
+ import { uiChildrenOf, revealUiSource, uiLiveChoiceReason, uiUrlDomain } from './node-text';
33
35
  import { UI_RENDERERS } from './registry';
34
36
  import type { UiRenderContext, UiRenderer } from './render-context';
35
- import { UiPageMemory } from './block-local';
37
+ import { UiSourceCitation } from './renderers/content';
38
+ import { uiReplyParts } from './reply-parts';
36
39
  import { UiBlockFrame } from './UiBlockFrame';
37
40
  import { UiFallbackPart } from './UiFallbackPart';
38
41
  import { useUiLinks } from './use-ui-links';
39
42
  import { useUiQueries, useUiLiveValues } from './use-ui-queries';
40
- import { UiSourceCitation } from './renderers/content';
41
- import { uiChildrenOf, revealUiSource, uiLiveChoiceReason, uiUrlDomain } from './node-text';
42
- import { uiReplyParts } from './reply-parts';
43
43
 
44
44
  const localStates = new UiPageMemory<UiState>(64);
45
45
 
@@ -1,6 +1,6 @@
1
- import type { TFunction } from 'i18next';
2
1
  import { parseUiEventTime, type UiComponentName, type UiProps, type UiViewNode } from '@adecore/intelligent-ui';
3
2
  import { formatClock, formatDateTime, formatDay, formatDayClock, formatDayClockWithYear, formatDayWithYear } from '@adecore/ui/format';
3
+ import type { TFunction } from 'i18next';
4
4
  import type { UiLiveStatus } from './render-context';
5
5
 
6
6
  /* The text a node holds, every `$text` below it joined as written, such as the code of a CodeBlock. */
@@ -1,6 +1,6 @@
1
- import { createContext, type ReactNode } from 'react';
2
1
  import type { UiComponentName, UiProps, UiViewNode } from '@adecore/intelligent-ui';
3
2
  import type { UiLinkTarget } from '@adecore/intelligent-ui/links';
3
+ import { createContext, type ReactNode } from 'react';
4
4
 
5
5
  export type { UiLinkTarget };
6
6