veryfront 0.1.997 → 0.1.998

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 (374) hide show
  1. package/esm/cli/templates/manifest.js +1 -1
  2. package/esm/deno.d.ts +7 -0
  3. package/esm/deno.js +11 -3
  4. package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +2 -0
  5. package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +1 -0
  6. package/esm/deps/esm.sh/react-dom@19.2.4.js +3 -0
  7. package/esm/react/react-dom.d.ts +3 -0
  8. package/esm/react/react-dom.d.ts.map +1 -0
  9. package/esm/react/react-dom.js +2 -0
  10. package/esm/src/agent/ag-ui/host-support.d.ts.map +1 -1
  11. package/esm/src/agent/ag-ui/host-support.js +12 -0
  12. package/esm/src/agent/react/index.d.ts +4 -2
  13. package/esm/src/agent/react/index.d.ts.map +1 -1
  14. package/esm/src/agent/react/index.js +2 -1
  15. package/esm/src/agent/react/use-agent-metadata.d.ts +5 -0
  16. package/esm/src/agent/react/use-agent-metadata.d.ts.map +1 -1
  17. package/esm/src/agent/react/use-agent-metadata.js +18 -9
  18. package/esm/src/agent/react/use-agents.d.ts +33 -0
  19. package/esm/src/agent/react/use-agents.d.ts.map +1 -0
  20. package/esm/src/agent/react/use-agents.js +72 -0
  21. package/esm/src/agent/react/use-chat/index.d.ts +1 -1
  22. package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
  23. package/esm/src/agent/react/use-chat/types.d.ts +3 -2
  24. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  25. package/esm/src/agent/react/use-chat/use-chat.d.ts +12 -1
  26. package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
  27. package/esm/src/agent/react/use-chat/use-chat.js +47 -7
  28. package/esm/src/agent/react/use-chat/utils.d.ts.map +1 -1
  29. package/esm/src/agent/react/use-chat/utils.js +4 -0
  30. package/esm/src/agent/runtime/message-adapter.d.ts.map +1 -1
  31. package/esm/src/agent/runtime/message-adapter.js +3 -1
  32. package/esm/src/agent/runtime/text-generation-runtime-message-converter.d.ts.map +1 -1
  33. package/esm/src/agent/runtime/text-generation-runtime-message-converter.js +6 -2
  34. package/esm/src/chat/index.d.ts +17 -7
  35. package/esm/src/chat/index.d.ts.map +1 -1
  36. package/esm/src/chat/index.js +33 -7
  37. package/esm/src/chat/protocol.d.ts +13 -1
  38. package/esm/src/chat/protocol.d.ts.map +1 -1
  39. package/esm/src/chat/upload-handler.d.ts +55 -0
  40. package/esm/src/chat/upload-handler.d.ts.map +1 -0
  41. package/esm/src/chat/upload-handler.js +180 -0
  42. package/esm/src/discovery/import-rewriter.d.ts +1 -1
  43. package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
  44. package/esm/src/discovery/import-rewriter.js +2 -0
  45. package/esm/src/discovery/transpiler.d.ts.map +1 -1
  46. package/esm/src/discovery/transpiler.js +2 -0
  47. package/esm/src/react/components/chat/agent-card.d.ts +84 -11
  48. package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
  49. package/esm/src/react/components/chat/agent-card.js +151 -57
  50. package/esm/src/react/components/chat/agent-picker.d.ts +166 -0
  51. package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -0
  52. package/esm/src/react/components/chat/agent-picker.js +183 -0
  53. package/esm/src/react/components/chat/chat/components/animations.js +1 -1
  54. package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +125 -3
  55. package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
  56. package/esm/src/react/components/chat/chat/components/attachment-pill.js +209 -25
  57. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +149 -0
  58. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -0
  59. package/esm/src/react/components/chat/chat/components/attachments-panel.js +187 -0
  60. package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +13 -2
  61. package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
  62. package/esm/src/react/components/chat/chat/components/branch-picker.js +6 -8
  63. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +20 -0
  64. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -0
  65. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +31 -0
  66. package/esm/src/react/components/chat/chat/components/code-block.d.ts +9 -1
  67. package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
  68. package/esm/src/react/components/chat/chat/components/code-block.js +14 -6
  69. package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +11 -4
  70. package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
  71. package/esm/src/react/components/chat/chat/components/drop-zone.js +10 -8
  72. package/esm/src/react/components/chat/chat/components/empty-state.d.ts +2 -1
  73. package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
  74. package/esm/src/react/components/chat/chat/components/empty-state.js +7 -8
  75. package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +6 -2
  76. package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
  77. package/esm/src/react/components/chat/chat/components/inference-badge.js +5 -4
  78. package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +9 -1
  79. package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
  80. package/esm/src/react/components/chat/chat/components/inline-citation.js +19 -20
  81. package/esm/src/react/components/chat/chat/components/message-actions.d.ts +28 -5
  82. package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
  83. package/esm/src/react/components/chat/chat/components/message-actions.js +24 -36
  84. package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +7 -2
  85. package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
  86. package/esm/src/react/components/chat/chat/components/message-edit-form.js +5 -5
  87. package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +11 -1
  88. package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
  89. package/esm/src/react/components/chat/chat/components/message-feedback.js +9 -11
  90. package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
  91. package/esm/src/react/components/chat/chat/components/quick-actions.js +3 -1
  92. package/esm/src/react/components/chat/chat/components/reasoning.d.ts +66 -3
  93. package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
  94. package/esm/src/react/components/chat/chat/components/reasoning.js +95 -21
  95. package/esm/src/react/components/chat/chat/components/sidebar.d.ts +178 -12
  96. package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
  97. package/esm/src/react/components/chat/chat/components/sidebar.js +228 -45
  98. package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +6 -1
  99. package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
  100. package/esm/src/react/components/chat/chat/components/skill-badge.js +6 -5
  101. package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +37 -0
  102. package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -0
  103. package/esm/src/react/components/chat/chat/components/skill-tool.js +46 -0
  104. package/esm/src/react/components/chat/chat/components/sources.d.ts +55 -3
  105. package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
  106. package/esm/src/react/components/chat/chat/components/sources.js +50 -16
  107. package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +42 -3
  108. package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
  109. package/esm/src/react/components/chat/chat/components/step-indicator.js +55 -12
  110. package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
  111. package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
  112. package/esm/src/react/components/chat/chat/components/tab-switcher.js +3 -3
  113. package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +96 -3
  114. package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
  115. package/esm/src/react/components/chat/chat/components/tool-ui.js +158 -36
  116. package/esm/src/react/components/chat/chat/composition/api.d.ts +4 -2
  117. package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
  118. package/esm/src/react/components/chat/chat/composition/api.js +4 -2
  119. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +112 -5
  120. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
  121. package/esm/src/react/components/chat/chat/composition/chat-composer.js +251 -61
  122. package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +78 -0
  123. package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -0
  124. package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +63 -0
  125. package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +4 -1
  126. package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
  127. package/esm/src/react/components/chat/chat/composition/chat-empty.js +11 -10
  128. package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +11 -3
  129. package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
  130. package/esm/src/react/components/chat/chat/composition/chat-message-list.js +81 -111
  131. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +4 -0
  132. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
  133. package/esm/src/react/components/chat/chat/composition/chat-root.js +3 -1
  134. package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +4 -0
  135. package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
  136. package/esm/src/react/components/chat/chat/composition/error-banner.js +10 -7
  137. package/esm/src/react/components/chat/chat/composition/message.d.ts +123 -5
  138. package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
  139. package/esm/src/react/components/chat/chat/composition/message.js +332 -53
  140. package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +6 -1
  141. package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
  142. package/esm/src/react/components/chat/chat/composition/model-avatar.js +3 -4
  143. package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +31 -0
  144. package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -0
  145. package/esm/src/react/components/chat/chat/composition/pending-message.js +31 -0
  146. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +4 -0
  147. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
  148. package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +1 -0
  149. package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
  150. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +29 -0
  151. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -0
  152. package/esm/src/react/components/chat/chat/contexts/conversations-context.js +39 -0
  153. package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
  154. package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
  155. package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
  156. package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +2 -0
  157. package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
  158. package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts +10 -0
  159. package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts.map +1 -0
  160. package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +34 -0
  161. package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts +21 -0
  162. package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts.map +1 -0
  163. package/esm/src/react/components/chat/chat/hooks/use-conversation.js +54 -0
  164. package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts +67 -0
  165. package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -0
  166. package/esm/src/react/components/chat/chat/hooks/use-conversations.js +317 -0
  167. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +27 -0
  168. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -0
  169. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +50 -0
  170. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +49 -0
  171. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -0
  172. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +120 -0
  173. package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts +34 -0
  174. package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts.map +1 -0
  175. package/esm/src/react/components/chat/chat/hooks/use-upload.js +147 -0
  176. package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts +37 -0
  177. package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts.map +1 -0
  178. package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +178 -0
  179. package/esm/src/react/components/chat/chat/index.d.ts +171 -31
  180. package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
  181. package/esm/src/react/components/chat/chat/index.js +371 -77
  182. package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts +63 -0
  183. package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts.map +1 -0
  184. package/esm/src/react/components/chat/chat/persistence/conversation-store.js +1 -0
  185. package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts +13 -0
  186. package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts.map +1 -0
  187. package/esm/src/react/components/chat/chat/persistence/local-conversation-store.js +102 -0
  188. package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts +11 -0
  189. package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts.map +1 -0
  190. package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.js +33 -0
  191. package/esm/src/react/components/chat/chat/utils/message-parts.d.ts +4 -1
  192. package/esm/src/react/components/chat/chat/utils/message-parts.d.ts.map +1 -1
  193. package/esm/src/react/components/chat/chat/utils/message-parts.js +4 -0
  194. package/esm/src/react/components/chat/chat-actions.d.ts +164 -0
  195. package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -0
  196. package/esm/src/react/components/chat/chat-actions.js +191 -0
  197. package/esm/src/react/components/chat/chat-agent-picker.d.ts +50 -0
  198. package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -0
  199. package/esm/src/react/components/chat/chat-agent-picker.js +40 -0
  200. package/esm/src/react/components/chat/chat-theme-scope.d.ts +26 -0
  201. package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -0
  202. package/esm/src/react/components/chat/chat-theme-scope.js +27 -0
  203. package/esm/src/react/components/chat/chat-tokens-style.d.ts +21 -0
  204. package/esm/src/react/components/chat/chat-tokens-style.d.ts.map +1 -0
  205. package/esm/src/react/components/chat/chat-tokens-style.js +24 -0
  206. package/esm/src/react/components/chat/chat.d.ts +5 -5
  207. package/esm/src/react/components/chat/chat.d.ts.map +1 -1
  208. package/esm/src/react/components/chat/chat.js +5 -5
  209. package/esm/src/react/components/chat/color-mode.d.ts +46 -0
  210. package/esm/src/react/components/chat/color-mode.d.ts.map +1 -0
  211. package/esm/src/react/components/chat/color-mode.js +123 -0
  212. package/esm/src/react/components/chat/error-boundary.js +2 -2
  213. package/esm/src/react/components/chat/icons/index.d.ts +8 -0
  214. package/esm/src/react/components/chat/icons/index.d.ts.map +1 -1
  215. package/esm/src/react/components/chat/icons/index.js +64 -0
  216. package/esm/src/react/components/chat/markdown.d.ts +24 -1
  217. package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
  218. package/esm/src/react/components/chat/markdown.js +122 -38
  219. package/esm/src/react/components/chat/model-selector.d.ts +130 -8
  220. package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
  221. package/esm/src/react/components/chat/model-selector.js +148 -121
  222. package/esm/src/react/components/chat/theme.d.ts +9 -12
  223. package/esm/src/react/components/chat/theme.d.ts.map +1 -1
  224. package/esm/src/react/components/chat/theme.js +149 -93
  225. package/esm/src/react/components/chat/ui/alert.d.ts +30 -0
  226. package/esm/src/react/components/chat/ui/alert.d.ts.map +1 -0
  227. package/esm/src/react/components/chat/ui/alert.js +35 -0
  228. package/esm/src/react/components/chat/ui/app-shell.d.ts +155 -0
  229. package/esm/src/react/components/chat/ui/app-shell.d.ts.map +1 -0
  230. package/esm/src/react/components/chat/ui/app-shell.js +276 -0
  231. package/esm/src/react/components/chat/ui/avatar.d.ts +24 -0
  232. package/esm/src/react/components/chat/ui/avatar.d.ts.map +1 -0
  233. package/esm/src/react/components/chat/ui/avatar.js +44 -0
  234. package/esm/src/react/components/chat/ui/badge.d.ts +24 -0
  235. package/esm/src/react/components/chat/ui/badge.d.ts.map +1 -0
  236. package/esm/src/react/components/chat/ui/badge.js +30 -0
  237. package/esm/src/react/components/chat/ui/button.d.ts +44 -0
  238. package/esm/src/react/components/chat/ui/button.d.ts.map +1 -0
  239. package/esm/src/react/components/chat/ui/button.js +108 -0
  240. package/esm/src/react/components/chat/ui/card.d.ts +42 -0
  241. package/esm/src/react/components/chat/ui/card.d.ts.map +1 -0
  242. package/esm/src/react/components/chat/ui/card.js +55 -0
  243. package/esm/src/react/components/chat/ui/checkbox.d.ts +28 -0
  244. package/esm/src/react/components/chat/ui/checkbox.d.ts.map +1 -0
  245. package/esm/src/react/components/chat/ui/checkbox.js +36 -0
  246. package/esm/src/react/components/chat/ui/code-block.d.ts +89 -0
  247. package/esm/src/react/components/chat/ui/code-block.d.ts.map +1 -0
  248. package/esm/src/react/components/chat/ui/code-block.js +277 -0
  249. package/esm/src/react/components/chat/ui/collapsible.d.ts +30 -0
  250. package/esm/src/react/components/chat/ui/collapsible.d.ts.map +1 -0
  251. package/esm/src/react/components/chat/ui/collapsible.js +44 -0
  252. package/esm/src/react/components/chat/ui/command.d.ts +65 -0
  253. package/esm/src/react/components/chat/ui/command.d.ts.map +1 -0
  254. package/esm/src/react/components/chat/ui/command.js +121 -0
  255. package/esm/src/react/components/chat/ui/cva.d.ts +36 -0
  256. package/esm/src/react/components/chat/ui/cva.d.ts.map +1 -0
  257. package/esm/src/react/components/chat/ui/cva.js +45 -0
  258. package/esm/src/react/components/chat/ui/dialog.d.ts +55 -0
  259. package/esm/src/react/components/chat/ui/dialog.d.ts.map +1 -0
  260. package/esm/src/react/components/chat/ui/dialog.js +116 -0
  261. package/esm/src/react/components/chat/ui/drawer.d.ts +41 -0
  262. package/esm/src/react/components/chat/ui/drawer.d.ts.map +1 -0
  263. package/esm/src/react/components/chat/ui/drawer.js +92 -0
  264. package/esm/src/react/components/chat/ui/dropdown-menu.d.ts +63 -0
  265. package/esm/src/react/components/chat/ui/dropdown-menu.d.ts.map +1 -0
  266. package/esm/src/react/components/chat/ui/dropdown-menu.js +76 -0
  267. package/esm/src/react/components/chat/ui/file-type.d.ts +26 -0
  268. package/esm/src/react/components/chat/ui/file-type.d.ts.map +1 -0
  269. package/esm/src/react/components/chat/ui/file-type.js +235 -0
  270. package/esm/src/react/components/chat/ui/floating.d.ts +29 -0
  271. package/esm/src/react/components/chat/ui/floating.d.ts.map +1 -0
  272. package/esm/src/react/components/chat/ui/floating.js +90 -0
  273. package/esm/src/react/components/chat/ui/icon-button.d.ts +19 -0
  274. package/esm/src/react/components/chat/ui/icon-button.d.ts.map +1 -0
  275. package/esm/src/react/components/chat/ui/icon-button.js +20 -0
  276. package/esm/src/react/components/chat/ui/index.d.ts +43 -0
  277. package/esm/src/react/components/chat/ui/index.d.ts.map +1 -0
  278. package/esm/src/react/components/chat/ui/index.js +42 -0
  279. package/esm/src/react/components/chat/ui/input.d.ts +27 -0
  280. package/esm/src/react/components/chat/ui/input.d.ts.map +1 -0
  281. package/esm/src/react/components/chat/ui/input.js +41 -0
  282. package/esm/src/react/components/chat/ui/label.d.ts +29 -0
  283. package/esm/src/react/components/chat/ui/label.d.ts.map +1 -0
  284. package/esm/src/react/components/chat/ui/label.js +40 -0
  285. package/esm/src/react/components/chat/ui/list.d.ts +47 -0
  286. package/esm/src/react/components/chat/ui/list.d.ts.map +1 -0
  287. package/esm/src/react/components/chat/ui/list.js +40 -0
  288. package/esm/src/react/components/chat/ui/pill.d.ts +26 -0
  289. package/esm/src/react/components/chat/ui/pill.d.ts.map +1 -0
  290. package/esm/src/react/components/chat/ui/pill.js +39 -0
  291. package/esm/src/react/components/chat/ui/popover.d.ts +47 -0
  292. package/esm/src/react/components/chat/ui/popover.d.ts.map +1 -0
  293. package/esm/src/react/components/chat/ui/popover.js +68 -0
  294. package/esm/src/react/components/chat/ui/progress-bar.d.ts +20 -0
  295. package/esm/src/react/components/chat/ui/progress-bar.d.ts.map +1 -0
  296. package/esm/src/react/components/chat/ui/progress-bar.js +31 -0
  297. package/esm/src/react/components/chat/ui/radio.d.ts +25 -0
  298. package/esm/src/react/components/chat/ui/radio.d.ts.map +1 -0
  299. package/esm/src/react/components/chat/ui/radio.js +29 -0
  300. package/esm/src/react/components/chat/ui/scroll-fade.d.ts +23 -0
  301. package/esm/src/react/components/chat/ui/scroll-fade.d.ts.map +1 -0
  302. package/esm/src/react/components/chat/ui/scroll-fade.js +40 -0
  303. package/esm/src/react/components/chat/ui/select.d.ts +64 -0
  304. package/esm/src/react/components/chat/ui/select.d.ts.map +1 -0
  305. package/esm/src/react/components/chat/ui/select.js +148 -0
  306. package/esm/src/react/components/chat/ui/shimmer.d.ts +25 -0
  307. package/esm/src/react/components/chat/ui/shimmer.d.ts.map +1 -0
  308. package/esm/src/react/components/chat/ui/shimmer.js +24 -0
  309. package/esm/src/react/components/chat/ui/skeleton.d.ts +14 -0
  310. package/esm/src/react/components/chat/ui/skeleton.d.ts.map +1 -0
  311. package/esm/src/react/components/chat/ui/skeleton.js +12 -0
  312. package/esm/src/react/components/chat/ui/slot.d.ts +21 -0
  313. package/esm/src/react/components/chat/ui/slot.d.ts.map +1 -0
  314. package/esm/src/react/components/chat/ui/slot.js +70 -0
  315. package/esm/src/react/components/chat/ui/status.d.ts +28 -0
  316. package/esm/src/react/components/chat/ui/status.d.ts.map +1 -0
  317. package/esm/src/react/components/chat/ui/status.js +23 -0
  318. package/esm/src/react/components/chat/ui/switch.d.ts +34 -0
  319. package/esm/src/react/components/chat/ui/switch.d.ts.map +1 -0
  320. package/esm/src/react/components/chat/ui/switch.js +58 -0
  321. package/esm/src/react/components/chat/ui/tabs.d.ts +44 -0
  322. package/esm/src/react/components/chat/ui/tabs.d.ts.map +1 -0
  323. package/esm/src/react/components/chat/ui/tabs.js +51 -0
  324. package/esm/src/react/components/chat/ui/tag.d.ts +22 -0
  325. package/esm/src/react/components/chat/ui/tag.d.ts.map +1 -0
  326. package/esm/src/react/components/chat/ui/tag.js +27 -0
  327. package/esm/src/react/components/chat/ui/textarea.d.ts +22 -0
  328. package/esm/src/react/components/chat/ui/textarea.d.ts.map +1 -0
  329. package/esm/src/react/components/chat/ui/textarea.js +35 -0
  330. package/esm/src/react/components/chat/ui/tooltip.d.ts +40 -0
  331. package/esm/src/react/components/chat/ui/tooltip.d.ts.map +1 -0
  332. package/esm/src/react/components/chat/ui/tooltip.js +132 -0
  333. package/esm/src/react/primitives/input-box.d.ts.map +1 -1
  334. package/esm/src/react/primitives/input-box.js +17 -4
  335. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  336. package/esm/src/server/handlers/dev/framework-candidates.generated.js +9437 -1064
  337. package/esm/src/server/handlers/dev/projects/html-shell.d.ts +1 -1
  338. package/esm/src/server/handlers/dev/projects/html-shell.d.ts.map +1 -1
  339. package/esm/src/server/handlers/dev/projects/html-shell.js +1 -12
  340. package/esm/src/server/handlers/request/public-agents-list.handler.d.ts +18 -0
  341. package/esm/src/server/handlers/request/public-agents-list.handler.d.ts.map +1 -0
  342. package/esm/src/server/handlers/request/public-agents-list.handler.js +44 -0
  343. package/esm/src/server/runtime-handler/index.d.ts +1 -1
  344. package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
  345. package/esm/src/server/runtime-handler/index.js +3 -0
  346. package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
  347. package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
  348. package/esm/src/studio/bridge/bridge-bundle.generated.js +3 -2
  349. package/esm/src/utils/version-constant.d.ts +1 -1
  350. package/esm/src/utils/version-constant.js +1 -1
  351. package/esm/src/workflow/blob/local-storage.d.ts +32 -0
  352. package/esm/src/workflow/blob/local-storage.d.ts.map +1 -0
  353. package/esm/src/workflow/blob/local-storage.js +179 -0
  354. package/esm/src/workflow/blob/types.d.ts +5 -0
  355. package/esm/src/workflow/blob/types.d.ts.map +1 -1
  356. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +11 -0
  357. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -1
  358. package/esm/src/workflow/blob/veryfront-cloud-storage.js +36 -0
  359. package/package.json +5 -1
  360. package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts +0 -20
  361. package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +0 -1
  362. package/esm/src/react/components/chat/chat/components/uploads-panel.js +0 -49
  363. package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts +0 -28
  364. package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +0 -1
  365. package/esm/src/react/components/chat/chat/contexts/thread-list-context.js +0 -27
  366. package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts +0 -28
  367. package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +0 -1
  368. package/esm/src/react/components/chat/chat/hooks/use-threads.js +0 -151
  369. package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -110
  370. package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +0 -1
  371. package/esm/src/react/components/chat/chat-with-sidebar.js +0 -167
  372. package/esm/src/react/components/chat/message.d.ts +0 -42
  373. package/esm/src/react/components/chat/message.d.ts.map +0 -1
  374. package/esm/src/react/components/chat/message.js +0 -69
@@ -0,0 +1,63 @@
1
+ /**
2
+ * ChatEmptyState — the conversation idle / empty view: an agent avatar, a
3
+ * heading, and a row of suggestion chips. Ported 1:1 from Veryfront Studio's
4
+ * `ChatIdleView` family (`ChatIdleView` + `…Avatar` + `…Heading` +
5
+ * `Suggestions`/`SuggestionItem`), restyled onto the chat primitives.
6
+ *
7
+ * Composed via children — every part is a small, focused piece you arrange
8
+ * yourself, so there is no monolithic prop surface:
9
+ *
10
+ * ```tsx
11
+ * <ChatEmptyState.Root>
12
+ * <ChatEmptyState.Avatar src={agent.avatarUrl} alt={agent.name} />
13
+ * <ChatEmptyState.Heading>{agent.name}</ChatEmptyState.Heading>
14
+ * <ChatEmptyState.Suggestions>
15
+ * <ChatEmptyState.Suggestion onClick={() => send("Create a plan")}>
16
+ * Create a plan
17
+ * </ChatEmptyState.Suggestion>
18
+ * </ChatEmptyState.Suggestions>
19
+ * </ChatEmptyState.Root>
20
+ * ```
21
+ *
22
+ * @module react/components/chat/composition/chat-empty-state
23
+ */
24
+ import * as React from "../../../../../../react/react.js";
25
+ import { cn } from "../../theme.js";
26
+ import { Avatar, Button } from "../../ui/index.js";
27
+ /** Centered container for the empty-state pieces. */
28
+ function Root({ className, children, ref, ...props }) {
29
+ return (React.createElement("div", { ref: ref, className: cn("flex flex-1 flex-col items-center justify-center gap-3.5 px-4", className), ...props }, children));
30
+ }
31
+ /**
32
+ * Hero agent avatar (64px). Renders the generic {@link Avatar} in `muted`
33
+ * tone — the agent's image when `src` resolves, otherwise its initial. Same as
34
+ * Studio's `ChatIdleView` avatar: agent identity comes from the data, not a
35
+ * bespoke component.
36
+ */
37
+ function EmptyStateAvatar({ className, isCreating, src, alt = "Veryfront Agent", ...props }) {
38
+ return (React.createElement(Avatar, { name: alt, avatarSrc: src, tone: "muted", className: cn("size-16!", isCreating && "animate-pulse", className), ...props }));
39
+ }
40
+ /** Balanced, centered title (e.g. the agent name). */
41
+ function Heading({ level = 2, className, children, ref, ...props }) {
42
+ const Tag = `h${level}`;
43
+ return (React.createElement(Tag, { ref: ref, className: cn("text-[1.375rem] font-semibold text-balance text-center leading-[1.2] tracking-normal text-[var(--foreground)]", className), ...props }, children));
44
+ }
45
+ /** Wrapping, centered row of suggestion chips. */
46
+ function Suggestions({ className, role = "group", children, ref, ...props }) {
47
+ return (React.createElement("div", { ref: ref, role: role, className: cn("mt-4 flex flex-wrap justify-center gap-2", className), ...props }, children));
48
+ }
49
+ /** A single filled suggestion chip. */
50
+ function Suggestion({ className, size = "sm", children, ...props }) {
51
+ return (React.createElement(Button, { variant: "tertiary", size: size, className: cn("h-9! rounded-md! px-3.5", className), ...props }, children));
52
+ }
53
+ /**
54
+ * Compound empty state. Use the namespaced parts to compose the view:
55
+ * `Root`, `Avatar`, `Heading`, `Suggestions`, `Suggestion`.
56
+ */
57
+ export const ChatEmptyState = {
58
+ Root,
59
+ Avatar: EmptyStateAvatar,
60
+ Heading,
61
+ Suggestions,
62
+ Suggestion,
63
+ };
@@ -1,5 +1,8 @@
1
1
  /**
2
- * ChatEmpty — Empty state for the chat conversation.
2
+ * ChatEmpty — the preset's empty state, composed from the `ChatEmptyState`
3
+ * primitive (`Root` + `Avatar`/icon + `Heading` + `Suggestions`/`Suggestion`)
4
+ * plus optional `QuickActions`. Prop-driven wrapper so `<Chat>` can render an
5
+ * empty state from data; drop to `ChatEmptyState.*` directly for full control.
3
6
  *
4
7
  * @module react/components/chat/composition/chat-empty
5
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chat-empty.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-empty.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,gCAAgC,CAAC;AAEhF,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,yBAAyB;AACzB,eAAO,MAAM,SAAS,uFAoDrB,CAAC"}
1
+ {"version":3,"file":"chat-empty.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-empty.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,gCAAgC,CAAC;AAEhF,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,yBAAyB;AACzB,eAAO,MAAM,SAAS,uFAgDrB,CAAC"}
@@ -1,24 +1,25 @@
1
1
  /**
2
- * ChatEmpty — Empty state for the chat conversation.
2
+ * ChatEmpty — the preset's empty state, composed from the `ChatEmptyState`
3
+ * primitive (`Root` + `Avatar`/icon + `Heading` + `Suggestions`/`Suggestion`)
4
+ * plus optional `QuickActions`. Prop-driven wrapper so `<Chat>` can render an
5
+ * empty state from data; drop to `ChatEmptyState.*` directly for full control.
3
6
  *
4
7
  * @module react/components/chat/composition/chat-empty
5
8
  */
6
9
  import * as React from "../../../../../../react/react.js";
7
- import { cn } from "../../theme.js";
8
- import { ConversationEmptyState, Suggestion, Suggestions } from "../components/empty-state.js";
10
+ import { ChatEmptyState } from "./chat-empty-state.js";
9
11
  import { QuickActions } from "../components/quick-actions.js";
10
12
  /** Render chat empty. */
11
13
  export const ChatEmpty = React.forwardRef(function ChatEmpty({ icon, title = "What can I help with?", description, suggestions, onSuggestionClick, quickActions, onQuickAction, className, children, }, ref) {
12
14
  const showSuggestions = (suggestions?.length ?? 0) > 0;
13
15
  const showQuickActions = (quickActions?.length ?? 0) > 0;
14
- return (React.createElement("div", { ref: ref, className: cn("flex flex-col items-center justify-center h-full px-4", className) },
15
- React.createElement("div", { className: "flex-1" }),
16
- React.createElement(ConversationEmptyState, { icon: icon, title: title, description: description }),
17
- showSuggestions && (React.createElement("div", { className: "w-full max-w-2xl mt-6" },
18
- React.createElement(Suggestions, { layout: "grid" }, suggestions?.map((suggestion) => (React.createElement(Suggestion, { key: suggestion, suggestion: suggestion, onClick: onSuggestionClick })))))),
16
+ return (React.createElement(ChatEmptyState.Root, { ref: ref, className: className },
17
+ icon,
18
+ React.createElement(ChatEmptyState.Heading, null, title),
19
+ description && (React.createElement("p", { className: "max-w-md text-center text-sm text-[var(--foreground)]" }, description)),
20
+ showSuggestions && (React.createElement(ChatEmptyState.Suggestions, null, suggestions?.map((suggestion) => (React.createElement(ChatEmptyState.Suggestion, { key: suggestion, onClick: () => onSuggestionClick?.(suggestion) }, suggestion))))),
19
21
  showQuickActions && (React.createElement("div", { className: "mt-4" },
20
22
  React.createElement(QuickActions, { actions: quickActions, onActionClick: onQuickAction }))),
21
- children,
22
- React.createElement("div", { className: "flex-1" })));
23
+ children));
23
24
  });
24
25
  ChatEmpty.displayName = "ChatEmpty";
@@ -1,8 +1,9 @@
1
1
  /**
2
- * ChatMessageList — Message rendering loop with component injection.
2
+ * ChatMessageList — Message rendering loop, composed from the `Message` primitive.
3
3
  *
4
- * Renders user and assistant messages with support for branching, editing,
5
- * feedback, sources, reasoning, tool calls, and step indicators.
4
+ * Every turn renders through `<Message message={…} />` so the `<Chat>` transcript
5
+ * is identical to the standalone `Message` component (header, reasoning, tools,
6
+ * sources, tokens, hover actions). Pass `renderMessage` to override a row.
6
7
  *
7
8
  * @module react/components/chat/composition/chat-message-list
8
9
  */
@@ -23,6 +24,11 @@ export interface ChatMessageListProps {
23
24
  showSources?: boolean;
24
25
  showSteps?: boolean;
25
26
  showScrollButton?: boolean;
27
+ /** Override the scroll-to-bottom button; receives the click handler + pin state. */
28
+ renderScrollButton?: (opts: {
29
+ onClick: () => void;
30
+ isAtBottom: boolean;
31
+ }) => React.ReactNode;
26
32
  onSourceClick?: (source: Source, index: number) => void;
27
33
  inferenceMode?: InferenceMode;
28
34
  editMessage?: (messageId: string, newText: string) => Promise<void>;
@@ -30,6 +36,8 @@ export interface ChatMessageListProps {
30
36
  switchBranch?: (messageId: string, branchIndex: number) => void;
31
37
  onFeedback?: (messageId: string, feedback: FeedbackValue) => void;
32
38
  className?: string;
39
+ /** Classes for the inner centered content column (default `max-w-[850px]`). */
40
+ contentClassName?: string;
33
41
  children?: React.ReactNode;
34
42
  }
35
43
  /** Render chat message list. */
@@ -1 +1 @@
1
- {"version":3,"file":"chat-message-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-message-list.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAgBhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIvD,OAAO,KAAK,EAAE,aAAa,EAAE,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M,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAElE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gCAAgC;AAChC,eAAO,MAAM,eAAe,6FA4J3B,CAAC"}
@@ -1,123 +1,93 @@
1
1
  /**
2
- * ChatMessageList — Message rendering loop with component injection.
2
+ * ChatMessageList — Message rendering loop, composed from the `Message` primitive.
3
3
  *
4
- * Renders user and assistant messages with support for branching, editing,
5
- * feedback, sources, reasoning, tool calls, and step indicators.
4
+ * Every turn renders through `<Message message={…} />` so the `<Chat>` transcript
5
+ * is identical to the standalone `Message` component (header, reasoning, tools,
6
+ * sources, tokens, hover actions). Pass `renderMessage` to override a row.
6
7
  *
7
8
  * @module react/components/chat/composition/chat-message-list
8
9
  */
9
10
  import * as React from "../../../../../../react/react.js";
10
- import { MessageItem, MessageList } from "../../../../primitives/index.js";
11
+ import { MessageList } from "../../../../primitives/index.js";
11
12
  import { cn } from "../../theme.js";
12
- import { Markdown } from "../../markdown.js";
13
- import { extractSourcesFromParts, getTextContent, groupPartsInOrder, isSkillToolPart, } from "../utils/message-parts.js";
14
13
  import { ConversationScrollButton } from "../components/empty-state.js";
15
- import { MessageActions } from "../components/message-actions.js";
16
- import { ReasoningCard } from "../components/reasoning.js";
17
- import { SkillBadge } from "../components/skill-badge.js";
18
- import { ToolCallCard } from "../components/tool-ui.js";
19
- import { Sources } from "../components/sources.js";
20
- import { MessageEditForm } from "../components/message-edit-form.js";
21
- import { BranchPicker } from "../components/branch-picker.js";
22
- import { MessageFeedback } from "../components/message-feedback.js";
23
- import { StepIndicator } from "../components/step-indicator.js";
24
- import { AgentAvatar } from "./agent-avatar.js";
25
- import { ModelAvatar } from "./model-avatar.js";
26
- function metadataString(metadata, key) {
27
- const value = metadata?.[key];
28
- return typeof value === "string" && value.trim().length > 0 ? value : undefined;
29
- }
30
- function getAssistantIdentity(message) {
31
- return {
32
- model: metadataString(message.metadata, "model"),
33
- agentName: metadataString(message.metadata, "agentName") ??
34
- metadataString(message.metadata, "agentId"),
35
- agentAvatarUrl: metadataString(message.metadata, "agentAvatarUrl"),
36
- };
37
- }
14
+ import { useStickToBottom } from "../hooks/use-stick-to-bottom.js";
15
+ import { PendingMessage } from "./pending-message.js";
16
+ import { Message } from "./message.js";
38
17
  /** Render chat message list. */
39
- export const ChatMessageList = React.forwardRef(function ChatMessageList({ messages, isLoading, theme, renderMessage, renderTool, model, showMessageActions = true, showSources = false, showSteps = false, showScrollButton = false, onSourceClick, inferenceMode: _inferenceMode, editMessage, getBranches, switchBranch, onFeedback, className, children, }, ref) {
40
- const messagesEndRef = React.useRef(null);
41
- const [editingMessageId, setEditingMessageId] = React.useState(null);
42
- const [feedbackMap, setFeedbackMap] = React.useState({});
43
- const handleFeedback = React.useCallback((msgId, value) => {
44
- setFeedbackMap((prev) => ({ ...prev, [msgId]: value }));
45
- onFeedback?.(msgId, value);
46
- }, [onFeedback]);
47
- const messageCount = messages.length;
18
+ export const ChatMessageList = React.forwardRef(function ChatMessageList({ messages, isLoading, renderMessage, renderTool, showSources = false, showSteps = false, showScrollButton = false, renderScrollButton, onSourceClick, inferenceMode: _inferenceMode, editMessage, getBranches, switchBranch, onFeedback, className, contentClassName, children, }, ref) {
19
+ // Stick-to-bottom: auto-scroll on new messages only while pinned, and drive
20
+ // the scroll-to-bottom button's visibility off `isAtBottom`.
21
+ const { scrollRef, contentRef, isAtBottom, scrollToBottom } = useStickToBottom(messages.length);
22
+ // Fade the top edge once the user scrolls down, so messages dissolve under
23
+ // whatever sits above the list (e.g. a borderless header) instead of a hard
24
+ // cut. Top-only: the bottom is never masked, so nothing is clipped at rest.
25
+ const [topFaded, setTopFaded] = React.useState(false);
48
26
  React.useEffect(() => {
49
- messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
50
- }, [messageCount]);
51
- return (React.createElement(MessageList, { ref: ref, className: cn("flex-1 min-h-0 overflow-y-auto relative", className) },
52
- React.createElement("div", { className: "max-w-2xl mx-auto px-4 py-6 space-y-6" },
53
- messages.map((msg) => {
54
- if (renderMessage) {
55
- return React.createElement(React.Fragment, { key: msg.id }, renderMessage(msg));
56
- }
57
- if (msg.role === "user") {
58
- return (React.createElement(UserMessage, { key: msg.id, message: msg, theme: theme, isEditing: editingMessageId === msg.id, onStartEdit: () => setEditingMessageId(msg.id), onCancelEdit: () => setEditingMessageId(null), editMessage: editMessage, getBranches: getBranches, switchBranch: switchBranch }));
59
- }
60
- return (React.createElement(AssistantMessage, { key: msg.id, message: msg, theme: theme, renderTool: renderTool, showMessageActions: showMessageActions, showSources: showSources, showSteps: showSteps, onSourceClick: onSourceClick, onFeedback: onFeedback ? handleFeedback : undefined, feedbackMap: feedbackMap }));
61
- }),
62
- isLoading && messages[messages.length - 1]?.role !== "assistant" && (React.createElement("div", { className: "flex items-start gap-3" },
63
- React.createElement(ModelAvatar, { model: model }),
64
- React.createElement("div", { className: "flex gap-1.5 items-center py-3" },
65
- React.createElement("span", { className: cn(theme?.loading) }),
66
- React.createElement("span", { className: cn(theme?.loading), style: { animationDelay: "0.15s" } }),
67
- React.createElement("span", { className: cn(theme?.loading), style: { animationDelay: "0.3s" } })))),
68
- React.createElement("div", { ref: messagesEndRef })),
69
- children,
70
- showScrollButton && (React.createElement(ConversationScrollButton, { onClick: () => messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }) }))));
27
+ const el = scrollRef.current;
28
+ if (!el)
29
+ return undefined;
30
+ const onScroll = () => setTopFaded(el.scrollTop > 8);
31
+ onScroll();
32
+ el.addEventListener("scroll", onScroll, { passive: true });
33
+ return () => el.removeEventListener("scroll", onScroll);
34
+ }, [scrollRef]);
35
+ // Merge the forwarded ref with the stick-to-bottom scroll container ref.
36
+ const setListRef = React.useCallback((node) => {
37
+ scrollRef.current = node;
38
+ if (typeof ref === "function")
39
+ ref(node);
40
+ else if (ref) {
41
+ ref.current = node;
42
+ }
43
+ }, [ref, scrollRef]);
44
+ const lastMessage = messages[messages.length - 1];
45
+ // Force-scroll to the bottom when the user submits a new message, even if
46
+ // they'd scrolled up into history. `useStickToBottom` only *follows* growth
47
+ // while already pinned, so a fresh user turn from a scrolled-up position
48
+ // would otherwise stay off-screen. Scrolling re-pins the view (the scroll
49
+ // listener flips `isAtBottom` back to true), so the streaming response then
50
+ // follows normally.
51
+ const lastUserIdRef = React.useRef(undefined);
52
+ React.useEffect(() => {
53
+ if (lastMessage?.role !== "user")
54
+ return;
55
+ if (lastMessage.id === lastUserIdRef.current)
56
+ return;
57
+ lastUserIdRef.current = lastMessage.id;
58
+ scrollToBottom("smooth");
59
+ }, [lastMessage, scrollToBottom]);
60
+ return (
61
+ // The scroll button must overlay the *visible* viewport, so it lives in a
62
+ // non-scrolling `relative` wrapper as a sibling of the scroll container —
63
+ // not inside it, where `absolute bottom-4` would anchor to the bottom of
64
+ // the full scrollable content and scroll away with the messages.
65
+ React.createElement("div", { className: cn("relative flex-1 min-h-0 flex flex-col", className) },
66
+ React.createElement(MessageList, { ref: setListRef, className: cn("flex-1 min-h-0 overflow-y-auto", topFaded && "[mask-image:linear-gradient(to_bottom,transparent,black_1.5rem)]") },
67
+ React.createElement("div", { ref: contentRef, className: cn("max-w-[850px] mx-auto px-9 py-6 space-y-6", contentClassName) },
68
+ messages.map((msg) => {
69
+ if (renderMessage) {
70
+ return (React.createElement(React.Fragment, { key: msg.id }, renderMessage(msg)));
71
+ }
72
+ // The last assistant turn shimmers while a response is streaming.
73
+ const isStreaming = Boolean(isLoading && msg === lastMessage && msg.role === "assistant");
74
+ return (React.createElement(Message, { key: msg.id, message: msg, isStreaming: isStreaming, showSources: showSources, showSteps: showSteps, editMessage: editMessage, getBranches: getBranches, switchBranch: switchBranch, onFeedback: onFeedback }, renderTool
75
+ ? (React.createElement(React.Fragment, null,
76
+ React.createElement(Message.Header, null),
77
+ React.createElement(Message.Content, { showSources: showSources, showSteps: showSteps, renderTool: renderTool, onSourceClick: onSourceClick }),
78
+ React.createElement(Message.Continuing, null),
79
+ React.createElement("div", { className: "mt-1.5 flex items-center gap-0.5" },
80
+ React.createElement(Message.Actions, null),
81
+ React.createElement(Message.Tokens, null))))
82
+ : undefined));
83
+ }),
84
+ isLoading && lastMessage?.role !== "assistant" && React.createElement(PendingMessage, null)),
85
+ children),
86
+ showScrollButton && (renderScrollButton
87
+ ? renderScrollButton({
88
+ onClick: () => scrollToBottom("smooth"),
89
+ isAtBottom,
90
+ })
91
+ : (!isAtBottom && React.createElement(ConversationScrollButton, { onClick: () => scrollToBottom("smooth") })))));
71
92
  });
72
93
  ChatMessageList.displayName = "ChatMessageList";
73
- function UserMessage({ message: msg, theme, isEditing, onStartEdit, onCancelEdit, editMessage, getBranches, switchBranch, }) {
74
- const content = getTextContent(msg);
75
- const branches = getBranches?.(msg.id);
76
- const hasBranches = branches && branches.total > 1;
77
- return (React.createElement(MessageItem, { role: msg.role, className: cn("flex flex-col items-end", "group/msg") },
78
- isEditing
79
- ? (React.createElement("div", { className: "w-full max-w-md" },
80
- React.createElement(MessageEditForm, { initialContent: content, onSave: (text) => {
81
- onCancelEdit();
82
- editMessage?.(msg.id, text);
83
- }, onCancel: onCancelEdit })))
84
- : (React.createElement("div", { className: theme?.message?.user },
85
- React.createElement("p", { className: "whitespace-pre-wrap text-[15px] leading-relaxed" }, content))),
86
- !isEditing && (React.createElement("div", { className: "flex items-center gap-2 mt-1" },
87
- hasBranches && (React.createElement(BranchPicker, { current: branches.current, total: branches.total, onPrev: () => switchBranch?.(msg.id, branches.current - 2), onNext: () => switchBranch?.(msg.id, branches.current) })),
88
- editMessage && React.createElement(MessageActions, { content: content, onEdit: onStartEdit })))));
89
- }
90
- function AssistantMessage({ message: msg, theme, renderTool, showMessageActions = true, showSources = false, showSteps = false, onSourceClick, onFeedback, feedbackMap, }) {
91
- const partGroups = groupPartsInOrder(msg.parts);
92
- const stepCount = partGroups.filter((g) => g.type === "step").length;
93
- const textContent = getTextContent(msg);
94
- const messageSources = showSources ? extractSourcesFromParts(msg.parts) : [];
95
- const identity = getAssistantIdentity(msg);
96
- return (React.createElement(MessageItem, { role: msg.role, className: cn("flex items-start gap-3", "justify-start", "group/msg") },
97
- React.createElement(AgentAvatar, { name: identity.agentName, avatarUrl: identity.agentAvatarUrl, model: identity.model }),
98
- React.createElement("div", { className: cn(theme?.message?.assistant, "flex-1 min-w-0") },
99
- identity.agentName && (React.createElement("div", { className: "mb-1 text-xs font-medium text-[var(--muted-foreground)]" }, identity.agentName)),
100
- partGroups.map((group, index) => {
101
- if (group.type === "text") {
102
- return (React.createElement(Markdown, { key: `text-${index}`, className: "text-[15px] leading-7" }, group.content));
103
- }
104
- if (group.type === "reasoning") {
105
- return (React.createElement(ReasoningCard, { key: `reasoning-${index}`, text: group.text, isStreaming: group.isStreaming }));
106
- }
107
- if (group.type === "step") {
108
- return showSteps && stepCount > 1
109
- ? (React.createElement(StepIndicator, { key: `step-${group.stepIndex}`, stepIndex: group.stepIndex, isComplete: group.isComplete }))
110
- : null;
111
- }
112
- const isSkill = isSkillToolPart(group.tool);
113
- return (React.createElement("div", { key: group.tool.toolCallId, className: isSkill ? "my-2" : "my-3" }, renderTool
114
- ? renderTool(group.tool)
115
- : isSkill
116
- ? React.createElement(SkillBadge, { tool: group.tool })
117
- : React.createElement(ToolCallCard, { tool: group.tool })));
118
- }),
119
- (showMessageActions || onFeedback) && textContent && (React.createElement("div", { className: "flex items-center gap-1 mt-1" },
120
- showMessageActions && React.createElement(MessageActions, { content: textContent }),
121
- onFeedback && (React.createElement(MessageFeedback, { messageId: msg.id, feedback: feedbackMap[msg.id], onFeedback: onFeedback })))),
122
- messageSources.length > 0 && (React.createElement(Sources, { sources: messageSources, onSourceClick: onSourceClick })))));
123
- }
@@ -28,6 +28,10 @@ export interface ChatRootProps extends Omit<React.HTMLAttributes<HTMLDivElement>
28
28
  model?: string;
29
29
  models?: ModelOption[];
30
30
  onModelChange?: (modelId: string) => void;
31
+ agent?: {
32
+ name?: string;
33
+ avatarUrl?: string;
34
+ };
31
35
  attachments?: AttachmentInfo[];
32
36
  onAttach?: (files: FileList) => void;
33
37
  onRemoveAttachment?: (id: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-root.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-root.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAItE,mCAAmC;AACnC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAG1B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,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AAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAG9C,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAGlE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGxD,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAwB;AACxB,eAAO,MAAM,QAAQ,sFAqHpB,CAAC"}
@@ -12,7 +12,7 @@ import { getDocumentNonce } from "../../csp-nonce.js";
12
12
  import { cn, defaultChatTheme, generateTokenCSS, mergeThemes } from "../../theme.js";
13
13
  import { ChatContextProvider } from "../contexts/chat-context.js";
14
14
  /** Render chat root. */
15
- export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages, isLoading = false, error = null, input, setInput, onSubmit, onStop, onReload, model, models = [], onModelChange, attachments = [], onAttach, onRemoveAttachment, editMessage, getBranches, switchBranch, onFeedback, showSources = false, onSourceClick, theme: userTheme, maxHeight = "100%", className, style, ...containerProps }, ref) {
15
+ export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages, isLoading = false, error = null, input, setInput, onSubmit, onStop, onReload, model, models = [], onModelChange, agent, attachments = [], onAttach, onRemoveAttachment, editMessage, getBranches, switchBranch, onFeedback, showSources = false, onSourceClick, theme: userTheme, maxHeight = "100%", className, style, ...containerProps }, ref) {
16
16
  const theme = React.useMemo(() => mergeThemes(defaultChatTheme, userTheme), [userTheme]);
17
17
  const nonce = getDocumentNonce();
18
18
  const tokenCSS = React.useMemo(() => generateTokenCSS(), []);
@@ -36,6 +36,7 @@ export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages,
36
36
  model,
37
37
  models,
38
38
  onModelChange,
39
+ agent,
39
40
  attachments,
40
41
  onAttach,
41
42
  onRemoveAttachment,
@@ -61,6 +62,7 @@ export const ChatRoot = React.forwardRef(function ChatRoot({ children, messages,
61
62
  model,
62
63
  models,
63
64
  onModelChange,
65
+ agent,
64
66
  attachments,
65
67
  onAttach,
66
68
  onRemoveAttachment,
@@ -9,6 +9,10 @@ export interface ErrorBannerProps {
9
9
  error: Error;
10
10
  onRetry?: () => void;
11
11
  className?: string;
12
+ /** Override the retry glyph. Defaults to the built-in refresh icon. */
13
+ icon?: React.ReactNode;
14
+ /** Label for the retry button. Defaults to "Retry". */
15
+ retryLabel?: string;
12
16
  }
13
17
  /** Render error banner. */
14
18
  export declare const ErrorBanner: React.ForwardRefExoticComponent<ErrorBannerProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"error-banner.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/error-banner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAI1D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2BAA2B;AAC3B,eAAO,MAAM,WAAW,yFAoBvB,CAAC"}
1
+ {"version":3,"file":"error-banner.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/error-banner.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAM1D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,2BAA2B;AAC3B,eAAO,MAAM,WAAW,yFAqBvB,CAAC"}
@@ -6,13 +6,16 @@
6
6
  import * as React from "../../../../../../react/react.js";
7
7
  import { cn } from "../../theme.js";
8
8
  import { RefreshCwIcon } from "../../icons/index.js";
9
+ import { Alert, AlertAction, AlertContent } from "../../ui/alert.js";
10
+ import { Button } from "../../ui/button.js";
9
11
  /** Render error banner. */
10
- export const ErrorBanner = React.forwardRef(function ErrorBanner({ error, onRetry, className }, ref) {
11
- return (React.createElement("div", { ref: ref, className: cn("max-w-2xl mx-auto px-4 pb-2", className) },
12
- React.createElement("div", { className: "px-4 py-3 bg-red-50 rounded-2xl text-red-600 text-sm flex items-center justify-between gap-3 border border-red-100" },
13
- React.createElement("span", null, error.message),
14
- onRetry && (React.createElement("button", { type: "button", onClick: onRetry, className: "inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-600 bg-red-100 hover:bg-red-200 rounded-full transition-colors" },
15
- React.createElement(RefreshCwIcon, { className: "size-3" }),
16
- "Retry")))));
12
+ export const ErrorBanner = React.forwardRef(function ErrorBanner({ error, onRetry, className, icon, retryLabel = "Retry" }, ref) {
13
+ return (React.createElement("div", { ref: ref, className: cn("max-w-2xl mx-auto px-4 pb-3", className) },
14
+ React.createElement(Alert, { variant: "error" },
15
+ React.createElement(AlertContent, null, error.message),
16
+ onRetry && (React.createElement(AlertAction, null,
17
+ React.createElement(Button, { variant: "link", size: "sm", onClick: onRetry },
18
+ icon ?? React.createElement(RefreshCwIcon, { className: "size-3.5" }),
19
+ retryLabel))))));
17
20
  });
18
21
  ErrorBanner.displayName = "ErrorBanner";