veryfront 0.0.84 → 0.0.88

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 (442) hide show
  1. package/README.md +18 -44
  2. package/esm/deno.d.ts +0 -1
  3. package/esm/deno.js +8 -9
  4. package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts +2 -0
  5. package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts.map +1 -0
  6. package/esm/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
  7. package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts +2 -0
  8. package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts.map +1 -0
  9. package/esm/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
  10. package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +2 -0
  11. package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts.map +1 -0
  12. package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
  13. package/esm/deps/esm.sh/react@19.1.1.d.ts +2 -0
  14. package/esm/deps/esm.sh/react@19.1.1.d.ts.map +1 -0
  15. package/esm/deps/esm.sh/react@19.1.1.js +3 -0
  16. package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts +2 -0
  17. package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts.map +1 -0
  18. package/esm/deps/esm.sh/scheduler@^0.26.0.js +3 -0
  19. package/esm/proxy/main.d.ts +2 -0
  20. package/esm/proxy/main.d.ts.map +1 -0
  21. package/esm/proxy/main.js +400 -0
  22. package/esm/src/agent/react/use-agent.js +1 -1
  23. package/esm/src/agent/react/use-chat/use-chat.js +1 -1
  24. package/esm/src/agent/react/use-completion.js +1 -1
  25. package/esm/src/agent/react/use-streaming.js +1 -1
  26. package/esm/src/agent/react/use-voice-input.js +1 -1
  27. package/esm/src/cli/app/components/list-select.js +2 -2
  28. package/esm/src/cli/app/index.d.ts +1 -1
  29. package/esm/src/cli/app/index.d.ts.map +1 -1
  30. package/esm/src/cli/app/index.js +26 -33
  31. package/esm/src/cli/app/state.d.ts +3 -0
  32. package/esm/src/cli/app/state.d.ts.map +1 -1
  33. package/esm/src/cli/app/state.js +4 -0
  34. package/esm/src/cli/app/views/dashboard.d.ts.map +1 -1
  35. package/esm/src/cli/app/views/dashboard.js +45 -57
  36. package/esm/src/cli/app/views/startup.d.ts +39 -0
  37. package/esm/src/cli/app/views/startup.d.ts.map +1 -0
  38. package/esm/src/cli/app/views/startup.js +103 -0
  39. package/esm/src/cli/commands/init/config-generator.js +1 -1
  40. package/esm/src/cli/index/arg-parser.d.ts.map +1 -1
  41. package/esm/src/cli/index/arg-parser.js +1 -0
  42. package/esm/src/cli/index/command-router.d.ts.map +1 -1
  43. package/esm/src/cli/index/command-router.js +54 -39
  44. package/esm/src/cli/index/types.d.ts +4 -0
  45. package/esm/src/cli/index/types.d.ts.map +1 -1
  46. package/esm/src/cli/mcp/advanced-tools.d.ts +2 -2
  47. package/esm/src/cli/ui/colors.d.ts +8 -0
  48. package/esm/src/cli/ui/colors.d.ts.map +1 -1
  49. package/esm/src/cli/ui/colors.js +34 -0
  50. package/esm/src/cli/ui/dot-matrix.d.ts +8 -0
  51. package/esm/src/cli/ui/dot-matrix.d.ts.map +1 -1
  52. package/esm/src/cli/ui/dot-matrix.js +67 -2
  53. package/esm/src/config/loader.d.ts.map +1 -1
  54. package/esm/src/config/loader.js +5 -4
  55. package/esm/src/html/utils.js +2 -2
  56. package/esm/src/modules/component-registry/registry.d.ts +1 -1
  57. package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
  58. package/esm/src/modules/import-map/default-import-map.d.ts +1 -11
  59. package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
  60. package/esm/src/modules/import-map/default-import-map.js +3 -20
  61. package/esm/src/modules/import-map/loader.d.ts.map +1 -1
  62. package/esm/src/modules/import-map/loader.js +7 -22
  63. package/esm/src/modules/import-map/resolver.d.ts.map +1 -1
  64. package/esm/src/modules/import-map/resolver.js +12 -8
  65. package/esm/src/modules/react-loader/component-loader.d.ts +1 -1
  66. package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
  67. package/esm/src/modules/react-loader/component-loader.js +2 -0
  68. package/esm/src/modules/react-loader/extract-component.d.ts +1 -1
  69. package/esm/src/modules/react-loader/extract-component.d.ts.map +1 -1
  70. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +2 -7
  71. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
  72. package/esm/src/modules/react-loader/ssr-module-loader/loader.js +68 -38
  73. package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts +2 -0
  74. package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts.map +1 -1
  75. package/esm/src/modules/react-loader/types.d.ts +3 -1
  76. package/esm/src/modules/react-loader/types.d.ts.map +1 -1
  77. package/esm/src/modules/react-loader/unified-loader.d.ts.map +1 -1
  78. package/esm/src/modules/react-loader/unified-loader.js +7 -4
  79. package/esm/src/modules/server/module-batch-handler.d.ts +2 -0
  80. package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
  81. package/esm/src/modules/server/module-batch-handler.js +3 -1
  82. package/esm/src/modules/server/module-server.d.ts +2 -0
  83. package/esm/src/modules/server/module-server.d.ts.map +1 -1
  84. package/esm/src/modules/server/module-server.js +4 -2
  85. package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
  86. package/esm/src/modules/server/ssr-import-rewriter.js +9 -17
  87. package/esm/src/react/compat/hooks-adapter.d.ts +1 -1
  88. package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
  89. package/esm/src/react/compat/hooks-adapter.js +1 -1
  90. package/esm/src/react/compat/ssr-adapter/response-builder.d.ts +1 -1
  91. package/esm/src/react/compat/ssr-adapter/response-builder.d.ts.map +1 -1
  92. package/esm/src/react/compat/ssr-adapter/server-loader.d.ts +5 -5
  93. package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
  94. package/esm/src/react/compat/ssr-adapter/server-loader.js +2 -2
  95. package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts +1 -1
  96. package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts.map +1 -1
  97. package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts +1 -1
  98. package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts.map +1 -1
  99. package/esm/src/react/compat/ssr-adapter/string-renderer.js +1 -1
  100. package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
  101. package/esm/src/react/components/AppWrapper.d.ts +1 -1
  102. package/esm/src/react/components/AppWrapper.d.ts.map +1 -1
  103. package/esm/src/react/components/AppWrapper.js +1 -1
  104. package/esm/src/react/components/Head.d.ts +1 -1
  105. package/esm/src/react/components/Head.d.ts.map +1 -1
  106. package/esm/src/react/components/Head.js +7 -3
  107. package/esm/src/react/components/LayoutComponent.d.ts +1 -1
  108. package/esm/src/react/components/LayoutComponent.d.ts.map +1 -1
  109. package/esm/src/react/components/LayoutComponent.js +1 -1
  110. package/esm/src/react/components/Link.d.ts +1 -1
  111. package/esm/src/react/components/Link.d.ts.map +1 -1
  112. package/esm/src/react/components/Link.js +1 -1
  113. package/esm/src/react/components/MDXProvider.d.ts +1 -1
  114. package/esm/src/react/components/MDXProvider.d.ts.map +1 -1
  115. package/esm/src/react/components/MDXProvider.js +2 -2
  116. package/esm/src/react/components/ProviderComponent.d.ts +1 -1
  117. package/esm/src/react/components/ProviderComponent.d.ts.map +1 -1
  118. package/esm/src/react/components/ProviderComponent.js +1 -1
  119. package/esm/src/react/components/ai/agent-card.d.ts +2 -2
  120. package/esm/src/react/components/ai/agent-card.d.ts.map +1 -1
  121. package/esm/src/react/components/ai/agent-card.js +1 -1
  122. package/esm/src/react/components/ai/chat/components/animations.d.ts +1 -1
  123. package/esm/src/react/components/ai/chat/components/animations.d.ts.map +1 -1
  124. package/esm/src/react/components/ai/chat/components/animations.js +1 -1
  125. package/esm/src/react/components/ai/chat/components/empty-state.d.ts +1 -1
  126. package/esm/src/react/components/ai/chat/components/empty-state.d.ts.map +1 -1
  127. package/esm/src/react/components/ai/chat/components/empty-state.js +1 -1
  128. package/esm/src/react/components/ai/chat/components/message-actions.d.ts +1 -1
  129. package/esm/src/react/components/ai/chat/components/message-actions.d.ts.map +1 -1
  130. package/esm/src/react/components/ai/chat/components/message-actions.js +1 -1
  131. package/esm/src/react/components/ai/chat/components/reasoning.d.ts +1 -1
  132. package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +1 -1
  133. package/esm/src/react/components/ai/chat/components/reasoning.js +1 -1
  134. package/esm/src/react/components/ai/chat/components/tool-ui.d.ts +1 -1
  135. package/esm/src/react/components/ai/chat/components/tool-ui.d.ts.map +1 -1
  136. package/esm/src/react/components/ai/chat/components/tool-ui.js +1 -1
  137. package/esm/src/react/components/ai/chat/composition/api.d.ts +5 -4
  138. package/esm/src/react/components/ai/chat/composition/api.d.ts.map +1 -1
  139. package/esm/src/react/components/ai/chat/composition/api.js +1 -1
  140. package/esm/src/react/components/ai/chat/index.d.ts +8 -3
  141. package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
  142. package/esm/src/react/components/ai/chat/index.js +1 -1
  143. package/esm/src/react/components/ai/error-boundary.d.ts +1 -1
  144. package/esm/src/react/components/ai/error-boundary.d.ts.map +1 -1
  145. package/esm/src/react/components/ai/error-boundary.js +1 -1
  146. package/esm/src/react/components/ai/icons/index.d.ts +1 -1
  147. package/esm/src/react/components/ai/icons/index.d.ts.map +1 -1
  148. package/esm/src/react/components/ai/icons/index.js +1 -1
  149. package/esm/src/react/components/ai/markdown.d.ts +1 -1
  150. package/esm/src/react/components/ai/markdown.d.ts.map +1 -1
  151. package/esm/src/react/components/ai/markdown.js +1 -1
  152. package/esm/src/react/components/ai/message.d.ts +3 -3
  153. package/esm/src/react/components/ai/message.d.ts.map +1 -1
  154. package/esm/src/react/components/ai/message.js +1 -1
  155. package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts +1 -1
  156. package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts.map +1 -1
  157. package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.js +1 -1
  158. package/esm/src/react/components/optimized-image/OptimizedImage.d.ts +1 -1
  159. package/esm/src/react/components/optimized-image/OptimizedImage.d.ts.map +1 -1
  160. package/esm/src/react/components/optimized-image/OptimizedImage.js +1 -1
  161. package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts +1 -1
  162. package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts.map +1 -1
  163. package/esm/src/react/components/optimized-image/utils.d.ts +1 -1
  164. package/esm/src/react/components/optimized-image/utils.d.ts.map +1 -1
  165. package/esm/src/react/components/optimized-image/utils.js +1 -1
  166. package/esm/src/react/context/index.d.ts +1 -1
  167. package/esm/src/react/context/index.d.ts.map +1 -1
  168. package/esm/src/react/context/index.js +1 -1
  169. package/esm/src/react/fonts/index.d.ts +1 -1
  170. package/esm/src/react/fonts/index.d.ts.map +1 -1
  171. package/esm/src/react/fonts/index.js +1 -1
  172. package/esm/src/react/primitives/agent-primitives.d.ts +4 -4
  173. package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
  174. package/esm/src/react/primitives/agent-primitives.js +1 -1
  175. package/esm/src/react/primitives/chat-container.d.ts +2 -2
  176. package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
  177. package/esm/src/react/primitives/chat-container.js +1 -1
  178. package/esm/src/react/primitives/input-box.d.ts +4 -4
  179. package/esm/src/react/primitives/input-box.d.ts.map +1 -1
  180. package/esm/src/react/primitives/input-box.js +7 -3
  181. package/esm/src/react/primitives/message-list.d.ts +5 -5
  182. package/esm/src/react/primitives/message-list.d.ts.map +1 -1
  183. package/esm/src/react/primitives/message-list.js +1 -1
  184. package/esm/src/react/primitives/tool-primitives.d.ts +4 -4
  185. package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
  186. package/esm/src/react/primitives/tool-primitives.js +1 -1
  187. package/esm/src/react/router/index.d.ts +1 -1
  188. package/esm/src/react/router/index.d.ts.map +1 -1
  189. package/esm/src/react/router/index.js +1 -1
  190. package/esm/src/rendering/app-reserved.d.ts +1 -1
  191. package/esm/src/rendering/app-reserved.d.ts.map +1 -1
  192. package/esm/src/rendering/app-reserved.js +1 -1
  193. package/esm/src/rendering/client/router.js +1 -1
  194. package/esm/src/rendering/client/state-bridge.d.ts +1 -1
  195. package/esm/src/rendering/client/state-bridge.d.ts.map +1 -1
  196. package/esm/src/rendering/client/state-bridge.js +1 -1
  197. package/esm/src/rendering/component-handling.d.ts +3 -1
  198. package/esm/src/rendering/component-handling.d.ts.map +1 -1
  199. package/esm/src/rendering/component-handling.js +4 -2
  200. package/esm/src/rendering/element-validator/element-normalizer.d.ts +1 -1
  201. package/esm/src/rendering/element-validator/element-normalizer.d.ts.map +1 -1
  202. package/esm/src/rendering/element-validator/element-normalizer.js +1 -1
  203. package/esm/src/rendering/element-validator/primitive-checks.d.ts +1 -1
  204. package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
  205. package/esm/src/rendering/element-validator/primitive-checks.js +1 -1
  206. package/esm/src/rendering/element-validator/validator-core.d.ts +1 -1
  207. package/esm/src/rendering/element-validator/validator-core.d.ts.map +1 -1
  208. package/esm/src/rendering/layouts/layout-applicator.d.ts +1 -1
  209. package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
  210. package/esm/src/rendering/layouts/layout-applicator.js +2 -0
  211. package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
  212. package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
  213. package/esm/src/rendering/layouts/utils/component-loader.d.ts +1 -1
  214. package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
  215. package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts +1 -1
  216. package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts.map +1 -1
  217. package/esm/src/rendering/orchestrator/layout.d.ts +1 -1
  218. package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
  219. package/esm/src/rendering/orchestrator/module-loader/index.d.ts +3 -0
  220. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  221. package/esm/src/rendering/orchestrator/module-loader/index.js +74 -19
  222. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  223. package/esm/src/rendering/orchestrator/pipeline.js +2 -0
  224. package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts +1 -1
  225. package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
  226. package/esm/src/rendering/page-renderer.d.ts +1 -1
  227. package/esm/src/rendering/page-renderer.d.ts.map +1 -1
  228. package/esm/src/rendering/page-rendering.d.ts +1 -1
  229. package/esm/src/rendering/page-rendering.d.ts.map +1 -1
  230. package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts +1 -1
  231. package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
  232. package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts +1 -1
  233. package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
  234. package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts +1 -1
  235. package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
  236. package/esm/src/rendering/rsc/server-renderer/tree-processor.js +4 -2
  237. package/esm/src/rendering/snippet-renderer.js +2 -2
  238. package/esm/src/rendering/ssr/component-registry.d.ts +1 -1
  239. package/esm/src/rendering/ssr/component-registry.d.ts.map +1 -1
  240. package/esm/src/rendering/ssr/component-registry.js +1 -1
  241. package/esm/src/rendering/ssr-renderer.d.ts +1 -1
  242. package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
  243. package/esm/src/rendering/utils/react-helpers.d.ts +1 -1
  244. package/esm/src/rendering/utils/react-helpers.d.ts.map +1 -1
  245. package/esm/src/rendering/utils/react-helpers.js +1 -1
  246. package/esm/src/server/handlers/request/ssr/error-page-fallback.js +1 -1
  247. package/esm/src/server/handlers/request/ssr/not-found-fallback.js +1 -1
  248. package/esm/src/transforms/esm/http-bundler.d.ts +15 -4
  249. package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
  250. package/esm/src/transforms/esm/http-bundler.js +105 -12
  251. package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
  252. package/esm/src/transforms/esm/http-cache.js +51 -44
  253. package/esm/src/transforms/esm/import-rewriter.d.ts.map +1 -1
  254. package/esm/src/transforms/esm/import-rewriter.js +3 -3
  255. package/esm/src/transforms/esm/package-registry.d.ts +15 -13
  256. package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
  257. package/esm/src/transforms/esm/package-registry.js +45 -32
  258. package/esm/src/transforms/esm/react-imports.d.ts.map +1 -1
  259. package/esm/src/transforms/esm/react-imports.js +3 -7
  260. package/esm/src/transforms/esm/types.d.ts +2 -0
  261. package/esm/src/transforms/esm/types.d.ts.map +1 -1
  262. package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts +14 -0
  263. package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
  264. package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +67 -0
  265. package/esm/src/transforms/mdx/esm-module-loader/loader.d.ts.map +1 -1
  266. package/esm/src/transforms/mdx/esm-module-loader/loader.js +1 -1
  267. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -0
  268. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
  269. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +1 -0
  270. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +4 -0
  271. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
  272. package/esm/src/transforms/mdx/index.d.ts +1 -1
  273. package/esm/src/transforms/mdx/index.d.ts.map +1 -1
  274. package/esm/src/transforms/mdx/index.js +1 -1
  275. package/esm/src/transforms/mdx/mdx-cache-adapter.js +1 -1
  276. package/esm/src/transforms/mdx/module-loader/types.d.ts +1 -1
  277. package/esm/src/transforms/mdx/module-loader/types.d.ts.map +1 -1
  278. package/esm/src/transforms/mdx/types.d.ts +2 -2
  279. package/esm/src/transforms/mdx/types.d.ts.map +1 -1
  280. package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
  281. package/esm/src/transforms/pipeline/context.js +7 -15
  282. package/esm/src/transforms/pipeline/stages/finalize.d.ts.map +1 -1
  283. package/esm/src/transforms/pipeline/stages/finalize.js +1 -1
  284. package/esm/src/types/app.d.ts +1 -1
  285. package/esm/src/types/app.d.ts.map +1 -1
  286. package/esm/src/types/global-guards.d.ts +1 -1
  287. package/esm/src/types/global-guards.d.ts.map +1 -1
  288. package/esm/src/types/index.d.ts +1 -1
  289. package/esm/src/types/index.d.ts.map +1 -1
  290. package/esm/src/utils/constants/cdn.d.ts.map +1 -1
  291. package/esm/src/utils/constants/cdn.js +22 -11
  292. package/esm/src/utils/hash-utils.d.ts +2 -0
  293. package/esm/src/utils/hash-utils.d.ts.map +1 -1
  294. package/esm/src/utils/hash-utils.js +4 -0
  295. package/esm/src/workflow/react/use-approval.js +1 -1
  296. package/esm/src/workflow/react/use-workflow-list.js +1 -1
  297. package/esm/src/workflow/react/use-workflow-start.js +1 -1
  298. package/esm/src/workflow/react/use-workflow.js +1 -1
  299. package/package.json +2 -1
  300. package/src/deno.js +8 -9
  301. package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/client.d.ts +105 -0
  302. package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/server.d.ts +162 -0
  303. package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/global.d.ts +165 -0
  304. package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/index.d.ts +4267 -0
  305. package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/global.d.ts +165 -0
  306. package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/index.d.ts +4267 -0
  307. package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/jsx-runtime.d.ts +36 -0
  308. package/src/deps/esm.sh/@types/scheduler@0.26.0/index.d.ts +30 -0
  309. package/src/deps/esm.sh/csstype@3.2.3/index.d.ts +22569 -0
  310. package/src/deps/esm.sh/react-dom@19.1.1/client.d.ts +105 -0
  311. package/src/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
  312. package/src/deps/esm.sh/react-dom@19.1.1/server.d.ts +162 -0
  313. package/src/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
  314. package/src/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +36 -0
  315. package/src/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
  316. package/src/deps/esm.sh/react@19.1.1.d.ts +4267 -0
  317. package/src/deps/esm.sh/react@19.1.1.js +3 -0
  318. package/src/deps/esm.sh/scheduler@^0.26.0.d.ts +30 -0
  319. package/src/deps/esm.sh/scheduler@^0.26.0.js +3 -0
  320. package/src/proxy/main.ts +471 -0
  321. package/src/src/agent/react/use-agent.ts +1 -1
  322. package/src/src/agent/react/use-chat/use-chat.ts +1 -1
  323. package/src/src/agent/react/use-completion.ts +1 -1
  324. package/src/src/agent/react/use-streaming.ts +1 -1
  325. package/src/src/agent/react/use-voice-input.ts +1 -1
  326. package/src/src/cli/app/components/list-select.ts +2 -2
  327. package/src/src/cli/app/index.ts +34 -35
  328. package/src/src/cli/app/state.ts +7 -0
  329. package/src/src/cli/app/views/dashboard.ts +46 -60
  330. package/src/src/cli/app/views/startup.ts +132 -0
  331. package/src/src/cli/commands/init/config-generator.ts +1 -1
  332. package/src/src/cli/index/arg-parser.ts +1 -0
  333. package/src/src/cli/index/command-router.ts +57 -40
  334. package/src/src/cli/index/types.ts +5 -0
  335. package/src/src/cli/ui/colors.ts +37 -0
  336. package/src/src/cli/ui/dot-matrix.ts +77 -1
  337. package/src/src/config/loader.ts +5 -4
  338. package/src/src/html/utils.ts +2 -2
  339. package/src/src/modules/component-registry/registry.ts +1 -1
  340. package/src/src/modules/import-map/default-import-map.ts +3 -25
  341. package/src/src/modules/import-map/loader.ts +7 -23
  342. package/src/src/modules/import-map/resolver.ts +13 -8
  343. package/src/src/modules/react-loader/component-loader.ts +3 -1
  344. package/src/src/modules/react-loader/extract-component.ts +1 -1
  345. package/src/src/modules/react-loader/ssr-module-loader/loader.ts +95 -68
  346. package/src/src/modules/react-loader/ssr-module-loader/types.ts +2 -0
  347. package/src/src/modules/react-loader/types.ts +3 -1
  348. package/src/src/modules/react-loader/unified-loader.ts +7 -4
  349. package/src/src/modules/server/module-batch-handler.ts +7 -0
  350. package/src/src/modules/server/module-server.ts +6 -1
  351. package/src/src/modules/server/ssr-import-rewriter.ts +9 -17
  352. package/src/src/react/compat/hooks-adapter.ts +1 -1
  353. package/src/src/react/compat/ssr-adapter/response-builder.ts +1 -1
  354. package/src/src/react/compat/ssr-adapter/server-loader.ts +10 -10
  355. package/src/src/react/compat/ssr-adapter/stream-renderer.ts +2 -2
  356. package/src/src/react/compat/ssr-adapter/string-renderer.ts +3 -3
  357. package/src/src/react/compat/version-detector/feature-detector.ts +1 -1
  358. package/src/src/react/components/AppWrapper.tsx +1 -1
  359. package/src/src/react/components/Head.tsx +7 -3
  360. package/src/src/react/components/LayoutComponent.tsx +2 -2
  361. package/src/src/react/components/Link.tsx +1 -1
  362. package/src/src/react/components/MDXProvider.tsx +2 -2
  363. package/src/src/react/components/ProviderComponent.tsx +2 -2
  364. package/src/src/react/components/ai/agent-card.tsx +1 -1
  365. package/src/src/react/components/ai/chat/components/animations.tsx +1 -1
  366. package/src/src/react/components/ai/chat/components/empty-state.tsx +1 -1
  367. package/src/src/react/components/ai/chat/components/message-actions.tsx +1 -1
  368. package/src/src/react/components/ai/chat/components/reasoning.tsx +1 -1
  369. package/src/src/react/components/ai/chat/components/tool-ui.tsx +1 -1
  370. package/src/src/react/components/ai/chat/composition/api.tsx +1 -1
  371. package/src/src/react/components/ai/chat/index.tsx +1 -1
  372. package/src/src/react/components/ai/error-boundary.tsx +1 -1
  373. package/src/src/react/components/ai/icons/index.ts +1 -1
  374. package/src/src/react/components/ai/markdown.tsx +1 -1
  375. package/src/src/react/components/ai/message.tsx +1 -1
  376. package/src/src/react/components/optimized-image/OptimizedBackgroundImage.tsx +1 -1
  377. package/src/src/react/components/optimized-image/OptimizedImage.tsx +1 -1
  378. package/src/src/react/components/optimized-image/SimpleOptimizedImage.tsx +1 -1
  379. package/src/src/react/components/optimized-image/utils.tsx +1 -1
  380. package/src/src/react/context/index.ts +1 -1
  381. package/src/src/react/fonts/index.ts +1 -1
  382. package/src/src/react/primitives/agent-primitives.tsx +1 -1
  383. package/src/src/react/primitives/chat-container.tsx +1 -1
  384. package/src/src/react/primitives/input-box.tsx +5 -3
  385. package/src/src/react/primitives/message-list.tsx +1 -1
  386. package/src/src/react/primitives/tool-primitives.tsx +1 -1
  387. package/src/src/react/router/index.ts +1 -1
  388. package/src/src/rendering/app-reserved.ts +1 -1
  389. package/src/src/rendering/client/router.ts +2 -2
  390. package/src/src/rendering/client/state-bridge.ts +2 -2
  391. package/src/src/rendering/component-handling.ts +7 -1
  392. package/src/src/rendering/element-validator/element-inspector.ts +1 -1
  393. package/src/src/rendering/element-validator/element-normalizer.ts +1 -1
  394. package/src/src/rendering/element-validator/primitive-checks.ts +1 -1
  395. package/src/src/rendering/element-validator/validator-core.ts +1 -1
  396. package/src/src/rendering/layouts/layout-applicator.ts +5 -6
  397. package/src/src/rendering/layouts/utils/applicator.ts +1 -1
  398. package/src/src/rendering/layouts/utils/component-loader.ts +1 -1
  399. package/src/src/rendering/layouts/utils/ensure-valid-child.ts +1 -1
  400. package/src/src/rendering/orchestrator/layout.ts +1 -1
  401. package/src/src/rendering/orchestrator/module-loader/index.ts +91 -20
  402. package/src/src/rendering/orchestrator/pipeline.ts +2 -0
  403. package/src/src/rendering/orchestrator/ssr-orchestrator.ts +2 -2
  404. package/src/src/rendering/page-renderer.ts +1 -1
  405. package/src/src/rendering/page-rendering.ts +1 -1
  406. package/src/src/rendering/rsc/server-renderer/component-detector.ts +1 -1
  407. package/src/src/rendering/rsc/server-renderer/rsc-renderer.ts +1 -1
  408. package/src/src/rendering/rsc/server-renderer/tree-processor.ts +14 -4
  409. package/src/src/rendering/snippet-renderer.ts +2 -2
  410. package/src/src/rendering/ssr/component-registry.ts +1 -1
  411. package/src/src/rendering/ssr-renderer.ts +1 -1
  412. package/src/src/rendering/utils/react-helpers.ts +1 -1
  413. package/src/src/server/build-app-route-renderer.ts +2 -2
  414. package/src/src/server/handlers/request/rsc/handlers/render-handler.ts +1 -1
  415. package/src/src/server/handlers/request/ssr/error-page-fallback.ts +2 -2
  416. package/src/src/server/handlers/request/ssr/not-found-fallback.ts +1 -1
  417. package/src/src/transforms/esm/http-bundler.ts +101 -11
  418. package/src/src/transforms/esm/http-cache.ts +53 -45
  419. package/src/src/transforms/esm/import-rewriter.ts +5 -3
  420. package/src/src/transforms/esm/package-registry.ts +46 -32
  421. package/src/src/transforms/esm/react-imports.ts +3 -7
  422. package/src/src/transforms/esm/types.ts +2 -0
  423. package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +84 -0
  424. package/src/src/transforms/mdx/esm-module-loader/loader.ts +2 -1
  425. package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +2 -1
  426. package/src/src/transforms/mdx/esm-module-loader/types.ts +4 -0
  427. package/src/src/transforms/mdx/index.ts +1 -1
  428. package/src/src/transforms/mdx/mdx-cache-adapter.ts +1 -1
  429. package/src/src/transforms/mdx/module-loader/types.ts +1 -1
  430. package/src/src/transforms/mdx/types.ts +2 -2
  431. package/src/src/transforms/pipeline/context.ts +7 -18
  432. package/src/src/transforms/pipeline/stages/finalize.ts +6 -1
  433. package/src/src/transforms/plugins/babel-node-positions.ts +2 -2
  434. package/src/src/types/app.ts +1 -1
  435. package/src/src/types/global-guards.ts +1 -1
  436. package/src/src/types/index.ts +1 -1
  437. package/src/src/utils/constants/cdn.ts +21 -12
  438. package/src/src/utils/hash-utils.ts +5 -0
  439. package/src/src/workflow/react/use-approval.ts +1 -1
  440. package/src/src/workflow/react/use-workflow-list.ts +1 -1
  441. package/src/src/workflow/react/use-workflow-start.ts +1 -1
  442. package/src/src/workflow/react/use-workflow.ts +1 -1
@@ -76,6 +76,14 @@ const COMPACT_OPTIONS: Partial<DotMatrixOptions> = {
76
76
 
77
77
  const RESET = "\x1b[0m";
78
78
 
79
+ // Colors for spinning animation - shades of orange
80
+ const SPIN_COLORS = {
81
+ bright: "\x1b[38;2;255;165;120m", // Bright orange (leading edge, toned down)
82
+ orange: "\x1b[38;2;252;143;93m", // Brand orange
83
+ mid: "\x1b[38;2;200;110;70m", // Mid orange (trailing)
84
+ dim: "\x1b[38;2;140;80;50m", // Dim orange/brown
85
+ };
86
+
79
87
  function resolveOptions(options: DotMatrixOptions): Required<DotMatrixOptions> {
80
88
  if (options.compact) return { ...DEFAULT_OPTIONS, ...COMPACT_OPTIONS, ...options };
81
89
  return { ...DEFAULT_OPTIONS, ...options };
@@ -92,12 +100,65 @@ function renderPattern(pattern: number[][], opts: Required<DotMatrixOptions>): s
92
100
  });
93
101
  }
94
102
 
103
+ /**
104
+ * Render the pattern with a spinning blade effect
105
+ * The blade sweeps across the lit dots, creating orange → purple gradient
106
+ */
107
+ function renderSpinningPattern(
108
+ pattern: number[][],
109
+ frame: number,
110
+ opts: Required<DotMatrixOptions>,
111
+ ): string[] {
112
+ const centerRow = 3;
113
+ const centerCol = 3;
114
+ const totalFrames = 16; // Full rotation in 16 frames
115
+ const bladeAngle = ((frame % totalFrames) / totalFrames) * Math.PI * 2;
116
+
117
+ return pattern.map((row, rowIdx) => {
118
+ const dots = row.map((dot, colIdx) => {
119
+ if (dot !== 1) {
120
+ return `${opts.offColor}${opts.offChar}${RESET}`;
121
+ }
122
+
123
+ // Calculate angle from center to this dot
124
+ const dy = rowIdx - centerRow;
125
+ const dx = colIdx - centerCol;
126
+ let dotAngle = Math.atan2(dy, dx);
127
+ if (dotAngle < 0) dotAngle += Math.PI * 2;
128
+
129
+ // Calculate angular distance from the blade
130
+ let angleDiff = dotAngle - bladeAngle;
131
+ if (angleDiff < 0) angleDiff += Math.PI * 2;
132
+ if (angleDiff > Math.PI) angleDiff = Math.PI * 2 - angleDiff;
133
+
134
+ // Color based on angular distance from blade
135
+ const normalizedDiff = angleDiff / Math.PI; // 0 = at blade, 1 = opposite
136
+ let color: string;
137
+ if (normalizedDiff < 0.15) {
138
+ color = SPIN_COLORS.bright; // Leading edge - brightest orange
139
+ } else if (normalizedDiff < 0.35) {
140
+ color = SPIN_COLORS.orange; // Near blade - brand orange
141
+ } else if (normalizedDiff < 0.6) {
142
+ color = SPIN_COLORS.mid; // Trailing - mid orange
143
+ } else {
144
+ color = SPIN_COLORS.dim; // Far from blade - dim orange
145
+ }
146
+
147
+ return `${color}${opts.litChar}${RESET}`;
148
+ });
149
+ return opts.prefix + dots.join(opts.spacing);
150
+ });
151
+ }
152
+
95
153
  function renderPatternWithText(
96
154
  pattern: number[][],
97
155
  textLines: string[],
98
156
  opts: Required<DotMatrixOptions>,
157
+ spinFrame?: number,
99
158
  ): string {
100
- const faceLines = renderPattern(pattern, opts);
159
+ const faceLines = spinFrame !== undefined
160
+ ? renderSpinningPattern(pattern, spinFrame, opts)
161
+ : renderPattern(pattern, opts);
101
162
 
102
163
  const faceHeight = faceLines.length;
103
164
  const startLine = Math.floor((faceHeight - textLines.length) / 2);
@@ -164,6 +225,21 @@ export function getAgentFaceWithText(
164
225
  return renderPatternWithText(AGENT_FACE, textLines, resolveOptions(options));
165
226
  }
166
227
 
228
+ /**
229
+ * Get the agent face with spinning blade animation
230
+ * Orange and purple dots rotate around the logo
231
+ * @param textLines Text to show next to the face
232
+ * @param frame Animation frame (0-15 for full rotation)
233
+ * @param options Dot matrix options
234
+ */
235
+ export function getSpinningAgentFace(
236
+ textLines: string[],
237
+ frame: number,
238
+ options: DotMatrixOptions = {},
239
+ ): string {
240
+ return renderPatternWithText(AGENT_FACE, textLines, resolveOptions(options), frame);
241
+ }
242
+
167
243
  /**
168
244
  * Animated dot matrix display with spinner support
169
245
  */
@@ -8,7 +8,8 @@ import { isBun } from "../platform/compat/runtime.js";
8
8
  import { serverLogger } from "../utils/logger/logger.js";
9
9
  import { getReactImportMap, REACT_DEFAULT_VERSION } from "../utils/constants/cdn.js";
10
10
  import { DEFAULT_CACHE_DIR } from "../utils/constants/server.js";
11
- import { setReactVersion } from "../transforms/esm/package-registry.js";
11
+ // React version is now passed per-request via TransformOptions.reactVersion
12
+ // No longer using global singleton: import { setReactVersion } from "#veryfront/transforms/esm/package-registry.ts";
12
13
  import { buildConfigCacheKey } from "../cache/keys.js";
13
14
  import { DEFAULT_PORT } from "./defaults.js";
14
15
  import { createFileSystem } from "../platform/compat/fs.js";
@@ -198,10 +199,10 @@ function validateAndCacheConfig(userConfig: unknown, cacheKey: string): Veryfron
198
199
 
199
200
  const merged = mergeConfigs(userConfig as Partial<VeryfrontConfig>);
200
201
 
201
- // Apply React version from config (sets global default for transforms)
202
+ // React version is now passed per-request via TransformOptions.reactVersion
203
+ // Config stores it at merged.react.version, accessed wherever needed
202
204
  if (merged.react?.version) {
203
- setReactVersion(merged.react.version);
204
- serverLogger.debug("[CONFIG] React version set from config", { version: merged.react.version });
205
+ serverLogger.debug("[CONFIG] React version from config", { version: merged.react.version });
205
206
  }
206
207
 
207
208
  configCacheByProject.set(cacheKey, { revision: cacheRevision, config: merged });
@@ -97,8 +97,8 @@ interface CdnUrlTemplates {
97
97
  const CDN_URL_TEMPLATES: Record<CdnProvider, CdnUrlTemplates> = {
98
98
  "esm.sh": {
99
99
  react: (v) => `https://esm.sh/react@${v}?target=es2022`,
100
- reactDom: (v) => `https://esm.sh/react-dom@${v}?target=es2022`,
101
- reactDomClient: (v) => `https://esm.sh/react-dom@${v}/client?target=es2022`,
100
+ reactDom: (v) => `https://esm.sh/react-dom@${v}?external=react&target=es2022`,
101
+ reactDomClient: (v) => `https://esm.sh/react-dom@${v}/client?external=react&target=es2022`,
102
102
  jsxRuntime: (v) => `https://esm.sh/react@${v}/jsx-runtime?target=es2022`,
103
103
  jsxDevRuntime: (v) => `https://esm.sh/react@${v}/jsx-dev-runtime?target=es2022`,
104
104
  veryfrontAgentReact: (v) =>
@@ -1,7 +1,7 @@
1
1
  import { serverLogger as logger } from "../../utils/index.js";
2
2
  import { basename, join } from "../../platform/compat/path/index.js";
3
3
  import type { RuntimeAdapter } from "../../platform/adapters/base.js";
4
- import type * as React from "react";
4
+ import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
5
5
  import { withSpan } from "../../observability/tracing/otlp-setup.js";
6
6
 
7
7
  export interface ComponentExports {
@@ -1,10 +1,6 @@
1
1
  import * as dntShim from "../../../_dnt.shims.js";
2
2
  import type { ImportMapConfig } from "./types.js";
3
- import { isDeno } from "../../platform/compat/runtime.js";
4
- import {
5
- getDenoNpmReactMap,
6
- getReactImportMap,
7
- } from "../../transforms/esm/package-registry.js";
3
+ import { getReactImportMap } from "../../transforms/esm/package-registry.js";
8
4
 
9
5
  function ensureTrailingSlash(path: string): string {
10
6
  return path.endsWith("/") ? path : `${path}/`;
@@ -45,33 +41,15 @@ function getVeryfrontSsrImportMap(): Record<string, string> {
45
41
  };
46
42
  }
47
43
 
48
- /**
49
- * Get React import map for SSR in Deno.
50
- * Uses npm: specifiers which Deno handles natively with automatic deduplication.
51
- * See: https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong
52
- *
53
- * This replaces the previous shared-*.ts approach which required manual re-exports.
54
- */
55
- export function getDenoReactImportMap(): Record<string, string> {
56
- return getDenoNpmReactMap();
57
- }
58
-
59
44
  /**
60
45
  * Get the default import map for SSR transforms.
61
- *
62
- * For Deno SSR: Uses npm: specifiers with automatic deduplication.
63
- * For other runtimes: Uses esm.sh URLs with external=react.
46
+ * Uses esm.sh URLs consistently (NO npm: specifiers per plan requirements).
64
47
  */
65
48
  export function getDefaultImportMap(): ImportMapConfig {
66
- const reactMap = isDeno ? getDenoReactImportMap() : getReactImportMap();
49
+ const reactMap = getReactImportMap();
67
50
  const veryfrontMap = getVeryfrontSsrImportMap();
68
51
 
69
- // For Deno SSR, add scopes so that esm.sh modules with external=react
70
- // resolve their bare `react` imports to npm: specifiers.
71
- const scopes = isDeno ? { "https://esm.sh/": getDenoReactImportMap() } : undefined;
72
-
73
52
  return {
74
53
  imports: { ...veryfrontMap, ...reactMap },
75
- scopes,
76
54
  };
77
55
  }
@@ -3,15 +3,16 @@ import { dirname, join } from "../../platform/compat/path/index.js";
3
3
  import type { RuntimeAdapter } from "../../platform/adapters/base.js";
4
4
  import { getConfig } from "../../config/index.js";
5
5
  import type { ImportMapConfig } from "./types.js";
6
- import { getDefaultImportMap, getDenoReactImportMap } from "./default-import-map.js";
6
+ import { getDefaultImportMap } from "./default-import-map.js";
7
7
  import { mergeImportMaps } from "./merger.js";
8
8
  import { withSpan } from "../../observability/tracing/otlp-setup.js";
9
- import { isDeno } from "../../platform/compat/runtime.js";
9
+ import { getReactImportMap } from "../../transforms/esm/package-registry.js";
10
10
 
11
11
  function normalizeImportMapForRuntime(importMap: ImportMapConfig): ImportMapConfig {
12
12
  const normalizeValue = (value: string): string => {
13
13
  if (!value.startsWith("npm:")) return value;
14
14
 
15
+ // Convert npm: specifiers to esm.sh URLs (should not happen with new code)
15
16
  const spec = value.slice(4);
16
17
  const [base, query] = spec.split("?");
17
18
  const url = `https://esm.sh/${base}`;
@@ -23,7 +24,7 @@ function normalizeImportMapForRuntime(importMap: ImportMapConfig): ImportMapConf
23
24
  ? Object.fromEntries(Object.entries(importMap.imports).map(([k, v]) => [k, normalizeValue(v)]))
24
25
  : undefined;
25
26
 
26
- let scopes = importMap.scopes
27
+ const scopes = importMap.scopes
27
28
  ? Object.fromEntries(
28
29
  Object.entries(importMap.scopes).map(([scope, mappings]) => [
29
30
  scope,
@@ -34,31 +35,14 @@ function normalizeImportMapForRuntime(importMap: ImportMapConfig): ImportMapConf
34
35
  )
35
36
  : undefined;
36
37
 
37
- // CRITICAL: For Deno SSR, always use shared-*.ts files for React.
38
- // Project configs may have esm.sh URLs which would create multiple React instances.
39
38
  // Override React mappings AFTER all other processing to ensure single instance.
40
- // Also remove any "react/" prefix match since we have explicit mappings.
41
- if (isDeno && imports) {
42
- const reactMap = getDenoReactImportMap();
43
- // Remove any esm.sh "react/" prefix mapping that would break subpath resolution
39
+ // Remove any "react/" prefix match since we have explicit mappings.
40
+ if (imports) {
41
+ const reactMap = getReactImportMap();
44
42
  delete imports["react/"];
45
43
  imports = { ...imports, ...reactMap };
46
44
  }
47
45
 
48
- // For Deno SSR, ensure esm.sh scope has React mappings to shared-*.ts files.
49
- // This is critical because esm.sh modules with external=react have bare `react`
50
- // imports that need to resolve to our shared React instance.
51
- if (isDeno) {
52
- const reactMap = getDenoReactImportMap();
53
- const esmShScope = scopes?.["https://esm.sh/"] ?? {};
54
- // Remove any "react/" prefix match from scope as well
55
- delete esmShScope["react/"];
56
- scopes = {
57
- ...scopes,
58
- "https://esm.sh/": { ...esmShScope, ...reactMap },
59
- };
60
- }
61
-
62
46
  return { imports, scopes };
63
47
  }
64
48
 
@@ -60,21 +60,26 @@ export function resolveImport(
60
60
  if (isEsmShUrl(specifier)) {
61
61
  const esmShPackage = extractEsmShPackage(specifier);
62
62
  if (esmShPackage) {
63
+ const subpath = extractEsmShSubpath(specifier);
64
+
65
+ // Always check for explicit subpath mapping first (e.g., "react/jsx-runtime")
66
+ // This takes priority over appending subpath to base package mapping
67
+ if (subpath) {
68
+ const fullKey = esmShPackage + subpath; // e.g., "react/jsx-runtime"
69
+ const subpathMapping = scopedImports?.[fullKey] ?? importMap.imports?.[fullKey];
70
+ if (subpathMapping) return subpathMapping;
71
+ }
72
+
63
73
  const mapping = scopedImports?.[esmShPackage] ?? importMap.imports?.[esmShPackage];
64
74
  if (mapping) {
65
- const subpath = extractEsmShSubpath(specifier);
66
75
  if (!subpath) return mapping;
67
76
 
68
- // If mapping target is a file path (not HTTP URL or npm: specifier), look for explicit subpath mapping
69
- // e.g., "react" local file but "react/jsx-runtime" different local file
70
- // npm: specifiers are URL-like and should have subpaths appended
77
+ // If mapping target is a file path (not HTTP URL or npm: specifier),
78
+ // fall back to base mapping since explicit subpath wasn't found above
71
79
  const isFilePath = !mapping.startsWith("http://") && !mapping.startsWith("https://") &&
72
80
  !mapping.startsWith("npm:");
73
81
  if (isFilePath) {
74
- const fullKey = esmShPackage + subpath; // e.g., "react/jsx-runtime"
75
- const subpathMapping = scopedImports?.[fullKey] ?? importMap.imports?.[fullKey];
76
- // Use explicit subpath mapping if available, otherwise fall back to base mapping
77
- return subpathMapping ?? mapping;
82
+ return mapping;
78
83
  }
79
84
 
80
85
  return mapping + subpath;
@@ -1,5 +1,5 @@
1
1
  import { join } from "../../platform/compat/path/index.js";
2
- import type * as React from "react";
2
+ import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
3
3
  import type { RuntimeAdapter } from "../../platform/adapters/base.js";
4
4
  import { transformToESM } from "../../transforms/esm/index.js";
5
5
  import type { TransformOptions } from "../../transforms/esm/types.js";
@@ -34,6 +34,7 @@ export function loadComponentFromSource(
34
34
  adapter,
35
35
  dev,
36
36
  contentSourceId: options?.contentSourceId,
37
+ reactVersion: options?.reactVersion,
37
38
  });
38
39
  return loader.loadModule(filePath, source);
39
40
  }
@@ -44,6 +45,7 @@ export function loadComponentFromSource(
44
45
  moduleServerUrl: options?.moduleServerUrl ?? "/_vf_modules",
45
46
  vendorBundleHash: options?.vendorBundleHash,
46
47
  ssr: false,
48
+ reactVersion: options?.reactVersion,
47
49
  };
48
50
 
49
51
  const transformedCode = await transformToESM(
@@ -1,4 +1,4 @@
1
- import type * as React from "react";
1
+ import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
2
2
  import { createError, toError } from "../../errors/veryfront-error.js";
3
3
 
4
4
  export function extractComponent(
@@ -8,13 +8,12 @@
8
8
  import * as dntShim from "../../../../_dnt.shims.js";
9
9
 
10
10
 
11
- import { isAbsolute, join } from "../../../platform/compat/path/index.js";
12
- import { cwd } from "../../../platform/compat/process.js";
13
- import type * as React from "react";
11
+ import { join } from "../../../platform/compat/path/index.js";
12
+ import type * as React from "../../../../deps/esm.sh/react@19.1.1.js";
14
13
  import { transformToESM } from "../../../transforms/esm/index.js";
15
14
  import type { TransformOptions } from "../../../transforms/esm/types.js";
16
15
  import { TRANSFORM_CACHE_VERSION } from "../../../transforms/esm/package-registry.js";
17
- import { buildSSRModuleCacheKey, buildSSRModuleProjectKey } from "../../../cache/keys.js";
16
+ import { buildSSRModuleCacheKey } from "../../../cache/keys.js";
18
17
  import {
19
18
  type CrossProjectImport,
20
19
  type MissingImport,
@@ -23,6 +22,7 @@ import {
23
22
  import { createFileSystem } from "../../../platform/compat/fs.js";
24
23
  import { createError, toError } from "../../../errors/veryfront-error.js";
25
24
  import { rendererLogger as logger } from "../../../utils/index.js";
25
+ import { hashCodeHex } from "../../../utils/hash-utils.js";
26
26
  import { getApiBaseUrlEnv } from "../../../config/env.js";
27
27
  import { injectContext, withSpan } from "../../../observability/tracing/otlp-setup.js";
28
28
  import { SpanNames } from "../../../observability/tracing/span-names.js";
@@ -49,7 +49,8 @@ import {
49
49
  transformSemaphore,
50
50
  } from "./cache/index.js";
51
51
  import type { ModuleCacheEntry, SSRModuleLoaderOptions } from "./types.js";
52
- import { getCacheBaseDir, getHttpBundleCacheDir } from "../../../utils/cache-dir.js";
52
+ import { getHttpBundleCacheDir, getMdxEsmCacheDir } from "../../../utils/cache-dir.js";
53
+ import { lookupMdxEsmCache } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
53
54
  import { ensureHttpBundlesExist } from "../../../transforms/esm/http-cache.js";
54
55
  import { LRUCache } from "../../../utils/lru-wrapper.js";
55
56
 
@@ -143,24 +144,37 @@ export class SSRModuleLoader {
143
144
  const bundleMatch = errorMsg.match(/veryfront-http-bundle\/http-([a-f0-9]+)\.mjs/);
144
145
  if (bundleMatch) {
145
146
  const hash = bundleMatch[1]!;
146
- logger.warn(
147
- "[SSR-MODULE-LOADER] Import failed due to missing HTTP bundle, attempting recovery",
148
- {
149
- file: filePath.slice(-40),
150
- hash,
151
- },
152
- );
147
+ const cacheDir = getHttpBundleCacheDir();
148
+
149
+ logger.error("[SSR-MODULE-LOADER] Missing HTTP bundle after ensureHttpBundlesExist", {
150
+ file: filePath.slice(-40),
151
+ hash,
152
+ tempPath: cacheEntry.tempPath,
153
+ contentHash: cacheEntry.contentHash,
154
+ cacheDir,
155
+ expectedPath: `${cacheDir}/http-${hash}.mjs`,
156
+ });
157
+
153
158
  const { recoverHttpBundleByHash } = await import(
154
159
  "../../../transforms/esm/http-cache.js"
155
160
  );
156
- const cacheDir = getHttpBundleCacheDir();
157
161
  const recovered = await recoverHttpBundleByHash(hash, cacheDir);
158
162
  if (recovered) {
159
- logger.info("[SSR-MODULE-LOADER] HTTP bundle recovered, retrying import", { hash });
163
+ logger.info("[SSR-MODULE-LOADER] HTTP bundle recovered, retrying import", {
164
+ hash,
165
+ file: filePath.slice(-40),
166
+ });
160
167
  mod = await import(
161
168
  `file://${cacheEntry.tempPath}?v=${cacheEntry.contentHash}&retry=1`
162
169
  ) as Record<string, unknown>;
163
170
  } else {
171
+ logger.error("[SSR-MODULE-LOADER] HTTP bundle recovery failed", {
172
+ hash,
173
+ file: filePath.slice(-40),
174
+ cacheDir,
175
+ hint:
176
+ "Bundle may have expired from Redis (24h TTL) while transform was still cached",
177
+ });
164
178
  throw importError;
165
179
  }
166
180
  } else {
@@ -250,10 +264,12 @@ export class SSRModuleLoader {
250
264
  `Missing contentSourceId for SSR module cache (project: ${this.options.projectId}, file: ${filePath})`,
251
265
  );
252
266
  }
267
+ // Include reactVersion in cache key to ensure different versions don't share cached modules
268
+ const reactVersion = this.options.reactVersion ?? "default";
253
269
  return buildSSRModuleCacheKey(
254
270
  TRANSFORM_CACHE_VERSION,
255
271
  this.options.projectId,
256
- `${this.options.contentSourceId}:${filePath}`,
272
+ `${this.options.contentSourceId}:${reactVersion}:${filePath}`,
257
273
  );
258
274
  }
259
275
 
@@ -348,6 +364,7 @@ export class SSRModuleLoader {
348
364
  dev: this.options.dev,
349
365
  ssr: true,
350
366
  apiBaseUrl: this.options.apiBaseUrl,
367
+ reactVersion: this.options.reactVersion,
351
368
  };
352
369
 
353
370
  const filePathWithExt = syntheticFilePath.endsWith(ext)
@@ -444,13 +461,13 @@ export class SSRModuleLoader {
444
461
  const cacheDir = getHttpBundleCacheDir();
445
462
  const failed = await ensureHttpBundlesExist(bundlePaths, cacheDir);
446
463
  if (failed.length > 0) {
447
- logger.warn(
448
- "[SSR-MODULE-LOADER] In-memory cached module has unrecoverable HTTP bundles, re-transforming",
449
- {
450
- file: filePath.slice(-40),
451
- failed,
452
- },
453
- );
464
+ logger.warn("[SSR-MODULE-LOADER] Unrecoverable HTTP bundles, re-transforming", {
465
+ file: filePath.slice(-40),
466
+ failed,
467
+ totalBundles: bundlePaths.length,
468
+ cacheDir,
469
+ source: "memory-cache",
470
+ });
454
471
  globalModuleCache.delete(contentCacheKey);
455
472
  globalModuleCache.delete(filePathCacheKey);
456
473
  // Fall through to Redis or fresh transform
@@ -487,13 +504,13 @@ export class SSRModuleLoader {
487
504
  const cacheDir = getHttpBundleCacheDir();
488
505
  const failed = await ensureHttpBundlesExist(bundlePaths, cacheDir);
489
506
  if (failed.length > 0) {
490
- logger.warn(
491
- "[SSR-MODULE-LOADER] Redis cached code has unrecoverable HTTP bundles, re-transforming",
492
- {
493
- file: filePath.slice(-40),
494
- failed,
495
- },
496
- );
507
+ logger.warn("[SSR-MODULE-LOADER] Unrecoverable HTTP bundles, re-transforming", {
508
+ file: filePath.slice(-40),
509
+ failed,
510
+ totalBundles: bundlePaths.length,
511
+ cacheDir,
512
+ source: "redis-cache",
513
+ });
497
514
  httpBundlesOk = false;
498
515
  }
499
516
  }
@@ -519,6 +536,34 @@ export class SSRModuleLoader {
519
536
  }
520
537
  }
521
538
 
539
+ // Check MDX-ESM cache to share modules with MDX loader and avoid duplicate React contexts
540
+ if (this.options.projectId && this.options.contentSourceId) {
541
+ const baseCacheDir = getMdxEsmCacheDir();
542
+ const projectKey = hashCodeHex(this.options.projectId);
543
+ const sourceKey = hashCodeHex(this.options.contentSourceId);
544
+ const mdxCacheDir = join(baseCacheDir, projectKey, sourceKey);
545
+
546
+ const mdxCachedPath = await lookupMdxEsmCache(
547
+ filePath,
548
+ mdxCacheDir,
549
+ this.options.projectDir,
550
+ contentHash,
551
+ );
552
+ if (mdxCachedPath) {
553
+ const entry: ModuleCacheEntry = { tempPath: mdxCachedPath, contentHash };
554
+ globalModuleCache.set(contentCacheKey, entry);
555
+ globalModuleCache.set(filePathCacheKey, entry);
556
+
557
+ logger.debug("[SSR-MODULE-LOADER] Reusing MDX-ESM cache", {
558
+ file: filePath.slice(-40),
559
+ cachedPath: mdxCachedPath.slice(-60),
560
+ });
561
+
562
+ await this.ensureDependenciesExist(code, filePath, depth);
563
+ return;
564
+ }
565
+ }
566
+
522
567
  const existingTransform = globalInProgress.get(inProgressKey);
523
568
  if (existingTransform) {
524
569
  try {
@@ -613,6 +658,7 @@ export class SSRModuleLoader {
613
658
  dev: this.options.dev,
614
659
  ssr: true,
615
660
  apiBaseUrl: this.options.apiBaseUrl,
661
+ reactVersion: this.options.reactVersion,
616
662
  };
617
663
 
618
664
  let transformed = await withSpan(
@@ -642,13 +688,13 @@ export class SSRModuleLoader {
642
688
  const cacheDir = getHttpBundleCacheDir();
643
689
  const failed = await ensureHttpBundlesExist(bundlePaths, cacheDir);
644
690
  if (failed.length > 0) {
645
- logger.warn(
646
- "[SSR-MODULE-LOADER] Some HTTP bundles could not be recovered",
647
- {
648
- file: filePath.slice(-40),
649
- failed,
650
- },
651
- );
691
+ logger.warn("[SSR-MODULE-LOADER] Unrecoverable HTTP bundles", {
692
+ file: filePath.slice(-40),
693
+ failed,
694
+ totalBundles: bundlePaths.length,
695
+ cacheDir,
696
+ source: "fresh-transform",
697
+ });
652
698
  }
653
699
  }
654
700
 
@@ -927,26 +973,12 @@ export class SSRModuleLoader {
927
973
  }
928
974
  }
929
975
 
930
- /**
931
- * Fast sync hash for small strings (project IDs, etc.)
932
- * Use hashContentAsync for large file content.
933
- */
934
- private hashCode(str: string): string {
935
- let hash = 0;
936
- for (let i = 0; i < str.length; i++) {
937
- const char = str.charCodeAt(i);
938
- hash = (hash << 5) - hash + char;
939
- hash = hash & hash;
940
- }
941
- return Math.abs(hash).toString(16);
942
- }
943
-
944
976
  /**
945
977
  * Async hash for large content using Web Crypto API.
946
- * Doesn't block event loop for large files.
978
+ * Falls back to sync hash for small files.
947
979
  */
948
980
  private async hashContentAsync(content: string): Promise<string> {
949
- if (content.length < 10000) return this.hashCode(content);
981
+ if (content.length < 10000) return hashCodeHex(content);
950
982
 
951
983
  try {
952
984
  const data = new TextEncoder().encode(content);
@@ -957,7 +989,7 @@ export class SSRModuleLoader {
957
989
  .map((b) => b.toString(16).padStart(2, "0"))
958
990
  .join("");
959
991
  } catch {
960
- return this.hashCode(content);
992
+ return hashCodeHex(content);
961
993
  }
962
994
  }
963
995
 
@@ -977,33 +1009,28 @@ export class SSRModuleLoader {
977
1009
  }
978
1010
 
979
1011
  private async ensureTmpDir(): Promise<string> {
980
- let projectDir = this.options.projectDir;
981
1012
  const { projectId, contentSourceId } = this.options;
982
1013
 
983
1014
  if (!projectId) {
984
- throw new Error(`Missing projectId for SSR temp directory (projectDir: ${projectDir})`);
1015
+ throw new Error(
1016
+ `Missing projectId for SSR temp directory (projectDir: ${this.options.projectDir})`,
1017
+ );
985
1018
  }
986
1019
  if (!contentSourceId) {
987
1020
  throw new Error(`Missing contentSourceId for SSR temp directory (project: ${projectId})`);
988
1021
  }
989
1022
 
990
- if (!projectDir.startsWith("/")) {
991
- projectDir = join(cwd(), projectDir);
992
- }
993
-
994
- const cacheBaseDir = getCacheBaseDir();
995
- const baseDir = isAbsolute(cacheBaseDir) ? cacheBaseDir : join(cwd(), cacheBaseDir);
996
-
997
- const cacheKey = `${baseDir}|${
998
- buildSSRModuleProjectKey(projectDir, projectId)
999
- }|${contentSourceId}`;
1023
+ // Use the same cache directory as MDX-ESM loader to share module instances.
1024
+ // This prevents issues like React context being created twice in separate files.
1025
+ const baseCacheDir = getMdxEsmCacheDir();
1026
+ const projectKey = hashCodeHex(projectId);
1027
+ const sourceKey = hashCodeHex(contentSourceId);
1028
+ const cacheKey = `${baseCacheDir}|${projectKey}|${sourceKey}`;
1000
1029
 
1001
1030
  const existingDir = globalTmpDirs.get(cacheKey);
1002
1031
  if (existingDir) return existingDir;
1003
1032
 
1004
- const projectKey = this.hashCode(projectId);
1005
- const sourceKey = this.hashCode(contentSourceId);
1006
- const tmpDir = join(baseDir, "veryfront-ssr", projectKey, sourceKey);
1033
+ const tmpDir = join(baseCacheDir, projectKey, sourceKey);
1007
1034
 
1008
1035
  await this.fs.mkdir(tmpDir, { recursive: true });
1009
1036
  globalTmpDirs.set(cacheKey, tmpDir);
@@ -16,6 +16,8 @@ export interface SSRModuleLoaderOptions {
16
16
  apiBaseUrl?: string;
17
17
  /** Content source ID for cache isolation (branch name or release ID) */
18
18
  contentSourceId?: string;
19
+ /** React version for transforms (defaults to DEFAULT_REACT_VERSION) */
20
+ reactVersion?: string;
19
21
  }
20
22
 
21
23
  export interface ModuleCacheEntry {
@@ -1,4 +1,4 @@
1
- import type * as React from "react";
1
+ import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
2
2
 
3
3
  export interface LoadComponentOptions {
4
4
  projectId?: string;
@@ -9,6 +9,8 @@ export interface LoadComponentOptions {
9
9
  ssr?: boolean;
10
10
  /** Content source ID for cache isolation (branch name or release ID) */
11
11
  contentSourceId?: string;
12
+ /** React version for transforms (from project config) */
13
+ reactVersion?: string;
12
14
  }
13
15
 
14
16
  export interface ComponentSource {