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
@@ -1,110 +0,0 @@
1
- import * as React from "../../../../react/react.js";
2
- import { type ChatProps } from "./chat/index.js";
3
- type ChatMessageSetter = (messages: ChatProps["messages"]) => void;
4
- type TabChangeHandler = NonNullable<ChatProps["onTabChange"]>;
5
- /** Public API contract for chat with sidebar chat controller. */
6
- export interface ChatWithSidebarChatController {
7
- messages: ChatProps["messages"];
8
- input: ChatProps["input"];
9
- onChange: ChatProps["onChange"];
10
- onSubmit?: ChatProps["onSubmit"];
11
- stop?: ChatProps["stop"];
12
- reload?: ChatProps["reload"];
13
- setInput?: ChatProps["setInput"];
14
- isLoading?: ChatProps["isLoading"];
15
- error?: ChatProps["error"];
16
- model?: ChatProps["model"];
17
- activeModel?: ChatProps["activeModel"];
18
- onModelChange?: ChatProps["onModelChange"];
19
- inferenceMode?: ChatProps["inferenceMode"];
20
- editMessage?: ChatProps["editMessage"];
21
- getBranches?: ChatProps["getBranches"];
22
- switchBranch?: ChatProps["switchBranch"];
23
- setMessages: ChatMessageSetter;
24
- }
25
- interface ChatWithSidebarSidebarBaseConfig {
26
- storageKey?: string;
27
- visible?: boolean;
28
- }
29
- /** Configuration used by chat with sidebar sidebar. */
30
- export type ChatWithSidebarSidebarConfig = (ChatWithSidebarSidebarBaseConfig & {
31
- open: boolean;
32
- onToggle: () => void;
33
- }) | (ChatWithSidebarSidebarBaseConfig & {
34
- open?: undefined;
35
- onToggle?: () => void;
36
- });
37
- /** Configuration used by chat with sidebar model. */
38
- export interface ChatWithSidebarModelConfig {
39
- options?: ChatProps["models"];
40
- }
41
- /** Configuration used by chat with sidebar attachment. */
42
- export interface ChatWithSidebarAttachmentConfig {
43
- accept?: ChatProps["attachAccept"];
44
- items?: ChatProps["attachments"];
45
- uploads?: ChatProps["uploads"];
46
- onAttach?: ChatProps["onAttach"];
47
- onDrop?: ChatProps["onDrop"];
48
- onRemoveItem?: ChatProps["onRemoveAttachment"];
49
- onRemoveUpload?: ChatProps["onRemoveUpload"];
50
- }
51
- /** Configuration used by chat with sidebar quick actions. */
52
- export interface ChatWithSidebarQuickActionsConfig {
53
- suggestions?: ChatProps["suggestions"];
54
- onSuggestionClick?: ChatProps["onSuggestionClick"];
55
- actions?: ChatProps["quickActions"];
56
- onAction?: ChatProps["onQuickAction"];
57
- }
58
- /** Configuration used by chat with sidebar message. */
59
- export interface ChatWithSidebarMessageConfig {
60
- render?: ChatProps["renderMessage"];
61
- renderTool?: ChatProps["renderTool"];
62
- onFeedback?: ChatProps["onFeedback"];
63
- onSourceClick?: ChatProps["onSourceClick"];
64
- }
65
- /** Configuration used by chat with sidebar feature. */
66
- export interface ChatWithSidebarFeatureConfig {
67
- steps?: ChatProps["showSteps"];
68
- tabs?: ChatProps["showTabs"];
69
- sources?: ChatProps["showSources"];
70
- export?: ChatProps["showExport"];
71
- scrollButton?: ChatProps["showScrollButton"];
72
- messageActions?: ChatProps["showMessageActions"];
73
- }
74
- /** Configuration used by chat with sidebar tabs. */
75
- export type ChatWithSidebarTabsConfig = {
76
- active: ChatProps["activeTab"];
77
- onChange: TabChangeHandler;
78
- } | {
79
- active?: undefined;
80
- onChange?: TabChangeHandler;
81
- };
82
- /** Configuration used by chat with sidebar voice. */
83
- export interface ChatWithSidebarVoiceConfig {
84
- enabled?: ChatProps["enableVoice"];
85
- onVoice?: ChatProps["onVoice"];
86
- }
87
- /** Props accepted by chat with sidebar grouped. */
88
- export interface ChatWithSidebarGroupedProps {
89
- chat: ChatWithSidebarChatController;
90
- sidebar?: ChatWithSidebarSidebarConfig;
91
- models?: ChatWithSidebarModelConfig;
92
- attachments?: ChatWithSidebarAttachmentConfig;
93
- quickActions?: ChatWithSidebarQuickActionsConfig;
94
- message?: ChatWithSidebarMessageConfig;
95
- features?: ChatWithSidebarFeatureConfig;
96
- tabs?: ChatWithSidebarTabsConfig;
97
- voice?: ChatWithSidebarVoiceConfig;
98
- className?: string;
99
- maxHeight?: ChatProps["maxHeight"];
100
- theme?: ChatProps["theme"];
101
- placeholder?: ChatProps["placeholder"];
102
- emptyState?: ChatProps["emptyState"];
103
- children?: ChatProps["children"];
104
- }
105
- /** Props accepted by chat with sidebar. */
106
- export type ChatWithSidebarProps = ChatWithSidebarGroupedProps;
107
- /** Render chat with sidebar. */
108
- export declare const ChatWithSidebar: React.ForwardRefExoticComponent<ChatWithSidebarGroupedProps & React.RefAttributes<HTMLDivElement>>;
109
- export {};
110
- //# sourceMappingURL=chat-with-sidebar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat-with-sidebar.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/chat-with-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAGpD,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMvD,KAAK,iBAAiB,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;AAKnE,KAAK,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;AAE9D,iEAAiE;AACjE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAChC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,SAAS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AAC,EAAE,4BAA4B,CAAC;IACvC,MAAM,CAAC,EAAE,0BAA0B,CAAC;IACpC,WAAW,CAAC,EAAE,+BAA+B,CAAC;IAC9C,YAAY,CAAC,EAAE,iCAAiC,CAAC;IACjD,OAAO,CAAC,EAAE,4BAA4B,CAAC;IACvC,QAAQ,CAAC,EAAE,4BAA4B,CAAC;IACxC,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,KAAK,CAAC,EAAE,0BAA0B,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAClC;AAED,2CAA2C;AAC3C,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAE/D,gCAAgC;AAChC,eAAO,MAAM,eAAe,oGAqP3B,CAAC"}
@@ -1,167 +0,0 @@
1
- import * as React from "../../../../react/react.js";
2
- import { getDocumentNonce } from "./csp-nonce.js";
3
- import { cn, generateTokenCSS } from "./theme.js";
4
- import { Chat } from "./chat/index.js";
5
- import { ChatSidebar } from "./chat/components/sidebar.js";
6
- import { TabSwitcher } from "./chat/components/tab-switcher.js";
7
- import { useThreads } from "./chat/hooks/use-threads.js";
8
- import { PanelLeftIcon } from "./icons/index.js";
9
- /** Render chat with sidebar. */
10
- export const ChatWithSidebar = React.forwardRef(function ChatWithSidebar({ chat, sidebar, models, attachments, quickActions, message, features, tabs, voice, className, maxHeight, theme, placeholder, emptyState, children, }, ref) {
11
- const nonce = getDocumentNonce();
12
- const storageKey = sidebar?.storageKey;
13
- const controlledOpen = sidebar?.open;
14
- const onSidebarToggle = sidebar?.onToggle;
15
- const showSidebar = sidebar?.visible ?? true;
16
- const setMessages = chat.setMessages;
17
- const messages = chat.messages;
18
- const model = chat.model;
19
- const onModelChange = chat.onModelChange;
20
- const controlledTab = tabs?.active;
21
- const chatProps = {
22
- input: chat.input,
23
- onChange: chat.onChange,
24
- onSubmit: chat.onSubmit,
25
- stop: chat.stop,
26
- reload: chat.reload,
27
- setInput: chat.setInput,
28
- isLoading: chat.isLoading,
29
- error: chat.error,
30
- placeholder,
31
- maxHeight,
32
- theme,
33
- renderMessage: message?.render,
34
- renderTool: message?.renderTool,
35
- suggestions: quickActions?.suggestions,
36
- onSuggestionClick: quickActions?.onSuggestionClick,
37
- emptyState,
38
- showScrollButton: features?.scrollButton,
39
- showMessageActions: features?.messageActions,
40
- models: models?.options,
41
- activeModel: chat.activeModel,
42
- inferenceMode: chat.inferenceMode,
43
- showSources: features?.sources,
44
- onSourceClick: message?.onSourceClick,
45
- onAttach: attachments?.onAttach,
46
- onDrop: attachments?.onDrop,
47
- attachAccept: attachments?.accept,
48
- attachments: attachments?.items,
49
- onRemoveAttachment: attachments?.onRemoveItem,
50
- showExport: features?.export,
51
- onFeedback: message?.onFeedback,
52
- editMessage: chat.editMessage,
53
- getBranches: chat.getBranches,
54
- switchBranch: chat.switchBranch,
55
- showSteps: features?.steps,
56
- showTabs: features?.tabs,
57
- uploads: attachments?.uploads,
58
- onRemoveUpload: attachments?.onRemoveUpload,
59
- quickActions: quickActions?.actions,
60
- onQuickAction: quickActions?.onAction,
61
- enableVoice: voice?.enabled,
62
- onVoice: voice?.onVoice,
63
- children,
64
- };
65
- const { activeThreadId, createThread, deleteThread, renameThread, selectThread, threads, updateThread, } = useThreads({ storageKey });
66
- const [internalOpen, setInternalOpen] = React.useState(false);
67
- const [internalTab, setInternalTab] = React.useState("chat");
68
- const showTabs = chatProps.showTabs ?? false;
69
- const isSidebarControlled = controlledOpen !== undefined;
70
- const sidebarOpen = isSidebarControlled ? controlledOpen : internalOpen;
71
- const toggleSidebar = React.useCallback(() => {
72
- if (isSidebarControlled) {
73
- onSidebarToggle?.();
74
- return;
75
- }
76
- setInternalOpen((prev) => {
77
- const next = !prev;
78
- onSidebarToggle?.();
79
- return next;
80
- });
81
- }, [isSidebarControlled, onSidebarToggle]);
82
- const isTabControlled = controlledTab !== undefined;
83
- const activeTab = controlledTab ?? internalTab;
84
- const handleTabChange = React.useCallback((tab) => {
85
- if (!isTabControlled) {
86
- setInternalTab(tab);
87
- }
88
- tabs?.onChange?.(tab);
89
- }, [isTabControlled, tabs]);
90
- // Keep refs in sync so callbacks always read current values
91
- const activeIdRef = React.useRef(activeThreadId);
92
- activeIdRef.current = activeThreadId;
93
- const messagesRef = React.useRef(messages);
94
- messagesRef.current = messages;
95
- const threadsRef = React.useRef(threads);
96
- threadsRef.current = threads;
97
- // Sync current messages to active thread on change
98
- const prevMessagesRef = React.useRef(messages);
99
- React.useEffect(() => {
100
- const currentActiveId = activeIdRef.current;
101
- if (!currentActiveId || messages === prevMessagesRef.current)
102
- return;
103
- prevMessagesRef.current = messages;
104
- if (messages.length > 0) {
105
- // Auto-title from first user message — combine with message sync
106
- // into a single updateThread call to avoid racing setThreads batches
107
- const activeThread = threadsRef.current.find((t) => t.id === currentActiveId);
108
- let title;
109
- if (activeThread?.title === "New Chat") {
110
- const firstUserMsg = messages.find((m) => m.role === "user");
111
- if (firstUserMsg) {
112
- const text = firstUserMsg.parts
113
- .filter((p) => p.type === "text")
114
- .map((p) => p.text)
115
- .join("")
116
- .trim();
117
- if (text)
118
- title = text.slice(0, 30);
119
- }
120
- }
121
- updateThread(currentActiveId, title ? { messages, title } : { messages });
122
- }
123
- }, [messages, updateThread]);
124
- const setInput = chat.setInput;
125
- const stopChat = chat.stop;
126
- const handleSelectThread = React.useCallback((id) => {
127
- stopChat?.();
128
- const currentActiveId = activeIdRef.current;
129
- if (currentActiveId && messagesRef.current.length > 0) {
130
- updateThread(currentActiveId, { messages: messagesRef.current });
131
- }
132
- selectThread(id);
133
- const thread = threadsRef.current.find((t) => t.id === id);
134
- setMessages(thread?.messages ?? []);
135
- setInput?.("");
136
- }, [selectThread, updateThread, setMessages, setInput, stopChat]);
137
- const handleNewThread = React.useCallback(() => {
138
- stopChat?.();
139
- const currentActiveId = activeIdRef.current;
140
- if (currentActiveId && messagesRef.current.length > 0) {
141
- updateThread(currentActiveId, { messages: messagesRef.current });
142
- }
143
- const nextThread = createThread();
144
- setMessages(nextThread.messages);
145
- setInput?.("");
146
- }, [createThread, updateThread, setMessages, setInput, stopChat]);
147
- if (!showSidebar) {
148
- return (React.createElement(Chat, { ref: ref, messages: messages, model: model, onModelChange: onModelChange, className: className, ...chatProps }));
149
- }
150
- const tokenCSS = React.useMemo(() => generateTokenCSS(), []);
151
- return (React.createElement("div", { ref: ref, className: cn("flex h-full bg-[var(--background)]", className), "data-vf-chat": "" },
152
- React.createElement("style", { nonce: nonce, dangerouslySetInnerHTML: { __html: tokenCSS } }),
153
- sidebarOpen && (React.createElement(ChatSidebar, { threads: threads, activeThreadId: activeThreadId, onSelectThread: handleSelectThread, onDeleteThread: (id) => {
154
- deleteThread(id);
155
- const next = threadsRef.current.find((t) => t.id !== id);
156
- setMessages(next?.messages ?? []);
157
- }, onRenameThread: renameThread, onNewThread: handleNewThread })),
158
- React.createElement("div", { className: "flex-1 min-w-0 flex flex-col" },
159
- React.createElement("div", { className: "flex items-center px-3 pt-4 pb-1 shrink-0" },
160
- React.createElement("button", { type: "button", onClick: toggleSidebar, className: "size-8 inline-flex items-center justify-center 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", "aria-label": sidebarOpen ? "Close sidebar" : "Open sidebar" },
161
- React.createElement(PanelLeftIcon, { className: "size-[18px]" })),
162
- showTabs && (React.createElement("div", { className: "flex-1 flex justify-center" },
163
- React.createElement(TabSwitcher, { activeTab: activeTab, onTabChange: handleTabChange, className: "py-0" }))),
164
- showTabs && React.createElement("div", { className: "size-8 shrink-0" })),
165
- React.createElement(Chat, { messages: messages, model: model, onModelChange: onModelChange, className: "flex-1 min-h-0", activeTab: activeTab, onTabChange: handleTabChange, hideTabSwitcher: true, ...chatProps }))));
166
- });
167
- ChatWithSidebar.displayName = "ChatWithSidebar";
@@ -1,42 +0,0 @@
1
- import * as React from "../../../../react/react.js";
2
- import type { ChatMessage, ChatMessagePart, ChatToolPart } from "../../../agent/react/index.js";
3
- import { type ChatTheme } from "./theme.js";
4
- /** Props accepted by message. */
5
- export interface MessageProps {
6
- /** Message to display */
7
- message: ChatMessage;
8
- /** Additional class name */
9
- className?: string;
10
- /** Theme customization */
11
- theme?: Partial<ChatTheme>;
12
- /** Show role label */
13
- showRole?: boolean;
14
- /** Show timestamp */
15
- showTimestamp?: boolean;
16
- /** Custom renderer for tool calls (matches tool-${toolName} pattern) */
17
- renderToolCall?: (part: ChatToolPart) => React.ReactNode;
18
- /** Custom renderer for dynamic tools */
19
- renderDynamicTool?: (part: Extract<ChatMessagePart, {
20
- type: "dynamic-tool";
21
- }>) => React.ReactNode;
22
- /** Custom renderer for reasoning */
23
- renderReasoning?: (part: Extract<ChatMessagePart, {
24
- type: "reasoning";
25
- }>) => React.ReactNode;
26
- }
27
- /** Render a standalone chat message. */
28
- export declare const Message: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
29
- /** Props accepted by streaming message. */
30
- export interface StreamingMessageProps {
31
- /** Streaming message parts */
32
- parts: ChatMessagePart[];
33
- /** Show typing cursor */
34
- showCursor?: boolean;
35
- /** Additional class name */
36
- className?: string;
37
- /** Theme customization */
38
- theme?: Partial<ChatTheme>;
39
- }
40
- /** Message shape for streaming. */
41
- export declare const StreamingMessage: React.ForwardRefExoticComponent<StreamingMessageProps & React.RefAttributes<HTMLDivElement>>;
42
- //# sourceMappingURL=message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":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EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC5B;AAED,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,8FAgB5B,CAAC"}
@@ -1,69 +0,0 @@
1
- import * as React from "../../../../react/react.js";
2
- import { MessageContent, MessageItem, MessageRole } from "../../primitives/index.js";
3
- import { cn, defaultChatTheme, mergeThemes } from "./theme.js";
4
- function getTextFromParts(parts) {
5
- return parts
6
- .filter((p) => p.type === "text")
7
- .map((p) => p.text)
8
- .join("");
9
- }
10
- function isToolPart(part) {
11
- return part.type.startsWith("tool-") && "toolCallId" in part;
12
- }
13
- /** Render a standalone chat message. */
14
- export const Message = React.forwardRef(function Message({ message, className, theme: userTheme, showRole = false, showTimestamp = false, renderToolCall, renderDynamicTool, renderReasoning, }, ref) {
15
- const theme = mergeThemes(defaultChatTheme, userTheme);
16
- const messageTheme = theme.message?.[message.role] ?? theme.message?.assistant;
17
- return (React.createElement(MessageItem, { ref: ref, role: message.role, className: cn("flex", message.role === "user" ? "justify-end" : "justify-start", className) },
18
- React.createElement("div", { className: messageTheme },
19
- showRole && (React.createElement(MessageRole, { className: "block text-xs font-semibold mb-1 opacity-75 uppercase" }, message.role)),
20
- message.parts.map((part, index) => {
21
- const key = `${message.id}-part-${index}`;
22
- if (part.type === "text") {
23
- return React.createElement(MessageContent, { key: key }, part.text);
24
- }
25
- if (part.type === "reasoning") {
26
- if (renderReasoning) {
27
- return React.createElement(React.Fragment, { key: key }, renderReasoning(part));
28
- }
29
- return (React.createElement("div", { key: key, className: "text-sm italic opacity-70 my-2 pl-2 border-l-2" }, part.text));
30
- }
31
- if (part.type === "dynamic-tool") {
32
- if (renderDynamicTool) {
33
- return React.createElement(React.Fragment, { key: key }, renderDynamicTool(part));
34
- }
35
- return (React.createElement("div", { key: key, className: "text-xs bg-blue-50 rounded p-2 my-2" },
36
- React.createElement("span", { className: "font-mono" }, part.toolName),
37
- React.createElement("span", { className: "ml-2 text-blue-500" },
38
- "[dynamic: ",
39
- part.state,
40
- "]"),
41
- part.errorText && React.createElement("div", { className: "text-red-600 mt-1" }, part.errorText)));
42
- }
43
- if (!isToolPart(part))
44
- return null;
45
- if (renderToolCall) {
46
- return React.createElement(React.Fragment, { key: key }, renderToolCall(part));
47
- }
48
- return (React.createElement("div", { key: key, className: "text-xs bg-gray-100 rounded p-2 my-2" },
49
- React.createElement("span", { className: "font-mono" }, part.toolName),
50
- React.createElement("span", { className: "ml-2 text-gray-500" },
51
- "[",
52
- part.state,
53
- "]"),
54
- part.errorText && React.createElement("div", { className: "text-red-600 mt-1" }, part.errorText)));
55
- }),
56
- showTimestamp && message.createdAt && (React.createElement("div", { className: "text-xs opacity-60 mt-1" }, new Date(message.createdAt).toLocaleTimeString())))));
57
- });
58
- Message.displayName = "Message";
59
- /** Message shape for streaming. */
60
- export const StreamingMessage = React.forwardRef(function StreamingMessage({ parts, showCursor = true, className, theme: userTheme }, ref) {
61
- const theme = mergeThemes(defaultChatTheme, userTheme);
62
- const textContent = getTextFromParts(parts);
63
- return (React.createElement(MessageItem, { ref: ref, role: "assistant", className: cn("flex justify-start", className) },
64
- React.createElement("div", { className: theme.message?.assistant },
65
- React.createElement(MessageContent, null,
66
- textContent,
67
- showCursor && React.createElement("span", { className: "inline-block w-1 h-4 bg-current ml-1 animate-pulse" })))));
68
- });
69
- StreamingMessage.displayName = "StreamingMessage";