veryfront 0.1.996 → 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 (380) hide show
  1. package/esm/cli/templates/manifest.js +1 -1
  2. package/esm/deno.d.ts +8 -0
  3. package/esm/deno.js +12 -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/task/discovery.d.ts +95 -0
  350. package/esm/src/task/discovery.d.ts.map +1 -0
  351. package/esm/src/task/discovery.js +192 -0
  352. package/esm/src/task/index.d.ts +27 -0
  353. package/esm/src/task/index.d.ts.map +1 -0
  354. package/esm/src/task/index.js +22 -0
  355. package/esm/src/utils/version-constant.d.ts +1 -1
  356. package/esm/src/utils/version-constant.js +1 -1
  357. package/esm/src/workflow/blob/local-storage.d.ts +32 -0
  358. package/esm/src/workflow/blob/local-storage.d.ts.map +1 -0
  359. package/esm/src/workflow/blob/local-storage.js +179 -0
  360. package/esm/src/workflow/blob/types.d.ts +5 -0
  361. package/esm/src/workflow/blob/types.d.ts.map +1 -1
  362. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +11 -0
  363. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -1
  364. package/esm/src/workflow/blob/veryfront-cloud-storage.js +36 -0
  365. package/package.json +9 -1
  366. package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts +0 -20
  367. package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +0 -1
  368. package/esm/src/react/components/chat/chat/components/uploads-panel.js +0 -49
  369. package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts +0 -28
  370. package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +0 -1
  371. package/esm/src/react/components/chat/chat/contexts/thread-list-context.js +0 -27
  372. package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts +0 -28
  373. package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +0 -1
  374. package/esm/src/react/components/chat/chat/hooks/use-threads.js +0 -151
  375. package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -110
  376. package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +0 -1
  377. package/esm/src/react/components/chat/chat-with-sidebar.js +0 -167
  378. package/esm/src/react/components/chat/message.d.ts +0 -42
  379. package/esm/src/react/components/chat/message.d.ts.map +0 -1
  380. package/esm/src/react/components/chat/message.js +0 -69
@@ -1,6 +1,91 @@
1
+ /**
2
+ * ChatSidebar — a conversation rail, available as a one-shot preset or as a
3
+ * composable compound (mirroring `Chat` / `Message`).
4
+ *
5
+ * Conversation-native: it lists {@link ConversationSummary} rows and, inside a
6
+ * {@link ConversationsProvider}, needs **no props at all** — it reads the list,
7
+ * the active id, and select/new/delete/rename straight from context. Pass props
8
+ * to override any of them (controlled), or drop to the compound parts for a
9
+ * custom layout.
10
+ *
11
+ * @example Zero-config inside a provider
12
+ * ```tsx
13
+ * <ConversationsProvider store={store}>
14
+ * <ChatSidebar /> // conversations + actions come from context
15
+ * </ConversationsProvider>
16
+ * ```
17
+ *
18
+ * @example Preset — the whole rail from props
19
+ * ```tsx
20
+ * <ChatSidebar
21
+ * conversations={conversations}
22
+ * activeId={activeId}
23
+ * onSelect={select}
24
+ * onDelete={remove}
25
+ * onRename={rename}
26
+ * onNew={create}
27
+ * />
28
+ * ```
29
+ *
30
+ * @example Composition — drive the layout yourself
31
+ * ```tsx
32
+ * <ChatSidebar.Root>
33
+ * <ChatSidebar.NewButton>New chat</ChatSidebar.NewButton>
34
+ * <ChatSidebar.List />
35
+ * </ChatSidebar.Root>
36
+ * ```
37
+ *
38
+ * `<ChatSidebar.List />` with no children auto-groups the conversations by recency.
39
+ *
40
+ * @module react/components/chat/chat/components/sidebar
41
+ */
1
42
  import * as React from "../../../../../../react/react.js";
43
+ import { COMPONENT_ERROR } from "../../../../../errors/error-registry.js";
2
44
  import { cn } from "../../theme.js";
3
- import { MessageSquareIcon, PlusIcon, TrashIcon } from "../../icons/index.js";
45
+ import { PencilIcon, TrashIcon } from "../../icons/index.js";
46
+ import { Button } from "../../ui/button.js";
47
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../../ui/dropdown-menu.js";
48
+ import { List, ListItem, ListLabel } from "../../ui/list.js";
49
+ import { Skeleton } from "../../ui/skeleton.js";
50
+ import { ChatTokens } from "../../chat-tokens-style.js";
51
+ import { useConversationsContextOptional } from "../contexts/conversations-context.js";
52
+ /** Three-dots "more actions" glyph (not in the shared icons barrel). */
53
+ function MoreGlyph({ className }) {
54
+ return (React.createElement("svg", { className: cn("size-3.5", className), viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" },
55
+ React.createElement("circle", { cx: "5", cy: "12", r: "1.6" }),
56
+ React.createElement("circle", { cx: "12", cy: "12", r: "1.6" }),
57
+ React.createElement("circle", { cx: "19", cy: "12", r: "1.6" })));
58
+ }
59
+ const ChatSidebarContext = React.createContext(null);
60
+ function useChatSidebarContext() {
61
+ const context = React.useContext(ChatSidebarContext);
62
+ if (!context) {
63
+ throw COMPONENT_ERROR.create({
64
+ detail: "ChatSidebar sub-components must be used within <ChatSidebar.Root>",
65
+ });
66
+ }
67
+ return context;
68
+ }
69
+ const noop = () => { };
70
+ /**
71
+ * Resolve the sidebar's data + actions from the explicit conversation props,
72
+ * falling back to the surrounding {@link ConversationsProvider}. Inside a
73
+ * provider the sidebar needs no props.
74
+ */
75
+ function useResolvedSidebar(props) {
76
+ const ctx = useConversationsContextOptional();
77
+ const conversations = props.conversations ?? ctx?.conversations ?? [];
78
+ const activeId = props.activeId !== undefined ? props.activeId : ctx?.activeId ?? null;
79
+ const onSelect = props.onSelect ?? ctx?.select ?? noop;
80
+ const onDelete = props.onDelete ?? ctx?.remove ?? noop;
81
+ const onRename = props.onRename ?? ctx?.rename;
82
+ const onNew = props.onNew ?? (ctx ? () => void ctx.create() : undefined);
83
+ const renderItem = props.renderItem;
84
+ return { conversations, activeId, onSelect, onDelete, onRename, onNew, renderItem };
85
+ }
86
+ // ---------------------------------------------------------------------------
87
+ // Recency grouping
88
+ // ---------------------------------------------------------------------------
4
89
  function getRelativeGroup(timestamp) {
5
90
  const day = 86_400_000;
6
91
  const diff = Date.now() - timestamp;
@@ -15,15 +100,15 @@ function getRelativeGroup(timestamp) {
15
100
  return "Previous 7 days";
16
101
  return "Older";
17
102
  }
18
- function groupThreads(threads) {
103
+ function groupConversations(conversations) {
19
104
  const groups = new Map();
20
105
  const order = ["Today", "Yesterday", "Previous 7 days", "Older"];
21
106
  for (const label of order) {
22
107
  groups.set(label, []);
23
108
  }
24
- for (const thread of threads) {
25
- const label = getRelativeGroup(thread.updatedAt);
26
- groups.get(label).push(thread);
109
+ for (const conversation of conversations) {
110
+ const label = getRelativeGroup(conversation.updatedAt);
111
+ groups.get(label).push(conversation);
27
112
  }
28
113
  for (const [key, value] of groups) {
29
114
  if (value.length === 0)
@@ -31,63 +116,161 @@ function groupThreads(threads) {
31
116
  }
32
117
  return groups;
33
118
  }
34
- function ThreadItem({ thread, isActive, onSelect, onDelete, onRename, }) {
119
+ /** Context provider + outer rail container for the compound sidebar. */
120
+ export function ChatSidebarRoot(props) {
121
+ const { icons, loading, isOpen = true, fill = false, className, children } = props;
122
+ const resolved = useResolvedSidebar(props);
123
+ const value = React.useMemo(() => ({ ...resolved, icons, loading }), [
124
+ resolved.conversations,
125
+ resolved.activeId,
126
+ resolved.onSelect,
127
+ resolved.onDelete,
128
+ resolved.onRename,
129
+ resolved.onNew,
130
+ resolved.renderItem,
131
+ icons,
132
+ loading,
133
+ ]);
134
+ if (!isOpen)
135
+ return null;
136
+ return (React.createElement(ChatSidebarContext.Provider, { value: value },
137
+ React.createElement(ChatTokens, null),
138
+ React.createElement("div", { "data-vf-chat": "", className: cn("flex flex-col h-full", fill
139
+ ? "w-full"
140
+ : "shrink-0 max-sm:absolute max-sm:z-20 max-sm:shadow-xl max-sm:bg-[var(--background)]", className), style: fill ? undefined : { width: 240 } }, children)));
141
+ }
142
+ ChatSidebarRoot.displayName = "ChatSidebar.Root";
143
+ /** The primary "new conversation" action. Wires `onNew` from context. */
144
+ export function ChatSidebarNewButton({ children, className, }) {
145
+ const { onNew, icons } = useChatSidebarContext();
146
+ return (React.createElement("div", { className: "px-3 pt-4 pb-1" },
147
+ React.createElement(Button, { type: "button", variant: "primary", onClick: onNew, className: cn("w-full", className) },
148
+ icons?.newConversation,
149
+ children ?? "New chat")));
150
+ }
151
+ ChatSidebarNewButton.displayName = "ChatSidebar.NewButton";
152
+ /** A single conversation row — select on click, rename/delete via a "…" menu. */
153
+ export function ChatSidebarItem({ conversation, className, }) {
154
+ const { activeId, onSelect, onDelete, onRename, icons, } = useChatSidebarContext();
155
+ const isActive = conversation.id === activeId;
35
156
  const [editing, setEditing] = React.useState(false);
36
- const [editValue, setEditValue] = React.useState(thread.title);
157
+ const [editValue, setEditValue] = React.useState(conversation.title);
158
+ const [menuOpen, setMenuOpen] = React.useState(false);
37
159
  const inputRef = React.useRef(null);
38
160
  React.useEffect(() => {
39
161
  if (editing)
40
- inputRef.current?.focus();
162
+ inputRef.current?.select();
41
163
  }, [editing]);
42
- function handleDoubleClick() {
164
+ function startRename() {
43
165
  if (!onRename)
44
166
  return;
45
- setEditValue(thread.title);
167
+ setEditValue(conversation.title);
46
168
  setEditing(true);
47
169
  }
48
170
  function commitRename() {
49
171
  setEditing(false);
50
172
  const trimmed = editValue.trim();
51
- if (trimmed && trimmed !== thread.title) {
52
- onRename?.(trimmed);
173
+ if (trimmed && trimmed !== conversation.title) {
174
+ onRename?.(conversation.id, trimmed);
53
175
  }
54
176
  }
55
- return (React.createElement("div", { className: cn("group/thread flex items-center gap-2.5 px-3 py-2.5 rounded-xl cursor-pointer transition-all", isActive
56
- ? "bg-[var(--foreground)]/[0.05] text-[var(--foreground)]"
57
- : "text-[var(--muted-foreground)] hover:bg-[var(--foreground)]/[0.03] hover:text-[var(--foreground)]"), onClick: !editing ? onSelect : undefined, onDoubleClick: handleDoubleClick },
58
- React.createElement(MessageSquareIcon, { className: "size-4 shrink-0 opacity-50" }),
59
- editing
60
- ? (React.createElement("input", { ref: inputRef, value: editValue, onChange: (e) => setEditValue(e.target.value), onBlur: commitRename, onKeyDown: (e) => {
177
+ if (editing) {
178
+ // Fixed `h-8` = the display row's height (py-1.5 + a size-5 action button),
179
+ // so entering rename mode never resizes the row.
180
+ return (React.createElement("div", { className: "flex h-8 items-center gap-1 rounded-[var(--radius-sm)] bg-[var(--accent)] px-2.5" },
181
+ React.createElement("input", { ref: inputRef, value: editValue, onChange: (e) => setEditValue(e.target.value), onBlur: commitRename, onKeyDown: (e) => {
61
182
  if (e.key === "Enter")
62
183
  commitRename();
63
184
  if (e.key === "Escape")
64
185
  setEditing(false);
65
- }, className: "flex-1 min-w-0 bg-transparent text-sm outline-none border-b border-[var(--input-border)]" }))
66
- : (React.createElement("span", { className: "flex-1 min-w-0 truncate text-[13px] leading-snug" }, thread.title)),
67
- !editing && (React.createElement("button", { type: "button", onClick: (e) => {
68
- e.stopPropagation();
69
- onDelete();
70
- }, className: "shrink-0 opacity-0 group-hover/thread:opacity-100 p-0.5 text-[var(--muted-foreground)] hover:text-[var(--destructive)] transition-all rounded", "aria-label": "Delete thread" },
71
- React.createElement(TrashIcon, { className: "size-3.5" })))));
186
+ }, className: "min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 text-[13px] leading-snug outline-none" })));
187
+ }
188
+ return (React.createElement(ListItem, { title: conversation.title, active: isActive || menuOpen, className: className, onClick: () => onSelect(conversation.id), action: React.createElement(DropdownMenu, { open: menuOpen, onOpenChange: setMenuOpen },
189
+ React.createElement(DropdownMenuTrigger, { asChild: true },
190
+ React.createElement(Button, { type: "button", variant: "icon-ghost", size: "icon-xs", on: "card", "aria-label": `More actions for ${conversation.title}` }, icons?.more ?? React.createElement(MoreGlyph, null))),
191
+ React.createElement(DropdownMenuContent, { align: "end", className: "min-w-[160px]" },
192
+ onRename && (React.createElement(DropdownMenuItem, { onSelect: startRename },
193
+ icons?.rename ?? React.createElement(PencilIcon, null),
194
+ "Rename")),
195
+ React.createElement(DropdownMenuItem, { onSelect: () => onDelete(conversation.id), className: "text-[var(--destructive)] hover:bg-[color-mix(in_oklch,var(--destructive),transparent_92%)]" },
196
+ icons?.delete ?? React.createElement(TrashIcon, null),
197
+ "Delete"))) }));
72
198
  }
73
- /** Render chat sidebar. */
74
- export function ChatSidebar({ threads, activeThreadId, onSelectThread, onDeleteThread, onRenameThread, onNewThread, className, isOpen = true, }) {
75
- const visibleThreads = React.useMemo(() => threads.filter((t) => t.messages.length > 0 || t.id === activeThreadId), [threads, activeThreadId]);
76
- const grouped = React.useMemo(() => groupThreads(visibleThreads), [visibleThreads]);
77
- const hasThreads = visibleThreads.length > 0;
78
- if (!isOpen)
79
- return null;
80
- return (React.createElement("div", { className: cn("flex flex-col h-full shrink-0 max-sm:absolute max-sm:z-20 max-sm:shadow-xl max-sm:bg-[var(--background)]", className), style: { width: 240 } },
81
- onNewThread && (React.createElement("div", { className: "px-3 pt-4 pb-1" },
82
- React.createElement("button", { type: "button", onClick: onNewThread, className: "w-full inline-flex items-center justify-center gap-1.5 h-9 px-4 rounded-full text-sm font-medium text-[var(--foreground)] bg-[var(--card)] hover:opacity-80 transition-all" },
83
- React.createElement(PlusIcon, { className: "size-4" }),
84
- React.createElement("span", null, "New Chat")))),
85
- React.createElement("div", { className: "flex-1 overflow-y-auto px-2 pt-2 pb-3 space-y-4" }, hasThreads
86
- ? Array.from(grouped.entries()).map(([label, items]) => (React.createElement("div", { key: label },
87
- React.createElement("div", { className: "px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-[var(--input-placeholder)]" }, label),
88
- React.createElement("div", { className: "space-y-1" }, items.map((thread) => (React.createElement(ThreadItem, { key: thread.id, thread: thread, isActive: thread.id === activeThreadId, onSelect: () => onSelectThread(thread.id), onDelete: () => onDeleteThread(thread.id), onRename: onRenameThread
89
- ? (title) => onRenameThread(thread.id, title)
90
- : undefined })))))))
91
- : (React.createElement("div", { className: "flex flex-col items-center justify-center h-full px-4 text-center text-[var(--muted-foreground)]" },
92
- React.createElement("p", { className: "text-sm" }, "No chats yet"))))));
199
+ ChatSidebarItem.displayName = "ChatSidebar.Item";
200
+ /** A labeled cluster of conversation rows. */
201
+ export function ChatSidebarGroup({ label, children, className, }) {
202
+ return (React.createElement(List, { className: className },
203
+ label !== undefined && React.createElement(ListLabel, null, label),
204
+ children));
205
+ }
206
+ ChatSidebarGroup.displayName = "ChatSidebar.Group";
207
+ /** Placeholder shown when there are no conversations to list. */
208
+ export function ChatSidebarEmpty({ children, className, }) {
209
+ return (React.createElement("div", { className: cn("flex h-full flex-col items-center justify-center px-4 text-center text-[var(--faint)]", className) }, children ?? React.createElement("p", { className: "text-sm" }, "No chats yet")));
210
+ }
211
+ ChatSidebarEmpty.displayName = "ChatSidebar.Empty";
212
+ /**
213
+ * Loading placeholder for the list shown until the client mounts (or while
214
+ * `loading`). Mirrors a real recency group (`List` + `ListLabel` + rows) so it
215
+ * sits at exactly the same position as the loaded list.
216
+ */
217
+ function ChatSidebarSkeleton() {
218
+ return (React.createElement("output", { "aria-label": "Loading conversations", className: "block pt-1.5" },
219
+ React.createElement("span", { className: "sr-only" }, "Loading conversations"),
220
+ React.createElement(List, { "aria-hidden": "true" },
221
+ React.createElement(ListLabel, null,
222
+ React.createElement(Skeleton, { className: "h-2! w-10! bg-[var(--edge)]!" })),
223
+ ["w-3/4", "w-1/2", "w-2/3", "w-3/5", "w-1/2"].map((width, index) => (React.createElement("div", { key: `${index}-${width}`, className: "px-2.5 py-1.5" },
224
+ React.createElement(Skeleton, { className: cn("h-3! bg-[var(--edge)]!", width) })))))));
225
+ }
226
+ /** Scrollable region. Auto-groups by recency unless given `children`. */
227
+ export function ChatSidebarList({ children, className, }) {
228
+ const { conversations, activeId, onSelect, onDelete, onRename, loading, renderItem, } = useChatSidebarContext();
229
+ // Conversations may load from localStorage (client-only), so the very first
230
+ // paint has none. Show a skeleton until mounted rather than flashing the
231
+ // "no chats yet" state — or whenever the caller explicitly signals `loading`.
232
+ const [mounted, setMounted] = React.useState(false);
233
+ React.useEffect(() => setMounted(true), []);
234
+ const visible = React.useMemo(
235
+ // Newest activity first. (spread first — never sort the source array.)
236
+ () => [...conversations].sort((a, b) => b.updatedAt - a.updatedAt), [conversations]);
237
+ const grouped = React.useMemo(() => groupConversations(visible), [visible]);
238
+ const body = children ?? (!mounted || loading
239
+ ? React.createElement(ChatSidebarSkeleton, null)
240
+ : visible.length > 0
241
+ ? Array.from(grouped.entries()).map(([label, items]) => (React.createElement(ChatSidebarGroup, { key: label, label: label }, items.map((conversation) => {
242
+ if (renderItem) {
243
+ return (React.createElement(React.Fragment, { key: conversation.id }, renderItem(conversation, {
244
+ isActive: conversation.id === activeId,
245
+ onSelect: () => onSelect(conversation.id),
246
+ onDelete: () => onDelete(conversation.id),
247
+ onRename: onRename
248
+ ? (title) => onRename(conversation.id, title)
249
+ : undefined,
250
+ })));
251
+ }
252
+ return React.createElement(ChatSidebarItem, { key: conversation.id, conversation: conversation });
253
+ }))))
254
+ : React.createElement(ChatSidebarEmpty, null));
255
+ return (React.createElement("div", { className: cn("flex-1 overflow-y-auto px-2 pt-2 pb-3 space-y-3", className) }, body));
256
+ }
257
+ ChatSidebarList.displayName = "ChatSidebar.List";
258
+ /** The one-shot preset — composes Root + NewButton + auto List. */
259
+ function ChatSidebarBase(props) {
260
+ // Show the "new" button whenever an action is available (explicit or context).
261
+ const ctx = useConversationsContextOptional();
262
+ const hasNew = props.onNew !== undefined || ctx !== null;
263
+ return (React.createElement(ChatSidebarRoot, { ...props },
264
+ hasNew && React.createElement(ChatSidebarNewButton, null),
265
+ React.createElement(ChatSidebarList, null)));
93
266
  }
267
+ ChatSidebarBase.displayName = "ChatSidebar";
268
+ /** Render a chat sidebar — usable as `<ChatSidebar />` or `<ChatSidebar.Root>…`. */
269
+ export const ChatSidebar = Object.assign(ChatSidebarBase, {
270
+ Root: ChatSidebarRoot,
271
+ NewButton: ChatSidebarNewButton,
272
+ List: ChatSidebarList,
273
+ Group: ChatSidebarGroup,
274
+ Item: ChatSidebarItem,
275
+ Empty: ChatSidebarEmpty,
276
+ });
@@ -8,7 +8,12 @@ import type { ChatDynamicToolPart, ChatToolPart } from "../../../../../agent/rea
8
8
  export interface SkillBadgeProps {
9
9
  tool: ChatToolPart | ChatDynamicToolPart;
10
10
  className?: string;
11
+ /**
12
+ * Override the state icon. When provided, it replaces the built-in
13
+ * loading/complete/error glyphs for all states.
14
+ */
15
+ icon?: React.ReactNode;
11
16
  }
12
17
  /** Render skill badge. */
13
- export declare function SkillBadge({ tool, className }: SkillBadgeProps): React.JSX.Element;
18
+ export declare function SkillBadge({ tool, className, icon }: SkillBadgeProps): React.JSX.Element;
14
19
  //# sourceMappingURL=skill-badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-badge.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/skill-badge.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAE7F,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,GAAG,mBAAmB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,0BAA0B;AAC1B,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAmClF"}
1
+ {"version":3,"file":"skill-badge.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/skill-badge.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAE7F,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,GAAG,mBAAmB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,0BAA0B;AAC1B,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2CxF"}
@@ -6,7 +6,7 @@ import * as React from "../../../../../../react/react.js";
6
6
  import { cn } from "../../theme.js";
7
7
  import { CheckCircleIcon, SparklesIcon, XCircleIcon } from "../../icons/index.js";
8
8
  /** Render skill badge. */
9
- export function SkillBadge({ tool, className }) {
9
+ export function SkillBadge({ tool, className, icon }) {
10
10
  const input = tool.input;
11
11
  const skillId = input?.skillId;
12
12
  const isComplete = tool.state === "output-available";
@@ -27,9 +27,10 @@ export function SkillBadge({ tool, className }) {
27
27
  ? `Script: ${script ?? "complete"}`
28
28
  : `Running${script ? `: ${script}` : ""}...`;
29
29
  }
30
- return (React.createElement("span", { className: cn("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium", "bg-[var(--accent)] text-[var(--muted-foreground)] border border-[var(--border)]", className) },
31
- React.createElement(SparklesIcon, { className: cn("size-3", !isComplete && !isError && "animate-pulse") }),
30
+ return (React.createElement("span", { className: cn("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium", "border border-[var(--outline-border)] bg-transparent text-[var(--faint)]", className) },
31
+ icon ?? (React.createElement(SparklesIcon, { className: cn("size-3", !isComplete && !isError && "animate-pulse") })),
32
32
  React.createElement("span", null, label),
33
- isComplete && React.createElement(CheckCircleIcon, { className: "size-3 text-[var(--success)]" }),
34
- isError && React.createElement(XCircleIcon, { className: "size-3 text-[var(--destructive)]" })));
33
+ icon ? null : (React.createElement(React.Fragment, null,
34
+ isComplete && React.createElement(CheckCircleIcon, { className: "size-3 text-[var(--success)]" }),
35
+ isError && React.createElement(XCircleIcon, { className: "size-3 text-[var(--destructive)]" })))));
35
36
  }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * SkillTool — tool-call row for the `load_skill` skill tool.
3
+ *
4
+ * Rebuilt from the old `SkillBadge` pill into a tool-call ROW that reads as a
5
+ * sibling of the other tool rows (see `tool-ui.tsx`). Forked dependency-light
6
+ * from Studio's `LoadSkillTool` → `ChatTool` (no radix / cva-from-Studio / `@/`
7
+ * imports, no licensed fonts). Variants are built with our private `ui/cva.ts`.
8
+ *
9
+ * Studio labels (from `toolConfigs` `load_skill`):
10
+ * loading → "Loading skill: X" · loaded → "Loaded skill: X"
11
+ *
12
+ * @module react/components/chat/components/skill-tool
13
+ */
14
+ import * as React from "../../../../../../react/react.js";
15
+ import type { ChatDynamicToolPart, ChatToolPart } from "../../../../../agent/react/index.js";
16
+ /** Props accepted by {@link SkillTool}. */
17
+ export interface SkillToolProps {
18
+ /** The skill being loaded (id or filename). Renders in the row label. */
19
+ skill: string;
20
+ /**
21
+ * Tool-call state.
22
+ * - `loading` — Sparkles pulses, label shimmers.
23
+ * - `loaded` — Check appears, label is solid.
24
+ * @default "loaded"
25
+ */
26
+ state?: "loading" | "loaded";
27
+ className?: string;
28
+ }
29
+ /** Render a skill-load tool-call row. */
30
+ export declare function SkillTool({ skill, state, className, }: SkillToolProps): React.JSX.Element;
31
+ /**
32
+ * Derive `SkillTool` props from a skill tool-call part (`load_skill`,
33
+ * `load_skill_reference`, `execute_skill_script`). Lets the message list route
34
+ * skill parts to the `SkillTool` row rather than the old `SkillBadge` pill.
35
+ */
36
+ export declare function getSkillToolProps(tool: ChatToolPart | ChatDynamicToolPart): SkillToolProps;
37
+ //# sourceMappingURL=skill-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-tool.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/skill-tool.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAW7F,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yCAAyC;AACzC,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAgB,EAChB,SAAS,GACV,EAAE,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkBpC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,GAAG,mBAAmB,GACvC,cAAc,CAQhB"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * SkillTool — tool-call row for the `load_skill` skill tool.
3
+ *
4
+ * Rebuilt from the old `SkillBadge` pill into a tool-call ROW that reads as a
5
+ * sibling of the other tool rows (see `tool-ui.tsx`). Forked dependency-light
6
+ * from Studio's `LoadSkillTool` → `ChatTool` (no radix / cva-from-Studio / `@/`
7
+ * imports, no licensed fonts). Variants are built with our private `ui/cva.ts`.
8
+ *
9
+ * Studio labels (from `toolConfigs` `load_skill`):
10
+ * loading → "Loading skill: X" · loaded → "Loaded skill: X"
11
+ *
12
+ * @module react/components/chat/components/skill-tool
13
+ */
14
+ import * as React from "../../../../../../react/react.js";
15
+ import { cn } from "../../theme.js";
16
+ import { cva } from "../../ui/cva.js";
17
+ import { Shimmer } from "../../ui/shimmer.js";
18
+ import { CheckIcon, SparklesIcon } from "../../icons/index.js";
19
+ /** Row chrome — mirrors `ChatTool`: 14px text, soft, single-line. */
20
+ const skillToolRow = cva("flex min-w-0 items-center gap-2 truncate text-sm text-[var(--foreground)]");
21
+ /** Render a skill-load tool-call row. */
22
+ export function SkillTool({ skill, state = "loaded", className, }) {
23
+ const isLoading = state === "loading";
24
+ const label = isLoading ? `Loading skill: ${skill}` : `Loaded skill: ${skill}`;
25
+ return (React.createElement("p", { className: cn(skillToolRow(), className) },
26
+ isLoading
27
+ ? React.createElement(SparklesIcon, { className: "size-3.5! shrink-0 animate-pulse" })
28
+ : React.createElement(CheckIcon, { className: "size-3.5! shrink-0" }),
29
+ isLoading
30
+ ? (React.createElement(Shimmer, { as: "span", duration: 1, className: "min-w-0 truncate" }, label))
31
+ : React.createElement("span", { className: "min-w-0 truncate" }, label)));
32
+ }
33
+ /**
34
+ * Derive `SkillTool` props from a skill tool-call part (`load_skill`,
35
+ * `load_skill_reference`, `execute_skill_script`). Lets the message list route
36
+ * skill parts to the `SkillTool` row rather than the old `SkillBadge` pill.
37
+ */
38
+ export function getSkillToolProps(tool) {
39
+ const input = tool.input;
40
+ const skill = (input?.skillId ?? input?.reference ?? input?.script ??
41
+ "unknown");
42
+ return {
43
+ skill,
44
+ state: tool.state === "output-available" ? "loaded" : "loading",
45
+ };
46
+ }
@@ -6,12 +6,64 @@ export interface Source {
6
6
  score?: number;
7
7
  snippet?: string;
8
8
  }
9
- /** Props accepted by sources. */
9
+ /** Per-list state shared with `Sources.*` sub-parts. */
10
+ export interface SourcesContextValue {
11
+ sources: Source[];
12
+ onSourceClick?: (source: Source, index: number) => void;
13
+ }
14
+ /** Read the enclosing `Sources` state. Throws when used outside a `Sources`. */
15
+ export declare function useSources(): SourcesContextValue;
16
+ /** Props accepted by `Sources` / `Sources.Root`. */
10
17
  export interface SourcesProps {
11
18
  sources: Source[];
12
19
  className?: string;
13
20
  onSourceClick?: (source: Source, index: number) => void;
21
+ /**
22
+ * @deprecated Compose `Sources.Pill` children instead. Optional render-prop
23
+ * for each source pill; when provided, the default anatomy maps items through
24
+ * it rather than rendering `Sources.Pill` directly.
25
+ */
26
+ renderPill?: (source: Source, index: number) => React.ReactNode;
27
+ /** Compose your own row; when omitted, the default anatomy is rendered. */
28
+ children?: React.ReactNode;
29
+ }
30
+ /** Props for `Sources.List` — the flex-wrap row of pills. */
31
+ export interface SourcesListProps {
32
+ className?: string;
33
+ /**
34
+ * @deprecated Compose `Sources.Pill` children instead. Optional render-prop
35
+ * for each source pill.
36
+ */
37
+ renderPill?: (source: Source, index: number) => React.ReactNode;
38
+ /** Compose your own pills; when omitted, one `Sources.Pill` per source. */
39
+ children?: React.ReactNode;
40
+ }
41
+ /** The flex-wrap row. Renders one `Sources.Pill` per source by default. */
42
+ declare function SourcesList({ className, renderPill, children }: SourcesListProps): React.JSX.Element;
43
+ declare namespace SourcesList {
44
+ var displayName: string;
45
+ }
46
+ /** Props accepted by an individual source pill. */
47
+ export interface SourcePillProps {
48
+ source: Source;
49
+ index: number;
50
+ onClick?: () => void;
51
+ className?: string;
52
+ }
53
+ /** Render a single source pill with hover preview and score-color behaviour. */
54
+ export declare function SourcePill({ source, index, onClick, className }: SourcePillProps): React.ReactElement;
55
+ export declare namespace SourcePill {
56
+ var displayName: string;
14
57
  }
15
- /** Render sources. */
16
- export declare const Sources: React.ForwardRefExoticComponent<SourcesProps & React.RefAttributes<HTMLDivElement>>;
58
+ /**
59
+ * Sources — render `<Sources sources={…} />` for the default row, or compose
60
+ * `Sources.Root` + `Sources.List` + `Sources.Pill` for a custom layout.
61
+ * Mirrors the `ToolCall` / `Reasoning` compounds: render it, or compose it.
62
+ */
63
+ export declare const Sources: React.ForwardRefExoticComponent<SourcesProps & React.RefAttributes<HTMLDivElement>> & {
64
+ Root: React.ForwardRefExoticComponent<SourcesProps & React.RefAttributes<HTMLDivElement>>;
65
+ List: typeof SourcesList;
66
+ Pill: typeof SourcePill;
67
+ };
68
+ export {};
17
69
  //# sourceMappingURL=sources.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/sources.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAG1D,sCAAsC;AACtC,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAED,sBAAsB;AACtB,eAAO,MAAM,OAAO,qFAuBnB,CAAC"}
1
+ {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/sources.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAI1D,sCAAsC;AACtC,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAID,gFAAgF;AAChF,wBAAgB,UAAU,IAAI,mBAAmB,CAQhD;AAED,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAChE,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA8BD,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAChE,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,2EAA2E;AAC3E,iBAAS,WAAW,CAClB,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,gBAAgB,GACpD,KAAK,CAAC,GAAG,CAAC,OAAO,CAsBnB;kBAxBQ,WAAW;;;AA2BpB,mDAAmD;AACnD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CACxB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,GACrD,KAAK,CAAC,YAAY,CAkDpB;yBApDe,UAAU;;;AAuD1B;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;CAIlB,CAAC"}
@@ -1,29 +1,63 @@
1
1
  import * as React from "../../../../../../react/react.js";
2
2
  import { cn } from "../../theme.js";
3
- /** Render sources. */
4
- export const Sources = React.forwardRef(function Sources({ sources, className, onSourceClick }, ref) {
3
+ import { COMPONENT_ERROR } from "../../../../../errors/error-registry.js";
4
+ const SourcesContext = React.createContext(null);
5
+ /** Read the enclosing `Sources` state. Throws when used outside a `Sources`. */
6
+ export function useSources() {
7
+ const ctx = React.useContext(SourcesContext);
8
+ if (!ctx) {
9
+ throw COMPONENT_ERROR.create({
10
+ detail: "useSources must be used within a Sources",
11
+ });
12
+ }
13
+ return ctx;
14
+ }
15
+ /**
16
+ * `Sources.Root` — context provider + the row wrapper. No children renders the
17
+ * default anatomy (`List` of `Pill`s); pass children to recompose. Renders
18
+ * nothing when the source list is empty.
19
+ */
20
+ const SourcesRoot = React.forwardRef(function Sources({ sources, className, onSourceClick, renderPill, children }, ref) {
5
21
  if (sources.length === 0)
6
22
  return null;
7
- return (React.createElement("div", { ref: ref, className: cn("mt-3 pt-3 border-t border-[var(--border)]", className) },
8
- React.createElement("p", { className: "text-xs font-medium text-[var(--muted-foreground)] mb-2" }, "Sources"),
9
- React.createElement("div", { className: "flex flex-wrap gap-1.5" }, sources.map((source, index) => (React.createElement(SourcePill, { key: `${source.title}-${index}`, source: source, index: index, onClick: onSourceClick ? () => onSourceClick(source, index) : undefined }))))));
23
+ const context = { sources, onSourceClick };
24
+ return (React.createElement(SourcesContext.Provider, { value: context },
25
+ React.createElement("div", { ref: ref, className: cn("mt-1", className) }, children ?? React.createElement(SourcesList, { renderPill: renderPill }))));
10
26
  });
11
- Sources.displayName = "Sources";
12
- function SourcePill({ source, index, onClick }) {
27
+ SourcesRoot.displayName = "Sources.Root";
28
+ /** The flex-wrap row. Renders one `Sources.Pill` per source by default. */
29
+ function SourcesList({ className, renderPill, children }) {
30
+ const { sources, onSourceClick } = useSources();
31
+ return (React.createElement("div", { className: cn("flex flex-wrap gap-2", className) }, children ?? sources.map((source, index) => renderPill
32
+ ? (React.createElement(React.Fragment, { key: `${source.title}-${index}` }, renderPill(source, index)))
33
+ : (React.createElement(SourcePill, { key: `${source.title}-${index}`, source: source, index: index, onClick: onSourceClick ? () => onSourceClick(source, index) : undefined })))));
34
+ }
35
+ SourcesList.displayName = "Sources.List";
36
+ /** Render a single source pill with hover preview and score-color behaviour. */
37
+ export function SourcePill({ source, index, onClick, className }) {
13
38
  const [showPreview, setShowPreview] = React.useState(false);
14
39
  return (React.createElement("span", { className: "relative" },
15
- React.createElement("button", { type: "button", onClick: onClick, onMouseEnter: () => setShowPreview(true), onMouseLeave: () => setShowPreview(false), className: cn("inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-full text-xs", "bg-[var(--accent)] text-[var(--card-foreground)]", "hover:bg-[var(--accent)] transition-colors", onClick ? "cursor-pointer" : "cursor-default") },
16
- React.createElement("span", { className: "flex items-center justify-center size-4 rounded bg-[var(--border)] text-[10px] font-medium text-[var(--card-foreground)]" }, index + 1),
17
- React.createElement("span", { className: "truncate max-w-[160px]" }, source.title),
18
- source.score != null && (React.createElement("span", { className: "flex items-center gap-1 shrink-0 ml-0.5" },
40
+ React.createElement("button", { type: "button", onClick: onClick, onMouseEnter: () => setShowPreview(true), onMouseLeave: () => setShowPreview(false), className: cn("inline-flex max-w-full items-center gap-1 rounded-full border border-[var(--outline-border)] py-1 pl-1 pr-2 text-xs no-underline", "bg-transparent text-[var(--foreground)]", "transition-colors hover:bg-[var(--tertiary)]", onClick ? "cursor-pointer" : "cursor-default", className) },
41
+ React.createElement("span", { className: "flex size-4 shrink-0 items-center justify-center rounded-full border border-[var(--outline-border)] text-xs font-medium" }, index + 1),
42
+ React.createElement("span", { className: "ml-0.5 max-w-[150px] truncate" }, source.title),
43
+ source.score != null && (React.createElement("span", { className: "ml-0.5 flex shrink-0 items-center gap-1" },
19
44
  React.createElement("span", { className: cn("size-1.5 rounded-full", source.score >= 0.7
20
45
  ? "bg-emerald-500"
21
46
  : source.score >= 0.4
22
47
  ? "bg-amber-500"
23
48
  : "bg-neutral-400") })))),
24
- showPreview && source.snippet && (React.createElement("div", { className: "absolute bottom-full left-0 mb-2 z-50 w-60 pointer-events-none" },
25
- React.createElement("div", { className: "bg-[var(--card)] border border-[var(--border)] rounded-xl shadow-lg p-2.5 text-left" },
26
- React.createElement("p", { className: "text-xs text-[var(--card-foreground)] line-clamp-3 leading-relaxed" },
27
- source.snippet.slice(0, 150),
28
- source.snippet.length > 150 ? "..." : ""))))));
49
+ showPreview && source.snippet && (React.createElement("div", { className: "absolute bottom-full left-0 mb-2 z-50 w-64 pointer-events-none animate-in fade-in duration-150" },
50
+ React.createElement("div", { className: "rounded-lg border border-[var(--outline-border)] bg-[var(--popover)] px-3 py-2 text-left shadow-md" },
51
+ React.createElement("p", { className: "text-xs text-[var(--foreground)] line-clamp-3 leading-relaxed" }, source.snippet))))));
29
52
  }
53
+ SourcePill.displayName = "Sources.Pill";
54
+ /**
55
+ * Sources — render `<Sources sources={…} />` for the default row, or compose
56
+ * `Sources.Root` + `Sources.List` + `Sources.Pill` for a custom layout.
57
+ * Mirrors the `ToolCall` / `Reasoning` compounds: render it, or compose it.
58
+ */
59
+ export const Sources = Object.assign(SourcesRoot, {
60
+ Root: SourcesRoot,
61
+ List: SourcesList,
62
+ Pill: SourcePill,
63
+ });