veryfront 0.1.149 → 0.1.151

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 (529) hide show
  1. package/esm/cli/commands/dev/command.js +3 -3
  2. package/esm/cli/commands/workflow/command-help.js +1 -1
  3. package/esm/cli/commands/workflow/command.js +2 -2
  4. package/esm/cli/shared/config.d.ts.map +1 -1
  5. package/esm/cli/shared/config.js +1 -3
  6. package/esm/deno.d.ts +5 -11
  7. package/esm/deno.js +16 -16
  8. package/esm/src/agent/ag-ui-handler.d.ts.map +1 -1
  9. package/esm/src/agent/ag-ui-handler.js +6 -0
  10. package/esm/src/agent/chat-handler.js +1 -1
  11. package/esm/src/agent/composition/composition.d.ts +1 -1
  12. package/esm/src/agent/composition/composition.d.ts.map +1 -1
  13. package/esm/src/agent/composition/composition.js +2 -2
  14. package/esm/src/agent/{ai-defaults.d.ts → defaults.d.ts} +1 -1
  15. package/esm/src/agent/defaults.d.ts.map +1 -0
  16. package/esm/src/agent/factory.js +1 -1
  17. package/esm/src/agent/react/index.d.ts +1 -1
  18. package/esm/src/agent/react/index.d.ts.map +1 -1
  19. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +5 -6
  20. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +1 -1
  21. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +1 -1
  22. package/esm/src/agent/react/use-chat/index.d.ts +2 -1
  23. package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
  24. package/esm/src/agent/react/use-chat/stream-protocol.d.ts +2 -0
  25. package/esm/src/agent/react/use-chat/stream-protocol.d.ts.map +1 -0
  26. package/esm/src/agent/react/use-chat/stream-protocol.js +1 -0
  27. package/esm/src/agent/react/use-chat/streaming/parts-builder.d.ts +2 -2
  28. package/esm/src/agent/react/use-chat/streaming/parts-builder.d.ts.map +1 -1
  29. package/esm/src/agent/react/use-chat/streaming/types.d.ts +4 -4
  30. package/esm/src/agent/react/use-chat/streaming/types.d.ts.map +1 -1
  31. package/esm/src/agent/react/use-chat/types.d.ts +7 -55
  32. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  33. package/esm/src/agent/react/use-chat/use-chat.d.ts +4 -4
  34. package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
  35. package/esm/src/agent/react/use-chat/use-chat.js +2 -2
  36. package/esm/src/agent/react/use-chat/utils.d.ts +2 -2
  37. package/esm/src/agent/react/use-chat/utils.d.ts.map +1 -1
  38. package/esm/src/agent/runtime/{ai-stream-handler.d.ts → chat-stream-handler.d.ts} +13 -13
  39. package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -0
  40. package/esm/src/agent/runtime/{ai-stream-handler.js → chat-stream-handler.js} +91 -89
  41. package/esm/src/agent/runtime/constants.js +1 -1
  42. package/esm/src/agent/runtime/index.d.ts +7 -5
  43. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  44. package/esm/src/agent/runtime/index.js +67 -30
  45. package/esm/src/agent/runtime/model-message-converter.d.ts +7 -7
  46. package/esm/src/agent/runtime/model-message-converter.d.ts.map +1 -1
  47. package/esm/src/agent/runtime/model-message-converter.js +8 -6
  48. package/esm/src/agent/runtime/model-runtime-types.d.ts +44 -0
  49. package/esm/src/agent/runtime/model-runtime-types.d.ts.map +1 -0
  50. package/esm/src/agent/runtime/model-runtime-types.js +8 -0
  51. package/esm/src/agent/runtime/model-tool-converter.d.ts +9 -9
  52. package/esm/src/agent/runtime/model-tool-converter.d.ts.map +1 -1
  53. package/esm/src/agent/runtime/model-tool-converter.js +10 -22
  54. package/esm/src/agent/runtime/provider-native-tools.d.ts +3 -0
  55. package/esm/src/agent/runtime/provider-native-tools.d.ts.map +1 -0
  56. package/esm/src/agent/runtime/provider-native-tools.js +56 -0
  57. package/esm/src/agent/runtime/repair-tool-call.d.ts +2 -2
  58. package/esm/src/agent/runtime/repair-tool-call.d.ts.map +1 -1
  59. package/esm/src/agent/runtime/repair-tool-call.js +3 -3
  60. package/esm/src/agent/runtime/runtime-tool-builder.d.ts +48 -0
  61. package/esm/src/agent/runtime/runtime-tool-builder.d.ts.map +1 -0
  62. package/esm/src/agent/runtime/runtime-tool-builder.js +28 -0
  63. package/esm/src/agent/runtime/runtime-tool-errors.d.ts +16 -0
  64. package/esm/src/agent/runtime/runtime-tool-errors.d.ts.map +1 -0
  65. package/esm/src/agent/runtime/runtime-tool-errors.js +28 -0
  66. package/esm/src/agent/runtime/runtime-tool-types.d.ts +104 -0
  67. package/esm/src/agent/runtime/runtime-tool-types.d.ts.map +1 -0
  68. package/esm/src/agent/runtime/runtime-tool-types.js +7 -0
  69. package/esm/src/chat/index.d.ts +9 -9
  70. package/esm/src/chat/index.d.ts.map +1 -1
  71. package/esm/src/chat/index.js +7 -7
  72. package/esm/src/chat/protocol.d.ts +156 -0
  73. package/esm/src/chat/protocol.d.ts.map +1 -0
  74. package/esm/src/chat/protocol.js +7 -0
  75. package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
  76. package/esm/src/discovery/import-rewriter.js +1 -14
  77. package/esm/src/discovery/index.d.ts +1 -1
  78. package/esm/src/discovery/index.d.ts.map +1 -1
  79. package/esm/src/discovery/index.js +2 -2
  80. package/esm/src/discovery/provider-config-validator.d.ts +14 -0
  81. package/esm/src/discovery/provider-config-validator.d.ts.map +1 -0
  82. package/esm/src/discovery/{config-validator.js → provider-config-validator.js} +4 -4
  83. package/esm/src/discovery/transpiler.d.ts.map +1 -1
  84. package/esm/src/discovery/transpiler.js +0 -3
  85. package/esm/src/embedding/embedding.d.ts.map +1 -1
  86. package/esm/src/embedding/embedding.js +1 -1
  87. package/esm/src/embedding/index.d.ts +3 -3
  88. package/esm/src/embedding/index.d.ts.map +1 -1
  89. package/esm/src/embedding/index.js +3 -3
  90. package/esm/src/embedding/rag-store.d.ts.map +1 -1
  91. package/esm/src/embedding/rag-store.js +1 -1
  92. package/esm/src/embedding/resolve.d.ts +5 -7
  93. package/esm/src/embedding/resolve.d.ts.map +1 -1
  94. package/esm/src/embedding/resolve.js +6 -9
  95. package/esm/src/embedding/vector-store.d.ts.map +1 -1
  96. package/esm/src/embedding/vector-store.js +1 -1
  97. package/esm/src/embedding/veryfront-cloud/provider.d.ts +2 -2
  98. package/esm/src/embedding/veryfront-cloud/provider.d.ts.map +1 -1
  99. package/esm/src/embedding/veryfront-cloud/provider.js +5 -6
  100. package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
  101. package/esm/src/internal-agents/ag-ui-sse.js +12 -0
  102. package/esm/src/markdown/index.d.ts +1 -1
  103. package/esm/src/markdown/index.d.ts.map +1 -1
  104. package/esm/src/markdown/index.js +1 -1
  105. package/esm/src/modules/import-map/default-import-map.js +2 -2
  106. package/esm/src/prompt/registry.d.ts +1 -1
  107. package/esm/src/prompt/registry.d.ts.map +1 -1
  108. package/esm/src/prompt/registry.js +2 -2
  109. package/esm/src/provider/index.d.ts +7 -8
  110. package/esm/src/provider/index.d.ts.map +1 -1
  111. package/esm/src/provider/index.js +6 -8
  112. package/esm/src/provider/local/embedding-runtime-adapter.d.ts +19 -0
  113. package/esm/src/provider/local/embedding-runtime-adapter.d.ts.map +1 -0
  114. package/esm/src/provider/local/{local-embedding-adapter.js → embedding-runtime-adapter.js} +5 -5
  115. package/esm/src/provider/local/model-runtime-adapter.d.ts +18 -0
  116. package/esm/src/provider/local/model-runtime-adapter.d.ts.map +1 -0
  117. package/esm/src/provider/local/{ai-sdk-adapter.js → model-runtime-adapter.js} +10 -12
  118. package/esm/src/provider/model-registry.d.ts +11 -12
  119. package/esm/src/provider/model-registry.d.ts.map +1 -1
  120. package/esm/src/provider/model-registry.js +17 -20
  121. package/esm/src/provider/runtime-inspection.d.ts +6 -0
  122. package/esm/src/provider/runtime-inspection.d.ts.map +1 -0
  123. package/esm/src/provider/runtime-inspection.js +19 -0
  124. package/esm/src/provider/runtime-loader.d.ts +27 -0
  125. package/esm/src/provider/runtime-loader.d.ts.map +1 -0
  126. package/esm/src/provider/runtime-loader.js +1307 -0
  127. package/esm/src/provider/types.d.ts +35 -0
  128. package/esm/src/provider/types.d.ts.map +1 -0
  129. package/esm/src/provider/types.js +1 -0
  130. package/esm/src/provider/veryfront-cloud/provider.d.ts +2 -2
  131. package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
  132. package/esm/src/provider/veryfront-cloud/provider.js +7 -9
  133. package/esm/src/provider/veryfront-cloud/shared.d.ts +1 -1
  134. package/esm/src/provider/veryfront-cloud/shared.js +1 -1
  135. package/esm/src/react/components/chat/agent-card.d.ts.map +1 -0
  136. package/esm/src/react/components/chat/chat/components/animations.d.ts.map +1 -0
  137. package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -0
  138. package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -0
  139. package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -0
  140. package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -0
  141. package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -0
  142. package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -0
  143. package/esm/src/react/components/{ai → chat}/chat/components/inference-badge.js +1 -1
  144. package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -0
  145. package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -0
  146. package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -0
  147. package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -0
  148. package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -0
  149. package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -0
  150. package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -0
  151. package/esm/src/react/components/{ai → chat}/chat/components/skill-badge.d.ts +3 -3
  152. package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -0
  153. package/esm/src/react/components/{ai → chat}/chat/components/skill-badge.js +1 -1
  154. package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -0
  155. package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -0
  156. package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -0
  157. package/esm/src/react/components/{ai → chat}/chat/components/tool-ui.d.ts +3 -3
  158. package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -0
  159. package/esm/src/react/components/{ai → chat}/chat/components/tool-ui.js +1 -1
  160. package/esm/src/react/components/chat/chat/components/upgrade-cta.d.ts.map +1 -0
  161. package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +1 -0
  162. package/esm/src/react/components/{ai → chat}/chat/composition/api.d.ts +1 -1
  163. package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -0
  164. package/esm/src/react/components/{ai → chat}/chat/composition/api.js +1 -1
  165. package/esm/src/react/components/{ai → chat}/chat/composition/chat-composer.d.ts +3 -3
  166. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -0
  167. package/esm/src/react/components/{ai → chat}/chat/composition/chat-composer.js +1 -1
  168. package/esm/src/react/components/{ai → chat}/chat/composition/chat-empty.d.ts +1 -1
  169. package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -0
  170. package/esm/src/react/components/{ai → chat}/chat/composition/chat-empty.js +1 -1
  171. package/esm/src/react/components/{ai → chat}/chat/composition/chat-if.d.ts +1 -1
  172. package/esm/src/react/components/chat/chat/composition/chat-if.d.ts.map +1 -0
  173. package/esm/src/react/components/{ai → chat}/chat/composition/chat-if.js +1 -1
  174. package/esm/src/react/components/{ai → chat}/chat/composition/chat-message-list.d.ts +5 -5
  175. package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -0
  176. package/esm/src/react/components/{ai → chat}/chat/composition/chat-message-list.js +2 -2
  177. package/esm/src/react/components/{ai → chat}/chat/composition/chat-root.d.ts +3 -3
  178. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -0
  179. package/esm/src/react/components/{ai → chat}/chat/composition/chat-root.js +1 -1
  180. package/esm/src/react/components/{ai → chat}/chat/composition/error-banner.d.ts +1 -1
  181. package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -0
  182. package/esm/src/react/components/{ai → chat}/chat/composition/error-banner.js +1 -1
  183. package/esm/src/react/components/{ai → chat}/chat/composition/message.d.ts +4 -4
  184. package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -0
  185. package/esm/src/react/components/{ai → chat}/chat/composition/message.js +1 -1
  186. package/esm/src/react/components/{ai → chat}/chat/composition/model-avatar.d.ts +1 -1
  187. package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -0
  188. package/esm/src/react/components/{ai → chat}/chat/composition/model-avatar.js +1 -1
  189. package/esm/src/react/components/{ai → chat}/chat/contexts/chat-context.d.ts +3 -3
  190. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -0
  191. package/esm/src/react/components/{ai → chat}/chat/contexts/chat-context.js +1 -1
  192. package/esm/src/react/components/{ai → chat}/chat/contexts/composer-context.d.ts +1 -1
  193. package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -0
  194. package/esm/src/react/components/{ai → chat}/chat/contexts/composer-context.js +1 -1
  195. package/esm/src/react/components/{ai → chat}/chat/contexts/index.d.ts +1 -1
  196. package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -0
  197. package/esm/src/react/components/{ai → chat}/chat/contexts/index.js +1 -1
  198. package/esm/src/react/components/{ai → chat}/chat/contexts/message-context.d.ts +3 -3
  199. package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -0
  200. package/esm/src/react/components/{ai → chat}/chat/contexts/message-context.js +1 -1
  201. package/esm/src/react/components/{ai → chat}/chat/contexts/thread-list-context.d.ts +1 -1
  202. package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +1 -0
  203. package/esm/src/react/components/{ai → chat}/chat/contexts/thread-list-context.js +1 -1
  204. package/esm/src/react/components/{ai → chat}/chat/hooks/use-threads.d.ts +2 -2
  205. package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +1 -0
  206. package/esm/src/react/components/{ai → chat}/chat/index.d.ts +5 -5
  207. package/esm/src/react/components/chat/chat/index.d.ts.map +1 -0
  208. package/esm/src/react/components/{ai → chat}/chat/index.js +1 -1
  209. package/esm/src/react/components/chat/chat/utils/export.d.ts +10 -0
  210. package/esm/src/react/components/chat/chat/utils/export.d.ts.map +1 -0
  211. package/esm/src/react/components/{ai → chat}/chat/utils/export.js +1 -1
  212. package/esm/src/react/components/{ai → chat}/chat/utils/message-parts.d.ts +10 -10
  213. package/esm/src/react/components/chat/chat/utils/message-parts.d.ts.map +1 -0
  214. package/esm/src/react/components/{ai → chat}/chat/utils/message-parts.js +2 -2
  215. package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +1 -0
  216. package/esm/src/react/components/{ai → chat}/chat.d.ts +1 -1
  217. package/esm/src/react/components/chat/chat.d.ts.map +1 -0
  218. package/esm/src/react/components/{ai → chat}/chat.js +1 -1
  219. package/esm/src/react/components/chat/csp-nonce.d.ts.map +1 -0
  220. package/esm/src/react/components/{ai → chat}/error-boundary.d.ts +6 -6
  221. package/esm/src/react/components/chat/error-boundary.d.ts.map +1 -0
  222. package/esm/src/react/components/{ai → chat}/error-boundary.js +5 -5
  223. package/esm/src/react/components/{ai → chat}/icons/index.d.ts +1 -1
  224. package/esm/src/react/components/chat/icons/index.d.ts.map +1 -0
  225. package/esm/src/react/components/{ai → chat}/icons/index.js +1 -1
  226. package/esm/src/react/components/chat/markdown.d.ts.map +1 -0
  227. package/esm/src/react/components/{ai → chat}/message.d.ts +8 -8
  228. package/esm/src/react/components/chat/message.d.ts.map +1 -0
  229. package/esm/src/react/components/chat/model-selector.d.ts.map +1 -0
  230. package/esm/src/react/components/chat/theme.d.ts.map +1 -0
  231. package/esm/src/react/primitives/message-list.d.ts +2 -2
  232. package/esm/src/react/primitives/message-list.d.ts.map +1 -1
  233. package/esm/src/react/primitives/tool-primitives.d.ts +3 -3
  234. package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
  235. package/esm/src/{ai/registry-manager.d.ts → registry/project-scoped-registry-manager.d.ts} +5 -4
  236. package/esm/src/registry/project-scoped-registry-manager.d.ts.map +1 -0
  237. package/esm/src/{ai/registry-manager.js → registry/project-scoped-registry-manager.js} +5 -4
  238. package/esm/src/{ai/registry-facade.d.ts → registry/scoped-registry-facade.d.ts} +2 -2
  239. package/esm/src/registry/scoped-registry-facade.d.ts.map +1 -0
  240. package/esm/src/rendering/script-page-handling.d.ts.map +1 -1
  241. package/esm/src/rendering/script-page-handling.js +0 -2
  242. package/esm/src/resource/registry.d.ts +1 -1
  243. package/esm/src/resource/registry.d.ts.map +1 -1
  244. package/esm/src/resource/registry.js +2 -2
  245. package/esm/src/routing/api/module-loader/loader.js +3 -19
  246. package/esm/src/runtime/runtime-bridge.d.ts +82 -0
  247. package/esm/src/runtime/runtime-bridge.d.ts.map +1 -0
  248. package/esm/src/runtime/runtime-bridge.js +367 -0
  249. package/esm/src/server/dev-server/file-watch-setup.d.ts +4 -4
  250. package/esm/src/server/dev-server/file-watch-setup.d.ts.map +1 -1
  251. package/esm/src/server/dev-server/file-watch-setup.js +14 -14
  252. package/esm/src/server/dev-server/server.d.ts +2 -2
  253. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  254. package/esm/src/server/dev-server/server.js +20 -18
  255. package/esm/src/server/dev-ui/manifest.d.ts +1 -1
  256. package/esm/src/server/dev-ui/manifest.js +2 -2
  257. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  258. package/esm/src/server/handlers/dev/framework-candidates.generated.js +58 -61
  259. package/esm/src/server/handlers/request/api/api-handler-wrapper.js +1 -1
  260. package/esm/src/server/handlers/request/api/project-discovery.d.ts +1 -1
  261. package/esm/src/server/handlers/request/api/project-discovery.d.ts.map +1 -1
  262. package/esm/src/server/handlers/request/api/project-discovery.js +12 -10
  263. package/esm/src/server/production-server.js +2 -2
  264. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  265. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  266. package/esm/src/skill/registry.d.ts +1 -1
  267. package/esm/src/skill/registry.d.ts.map +1 -1
  268. package/esm/src/skill/registry.js +2 -2
  269. package/esm/src/tool/registry.d.ts +1 -1
  270. package/esm/src/tool/registry.d.ts.map +1 -1
  271. package/esm/src/tool/registry.js +2 -2
  272. package/esm/src/transforms/npm-import-rewrites.d.ts +1 -1
  273. package/esm/src/transforms/npm-import-rewrites.d.ts.map +1 -1
  274. package/esm/src/transforms/npm-import-rewrites.js +5 -13
  275. package/esm/src/utils/constants/server.d.ts +4 -4
  276. package/esm/src/utils/constants/server.d.ts.map +1 -1
  277. package/esm/src/utils/constants/server.js +4 -4
  278. package/esm/src/utils/id.js +1 -1
  279. package/esm/src/utils/version-constant.d.ts +1 -1
  280. package/esm/src/utils/version-constant.js +1 -1
  281. package/esm/src/workflow/discovery/workflow-discovery.d.ts +3 -3
  282. package/esm/src/workflow/discovery/workflow-discovery.d.ts.map +1 -1
  283. package/esm/src/workflow/discovery/workflow-discovery.js +3 -3
  284. package/esm/src/workflow/registry.d.ts +1 -1
  285. package/esm/src/workflow/registry.d.ts.map +1 -1
  286. package/esm/src/workflow/registry.js +2 -2
  287. package/package.json +4 -5
  288. package/src/cli/commands/dev/command.ts +3 -3
  289. package/src/cli/commands/workflow/command-help.ts +1 -1
  290. package/src/cli/commands/workflow/command.ts +2 -2
  291. package/src/cli/shared/config.ts +1 -3
  292. package/src/deno.js +16 -16
  293. package/src/src/agent/ag-ui-handler.ts +6 -0
  294. package/src/src/agent/chat-handler.ts +1 -1
  295. package/src/src/agent/composition/composition.ts +2 -2
  296. package/src/src/agent/factory.ts +1 -1
  297. package/src/src/agent/react/index.ts +11 -9
  298. package/src/src/agent/react/use-chat/browser-inference/browser-engine.ts +9 -10
  299. package/src/src/agent/react/use-chat/index.ts +10 -9
  300. package/src/src/agent/react/use-chat/stream-protocol.ts +1 -0
  301. package/src/src/agent/react/use-chat/streaming/handler.ts +17 -17
  302. package/src/src/agent/react/use-chat/streaming/parts-builder.ts +5 -5
  303. package/src/src/agent/react/use-chat/streaming/types.ts +4 -4
  304. package/src/src/agent/react/use-chat/types.ts +27 -73
  305. package/src/src/agent/react/use-chat/use-chat.ts +13 -13
  306. package/src/src/agent/react/use-chat/utils.ts +2 -2
  307. package/src/src/agent/runtime/{ai-stream-handler.ts → chat-stream-handler.ts} +100 -96
  308. package/src/src/agent/runtime/constants.ts +1 -1
  309. package/src/src/agent/runtime/index.ts +88 -40
  310. package/src/src/agent/runtime/model-message-converter.ts +22 -33
  311. package/src/src/agent/runtime/model-runtime-types.ts +55 -0
  312. package/src/src/agent/runtime/model-tool-converter.ts +29 -26
  313. package/src/src/agent/runtime/provider-native-tools.ts +61 -0
  314. package/src/src/agent/runtime/repair-tool-call.ts +6 -9
  315. package/src/src/agent/runtime/runtime-tool-builder.ts +82 -0
  316. package/src/src/agent/runtime/runtime-tool-errors.ts +46 -0
  317. package/src/src/agent/runtime/runtime-tool-types.ts +114 -0
  318. package/src/src/chat/index.ts +22 -20
  319. package/src/src/chat/protocol.ts +210 -0
  320. package/src/src/discovery/import-rewriter.ts +1 -14
  321. package/src/src/discovery/index.ts +2 -2
  322. package/src/src/discovery/{config-validator.ts → provider-config-validator.ts} +4 -4
  323. package/src/src/discovery/transpiler.ts +0 -3
  324. package/src/src/embedding/embedding.ts +1 -1
  325. package/src/src/embedding/index.ts +3 -3
  326. package/src/src/embedding/rag-store.ts +1 -1
  327. package/src/src/embedding/resolve.ts +15 -12
  328. package/src/src/embedding/vector-store.ts +1 -1
  329. package/src/src/embedding/veryfront-cloud/provider.ts +10 -8
  330. package/src/src/internal-agents/ag-ui-sse.ts +12 -0
  331. package/src/src/markdown/index.ts +1 -1
  332. package/src/src/modules/import-map/default-import-map.ts +2 -2
  333. package/src/src/prompt/registry.ts +2 -2
  334. package/src/src/provider/index.ts +7 -8
  335. package/src/src/provider/local/{local-embedding-adapter.ts → embedding-runtime-adapter.ts} +8 -8
  336. package/src/src/provider/local/{ai-sdk-adapter.ts → model-runtime-adapter.ts} +13 -16
  337. package/src/src/provider/model-registry.ts +31 -26
  338. package/src/src/provider/runtime-inspection.ts +25 -0
  339. package/src/src/provider/runtime-loader.ts +1854 -0
  340. package/src/src/provider/types.ts +38 -0
  341. package/src/src/provider/veryfront-cloud/provider.ts +13 -11
  342. package/src/src/provider/veryfront-cloud/shared.ts +1 -1
  343. package/src/src/react/components/{ai → chat}/chat/components/inference-badge.tsx +1 -1
  344. package/src/src/react/components/{ai → chat}/chat/components/skill-badge.tsx +3 -3
  345. package/src/src/react/components/{ai → chat}/chat/components/tool-ui.tsx +3 -3
  346. package/src/src/react/components/{ai → chat}/chat/composition/api.tsx +1 -1
  347. package/src/src/react/components/{ai → chat}/chat/composition/chat-composer.tsx +3 -3
  348. package/src/src/react/components/{ai → chat}/chat/composition/chat-empty.tsx +1 -1
  349. package/src/src/react/components/{ai → chat}/chat/composition/chat-if.tsx +1 -1
  350. package/src/src/react/components/{ai → chat}/chat/composition/chat-message-list.tsx +11 -11
  351. package/src/src/react/components/{ai → chat}/chat/composition/chat-root.tsx +3 -3
  352. package/src/src/react/components/{ai → chat}/chat/composition/error-banner.tsx +1 -1
  353. package/src/src/react/components/{ai → chat}/chat/composition/message.tsx +9 -4
  354. package/src/src/react/components/{ai → chat}/chat/composition/model-avatar.tsx +1 -1
  355. package/src/src/react/components/{ai → chat}/chat/contexts/chat-context.tsx +3 -3
  356. package/src/src/react/components/{ai → chat}/chat/contexts/composer-context.tsx +1 -1
  357. package/src/src/react/components/{ai → chat}/chat/contexts/index.ts +1 -1
  358. package/src/src/react/components/{ai → chat}/chat/contexts/message-context.tsx +3 -3
  359. package/src/src/react/components/{ai → chat}/chat/contexts/thread-list-context.tsx +1 -1
  360. package/src/src/react/components/{ai → chat}/chat/hooks/use-threads.ts +2 -2
  361. package/src/src/react/components/{ai → chat}/chat/index.tsx +7 -7
  362. package/src/src/react/components/{ai → chat}/chat/utils/export.ts +4 -4
  363. package/src/src/react/components/{ai → chat}/chat/utils/message-parts.ts +13 -13
  364. package/src/src/react/components/{ai → chat}/chat.tsx +1 -1
  365. package/src/src/react/components/{ai → chat}/error-boundary.tsx +11 -11
  366. package/src/src/react/components/{ai → chat}/icons/index.ts +1 -1
  367. package/src/src/react/components/{ai → chat}/message.tsx +11 -11
  368. package/src/src/react/primitives/message-list.tsx +2 -2
  369. package/src/src/react/primitives/tool-primitives.tsx +4 -4
  370. package/src/src/{ai/registry-manager.ts → registry/project-scoped-registry-manager.ts} +5 -4
  371. package/src/src/{ai/registry-facade.ts → registry/scoped-registry-facade.ts} +1 -1
  372. package/src/src/rendering/script-page-handling.ts +0 -2
  373. package/src/src/resource/registry.ts +2 -2
  374. package/src/src/routing/api/module-loader/loader.ts +3 -19
  375. package/src/src/runtime/runtime-bridge.ts +608 -0
  376. package/src/src/server/dev-server/file-watch-setup.ts +14 -14
  377. package/src/src/server/dev-server/server.ts +20 -18
  378. package/src/src/server/dev-ui/manifest.js +2 -2
  379. package/src/src/server/handlers/dev/framework-candidates.generated.ts +58 -61
  380. package/src/src/server/handlers/request/api/api-handler-wrapper.ts +1 -1
  381. package/src/src/server/handlers/request/api/project-discovery.ts +12 -10
  382. package/src/src/server/production-server.ts +2 -2
  383. package/src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts +2 -2
  384. package/src/src/skill/registry.ts +2 -2
  385. package/src/src/tool/registry.ts +2 -2
  386. package/src/src/transforms/npm-import-rewrites.ts +5 -13
  387. package/src/src/utils/constants/server.ts +4 -4
  388. package/src/src/utils/id.ts +1 -1
  389. package/src/src/utils/version-constant.ts +1 -1
  390. package/src/src/workflow/discovery/workflow-discovery.ts +4 -4
  391. package/src/src/workflow/registry.ts +2 -2
  392. package/esm/src/agent/ai-defaults.d.ts.map +0 -1
  393. package/esm/src/agent/runtime/ai-stream-handler.d.ts.map +0 -1
  394. package/esm/src/ai/registry-facade.d.ts.map +0 -1
  395. package/esm/src/ai/registry-manager.d.ts.map +0 -1
  396. package/esm/src/discovery/config-validator.d.ts +0 -14
  397. package/esm/src/discovery/config-validator.d.ts.map +0 -1
  398. package/esm/src/provider/local/ai-sdk-adapter.d.ts +0 -19
  399. package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +0 -1
  400. package/esm/src/provider/local/local-embedding-adapter.d.ts +0 -19
  401. package/esm/src/provider/local/local-embedding-adapter.d.ts.map +0 -1
  402. package/esm/src/react/components/ai/agent-card.d.ts.map +0 -1
  403. package/esm/src/react/components/ai/chat/components/animations.d.ts.map +0 -1
  404. package/esm/src/react/components/ai/chat/components/attachment-pill.d.ts.map +0 -1
  405. package/esm/src/react/components/ai/chat/components/branch-picker.d.ts.map +0 -1
  406. package/esm/src/react/components/ai/chat/components/code-block.d.ts.map +0 -1
  407. package/esm/src/react/components/ai/chat/components/drop-zone.d.ts.map +0 -1
  408. package/esm/src/react/components/ai/chat/components/empty-state.d.ts.map +0 -1
  409. package/esm/src/react/components/ai/chat/components/inference-badge.d.ts.map +0 -1
  410. package/esm/src/react/components/ai/chat/components/inline-citation.d.ts.map +0 -1
  411. package/esm/src/react/components/ai/chat/components/message-actions.d.ts.map +0 -1
  412. package/esm/src/react/components/ai/chat/components/message-edit-form.d.ts.map +0 -1
  413. package/esm/src/react/components/ai/chat/components/message-feedback.d.ts.map +0 -1
  414. package/esm/src/react/components/ai/chat/components/quick-actions.d.ts.map +0 -1
  415. package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +0 -1
  416. package/esm/src/react/components/ai/chat/components/sidebar.d.ts.map +0 -1
  417. package/esm/src/react/components/ai/chat/components/skill-badge.d.ts.map +0 -1
  418. package/esm/src/react/components/ai/chat/components/sources.d.ts.map +0 -1
  419. package/esm/src/react/components/ai/chat/components/step-indicator.d.ts.map +0 -1
  420. package/esm/src/react/components/ai/chat/components/tab-switcher.d.ts.map +0 -1
  421. package/esm/src/react/components/ai/chat/components/tool-ui.d.ts.map +0 -1
  422. package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts.map +0 -1
  423. package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts.map +0 -1
  424. package/esm/src/react/components/ai/chat/composition/api.d.ts.map +0 -1
  425. package/esm/src/react/components/ai/chat/composition/chat-composer.d.ts.map +0 -1
  426. package/esm/src/react/components/ai/chat/composition/chat-empty.d.ts.map +0 -1
  427. package/esm/src/react/components/ai/chat/composition/chat-if.d.ts.map +0 -1
  428. package/esm/src/react/components/ai/chat/composition/chat-message-list.d.ts.map +0 -1
  429. package/esm/src/react/components/ai/chat/composition/chat-root.d.ts.map +0 -1
  430. package/esm/src/react/components/ai/chat/composition/error-banner.d.ts.map +0 -1
  431. package/esm/src/react/components/ai/chat/composition/message.d.ts.map +0 -1
  432. package/esm/src/react/components/ai/chat/composition/model-avatar.d.ts.map +0 -1
  433. package/esm/src/react/components/ai/chat/contexts/chat-context.d.ts.map +0 -1
  434. package/esm/src/react/components/ai/chat/contexts/composer-context.d.ts.map +0 -1
  435. package/esm/src/react/components/ai/chat/contexts/index.d.ts.map +0 -1
  436. package/esm/src/react/components/ai/chat/contexts/message-context.d.ts.map +0 -1
  437. package/esm/src/react/components/ai/chat/contexts/thread-list-context.d.ts.map +0 -1
  438. package/esm/src/react/components/ai/chat/hooks/use-threads.d.ts.map +0 -1
  439. package/esm/src/react/components/ai/chat/index.d.ts.map +0 -1
  440. package/esm/src/react/components/ai/chat/utils/export.d.ts +0 -10
  441. package/esm/src/react/components/ai/chat/utils/export.d.ts.map +0 -1
  442. package/esm/src/react/components/ai/chat/utils/message-parts.d.ts.map +0 -1
  443. package/esm/src/react/components/ai/chat-with-sidebar.d.ts.map +0 -1
  444. package/esm/src/react/components/ai/chat.d.ts.map +0 -1
  445. package/esm/src/react/components/ai/csp-nonce.d.ts.map +0 -1
  446. package/esm/src/react/components/ai/error-boundary.d.ts.map +0 -1
  447. package/esm/src/react/components/ai/icons/index.d.ts.map +0 -1
  448. package/esm/src/react/components/ai/markdown.d.ts.map +0 -1
  449. package/esm/src/react/components/ai/message.d.ts.map +0 -1
  450. package/esm/src/react/components/ai/model-selector.d.ts.map +0 -1
  451. package/esm/src/react/components/ai/theme.d.ts.map +0 -1
  452. /package/esm/src/agent/{ai-defaults.js → defaults.js} +0 -0
  453. /package/esm/src/react/components/{ai → chat}/agent-card.d.ts +0 -0
  454. /package/esm/src/react/components/{ai → chat}/agent-card.js +0 -0
  455. /package/esm/src/react/components/{ai → chat}/chat/components/animations.d.ts +0 -0
  456. /package/esm/src/react/components/{ai → chat}/chat/components/animations.js +0 -0
  457. /package/esm/src/react/components/{ai → chat}/chat/components/attachment-pill.d.ts +0 -0
  458. /package/esm/src/react/components/{ai → chat}/chat/components/attachment-pill.js +0 -0
  459. /package/esm/src/react/components/{ai → chat}/chat/components/branch-picker.d.ts +0 -0
  460. /package/esm/src/react/components/{ai → chat}/chat/components/branch-picker.js +0 -0
  461. /package/esm/src/react/components/{ai → chat}/chat/components/code-block.d.ts +0 -0
  462. /package/esm/src/react/components/{ai → chat}/chat/components/code-block.js +0 -0
  463. /package/esm/src/react/components/{ai → chat}/chat/components/drop-zone.d.ts +0 -0
  464. /package/esm/src/react/components/{ai → chat}/chat/components/drop-zone.js +0 -0
  465. /package/esm/src/react/components/{ai → chat}/chat/components/empty-state.d.ts +0 -0
  466. /package/esm/src/react/components/{ai → chat}/chat/components/empty-state.js +0 -0
  467. /package/esm/src/react/components/{ai → chat}/chat/components/inference-badge.d.ts +0 -0
  468. /package/esm/src/react/components/{ai → chat}/chat/components/inline-citation.d.ts +0 -0
  469. /package/esm/src/react/components/{ai → chat}/chat/components/inline-citation.js +0 -0
  470. /package/esm/src/react/components/{ai → chat}/chat/components/message-actions.d.ts +0 -0
  471. /package/esm/src/react/components/{ai → chat}/chat/components/message-actions.js +0 -0
  472. /package/esm/src/react/components/{ai → chat}/chat/components/message-edit-form.d.ts +0 -0
  473. /package/esm/src/react/components/{ai → chat}/chat/components/message-edit-form.js +0 -0
  474. /package/esm/src/react/components/{ai → chat}/chat/components/message-feedback.d.ts +0 -0
  475. /package/esm/src/react/components/{ai → chat}/chat/components/message-feedback.js +0 -0
  476. /package/esm/src/react/components/{ai → chat}/chat/components/quick-actions.d.ts +0 -0
  477. /package/esm/src/react/components/{ai → chat}/chat/components/quick-actions.js +0 -0
  478. /package/esm/src/react/components/{ai → chat}/chat/components/reasoning.d.ts +0 -0
  479. /package/esm/src/react/components/{ai → chat}/chat/components/reasoning.js +0 -0
  480. /package/esm/src/react/components/{ai → chat}/chat/components/sidebar.d.ts +0 -0
  481. /package/esm/src/react/components/{ai → chat}/chat/components/sidebar.js +0 -0
  482. /package/esm/src/react/components/{ai → chat}/chat/components/sources.d.ts +0 -0
  483. /package/esm/src/react/components/{ai → chat}/chat/components/sources.js +0 -0
  484. /package/esm/src/react/components/{ai → chat}/chat/components/step-indicator.d.ts +0 -0
  485. /package/esm/src/react/components/{ai → chat}/chat/components/step-indicator.js +0 -0
  486. /package/esm/src/react/components/{ai → chat}/chat/components/tab-switcher.d.ts +0 -0
  487. /package/esm/src/react/components/{ai → chat}/chat/components/tab-switcher.js +0 -0
  488. /package/esm/src/react/components/{ai → chat}/chat/components/upgrade-cta.d.ts +0 -0
  489. /package/esm/src/react/components/{ai → chat}/chat/components/upgrade-cta.js +0 -0
  490. /package/esm/src/react/components/{ai → chat}/chat/components/uploads-panel.d.ts +0 -0
  491. /package/esm/src/react/components/{ai → chat}/chat/components/uploads-panel.js +0 -0
  492. /package/esm/src/react/components/{ai → chat}/chat/hooks/use-threads.js +0 -0
  493. /package/esm/src/react/components/{ai → chat}/chat-with-sidebar.d.ts +0 -0
  494. /package/esm/src/react/components/{ai → chat}/chat-with-sidebar.js +0 -0
  495. /package/esm/src/react/components/{ai → chat}/csp-nonce.d.ts +0 -0
  496. /package/esm/src/react/components/{ai → chat}/csp-nonce.js +0 -0
  497. /package/esm/src/react/components/{ai → chat}/markdown.d.ts +0 -0
  498. /package/esm/src/react/components/{ai → chat}/markdown.js +0 -0
  499. /package/esm/src/react/components/{ai → chat}/message.js +0 -0
  500. /package/esm/src/react/components/{ai → chat}/model-selector.d.ts +0 -0
  501. /package/esm/src/react/components/{ai → chat}/model-selector.js +0 -0
  502. /package/esm/src/react/components/{ai → chat}/theme.d.ts +0 -0
  503. /package/esm/src/react/components/{ai → chat}/theme.js +0 -0
  504. /package/esm/src/{ai/registry-facade.js → registry/scoped-registry-facade.js} +0 -0
  505. /package/src/src/agent/{ai-defaults.ts → defaults.ts} +0 -0
  506. /package/src/src/react/components/{ai → chat}/agent-card.tsx +0 -0
  507. /package/src/src/react/components/{ai → chat}/chat/components/animations.tsx +0 -0
  508. /package/src/src/react/components/{ai → chat}/chat/components/attachment-pill.tsx +0 -0
  509. /package/src/src/react/components/{ai → chat}/chat/components/branch-picker.tsx +0 -0
  510. /package/src/src/react/components/{ai → chat}/chat/components/code-block.tsx +0 -0
  511. /package/src/src/react/components/{ai → chat}/chat/components/drop-zone.tsx +0 -0
  512. /package/src/src/react/components/{ai → chat}/chat/components/empty-state.tsx +0 -0
  513. /package/src/src/react/components/{ai → chat}/chat/components/inline-citation.tsx +0 -0
  514. /package/src/src/react/components/{ai → chat}/chat/components/message-actions.tsx +0 -0
  515. /package/src/src/react/components/{ai → chat}/chat/components/message-edit-form.tsx +0 -0
  516. /package/src/src/react/components/{ai → chat}/chat/components/message-feedback.tsx +0 -0
  517. /package/src/src/react/components/{ai → chat}/chat/components/quick-actions.tsx +0 -0
  518. /package/src/src/react/components/{ai → chat}/chat/components/reasoning.tsx +0 -0
  519. /package/src/src/react/components/{ai → chat}/chat/components/sidebar.tsx +0 -0
  520. /package/src/src/react/components/{ai → chat}/chat/components/sources.tsx +0 -0
  521. /package/src/src/react/components/{ai → chat}/chat/components/step-indicator.tsx +0 -0
  522. /package/src/src/react/components/{ai → chat}/chat/components/tab-switcher.tsx +0 -0
  523. /package/src/src/react/components/{ai → chat}/chat/components/upgrade-cta.tsx +0 -0
  524. /package/src/src/react/components/{ai → chat}/chat/components/uploads-panel.tsx +0 -0
  525. /package/src/src/react/components/{ai → chat}/chat-with-sidebar.tsx +0 -0
  526. /package/src/src/react/components/{ai → chat}/csp-nonce.ts +0 -0
  527. /package/src/src/react/components/{ai → chat}/markdown.tsx +0 -0
  528. /package/src/src/react/components/{ai → chat}/model-selector.tsx +0 -0
  529. /package/src/src/react/components/{ai → chat}/theme.ts +0 -0
@@ -532,12 +532,6 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
532
532
  "A",
533
533
  "ACTION_BUTTON",
534
534
  "AI",
535
- "AI...",
536
- "AIErrorBoundary",
537
- "AIErrorBoundary,",
538
- "AIErrorBoundaryProps",
539
- "AIErrorBoundaryProps,",
540
- "AIErrorBoundaryState",
541
535
  "API",
542
536
  "ARROW_DOWN_ICON_ELEMENTS);",
543
537
  "ARROW_DOWN_ICON_ELEMENTS:",
@@ -714,6 +708,11 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
714
708
  "ChatContextValue",
715
709
  "ChatContextValue)",
716
710
  "ChatContextValue,",
711
+ "ChatDynamicToolPart",
712
+ "ChatDynamicToolPart)",
713
+ "ChatDynamicToolPart):",
714
+ "ChatDynamicToolPart,",
715
+ "ChatDynamicToolPart;",
717
716
  "ChatEmpty",
718
717
  "ChatEmpty(",
719
718
  "ChatEmpty,",
@@ -723,12 +722,22 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
723
722
  "ChatEmptyProps",
724
723
  "ChatEmptyProps,",
725
724
  "ChatEmptyProps>(",
725
+ "ChatErrorBoundary",
726
+ "ChatErrorBoundary,",
727
+ "ChatErrorBoundaryProps",
728
+ "ChatErrorBoundaryProps,",
729
+ "ChatErrorBoundaryState",
726
730
  "ChatIf",
727
731
  "ChatIf(",
728
732
  "ChatIf,",
729
733
  "ChatIf;",
730
734
  "ChatIfProps",
731
735
  "ChatIfProps,",
736
+ "ChatMessage",
737
+ "ChatMessage)",
738
+ "ChatMessage):",
739
+ "ChatMessage,",
740
+ "ChatMessage;",
732
741
  "ChatMessageList",
733
742
  "ChatMessageList(",
734
743
  "ChatMessageList,",
@@ -737,8 +746,18 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
737
746
  "ChatMessageListProps",
738
747
  "ChatMessageListProps,",
739
748
  "ChatMessageListProps>(",
749
+ "ChatMessagePart",
750
+ "ChatMessagePart):",
751
+ "ChatMessagePart,",
752
+ "ChatMessagePart[]",
753
+ "ChatMessagePart[]):",
754
+ "ChatMessagePart[];",
740
755
  "ChatMessageSetter",
741
756
  "ChatMessageSetter;",
757
+ "ChatMessage[",
758
+ "ChatMessage[]):",
759
+ "ChatMessage[],",
760
+ "ChatMessage[];",
742
761
  "ChatProps",
743
762
  "ChatProps,",
744
763
  "ChatProps>(function",
@@ -773,6 +792,11 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
773
792
  "ChatTheme",
774
793
  "ChatTheme,",
775
794
  "ChatTheme;",
795
+ "ChatToolPart",
796
+ "ChatToolPart)",
797
+ "ChatToolPart,",
798
+ "ChatToolState",
799
+ "ChatToolState;",
776
800
  "ChatWithSidebar",
777
801
  "ChatWithSidebar(",
778
802
  "ChatWithSidebar,",
@@ -940,11 +964,6 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
940
964
  "DropZoneOverlayProps):",
941
965
  "DropZoneOverlayProps,",
942
966
  "Dropdown",
943
- "DynamicToolUIPart",
944
- "DynamicToolUIPart)",
945
- "DynamicToolUIPart):",
946
- "DynamicToolUIPart,",
947
- "DynamicToolUIPart;",
948
967
  "ESM_MERMAID",
949
968
  "ESM_REACT_MARKDOWN",
950
969
  "ESM_REHYPE_HIGHLIGHT",
@@ -982,7 +1001,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
982
1001
  "Export",
983
1002
  "Extra",
984
1003
  "Extract",
985
- "Extract<UIMessagePart,",
1004
+ "Extract<ChatMessagePart,",
986
1005
  "FILE_TEXT_ICON_ELEMENTS);",
987
1006
  "FILE_TEXT_ICON_ELEMENTS:",
988
1007
  "FILE_TYPE_COLORS:",
@@ -1727,34 +1746,14 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
1727
1746
  "ToolResultProps",
1728
1747
  "ToolResultProps,",
1729
1748
  "ToolResultProps>(",
1730
- "ToolState,",
1731
- "ToolState;",
1732
1749
  "ToolStatusBadge",
1733
1750
  "ToolStatusBadge({",
1734
1751
  "ToolStatusBadge,",
1735
- "ToolUIPart",
1736
- "ToolUIPart)",
1737
- "ToolUIPart,",
1738
1752
  "TrashIcon",
1739
1753
  "TrashIcon({",
1740
1754
  "Try",
1741
1755
  "Type",
1742
1756
  "UI",
1743
- "UIMessage",
1744
- "UIMessage)",
1745
- "UIMessage):",
1746
- "UIMessage,",
1747
- "UIMessage;",
1748
- "UIMessagePart",
1749
- "UIMessagePart):",
1750
- "UIMessagePart,",
1751
- "UIMessagePart[]",
1752
- "UIMessagePart[]):",
1753
- "UIMessagePart[];",
1754
- "UIMessage[",
1755
- "UIMessage[]):",
1756
- "UIMessage[],",
1757
- "UIMessage[];",
1758
1757
  "UIs.",
1759
1758
  "URL.createObjectURL(blob);",
1760
1759
  "URL.revokeObjectURL(url);",
@@ -1824,7 +1823,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
1824
1823
  "[&_svg]:shrink-0",
1825
1824
  "[&_svg]:size-4",
1826
1825
  "[&_svg]:size-5",
1827
- "[AIErrorBoundary]",
1826
+ "[ChatErrorBoundary]",
1828
1827
  "[]",
1829
1828
  "[]);",
1830
1829
  "[],",
@@ -1902,7 +1901,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
1902
1901
  "[thread,",
1903
1902
  "[threads,",
1904
1903
  "[updateThread],",
1905
- "[useAIErrorHandler]",
1904
+ "[useChatErrorHandler]",
1906
1905
  "[userTheme]);",
1907
1906
  "[value,",
1908
1907
  "[visibleThreads]);",
@@ -1967,29 +1966,6 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
1967
1966
  "agent-card.tsx",
1968
1967
  "agent-primitives.tsx",
1969
1968
  "aggregator",
1970
- "ai/react/components/ai/chat",
1971
- "ai/react/components/chat",
1972
- "ai/react/components/chat-style-provider",
1973
- "ai/react/components/chat-tokens",
1974
- "ai/react/components/chat/components/skill-badge",
1975
- "ai/react/components/chat/components/tool-ui",
1976
- "ai/react/components/chat/composition/api",
1977
- "ai/react/components/chat/composition/chat-composer",
1978
- "ai/react/components/chat/composition/chat-empty",
1979
- "ai/react/components/chat/composition/chat-if",
1980
- "ai/react/components/chat/composition/chat-message-list",
1981
- "ai/react/components/chat/composition/chat-root",
1982
- "ai/react/components/chat/composition/error-banner",
1983
- "ai/react/components/chat/composition/message",
1984
- "ai/react/components/chat/composition/model-avatar",
1985
- "ai/react/components/chat/contexts",
1986
- "ai/react/components/chat/contexts/chat-context",
1987
- "ai/react/components/chat/contexts/composer-context",
1988
- "ai/react/components/chat/contexts/message-context",
1989
- "ai/react/components/chat/contexts/thread-list-context",
1990
- "ai/react/components/chat/utils/export",
1991
- "ai/react/components/chat/utils/message-parts",
1992
- "ai/react/components/color-mode",
1993
1969
  "alert",
1994
1970
  "align",
1995
1971
  "align-super",
@@ -4287,8 +4263,29 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
4287
4263
  "react-dom/client",
4288
4264
  "react-dom/server",
4289
4265
  "react-hooks/exhaustive-deps",
4290
- "react/components/ai",
4291
- "react/components/ai/icons",
4266
+ "react/components/chat",
4267
+ "react/components/chat-style-provider",
4268
+ "react/components/chat-tokens",
4269
+ "react/components/chat/components/skill-badge",
4270
+ "react/components/chat/components/tool-ui",
4271
+ "react/components/chat/composition/api",
4272
+ "react/components/chat/composition/chat-composer",
4273
+ "react/components/chat/composition/chat-empty",
4274
+ "react/components/chat/composition/chat-if",
4275
+ "react/components/chat/composition/chat-message-list",
4276
+ "react/components/chat/composition/chat-root",
4277
+ "react/components/chat/composition/error-banner",
4278
+ "react/components/chat/composition/message",
4279
+ "react/components/chat/composition/model-avatar",
4280
+ "react/components/chat/contexts",
4281
+ "react/components/chat/contexts/chat-context",
4282
+ "react/components/chat/contexts/composer-context",
4283
+ "react/components/chat/contexts/message-context",
4284
+ "react/components/chat/contexts/thread-list-context",
4285
+ "react/components/chat/icons",
4286
+ "react/components/chat/utils/export",
4287
+ "react/components/chat/utils/message-parts",
4288
+ "react/components/color-mode",
4292
4289
  "react/primitives",
4293
4290
  "read",
4294
4291
  "ready",
@@ -5213,8 +5210,6 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
5213
5210
  "url;",
5214
5211
  "url?:",
5215
5212
  "use",
5216
- "useAIErrorHandler",
5217
- "useAIErrorHandler():",
5218
5213
  "useChat",
5219
5214
  "useChat({",
5220
5215
  "useChatContext",
@@ -5225,6 +5220,8 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
5225
5220
  "useChatContextOptional():",
5226
5221
  "useChatContextOptional();",
5227
5222
  "useChatContextOptional,",
5223
+ "useChatErrorHandler",
5224
+ "useChatErrorHandler():",
5228
5225
  "useColorMode",
5229
5226
  "useColorMode():",
5230
5227
  "useColorMode();",
@@ -106,7 +106,7 @@ export class ApiHandlerWrapper extends BaseHandler {
106
106
  "api.handleWithContext",
107
107
  async () => {
108
108
  try {
109
- // Lazy per-project AI discovery (agents, tools) on first access.
109
+ // Lazy per-project primitive discovery (agents, tools) on first access.
110
110
  // Must run within runWithContext so VFS and registry scope are correct.
111
111
  await ensureProjectDiscovery(ctx);
112
112
 
@@ -6,7 +6,7 @@ import type { HandlerContext } from "../../types.js";
6
6
  const logger = serverLogger.component("api-wrapper");
7
7
 
8
8
  /**
9
- * Tracks in-flight and completed AI discovery per project+release.
9
+ * Tracks in-flight and completed primitive discovery per project+release.
10
10
  *
11
11
  * Key: `{projectSlug}:{releaseId}` for production, `{projectSlug}:preview` for preview.
12
12
  * This ensures a new deployment triggers re-discovery of agents/tools.
@@ -17,14 +17,16 @@ const logger = serverLogger.component("api-wrapper");
17
17
  const discoveredProjects = new Map<string, Promise<void>>();
18
18
 
19
19
  function buildDiscoveryConfig(ctx: HandlerContext) {
20
- const ai = ctx.config?.ai;
21
- const skillDiscoveryEnabled = ai?.skills?.discovery?.enabled ?? true;
20
+ const discoveryConfig = ctx.config?.ai;
21
+ const skillDiscoveryEnabled = discoveryConfig?.skills?.discovery?.enabled ?? true;
22
22
 
23
23
  return {
24
24
  baseDir: ctx.projectDir,
25
- toolDirs: ai?.tools?.discovery?.paths ?? ["tools"],
26
- agentDirs: ai?.agents?.discovery?.paths ?? ["agents"],
27
- skillDirs: skillDiscoveryEnabled ? (ai?.skills?.discovery?.paths ?? ["skills"]) : [],
25
+ toolDirs: discoveryConfig?.tools?.discovery?.paths ?? ["tools"],
26
+ agentDirs: discoveryConfig?.agents?.discovery?.paths ?? ["agents"],
27
+ skillDirs: skillDiscoveryEnabled
28
+ ? (discoveryConfig?.skills?.discovery?.paths ?? ["skills"])
29
+ : [],
28
30
  resourceDirs: ["resources"],
29
31
  promptDirs: ["prompts"],
30
32
  workflowDirs: ["workflows"],
@@ -65,7 +67,7 @@ function shouldCacheCompletedDiscovery(ctx: HandlerContext): boolean {
65
67
  }
66
68
 
67
69
  /**
68
- * Run AI discovery (agents, tools) for a project if not already done.
70
+ * Run primitive discovery (agents, tools) for a project if not already done.
69
71
  * Must be called within a runWithContext scope so the VFS can resolve
70
72
  * the correct remote project files and the agent registry uses the
71
73
  * correct project scope.
@@ -102,13 +104,13 @@ export async function ensureProjectDiscovery(ctx: HandlerContext): Promise<void>
102
104
  };
103
105
 
104
106
  if (result.agents.size === 0 && result.tools.size === 0) {
105
- logger.warn("AI discovery found 0 agents and 0 tools", {
107
+ logger.warn("Primitive discovery found 0 agents and 0 tools", {
106
108
  ...logData,
107
109
  errorMessages: result.errors.map((e) => e.error.message).slice(0, 5),
108
110
  baseDir: ctx.projectDir,
109
111
  });
110
112
  } else {
111
- logger.info("AI discovery completed", logData);
113
+ logger.info("Primitive discovery completed", logData);
112
114
  }
113
115
  })();
114
116
 
@@ -119,7 +121,7 @@ export async function ensureProjectDiscovery(ctx: HandlerContext): Promise<void>
119
121
  } catch (error) {
120
122
  // Allow retry on next request
121
123
  discoveredProjects.delete(key);
122
- logger.warn("AI discovery failed (will retry)", {
124
+ logger.warn("Primitive discovery failed (will retry)", {
123
125
  projectSlug: ctx.projectSlug,
124
126
  error: error instanceof Error ? error.message : String(error),
125
127
  stack: error instanceof Error ? error.stack : undefined,
@@ -211,7 +211,7 @@ export function startProductionServer(
211
211
  // the actual data client-side after hydration.
212
212
  enableSSRClientOnlyFetching();
213
213
 
214
- // Run AI discovery before serving (registries must be populated before first request)
214
+ // Run primitive discovery before serving (registries must be populated before first request)
215
215
  if (discoveryConfig) {
216
216
  try {
217
217
  const { discoverAll } = await import("../discovery/index.js");
@@ -243,7 +243,7 @@ export function startProductionServer(
243
243
  });
244
244
  }
245
245
  } catch (error) {
246
- serverLog.error("AI discovery failed", {
246
+ serverLog.error("Primitive discovery failed", {
247
247
  error: error instanceof Error ? error.message : String(error),
248
248
  });
249
249
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  export const CLIENT_BOOT_BUNDLE: string =
10
- 'var B=Object.defineProperty;var Y=(t,e,o)=>e in t?B(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var d=(t,e,o)=>Y(t,typeof e!="symbol"?e+"":e,o);var W="3.2.3";function q(t,e,o,n){let s=[];if(n?.external?.length&&s.push(`external=${n.external.join(",")}`),s.push(`target=${n?.target??"es2022"}`),n?.deps){let g=Object.entries(n.deps).map(([a,I])=>`${a}@${I}`).join(",");s.push(`deps=${g}`)}let c=e?`@${e}`:"",l=o??"",u=s.length?`?${s.join("&")}`:"";return`https://esm.sh/${t}${c}${l}${u}`}function R(t,e,o,n=!1){return q(t,e,o,{external:n?["react"]:void 0,deps:{csstype:W}})}var X="19.1.1",f=X;function N(t=f){return{react:R("react",t),"react-dom":R("react-dom",t,void 0,!0),"react-dom/client":R("react-dom",t,"/client",!0),"react-dom/server":R("react-dom",t,"/server",!0),"react/jsx-runtime":R("react",t,"/jsx-runtime",!0),"react/jsx-dev-runtime":R("react",t,"/jsx-dev-runtime",!0)}}function A(t=f){return N(t).react}function D(t=f){return N(t)["react-dom/client"]}function J(t){return t.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function v(t){return J(btoa(t))}var Nt=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function h(t,e){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t))return!0;for(let o of Object.keys(e))if(o.endsWith("/")&&t.startsWith(o))return!0;return!1}function K(t){try{return JSON.parse(t)?.imports??{}}catch{return{}}}function L(t=document){let e=t.querySelector(\'script[type="importmap"]\');return e?.textContent?K(e.textContent):{}}var i="/_veryfront",S={RSC:`${i}/rsc/`,FS:`${i}/fs/`,MODULES:`${i}/modules/`,PAGES:`${i}/pages/`,DATA:`${i}/data/`,LIB:`${i}/lib/`,CHUNKS:`${i}/chunks/`,CLIENT:`${i}/client/`},b={HMR_RUNTIME:`${i}/hmr-runtime.js`,HMR:`${i}/hmr.js`,HYDRATE:`${i}/hydrate.js`,ERROR_OVERLAY:`${i}/error-overlay.js`,DEV_LOADER:`${i}/dev-loader.js`,CLIENT_LOG:`${i}/log`,CLIENT_JS:`${i}/client.js`,ROUTER_JS:`${i}/router.js`,PREFETCH_JS:`${i}/prefetch.js`,MANIFEST_JSON:`${i}/manifest.json`,APP_JS:`${i}/app.js`,RSC_CLIENT:`${i}/rsc/client.js`,RSC_MANIFEST:`${i}/rsc/manifest`,RSC_STREAM:`${i}/rsc/stream`,RSC_PAYLOAD:`${i}/rsc/payload`,RSC_RENDER:`${i}/rsc/render`,RSC_PAGE:`${i}/rsc/page`,RSC_MODULE:`${i}/rsc/module`,RSC_DOM:`${i}/rsc/dom.js`,RSC_HYDRATOR:`${i}/rsc/hydrator.js`,RSC_HYDRATE_CLIENT:`${i}/rsc/hydrate-client.js`,LIB_AI_REACT:`${i}/lib/ai/react.js`,LIB_AI_COMPONENTS:`${i}/lib/ai/components.js`,LIB_AI_PRIMITIVES:`${i}/lib/ai/primitives.js`};var Q={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},bt=Q.CACHE;var Mt={HMR_RUNTIME:b.HMR_RUNTIME,ERROR_OVERLAY:b.ERROR_OVERLAY};var m=S.RSC,M=S.FS,U="veryfront-hydration-data",y="rsc-root";function P(t=document){try{let e=t.getElementById(U);return e?JSON.parse(e.textContent||"{}"):null}catch(e){return console.debug?.("[RSC] hydration data parse failed",e),null}}function V(t){return t?.clientModuleStrategy?t.clientModuleStrategy:t?.dev?"fs":"rsc-module"}function tt(t){return`${M}${v(t)}.js`}function et(t,e){let o=e?`&v=${encodeURIComponent(e)}`:"";return`${m}module?rel=${encodeURIComponent(t)}${o}`}function w(t){if(t.strategy==="fs"){let e=t.absPath??t.rel;return e?tt(e):null}return et(t.rel,t.version)}function F(t=document,e=f){let o=L(t);return{react:h("react",o)?"react":A(e),reactDomClient:h("react-dom/client",o)?"react-dom/client":D(e)}}function r(t){return{...t,create(e){return new C(e?.message||e?.detail||t.title,{slug:t.slug,category:t.category,status:e?.status??t.status,title:t.title,suggestion:t.suggestion,detail:e?.detail,cause:e?.cause,instance:e?.instance,context:e?.context})}}}var C=class extends Error{constructor(o,n){super(o);d(this,"slug");d(this,"category");d(this,"status");d(this,"title");d(this,"suggestion");d(this,"detail");d(this,"cause");d(this,"instance");d(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var qt=r({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),zt=r({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Xt=r({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),Jt=r({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),Kt=r({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),Zt=r({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),Qt=r({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),te=r({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),ee=r({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),re=r({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),oe=r({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),ne=r({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),se=r({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),ie=r({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),ae=r({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),ce=r({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),ue=r({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),le=r({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),ge=r({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),de=r({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),pe=r({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),Re=r({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),me=r({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),Ee=r({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),fe=r({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),ye=r({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),_e=r({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),Oe=r({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),xe=r({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),Ie=r({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),he=r({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),Se=r({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),Ce=r({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Te=r({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Ne=r({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Ae=r({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),De=r({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),ve=r({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Le=r({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),be=r({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Me=r({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Ue=r({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Pe=r({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Ve=r({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),we=r({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Fe=r({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),$e=r({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),He=r({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),ke=r({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Ge=r({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),je=r({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),Be=r({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),Ye=r({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),We=r({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),qe=r({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),ze=r({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Xe=r({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),Je=r({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Ke=r({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),Ze=r({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),Qe=r({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),tr=r({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),er=r({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),rr=r({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),or=r({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),nr=r({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),sr=r({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),ir=r({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),ar=r({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),cr=r({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),ur=r({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),lr=r({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),gr=r({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),dr=r({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),pr=r({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),Rr=r({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),mr=r({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),$=r({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Er=r({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var rt=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function ot(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function _(t,e={}){let{strict:o=!1,warn:n=!0}=e;for(let{pattern:s,name:c}of rt)if(s.lastIndex=0,!!s.test(t)&&(n&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!ot()))throw $.create({detail:`Potentially unsafe HTML: ${c} detected`});return t}var E=class{constructor(e,o){this.prefix=e;this.level=o}log(e,o,n,...s){this.level>e||o?.(n,...s)}debug(e,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${e}`,...o)}info(e,...o){this.log(1,console.log,`[${this.prefix}] ${e}`,...o)}warn(e,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${e}`,...o)}error(e,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${e}`,...o)}};function nt(){if(typeof window>"u")return 2;let t=globalThis;return t.__VERYFRONT_DEV__||t.__RSC_DEV__?t.__VERYFRONT_DEBUG__||t.__RSC_DEBUG__?0:1:2}var x=nt(),p=new E("RSC",x),Ir=new E("PREFETCH",x),hr=new E("HYDRATE",x),Sr=new E("VERYFRONT",x);function O(t,e){let o=e==="root"?y:`rsc-slot-${e}`,n=t.getElementById(o);if(n)return n;let s=t.createElement("div");return s.id=o,t.body.appendChild(s),s}function st(t,e){if(e.type!=="slot")return;let o=O(t,e.id);o.innerHTML=_(String(e.html??""))}function H(t,e){let o=e.split(`\n`),n=o.pop()??"";for(let s of o){let c=s.trim();if(!c)continue;let l;try{l=JSON.parse(c)}catch(g){p.debug("[client-dom] malformed NDJSON line",{line:c,error:g instanceof Error?g.message:String(g)});continue}if(!l||typeof l!="object")continue;let u=l;if(u.type==="slot"){st(t,u);try{ct(t,u.id||"root")}catch(g){p.debug("[client-dom] hydration optional failed",g)}}}return n}function it(t){return new Promise((e,o)=>{let n=()=>o(new DOMException("aborted","AbortError"));if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0})})}async function k(t,e=document,o){let n="body"in t?t:null,s=n?.body??t;if(!s)return;let c=s.getReader(),l=new TextDecoder,u="",g=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:I,value:j}=o?await Promise.race([a,it(o)]):await a;if(I){g=!0;break}u+=l.decode(j,{stream:!0}),u=H(e,u)}u&&H(e,`${u}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||p.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){g||p.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){p.debug("[client-dom] reader.releaseLock failed",a)}if(typeof s.cancel=="function")try{await s.cancel()}catch(a){p.debug("[client-dom] stream.cancel failed",a)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(a){p.debug("[client-dom] response.body.cancel failed",a)}}}function at(t,e){let o=O(t,e),n=[],s=c=>{let l=c;l.dataset?.clientRef&&n.push(l);for(let u of c.children)s(u)};return s(o),n}function ct(t,e){let o=at(t,e);for(let n of o){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",p.debug("[client-dom] marked for hydration",s))}}async function ut(){let t=F(document),[e,o]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:e,ReactDOM:o}}var lt=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function G(t){let e=t.getAttribute("style")??"";return t.hasAttribute("data-veryfront-head")||t.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(e)||lt.has(t.tagName.toUpperCase())}function gt(t,e){return t.find(o=>o.tagName.toUpperCase()==="DIV"&&!!o.getAttribute("class")?.trim()&&!G(o))??t.find(o=>!G(o))??e}function dt(t,e){return e?.pagePath?!1:!!t.getElementById(y)}async function pt(t){try{let e=await fetch(m+"stream"+t);if(!e.ok||!e.body)return!1;let o=new AbortController;return addEventListener("pagehide",()=>o.abort(),{once:!0}),await k(e,document,o.signal),!0}catch(e){return console.debug?.("[RSC] tryStream failed",e),!1}}async function T(){try{(await import(m+"hydrate.js")).bootHydration?.()}catch(t){console.debug?.("[RSC] hydrate import failed",t)}}async function Rt(t,e){try{let{React:o,ReactDOM:n}=await ut(),s=w({strategy:e,rel:t});if(!s)return!1;console.debug?.("[RSC] Loading component from:",s);let l=(await import(s)).default;if(typeof l!="function")return console.debug?.("[RSC] Page component is not a function"),!1;let u=gt(Array.from(document.body.children),document.body);return n.hydrateRoot(u,o.createElement(l,{}),{identifierPrefix:"vf",onRecoverableError:()=>{}}),console.debug?.("[RSC] Page component hydrated successfully"),!0}catch(o){return console.error("[RSC] Page hydration failed",o),!1}}async function mt(t){try{let e=await fetch(m+"payload"+t);if(!e.ok)return!1;let o=await e.json();if(o?.slots){for(let[n,s]of Object.entries(o.slots))O(document,n).innerHTML=_(String(s||""));return!0}return O(document,y).innerHTML=_(String(o?.html||"")),!0}catch(e){return console.debug?.("[RSC] payload fetch failed",e),!1}}async function Et(){try{let t=globalThis.window?.location.search??"",e=P(document),o=e?.pagePath,n=V(e);if(o){console.debug?.("[RSC] Found page component in hydration data:",o),await Rt(o,n)&&console.debug?.("[RSC] Client component hydrated successfully");return}if(!dt(document,e))return;if(await pt(t)){await T();return}if(await mt(t)){await T();return}await T()}catch(t){console.error("[RSC] boot failed",t)}}if(typeof document<"u"){let t=()=>{Et()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}export{Et as boot,gt as selectHydrationRoot,dt as shouldAttemptRSCTransport};\n';
10
+ 'var B=Object.defineProperty;var Y=(t,e,o)=>e in t?B(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var d=(t,e,o)=>Y(t,typeof e!="symbol"?e+"":e,o);var W="3.2.3";function q(t,e,o,n){let s=[];if(n?.external?.length&&s.push(`external=${n.external.join(",")}`),s.push(`target=${n?.target??"es2022"}`),n?.deps){let g=Object.entries(n.deps).map(([a,h])=>`${a}@${h}`).join(",");s.push(`deps=${g}`)}let c=e?`@${e}`:"",l=o??"",u=s.length?`?${s.join("&")}`:"";return`https://esm.sh/${t}${c}${l}${u}`}function R(t,e,o,n=!1){return q(t,e,o,{external:n?["react"]:void 0,deps:{csstype:W}})}var X="19.1.1",f=X;function N(t=f){return{react:R("react",t),"react-dom":R("react-dom",t,void 0,!0),"react-dom/client":R("react-dom",t,"/client",!0),"react-dom/server":R("react-dom",t,"/server",!0),"react/jsx-runtime":R("react",t,"/jsx-runtime",!0),"react/jsx-dev-runtime":R("react",t,"/jsx-dev-runtime",!0)}}function A(t=f){return N(t).react}function D(t=f){return N(t)["react-dom/client"]}function J(t){return t.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function v(t){return J(btoa(t))}var Nt=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function I(t,e){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t))return!0;for(let o of Object.keys(e))if(o.endsWith("/")&&t.startsWith(o))return!0;return!1}function K(t){try{return JSON.parse(t)?.imports??{}}catch{return{}}}function L(t=document){let e=t.querySelector(\'script[type="importmap"]\');return e?.textContent?K(e.textContent):{}}var i="/_veryfront",S={RSC:`${i}/rsc/`,FS:`${i}/fs/`,MODULES:`${i}/modules/`,PAGES:`${i}/pages/`,DATA:`${i}/data/`,LIB:`${i}/lib/`,CHUNKS:`${i}/chunks/`,CLIENT:`${i}/client/`},b={HMR_RUNTIME:`${i}/hmr-runtime.js`,HMR:`${i}/hmr.js`,HYDRATE:`${i}/hydrate.js`,ERROR_OVERLAY:`${i}/error-overlay.js`,DEV_LOADER:`${i}/dev-loader.js`,CLIENT_LOG:`${i}/log`,CLIENT_JS:`${i}/client.js`,ROUTER_JS:`${i}/router.js`,PREFETCH_JS:`${i}/prefetch.js`,MANIFEST_JSON:`${i}/manifest.json`,APP_JS:`${i}/app.js`,RSC_CLIENT:`${i}/rsc/client.js`,RSC_MANIFEST:`${i}/rsc/manifest`,RSC_STREAM:`${i}/rsc/stream`,RSC_PAYLOAD:`${i}/rsc/payload`,RSC_RENDER:`${i}/rsc/render`,RSC_PAGE:`${i}/rsc/page`,RSC_MODULE:`${i}/rsc/module`,RSC_DOM:`${i}/rsc/dom.js`,RSC_HYDRATOR:`${i}/rsc/hydrator.js`,RSC_HYDRATE_CLIENT:`${i}/rsc/hydrate-client.js`,LIB_CHAT_REACT:`${i}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${i}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${i}/lib/chat/primitives.js`};var Q={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},bt=Q.CACHE;var Mt={HMR_RUNTIME:b.HMR_RUNTIME,ERROR_OVERLAY:b.ERROR_OVERLAY};var m=S.RSC,M=S.FS,U="veryfront-hydration-data",y="rsc-root";function P(t=document){try{let e=t.getElementById(U);return e?JSON.parse(e.textContent||"{}"):null}catch(e){return console.debug?.("[RSC] hydration data parse failed",e),null}}function V(t){return t?.clientModuleStrategy?t.clientModuleStrategy:t?.dev?"fs":"rsc-module"}function tt(t){return`${M}${v(t)}.js`}function et(t,e){let o=e?`&v=${encodeURIComponent(e)}`:"";return`${m}module?rel=${encodeURIComponent(t)}${o}`}function w(t){if(t.strategy==="fs"){let e=t.absPath??t.rel;return e?tt(e):null}return et(t.rel,t.version)}function F(t=document,e=f){let o=L(t);return{react:I("react",o)?"react":A(e),reactDomClient:I("react-dom/client",o)?"react-dom/client":D(e)}}function r(t){return{...t,create(e){return new C(e?.message||e?.detail||t.title,{slug:t.slug,category:t.category,status:e?.status??t.status,title:t.title,suggestion:t.suggestion,detail:e?.detail,cause:e?.cause,instance:e?.instance,context:e?.context})}}}var C=class extends Error{constructor(o,n){super(o);d(this,"slug");d(this,"category");d(this,"status");d(this,"title");d(this,"suggestion");d(this,"detail");d(this,"cause");d(this,"instance");d(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var qt=r({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),zt=r({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Xt=r({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),Jt=r({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),Kt=r({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),Zt=r({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),Qt=r({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),te=r({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),ee=r({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),re=r({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),oe=r({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),ne=r({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),se=r({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),ie=r({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),ae=r({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),ce=r({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),ue=r({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),le=r({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),ge=r({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),de=r({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),pe=r({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),Re=r({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),me=r({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),Ee=r({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),fe=r({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),ye=r({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),_e=r({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),Oe=r({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),xe=r({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),he=r({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),Ie=r({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),Se=r({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),Ce=r({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Te=r({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Ne=r({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Ae=r({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),De=r({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),ve=r({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Le=r({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),be=r({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Me=r({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Ue=r({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Pe=r({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Ve=r({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),we=r({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Fe=r({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),He=r({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),$e=r({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),ke=r({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Ge=r({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),je=r({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),Be=r({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),Ye=r({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),We=r({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),qe=r({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),ze=r({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Xe=r({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),Je=r({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Ke=r({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),Ze=r({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),Qe=r({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),tr=r({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),er=r({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),rr=r({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),or=r({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),nr=r({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),sr=r({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),ir=r({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),ar=r({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),cr=r({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),ur=r({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),lr=r({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),gr=r({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),dr=r({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),pr=r({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),Rr=r({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),mr=r({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),H=r({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Er=r({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var rt=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function ot(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function _(t,e={}){let{strict:o=!1,warn:n=!0}=e;for(let{pattern:s,name:c}of rt)if(s.lastIndex=0,!!s.test(t)&&(n&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!ot()))throw H.create({detail:`Potentially unsafe HTML: ${c} detected`});return t}var E=class{constructor(e,o){this.prefix=e;this.level=o}log(e,o,n,...s){this.level>e||o?.(n,...s)}debug(e,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${e}`,...o)}info(e,...o){this.log(1,console.log,`[${this.prefix}] ${e}`,...o)}warn(e,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${e}`,...o)}error(e,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${e}`,...o)}};function nt(){if(typeof window>"u")return 2;let t=globalThis;return t.__VERYFRONT_DEV__||t.__RSC_DEV__?t.__VERYFRONT_DEBUG__||t.__RSC_DEBUG__?0:1:2}var x=nt(),p=new E("RSC",x),hr=new E("PREFETCH",x),Ir=new E("HYDRATE",x),Sr=new E("VERYFRONT",x);function O(t,e){let o=e==="root"?y:`rsc-slot-${e}`,n=t.getElementById(o);if(n)return n;let s=t.createElement("div");return s.id=o,t.body.appendChild(s),s}function st(t,e){if(e.type!=="slot")return;let o=O(t,e.id);o.innerHTML=_(String(e.html??""))}function $(t,e){let o=e.split(`\n`),n=o.pop()??"";for(let s of o){let c=s.trim();if(!c)continue;let l;try{l=JSON.parse(c)}catch(g){p.debug("[client-dom] malformed NDJSON line",{line:c,error:g instanceof Error?g.message:String(g)});continue}if(!l||typeof l!="object")continue;let u=l;if(u.type==="slot"){st(t,u);try{ct(t,u.id||"root")}catch(g){p.debug("[client-dom] hydration optional failed",g)}}}return n}function it(t){return new Promise((e,o)=>{let n=()=>o(new DOMException("aborted","AbortError"));if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0})})}async function k(t,e=document,o){let n="body"in t?t:null,s=n?.body??t;if(!s)return;let c=s.getReader(),l=new TextDecoder,u="",g=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:h,value:j}=o?await Promise.race([a,it(o)]):await a;if(h){g=!0;break}u+=l.decode(j,{stream:!0}),u=$(e,u)}u&&$(e,`${u}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||p.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){g||p.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){p.debug("[client-dom] reader.releaseLock failed",a)}if(typeof s.cancel=="function")try{await s.cancel()}catch(a){p.debug("[client-dom] stream.cancel failed",a)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(a){p.debug("[client-dom] response.body.cancel failed",a)}}}function at(t,e){let o=O(t,e),n=[],s=c=>{let l=c;l.dataset?.clientRef&&n.push(l);for(let u of c.children)s(u)};return s(o),n}function ct(t,e){let o=at(t,e);for(let n of o){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",p.debug("[client-dom] marked for hydration",s))}}async function ut(){let t=F(document),[e,o]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:e,ReactDOM:o}}var lt=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function G(t){let e=t.getAttribute("style")??"";return t.hasAttribute("data-veryfront-head")||t.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(e)||lt.has(t.tagName.toUpperCase())}function gt(t,e){return t.find(o=>o.tagName.toUpperCase()==="DIV"&&!!o.getAttribute("class")?.trim()&&!G(o))??t.find(o=>!G(o))??e}function dt(t,e){return e?.pagePath?!1:!!t.getElementById(y)}async function pt(t){try{let e=await fetch(m+"stream"+t);if(!e.ok||!e.body)return!1;let o=new AbortController;return addEventListener("pagehide",()=>o.abort(),{once:!0}),await k(e,document,o.signal),!0}catch(e){return console.debug?.("[RSC] tryStream failed",e),!1}}async function T(){try{(await import(m+"hydrate.js")).bootHydration?.()}catch(t){console.debug?.("[RSC] hydrate import failed",t)}}async function Rt(t,e){try{let{React:o,ReactDOM:n}=await ut(),s=w({strategy:e,rel:t});if(!s)return!1;console.debug?.("[RSC] Loading component from:",s);let l=(await import(s)).default;if(typeof l!="function")return console.debug?.("[RSC] Page component is not a function"),!1;let u=gt(Array.from(document.body.children),document.body);return n.hydrateRoot(u,o.createElement(l,{}),{identifierPrefix:"vf",onRecoverableError:()=>{}}),console.debug?.("[RSC] Page component hydrated successfully"),!0}catch(o){return console.error("[RSC] Page hydration failed",o),!1}}async function mt(t){try{let e=await fetch(m+"payload"+t);if(!e.ok)return!1;let o=await e.json();if(o?.slots){for(let[n,s]of Object.entries(o.slots))O(document,n).innerHTML=_(String(s||""));return!0}return O(document,y).innerHTML=_(String(o?.html||"")),!0}catch(e){return console.debug?.("[RSC] payload fetch failed",e),!1}}async function Et(){try{let t=globalThis.window?.location.search??"",e=P(document),o=e?.pagePath,n=V(e);if(o){console.debug?.("[RSC] Found page component in hydration data:",o),await Rt(o,n)&&console.debug?.("[RSC] Client component hydrated successfully");return}if(!dt(document,e))return;if(await pt(t)){await T();return}if(await mt(t)){await T();return}await T()}catch(t){console.error("[RSC] boot failed",t)}}if(typeof document<"u"){let t=()=>{Et()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}export{Et as boot,gt as selectHydrationRoot,dt as shouldAttemptRSCTransport};\n';
11
11
 
12
12
  export const CLIENT_DOM_BUNDLE: string =
13
- 'var A=Object.defineProperty;var x=(r,t,o)=>t in r?A(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var u=(r,t,o)=>x(r,typeof t!="symbol"?t+"":t,o);function e(r){return{...r,create(t){return new f(t?.message||t?.detail||r.title,{slug:r.slug,category:r.category,status:t?.status??r.status,title:r.title,suggestion:r.suggestion,detail:t?.detail,cause:t?.cause,instance:t?.instance,context:t?.context})}}}var f=class extends Error{constructor(o,n){super(o);u(this,"slug");u(this,"category");u(this,"status");u(this,"title");u(this,"suggestion");u(this,"detail");u(this,"cause");u(this,"instance");u(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var $=e({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),B=e({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Y=e({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),j=e({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),q=e({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),z=e({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),W=e({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),X=e({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),J=e({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),K=e({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),Z=e({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),Q=e({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),ee=e({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),te=e({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),re=e({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),oe=e({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),se=e({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),ne=e({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),ie=e({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),ae=e({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),ce=e({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),le=e({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),ue=e({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),ge=e({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),de=e({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),pe=e({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),Ee=e({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),Re=e({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),fe=e({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),me=e({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),_e=e({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),ye=e({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),Oe=e({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Ie=e({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Te=e({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),he=e({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),ve=e({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Ne=e({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Ae=e({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),xe=e({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Ce=e({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Se=e({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),De=e({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Le=e({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Ue=e({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),be=e({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),Me=e({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),Pe=e({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),Ve=e({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Fe=e({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),ke=e({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),we=e({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),Ge=e({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),He=e({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),$e=e({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),Be=e({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Ye=e({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),je=e({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),qe=e({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),ze=e({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),We=e({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),Xe=e({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Je=e({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),Ke=e({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Ze=e({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Qe=e({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),et=e({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),tt=e({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),rt=e({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),ot=e({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),st=e({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),nt=e({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),it=e({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),at=e({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),ct=e({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),lt=e({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),ut=e({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),_=e({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),gt=e({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var C=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function S(){let r=globalThis;return r.__VERYFRONT_DEV__===!0||r.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function y(r,t={}){let{strict:o=!1,warn:n=!0}=t;for(let{pattern:i,name:c}of C)if(i.lastIndex=0,!!i.test(r)&&(n&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!S()))throw _.create({detail:`Potentially unsafe HTML: ${c} detected`});return r}var E=class{constructor(t,o){this.prefix=t;this.level=o}log(t,o,n,...i){this.level>t||o?.(n,...i)}debug(t,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...o)}info(t,...o){this.log(1,console.log,`[${this.prefix}] ${t}`,...o)}warn(t,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...o)}error(t,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...o)}};function D(){if(typeof window>"u")return 2;let r=globalThis;return r.__VERYFRONT_DEV__||r.__RSC_DEV__?r.__VERYFRONT_DEBUG__||r.__RSC_DEBUG__?0:1:2}var R=D(),d=new E("RSC",R),mt=new E("PREFETCH",R),_t=new E("HYDRATE",R),yt=new E("VERYFRONT",R);var s="/_veryfront",m={RSC:`${s}/rsc/`,FS:`${s}/fs/`,MODULES:`${s}/modules/`,PAGES:`${s}/pages/`,DATA:`${s}/data/`,LIB:`${s}/lib/`,CHUNKS:`${s}/chunks/`,CLIENT:`${s}/client/`},O={HMR_RUNTIME:`${s}/hmr-runtime.js`,HMR:`${s}/hmr.js`,HYDRATE:`${s}/hydrate.js`,ERROR_OVERLAY:`${s}/error-overlay.js`,DEV_LOADER:`${s}/dev-loader.js`,CLIENT_LOG:`${s}/log`,CLIENT_JS:`${s}/client.js`,ROUTER_JS:`${s}/router.js`,PREFETCH_JS:`${s}/prefetch.js`,MANIFEST_JSON:`${s}/manifest.json`,APP_JS:`${s}/app.js`,RSC_CLIENT:`${s}/rsc/client.js`,RSC_MANIFEST:`${s}/rsc/manifest`,RSC_STREAM:`${s}/rsc/stream`,RSC_PAYLOAD:`${s}/rsc/payload`,RSC_RENDER:`${s}/rsc/render`,RSC_PAGE:`${s}/rsc/page`,RSC_MODULE:`${s}/rsc/module`,RSC_DOM:`${s}/rsc/dom.js`,RSC_HYDRATOR:`${s}/rsc/hydrator.js`,RSC_HYDRATE_CLIENT:`${s}/rsc/hydrate-client.js`,LIB_AI_REACT:`${s}/lib/ai/react.js`,LIB_AI_COMPONENTS:`${s}/lib/ai/components.js`,LIB_AI_PRIMITIVES:`${s}/lib/ai/primitives.js`};var U={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},vt=U.CACHE;var Nt={HMR_RUNTIME:O.HMR_RUNTIME,ERROR_OVERLAY:O.ERROR_OVERLAY};var St=m.RSC,Dt=m.FS;var I="rsc-root";function h(r,t){let o=t==="root"?I:`rsc-slot-${t}`,n=r.getElementById(o);if(n)return n;let i=r.createElement("div");return i.id=o,r.body.appendChild(i),i}function b(r,t){if(t.type!=="slot")return;let o=h(r,t.id);o.innerHTML=y(String(t.html??""))}function T(r,t){let o=t.split(`\n`),n=o.pop()??"";for(let i of o){let c=i.trim();if(!c)continue;let g;try{g=JSON.parse(c)}catch(p){d.debug("[client-dom] malformed NDJSON line",{line:c,error:p instanceof Error?p.message:String(p)});continue}if(!g||typeof g!="object")continue;let l=g;if(l.type==="slot"){b(r,l);try{V(r,l.id||"root")}catch(p){d.debug("[client-dom] hydration optional failed",p)}}}return n}function M(r){return new Promise((t,o)=>{let n=()=>o(new DOMException("aborted","AbortError"));if(r.aborted){n();return}r.addEventListener("abort",n,{once:!0})})}async function Pt(r,t=document,o){let n="body"in r?r:null,i=n?.body??r;if(!i)return;let c=i.getReader(),g=new TextDecoder,l="",p=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:v,value:N}=o?await Promise.race([a,M(o)]):await a;if(v){p=!0;break}l+=g.decode(N,{stream:!0}),l=T(t,l)}l&&T(t,`${l}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||d.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){p||d.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){d.debug("[client-dom] reader.releaseLock failed",a)}if(typeof i.cancel=="function")try{await i.cancel()}catch(a){d.debug("[client-dom] stream.cancel failed",a)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(a){d.debug("[client-dom] response.body.cancel failed",a)}}}function P(r,t){let o=h(r,t),n=[],i=c=>{let g=c;g.dataset?.clientRef&&n.push(g);for(let l of c.children)i(l)};return i(o),n}function V(r,t){let o=P(r,t);for(let n of o){let i=n.dataset?.clientRef;i&&(n.dataset.hydrated="true",d.debug("[client-dom] marked for hydration",i))}}export{Pt as consumeNdjsonStream,h as getContainer};\n';
13
+ 'var A=Object.defineProperty;var x=(r,t,o)=>t in r?A(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var u=(r,t,o)=>x(r,typeof t!="symbol"?t+"":t,o);function e(r){return{...r,create(t){return new f(t?.message||t?.detail||r.title,{slug:r.slug,category:r.category,status:t?.status??r.status,title:r.title,suggestion:r.suggestion,detail:t?.detail,cause:t?.cause,instance:t?.instance,context:t?.context})}}}var f=class extends Error{constructor(o,n){super(o);u(this,"slug");u(this,"category");u(this,"status");u(this,"title");u(this,"suggestion");u(this,"detail");u(this,"cause");u(this,"instance");u(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var $=e({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),B=e({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Y=e({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),j=e({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),q=e({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),z=e({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),W=e({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),X=e({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),J=e({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),K=e({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),Z=e({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),Q=e({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),ee=e({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),te=e({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),re=e({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),oe=e({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),se=e({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),ne=e({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),ie=e({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),ae=e({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),ce=e({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),le=e({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),ue=e({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),ge=e({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),de=e({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),pe=e({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),Ee=e({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),Re=e({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),fe=e({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),me=e({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),_e=e({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),ye=e({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),Oe=e({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Te=e({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),he=e({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Ie=e({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),ve=e({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Ne=e({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Ae=e({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),xe=e({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Ce=e({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Se=e({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),De=e({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Le=e({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Ue=e({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),be=e({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),Me=e({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),Pe=e({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),Ve=e({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Fe=e({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),ke=e({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),we=e({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),Ge=e({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),He=e({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),$e=e({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),Be=e({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Ye=e({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),je=e({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),qe=e({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),ze=e({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),We=e({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),Xe=e({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Je=e({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),Ke=e({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Ze=e({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Qe=e({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),et=e({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),tt=e({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),rt=e({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),ot=e({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),st=e({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),nt=e({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),it=e({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),at=e({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),ct=e({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),lt=e({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),ut=e({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),_=e({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),gt=e({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var C=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function S(){let r=globalThis;return r.__VERYFRONT_DEV__===!0||r.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function y(r,t={}){let{strict:o=!1,warn:n=!0}=t;for(let{pattern:i,name:c}of C)if(i.lastIndex=0,!!i.test(r)&&(n&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!S()))throw _.create({detail:`Potentially unsafe HTML: ${c} detected`});return r}var E=class{constructor(t,o){this.prefix=t;this.level=o}log(t,o,n,...i){this.level>t||o?.(n,...i)}debug(t,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...o)}info(t,...o){this.log(1,console.log,`[${this.prefix}] ${t}`,...o)}warn(t,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...o)}error(t,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...o)}};function D(){if(typeof window>"u")return 2;let r=globalThis;return r.__VERYFRONT_DEV__||r.__RSC_DEV__?r.__VERYFRONT_DEBUG__||r.__RSC_DEBUG__?0:1:2}var R=D(),d=new E("RSC",R),mt=new E("PREFETCH",R),_t=new E("HYDRATE",R),yt=new E("VERYFRONT",R);var s="/_veryfront",m={RSC:`${s}/rsc/`,FS:`${s}/fs/`,MODULES:`${s}/modules/`,PAGES:`${s}/pages/`,DATA:`${s}/data/`,LIB:`${s}/lib/`,CHUNKS:`${s}/chunks/`,CLIENT:`${s}/client/`},O={HMR_RUNTIME:`${s}/hmr-runtime.js`,HMR:`${s}/hmr.js`,HYDRATE:`${s}/hydrate.js`,ERROR_OVERLAY:`${s}/error-overlay.js`,DEV_LOADER:`${s}/dev-loader.js`,CLIENT_LOG:`${s}/log`,CLIENT_JS:`${s}/client.js`,ROUTER_JS:`${s}/router.js`,PREFETCH_JS:`${s}/prefetch.js`,MANIFEST_JSON:`${s}/manifest.json`,APP_JS:`${s}/app.js`,RSC_CLIENT:`${s}/rsc/client.js`,RSC_MANIFEST:`${s}/rsc/manifest`,RSC_STREAM:`${s}/rsc/stream`,RSC_PAYLOAD:`${s}/rsc/payload`,RSC_RENDER:`${s}/rsc/render`,RSC_PAGE:`${s}/rsc/page`,RSC_MODULE:`${s}/rsc/module`,RSC_DOM:`${s}/rsc/dom.js`,RSC_HYDRATOR:`${s}/rsc/hydrator.js`,RSC_HYDRATE_CLIENT:`${s}/rsc/hydrate-client.js`,LIB_CHAT_REACT:`${s}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${s}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${s}/lib/chat/primitives.js`};var U={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},vt=U.CACHE;var Nt={HMR_RUNTIME:O.HMR_RUNTIME,ERROR_OVERLAY:O.ERROR_OVERLAY};var St=m.RSC,Dt=m.FS;var T="rsc-root";function I(r,t){let o=t==="root"?T:`rsc-slot-${t}`,n=r.getElementById(o);if(n)return n;let i=r.createElement("div");return i.id=o,r.body.appendChild(i),i}function b(r,t){if(t.type!=="slot")return;let o=I(r,t.id);o.innerHTML=y(String(t.html??""))}function h(r,t){let o=t.split(`\n`),n=o.pop()??"";for(let i of o){let c=i.trim();if(!c)continue;let g;try{g=JSON.parse(c)}catch(p){d.debug("[client-dom] malformed NDJSON line",{line:c,error:p instanceof Error?p.message:String(p)});continue}if(!g||typeof g!="object")continue;let l=g;if(l.type==="slot"){b(r,l);try{V(r,l.id||"root")}catch(p){d.debug("[client-dom] hydration optional failed",p)}}}return n}function M(r){return new Promise((t,o)=>{let n=()=>o(new DOMException("aborted","AbortError"));if(r.aborted){n();return}r.addEventListener("abort",n,{once:!0})})}async function Pt(r,t=document,o){let n="body"in r?r:null,i=n?.body??r;if(!i)return;let c=i.getReader(),g=new TextDecoder,l="",p=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:v,value:N}=o?await Promise.race([a,M(o)]):await a;if(v){p=!0;break}l+=g.decode(N,{stream:!0}),l=h(t,l)}l&&h(t,`${l}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||d.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){p||d.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){d.debug("[client-dom] reader.releaseLock failed",a)}if(typeof i.cancel=="function")try{await i.cancel()}catch(a){d.debug("[client-dom] stream.cancel failed",a)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(a){d.debug("[client-dom] response.body.cancel failed",a)}}}function P(r,t){let o=I(r,t),n=[],i=c=>{let g=c;g.dataset?.clientRef&&n.push(g);for(let l of c.children)i(l)};return i(o),n}function V(r,t){let o=P(r,t);for(let n of o){let i=n.dataset?.clientRef;i&&(n.dataset.hydrated="true",d.debug("[client-dom] marked for hydration",i))}}export{Pt as consumeNdjsonStream,I as getContainer};\n';
@@ -8,8 +8,8 @@
8
8
  */
9
9
 
10
10
  import type { Skill } from "./types.js";
11
- import { ProjectScopedRegistryManager } from "../ai/registry-manager.js";
12
- import { ScopedRegistryFacade } from "../ai/registry-facade.js";
11
+ import { ScopedRegistryFacade } from "../registry/scoped-registry-facade.js";
12
+ import { ProjectScopedRegistryManager } from "../registry/project-scoped-registry-manager.js";
13
13
 
14
14
  const skillManager = new ProjectScopedRegistryManager<Skill>("skill");
15
15
 
@@ -1,8 +1,8 @@
1
1
  import type { Tool, ToolDefinition } from "./types.js";
2
2
  import { zodToJsonSchema } from "./schema/zod-json-schema.js";
3
3
  import { agentLogger } from "../utils/logger/logger.js";
4
- import { ProjectScopedRegistryManager } from "../ai/registry-manager.js";
5
- import { ScopedRegistryFacade } from "../ai/registry-facade.js";
4
+ import { ScopedRegistryFacade } from "../registry/scoped-registry-facade.js";
5
+ import { ProjectScopedRegistryManager } from "../registry/project-scoped-registry-manager.js";
6
6
 
7
7
  const toolManager = new ProjectScopedRegistryManager<Tool>("tool");
8
8
 
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * NPM Import Rewrites for Deno
3
3
  *
4
- * Generates regex rewrite rules from deno.json's import map so that bare
5
- * specifiers in user code (e.g. `from "ai"`) are rewritten to pinned npm:
6
- * specifiers (e.g. `from "npm:ai@6.0.33"`).
4
+ * Generates regex rewrite rules from deno.json's import map for the small set
5
+ * of framework-managed bare specifiers that still need pinning in Deno.
7
6
  *
8
7
  * Single source of truth: versions come from deno.json — no hardcoded strings.
9
8
  *
@@ -20,13 +19,6 @@ import { join } from "../platform/compat/path/index.js";
20
19
  * Each must have a corresponding entry in deno.json's import map.
21
20
  */
22
21
  const REWRITABLE_PACKAGES = [
23
- "ai",
24
- "@ai-sdk/anthropic",
25
- "@ai-sdk/openai",
26
- "@ai-sdk/google",
27
- "@ai-sdk/mistral",
28
- "@ai-sdk/provider",
29
- "@ai-sdk/provider-utils",
30
22
  "zod",
31
23
  ] as const;
32
24
 
@@ -48,16 +40,16 @@ function buildRules(importMap: Record<string, string>): RewriteRule[] {
48
40
  const mapped = importMap[pkg];
49
41
  if (!mapped) continue;
50
42
 
51
- // deno.json values look like "npm:ai@6.0.33" — use as-is
43
+ // deno.json values look like "npm:zod@4.3.6" — use as-is
52
44
  const escaped = escapeForRegex(pkg);
53
45
 
54
- // Static imports: from "ai"
46
+ // Static imports
55
47
  rules.push({
56
48
  pattern: new RegExp(`from\\s+["']${escaped}["']`, "g"),
57
49
  replacement: `from "${mapped}"`,
58
50
  });
59
51
 
60
- // Dynamic imports: import("ai")
52
+ // Dynamic imports
61
53
  rules.push({
62
54
  pattern: new RegExp(`import\\s*\\(\\s*["']${escaped}["']\\s*\\)`, "g"),
63
55
  replacement: `import("${mapped}")`,