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
@@ -53,7 +53,7 @@ export default {
53
53
  "app/api/uploads/[id]/route.ts": "import { createUploadHandler } from \"veryfront/embedding\";\nimport { store } from \"../../../../store.ts\";\n\nexport const { DELETE } = createUploadHandler(store, {\n auth: { type: \"none\", allowUnauthenticated: true },\n});\n",
54
54
  "app/api/uploads/route.ts": "import { createUploadHandler } from \"veryfront/embedding\";\nimport { store } from \"../../../store.ts\";\n\nexport const { POST, GET } = createUploadHandler(store, {\n auth: { type: \"none\", allowUnauthenticated: true },\n});\n",
55
55
  "app/layout.tsx": "import \"../globals.css\";\nimport { Head } from \"veryfront/head\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }): React.ReactNode {\n return (\n <>\n <Head><title>Docs Agent</title></Head>\n <div className=\"flex flex-col h-screen\">\n {children}\n </div>\n </>\n );\n}\n",
56
- "app/page.tsx": "'use client'\n\nimport { useState, useEffect, useCallback, useMemo } from 'react'\nimport { ChatWithSidebar, useChat, type QuickAction } from 'veryfront/chat'\n\nconst UPLOAD_API = '/api/uploads'\nconst ACCEPT = '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.csv,.txt,.md,.mdx,.html,.rtf,.epub,.json,.xml'\n\nconst QUICK_ACTIONS: QuickAction[] = [\n { id: 'ask-question', label: 'Ask Question', prompt: 'I have a question about this document: ' },\n { id: 'extract-insights', label: 'Extract Insights', prompt: 'Extract the key insights from the uploaded documents.' },\n { id: 'find-sources', label: 'Find Sources', prompt: 'Find relevant sources and references in the documents for: ' },\n]\n\ninterface Doc { id: string; title: string; source: string; url?: string }\n\nfunction useUploads(api: string) {\n const [docs, setDocs] = useState<Doc[]>([])\n const [uploading, setUploading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const refresh = useCallback(async () => {\n try {\n const res = await fetch(api)\n if (res.ok) {\n const data = await res.json()\n setDocs(Array.isArray(data) ? data : data.uploads ?? [])\n }\n } catch { /* ignore */ }\n }, [api])\n\n useEffect(() => { refresh() }, [refresh])\n\n const upload = useCallback(async (file: File) => {\n setUploading(true)\n setError(null)\n try {\n const form = new FormData()\n form.append('file', file)\n const res = await fetch(api, { method: 'POST', body: form })\n if (!res.ok) throw new Error(await res.text())\n await refresh()\n } catch (e) {\n setError(e instanceof Error ? e.message : 'Upload failed')\n } finally {\n setUploading(false)\n }\n }, [api, refresh])\n\n const remove = useCallback(async (id: string) => {\n await fetch(`${api}/${id}`, { method: 'DELETE' })\n await refresh()\n }, [api, refresh])\n\n const uploads = useMemo(\n () => docs.filter((d) => d.source.startsWith('upload:')),\n [docs],\n )\n\n return { uploads, uploading, error, upload, remove }\n}\n\nexport default function DocsChat() {\n const chat = useChat({ api: '/api/ag-ui' })\n const docs = useUploads(UPLOAD_API)\n\n const attachmentItems = useMemo(() => {\n const items = docs.uploads.map((d) => ({\n id: d.id,\n name: d.title,\n status: 'ready' as const,\n }))\n if (docs.uploading) {\n items.push({ id: '__uploading', name: 'Uploading...', status: 'uploading' as const })\n }\n return items\n }, [docs.uploads, docs.uploading])\n\n const uploadFiles = useMemo(\n () => docs.uploads.map((d) => ({ id: d.id, name: d.title, url: d.url })),\n [docs.uploads],\n )\n\n const handleAttach = useCallback((files: FileList) => {\n for (const file of Array.from(files)) {\n docs.upload(file)\n }\n }, [docs.upload])\n\n const handleQuickAction = useCallback((action: QuickAction) => {\n if (action.prompt) chat.setInput(action.prompt)\n }, [chat.setInput])\n\n return (\n <ChatWithSidebar\n chat={chat}\n sidebar={{ storageKey: 'rag-threads' }}\n features={{ steps: true, tabs: true, sources: true, export: true }}\n models={{\n options: [\n {\n value: 'anthropic/claude-sonnet-4-6',\n label: 'Claude Sonnet',\n },\n {\n value: 'openai/gpt-4.1-mini',\n label: 'GPT-4.1 Mini',\n },\n {\n value: 'google/gemini-2.5-flash',\n label: 'Gemini 2.5 Flash',\n badge: 'Fast',\n },\n ],\n }}\n attachments={{\n uploads: uploadFiles,\n onRemoveUpload: docs.remove,\n onAttach: handleAttach,\n accept: ACCEPT,\n items: attachmentItems,\n onRemoveItem: docs.remove,\n }}\n quickActions={{\n actions: QUICK_ACTIONS,\n onAction: handleQuickAction,\n }}\n message={{\n renderTool: () => null,\n }}\n className=\"flex-1 min-h-0\"\n placeholder=\"Ask anything about your documents...\"\n emptyState={{ title: 'Docs Agent', description: 'Upload files and ask questions' }}\n />\n )\n}\n",
56
+ "app/page.tsx": "'use client'\n\nimport { useCallback, useMemo } from 'react'\nimport {\n Chat,\n ChatSidebar,\n ChatThemeScope,\n ConversationsProvider,\n useChat,\n useUploadsRegistry,\n} from 'veryfront/chat'\n\nconst UPLOAD_API = '/api/uploads'\nconst ACCEPT = '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.csv,.txt,.md,.mdx,.html,.rtf,.epub,.json,.xml'\n\nconst SUGGESTIONS = [\n {\n label: 'Ask Question',\n prompt: 'I have a question about this document: ',\n },\n {\n label: 'Extract Insights',\n prompt: 'Extract the key insights from the uploaded documents.',\n },\n {\n label: 'Find Sources',\n prompt: 'Find relevant sources and references in the documents for: ',\n },\n]\n\nconst MODELS = [\n {\n value: 'anthropic/claude-sonnet-4-6',\n label: 'Claude Sonnet',\n },\n {\n value: 'openai/gpt-4.1-mini',\n label: 'GPT-4.1 Mini',\n },\n {\n value: 'google/gemini-2.5-flash',\n label: 'Gemini 2.5 Flash',\n badge: 'Fast',\n },\n]\n\nfunction DocsChatSurface() {\n const chat = useChat({ api: '/api/ag-ui' })\n const uploads = useUploadsRegistry({ url: UPLOAD_API, storageKey: 'rag-uploads' })\n\n const suggestionLabels = useMemo(\n () => SUGGESTIONS.map((suggestion) => suggestion.label),\n [],\n )\n\n const handleSuggestionClick = useCallback((label: string) => {\n const suggestion = SUGGESTIONS.find((item) => item.label === label)\n chat.setInput(suggestion?.prompt ?? label)\n }, [chat.setInput])\n\n return (\n <ChatThemeScope className=\"flex h-screen min-h-0\">\n <ChatSidebar className=\"w-72 shrink-0 border-r border-[var(--border)]\" />\n <Chat\n chat={chat}\n showSteps\n showTabs\n showSources\n agent={{\n name: 'Docs Agent',\n description: 'Upload files and ask questions',\n models: MODELS,\n }}\n suggestions={suggestionLabels}\n onSuggestionClick={handleSuggestionClick}\n uploads={uploads.items}\n onRemoveUpload={uploads.remove}\n onAttach={uploads.upload}\n onDrop={uploads.upload}\n attachAccept={ACCEPT}\n className=\"flex-1 min-h-0\"\n placeholder=\"Ask anything about your documents...\"\n emptyState={{ title: 'Docs Agent', description: 'Upload files and ask questions' }}\n />\n </ChatThemeScope>\n )\n}\n\nexport default function DocsChat() {\n return (\n <ConversationsProvider storageKey=\"rag-conversations\">\n <DocsChatSurface />\n </ConversationsProvider>\n )\n}\n",
57
57
  "content/architecture.md": "# Architecture\n\nAcme Platform uses a modular, event-driven architecture.\n\n## Core Components\n\n### API Gateway\nRoutes incoming requests to the appropriate microservice. Handles authentication, rate limiting, and request validation.\n\n### Event Bus\nAsynchronous message broker connecting all services. Supports pub/sub and point-to-point messaging patterns.\n\n### Data Layer\nMulti-tenant data storage with automatic sharding. Supports PostgreSQL for relational data and Redis for caching.\n\n## Request Flow\n\n1. Client sends request to API Gateway\n2. Gateway validates authentication token\n3. Request is routed to the target service\n4. Service processes request and publishes events\n5. Response is returned through the gateway\n\n## Scaling\n\nEach component scales independently. The API Gateway uses horizontal scaling with load balancing. Services auto-scale based on queue depth and CPU utilization.\n\n## Security\n\n- All inter-service communication uses mTLS\n- API tokens are rotated every 24 hours\n- Data at rest is encrypted with AES-256\n- Audit logs are retained for 90 days\n",
58
58
  "content/getting-started.md": "# Getting Started\n\nWelcome to Acme Platform. This guide covers initial setup and core concepts.\n\n## Installation\n\nInstall the CLI globally:\n\n```bash\nnpm install -g @acme/cli\n```\n\n## Creating a Project\n\nRun the init command to scaffold a new project:\n\n```bash\nacme init my-project\ncd my-project\n```\n\n## Project Structure\n\n- `src/`: Application source code\n- `config/`: Configuration files\n- `tests/`: Test suite\n- `docs/`: Documentation\n\n## Configuration\n\nCreate an `acme.config.ts` file in your project root:\n\n```ts\nexport default {\n name: \"my-project\",\n region: \"us-east-1\",\n features: [\"auth\", \"storage\"],\n};\n```\n\n## Next Steps\n\n- Read the [Architecture Guide](./architecture) to understand the system design\n- Check [API Reference](./api-reference) for available endpoints\n- Join our Discord community for support\n",
59
59
  "globals.css": "@import \"tailwindcss\";\n",
package/esm/deno.d.ts CHANGED
@@ -20,6 +20,7 @@ declare namespace _default {
20
20
  "./chat/ag-ui": string;
21
21
  "./chat/protocol": string;
22
22
  "./chat/types": string;
23
+ "./chat/uploads": string;
23
24
  "./markdown": string;
24
25
  "./mdx": string;
25
26
  "./agent": string;
@@ -42,6 +43,7 @@ declare namespace _default {
42
43
  "./runs": string;
43
44
  "./skill": string;
44
45
  "./trigger": string;
46
+ "./task": string;
45
47
  "./schedule": string;
46
48
  "./webhook": string;
47
49
  "./mcp": string;
@@ -88,6 +90,7 @@ declare namespace _default {
88
90
  "veryfront/fonts": string;
89
91
  "veryfront/chat": string;
90
92
  "veryfront/chat/types": string;
93
+ "veryfront/chat/uploads": string;
91
94
  "veryfront/markdown": string;
92
95
  "veryfront/mdx": string;
93
96
  "veryfront/fs": string;
@@ -187,6 +190,7 @@ declare namespace _default {
187
190
  "#veryfront/chat/protocol": string;
188
191
  "#veryfront/chat/provider-errors": string;
189
192
  "#veryfront/chat/stream-watchdog": string;
193
+ "#veryfront/chat/uploads": string;
190
194
  "#veryfront/build": string;
191
195
  "#veryfront/cache": string;
192
196
  "#veryfront/config": string;
@@ -346,6 +350,9 @@ declare namespace _default {
346
350
  "coverage:html": string;
347
351
  bench: string;
348
352
  clean: string;
353
+ storybook: string;
354
+ "build:storybook": string;
355
+ "storybook:check": string;
349
356
  lint: string;
350
357
  fmt: string;
351
358
  "fmt:check": string;
@@ -367,6 +374,7 @@ declare namespace _default {
367
374
  "lint:ban-deep-imports": string;
368
375
  "lint:imports": string;
369
376
  "lint:ban-internal-root-imports": string;
377
+ "lint:chat-composability": string;
370
378
  "lint:style": string;
371
379
  "lint:cli-boundary": string;
372
380
  "validate:architecture": string;
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.996",
3
+ "version": "0.1.998",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -59,6 +59,7 @@ export default {
59
59
  "dist/",
60
60
  "coverage/",
61
61
  "scripts/",
62
+ "storybook/",
62
63
  "examples/",
63
64
  "data/",
64
65
  ".deno_cache/",
@@ -76,6 +77,7 @@ export default {
76
77
  "./chat/ag-ui": "./src/chat/ag-ui.ts",
77
78
  "./chat/protocol": "./src/chat/protocol.ts",
78
79
  "./chat/types": "./src/chat/types.ts",
80
+ "./chat/uploads": "./src/chat/upload-handler.ts",
79
81
  "./markdown": "./src/markdown/index.ts",
80
82
  "./mdx": "./src/mdx/index.ts",
81
83
  "./agent": "./src/agent/index.ts",
@@ -98,6 +100,7 @@ export default {
98
100
  "./runs": "./src/runs/index.ts",
99
101
  "./skill": "./src/skill/index.ts",
100
102
  "./trigger": "./src/trigger/index.ts",
103
+ "./task": "./src/task/index.ts",
101
104
  "./schedule": "./src/schedule/index.ts",
102
105
  "./webhook": "./src/webhook/index.ts",
103
106
  "./mcp": "./src/mcp/index.ts",
@@ -144,6 +147,7 @@ export default {
144
147
  "veryfront/fonts": "./src/react/fonts/index.ts",
145
148
  "veryfront/chat": "./src/chat/index.ts",
146
149
  "veryfront/chat/types": "./src/chat/types.ts",
150
+ "veryfront/chat/uploads": "./src/chat/upload-handler.ts",
147
151
  "veryfront/markdown": "./src/markdown/index.ts",
148
152
  "veryfront/mdx": "./src/mdx/index.ts",
149
153
  "veryfront/fs": "./src/fs/index.ts",
@@ -243,6 +247,7 @@ export default {
243
247
  "#veryfront/chat/protocol": "./src/chat/protocol.ts",
244
248
  "#veryfront/chat/provider-errors": "./src/chat/provider-errors.ts",
245
249
  "#veryfront/chat/stream-watchdog": "./src/chat/stream-watchdog.ts",
250
+ "#veryfront/chat/uploads": "./src/chat/upload-handler.ts",
246
251
  "#veryfront/build": "./src/build/index.ts",
247
252
  "#veryfront/cache": "./src/cache/index.ts",
248
253
  "#veryfront/config": "./src/config/index.ts",
@@ -408,12 +413,15 @@ export default {
408
413
  "coverage:html": "deno coverage coverage --include=src/ --exclude=tests '--exclude=src/**/*_test.ts' '--exclude=src/**/*_test.tsx' '--exclude=src/**/*.test.ts' '--exclude=src/**/*.test.tsx' --html",
409
414
  "bench": "VF_DISABLE_LRU_INTERVAL=1 NODE_ENV=production LOG_FORMAT=text deno bench --no-check --allow-all --unstable-worker-options --unstable-net $(find src -name '*.bench.ts')",
410
415
  "clean": "rm -rf .cache/",
416
+ "storybook": "npm --prefix storybook run storybook",
417
+ "build:storybook": "npm --prefix storybook run build-storybook",
418
+ "storybook:check": "deno test --no-lock --config=scripts/test.deno.json --no-check --allow-read scripts/storybook/storybook-workbench.test.ts",
411
419
  "lint": "DENO_NO_PACKAGE_JSON=1 deno lint src/ cli/ react/ && deno lint --config=scripts/test.deno.json scripts/test/ scripts/build/npm-package-metadata.test.ts",
412
420
  "fmt": "deno fmt src/ cli/ react/ && deno fmt --config=scripts/test.deno.json scripts/test/",
413
421
  "fmt:check": "deno fmt --check src/ cli/ react/ && deno fmt --check --config=scripts/test.deno.json scripts/test/",
414
422
  "typecheck": "deno task generate:manifests:check && deno check src/index.ts cli/main.ts src/server/index.ts src/routing/api/index.ts src/rendering/index.ts src/platform/index.ts src/platform/adapters/index.ts src/build/index.ts src/build/production-build/index.ts src/transforms/index.ts src/config/index.ts src/utils/index.ts src/data/index.ts src/security/index.ts src/middleware/index.ts src/server/handlers/dev/index.ts src/server/handlers/request/api/index.ts src/rendering/cache/index.ts src/rendering/cache/stores/index.ts src/rendering/rsc/actions/index.ts src/html/index.ts src/modules/index.ts src/proxy/main.ts src/chat/index.ts src/markdown/index.ts src/mdx/index.ts src/fs/index.ts src/oauth/index.ts src/agent/index.ts src/agent/service/route-export.check.ts src/eval/index.ts src/tool/index.ts src/workflow/index.ts src/work/index.ts src/prompt/index.ts src/resource/index.ts src/runs/index.ts src/mcp/index.ts src/provider/index.ts",
415
- "verify": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck && deno task test && deno task test:e2e:binary",
416
- "verify:quick": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck",
423
+ "verify": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:chat-composability && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck && deno task test && deno task test:e2e:binary",
424
+ "verify:quick": "deno task generate:manifests:check && deno task fmt:check && deno task lint && deno task lint:style && deno task lint:chat-composability && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:core-deps && deno task lint:dependency-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck",
417
425
  "docs": "deno run --allow-read --allow-write --allow-run --allow-env scripts/docs/generate-api-reference.ts",
418
426
  "docs:coverage": "deno run --allow-read scripts/docs/docs-coverage.ts",
419
427
  "docs:copy": "rm -rf ../../docs/docs/code/api-reference && cp -r docs/api-reference/ ../../docs/docs/code/api-reference/",
@@ -429,6 +437,7 @@ export default {
429
437
  "lint:ban-deep-imports": "deno run --allow-read scripts/lint/ban-deep-imports.ts",
430
438
  "lint:imports": "deno run --allow-read scripts/lint/no-cross-boundary-relative-imports.ts",
431
439
  "lint:ban-internal-root-imports": "deno run --allow-read scripts/lint/ban-internal-root-imports.ts",
440
+ "lint:chat-composability": "deno run --allow-read scripts/lint/audit-chat-composability.ts",
432
441
  "lint:style": "deno run --allow-read scripts/lint/enforce-style-conventions.ts",
433
442
  "lint:cli-boundary": "deno run --allow-read scripts/lint/enforce-cli-boundary.ts",
434
443
  "validate:architecture": "deno run --allow-read scripts/lint/validate-architecture.ts",
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=react-dom@19.2.4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-dom@19.2.4.d.ts","sourceRoot":"","sources":["../../../src/deps/esm.sh/react-dom@19.2.4.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /* npm package shim for esm.sh react-dom@19.2.4.js */
2
+ export * from "react-dom";
3
+ export { default } from "react-dom";
@@ -0,0 +1,3 @@
1
+ export * from "../deps/esm.sh/react-dom@19.2.4.js";
2
+ export { default } from "../deps/esm.sh/react-dom@19.2.4.js";
3
+ //# sourceMappingURL=react-dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-dom.d.ts","sourceRoot":"","sources":["../../src/react/react-dom.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "../deps/esm.sh/react-dom@19.2.4.js";
2
+ export { default } from "../deps/esm.sh/react-dom@19.2.4.js";
@@ -1 +1 @@
1
- {"version":3,"file":"host-support.d.ts","sour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;;;;;;;;;;;;;;;;;GAAmC,CAAC;AAElE,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC;AACzF,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC;AACvF,iCAAiC;AACjC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IAC3C,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AA6OD,uCAAuC;AACvC,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAE7E;AAED,8CAA8C;AAC9C,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,WAAW,GAAG,QAAQ,CAAC,CAKjC;AAED,iCAAiC;AACjC,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,EACjC,OAAO,GAAE,4BAAiC,GACzC,OAAO,EAAE,CAsCX;AAED,gDAAgD;AAChD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAQpF;AAED,mDAAmD;AACnD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAUxF;AAED,6CAA6C;AAC7C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,QAAQ,CASlF"}
@@ -181,6 +181,18 @@ function normalizeMessagePart(part, toolNamesById = new Map()) {
181
181
  result: "result" in part ? part.result : undefined,
182
182
  };
183
183
  }
184
+ // Attachments: keep `file`/`image` parts (multimodal input). The composer
185
+ // sends every attachment as `type: "file"`, so route by media type — images
186
+ // become `image` parts the model can view, everything else stays `file`.
187
+ // The `url` may be a fetchable URL or an inline `data:` base64 URL.
188
+ if ((part.type === "file" || part.type === "image") &&
189
+ typeof part.url === "string" && part.url.length > 0 &&
190
+ typeof part.mediaType === "string" && part.mediaType.length > 0) {
191
+ const isImage = part.type === "image" || part.mediaType.startsWith("image/");
192
+ return isImage
193
+ ? { type: "image", url: part.url, mediaType: part.mediaType }
194
+ : { type: "file", url: part.url, mediaType: part.mediaType };
195
+ }
184
196
  return null;
185
197
  }
186
198
  function buildMessageMetadataFields(message) {
@@ -4,11 +4,13 @@
4
4
  * @module agent/react
5
5
  */
6
6
  export { useChat } from "./use-chat/index.js";
7
- export type { BranchInfo, ChatDynamicToolPart, ChatFinishReason, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatStreamEvent, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, InferenceMode, OnToolCallArg, ToolOutput, UseChatOptions, UseChatResult, } from "./use-chat/index.js";
7
+ export type { BranchInfo, ChatDynamicToolPart, ChatFilePart, ChatFinishReason, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatStreamEvent, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, InferenceMode, OnToolCallArg, ToolOutput, UseChatOptions, UseChatResult, } from "./use-chat/index.js";
8
8
  export { useAgent } from "./use-agent.js";
9
9
  export type { UseAgentOptions, UseAgentResult } from "./use-agent.js";
10
- export { getAgentPromptSuggestions, normalizeAgentMetadataResponse, useAgentMetadata, } from "./use-agent-metadata.js";
10
+ export { getAgentPromptSuggestions, normalizeAgentMetadata, normalizeAgentMetadataResponse, useAgentMetadata, } from "./use-agent-metadata.js";
11
11
  export type { AgentMetadata, AgentMetadataPromptSuggestion, AgentMetadataSuggestion, AgentMetadataSuggestions, AgentMetadataTaskSuggestion, UseAgentMetadataResult, } from "./use-agent-metadata.js";
12
+ export { normalizeAgentsListResponse, useAgents } from "./use-agents.js";
13
+ export type { UseAgentsOptions, UseAgentsResult } from "./use-agents.js";
12
14
  export { useCompletion } from "./use-completion.js";
13
15
  export type { UseCompletionOptions, UseCompletionResult } from "./use-completion.js";
14
16
  export { useStreaming } from "./use-streaming.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
1
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8 @@
5
5
  */
6
6
  export { useChat } from "./use-chat/index.js";
7
7
  export { useAgent } from "./use-agent.js";
8
- export { getAgentPromptSuggestions, normalizeAgentMetadataResponse, useAgentMetadata, } from "./use-agent-metadata.js";
8
+ export { getAgentPromptSuggestions, normalizeAgentMetadata, normalizeAgentMetadataResponse, useAgentMetadata, } from "./use-agent-metadata.js";
9
+ export { normalizeAgentsListResponse, useAgents } from "./use-agents.js";
9
10
  export { useCompletion } from "./use-completion.js";
10
11
  export { useStreaming } from "./use-streaming.js";
11
12
  export { useVoiceInput } from "./use-voice-input.js";
@@ -33,6 +33,11 @@ export interface UseAgentMetadataResult {
33
33
  isLoading: boolean;
34
34
  error: Error | null;
35
35
  }
36
+ /**
37
+ * Normalize a single browser-safe agent record (the `agent` object inside the
38
+ * `/api/agents/:id` response, or one entry of the `/api/agents` list).
39
+ */
40
+ export declare function normalizeAgentMetadata(value: unknown): AgentMetadata;
36
41
  /** Normalize the wire response from /api/agents/:id. */
37
42
  export declare function normalizeAgentMetadataResponse(value: unknown): AgentMetadata;
38
43
  /** Return prompt text suggestions that the current Chat component can render. */
@@ -1 +1 @@
1
- {"version":3,"file":"use-agent-metadata.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/react/use-agent-metadata.ts"],"names":[],"mappings":"AAGA,+DAA+D;AAC/D,MAAM,MAAM,6BAA6B,GACrC;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GACC;IACA,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEJ,6DAA6D;AAC7D,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,uCAAuC;AACvC,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GAAG,2BAA2B,CAAC;AAElG,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,uBAAuB,EAAE,CAAC;CACxC;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACxC;AAED,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AA2ED,wDAAwD;AACxD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAa5E;AAED,iFAAiF;AACjF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,MAAM,EAAE,CAK/E;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,sBAAsB,CAkD3F"}
1
+ {"version":3,"file":"use-agent-metadata.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/react/use-agent-metadata.ts"],"names":[],"mappings":"AAGA,+DAA+D;AAC/D,MAAM,MAAM,6BAA6B,GACrC;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GACC;IACA,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEJ,6DAA6D;AAC7D,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,uCAAuC;AACvC,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GAAG,2BAA2B,CAAC;AAElG,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,uBAAuB,EAAE,CAAC;CACxC;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACxC;AAED,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AA2ED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAYpE;AAED,wDAAwD;AACxD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAK5E;AAED,iFAAiF;AACjF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,MAAM,EAAE,CAK/E;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,sBAAsB,CAkD3F"}
@@ -62,19 +62,28 @@ function normalizeSuggestions(value) {
62
62
  suggestions: rawSuggestions.map(normalizeSuggestion),
63
63
  };
64
64
  }
65
+ /**
66
+ * Normalize a single browser-safe agent record (the `agent` object inside the
67
+ * `/api/agents/:id` response, or one entry of the `/api/agents` list).
68
+ */
69
+ export function normalizeAgentMetadata(value) {
70
+ if (!isRecord(value)) {
71
+ throw new Error("Invalid agent metadata: agent must be an object");
72
+ }
73
+ return {
74
+ id: getRequiredString(value, "id"),
75
+ name: getRequiredString(value, "name"),
76
+ description: getNullableString(value, "description"),
77
+ avatarUrl: getNullableString(value, "avatar_url"),
78
+ suggestions: normalizeSuggestions(value.suggestions),
79
+ };
80
+ }
65
81
  /** Normalize the wire response from /api/agents/:id. */
66
82
  export function normalizeAgentMetadataResponse(value) {
67
- if (!isRecord(value) || !isRecord(value.agent)) {
83
+ if (!isRecord(value)) {
68
84
  throw new Error("Invalid agent metadata response");
69
85
  }
70
- const agent = value.agent;
71
- return {
72
- id: getRequiredString(agent, "id"),
73
- name: getRequiredString(agent, "name"),
74
- description: getNullableString(agent, "description"),
75
- avatarUrl: getNullableString(agent, "avatar_url"),
76
- suggestions: normalizeSuggestions(agent.suggestions),
77
- };
86
+ return normalizeAgentMetadata(value.agent);
78
87
  }
79
88
  /** Return prompt text suggestions that the current Chat component can render. */
80
89
  export function getAgentPromptSuggestions(agent) {
@@ -0,0 +1,33 @@
1
+ import { type AgentMetadata } from "./use-agent-metadata.js";
2
+ /** Options accepted by {@link useAgents}. */
3
+ export interface UseAgentsOptions {
4
+ /**
5
+ * When `false`, the request is skipped and the hook stays idle with an empty
6
+ * list. Flip it to `true` to fetch (or refetch). Defaults to `true`.
7
+ */
8
+ enabled?: boolean;
9
+ }
10
+ /** Result returned from {@link useAgents}. */
11
+ export interface UseAgentsResult {
12
+ /** Browser-safe metadata for every agent the project exposes, sorted by name. */
13
+ agents: AgentMetadata[];
14
+ /** `true` while the list request is in flight. */
15
+ isLoading: boolean;
16
+ /** The last request error, or `null`. */
17
+ error: Error | null;
18
+ /** Re-run the request, bypassing nothing — always hits the network. */
19
+ refetch: () => void;
20
+ }
21
+ /** Normalize the wire response from `GET /api/agents`. */
22
+ export declare function normalizeAgentsListResponse(value: unknown): AgentMetadata[];
23
+ /**
24
+ * React hook that lists the browser-safe agents a project exposes, via
25
+ * `GET /api/agents`. Companion to {@link useAgentMetadata} (single agent) — use
26
+ * it to drive an agent switcher, e.g. only rendering a picker when
27
+ * `agents.length > 1`.
28
+ *
29
+ * The in-flight request is aborted on unmount, on option change, and before a
30
+ * `refetch`, so state never lands from a stale response.
31
+ */
32
+ export declare function useAgents(options?: UseAgentsOptions): UseAgentsResult;
33
+ //# sourceMappingURL=use-agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-agents.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/react/use-agents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,yBAAyB,CAAC;AAErF,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,8CAA8C;AAC9C,MAAM,WAAW,eAAe;IAC9B,iFAAiF;IACjF,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,uEAAuE;IACvE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAQD,0DAA0D;AAC1D,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,EAAE,CAK3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAuDzE"}
@@ -0,0 +1,72 @@
1
+ import { useCallback, useEffect, useState } from "../../../react/react.js";
2
+ import { ensureError } from "../../errors/veryfront-error.js";
3
+ import { normalizeAgentMetadata } from "./use-agent-metadata.js";
4
+ function isRecord(value) {
5
+ return value !== null && typeof value === "object" && !Array.isArray(value);
6
+ }
7
+ /** Normalize the wire response from `GET /api/agents`. */
8
+ export function normalizeAgentsListResponse(value) {
9
+ if (!isRecord(value) || !Array.isArray(value.agents)) {
10
+ throw new Error("Invalid agents list response: agents must be an array");
11
+ }
12
+ return value.agents.map(normalizeAgentMetadata);
13
+ }
14
+ /**
15
+ * React hook that lists the browser-safe agents a project exposes, via
16
+ * `GET /api/agents`. Companion to {@link useAgentMetadata} (single agent) — use
17
+ * it to drive an agent switcher, e.g. only rendering a picker when
18
+ * `agents.length > 1`.
19
+ *
20
+ * The in-flight request is aborted on unmount, on option change, and before a
21
+ * `refetch`, so state never lands from a stale response.
22
+ */
23
+ export function useAgents(options = {}) {
24
+ const { enabled = true } = options;
25
+ const [agents, setAgents] = useState([]);
26
+ const [isLoading, setIsLoading] = useState(enabled);
27
+ const [error, setError] = useState(null);
28
+ // Bumping this re-runs the effect below to force a fresh request.
29
+ const [reloadToken, setReloadToken] = useState(0);
30
+ const refetch = useCallback(() => {
31
+ setReloadToken((token) => token + 1);
32
+ }, []);
33
+ useEffect(() => {
34
+ if (!enabled) {
35
+ setAgents([]);
36
+ setIsLoading(false);
37
+ setError(null);
38
+ return;
39
+ }
40
+ const abortController = new AbortController();
41
+ setIsLoading(true);
42
+ setError(null);
43
+ async function loadAgents() {
44
+ try {
45
+ const response = await fetch("/api/agents", {
46
+ headers: { accept: "application/json" },
47
+ signal: abortController.signal,
48
+ });
49
+ if (!response.ok) {
50
+ throw new Error(`Agents list request failed: ${response.status}`);
51
+ }
52
+ setAgents(normalizeAgentsListResponse(await response.json()));
53
+ }
54
+ catch (caught) {
55
+ if (caught instanceof Error && caught.name === "AbortError")
56
+ return;
57
+ setAgents([]);
58
+ setError(ensureError(caught));
59
+ }
60
+ finally {
61
+ if (!abortController.signal.aborted) {
62
+ setIsLoading(false);
63
+ }
64
+ }
65
+ }
66
+ void loadAgents();
67
+ return () => {
68
+ abortController.abort();
69
+ };
70
+ }, [enabled, reloadToken]);
71
+ return { agents, isLoading, error, refetch };
72
+ }
@@ -5,6 +5,6 @@
5
5
  * Build any interface you want.
6
6
  */
7
7
  export { useChat } from "./use-chat.js";
8
- export type { BranchInfo, ChatDynamicToolPart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, InferenceMode, OnToolCallArg, ToolOutput, UseChatOptions, UseChatResult, } from "./types.js";
8
+ export type { BranchInfo, ChatDynamicToolPart, ChatFilePart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, InferenceMode, OnToolCallArg, ToolOutput, UseChatOptions, UseChatResult, } from "./types.js";
9
9
  export type { ChatFinishReason, ChatStreamEvent, } from "./stream-protocol.js";
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,sBAAsB,CAAC"}
@@ -1,7 +1,7 @@
1
- import type { ChatDataPart, ChatDynamicToolPart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState } from "../../../chat/protocol.js";
1
+ import type { ChatDataPart, ChatDynamicToolPart, ChatFilePart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState } from "../../../chat/protocol.js";
2
2
  /** Where inference is happening. */
3
3
  export type InferenceMode = "cloud" | "server-local";
4
- export type { ChatDataPart, ChatDynamicToolPart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, };
4
+ export type { ChatDataPart, ChatDynamicToolPart, ChatFilePart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, };
5
5
  type ToolOutputState = "output-available" | "output-error";
6
6
  /** Output from tool. */
7
7
  export interface ToolOutput {
@@ -59,6 +59,7 @@ export interface UseChatResult {
59
59
  setModel: (model: string | undefined) => void;
60
60
  sendMessage: (message: {
61
61
  text: string;
62
+ files?: ChatFilePart[];
62
63
  }) => Promise<void>;
63
64
  /** Edit a user message and resubmit — truncates history to that point */
64
65
  editMessage: (messageId: string, newText: string) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,cAAc,CAAC;AAErD,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YA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,CAAC,CAAC;IACrD,sFAAsF;IACtF,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACjF,iFAAiF;IACjF,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,kFAAkF;IAClF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACpD"}
@@ -9,7 +9,7 @@
9
9
  * - server-local: explicit local model on the server
10
10
  */
11
11
  import { handleAgUiStreamingResponse } from "./streaming/index.js";
12
- import type { ChatMessage, UseChatOptions, UseChatResult } from "./types.js";
12
+ import type { ChatFilePart, ChatMessage, ChatMessagePart, UseChatOptions, UseChatResult } from "./types.js";
13
13
  type UseChatStreamHandler = typeof handleAgUiStreamingResponse;
14
14
  /** A snapshot of messages from a branch point onward */
15
15
  interface Branch {
@@ -24,6 +24,17 @@ interface BranchState {
24
24
  export declare function isLatestRequest(activeRequestId: number, requestId: number): boolean;
25
25
  export declare function resolveBranchKey(messageId: string, branchMap: Map<string, BranchState>, branchKeyByMessageId: Map<string, string>): string | undefined;
26
26
  export declare function findBranchUserMessageIndex(messages: ChatMessage[], branchKey: string, branchKeyByMessageId: Map<string, string>): number;
27
+ /**
28
+ * Build the parts for an outgoing user message. File attachments lead (before
29
+ * the text) so the model sees the referenced files first — matching how AI-SDK
30
+ * orders multimodal parts. Exported for unit testing.
31
+ */
32
+ export declare function buildUserMessageParts(text: string, files?: ChatFilePart[]): ChatMessagePart[];
33
+ /** Extract the text and file payload from a user message for regenerate. */
34
+ export declare function userMessagePayload(message: ChatMessage): {
35
+ text: string;
36
+ files?: ChatFilePart[];
37
+ } | null;
27
38
  export declare function resolveUseChatStreamHandler(transport: UseChatOptions["transport"]): UseChatStreamHandler;
28
39
  export declare function useChat(options?: UseChatOptions): UseChatResult;
29
40
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"use-chat.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/use-chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAEV,WAAW,EAGX,cAAc,EACd,aAAa,EACd,MAAM,YAAY,CAAC;AAGpB,KAAK,oBAAoB,GAAG,OAAO,2BAA2B,CAAC;AAE/D,wDAAwD;AACxD,UAAU,MAAM;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,sEAAsE;AACtE,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAEnF;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACxC,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,WAAW,EAAE,EACvB,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACxC,MAAM,CAIR;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,GACrC,oBAAoB,CAGtB;AAOD,wBAAgB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CA8ZnE"}
1
+ {"version":3,"file":"use-chat.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/use-chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,O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AAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CAsbnE"}
@@ -22,6 +22,28 @@ export function resolveBranchKey(messageId, branchMap, branchKeyByMessageId) {
22
22
  export function findBranchUserMessageIndex(messages, branchKey, branchKeyByMessageId) {
23
23
  return messages.findIndex((m) => m.role === "user" && branchKeyByMessageId.get(m.id) === branchKey);
24
24
  }
25
+ /**
26
+ * Build the parts for an outgoing user message. File attachments lead (before
27
+ * the text) so the model sees the referenced files first — matching how AI-SDK
28
+ * orders multimodal parts. Exported for unit testing.
29
+ */
30
+ export function buildUserMessageParts(text, files) {
31
+ return [...(files ?? []), { type: "text", text }];
32
+ }
33
+ function isFilePart(part) {
34
+ return part.type === "file";
35
+ }
36
+ /** Extract the text and file payload from a user message for regenerate. */
37
+ export function userMessagePayload(message) {
38
+ const text = message.parts
39
+ .filter((part) => part.type === "text")
40
+ .map((part) => part.text)
41
+ .join("");
42
+ const files = message.parts.filter(isFilePart);
43
+ if (!text && files.length === 0)
44
+ return null;
45
+ return { text, ...(files.length > 0 ? { files } : {}) };
46
+ }
25
47
  export function resolveUseChatStreamHandler(transport) {
26
48
  void transport;
27
49
  return handleAgUiStreamingResponse;
@@ -88,7 +110,8 @@ export function useChat(options = {}) {
88
110
  const userMessage = {
89
111
  id: message.userMessageId ?? generateClientId("msg"),
90
112
  role: "user",
91
- parts: [{ type: "text", text: message.text }],
113
+ parts: buildUserMessageParts(message.text, message.files),
114
+ createdAt: new Date().toISOString(),
92
115
  };
93
116
  const base = message.baseMessages ?? messagesRef.current;
94
117
  setMessages([...base, userMessage]);
@@ -151,7 +174,12 @@ export function useChat(options = {}) {
151
174
  if (!hasAddedStreamingMessage)
152
175
  return [...prev, withMeta];
153
176
  return prev.map((m) => (m.id === currentMessageIdRef.current
154
- ? { ...withMeta, metadata: { ...m.metadata, ...withMeta.metadata } }
177
+ ? {
178
+ ...withMeta,
179
+ // Keep the timestamp from when the turn first streamed in.
180
+ createdAt: m.createdAt ?? withMeta.createdAt,
181
+ metadata: { ...m.metadata, ...withMeta.metadata },
182
+ }
155
183
  : m));
156
184
  });
157
185
  options.onFinish?.(withMeta);
@@ -187,7 +215,17 @@ export function useChat(options = {}) {
187
215
  }
188
216
  if (!hasAddedStreamingMessage) {
189
217
  hasAddedStreamingMessage = true;
190
- setMessages((prev) => [...prev, { id, role: "assistant", parts, metadata }]);
218
+ setMessages((prev) => [
219
+ ...prev,
220
+ {
221
+ id,
222
+ role: "assistant",
223
+ parts,
224
+ metadata,
225
+ // Stamp when the turn first appears; `onMessage` preserves it.
226
+ createdAt: new Date().toISOString(),
227
+ },
228
+ ]);
191
229
  return;
192
230
  }
193
231
  setMessages((prev) => prev.map((m) => m.id === currentMessageIdRef.current
@@ -223,11 +261,13 @@ export function useChat(options = {}) {
223
261
  if (lastUserIndex === -1)
224
262
  return;
225
263
  const lastUserMessage = currentMessages[lastUserIndex];
226
- const textPart = lastUserMessage?.parts.find((p) => p.type === "text");
227
- if (!textPart || !("text" in textPart))
264
+ if (!lastUserMessage)
265
+ return;
266
+ const payload = userMessagePayload(lastUserMessage);
267
+ if (!payload)
228
268
  return;
229
269
  const base = currentMessages.slice(0, lastUserIndex);
230
- await sendMessage({ text: textPart.text, baseMessages: base });
270
+ await sendMessage({ ...payload, baseMessages: base });
231
271
  }, [sendMessage]);
232
272
  /**
233
273
  * Stop generation
@@ -368,7 +408,7 @@ export function useChat(options = {}) {
368
408
  data,
369
409
  handleInputChange,
370
410
  handleSubmit,
371
- // Aliases that match ChatProps / ChatWithSidebarProps so users can spread {...chat}
411
+ // Aliases that match ChatProps so users can spread {...chat}
372
412
  onChange: handleInputChange,
373
413
  onSubmit: handleSubmit,
374
414
  onModelChange: setModel,