veryfront 0.1.997 → 0.1.999

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 (386) hide show
  1. package/esm/cli/templates/manifest.d.ts +1 -1
  2. package/esm/cli/templates/manifest.js +15 -15
  3. package/esm/deno.d.ts +7 -0
  4. package/esm/deno.js +11 -3
  5. package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +2 -0
  6. package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +1 -0
  7. package/esm/deps/esm.sh/react-dom@19.2.4.js +3 -0
  8. package/esm/react/react-dom.d.ts +3 -0
  9. package/esm/react/react-dom.d.ts.map +1 -0
  10. package/esm/react/react-dom.js +2 -0
  11. package/esm/src/agent/ag-ui/host-support.d.ts.map +1 -1
  12. package/esm/src/agent/ag-ui/host-support.js +12 -0
  13. package/esm/src/agent/react/index.d.ts +4 -2
  14. package/esm/src/agent/react/index.d.ts.map +1 -1
  15. package/esm/src/agent/react/index.js +2 -1
  16. package/esm/src/agent/react/use-agent-metadata.d.ts +5 -0
  17. package/esm/src/agent/react/use-agent-metadata.d.ts.map +1 -1
  18. package/esm/src/agent/react/use-agent-metadata.js +18 -9
  19. package/esm/src/agent/react/use-agents.d.ts +33 -0
  20. package/esm/src/agent/react/use-agents.d.ts.map +1 -0
  21. package/esm/src/agent/react/use-agents.js +72 -0
  22. package/esm/src/agent/react/use-chat/index.d.ts +1 -1
  23. package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
  24. package/esm/src/agent/react/use-chat/types.d.ts +3 -2
  25. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  26. package/esm/src/agent/react/use-chat/use-chat.d.ts +12 -1
  27. package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
  28. package/esm/src/agent/react/use-chat/use-chat.js +47 -7
  29. package/esm/src/agent/react/use-chat/utils.d.ts.map +1 -1
  30. package/esm/src/agent/react/use-chat/utils.js +4 -0
  31. package/esm/src/agent/runtime/message-adapter.d.ts.map +1 -1
  32. package/esm/src/agent/runtime/message-adapter.js +3 -1
  33. package/esm/src/agent/runtime/text-generation-runtime-message-converter.d.ts.map +1 -1
  34. package/esm/src/agent/runtime/text-generation-runtime-message-converter.js +6 -2
  35. package/esm/src/chat/index.d.ts +17 -7
  36. package/esm/src/chat/index.d.ts.map +1 -1
  37. package/esm/src/chat/index.js +33 -7
  38. package/esm/src/chat/protocol.d.ts +13 -1
  39. package/esm/src/chat/protocol.d.ts.map +1 -1
  40. package/esm/src/chat/upload-handler.d.ts +55 -0
  41. package/esm/src/chat/upload-handler.d.ts.map +1 -0
  42. package/esm/src/chat/upload-handler.js +180 -0
  43. package/esm/src/discovery/import-rewriter.d.ts +1 -1
  44. package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
  45. package/esm/src/discovery/import-rewriter.js +2 -0
  46. package/esm/src/discovery/transpiler.d.ts.map +1 -1
  47. package/esm/src/discovery/transpiler.js +2 -0
  48. package/esm/src/embedding/index.d.ts +0 -2
  49. package/esm/src/embedding/index.d.ts.map +1 -1
  50. package/esm/src/embedding/index.js +0 -1
  51. package/esm/src/embedding/upload-handler.d.ts +2 -13
  52. package/esm/src/embedding/upload-handler.d.ts.map +1 -1
  53. package/esm/src/embedding/upload-handler.js +24 -17
  54. package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
  55. package/esm/src/modules/import-map/default-import-map.js +0 -5
  56. package/esm/src/react/components/chat/agent-card.d.ts +84 -11
  57. package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
  58. package/esm/src/react/components/chat/agent-card.js +151 -57
  59. package/esm/src/react/components/chat/agent-picker.d.ts +166 -0
  60. package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -0
  61. package/esm/src/react/components/chat/agent-picker.js +183 -0
  62. package/esm/src/react/components/chat/chat/components/animations.js +1 -1
  63. package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +125 -3
  64. package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
  65. package/esm/src/react/components/chat/chat/components/attachment-pill.js +209 -25
  66. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +149 -0
  67. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -0
  68. package/esm/src/react/components/chat/chat/components/attachments-panel.js +187 -0
  69. package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +13 -2
  70. package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
  71. package/esm/src/react/components/chat/chat/components/branch-picker.js +6 -8
  72. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +20 -0
  73. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -0
  74. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +31 -0
  75. package/esm/src/react/components/chat/chat/components/code-block.d.ts +9 -1
  76. package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
  77. package/esm/src/react/components/chat/chat/components/code-block.js +14 -6
  78. package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +11 -4
  79. package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
  80. package/esm/src/react/components/chat/chat/components/drop-zone.js +10 -8
  81. package/esm/src/react/components/chat/chat/components/empty-state.d.ts +2 -1
  82. package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
  83. package/esm/src/react/components/chat/chat/components/empty-state.js +7 -8
  84. package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +6 -2
  85. package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
  86. package/esm/src/react/components/chat/chat/components/inference-badge.js +5 -4
  87. package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +9 -1
  88. package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
  89. package/esm/src/react/components/chat/chat/components/inline-citation.js +19 -20
  90. package/esm/src/react/components/chat/chat/components/message-actions.d.ts +28 -5
  91. package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
  92. package/esm/src/react/components/chat/chat/components/message-actions.js +24 -36
  93. package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +7 -2
  94. package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
  95. package/esm/src/react/components/chat/chat/components/message-edit-form.js +5 -5
  96. package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +11 -1
  97. package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
  98. package/esm/src/react/components/chat/chat/components/message-feedback.js +9 -11
  99. package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
  100. package/esm/src/react/components/chat/chat/components/quick-actions.js +3 -1
  101. package/esm/src/react/components/chat/chat/components/reasoning.d.ts +66 -3
  102. package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
  103. package/esm/src/react/components/chat/chat/components/reasoning.js +95 -21
  104. package/esm/src/react/components/chat/chat/components/sidebar.d.ts +178 -12
  105. package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
  106. package/esm/src/react/components/chat/chat/components/sidebar.js +228 -45
  107. package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +6 -1
  108. package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
  109. package/esm/src/react/components/chat/chat/components/skill-badge.js +6 -5
  110. package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +37 -0
  111. package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -0
  112. package/esm/src/react/components/chat/chat/components/skill-tool.js +46 -0
  113. package/esm/src/react/components/chat/chat/components/sources.d.ts +55 -3
  114. package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
  115. package/esm/src/react/components/chat/chat/components/sources.js +50 -16
  116. package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +42 -3
  117. package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
  118. package/esm/src/react/components/chat/chat/components/step-indicator.js +55 -12
  119. package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
  120. package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
  121. package/esm/src/react/components/chat/chat/components/tab-switcher.js +3 -3
  122. package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +96 -3
  123. package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
  124. package/esm/src/react/components/chat/chat/components/tool-ui.js +158 -36
  125. package/esm/src/react/components/chat/chat/composition/api.d.ts +4 -2
  126. package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
  127. package/esm/src/react/components/chat/chat/composition/api.js +4 -2
  128. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +112 -5
  129. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
  130. package/esm/src/react/components/chat/chat/composition/chat-composer.js +251 -61
  131. package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +78 -0
  132. package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -0
  133. package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +63 -0
  134. package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +4 -1
  135. package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
  136. package/esm/src/react/components/chat/chat/composition/chat-empty.js +11 -10
  137. package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +11 -3
  138. package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
  139. package/esm/src/react/components/chat/chat/composition/chat-message-list.js +81 -111
  140. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +4 -0
  141. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
  142. package/esm/src/react/components/chat/chat/composition/chat-root.js +3 -1
  143. package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +4 -0
  144. package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
  145. package/esm/src/react/components/chat/chat/composition/error-banner.js +10 -7
  146. package/esm/src/react/components/chat/chat/composition/message.d.ts +123 -5
  147. package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
  148. package/esm/src/react/components/chat/chat/composition/message.js +332 -53
  149. package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +6 -1
  150. package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
  151. package/esm/src/react/components/chat/chat/composition/model-avatar.js +3 -4
  152. package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +31 -0
  153. package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -0
  154. package/esm/src/react/components/chat/chat/composition/pending-message.js +31 -0
  155. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +4 -0
  156. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
  157. package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +1 -0
  158. package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
  159. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +29 -0
  160. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -0
  161. package/esm/src/react/components/chat/chat/contexts/conversations-context.js +39 -0
  162. package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
  163. package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
  164. package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
  165. package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +2 -0
  166. package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
  167. package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts +10 -0
  168. package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts.map +1 -0
  169. package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +34 -0
  170. package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts +21 -0
  171. package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts.map +1 -0
  172. package/esm/src/react/components/chat/chat/hooks/use-conversation.js +54 -0
  173. package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts +67 -0
  174. package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -0
  175. package/esm/src/react/components/chat/chat/hooks/use-conversations.js +317 -0
  176. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +27 -0
  177. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -0
  178. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +50 -0
  179. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +49 -0
  180. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -0
  181. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +120 -0
  182. package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts +34 -0
  183. package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts.map +1 -0
  184. package/esm/src/react/components/chat/chat/hooks/use-upload.js +147 -0
  185. package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts +37 -0
  186. package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts.map +1 -0
  187. package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +178 -0
  188. package/esm/src/react/components/chat/chat/index.d.ts +171 -31
  189. package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
  190. package/esm/src/react/components/chat/chat/index.js +371 -77
  191. package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts +63 -0
  192. package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts.map +1 -0
  193. package/esm/src/react/components/chat/chat/persistence/conversation-store.js +1 -0
  194. package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts +13 -0
  195. package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts.map +1 -0
  196. package/esm/src/react/components/chat/chat/persistence/local-conversation-store.js +102 -0
  197. package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts +11 -0
  198. package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts.map +1 -0
  199. package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.js +33 -0
  200. package/esm/src/react/components/chat/chat/utils/message-parts.d.ts +4 -1
  201. package/esm/src/react/components/chat/chat/utils/message-parts.d.ts.map +1 -1
  202. package/esm/src/react/components/chat/chat/utils/message-parts.js +4 -0
  203. package/esm/src/react/components/chat/chat-actions.d.ts +164 -0
  204. package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -0
  205. package/esm/src/react/components/chat/chat-actions.js +191 -0
  206. package/esm/src/react/components/chat/chat-agent-picker.d.ts +50 -0
  207. package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -0
  208. package/esm/src/react/components/chat/chat-agent-picker.js +40 -0
  209. package/esm/src/react/components/chat/chat-theme-scope.d.ts +26 -0
  210. package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -0
  211. package/esm/src/react/components/chat/chat-theme-scope.js +27 -0
  212. package/esm/src/react/components/chat/chat-tokens-style.d.ts +21 -0
  213. package/esm/src/react/components/chat/chat-tokens-style.d.ts.map +1 -0
  214. package/esm/src/react/components/chat/chat-tokens-style.js +24 -0
  215. package/esm/src/react/components/chat/chat.d.ts +5 -5
  216. package/esm/src/react/components/chat/chat.d.ts.map +1 -1
  217. package/esm/src/react/components/chat/chat.js +5 -5
  218. package/esm/src/react/components/chat/color-mode.d.ts +46 -0
  219. package/esm/src/react/components/chat/color-mode.d.ts.map +1 -0
  220. package/esm/src/react/components/chat/color-mode.js +123 -0
  221. package/esm/src/react/components/chat/error-boundary.js +2 -2
  222. package/esm/src/react/components/chat/icons/index.d.ts +8 -0
  223. package/esm/src/react/components/chat/icons/index.d.ts.map +1 -1
  224. package/esm/src/react/components/chat/icons/index.js +64 -0
  225. package/esm/src/react/components/chat/markdown.d.ts +24 -1
  226. package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
  227. package/esm/src/react/components/chat/markdown.js +122 -38
  228. package/esm/src/react/components/chat/model-selector.d.ts +130 -8
  229. package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
  230. package/esm/src/react/components/chat/model-selector.js +148 -121
  231. package/esm/src/react/components/chat/theme.d.ts +9 -12
  232. package/esm/src/react/components/chat/theme.d.ts.map +1 -1
  233. package/esm/src/react/components/chat/theme.js +149 -93
  234. package/esm/src/react/components/chat/ui/alert.d.ts +30 -0
  235. package/esm/src/react/components/chat/ui/alert.d.ts.map +1 -0
  236. package/esm/src/react/components/chat/ui/alert.js +35 -0
  237. package/esm/src/react/components/chat/ui/app-shell.d.ts +155 -0
  238. package/esm/src/react/components/chat/ui/app-shell.d.ts.map +1 -0
  239. package/esm/src/react/components/chat/ui/app-shell.js +276 -0
  240. package/esm/src/react/components/chat/ui/avatar.d.ts +24 -0
  241. package/esm/src/react/components/chat/ui/avatar.d.ts.map +1 -0
  242. package/esm/src/react/components/chat/ui/avatar.js +44 -0
  243. package/esm/src/react/components/chat/ui/badge.d.ts +24 -0
  244. package/esm/src/react/components/chat/ui/badge.d.ts.map +1 -0
  245. package/esm/src/react/components/chat/ui/badge.js +30 -0
  246. package/esm/src/react/components/chat/ui/button.d.ts +44 -0
  247. package/esm/src/react/components/chat/ui/button.d.ts.map +1 -0
  248. package/esm/src/react/components/chat/ui/button.js +108 -0
  249. package/esm/src/react/components/chat/ui/card.d.ts +42 -0
  250. package/esm/src/react/components/chat/ui/card.d.ts.map +1 -0
  251. package/esm/src/react/components/chat/ui/card.js +55 -0
  252. package/esm/src/react/components/chat/ui/checkbox.d.ts +28 -0
  253. package/esm/src/react/components/chat/ui/checkbox.d.ts.map +1 -0
  254. package/esm/src/react/components/chat/ui/checkbox.js +36 -0
  255. package/esm/src/react/components/chat/ui/code-block.d.ts +89 -0
  256. package/esm/src/react/components/chat/ui/code-block.d.ts.map +1 -0
  257. package/esm/src/react/components/chat/ui/code-block.js +277 -0
  258. package/esm/src/react/components/chat/ui/collapsible.d.ts +30 -0
  259. package/esm/src/react/components/chat/ui/collapsible.d.ts.map +1 -0
  260. package/esm/src/react/components/chat/ui/collapsible.js +44 -0
  261. package/esm/src/react/components/chat/ui/command.d.ts +65 -0
  262. package/esm/src/react/components/chat/ui/command.d.ts.map +1 -0
  263. package/esm/src/react/components/chat/ui/command.js +121 -0
  264. package/esm/src/react/components/chat/ui/cva.d.ts +36 -0
  265. package/esm/src/react/components/chat/ui/cva.d.ts.map +1 -0
  266. package/esm/src/react/components/chat/ui/cva.js +45 -0
  267. package/esm/src/react/components/chat/ui/dialog.d.ts +55 -0
  268. package/esm/src/react/components/chat/ui/dialog.d.ts.map +1 -0
  269. package/esm/src/react/components/chat/ui/dialog.js +116 -0
  270. package/esm/src/react/components/chat/ui/drawer.d.ts +41 -0
  271. package/esm/src/react/components/chat/ui/drawer.d.ts.map +1 -0
  272. package/esm/src/react/components/chat/ui/drawer.js +92 -0
  273. package/esm/src/react/components/chat/ui/dropdown-menu.d.ts +63 -0
  274. package/esm/src/react/components/chat/ui/dropdown-menu.d.ts.map +1 -0
  275. package/esm/src/react/components/chat/ui/dropdown-menu.js +76 -0
  276. package/esm/src/react/components/chat/ui/file-type.d.ts +26 -0
  277. package/esm/src/react/components/chat/ui/file-type.d.ts.map +1 -0
  278. package/esm/src/react/components/chat/ui/file-type.js +235 -0
  279. package/esm/src/react/components/chat/ui/floating.d.ts +29 -0
  280. package/esm/src/react/components/chat/ui/floating.d.ts.map +1 -0
  281. package/esm/src/react/components/chat/ui/floating.js +90 -0
  282. package/esm/src/react/components/chat/ui/icon-button.d.ts +19 -0
  283. package/esm/src/react/components/chat/ui/icon-button.d.ts.map +1 -0
  284. package/esm/src/react/components/chat/ui/icon-button.js +20 -0
  285. package/esm/src/react/components/chat/ui/index.d.ts +43 -0
  286. package/esm/src/react/components/chat/ui/index.d.ts.map +1 -0
  287. package/esm/src/react/components/chat/ui/index.js +42 -0
  288. package/esm/src/react/components/chat/ui/input.d.ts +27 -0
  289. package/esm/src/react/components/chat/ui/input.d.ts.map +1 -0
  290. package/esm/src/react/components/chat/ui/input.js +41 -0
  291. package/esm/src/react/components/chat/ui/label.d.ts +29 -0
  292. package/esm/src/react/components/chat/ui/label.d.ts.map +1 -0
  293. package/esm/src/react/components/chat/ui/label.js +40 -0
  294. package/esm/src/react/components/chat/ui/list.d.ts +47 -0
  295. package/esm/src/react/components/chat/ui/list.d.ts.map +1 -0
  296. package/esm/src/react/components/chat/ui/list.js +40 -0
  297. package/esm/src/react/components/chat/ui/pill.d.ts +26 -0
  298. package/esm/src/react/components/chat/ui/pill.d.ts.map +1 -0
  299. package/esm/src/react/components/chat/ui/pill.js +39 -0
  300. package/esm/src/react/components/chat/ui/popover.d.ts +47 -0
  301. package/esm/src/react/components/chat/ui/popover.d.ts.map +1 -0
  302. package/esm/src/react/components/chat/ui/popover.js +68 -0
  303. package/esm/src/react/components/chat/ui/progress-bar.d.ts +20 -0
  304. package/esm/src/react/components/chat/ui/progress-bar.d.ts.map +1 -0
  305. package/esm/src/react/components/chat/ui/progress-bar.js +31 -0
  306. package/esm/src/react/components/chat/ui/radio.d.ts +25 -0
  307. package/esm/src/react/components/chat/ui/radio.d.ts.map +1 -0
  308. package/esm/src/react/components/chat/ui/radio.js +29 -0
  309. package/esm/src/react/components/chat/ui/scroll-fade.d.ts +23 -0
  310. package/esm/src/react/components/chat/ui/scroll-fade.d.ts.map +1 -0
  311. package/esm/src/react/components/chat/ui/scroll-fade.js +40 -0
  312. package/esm/src/react/components/chat/ui/select.d.ts +64 -0
  313. package/esm/src/react/components/chat/ui/select.d.ts.map +1 -0
  314. package/esm/src/react/components/chat/ui/select.js +148 -0
  315. package/esm/src/react/components/chat/ui/shimmer.d.ts +25 -0
  316. package/esm/src/react/components/chat/ui/shimmer.d.ts.map +1 -0
  317. package/esm/src/react/components/chat/ui/shimmer.js +24 -0
  318. package/esm/src/react/components/chat/ui/skeleton.d.ts +14 -0
  319. package/esm/src/react/components/chat/ui/skeleton.d.ts.map +1 -0
  320. package/esm/src/react/components/chat/ui/skeleton.js +12 -0
  321. package/esm/src/react/components/chat/ui/slot.d.ts +21 -0
  322. package/esm/src/react/components/chat/ui/slot.d.ts.map +1 -0
  323. package/esm/src/react/components/chat/ui/slot.js +70 -0
  324. package/esm/src/react/components/chat/ui/status.d.ts +28 -0
  325. package/esm/src/react/components/chat/ui/status.d.ts.map +1 -0
  326. package/esm/src/react/components/chat/ui/status.js +23 -0
  327. package/esm/src/react/components/chat/ui/switch.d.ts +34 -0
  328. package/esm/src/react/components/chat/ui/switch.d.ts.map +1 -0
  329. package/esm/src/react/components/chat/ui/switch.js +58 -0
  330. package/esm/src/react/components/chat/ui/tabs.d.ts +44 -0
  331. package/esm/src/react/components/chat/ui/tabs.d.ts.map +1 -0
  332. package/esm/src/react/components/chat/ui/tabs.js +51 -0
  333. package/esm/src/react/components/chat/ui/tag.d.ts +22 -0
  334. package/esm/src/react/components/chat/ui/tag.d.ts.map +1 -0
  335. package/esm/src/react/components/chat/ui/tag.js +27 -0
  336. package/esm/src/react/components/chat/ui/textarea.d.ts +22 -0
  337. package/esm/src/react/components/chat/ui/textarea.d.ts.map +1 -0
  338. package/esm/src/react/components/chat/ui/textarea.js +35 -0
  339. package/esm/src/react/components/chat/ui/tooltip.d.ts +40 -0
  340. package/esm/src/react/components/chat/ui/tooltip.d.ts.map +1 -0
  341. package/esm/src/react/components/chat/ui/tooltip.js +132 -0
  342. package/esm/src/react/primitives/input-box.d.ts.map +1 -1
  343. package/esm/src/react/primitives/input-box.js +17 -4
  344. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  345. package/esm/src/server/handlers/dev/framework-candidates.generated.js +9437 -1064
  346. package/esm/src/server/handlers/dev/projects/html-shell.d.ts +1 -1
  347. package/esm/src/server/handlers/dev/projects/html-shell.d.ts.map +1 -1
  348. package/esm/src/server/handlers/dev/projects/html-shell.js +1 -12
  349. package/esm/src/server/handlers/request/public-agents-list.handler.d.ts +18 -0
  350. package/esm/src/server/handlers/request/public-agents-list.handler.d.ts.map +1 -0
  351. package/esm/src/server/handlers/request/public-agents-list.handler.js +44 -0
  352. package/esm/src/server/runtime-handler/index.d.ts +1 -1
  353. package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
  354. package/esm/src/server/runtime-handler/index.js +3 -0
  355. package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
  356. package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
  357. package/esm/src/studio/bridge/bridge-bundle.generated.js +3 -2
  358. package/esm/src/utils/version-constant.d.ts +1 -1
  359. package/esm/src/utils/version-constant.js +1 -1
  360. package/esm/src/workflow/blob/local-storage.d.ts +32 -0
  361. package/esm/src/workflow/blob/local-storage.d.ts.map +1 -0
  362. package/esm/src/workflow/blob/local-storage.js +179 -0
  363. package/esm/src/workflow/blob/types.d.ts +5 -0
  364. package/esm/src/workflow/blob/types.d.ts.map +1 -1
  365. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +11 -0
  366. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -1
  367. package/esm/src/workflow/blob/veryfront-cloud-storage.js +36 -0
  368. package/package.json +5 -1
  369. package/esm/src/embedding/react/use-uploads.d.ts +0 -33
  370. package/esm/src/embedding/react/use-uploads.d.ts.map +0 -1
  371. package/esm/src/embedding/react/use-uploads.js +0 -76
  372. package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts +0 -20
  373. package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +0 -1
  374. package/esm/src/react/components/chat/chat/components/uploads-panel.js +0 -49
  375. package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts +0 -28
  376. package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +0 -1
  377. package/esm/src/react/components/chat/chat/contexts/thread-list-context.js +0 -27
  378. package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts +0 -28
  379. package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +0 -1
  380. package/esm/src/react/components/chat/chat/hooks/use-threads.js +0 -151
  381. package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -110
  382. package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +0 -1
  383. package/esm/src/react/components/chat/chat-with-sidebar.js +0 -167
  384. package/esm/src/react/components/chat/message.d.ts +0 -42
  385. package/esm/src/react/components/chat/message.d.ts.map +0 -1
  386. package/esm/src/react/components/chat/message.js +0 -69
@@ -1,7 +1,7 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  import { cn } from "../../theme.js";
3
3
  /** Render inline citation. */
4
- export function InlineCitation({ index, source, className, onClick, }) {
4
+ export function InlineCitation({ index, source, className, onClick, renderCard, cardClassName, }) {
5
5
  const [showCard, setShowCard] = React.useState(false);
6
6
  const timerRef = React.useRef(undefined);
7
7
  const buttonRef = React.useRef(null);
@@ -30,30 +30,29 @@ export function InlineCitation({ index, source, className, onClick, }) {
30
30
  React.useEffect(() => () => clearTimeout(timerRef.current), []);
31
31
  return (React.createElement(React.Fragment, null,
32
32
  React.createElement("span", { className: "relative inline-block" },
33
- React.createElement("button", { ref: buttonRef, type: "button", onClick: () => onClick?.(index), onMouseEnter: show, onMouseLeave: hide, className: cn("inline-flex items-center justify-center", "size-4 rounded text-[10px] font-medium leading-none", "bg-[var(--border)] text-[var(--card-foreground)]", "hover:bg-[var(--accent)] transition-colors", "align-super -translate-y-0.5 mx-0.5", className) }, index + 1)),
34
- showCard && source && (React.createElement("div", { style: cardStyle, className: "w-80 animate-in fade-in duration-150", onMouseEnter: show, onMouseLeave: hide },
35
- React.createElement("div", { className: "bg-[var(--card)] border border-[var(--border)] rounded-xl shadow-xl p-3.5 text-left" },
36
- React.createElement("div", { className: "flex items-start gap-2" },
37
- React.createElement("span", { className: "flex-shrink-0 flex items-center justify-center size-5 rounded bg-[var(--border)] text-[10px] font-bold text-[var(--card-foreground)] mt-0.5" }, index + 1),
38
- React.createElement("div", { className: "min-w-0 flex-1" },
39
- React.createElement("p", { className: "text-sm font-medium text-[var(--foreground)] line-clamp-2" }, source.title),
40
- source.url && (React.createElement("p", { className: "text-[10px] text-[var(--muted-foreground)] truncate mt-0.5 flex items-center gap-1" },
41
- React.createElement("svg", { className: "size-2.5 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" },
42
- React.createElement("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
43
- React.createElement("polyline", { points: "15 3 21 3 21 9" }),
44
- React.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" })),
45
- source.url)))),
46
- source.snippet && (React.createElement("div", { className: "mt-2.5 pl-3 border-l-2 border-[var(--border)]" },
47
- React.createElement("p", { className: "text-xs text-[var(--card-foreground)] line-clamp-4 leading-relaxed italic" }, source.snippet))),
33
+ React.createElement("button", { ref: buttonRef, type: "button", onClick: () => onClick?.(index), onMouseEnter: show, onMouseLeave: hide, className: cn("inline-flex items-center justify-center", "size-[15px] rounded-full border border-[var(--outline-border)] text-[10px] font-semibold leading-none tabular-nums", "bg-[var(--secondary)] text-[var(--soft)] shadow-sm", "hover:border-[var(--faint)] hover:text-[var(--foreground)] transition-colors", "cursor-pointer align-super -translate-y-px ml-0.5", className) }, index + 1)),
34
+ showCard && source && (React.createElement("div", { style: cardStyle, className: cn("w-80 animate-in fade-in duration-150", cardClassName), onMouseEnter: show, onMouseLeave: hide }, renderCard
35
+ ? renderCard(source, index)
36
+ : (React.createElement("div", { className: "rounded-lg bg-[var(--popover)] p-3.5 text-left shadow-sm" },
37
+ React.createElement("div", { className: "min-w-0" },
38
+ React.createElement("p", { className: "text-sm font-medium text-[var(--foreground)] line-clamp-2" }, source.title),
39
+ source.url && (React.createElement("p", { className: "text-[10px] text-[var(--faint)] truncate mt-1 flex items-center gap-1" },
40
+ React.createElement("svg", { className: "size-2.5 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" },
41
+ React.createElement("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
42
+ React.createElement("polyline", { points: "15 3 21 3 21 9" }),
43
+ React.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" })),
44
+ source.url))),
45
+ source.snippet && (React.createElement("div", { className: "mt-2.5 border-l-2 border-[var(--outline-border)] pl-3" },
46
+ React.createElement("p", { className: "text-xs text-[var(--foreground)] line-clamp-4 leading-relaxed italic" }, source.snippet))),
48
47
  source.score != null && (React.createElement("div", { className: "mt-2.5 flex items-center gap-2" },
49
- React.createElement("span", { className: "text-[10px] text-[var(--input-placeholder)] shrink-0" }, "Relevance"),
50
- React.createElement("div", { className: "flex-1 h-1 rounded-full bg-[var(--border)] overflow-hidden" },
48
+ React.createElement("span", { className: "text-[10px] text-[var(--faint)] shrink-0" }, "Relevance"),
49
+ React.createElement("div", { className: "flex-1 h-1 rounded-full bg-[var(--edge-medium)] overflow-hidden" },
51
50
  React.createElement("div", { className: cn("h-full rounded-full transition-all", source.score >= 0.7
52
51
  ? "bg-emerald-500"
53
52
  : source.score >= 0.4
54
53
  ? "bg-amber-500"
55
54
  : "bg-neutral-400"), style: { width: `${Math.round(source.score * 100)}%` } })),
56
- React.createElement("span", { className: "text-[10px] tabular-nums text-[var(--input-placeholder)]" },
55
+ React.createElement("span", { className: "text-[10px] tabular-nums text-[var(--faint)]" },
57
56
  Math.round(source.score * 100),
58
- "%"))))))));
57
+ "%")))))))));
59
58
  }
@@ -1,11 +1,34 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
- /** Props accepted by message actions. */
3
- export interface MessageActionsProps {
2
+ /**
3
+ * Icon overrides for {@link MessageActionBar}. Each defaults to the built-in
4
+ * glyph; `copied` shows briefly after a successful copy.
5
+ */
6
+ export interface MessageActionBarIcons {
7
+ copy?: React.ReactNode;
8
+ copied?: React.ReactNode;
9
+ edit?: React.ReactNode;
10
+ regenerate?: React.ReactNode;
11
+ }
12
+ /** Props accepted by the context-free message action bar. */
13
+ export interface MessageActionBarProps {
4
14
  content: string;
5
15
  className?: string;
6
- /** When provided, renders an edit button that calls this handler */
16
+ /** Override any of the action icons. */
17
+ icons?: MessageActionBarIcons;
18
+ /** Wrap the built-in copy; call `next()` to run it (or skip it). */
19
+ onCopy?: (event: React.MouseEvent<HTMLButtonElement>, next: () => void) => void;
20
+ /** When provided, renders an edit button that calls this handler. */
7
21
  onEdit?: (content: string) => void;
22
+ /** When provided, renders a regenerate button that calls this handler. */
23
+ onRegenerate?: () => void;
8
24
  }
9
- /** Render message actions. */
10
- export declare const MessageActions: React.ForwardRefExoticComponent<MessageActionsProps & React.RefAttributes<HTMLDivElement>>;
25
+ /**
26
+ * MessageActionBar the low-level, context-free hover action bar (copy / edit /
27
+ * regenerate). Used where there is no `Message.Root` context (e.g. the legacy
28
+ * message-list row). Inside a `Message`, prefer `Message.Actions` +
29
+ * `Message.CopyAction`/… which read from context.
30
+ *
31
+ * Renamed from `MessageActions` to end the collision with `Message.Actions`.
32
+ */
33
+ export declare const MessageActionBar: React.ForwardRefExoticComponent<MessageActionBarProps & React.RefAttributes<HTMLDivElement>>;
11
34
  //# sourceMappingURL=message-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-actions.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/message-actions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAO1D,yCAAyC;AACzC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,8BAA8B;AAC9B,eAAO,MAAM,cAAc,4FAuE1B,CAAC"}
1
+ {"version":3,"file":"message-actions.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/message-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAQ1D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,6DAA6D;AAC7D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,oEAAoE;IACpE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAChF,qEAAqE;IACrE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,8FAyD5B,CAAC"}
@@ -1,39 +1,27 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  import { cn } from "../../theme.js";
3
- import { CheckIcon, CopyIcon } from "../../icons/index.js";
4
- const ACTION_BUTTON = "inline-flex items-center justify-center size-7 text-[var(--input-placeholder)] hover:text-[var(--foreground)] hover:bg-[var(--foreground)]/5 rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2";
5
- /** Render message actions. */
6
- export const MessageActions = React.forwardRef(function MessageActions({ content, className, onEdit }, ref) {
7
- const [copied, setCopied] = React.useState(false);
8
- const setCopiedWithTimeout = React.useCallback(() => {
9
- setCopied(true);
10
- globalThis.setTimeout(() => setCopied(false), 2000);
11
- }, []);
12
- const fallbackCopy = React.useCallback(() => {
13
- const textarea = document.createElement("textarea");
14
- textarea.value = content;
15
- document.body.appendChild(textarea);
16
- textarea.select();
17
- document.execCommand("copy");
18
- document.body.removeChild(textarea);
19
- }, [content]);
20
- const handleCopy = React.useCallback(async () => {
21
- try {
22
- await navigator.clipboard.writeText(content);
23
- }
24
- catch (_) {
25
- /* expected: clipboard API unavailable in older browsers */
26
- fallbackCopy();
27
- }
28
- finally {
29
- setCopiedWithTimeout();
30
- }
31
- }, [content, fallbackCopy, setCopiedWithTimeout]);
32
- return (React.createElement("div", { ref: ref, className: cn("flex items-center gap-0.5 mt-1.5 opacity-0 group-hover/msg:opacity-100 transition-all duration-200", className) },
33
- React.createElement("button", { type: "button", onClick: handleCopy, className: ACTION_BUTTON, title: copied ? "Copied!" : "Copy to clipboard", "aria-label": copied ? "Copied!" : "Copy to clipboard" }, copied ? React.createElement(CheckIcon, { className: "size-3.5" }) : React.createElement(CopyIcon, { className: "size-3.5" })),
34
- onEdit && (React.createElement("button", { type: "button", onClick: () => onEdit(content), className: ACTION_BUTTON, title: "Edit message", "aria-label": "Edit message" },
35
- React.createElement("svg", { className: "size-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
36
- React.createElement("path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" }),
37
- React.createElement("path", { d: "m15 5 4 4" }))))));
3
+ import { CheckIcon, CopyIcon, PencilIcon, RefreshCwIcon } from "../../icons/index.js";
4
+ import { useClipboard } from "../hooks/use-clipboard.js";
5
+ const ACTION_BUTTON = "inline-flex items-center justify-center size-7 rounded-full text-[var(--faint)] transition-colors hover:bg-[var(--tertiary)] hover:text-[var(--foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--edge-medium)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--background)]";
6
+ /**
7
+ * MessageActionBar — the low-level, context-free hover action bar (copy / edit /
8
+ * regenerate). Used where there is no `Message.Root` context (e.g. the legacy
9
+ * message-list row). Inside a `Message`, prefer `Message.Actions` +
10
+ * `Message.CopyAction`/… which read from context.
11
+ *
12
+ * Renamed from `MessageActions` to end the collision with `Message.Actions`.
13
+ */
14
+ export const MessageActionBar = React.forwardRef(function MessageActionBar({ content, className, icons, onCopy, onEdit, onRegenerate }, ref) {
15
+ const { copied, copy } = useClipboard();
16
+ const doCopy = React.useCallback(() => void copy(content), [copy, content]);
17
+ return (React.createElement("div", { ref: ref, className: cn(
18
+ // No vertical margin here — the footer row owns spacing/alignment so
19
+ // the buttons stay centered with the token count beside them.
20
+ "flex items-center gap-0.5 opacity-0 group-hover/msg:opacity-100 transition-all duration-200", className) },
21
+ React.createElement("button", { type: "button", onClick: (e) => (onCopy ? onCopy(e, doCopy) : doCopy()), className: ACTION_BUTTON, title: copied ? "Copied!" : "Copy to clipboard", "aria-label": copied ? "Copied!" : "Copy to clipboard" }, copied
22
+ ? (icons?.copied ?? React.createElement(CheckIcon, { className: "size-3.5" }))
23
+ : (icons?.copy ?? React.createElement(CopyIcon, { className: "size-3.5" }))),
24
+ onRegenerate && (React.createElement("button", { type: "button", onClick: onRegenerate, className: ACTION_BUTTON, title: "Regenerate response", "aria-label": "Regenerate response" }, icons?.regenerate ?? React.createElement(RefreshCwIcon, { className: "size-3.5" }))),
25
+ onEdit && (React.createElement("button", { type: "button", onClick: () => onEdit(content), className: ACTION_BUTTON, title: "Edit message", "aria-label": "Edit message" }, icons?.edit ?? React.createElement(PencilIcon, { className: "size-3.5" })))));
38
26
  });
39
- MessageActions.displayName = "MessageActions";
27
+ MessageActionBar.displayName = "MessageActionBar";
@@ -1,10 +1,15 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  /** Props accepted by message edit form. */
3
- export interface MessageEditFormProps {
3
+ export interface MessageEditFormProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "className"> {
4
4
  initialContent: string;
5
5
  onSave: (content: string) => void;
6
6
  onCancel: () => void;
7
+ className?: string;
8
+ /** Label for the save/submit button. Defaults to "Save & Submit". */
9
+ saveLabel?: string;
10
+ /** Label for the cancel button. Defaults to "Cancel". */
11
+ cancelLabel?: string;
7
12
  }
8
13
  /** Render message edit form. */
9
- export declare function MessageEditForm({ initialContent, onSave, onCancel, }: MessageEditFormProps): React.ReactElement;
14
+ export declare function MessageEditForm({ initialContent, onSave, onCancel, className, saveLabel, cancelLabel, ...props }: MessageEditFormProps): React.ReactElement;
10
15
  //# sourceMappingURL=message-edit-form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-edit-form.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/message-edit-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gCAAgC;AAChC,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,MAAM,EACN,QAAQ,GACT,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAiF3C"}
1
+ {"version":3,"file":"message-edit-form.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/message-edit-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,2CAA2C;AAC3C,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,gCAAgC;AAChC,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAA2B,EAC3B,WAAsB,EACtB,GAAG,KAAK,EACT,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAgF3C"}
@@ -1,7 +1,7 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  import { cn } from "../../theme.js";
3
3
  /** Render message edit form. */
4
- export function MessageEditForm({ initialContent, onSave, onCancel, }) {
4
+ export function MessageEditForm({ initialContent, onSave, onCancel, className, saveLabel = "Save & Submit", cancelLabel = "Cancel", ...props }) {
5
5
  const [content, setContent] = React.useState(initialContent);
6
6
  const textareaRef = React.useRef(null);
7
7
  React.useEffect(() => {
@@ -32,16 +32,16 @@ export function MessageEditForm({ initialContent, onSave, onCancel, }) {
32
32
  onSave(trimmed);
33
33
  }
34
34
  }, [content, onSave, onCancel]);
35
- return (React.createElement("div", { className: "w-full" },
35
+ return (React.createElement("div", { ...props, className: cn("w-full", className) },
36
36
  React.createElement("textarea", { ref: textareaRef, value: content, onChange: (e) => {
37
37
  setContent(e.target.value);
38
38
  resize();
39
- }, onKeyDown: handleKeyDown, rows: 1, className: cn("w-full resize-none rounded-xl px-4 py-3 text-[15px] leading-relaxed", "bg-[var(--accent)]", "border border-[var(--border)]", "focus:outline-none focus-visible:border-[var(--ring)]", "text-[var(--foreground)]") }),
39
+ }, onKeyDown: handleKeyDown, rows: 1, className: cn("w-full resize-none rounded-[var(--radius-lg)] px-4 py-3 text-[15px] leading-relaxed", "border border-[var(--outline-border)] bg-[var(--secondary)]", "focus:outline-none focus-visible:border-[var(--edge-medium)]", "text-[var(--foreground)]") }),
40
40
  React.createElement("div", { className: "flex items-center gap-2 mt-2" },
41
41
  React.createElement("button", { type: "button", onClick: () => {
42
42
  const trimmed = content.trim();
43
43
  if (trimmed)
44
44
  onSave(trimmed);
45
- }, disabled: !content.trim(), className: cn("px-3 py-1.5 text-xs font-medium rounded-full transition-all", "bg-[var(--primary)] text-[var(--primary-foreground)]", "hover:opacity-90", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2", "disabled:opacity-50 disabled:pointer-events-none") }, "Save & Submit"),
46
- React.createElement("button", { type: "button", onClick: onCancel, className: "px-3 py-1.5 text-xs font-medium rounded-full text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--foreground)]/5 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2" }, "Cancel"))));
45
+ }, disabled: !content.trim(), className: cn("px-3 py-1.5 text-xs font-medium rounded-full transition-all", "bg-[var(--primary)] text-[var(--secondary)]", "hover:bg-[var(--secondary)] hover:text-[var(--foreground)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--edge-medium)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--background)]", "disabled:opacity-50 disabled:pointer-events-none") }, saveLabel),
46
+ React.createElement("button", { type: "button", onClick: onCancel, className: "px-3 py-1.5 text-xs font-medium rounded-full text-[var(--faint)] hover:bg-[var(--tertiary)] hover:text-[var(--foreground)] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--edge-medium)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--background)]" }, cancelLabel))));
47
47
  }
@@ -1,12 +1,22 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  /** Public API contract for feedback value. */
3
3
  export type FeedbackValue = "positive" | "negative";
4
+ /**
5
+ * Icon overrides for {@link MessageFeedback}. Each defaults to the built-in
6
+ * thumbs glyph.
7
+ */
8
+ export interface MessageFeedbackIcons {
9
+ positive?: React.ReactNode;
10
+ negative?: React.ReactNode;
11
+ }
4
12
  /** Props accepted by message feedback. */
5
- export interface MessageFeedbackProps {
13
+ export interface MessageFeedbackProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClick" | "className"> {
6
14
  messageId: string;
7
15
  feedback?: FeedbackValue | null;
8
16
  onFeedback: (messageId: string, feedback: FeedbackValue) => void;
9
17
  className?: string;
18
+ /** Override either of the thumbs icons. */
19
+ icons?: MessageFeedbackIcons;
10
20
  }
11
21
  /** Render message feedback. */
12
22
  export declare const MessageFeedback: React.ForwardRefExoticComponent<MessageFeedbackProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"message-feedback.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/message-feedback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,8CAA8C;AAC9C,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAEpD,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,+BAA+B;AAC/B,eAAO,MAAM,eAAe,6FAuD3B,CAAC"}
1
+ {"version":3,"file":"message-feedback.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/message-feedback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,8CAA8C;AAC9C,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,0CAA0C;AAC1C,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAKD,+BAA+B;AAC/B,eAAO,MAAM,eAAe,6FAkE3B,CAAC"}
@@ -1,20 +1,18 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  import { cn } from "../../theme.js";
3
- const BUTTON_BASE = "inline-flex items-center justify-center size-7 rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2";
3
+ const BUTTON_BASE = "inline-flex items-center justify-center size-7 rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--edge-medium)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--background)]";
4
4
  /** Render message feedback. */
5
- export const MessageFeedback = React.forwardRef(function MessageFeedback({ messageId, feedback, onFeedback, className }, ref) {
6
- return (React.createElement("div", { ref: ref, className: cn("flex items-center gap-1", className) },
5
+ export const MessageFeedback = React.forwardRef(function MessageFeedback({ messageId, feedback, onFeedback, className, icons, ...props }, ref) {
6
+ return (React.createElement("div", { ref: ref, ...props, className: cn("flex items-center gap-1", className) },
7
7
  React.createElement("button", { type: "button", onClick: () => onFeedback(messageId, "positive"), className: cn(BUTTON_BASE, feedback === "positive"
8
8
  ? "text-emerald-500 bg-emerald-500/10"
9
- : "text-[var(--input-placeholder)] hover:text-emerald-500 hover:bg-[var(--accent)]"), title: "Helpful" },
10
- React.createElement("svg", { className: "size-3.5", viewBox: "0 0 24 24", fill: feedback === "positive" ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
11
- React.createElement("path", { d: "M7 10v12" }),
12
- React.createElement("path", { d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z" }))),
9
+ : "text-[var(--faint)] hover:bg-[var(--tertiary)] hover:text-emerald-500"), title: "Helpful" }, icons?.positive ?? (React.createElement("svg", { className: "size-3.5", viewBox: "0 0 24 24", fill: feedback === "positive" ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
10
+ React.createElement("path", { d: "M7 10v12" }),
11
+ React.createElement("path", { d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z" })))),
13
12
  React.createElement("button", { type: "button", onClick: () => onFeedback(messageId, "negative"), className: cn(BUTTON_BASE, feedback === "negative"
14
13
  ? "text-red-500 bg-red-500/10"
15
- : "text-[var(--input-placeholder)] hover:text-[var(--destructive)] hover:bg-[var(--accent)]"), title: "Not helpful" },
16
- React.createElement("svg", { className: "size-3.5", viewBox: "0 0 24 24", fill: feedback === "negative" ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
17
- React.createElement("path", { d: "M17 14V2" }),
18
- React.createElement("path", { d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z" })))));
14
+ : "text-[var(--faint)] hover:bg-[var(--tertiary)] hover:text-[var(--destructive)]"), title: "Not helpful" }, icons?.negative ?? (React.createElement("svg", { className: "size-3.5", viewBox: "0 0 24 24", fill: feedback === "negative" ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
15
+ React.createElement("path", { d: "M17 14V2" }),
16
+ React.createElement("path", { d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z" }))))));
19
17
  });
20
18
  MessageFeedback.displayName = "MessageFeedback";
@@ -1 +1 @@
1
- {"version":3,"file":"quick-actions.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/quick-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,4CAA4C;AAC5C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4BAA4B;AAC5B,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,aAAa,EACb,SAAS,GACV,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAiB/C"}
1
+ {"version":3,"file":"quick-actions.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/quick-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,4CAA4C;AAC5C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4BAA4B;AAC5B,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,aAAa,EACb,SAAS,GACV,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAkB/C"}
@@ -4,5 +4,7 @@ import { cn } from "../../theme.js";
4
4
  export function QuickActions({ actions, onActionClick, className, }) {
5
5
  if (!actions || actions.length === 0)
6
6
  return null;
7
- return (React.createElement("div", { className: cn("flex flex-wrap gap-2", className) }, actions.map((action) => (React.createElement("button", { key: action.id, type: "button", onClick: () => onActionClick?.(action), className: "rounded-full border border-[var(--border)] px-4 py-2 text-sm text-[var(--muted-foreground)] transition-colors hover:bg-[var(--foreground)]/[0.03] hover:text-[var(--foreground)] hover:border-[var(--input-border)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]" }, action.label)))));
7
+ return (React.createElement("div", { className: cn("flex flex-wrap gap-2", className) }, actions.map((action) => (React.createElement("button", { key: action.id, type: "button", onClick: () => onActionClick?.(action), className: "rounded-full border border-[var(--outline-border)] px-4 py-2 text-sm text-[var(--faint)] transition-colors hover:border-[var(--edge-medium)] hover:bg-[var(--tertiary)] hover:text-[var(--foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--edge-medium)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--background)]" },
8
+ action.icon,
9
+ action.label)))));
8
10
  }
@@ -1,10 +1,73 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
- type ReasoningCardProps = {
2
+ /** Per-card state shared with `Reasoning.*` sub-parts. */
3
+ export interface ReasoningContextValue {
4
+ text: string;
5
+ isStreaming: boolean;
6
+ isOpen: boolean;
7
+ toggle: () => void;
8
+ }
9
+ /** Read the enclosing `Reasoning` state. Throws when used outside a `Reasoning`. */
10
+ export declare function useReasoning(): ReasoningContextValue;
11
+ /** Props accepted by `Reasoning` / `Reasoning.Root` (aka `ReasoningCard`). */
12
+ export interface ReasoningProps {
3
13
  text: string;
4
14
  isStreaming?: boolean;
5
15
  className?: string;
16
+ /** Overrides the chevron glyph. Rotation-on-open styling is applied to the
17
+ * wrapper, so a custom icon does not need to know about open state. */
18
+ icon?: React.ReactNode;
19
+ /** Override the two labels; each defaults to the current string. */
20
+ labels?: {
21
+ thinking?: string;
22
+ thought?: string;
23
+ };
24
+ /** Controlled open state. When provided, the component is controlled and the
25
+ * auto open/collapse behaviour is disabled (the parent owns the state). */
26
+ open?: boolean;
27
+ /** Initial open value when uncontrolled. Defaults to whether the card is
28
+ * streaming at mount — so a completed / reloaded reasoning starts collapsed
29
+ * and never animates, while a live one opens as tokens arrive. */
30
+ defaultOpen?: boolean;
31
+ /** Called whenever the open state should change (both controlled and not). */
32
+ onOpenChange?: (open: boolean) => void;
33
+ /** Compose your own disclosure; when omitted, the default anatomy renders. */
34
+ children?: React.ReactNode;
35
+ }
36
+ /** Props for `Reasoning.Trigger` — the disclosure button. */
37
+ export interface ReasoningTriggerProps {
38
+ /** Overrides the chevron glyph. */
39
+ icon?: React.ReactNode;
40
+ /** Override the two labels; each defaults to the current string. */
41
+ labels?: {
42
+ thinking?: string;
43
+ thought?: string;
44
+ };
45
+ className?: string;
46
+ }
47
+ /** The header row: a "Thinking…" / "Thought process" label + expand chevron. */
48
+ declare function ReasoningTrigger({ icon, labels, className }: ReasoningTriggerProps): React.JSX.Element;
49
+ declare namespace ReasoningTrigger {
50
+ var displayName: string;
51
+ }
52
+ /** The reasoning body. Renders when open; pass children to replace the markdown. */
53
+ declare function ReasoningContent({ className, children }: {
54
+ className?: string;
55
+ children?: React.ReactNode;
56
+ }): React.JSX.Element | null;
57
+ declare namespace ReasoningContent {
58
+ var displayName: string;
59
+ }
60
+ /**
61
+ * Reasoning — render `<Reasoning text={…} />` for the default disclosure, or
62
+ * compose `Reasoning.Trigger` + `Reasoning.Content` for a custom layout.
63
+ * Mirrors the `Message` / `ToolCall` compounds: render it, or compose it.
64
+ */
65
+ export declare const Reasoning: React.ForwardRefExoticComponent<ReasoningProps & React.RefAttributes<HTMLDivElement>> & {
66
+ Root: React.ForwardRefExoticComponent<ReasoningProps & React.RefAttributes<HTMLDivElement>>;
67
+ Trigger: typeof ReasoningTrigger;
68
+ Content: typeof ReasoningContent;
6
69
  };
7
- /** Render reasoning card. */
8
- export declare const ReasoningCard: React.ForwardRefExoticComponent<ReasoningCardProps & React.RefAttributes<HTMLDivElement>>;
70
+ /** Back-compat alias — `message.tsx` and `agent-card.tsx` import `ReasoningCard`. */
71
+ export declare const ReasoningCard: React.ForwardRefExoticComponent<ReasoningProps & React.RefAttributes<HTMLDivElement>>;
9
72
  export {};
10
73
  //# sourceMappingURL=reasoning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reasoning.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/reasoning.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAM1D,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,aAAa,2FAyCzB,CAAC"}
1
+ {"version":3,"file":"reasoning.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/reasoning.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAgB1D,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAID,oFAAoF;AACpF,wBAAgB,YAAY,IAAI,qBAAqB,CAQpD;AAED,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;4EACwE;IACxE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oEAAoE;IACpE,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD;gFAC4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;uEAEmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAqFD,6DAA6D;AAC7D,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oEAAoE;IACpE,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,iBAAS,gBAAgB,CACvB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,qBAAqB,GACjD,KAAK,CAAC,GAAG,CAAC,OAAO,CA0BnB;kBA5BQ,gBAAgB;;;AA+BzB,oFAAoF;AACpF,iBAAS,gBAAgB,CACvB,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAC1E,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAY1B;kBAdQ,gBAAgB;;;AAiBzB;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;CAIpB,CAAC;AAEH,qFAAqF;AACrF,eAAO,MAAM,aAAa,uFAAgB,CAAC"}
@@ -1,30 +1,104 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  import { cn } from "../../theme.js";
3
3
  import { Markdown } from "../../markdown.js";
4
- import { BrainIcon, ChevronDownIcon } from "../../icons/index.js";
4
+ import { ChevronDownIcon } from "../../icons/index.js";
5
+ import { COMPONENT_ERROR } from "../../../../../errors/error-registry.js";
5
6
  import { Shimmer } from "./animations.js";
6
- /** Render reasoning card. */
7
- export const ReasoningCard = React.forwardRef(function ReasoningCard({ text, isStreaming = false, className }, ref) {
8
- const [isOpen, setIsOpen] = React.useState(true);
7
+ const ReasoningContext = React.createContext(null);
8
+ /** Read the enclosing `Reasoning` state. Throws when used outside a `Reasoning`. */
9
+ export function useReasoning() {
10
+ const ctx = React.useContext(ReasoningContext);
11
+ if (!ctx) {
12
+ throw COMPONENT_ERROR.create({
13
+ detail: "useReasoning must be used within a Reasoning",
14
+ });
15
+ }
16
+ return ctx;
17
+ }
18
+ /**
19
+ * `Reasoning.Root` — context provider + wrapper. No children renders the
20
+ * default anatomy (`Trigger` + `Content`); pass children to recompose.
21
+ */
22
+ const ReasoningRoot = React.forwardRef(function Reasoning({ text, isStreaming = false, className, icon, labels, open, defaultOpen, onOpenChange, children, }, ref) {
23
+ const isControlled = open !== undefined;
24
+ // Uncontrolled default: open only if we mount mid-stream. A completed /
25
+ // reloaded card (isStreaming === false) starts collapsed, so it never
26
+ // plays the open-then-collapse animation.
27
+ const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? isStreaming);
28
+ const isOpen = isControlled ? open : uncontrolledOpen;
9
29
  const userToggledRef = React.useRef(false);
30
+ // Tracks whether this card has ever streamed during its lifetime. We only
31
+ // auto-collapse once streaming actually ends — a card that was never
32
+ // streaming (history reload) has nothing to animate away from.
33
+ const hasStreamedRef = React.useRef(isStreaming);
10
34
  React.useEffect(() => {
11
- if (isStreaming || !isOpen || userToggledRef.current)
35
+ // Parent owns state when controlled, and a manual toggle opts out of the
36
+ // stream-driven open/collapse entirely.
37
+ if (isControlled || userToggledRef.current)
12
38
  return;
13
- const timer = globalThis.setTimeout(() => setIsOpen(false), 1000);
39
+ if (isStreaming) {
40
+ hasStreamedRef.current = true;
41
+ if (!isOpen) {
42
+ setUncontrolledOpen(true);
43
+ onOpenChange?.(true);
44
+ }
45
+ return;
46
+ }
47
+ // Streaming just finished in this session — collapse after a beat. If we
48
+ // never streamed (reloaded chat), leave the card exactly as it mounted.
49
+ if (!hasStreamedRef.current || !isOpen)
50
+ return;
51
+ const timer = globalThis.setTimeout(() => {
52
+ setUncontrolledOpen(false);
53
+ onOpenChange?.(false);
54
+ }, 1000);
14
55
  return () => clearTimeout(timer);
15
- }, [isStreaming, isOpen]);
16
- const label = isStreaming ? React.createElement(Shimmer, null, "Thinking...") : React.createElement("span", null, "Thought process");
17
- return (React.createElement("div", { ref: ref, className: cn("not-prose mb-4", className) },
18
- React.createElement("button", { type: "button", onClick: () => {
19
- userToggledRef.current = true;
20
- setIsOpen((open) => !open);
21
- }, className: "flex w-full items-center gap-2 text-[var(--input-placeholder)] text-sm transition-colors hover:text-[var(--foreground)]" },
22
- React.createElement(BrainIcon, { className: "size-4" }),
23
- label,
24
- React.createElement(ChevronDownIcon, { className: cn("size-4 transition-transform", isOpen && "rotate-180") })),
25
- isOpen
26
- ? (React.createElement("div", { className: "mt-4 text-sm text-[var(--muted-foreground)] border-l-2 border-[var(--border)] pl-4 ml-2" },
27
- React.createElement(Markdown, { className: "text-sm" }, text)))
28
- : null));
56
+ }, [isControlled, isStreaming, isOpen, onOpenChange]);
57
+ const toggle = React.useCallback(() => {
58
+ userToggledRef.current = true;
59
+ const next = !isOpen;
60
+ if (!isControlled)
61
+ setUncontrolledOpen(next);
62
+ onOpenChange?.(next);
63
+ }, [isControlled, isOpen, onOpenChange]);
64
+ const context = { text, isStreaming, isOpen, toggle };
65
+ return (React.createElement(ReasoningContext.Provider, { value: context },
66
+ React.createElement("div", { ref: ref, className: cn("not-prose mb-3", className) }, children ?? (React.createElement(React.Fragment, null,
67
+ React.createElement(ReasoningTrigger, { icon: icon, labels: labels }),
68
+ React.createElement(ReasoningContent, null))))));
69
+ });
70
+ ReasoningRoot.displayName = "Reasoning.Root";
71
+ /** The header row: a "Thinking…" / "Thought process" label + expand chevron. */
72
+ function ReasoningTrigger({ icon, labels, className }) {
73
+ const { isStreaming, isOpen, toggle } = useReasoning();
74
+ const thinkingLabel = labels?.thinking ?? "Thinking...";
75
+ const thoughtLabel = labels?.thought ?? "Thought process";
76
+ const label = isStreaming ? React.createElement(Shimmer, null, thinkingLabel) : React.createElement("span", null, thoughtLabel);
77
+ return (React.createElement("button", { type: "button", onClick: toggle, className: cn("flex w-full items-center gap-2 rounded-sm text-sm text-[var(--foreground)] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[var(--edge-medium)] focus-visible:ring-offset-0", className) },
78
+ label,
79
+ React.createElement("span", { className: cn("flex size-3.5 shrink-0 items-center justify-center transition-transform duration-200", !isOpen && "-rotate-90") }, icon ?? React.createElement(ChevronDownIcon, { className: "size-3.5 shrink-0" }))));
80
+ }
81
+ ReasoningTrigger.displayName = "Reasoning.Trigger";
82
+ /** The reasoning body. Renders when open; pass children to replace the markdown. */
83
+ function ReasoningContent({ className, children }) {
84
+ const { text, isOpen } = useReasoning();
85
+ if (!isOpen)
86
+ return null;
87
+ return (React.createElement("div", { className: cn("mt-2 text-sm text-[var(--foreground)]", className) }, children ?? (
88
+ // `text-sm!` overrides Markdown's base `text-base` (cn does not tw-merge)
89
+ // so reasoning renders at 14px like Studio's compact variant.
90
+ React.createElement(Markdown, { className: "mb-0 space-y-2.5 text-sm!" }, text))));
91
+ }
92
+ ReasoningContent.displayName = "Reasoning.Content";
93
+ /**
94
+ * Reasoning — render `<Reasoning text={…} />` for the default disclosure, or
95
+ * compose `Reasoning.Trigger` + `Reasoning.Content` for a custom layout.
96
+ * Mirrors the `Message` / `ToolCall` compounds: render it, or compose it.
97
+ */
98
+ export const Reasoning = Object.assign(ReasoningRoot, {
99
+ Root: ReasoningRoot,
100
+ Trigger: ReasoningTrigger,
101
+ Content: ReasoningContent,
29
102
  });
30
- ReasoningCard.displayName = "ReasoningCard";
103
+ /** Back-compat alias — `message.tsx` and `agent-card.tsx` import `ReasoningCard`. */
104
+ export const ReasoningCard = ReasoningRoot;