veryfront 0.1.1048 → 0.1.1049

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 (513) hide show
  1. package/esm/cli/templates/manifest.js +3 -3
  2. package/esm/deno.d.ts +3 -0
  3. package/esm/deno.js +10 -6
  4. package/esm/src/agent/react/use-agent-metadata.js +1 -1
  5. package/esm/src/agent/react/use-agent.js +1 -1
  6. package/esm/src/agent/react/use-agents.js +1 -1
  7. package/esm/src/agent/react/use-chat/types.d.ts +0 -6
  8. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  9. package/esm/src/agent/react/use-chat/use-chat.d.ts +5 -0
  10. package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
  11. package/esm/src/agent/react/use-chat/use-chat.js +87 -34
  12. package/esm/src/agent/react/use-completion.js +1 -1
  13. package/esm/src/agent/react/use-streaming.js +1 -1
  14. package/esm/src/agent/react/use-voice-input.js +1 -1
  15. package/esm/src/cache/backends/api.d.ts.map +1 -1
  16. package/esm/src/cache/backends/api.js +10 -7
  17. package/esm/src/chat/index.d.ts +8 -15
  18. package/esm/src/chat/index.d.ts.map +1 -1
  19. package/esm/src/chat/index.js +7 -16
  20. package/esm/src/modules/component-registry/registry.d.ts +1 -1
  21. package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
  22. package/esm/src/modules/react-loader/component-loader.d.ts +1 -1
  23. package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
  24. package/esm/src/modules/react-loader/extract-component.d.ts +1 -1
  25. package/esm/src/modules/react-loader/extract-component.d.ts.map +1 -1
  26. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +1 -1
  27. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
  28. package/esm/src/modules/react-loader/types.d.ts +1 -1
  29. package/esm/src/modules/react-loader/types.d.ts.map +1 -1
  30. package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts +3 -1
  31. package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts.map +1 -1
  32. package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.js +2 -0
  33. package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts +4 -0
  34. package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts.map +1 -1
  35. package/esm/src/platform/adapters/fs/veryfront/request-context.js +1 -0
  36. package/esm/src/proxy/main.js +6 -5
  37. package/esm/src/proxy/retry.d.ts +14 -6
  38. package/esm/src/proxy/retry.d.ts.map +1 -1
  39. package/esm/src/proxy/retry.js +82 -20
  40. package/esm/src/react/compat/hooks-adapter.d.ts +1 -1
  41. package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
  42. package/esm/src/react/compat/hooks-adapter.js +1 -1
  43. package/esm/src/react/compat/ssr-adapter/response-builder.d.ts +1 -1
  44. package/esm/src/react/compat/ssr-adapter/response-builder.d.ts.map +1 -1
  45. package/esm/src/react/compat/ssr-adapter/server-loader.d.ts +5 -5
  46. package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
  47. package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts +1 -1
  48. package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts.map +1 -1
  49. package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts +1 -1
  50. package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts.map +1 -1
  51. package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
  52. package/esm/src/react/components/AppWrapper.d.ts +1 -1
  53. package/esm/src/react/components/AppWrapper.d.ts.map +1 -1
  54. package/esm/src/react/components/AppWrapper.js +1 -1
  55. package/esm/src/react/components/LayoutComponent.d.ts +1 -1
  56. package/esm/src/react/components/LayoutComponent.d.ts.map +1 -1
  57. package/esm/src/react/components/LayoutComponent.js +1 -1
  58. package/esm/src/react/components/MDXProvider.d.ts +1 -1
  59. package/esm/src/react/components/MDXProvider.d.ts.map +1 -1
  60. package/esm/src/react/components/MDXProvider.js +1 -1
  61. package/esm/src/react/components/ProviderComponent.d.ts +1 -1
  62. package/esm/src/react/components/ProviderComponent.d.ts.map +1 -1
  63. package/esm/src/react/components/ProviderComponent.js +1 -1
  64. package/esm/src/react/components/chat/agent-card.d.ts +15 -7
  65. package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
  66. package/esm/src/react/components/chat/agent-card.js +9 -10
  67. package/esm/src/react/components/chat/agent-picker-actions.d.ts +20 -0
  68. package/esm/src/react/components/chat/agent-picker-actions.d.ts.map +1 -0
  69. package/esm/src/react/components/chat/agent-picker-actions.js +24 -0
  70. package/esm/src/react/components/chat/agent-picker-context.d.ts +19 -0
  71. package/esm/src/react/components/chat/agent-picker-context.d.ts.map +1 -0
  72. package/esm/src/react/components/chat/agent-picker-context.js +13 -0
  73. package/esm/src/react/components/chat/agent-picker.d.ts +35 -42
  74. package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -1
  75. package/esm/src/react/components/chat/agent-picker.js +59 -50
  76. package/esm/src/react/components/chat/chat/app-mode-chat.d.ts +14 -0
  77. package/esm/src/react/components/chat/chat/app-mode-chat.d.ts.map +1 -0
  78. package/esm/src/react/components/chat/chat/app-mode-chat.js +137 -0
  79. package/esm/src/react/components/chat/chat/chat-attachments.d.ts +7 -0
  80. package/esm/src/react/components/chat/chat/chat-attachments.d.ts.map +1 -0
  81. package/esm/src/react/components/chat/chat/chat-attachments.js +16 -0
  82. package/esm/src/react/components/chat/chat/chat-component.d.ts +21 -0
  83. package/esm/src/react/components/chat/chat/chat-component.d.ts.map +1 -0
  84. package/esm/src/react/components/chat/chat/chat-component.js +1 -0
  85. package/esm/src/react/components/chat/chat/chat-props.d.ts +114 -0
  86. package/esm/src/react/components/chat/chat/chat-props.d.ts.map +1 -0
  87. package/esm/src/react/components/chat/chat/chat-props.js +1 -0
  88. package/esm/src/react/components/chat/chat/components/animations.d.ts +1 -1
  89. package/esm/src/react/components/chat/chat/components/animations.d.ts.map +1 -1
  90. package/esm/src/react/components/chat/chat/components/animations.js +1 -1
  91. package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +18 -18
  92. package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
  93. package/esm/src/react/components/chat/chat/components/attachment-pill.js +11 -15
  94. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +14 -3
  95. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -1
  96. package/esm/src/react/components/chat/chat/components/attachments-panel.js +3 -3
  97. package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +44 -14
  98. package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
  99. package/esm/src/react/components/chat/chat/components/branch-picker.js +55 -12
  100. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +1 -1
  101. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -1
  102. package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +1 -1
  103. package/esm/src/react/components/chat/chat/components/code-block.d.ts +7 -2
  104. package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
  105. package/esm/src/react/components/chat/chat/components/code-block.js +3 -3
  106. package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +1 -1
  107. package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
  108. package/esm/src/react/components/chat/chat/components/drop-zone.js +1 -1
  109. package/esm/src/react/components/chat/chat/components/empty-state.d.ts +1 -1
  110. package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
  111. package/esm/src/react/components/chat/chat/components/empty-state.js +1 -1
  112. package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +1 -1
  113. package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
  114. package/esm/src/react/components/chat/chat/components/inference-badge.js +1 -1
  115. package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +33 -10
  116. package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
  117. package/esm/src/react/components/chat/chat/components/inline-citation.js +145 -51
  118. package/esm/src/react/components/chat/chat/components/message-actions.d.ts +49 -20
  119. package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
  120. package/esm/src/react/components/chat/chat/components/message-actions.js +72 -18
  121. package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +1 -1
  122. package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
  123. package/esm/src/react/components/chat/chat/components/message-edit-form.js +1 -1
  124. package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +34 -14
  125. package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
  126. package/esm/src/react/components/chat/chat/components/message-feedback.js +54 -15
  127. package/esm/src/react/components/chat/chat/components/quick-actions.d.ts +1 -1
  128. package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
  129. package/esm/src/react/components/chat/chat/components/quick-actions.js +1 -1
  130. package/esm/src/react/components/chat/chat/components/reasoning.d.ts +14 -6
  131. package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
  132. package/esm/src/react/components/chat/chat/components/reasoning.js +3 -5
  133. package/esm/src/react/components/chat/chat/components/sidebar.d.ts +70 -16
  134. package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
  135. package/esm/src/react/components/chat/chat/components/sidebar.js +72 -23
  136. package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +1 -1
  137. package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
  138. package/esm/src/react/components/chat/chat/components/skill-badge.js +1 -1
  139. package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +1 -1
  140. package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -1
  141. package/esm/src/react/components/chat/chat/components/skill-tool.js +1 -1
  142. package/esm/src/react/components/chat/chat/components/sources.d.ts +25 -15
  143. package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
  144. package/esm/src/react/components/chat/chat/components/sources.js +7 -7
  145. package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +14 -3
  146. package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
  147. package/esm/src/react/components/chat/chat/components/step-indicator.js +3 -3
  148. package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
  149. package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
  150. package/esm/src/react/components/chat/chat/components/tab-switcher.js +1 -1
  151. package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +16 -9
  152. package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
  153. package/esm/src/react/components/chat/chat/components/tool-ui.js +10 -14
  154. package/esm/src/react/components/chat/chat/composition/agent-avatar.d.ts +1 -1
  155. package/esm/src/react/components/chat/chat/composition/agent-avatar.d.ts.map +1 -1
  156. package/esm/src/react/components/chat/chat/composition/agent-avatar.js +1 -1
  157. package/esm/src/react/components/chat/chat/composition/api.d.ts +3 -3
  158. package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
  159. package/esm/src/react/components/chat/chat/composition/api.js +2 -2
  160. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +72 -29
  161. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
  162. package/esm/src/react/components/chat/chat/composition/chat-composer.js +92 -82
  163. package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +1 -1
  164. package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -1
  165. package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +1 -1
  166. package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +7 -2
  167. package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
  168. package/esm/src/react/components/chat/chat/composition/chat-empty.js +3 -3
  169. package/esm/src/react/components/chat/chat/composition/chat-if.d.ts +1 -1
  170. package/esm/src/react/components/chat/chat/composition/chat-if.d.ts.map +1 -1
  171. package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +25 -11
  172. package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
  173. package/esm/src/react/components/chat/chat/composition/chat-message-list.js +67 -29
  174. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +7 -3
  175. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
  176. package/esm/src/react/components/chat/chat/composition/chat-root.js +3 -5
  177. package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +7 -2
  178. package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
  179. package/esm/src/react/components/chat/chat/composition/error-banner.js +3 -3
  180. package/esm/src/react/components/chat/chat/composition/message.d.ts +85 -34
  181. package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
  182. package/esm/src/react/components/chat/chat/composition/message.js +146 -122
  183. package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +1 -1
  184. package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
  185. package/esm/src/react/components/chat/chat/composition/model-avatar.js +1 -1
  186. package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +1 -1
  187. package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -1
  188. package/esm/src/react/components/chat/chat/composition/pending-message.js +1 -1
  189. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +2 -3
  190. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
  191. package/esm/src/react/components/chat/chat/contexts/chat-context.js +1 -1
  192. package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +2 -2
  193. package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
  194. package/esm/src/react/components/chat/chat/contexts/composer-context.js +1 -1
  195. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +2 -2
  196. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -1
  197. package/esm/src/react/components/chat/chat/contexts/conversations-context.js +1 -1
  198. package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
  199. package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
  200. package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
  201. package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +15 -2
  202. package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
  203. package/esm/src/react/components/chat/chat/contexts/message-context.js +11 -1
  204. package/esm/src/react/components/chat/chat/controlled-chat.d.ts +15 -0
  205. package/esm/src/react/components/chat/chat/controlled-chat.d.ts.map +1 -0
  206. package/esm/src/react/components/chat/chat/controlled-chat.js +97 -0
  207. package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +1 -1
  208. package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.d.ts +54 -0
  209. package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.d.ts.map +1 -0
  210. package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.js +179 -0
  211. package/esm/src/react/components/chat/chat/hooks/use-conversation.js +1 -1
  212. package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -1
  213. package/esm/src/react/components/chat/chat/hooks/use-conversations.js +3 -6
  214. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +8 -5
  215. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -1
  216. package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +6 -6
  217. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +1 -1
  218. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -1
  219. package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +1 -1
  220. package/esm/src/react/components/chat/chat/hooks/use-upload.js +1 -1
  221. package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +1 -1
  222. package/esm/src/react/components/chat/chat/index.d.ts +13 -230
  223. package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
  224. package/esm/src/react/components/chat/chat/index.js +27 -383
  225. package/esm/src/react/components/chat/chat-actions.d.ts +1 -1
  226. package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -1
  227. package/esm/src/react/components/chat/chat-actions.js +1 -1
  228. package/esm/src/react/components/chat/chat-agent-picker.d.ts +1 -1
  229. package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -1
  230. package/esm/src/react/components/chat/chat-agent-picker.js +1 -1
  231. package/esm/src/react/components/chat/chat-theme-scope.d.ts +1 -1
  232. package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -1
  233. package/esm/src/react/components/chat/chat-theme-scope.js +1 -1
  234. package/esm/src/react/components/chat/chat.d.ts +6 -6
  235. package/esm/src/react/components/chat/chat.d.ts.map +1 -1
  236. package/esm/src/react/components/chat/chat.js +4 -4
  237. package/esm/src/react/components/chat/error-boundary.d.ts +1 -1
  238. package/esm/src/react/components/chat/error-boundary.d.ts.map +1 -1
  239. package/esm/src/react/components/chat/error-boundary.js +1 -1
  240. package/esm/src/react/components/chat/markdown.d.ts +3 -5
  241. package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
  242. package/esm/src/react/components/chat/markdown.js +4 -72
  243. package/esm/src/react/components/chat/model-selector.d.ts +21 -27
  244. package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
  245. package/esm/src/react/components/chat/model-selector.js +26 -31
  246. package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts +1 -1
  247. package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts.map +1 -1
  248. package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.js +1 -1
  249. package/esm/src/react/components/optimized-image/OptimizedImage.d.ts +1 -1
  250. package/esm/src/react/components/optimized-image/OptimizedImage.d.ts.map +1 -1
  251. package/esm/src/react/components/optimized-image/OptimizedImage.js +1 -1
  252. package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts +1 -1
  253. package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts.map +1 -1
  254. package/esm/src/react/components/optimized-image/utils.d.ts +1 -1
  255. package/esm/src/react/components/optimized-image/utils.d.ts.map +1 -1
  256. package/esm/src/react/components/optimized-image/utils.js +1 -1
  257. package/esm/src/react/components/ui/alert.d.ts +1 -1
  258. package/esm/src/react/components/ui/alert.d.ts.map +1 -1
  259. package/esm/src/react/components/ui/alert.js +1 -1
  260. package/esm/src/react/components/ui/app-shell.d.ts +1 -1
  261. package/esm/src/react/components/ui/app-shell.d.ts.map +1 -1
  262. package/esm/src/react/components/ui/app-shell.js +1 -1
  263. package/esm/src/react/components/ui/avatar.d.ts +1 -1
  264. package/esm/src/react/components/ui/avatar.d.ts.map +1 -1
  265. package/esm/src/react/components/ui/avatar.js +1 -1
  266. package/esm/src/react/components/ui/badge.d.ts +1 -1
  267. package/esm/src/react/components/ui/badge.d.ts.map +1 -1
  268. package/esm/src/react/components/ui/badge.js +1 -1
  269. package/esm/src/react/components/ui/button.d.ts +1 -1
  270. package/esm/src/react/components/ui/button.d.ts.map +1 -1
  271. package/esm/src/react/components/ui/button.js +1 -1
  272. package/esm/src/react/components/ui/card.d.ts +1 -1
  273. package/esm/src/react/components/ui/card.d.ts.map +1 -1
  274. package/esm/src/react/components/ui/card.js +1 -1
  275. package/esm/src/react/components/ui/checkbox.d.ts +1 -1
  276. package/esm/src/react/components/ui/checkbox.d.ts.map +1 -1
  277. package/esm/src/react/components/ui/checkbox.js +1 -1
  278. package/esm/src/react/components/ui/code-block.d.ts +1 -1
  279. package/esm/src/react/components/ui/code-block.d.ts.map +1 -1
  280. package/esm/src/react/components/ui/code-block.js +1 -1
  281. package/esm/src/react/components/ui/collapsible.d.ts +1 -1
  282. package/esm/src/react/components/ui/collapsible.d.ts.map +1 -1
  283. package/esm/src/react/components/ui/collapsible.js +1 -1
  284. package/esm/src/react/components/ui/color-mode.d.ts +2 -2
  285. package/esm/src/react/components/ui/color-mode.d.ts.map +1 -1
  286. package/esm/src/react/components/ui/color-mode.js +1 -1
  287. package/esm/src/react/components/ui/command.d.ts +1 -1
  288. package/esm/src/react/components/ui/command.d.ts.map +1 -1
  289. package/esm/src/react/components/ui/command.js +1 -1
  290. package/esm/src/react/components/ui/dialog.d.ts +1 -1
  291. package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
  292. package/esm/src/react/components/ui/dialog.js +1 -1
  293. package/esm/src/react/components/ui/drawer.d.ts +1 -1
  294. package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
  295. package/esm/src/react/components/ui/drawer.js +1 -1
  296. package/esm/src/react/components/ui/dropdown-menu.d.ts +1 -1
  297. package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
  298. package/esm/src/react/components/ui/dropdown-menu.js +1 -1
  299. package/esm/src/react/components/ui/file-type.d.ts +1 -1
  300. package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
  301. package/esm/src/react/components/ui/file-type.js +1 -1
  302. package/esm/src/react/components/ui/floating.d.ts +1 -1
  303. package/esm/src/react/components/ui/floating.d.ts.map +1 -1
  304. package/esm/src/react/components/ui/floating.js +2 -2
  305. package/esm/src/react/components/ui/icon-button.d.ts +1 -1
  306. package/esm/src/react/components/ui/icon-button.d.ts.map +1 -1
  307. package/esm/src/react/components/ui/icon-button.js +1 -1
  308. package/esm/src/react/components/ui/icons/index.d.ts +1 -1
  309. package/esm/src/react/components/ui/icons/index.d.ts.map +1 -1
  310. package/esm/src/react/components/ui/icons/index.js +1 -1
  311. package/esm/src/react/components/ui/input.d.ts +1 -1
  312. package/esm/src/react/components/ui/input.d.ts.map +1 -1
  313. package/esm/src/react/components/ui/input.js +1 -1
  314. package/esm/src/react/components/ui/label.d.ts +1 -1
  315. package/esm/src/react/components/ui/label.d.ts.map +1 -1
  316. package/esm/src/react/components/ui/label.js +1 -1
  317. package/esm/src/react/components/ui/list.d.ts +1 -1
  318. package/esm/src/react/components/ui/list.d.ts.map +1 -1
  319. package/esm/src/react/components/ui/list.js +1 -1
  320. package/esm/src/react/components/ui/pill.d.ts +1 -1
  321. package/esm/src/react/components/ui/pill.d.ts.map +1 -1
  322. package/esm/src/react/components/ui/pill.js +1 -1
  323. package/esm/src/react/components/ui/popover.d.ts +1 -1
  324. package/esm/src/react/components/ui/popover.d.ts.map +1 -1
  325. package/esm/src/react/components/ui/popover.js +1 -1
  326. package/esm/src/react/components/ui/progress-bar.d.ts +1 -1
  327. package/esm/src/react/components/ui/progress-bar.d.ts.map +1 -1
  328. package/esm/src/react/components/ui/progress-bar.js +1 -1
  329. package/esm/src/react/components/ui/radio.d.ts +1 -1
  330. package/esm/src/react/components/ui/radio.d.ts.map +1 -1
  331. package/esm/src/react/components/ui/radio.js +1 -1
  332. package/esm/src/react/components/ui/scroll-fade.d.ts +1 -1
  333. package/esm/src/react/components/ui/scroll-fade.d.ts.map +1 -1
  334. package/esm/src/react/components/ui/scroll-fade.js +1 -1
  335. package/esm/src/react/components/ui/select.d.ts +1 -1
  336. package/esm/src/react/components/ui/select.d.ts.map +1 -1
  337. package/esm/src/react/components/ui/select.js +1 -1
  338. package/esm/src/react/components/ui/shimmer.d.ts +1 -1
  339. package/esm/src/react/components/ui/shimmer.d.ts.map +1 -1
  340. package/esm/src/react/components/ui/shimmer.js +1 -1
  341. package/esm/src/react/components/ui/skeleton.d.ts +1 -1
  342. package/esm/src/react/components/ui/skeleton.d.ts.map +1 -1
  343. package/esm/src/react/components/ui/skeleton.js +1 -1
  344. package/esm/src/react/components/ui/slot.d.ts +1 -1
  345. package/esm/src/react/components/ui/slot.d.ts.map +1 -1
  346. package/esm/src/react/components/ui/slot.js +1 -1
  347. package/esm/src/react/components/ui/status.d.ts +1 -1
  348. package/esm/src/react/components/ui/status.d.ts.map +1 -1
  349. package/esm/src/react/components/ui/status.js +1 -1
  350. package/esm/src/react/components/ui/switch.d.ts +1 -1
  351. package/esm/src/react/components/ui/switch.d.ts.map +1 -1
  352. package/esm/src/react/components/ui/switch.js +1 -1
  353. package/esm/src/react/components/ui/tabs.d.ts +3 -3
  354. package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
  355. package/esm/src/react/components/ui/tabs.js +1 -1
  356. package/esm/src/react/components/ui/tag.d.ts +1 -1
  357. package/esm/src/react/components/ui/tag.d.ts.map +1 -1
  358. package/esm/src/react/components/ui/tag.js +1 -1
  359. package/esm/src/react/components/ui/textarea.d.ts +1 -1
  360. package/esm/src/react/components/ui/textarea.d.ts.map +1 -1
  361. package/esm/src/react/components/ui/textarea.js +1 -1
  362. package/esm/src/react/components/ui/tokens.d.ts +1 -1
  363. package/esm/src/react/components/ui/tokens.d.ts.map +1 -1
  364. package/esm/src/react/components/ui/tokens.js +1 -1
  365. package/esm/src/react/components/ui/tooltip.d.ts +1 -1
  366. package/esm/src/react/components/ui/tooltip.d.ts.map +1 -1
  367. package/esm/src/react/components/ui/tooltip.js +2 -2
  368. package/esm/src/react/fonts/index.d.ts +1 -1
  369. package/esm/src/react/fonts/index.d.ts.map +1 -1
  370. package/esm/src/react/fonts/index.js +1 -1
  371. package/esm/src/react/primitives/agent-primitives.d.ts +4 -4
  372. package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
  373. package/esm/src/react/primitives/agent-primitives.js +1 -1
  374. package/esm/src/react/primitives/chat-container.d.ts +2 -2
  375. package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
  376. package/esm/src/react/primitives/chat-container.js +1 -1
  377. package/esm/src/react/primitives/input-box.d.ts +4 -4
  378. package/esm/src/react/primitives/input-box.d.ts.map +1 -1
  379. package/esm/src/react/primitives/input-box.js +1 -1
  380. package/esm/src/react/primitives/message-list.d.ts +5 -5
  381. package/esm/src/react/primitives/message-list.d.ts.map +1 -1
  382. package/esm/src/react/primitives/message-list.js +1 -1
  383. package/esm/src/react/primitives/tool-primitives.d.ts +4 -4
  384. package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
  385. package/esm/src/react/primitives/tool-primitives.js +1 -1
  386. package/esm/src/react/runtime/core.d.ts +1 -1
  387. package/esm/src/react/runtime/core.d.ts.map +1 -1
  388. package/esm/src/react/runtime/core.js +1 -1
  389. package/esm/src/rendering/app-reserved.d.ts +1 -1
  390. package/esm/src/rendering/app-reserved.d.ts.map +1 -1
  391. package/esm/src/rendering/app-reserved.js +1 -1
  392. package/esm/src/rendering/component-handling.d.ts +1 -1
  393. package/esm/src/rendering/component-handling.d.ts.map +1 -1
  394. package/esm/src/rendering/element-validator/element-normalizer.d.ts +1 -1
  395. package/esm/src/rendering/element-validator/element-normalizer.d.ts.map +1 -1
  396. package/esm/src/rendering/element-validator/element-normalizer.js +1 -1
  397. package/esm/src/rendering/element-validator/primitive-checks.d.ts +1 -1
  398. package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
  399. package/esm/src/rendering/element-validator/primitive-checks.js +1 -1
  400. package/esm/src/rendering/element-validator/validator-core.d.ts +1 -1
  401. package/esm/src/rendering/element-validator/validator-core.d.ts.map +1 -1
  402. package/esm/src/rendering/layouts/layout-applicator.d.ts +1 -1
  403. package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
  404. package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
  405. package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
  406. package/esm/src/rendering/layouts/utils/component-loader.d.ts +1 -1
  407. package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
  408. package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts +1 -1
  409. package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts.map +1 -1
  410. package/esm/src/rendering/orchestrator/layout.d.ts +1 -1
  411. package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
  412. package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts +1 -1
  413. package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
  414. package/esm/src/rendering/page-renderer.d.ts +1 -1
  415. package/esm/src/rendering/page-renderer.d.ts.map +1 -1
  416. package/esm/src/rendering/page-rendering.d.ts +1 -1
  417. package/esm/src/rendering/page-rendering.d.ts.map +1 -1
  418. package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts +1 -1
  419. package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
  420. package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts +1 -1
  421. package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
  422. package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts +1 -1
  423. package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
  424. package/esm/src/rendering/rsc/server-renderer/tree-processor.js +1 -1
  425. package/esm/src/rendering/snippet-renderer.js +2 -2
  426. package/esm/src/rendering/ssr/component-registry.d.ts +1 -1
  427. package/esm/src/rendering/ssr/component-registry.d.ts.map +1 -1
  428. package/esm/src/rendering/ssr/component-registry.js +1 -1
  429. package/esm/src/rendering/ssr/mdx-renderer.d.ts +1 -1
  430. package/esm/src/rendering/ssr/mdx-renderer.d.ts.map +1 -1
  431. package/esm/src/rendering/ssr/mdx-renderer.js +1 -1
  432. package/esm/src/rendering/ssr/types.d.ts +1 -1
  433. package/esm/src/rendering/ssr/types.d.ts.map +1 -1
  434. package/esm/src/rendering/ssr-renderer.d.ts +1 -1
  435. package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
  436. package/esm/src/rendering/utils/react-helpers.d.ts +1 -1
  437. package/esm/src/rendering/utils/react-helpers.d.ts.map +1 -1
  438. package/esm/src/rendering/utils/react-helpers.js +1 -1
  439. package/esm/src/security/http/base-handler.d.ts +2 -0
  440. package/esm/src/security/http/base-handler.d.ts.map +1 -1
  441. package/esm/src/security/http/base-handler.js +1 -0
  442. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  443. package/esm/src/server/handlers/dev/framework-candidates.generated.js +841 -596
  444. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  445. package/esm/src/server/handlers/request/agent-stream.handler.js +4 -1
  446. package/esm/src/transforms/mdx/esm-module-loader/components/resolver.d.ts +1 -1
  447. package/esm/src/transforms/mdx/esm-module-loader/components/resolver.d.ts.map +1 -1
  448. package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +1 -1
  449. package/esm/src/transforms/mdx/index.d.ts +1 -1
  450. package/esm/src/transforms/mdx/index.d.ts.map +1 -1
  451. package/esm/src/transforms/mdx/index.js +1 -1
  452. package/esm/src/transforms/mdx/mdx-cache-adapter.js +1 -1
  453. package/esm/src/transforms/mdx/module-loader/types.d.ts +1 -1
  454. package/esm/src/transforms/mdx/module-loader/types.d.ts.map +1 -1
  455. package/esm/src/transforms/mdx/types.d.ts +2 -2
  456. package/esm/src/transforms/mdx/types.d.ts.map +1 -1
  457. package/esm/src/types/app.d.ts +1 -1
  458. package/esm/src/types/app.d.ts.map +1 -1
  459. package/esm/src/types/global-guards.d.ts +1 -1
  460. package/esm/src/types/global-guards.d.ts.map +1 -1
  461. package/esm/src/types/index.d.ts +1 -1
  462. package/esm/src/types/index.d.ts.map +1 -1
  463. package/esm/src/utils/id.d.ts +7 -0
  464. package/esm/src/utils/id.d.ts.map +1 -1
  465. package/esm/src/utils/id.js +22 -0
  466. package/esm/src/utils/version-constant.d.ts +1 -1
  467. package/esm/src/utils/version-constant.js +1 -1
  468. package/esm/src/workflow/claude-code/react/use-claude-code-stream.js +1 -1
  469. package/esm/src/workflow/claude-code/react/use-claude-code-websocket.js +1 -1
  470. package/esm/src/workflow/react/use-approval.js +1 -1
  471. package/esm/src/workflow/react/use-workflow-list.js +1 -1
  472. package/esm/src/workflow/react/use-workflow-start.js +1 -1
  473. package/esm/src/workflow/react/use-workflow.js +1 -1
  474. package/package.json +4 -5
  475. package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts +0 -3
  476. package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts.map +0 -1
  477. package/esm/deps/esm.sh/react-dom@19.2.4/client.js +0 -3
  478. package/esm/deps/esm.sh/react-dom@19.2.4/server.d.ts +0 -3
  479. package/esm/deps/esm.sh/react-dom@19.2.4/server.d.ts.map +0 -1
  480. package/esm/deps/esm.sh/react-dom@19.2.4/server.js +0 -3
  481. package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +0 -3
  482. package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +0 -1
  483. package/esm/deps/esm.sh/react-dom@19.2.4.js +0 -3
  484. package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.d.ts +0 -3
  485. package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.d.ts.map +0 -1
  486. package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.js +0 -3
  487. package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.d.ts +0 -3
  488. package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.d.ts.map +0 -1
  489. package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.js +0 -3
  490. package/esm/deps/esm.sh/react@19.2.4.d.ts +0 -3
  491. package/esm/deps/esm.sh/react@19.2.4.d.ts.map +0 -1
  492. package/esm/deps/esm.sh/react@19.2.4.js +0 -3
  493. package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts +0 -3
  494. package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts.map +0 -1
  495. package/esm/deps/esm.sh/scheduler@^0.27.0.js +0 -3
  496. package/esm/react/jsx-dev-runtime.d.ts +0 -2
  497. package/esm/react/jsx-dev-runtime.d.ts.map +0 -1
  498. package/esm/react/jsx-dev-runtime.js +0 -1
  499. package/esm/react/jsx-runtime.d.ts +0 -2
  500. package/esm/react/jsx-runtime.d.ts.map +0 -1
  501. package/esm/react/jsx-runtime.js +0 -1
  502. package/esm/react/react-dom-client.d.ts +0 -3
  503. package/esm/react/react-dom-client.d.ts.map +0 -1
  504. package/esm/react/react-dom-client.js +0 -2
  505. package/esm/react/react-dom-server.d.ts +0 -3
  506. package/esm/react/react-dom-server.d.ts.map +0 -1
  507. package/esm/react/react-dom-server.js +0 -2
  508. package/esm/react/react-dom.d.ts +0 -3
  509. package/esm/react/react-dom.d.ts.map +0 -1
  510. package/esm/react/react-dom.js +0 -2
  511. package/esm/react/react.d.ts +0 -6
  512. package/esm/react/react.d.ts.map +0 -1
  513. package/esm/react/react.js +0 -7
@@ -22,7 +22,7 @@
22
22
  import * as dntShim from "../../_dnt.shims.js";
23
23
  import { createProxyHandler, INTERNAL_PROXY_HEADERS } from "./handler.js";
24
24
  import { createCacheFromEnv } from "./cache/index.js";
25
- import { getFramedRequestBody, getUpstreamRetryCount, isRetryableConnectionError, } from "./retry.js";
25
+ import { getReplayableRequestBodies, getUpstreamRetryCount, shouldRetryUpstreamRequest, } from "./retry.js";
26
26
  import { authorizeWebSocketRequest, closeBridgePeer, createProxyClientWebSocketUpgradeOptions, getClientWebSocketErrorLogLevel, getServerWebSocketErrorLogLevel, } from "./websocket-bridge.js";
27
27
  import { register } from "../extensions/contracts.js";
28
28
  import { importFirstPartyExtensionModule } from "../extensions/first-party-import.js";
@@ -301,8 +301,8 @@ function forwardToServer(req, url) {
301
301
  newHeaders.set("x-branch-name", ctx.branchName);
302
302
  newHeaders.delete("host");
303
303
  injectContext(newHeaders);
304
- const maxRetries = getUpstreamRetryCount(req.method, url.pathname, req.headers, VERYFRONT_SERVER_RETRY_COUNT);
305
- const upstreamBody = getFramedRequestBody(req.headers, req.body);
304
+ const maxRetries = getUpstreamRetryCount(req, url.pathname, VERYFRONT_SERVER_RETRY_COUNT);
305
+ const upstreamBodies = getReplayableRequestBodies(req, maxRetries);
306
306
  let lastError = null;
307
307
  // After a retryable connection error to a dedicated server, fall back to shared pool
308
308
  let skipDedicated = false;
@@ -333,7 +333,7 @@ function forwardToServer(req, url) {
333
333
  const response = await profileProxyServerTimingPhase(proxyTiming, "proxy.upstream", () => withSpan(ProxySpanNames.HTTP_CLIENT_FETCH, () => fetch(serverUrl.toString(), {
334
334
  method: req.method,
335
335
  headers: newHeaders,
336
- body: upstreamBody,
336
+ body: upstreamBodies[attempt] ?? null,
337
337
  redirect: "manual",
338
338
  signal: abortController.signal,
339
339
  }), {
@@ -372,7 +372,8 @@ function forwardToServer(req, url) {
372
372
  return withProxyTiming(createUpstreamTimeoutResponse(VERYFRONT_SERVER_REQUEST_TIMEOUT_MS));
373
373
  }
374
374
  // Check if this is a retryable error and we have retries left
375
- if (isRetryableConnectionError(error) && attempt < maxRetries) {
375
+ if (shouldRetryUpstreamRequest(req, url.pathname, error) &&
376
+ attempt < maxRetries) {
376
377
  // If we were targeting a dedicated server, fall back to shared pool on retry
377
378
  if (dedicatedServerUrl) {
378
379
  skipDedicated = true;
@@ -9,11 +9,19 @@ export declare function isRetryableConnectionError(error: unknown): boolean;
9
9
  /**
10
10
  * Decide how many times the proxy can safely retry an upstream request.
11
11
  *
12
- * Ordinary non-idempotent requests are not replayed. The control-plane run
13
- * stream attach endpoint is a bodyless POST, so it can safely retry once to
14
- * fall back from an unavailable dedicated runtime to the shared runtime during
15
- * operator reconciliation.
12
+ * Ordinary non-idempotent requests are not replayed. A bounded control-plane
13
+ * run stream invocation may retry to the shared runtime when the dedicated
14
+ * runtime refuses the connection. Missing, chunked, invalid, and oversized
15
+ * bodies remain single-shot so cloning cannot buffer unbounded input.
16
16
  */
17
- export declare function getUpstreamRetryCount(method: string, pathname: string, headers: Headers, configuredRetryCount: number): number;
18
- export declare function getFramedRequestBody(headers: Headers, body: ReadableStream<Uint8Array> | null): ReadableStream<Uint8Array> | null;
17
+ export declare function getUpstreamRetryCount(request: Request, pathname: string, configuredRetryCount: number): number;
18
+ /** Decide whether this failure mode is safe to replay for the request. */
19
+ export declare function shouldRetryUpstreamRequest(request: Request, pathname: string, error: unknown): boolean;
20
+ /**
21
+ * Build one independently consumable body stream for every upstream attempt.
22
+ * Request bodies are one-shot streams, so reusing the first stream would make
23
+ * a retry fail before it reaches the fallback runtime. Cloning before the
24
+ * first fetch preserves the exact signed bytes for each attempt.
25
+ */
26
+ export declare function getReplayableRequestBodies(request: Request, retryCount: number): Array<ReadableStream<Uint8Array> | null>;
19
27
  //# sourceMappingURL=retry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAUlE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAQR;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,GACtC,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAEnC"}
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAUlE;AAwCD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAUR;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,GACb,OAAO,CAQT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,GACjB,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAc1C"}
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Retry utilities for the proxy server.
3
3
  */
4
+ import { DEFAULT_MAX_BODY_SIZE_BYTES } from "../utils/constants/index.js";
5
+ const CONTROL_PLANE_RUN_STREAM_PATH = /^\/api\/control-plane\/runs\/[^/]+\/stream$/;
4
6
  /**
5
7
  * Check if a fetch error is a transient connection error worth retrying.
6
8
  * These occur when renderer pods are being recycled or temporarily unavailable.
@@ -16,30 +18,90 @@ export function isRetryableConnectionError(error) {
16
18
  msg.includes("os error 111") // ECONNREFUSED
17
19
  );
18
20
  }
21
+ function isConnectionRefusedError(error) {
22
+ if (!(error instanceof Error))
23
+ return false;
24
+ const message = error.message.toLowerCase();
25
+ return message.includes("connection refused") || message.includes("os error 111");
26
+ }
27
+ function isIdempotentMethod(method) {
28
+ return method === "GET" || method === "HEAD" || method === "OPTIONS";
29
+ }
30
+ function isControlPlaneRunStreamPost(request, pathname) {
31
+ return request.method === "POST" && CONTROL_PLANE_RUN_STREAM_PATH.test(pathname);
32
+ }
33
+ function getRequestBodyReplayKind(request) {
34
+ const transferEncoding = request.headers.get("transfer-encoding");
35
+ if (transferEncoding !== null && transferEncoding.trim() !== "") {
36
+ return "unsupported";
37
+ }
38
+ const contentLength = request.headers.get("content-length");
39
+ if (contentLength === null)
40
+ return request.body === null ? "bodyless" : "unsupported";
41
+ const normalizedLength = contentLength.trim();
42
+ if (!/^\d+$/.test(normalizedLength))
43
+ return "unsupported";
44
+ const length = Number(normalizedLength);
45
+ if (length === 0)
46
+ return "bodyless";
47
+ if (request.body === null ||
48
+ !Number.isSafeInteger(length) ||
49
+ length > DEFAULT_MAX_BODY_SIZE_BYTES) {
50
+ return "unsupported";
51
+ }
52
+ return "bounded";
53
+ }
19
54
  /**
20
55
  * Decide how many times the proxy can safely retry an upstream request.
21
56
  *
22
- * Ordinary non-idempotent requests are not replayed. The control-plane run
23
- * stream attach endpoint is a bodyless POST, so it can safely retry once to
24
- * fall back from an unavailable dedicated runtime to the shared runtime during
25
- * operator reconciliation.
57
+ * Ordinary non-idempotent requests are not replayed. A bounded control-plane
58
+ * run stream invocation may retry to the shared runtime when the dedicated
59
+ * runtime refuses the connection. Missing, chunked, invalid, and oversized
60
+ * bodies remain single-shot so cloning cannot buffer unbounded input.
26
61
  */
27
- export function getUpstreamRetryCount(method, pathname, headers, configuredRetryCount) {
28
- if (["GET", "HEAD", "OPTIONS"].includes(method))
29
- return configuredRetryCount;
30
- const isBodylessControlPlaneRunStreamPost = method === "POST" &&
31
- requestHeadersDeclareBody(headers) === false &&
32
- /^\/api\/control-plane\/runs\/[^/]+\/stream$/.test(pathname);
33
- return isBodylessControlPlaneRunStreamPost ? configuredRetryCount : 0;
34
- }
35
- export function getFramedRequestBody(headers, body) {
36
- return requestHeadersDeclareBody(headers) ? body : null;
37
- }
38
- function requestHeadersDeclareBody(headers) {
39
- const contentLength = headers.get("content-length");
40
- if (contentLength !== null && contentLength.trim() !== "" && contentLength !== "0") {
62
+ export function getUpstreamRetryCount(request, pathname, configuredRetryCount) {
63
+ const bodyKind = getRequestBodyReplayKind(request);
64
+ if (bodyKind === "unsupported")
65
+ return 0;
66
+ const retryCount = Math.max(0, configuredRetryCount);
67
+ if (isIdempotentMethod(request.method))
68
+ return retryCount;
69
+ if (isControlPlaneRunStreamPost(request, pathname)) {
70
+ return Math.min(retryCount, 1);
71
+ }
72
+ return 0;
73
+ }
74
+ /** Decide whether this failure mode is safe to replay for the request. */
75
+ export function shouldRetryUpstreamRequest(request, pathname, error) {
76
+ if (!isRetryableConnectionError(error))
77
+ return false;
78
+ if (isIdempotentMethod(request.method))
79
+ return true;
80
+ if (!isControlPlaneRunStreamPost(request, pathname))
81
+ return false;
82
+ const bodyKind = getRequestBodyReplayKind(request);
83
+ if (bodyKind === "bodyless")
41
84
  return true;
85
+ return bodyKind === "bounded" && isConnectionRefusedError(error);
86
+ }
87
+ /**
88
+ * Build one independently consumable body stream for every upstream attempt.
89
+ * Request bodies are one-shot streams, so reusing the first stream would make
90
+ * a retry fail before it reaches the fallback runtime. Cloning before the
91
+ * first fetch preserves the exact signed bytes for each attempt.
92
+ */
93
+ export function getReplayableRequestBodies(request, retryCount) {
94
+ const attemptCount = Math.max(0, retryCount) + 1;
95
+ const bodyKind = getRequestBodyReplayKind(request);
96
+ if (bodyKind === "bodyless") {
97
+ return Array.from({ length: attemptCount }, () => null);
98
+ }
99
+ if (bodyKind === "unsupported" || attemptCount === 1)
100
+ return [request.body];
101
+ const bodies = [];
102
+ for (let attempt = 1; attempt < attemptCount; attempt++) {
103
+ bodies.push(request.clone().body);
42
104
  }
43
- const transferEncoding = headers.get("transfer-encoding");
44
- return transferEncoding !== null && transferEncoding.trim() !== "";
105
+ bodies.push(request.body);
106
+ return bodies;
45
107
  }
@@ -1,4 +1,4 @@
1
- import * as React from "../../../react/react.js";
1
+ import * as React from "react";
2
2
  export interface FormStatus {
3
3
  pending: boolean;
4
4
  data: FormData | null;
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-adapter.d.ts","sourceRoot":"","sources":["../../../../src/src/react/compat/hooks-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAGjD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,KAAK,KAAK,CAAC,CAAC;AAmBpF,wBAAgB,iCAAiC,CAC/C,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAC1C;IACD,OAAO,IAAI,IAAI,CAAC;IAChB,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC7C,CAoBA;AAED,wBAAgB,mBAAmB,IAAI,UAAU,CAWhD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,EAChE,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,e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gB,EAAE,OAAO,sBAAsB,CAAC;IAChD,KAAK,EAAE,OAAO,WAAW,CAAC;CAC3B;AAkBD;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,KAAK,CAAC,YAAY,CAMrB;AAED,eAAO,MAAM,WAAW,aAAqB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../../../_dnt.shims.js";
2
2
  import { rendererLogger as logger } from "../../utils/index.js";
3
- import * as React from "../../../react/react.js";
3
+ import * as React from "react";
4
4
  import { getReactVersionInfo, hasFeature } from "./version-detector/index.js";
5
5
  function hasReactHook(hookName) {
6
6
  return typeof React[hookName] === "function";
@@ -1,4 +1,4 @@
1
- import type * as React from "../../../../react/react.js";
1
+ import type * as React from "react";
2
2
  import type { SSRResponseOptions } from "./types.js";
3
3
  export declare function createSSRResponse(element: React.ReactNode, options?: SSRResponseOptions): Promise<Response>;
4
4
  //# sourceMappingURL=response-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-builder.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/response-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAIzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAUrD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,QAAQ,CAAC,CA0BnB"}
1
+ {"version":3,"file":"response-builder.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/response-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAUrD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,QAAQ,CAAC,CA0BnB"}
@@ -1,14 +1,14 @@
1
1
  export interface ReactDOMServer {
2
- renderToString: typeof import("../../../../react/react-dom-server.js").renderToString;
3
- renderToStaticMarkup: typeof import("../../../../react/react-dom-server.js").renderToStaticMarkup;
4
- renderToPipeableStream?: typeof import("../../../../react/react-dom-server.js").renderToPipeableStream;
5
- renderToReadableStream?: typeof import("../../../../react/react-dom-server.js").renderToReadableStream;
2
+ renderToString: typeof import("react-dom/server").renderToString;
3
+ renderToStaticMarkup: typeof import("react-dom/server").renderToStaticMarkup;
4
+ renderToPipeableStream?: typeof import("react-dom/server").renderToPipeableStream;
5
+ renderToReadableStream?: typeof import("react-dom/server").renderToReadableStream;
6
6
  }
7
7
  type ServerModuleLoader = (url: string, label: string, reactVersion: string) => Promise<unknown>;
8
8
  export declare function resetReactCache(): void;
9
9
  export declare function __injectReactDOMServerForTests(server: ReactDOMServer | null, version?: string): void;
10
10
  export declare function __setServerModuleLoaderForTests(loader: ServerModuleLoader | null): void;
11
- export declare function getProjectReact(version?: string): Promise<typeof import("../../../../react/react.js")>;
11
+ export declare function getProjectReact(version?: string): Promise<typeof import("react")>;
12
12
  export declare function getReactDOMServer(version?: string): Promise<ReactDOMServer>;
13
13
  export {};
14
14
  //# sourceMappingURL=server-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/server-loader.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,cAAc,uCAAuC,EAAE,cAAc,CAAC;IACtF,oBAAoB,EAAE,cAAc,uCAAuC,EAAE,oBAAoB,CAAC;IAClG,sBAAsB,CAAC,EAAE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,cAAc,GAAG,IAAI,EAC7B,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAON;AAeD,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAEvF;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,OAAO,CAAC,CAAC,CA4BjF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAqC3E"}
@@ -1,4 +1,4 @@
1
- import * as React from "../../../../react/react.js";
1
+ import * as React from "react";
2
2
  import type { SSROptions, SSRResult } from "./types.js";
3
3
  export declare function __setSSRStreamTimeoutForTests(timeoutMs: number): void;
4
4
  export declare function __resetSSRStreamRendererForTests(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"stream-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/stream-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAKpD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAexD,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAErE;AAED,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAwMD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,CAAC,CAwBpB"}
1
+ {"version":3,"file":"stream-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/stream-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAexD,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAErE;AAED,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAwMD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,SAAS,CAAC,CAwBpB"}
@@ -1,4 +1,4 @@
1
- import * as React from "../../../../react/react.js";
1
+ import * as React from "react";
2
2
  import type { SSROptions } from "./types.js";
3
3
  export declare function renderToStringAdapter(element: React.ReactNode, options?: SSROptions): Promise<string>;
4
4
  export declare function renderToStaticMarkupAdapter(element: React.ReactNode, options?: SSROptions): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"string-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/string-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAKpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAiB7C,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAmCjB;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
1
+ {"version":3,"file":"string-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/compat/ssr-adapter/string-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAiB7C,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAmCjB;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
@@ -1,6 +1,6 @@
1
1
  import { rendererLogger as logger } from "../../../utils/index.js";
2
2
  import { readTextFile } from "../../../platform/compat/fs.js";
3
- import * as React from "../../../../react/react.js";
3
+ import * as React from "react";
4
4
  import { isReact17, isReact18, isReact19, parseVersion } from "./version-parser.js";
5
5
  export function detectFeatures(major, minor, isReact19Flag) {
6
6
  const isReact18Plus = major >= 18;
@@ -1,4 +1,4 @@
1
- import * as React from "../../../react/react.js";
1
+ import * as React from "react";
2
2
  import type { MDXComponents, PageContext as TypedPageContext } from "../../types/index.js";
3
3
  import type { MdxBundle } from "./LayoutComponent.js";
4
4
  export interface AppWrapperProps {
@@ -1 +1 @@
1
- {"version":3,"file":"AppWrapper.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/AppWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAc,EACd,MAAM,EACN,UAAe,EACf,WAAW,GACZ,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CAqBnC"}
1
+ {"version":3,"file":"AppWrapper.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/AppWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAc,EACd,MAAM,EACN,UAAe,EACf,WAAW,GACZ,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CAqBnC"}
@@ -1,4 +1,4 @@
1
- import * as React from "../../../react/react.js";
1
+ import * as React from "react";
2
2
  import { LayoutComponent } from "./LayoutComponent.js";
3
3
  import { ProviderComponent } from "./ProviderComponent.js";
4
4
  export function AppWrapper({ children, providers = [], layout, components = {}, pageContext, }) {
@@ -1,4 +1,4 @@
1
- import type React from "../../../react/react.js";
1
+ import type React from "react";
2
2
  import type { MdxBundle, MDXComponents, PageContext as TypedPageContext } from "../../types/index.js";
3
3
  export type { MdxBundle } from "../../types/index.js";
4
4
  interface LayoutComponentProps {
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/LayoutComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAGjD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGtG,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,UAAU,oBAAoB;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAcD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,QAAQ,EACR,UAAe,EACf,WAAW,GACZ,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CA6B3C"}
1
+ {"version":3,"file":"LayoutComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/LayoutComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGtG,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,UAAU,oBAAoB;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAcD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,QAAQ,EACR,UAAe,EACf,WAAW,GACZ,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CA6B3C"}
@@ -1,4 +1,4 @@
1
- import { useMemo, useRef } from "../../../react/react.js";
1
+ import { useMemo, useRef } from "react";
2
2
  import { mdxRenderer } from "../../transforms/mdx/index.js";
3
3
  import { rendererLogger as logger } from "../../utils/index.js";
4
4
  function useStableObject(obj) {
@@ -1,4 +1,4 @@
1
- import React from "../../../react/react.js";
1
+ import React from "react";
2
2
  import type { MDXComponents } from "../../types/index.js";
3
3
  /** Props accepted by MDX provider. */
4
4
  export interface MDXProviderProps {
@@ -1 +1 @@
1
- {"version":3,"file":"MDXProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/MDXProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,2BAA2B;AAC3B,wBAAgB,WAAW,CAAC,EAC1B,UAAe,EACf,QAAQ,GACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAEpC;AAED,oCAAoC;AACpC,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,aAAa,CAG1E"}
1
+ {"version":3,"file":"MDXProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/MDXProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,2BAA2B;AAC3B,wBAAgB,WAAW,CAAC,EAC1B,UAAe,EACf,QAAQ,GACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAEpC;AAED,oCAAoC;AACpC,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,aAAa,CAG1E"}
@@ -1,4 +1,4 @@
1
- import React, { createContext, useContext } from "../../../react/react.js";
1
+ import React, { createContext, useContext } from "react";
2
2
  const MDXContext = createContext({});
3
3
  /** Render MDX provider. */
4
4
  export function MDXProvider({ components = {}, children, }) {
@@ -1,4 +1,4 @@
1
- import type * as React from "../../../react/react.js";
1
+ import type * as React from "react";
2
2
  import type { MDXComponents } from "../../types/index.js";
3
3
  import type { MdxBundle } from "./LayoutComponent.js";
4
4
  interface ProviderComponentProps {
@@ -1 +1 @@
1
- {"version":3,"file":"ProviderComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/ProviderComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAGtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,UAAU,sBAAsB;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAiBD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,UAAe,GAChB,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CAyB7C"}
1
+ {"version":3,"file":"ProviderComponent.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/ProviderComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,UAAU,sBAAsB;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAiBD,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,UAAe,GAChB,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CAyB7C"}
@@ -1,4 +1,4 @@
1
- import { useMemo, useRef } from "../../../react/react.js";
1
+ import { useMemo, useRef } from "react";
2
2
  import { mdxRenderer } from "../../transforms/mdx/index.js";
3
3
  import { rendererLogger as logger } from "../../utils/index.js";
4
4
  function useStableFrontmatter(frontmatter) {
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @module react/components/chat/agent-card
10
10
  */
11
- import * as React from "../../../../react/react.js";
11
+ import * as React from "react";
12
12
  import type { AgentMessage, AgentStatus, ToolCall } from "../../../agent/index.js";
13
13
  import { type StatusColor } from "../ui/status.js";
14
14
  /** Props accepted by agent card. */
@@ -27,10 +27,10 @@ export interface AgentCardProps {
27
27
  thinking?: string;
28
28
  /** Additional class name for the card. */
29
29
  className?: string;
30
- /** Custom tool renderer — overrides the default `ToolCall` card. */
31
- renderTool?: (toolCall: ToolCall) => React.ReactNode;
32
30
  /** Compose your own card; when omitted, the default anatomy is rendered. */
33
31
  children?: React.ReactNode;
32
+ /** React 19: ref is a regular prop. */
33
+ ref?: React.Ref<HTMLDivElement>;
34
34
  }
35
35
  /** Per-card state shared with `AgentCard.*` sub-parts. */
36
36
  export interface AgentCardContextValue {
@@ -40,7 +40,6 @@ export interface AgentCardContextValue {
40
40
  toolCalls: ToolCall[];
41
41
  status: AgentStatus;
42
42
  thinking?: string;
43
- renderTool?: (toolCall: ToolCall) => React.ReactNode;
44
43
  presentation: {
45
44
  color: StatusColor;
46
45
  label: string;
@@ -49,6 +48,15 @@ export interface AgentCardContextValue {
49
48
  }
50
49
  /** Read the enclosing `AgentCard` state. Throws when used outside an `AgentCard`. */
51
50
  export declare function useAgentCard(): AgentCardContextValue;
51
+ /**
52
+ * `AgentCard.Root` — context provider + the `Card` wrapper. No children renders
53
+ * the default anatomy (`Header` + `Reasoning` + `Tools` + `Body`); pass children
54
+ * to recompose.
55
+ */
56
+ declare function AgentCardRoot({ name, avatarUrl, messages, toolCalls, status, thinking, className, children, ref, }: AgentCardProps): React.ReactElement;
57
+ declare namespace AgentCardRoot {
58
+ var displayName: string;
59
+ }
52
60
  /**
53
61
  * The header row: Avatar + name (left), Status (right). Mirrors
54
62
  * `ChatMessageHeader` / `Message.Header`.
@@ -66,7 +74,7 @@ declare function AgentCardReasoning({ className }: {
66
74
  declare namespace AgentCardReasoning {
67
75
  var displayName: string;
68
76
  }
69
- /** The tool-call list. Renders one `ToolCall` card per entry, or `renderTool`. */
77
+ /** The tool-call list. Renders one `ToolCall` card per entry. */
70
78
  declare function AgentCardTools({ className }: {
71
79
  className?: string;
72
80
  }): React.JSX.Element | null;
@@ -85,8 +93,8 @@ declare namespace AgentCardBody {
85
93
  * `AgentCard.Header` / `Reasoning` / `Tools` / `Body` for a custom layout.
86
94
  * Mirrors the `ToolCall` compound: render it, or compose it.
87
95
  */
88
- export declare const AgentCard: React.ForwardRefExoticComponent<AgentCardProps & React.RefAttributes<HTMLDivElement>> & {
89
- Root: React.ForwardRefExoticComponent<AgentCardProps & React.RefAttributes<HTMLDivElement>>;
96
+ export declare const AgentCard: typeof AgentCardRoot & {
97
+ Root: typeof AgentCardRoot;
90
98
  Header: typeof AgentCardHeader;
91
99
  Reasoning: typeof AgentCardReasoning;
92
100
  Tools: typeof AgentCardTools;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMnF,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK3D,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,gEAAgE;IAChE,SAAS,C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;AACrE,iBAAS,aAAa,CACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAgB1B;kBAlBQ,aAAa;;;AAqBtB;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;;;CAMpB,CAAC"}
@@ -18,15 +18,15 @@
18
18
  // sub-part takes `className`, merged LAST via `cn`. The preset `<AgentCard>`
19
19
  // stays fully back-compatible.
20
20
  // ---------------------------------------------------------------------------
21
- import * as React from "../../../../react/react.js";
21
+ import * as React from "react";
22
22
  import { COMPONENT_ERROR } from "../../../errors/error-registry.js";
23
23
  import { cn } from "./theme.js";
24
24
  import { Avatar } from "../ui/avatar.js";
25
25
  import { Card } from "../ui/card.js";
26
26
  import { Status } from "../ui/status.js";
27
27
  import { Markdown } from "./markdown.js";
28
- import { ReasoningCard } from "./chat/components/reasoning.js";
29
- import { ToolCallCard } from "./chat/components/tool-ui.js";
28
+ import { Reasoning } from "./chat/components/reasoning.js";
29
+ import { ToolCall as ToolCallView } from "./chat/components/tool-ui.js";
30
30
  /** Map the agent status to a `Status` dot colour, label, and pulse. */
31
31
  function statusPresentation(status) {
32
32
  switch (status) {
@@ -86,7 +86,7 @@ export function useAgentCard() {
86
86
  * the default anatomy (`Header` + `Reasoning` + `Tools` + `Body`); pass children
87
87
  * to recompose.
88
88
  */
89
- const AgentCardRoot = React.forwardRef(function AgentCard({ name = "Agent", avatarUrl, messages, toolCalls = [], status, thinking, className, renderTool, children, }, ref) {
89
+ function AgentCardRoot({ name = "Agent", avatarUrl, messages, toolCalls = [], status, thinking, className, children, ref, }) {
90
90
  const presentation = statusPresentation(status);
91
91
  const context = {
92
92
  name,
@@ -95,7 +95,6 @@ const AgentCardRoot = React.forwardRef(function AgentCard({ name = "Agent", avat
95
95
  toolCalls,
96
96
  status,
97
97
  thinking,
98
- renderTool,
99
98
  presentation,
100
99
  };
101
100
  return (React.createElement(AgentCardContext.Provider, { value: context },
@@ -104,7 +103,7 @@ const AgentCardRoot = React.forwardRef(function AgentCard({ name = "Agent", avat
104
103
  React.createElement(AgentCardReasoning, null),
105
104
  React.createElement(AgentCardTools, null),
106
105
  React.createElement(AgentCardBody, null))))));
107
- });
106
+ }
108
107
  AgentCardRoot.displayName = "AgentCard.Root";
109
108
  /**
110
109
  * The header row: Avatar + name (left), Status (right). Mirrors
@@ -123,15 +122,15 @@ function AgentCardReasoning({ className }) {
123
122
  const { thinking } = useAgentCard();
124
123
  if (!thinking)
125
124
  return null;
126
- return React.createElement(ReasoningCard, { text: thinking, className: className });
125
+ return React.createElement(Reasoning, { text: thinking, className: className });
127
126
  }
128
127
  AgentCardReasoning.displayName = "AgentCard.Reasoning";
129
- /** The tool-call list. Renders one `ToolCall` card per entry, or `renderTool`. */
128
+ /** The tool-call list. Renders one `ToolCall` card per entry. */
130
129
  function AgentCardTools({ className }) {
131
- const { toolCalls, renderTool } = useAgentCard();
130
+ const { toolCalls } = useAgentCard();
132
131
  if (toolCalls.length === 0)
133
132
  return null;
134
- return (React.createElement("div", { className: cn("flex flex-col gap-2", className) }, toolCalls.map((tool) => (React.createElement(React.Fragment, { key: tool.id }, renderTool ? renderTool(tool) : React.createElement(ToolCallCard, { tool: toToolPart(tool) }))))));
133
+ return (React.createElement("div", { className: cn("flex flex-col gap-2", className) }, toolCalls.map((tool) => React.createElement(ToolCallView, { key: tool.id, tool: toToolPart(tool) }))));
135
134
  }
136
135
  AgentCardTools.displayName = "AgentCard.Tools";
137
136
  /** The message body — each message's text rendered as `Markdown`. */
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ /** Props shared by `AgentPicker.Create` and `AgentPicker.Manage`. */
3
+ export interface AgentPickerActionProps {
4
+ /** Override the leading action glyph. */
5
+ icon?: React.ReactNode;
6
+ /** Override the action label. */
7
+ children?: React.ReactNode;
8
+ className?: string;
9
+ }
10
+ /** Create-agent action. Renders only when `onCreate` is available on the root. */
11
+ export declare function AgentPickerCreate({ icon, children, className, }: AgentPickerActionProps): React.ReactElement | null;
12
+ export declare namespace AgentPickerCreate {
13
+ var displayName: string;
14
+ }
15
+ /** Manage-agents action. Renders only when `onManage` is available on the root. */
16
+ export declare function AgentPickerManage({ icon, children, className, }: AgentPickerActionProps): React.ReactElement | null;
17
+ export declare namespace AgentPickerManage {
18
+ var displayName: string;
19
+ }
20
+ //# sourceMappingURL=agent-picker-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-picker-actions.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-picker-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,qEAAqE;AACrE,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CASpD;yBAbe,iBAAiB;;;AAgBjC,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CASpD;yBAbe,iBAAiB"}
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { CommandItem } from "../ui/command.js";
3
+ import { PlusIcon, SparklesIcon } from "../ui/icons/index.js";
4
+ import { useAgentPicker } from "./agent-picker-context.js";
5
+ /** Create-agent action. Renders only when `onCreate` is available on the root. */
6
+ export function AgentPickerCreate({ icon, children, className, }) {
7
+ const { onCreate } = useAgentPicker();
8
+ if (!onCreate)
9
+ return null;
10
+ return (React.createElement(CommandItem, { value: "Create Agent", onSelect: onCreate, className: className },
11
+ icon ?? React.createElement(PlusIcon, null),
12
+ children ?? "Create Agent"));
13
+ }
14
+ AgentPickerCreate.displayName = "AgentPicker.Create";
15
+ /** Manage-agents action. Renders only when `onManage` is available on the root. */
16
+ export function AgentPickerManage({ icon, children, className, }) {
17
+ const { onManage } = useAgentPicker();
18
+ if (!onManage)
19
+ return null;
20
+ return (React.createElement(CommandItem, { value: "Manage Agents", onSelect: onManage, className: className },
21
+ icon ?? React.createElement(SparklesIcon, null),
22
+ children ?? "Manage Agents"));
23
+ }
24
+ AgentPickerManage.displayName = "AgentPicker.Manage";
@@ -0,0 +1,19 @@
1
+ /** Shared selection and open state exposed to `AgentPicker.*` sub-parts. */
2
+ export interface AgentPickerContextValue {
3
+ /** Selected agent id. */
4
+ value?: string;
5
+ /** Select an agent by id and close the menu. */
6
+ onSelect: (id: string) => void;
7
+ /** Popover open state. */
8
+ open: boolean;
9
+ /** Set the popover open state and notify `onOpenChange`. */
10
+ setOpen: (open: boolean) => void;
11
+ /** Create an agent and close the menu when the action is available. */
12
+ onCreate?: () => void;
13
+ /** Manage agents and close the menu when the action is available. */
14
+ onManage?: () => void;
15
+ }
16
+ export declare const AgentPickerContext: any;
17
+ /** Read the enclosing `AgentPicker` state. */
18
+ export declare function useAgentPicker(): AgentPickerContextValue;
19
+ //# sourceMappingURL=agent-picker-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-picker-context.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/agent-picker-context.tsx"],"names":[],"mappings":"AAGA,4EAA4E;AAC5E,MAAM,WAAW,uBAAuB;IACtC,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,0BAA0B;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,4DAA4D;IAC5D,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,KAA4D,CAAC;AAE5F,8CAA8C;AAC9C,wBAAgB,cAAc,IAAI,uBAAuB,CAQxD"}