veryfront 0.1.49 → 0.1.51

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 (1571) hide show
  1. package/esm/_dnt.polyfills.d.ts +8 -7
  2. package/esm/_dnt.polyfills.d.ts.map +1 -1
  3. package/esm/_dnt.polyfills.js +121 -109
  4. package/esm/cli/commands/dev/command.d.ts.map +1 -1
  5. package/esm/cli/commands/dev/command.js +0 -1
  6. package/esm/cli/commands/generate/integration-generator.d.ts +8 -0
  7. package/esm/cli/commands/generate/integration-generator.d.ts.map +1 -1
  8. package/esm/cli/commands/generate/integration-generator.js +322 -34
  9. package/esm/cli/commands/install/types.d.ts +2 -2
  10. package/esm/cli/commands/serve/handler.d.ts +1 -1
  11. package/esm/cli/commands/start/command.d.ts.map +1 -1
  12. package/esm/cli/commands/start/command.js +0 -1
  13. package/esm/cli/commands/studio/handler.d.ts +1 -1
  14. package/esm/cli/mcp/remote-file-tools.d.ts +6 -6
  15. package/esm/cli/mcp/server.d.ts.map +1 -1
  16. package/esm/cli/mcp/server.js +0 -2
  17. package/esm/cli/mcp/tools.d.ts +2 -2
  18. package/esm/cli/shared/server-startup.d.ts +0 -1
  19. package/esm/cli/shared/server-startup.d.ts.map +1 -1
  20. package/esm/cli/shared/server-startup.js +0 -1
  21. package/esm/cli/templates/index.d.ts.map +1 -1
  22. package/esm/cli/templates/index.js +1 -16
  23. package/esm/cli/templates/manifest.js +12 -12
  24. package/esm/cli/ui/ansi.js +1 -1
  25. package/esm/deno.js +1 -1
  26. package/esm/src/agent/ai-defaults.d.ts +0 -95
  27. package/esm/src/agent/ai-defaults.d.ts.map +1 -1
  28. package/esm/src/agent/ai-defaults.js +4 -56
  29. package/esm/src/agent/chat-handler.d.ts +1 -1
  30. package/esm/src/agent/chat-handler.d.ts.map +1 -1
  31. package/esm/src/agent/chat-handler.js +30 -14
  32. package/esm/src/agent/factory.d.ts.map +1 -1
  33. package/esm/src/agent/factory.js +13 -5
  34. package/esm/src/agent/index.d.ts +3 -10
  35. package/esm/src/agent/index.d.ts.map +1 -1
  36. package/esm/src/agent/index.js +2 -7
  37. package/esm/src/agent/memory/redis.d.ts.map +1 -1
  38. package/esm/src/agent/memory/redis.js +3 -2
  39. package/esm/src/agent/react/use-agent.d.ts +2 -2
  40. package/esm/src/agent/react/use-agent.d.ts.map +1 -1
  41. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +2 -1
  42. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +1 -1
  43. package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +9 -1
  44. package/esm/src/agent/react/use-chat/browser-inference/types.d.ts +7 -6
  45. package/esm/src/agent/react/use-chat/browser-inference/types.d.ts.map +1 -1
  46. package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts +2 -1
  47. package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts.map +1 -1
  48. package/esm/src/agent/react/use-chat/streaming/handler.d.ts.map +1 -1
  49. package/esm/src/agent/react/use-chat/streaming/handler.js +11 -5
  50. package/esm/src/agent/react/use-chat/types.d.ts +3 -2
  51. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  52. package/esm/src/agent/react/use-chat/use-chat.js +4 -4
  53. package/esm/src/agent/react/use-voice-input.js +2 -2
  54. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  55. package/esm/src/agent/runtime/index.js +16 -10
  56. package/esm/src/agent/runtime/input-utils.d.ts.map +1 -1
  57. package/esm/src/agent/runtime/input-utils.js +2 -1
  58. package/esm/src/agent/runtime/model-resolution.d.ts +4 -0
  59. package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -0
  60. package/esm/src/agent/runtime/model-resolution.js +10 -0
  61. package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
  62. package/esm/src/agent/runtime/tool-helpers.js +3 -1
  63. package/esm/src/agent/types.d.ts +12 -2
  64. package/esm/src/agent/types.d.ts.map +1 -1
  65. package/esm/src/agent/types.js +4 -1
  66. package/esm/src/build/bundler/code-splitter/entry-points.d.ts +2 -1
  67. package/esm/src/build/bundler/code-splitter/entry-points.d.ts.map +1 -1
  68. package/esm/src/build/bundler/code-splitter/index.d.ts.map +1 -1
  69. package/esm/src/build/bundler/code-splitter/index.js +4 -2
  70. package/esm/src/build/compiler/mdx-compiler/directory-compiler.d.ts +0 -1
  71. package/esm/src/build/compiler/mdx-compiler/directory-compiler.d.ts.map +1 -1
  72. package/esm/src/build/compiler/mdx-compiler/directory-compiler.js +1 -1
  73. package/esm/src/build/compiler/mdx-compiler/frontmatter-parser.d.ts +2 -1
  74. package/esm/src/build/compiler/mdx-compiler/frontmatter-parser.d.ts.map +1 -1
  75. package/esm/src/build/compiler/mdx-compiler/frontmatter-parser.js +4 -2
  76. package/esm/src/build/compiler/mdx-compiler/mdx-processor.d.ts +2 -1
  77. package/esm/src/build/compiler/mdx-compiler/mdx-processor.d.ts.map +1 -1
  78. package/esm/src/build/compiler/mdx-compiler/types.d.ts +2 -1
  79. package/esm/src/build/compiler/mdx-compiler/types.d.ts.map +1 -1
  80. package/esm/src/build/compiler/mdx-compiler/validator.d.ts.map +1 -1
  81. package/esm/src/build/compiler/mdx-compiler/validator.js +4 -3
  82. package/esm/src/build/compiler/mdx-compiler/watcher.js +2 -1
  83. package/esm/src/build/compiler/mdx-to-js.d.ts +2 -1
  84. package/esm/src/build/compiler/mdx-to-js.d.ts.map +1 -1
  85. package/esm/src/build/config/environment.d.ts.map +1 -1
  86. package/esm/src/build/config/environment.js +8 -2
  87. package/esm/src/build/embedded/preset.d.ts +2 -1
  88. package/esm/src/build/embedded/preset.d.ts.map +1 -1
  89. package/esm/src/build/embedded/preset.js +6 -6
  90. package/esm/src/build/production-build/asset-generation.js +2 -2
  91. package/esm/src/build/production-build/build/build-cleanup.d.ts.map +1 -1
  92. package/esm/src/build/production-build/build/build-cleanup.js +2 -9
  93. package/esm/src/build/production-build/client-runtime.d.ts.map +1 -1
  94. package/esm/src/build/production-build/client-runtime.js +6 -4
  95. package/esm/src/build/production-build/templates.d.ts.map +1 -1
  96. package/esm/src/build/production-build/templates.js +2 -2
  97. package/esm/src/cache/backends/api.d.ts.map +1 -1
  98. package/esm/src/cache/backends/api.js +13 -5
  99. package/esm/src/cache/backends/disk.d.ts.map +1 -1
  100. package/esm/src/cache/backends/disk.js +2 -1
  101. package/esm/src/cache/backends/factory.d.ts.map +1 -1
  102. package/esm/src/cache/backends/factory.js +2 -1
  103. package/esm/src/cache/backends/memory.d.ts.map +1 -1
  104. package/esm/src/cache/backends/memory.js +5 -3
  105. package/esm/src/cache/cache-key-builder.d.ts.map +1 -1
  106. package/esm/src/cache/cache-key-builder.js +7 -3
  107. package/esm/src/cache/config-hash.d.ts +2 -1
  108. package/esm/src/cache/config-hash.d.ts.map +1 -1
  109. package/esm/src/cache/dependency-graph.js +2 -1
  110. package/esm/src/cache/distributed-cache-init.d.ts +2 -1
  111. package/esm/src/cache/distributed-cache-init.d.ts.map +1 -1
  112. package/esm/src/cache/keys/builders/file.d.ts.map +1 -1
  113. package/esm/src/cache/keys/builders/file.js +4 -1
  114. package/esm/src/cache/keys/builders/render.d.ts.map +1 -1
  115. package/esm/src/cache/keys/builders/render.js +7 -2
  116. package/esm/src/cache/registry.d.ts.map +1 -1
  117. package/esm/src/cache/registry.js +7 -2
  118. package/esm/src/config/environment-config.d.ts.map +1 -1
  119. package/esm/src/config/environment-config.js +10 -2
  120. package/esm/src/config/loader.d.ts.map +1 -1
  121. package/esm/src/config/loader.js +20 -4
  122. package/esm/src/config/runtime-config.d.ts.map +1 -1
  123. package/esm/src/config/runtime-config.js +3 -1
  124. package/esm/src/data/data-fetcher.d.ts +1 -1
  125. package/esm/src/data/data-fetcher.d.ts.map +1 -1
  126. package/esm/src/data/data-fetcher.js +1 -2
  127. package/esm/src/data/static-data-fetcher.js +2 -2
  128. package/esm/src/discovery/file-discovery.d.ts +0 -9
  129. package/esm/src/discovery/file-discovery.d.ts.map +1 -1
  130. package/esm/src/discovery/file-discovery.js +3 -2
  131. package/esm/src/discovery/handlers/skill-handler.d.ts +3 -2
  132. package/esm/src/discovery/handlers/skill-handler.d.ts.map +1 -1
  133. package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
  134. package/esm/src/discovery/import-rewriter.js +8 -5
  135. package/esm/src/discovery/transpiler.d.ts.map +1 -1
  136. package/esm/src/discovery/transpiler.js +8 -2
  137. package/esm/src/embedding/chunk.d.ts.map +1 -1
  138. package/esm/src/embedding/chunk.js +6 -2
  139. package/esm/src/embedding/embedding.d.ts +0 -1
  140. package/esm/src/embedding/embedding.d.ts.map +1 -1
  141. package/esm/src/embedding/embedding.js +4 -3
  142. package/esm/src/embedding/index.d.ts +4 -4
  143. package/esm/src/embedding/index.d.ts.map +1 -1
  144. package/esm/src/embedding/index.js +3 -3
  145. package/esm/src/embedding/model-resolution.d.ts +4 -0
  146. package/esm/src/embedding/model-resolution.d.ts.map +1 -0
  147. package/esm/src/embedding/model-resolution.js +16 -0
  148. package/esm/src/embedding/rag-store.d.ts +27 -0
  149. package/esm/src/embedding/rag-store.d.ts.map +1 -0
  150. package/esm/src/embedding/{upload-store.js → rag-store.js} +153 -48
  151. package/esm/src/embedding/react/use-uploads.d.ts +2 -2
  152. package/esm/src/embedding/react/use-uploads.d.ts.map +1 -1
  153. package/esm/src/embedding/react/use-uploads.js +6 -3
  154. package/esm/src/embedding/resolve.d.ts +2 -1
  155. package/esm/src/embedding/resolve.d.ts.map +1 -1
  156. package/esm/src/embedding/resolve.js +4 -0
  157. package/esm/src/embedding/types.d.ts +27 -16
  158. package/esm/src/embedding/types.d.ts.map +1 -1
  159. package/esm/src/embedding/upload-handler.d.ts +6 -4
  160. package/esm/src/embedding/upload-handler.d.ts.map +1 -1
  161. package/esm/src/embedding/upload-handler.js +81 -7
  162. package/esm/src/embedding/upload-loader.js +1 -1
  163. package/esm/src/embedding/veryfront-cloud/provider.d.ts +3 -0
  164. package/esm/src/embedding/veryfront-cloud/provider.d.ts.map +1 -0
  165. package/esm/src/embedding/veryfront-cloud/provider.js +30 -0
  166. package/esm/src/embedding/veryfront-cloud/rag-store.d.ts +7 -0
  167. package/esm/src/embedding/veryfront-cloud/rag-store.d.ts.map +1 -0
  168. package/esm/src/embedding/veryfront-cloud/rag-store.js +360 -0
  169. package/esm/src/errors/catalog/general-errors.d.ts.map +1 -1
  170. package/esm/src/errors/catalog/general-errors.js +5 -0
  171. package/esm/src/errors/error-context.d.ts.map +1 -1
  172. package/esm/src/errors/error-context.js +3 -0
  173. package/esm/src/errors/error-handlers.d.ts.map +1 -1
  174. package/esm/src/errors/error-handlers.js +3 -2
  175. package/esm/src/errors/error-registry.d.ts +2 -0
  176. package/esm/src/errors/error-registry.d.ts.map +1 -1
  177. package/esm/src/errors/error-registry.js +8 -0
  178. package/esm/src/errors/index.d.ts +1 -1
  179. package/esm/src/errors/index.d.ts.map +1 -1
  180. package/esm/src/errors/index.js +1 -1
  181. package/esm/src/errors/logging.d.ts.map +1 -1
  182. package/esm/src/errors/logging.js +8 -6
  183. package/esm/src/errors/types.d.ts +2 -0
  184. package/esm/src/errors/types.d.ts.map +1 -1
  185. package/esm/src/errors/types.js +1 -1
  186. package/esm/src/errors/veryfront-error.d.ts +2 -6
  187. package/esm/src/errors/veryfront-error.d.ts.map +1 -1
  188. package/esm/src/errors/veryfront-error.js +0 -1
  189. package/esm/src/html/dev-scripts.d.ts +2 -1
  190. package/esm/src/html/dev-scripts.d.ts.map +1 -1
  191. package/esm/src/html/hydration-script-builder/dev-error-logger.js +1 -1
  192. package/esm/src/html/hydration-script-builder/dev-scripts.d.ts +2 -1
  193. package/esm/src/html/hydration-script-builder/dev-scripts.d.ts.map +1 -1
  194. package/esm/src/html/hydration-script-builder/templates/renderer.d.ts.map +1 -1
  195. package/esm/src/html/hydration-script-builder/templates/renderer.js +4 -3
  196. package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
  197. package/esm/src/html/hydration-script-builder/templates/router.js +5 -4
  198. package/esm/src/html/schemas/html.schema.d.ts +2 -2
  199. package/esm/src/html/styles-builder/css-hash-cache.d.ts +2 -1
  200. package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
  201. package/esm/src/html/styles-builder/css-hash-cache.js +16 -14
  202. package/esm/src/html/styles-builder/css-pregeneration.d.ts +2 -1
  203. package/esm/src/html/styles-builder/css-pregeneration.d.ts.map +1 -1
  204. package/esm/src/html/styles-builder/index.d.ts +1 -1
  205. package/esm/src/html/styles-builder/index.d.ts.map +1 -1
  206. package/esm/src/html/styles-builder/index.js +1 -1
  207. package/esm/src/html/styles-builder/plugin-loader.d.ts +1 -1
  208. package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
  209. package/esm/src/html/styles-builder/plugin-loader.js +35 -27
  210. package/esm/src/html/styles-builder/project-css-cache.d.ts +4 -3
  211. package/esm/src/html/styles-builder/project-css-cache.d.ts.map +1 -1
  212. package/esm/src/html/styles-builder/tailwind-compiler-cache.d.ts.map +1 -1
  213. package/esm/src/html/styles-builder/tailwind-compiler-cache.js +10 -4
  214. package/esm/src/html/styles-builder/tailwind-compiler-utils.d.ts +5 -4
  215. package/esm/src/html/styles-builder/tailwind-compiler-utils.d.ts.map +1 -1
  216. package/esm/src/html/styles-builder/tailwind-compiler-utils.js +4 -2
  217. package/esm/src/html/styles-builder/tailwind-compiler.d.ts +0 -2
  218. package/esm/src/html/styles-builder/tailwind-compiler.d.ts.map +1 -1
  219. package/esm/src/html/styles-builder/tailwind-compiler.js +5 -8
  220. package/esm/src/html/utils.d.ts +2 -1
  221. package/esm/src/html/utils.d.ts.map +1 -1
  222. package/esm/src/html/utils.js +2 -2
  223. package/esm/src/integrations/endpoint-executor.d.ts.map +1 -1
  224. package/esm/src/integrations/endpoint-executor.js +5 -2
  225. package/esm/src/integrations/schema.d.ts +2 -2
  226. package/esm/src/integrations/types.d.ts +2 -1
  227. package/esm/src/integrations/types.d.ts.map +1 -1
  228. package/esm/src/issues/core.d.ts.map +1 -1
  229. package/esm/src/issues/core.js +8 -5
  230. package/esm/src/issues/schemas/issue.schema.d.ts +14 -14
  231. package/esm/src/mcp/server.d.ts.map +1 -1
  232. package/esm/src/mcp/server.js +4 -3
  233. package/esm/src/mcp/types.d.ts.map +1 -1
  234. package/esm/src/middleware/builtin/security/redis-rate-limit.d.ts.map +1 -1
  235. package/esm/src/middleware/builtin/security/redis-rate-limit.js +2 -1
  236. package/esm/src/middleware/builtin/timeout.js +1 -1
  237. package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
  238. package/esm/src/modules/component-registry/registry.js +5 -3
  239. package/esm/src/modules/import-map/default-import-map.js +1 -1
  240. package/esm/src/modules/import-map/loader.js +6 -6
  241. package/esm/src/modules/import-map/preloader.d.ts +3 -3
  242. package/esm/src/modules/import-map/preloader.d.ts.map +1 -1
  243. package/esm/src/modules/import-map/preloader.js +12 -10
  244. package/esm/src/modules/import-map/resolver.d.ts.map +1 -1
  245. package/esm/src/modules/import-map/resolver.js +2 -1
  246. package/esm/src/modules/react-loader/ssr-module-loader/cache/memory.js +1 -1
  247. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +1 -1
  248. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +3 -1
  249. package/esm/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.d.ts +3 -2
  250. package/esm/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.d.ts.map +1 -1
  251. package/esm/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.js +7 -2
  252. package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.d.ts +0 -5
  253. package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.d.ts.map +1 -1
  254. package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.js +8 -4
  255. package/esm/src/modules/react-loader/ssr-module-loader/loader.js +1 -1
  256. package/esm/src/modules/react-loader/ssr-module-loader/preflight-imports.d.ts +2 -1
  257. package/esm/src/modules/react-loader/ssr-module-loader/preflight-imports.d.ts.map +1 -1
  258. package/esm/src/modules/react-loader/ssr-module-loader/preflight-imports.js +2 -1
  259. package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.d.ts.map +1 -1
  260. package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +19 -7
  261. package/esm/src/modules/react-loader/ssr-module-loader/vf-module-resolver.d.ts.map +1 -1
  262. package/esm/src/modules/react-loader/ssr-module-loader/vf-module-resolver.js +12 -2
  263. package/esm/src/modules/react-loader/unified-loader.js +2 -2
  264. package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
  265. package/esm/src/modules/server/module-batch-handler.js +10 -6
  266. package/esm/src/modules/server/module-server.d.ts +0 -7
  267. package/esm/src/modules/server/module-server.d.ts.map +1 -1
  268. package/esm/src/modules/server/module-server.js +12 -36
  269. package/esm/src/modules/server/ssr-import-rewriter.d.ts +2 -1
  270. package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
  271. package/esm/src/modules/server/websocket-handler.js +1 -1
  272. package/esm/src/oauth/providers/base.d.ts.map +1 -1
  273. package/esm/src/oauth/providers/base.js +44 -16
  274. package/esm/src/oauth/token-store/memory.d.ts +0 -2
  275. package/esm/src/oauth/token-store/memory.d.ts.map +1 -1
  276. package/esm/src/oauth/token-store/memory.js +4 -4
  277. package/esm/src/observability/auto-instrument/http-instrumentation.js +2 -2
  278. package/esm/src/observability/auto-instrument/types.d.ts +3 -8
  279. package/esm/src/observability/auto-instrument/types.d.ts.map +1 -1
  280. package/esm/src/observability/error-collector.d.ts.map +1 -1
  281. package/esm/src/observability/error-collector.js +6 -3
  282. package/esm/src/observability/log-buffer.d.ts.map +1 -1
  283. package/esm/src/observability/log-buffer.js +4 -3
  284. package/esm/src/observability/metrics/config.d.ts.map +1 -1
  285. package/esm/src/observability/metrics/config.js +4 -3
  286. package/esm/src/observability/simple-metrics/metrics-recorder.d.ts.map +1 -1
  287. package/esm/src/observability/simple-metrics/metrics-recorder.js +9 -5
  288. package/esm/src/observability/simple-metrics/otel-instruments.js +2 -2
  289. package/esm/src/observability/tracing/config.js +2 -2
  290. package/esm/src/platform/adapters/detect.d.ts +0 -1
  291. package/esm/src/platform/adapters/detect.d.ts.map +1 -1
  292. package/esm/src/platform/adapters/detect.js +0 -2
  293. package/esm/src/platform/adapters/fs/factory.d.ts.map +1 -1
  294. package/esm/src/platform/adapters/fs/factory.js +2 -4
  295. package/esm/src/platform/adapters/fs/github/adapter.d.ts.map +1 -1
  296. package/esm/src/platform/adapters/fs/github/adapter.js +2 -1
  297. package/esm/src/platform/adapters/fs/github/github-api-client.d.ts.map +1 -1
  298. package/esm/src/platform/adapters/fs/github/github-api-client.js +5 -2
  299. package/esm/src/platform/adapters/fs/github/stat-operations.d.ts.map +1 -1
  300. package/esm/src/platform/adapters/fs/github/stat-operations.js +2 -1
  301. package/esm/src/platform/adapters/fs/github/types.d.ts.map +1 -1
  302. package/esm/src/platform/adapters/fs/github/types.js +12 -6
  303. package/esm/src/platform/adapters/fs/veryfront/adapter-content-context.d.ts.map +1 -1
  304. package/esm/src/platform/adapters/fs/veryfront/adapter-content-context.js +7 -2
  305. package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
  306. package/esm/src/platform/adapters/fs/veryfront/adapter.js +12 -6
  307. package/esm/src/platform/adapters/fs/veryfront/api-search-circuit-breaker.d.ts +2 -1
  308. package/esm/src/platform/adapters/fs/veryfront/api-search-circuit-breaker.d.ts.map +1 -1
  309. package/esm/src/platform/adapters/fs/veryfront/content-metrics.d.ts +1 -1
  310. package/esm/src/platform/adapters/fs/veryfront/content-metrics.d.ts.map +1 -1
  311. package/esm/src/platform/adapters/fs/veryfront/file-list-index.d.ts.map +1 -1
  312. package/esm/src/platform/adapters/fs/veryfront/file-list-index.js +2 -1
  313. package/esm/src/platform/adapters/fs/veryfront/in-flight-dedupe.d.ts +4 -3
  314. package/esm/src/platform/adapters/fs/veryfront/in-flight-dedupe.d.ts.map +1 -1
  315. package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts +1 -1
  316. package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts.map +1 -1
  317. package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.js +15 -7
  318. package/esm/src/platform/adapters/fs/veryfront/proxy-manager.d.ts.map +1 -1
  319. package/esm/src/platform/adapters/fs/veryfront/proxy-manager.js +23 -16
  320. package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +2 -2
  321. package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
  322. package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +5 -2
  323. package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
  324. package/esm/src/platform/adapters/fs/veryfront/read-operations.js +8 -4
  325. package/esm/src/platform/adapters/fs/veryfront/retry.d.ts.map +1 -1
  326. package/esm/src/platform/adapters/fs/veryfront/retry.js +1 -0
  327. package/esm/src/platform/adapters/fs/veryfront/stat-operations-helpers.d.ts +2 -1
  328. package/esm/src/platform/adapters/fs/veryfront/stat-operations-helpers.d.ts.map +1 -1
  329. package/esm/src/platform/adapters/fs/veryfront/stat-operations.d.ts.map +1 -1
  330. package/esm/src/platform/adapters/fs/veryfront/stat-operations.js +6 -3
  331. package/esm/src/platform/adapters/fs/veryfront/types.d.ts +1 -4
  332. package/esm/src/platform/adapters/fs/veryfront/types.d.ts.map +1 -1
  333. package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +2 -1
  334. package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
  335. package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +33 -20
  336. package/esm/src/platform/adapters/redis/modules.d.ts.map +1 -1
  337. package/esm/src/platform/adapters/redis/modules.js +9 -2
  338. package/esm/src/platform/adapters/registry.d.ts.map +1 -1
  339. package/esm/src/platform/adapters/registry.js +23 -10
  340. package/esm/src/platform/adapters/runtime/bun/filesystem-adapter.d.ts.map +1 -1
  341. package/esm/src/platform/adapters/runtime/bun/filesystem-adapter.js +5 -3
  342. package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
  343. package/esm/src/platform/adapters/runtime/deno/adapter.js +23 -12
  344. package/esm/src/platform/adapters/runtime/node/filesystem-adapter.js +2 -2
  345. package/esm/src/platform/adapters/runtime/node/http-server.d.ts.map +1 -1
  346. package/esm/src/platform/adapters/runtime/node/http-server.js +14 -4
  347. package/esm/src/platform/adapters/runtime/node/websocket-adapter.d.ts.map +1 -1
  348. package/esm/src/platform/adapters/runtime/node/websocket-adapter.js +10 -6
  349. package/esm/src/platform/adapters/runtime/shared/server-lifecycle.d.ts +0 -1
  350. package/esm/src/platform/adapters/runtime/shared/server-lifecycle.d.ts.map +1 -1
  351. package/esm/src/platform/adapters/runtime/shared/server-lifecycle.js +1 -1
  352. package/esm/src/platform/adapters/runtime/shared/shared-watcher.d.ts.map +1 -1
  353. package/esm/src/platform/adapters/runtime/shared/shared-watcher.js +8 -4
  354. package/esm/src/platform/adapters/veryfront-api-client/client.d.ts +6 -6
  355. package/esm/src/platform/adapters/veryfront-api-client/client.d.ts.map +1 -1
  356. package/esm/src/platform/adapters/veryfront-api-client/client.js +11 -6
  357. package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts.map +1 -1
  358. package/esm/src/platform/adapters/veryfront-api-client/operations.js +13 -4
  359. package/esm/src/platform/adapters/veryfront-api-client/retry-handler.d.ts.map +1 -1
  360. package/esm/src/platform/adapters/veryfront-api-client/retry-handler.js +1 -0
  361. package/esm/src/platform/adapters/veryfront-api-client/schemas/api.schema.d.ts +34 -34
  362. package/esm/src/platform/cloud/resolver.d.ts +17 -0
  363. package/esm/src/platform/cloud/resolver.d.ts.map +1 -0
  364. package/esm/src/platform/cloud/resolver.js +67 -0
  365. package/esm/src/platform/compat/console/index.d.ts.map +1 -1
  366. package/esm/src/platform/compat/console/index.js +2 -1
  367. package/esm/src/platform/compat/dynamic-import.d.ts +1 -1
  368. package/esm/src/platform/compat/dynamic-import.d.ts.map +1 -1
  369. package/esm/src/platform/compat/dynamic-import.js +0 -1
  370. package/esm/src/platform/compat/esbuild-init.js +7 -6
  371. package/esm/src/platform/compat/esbuild.d.ts +0 -1
  372. package/esm/src/platform/compat/esbuild.d.ts.map +1 -1
  373. package/esm/src/platform/compat/esbuild.js +15 -13
  374. package/esm/src/platform/compat/fs.d.ts.map +1 -1
  375. package/esm/src/platform/compat/fs.js +29 -14
  376. package/esm/src/platform/compat/http/node-server.d.ts.map +1 -1
  377. package/esm/src/platform/compat/http/node-server.js +5 -3
  378. package/esm/src/platform/compat/http/responses.d.ts.map +1 -1
  379. package/esm/src/platform/compat/http/responses.js +4 -2
  380. package/esm/src/platform/compat/http/websocket.d.ts.map +1 -1
  381. package/esm/src/platform/compat/http/websocket.js +5 -2
  382. package/esm/src/platform/compat/opaque-deps.d.ts +0 -16
  383. package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -1
  384. package/esm/src/platform/compat/opaque-deps.js +5 -0
  385. package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
  386. package/esm/src/platform/compat/path/basic-operations.js +4 -7
  387. package/esm/src/platform/compat/path/parse-format.js +3 -3
  388. package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
  389. package/esm/src/platform/compat/path/resolution.js +5 -8
  390. package/esm/src/platform/compat/path/runtime.js +2 -2
  391. package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -1
  392. package/esm/src/platform/compat/path/url-conversion.js +2 -1
  393. package/esm/src/platform/compat/process.d.ts +12 -0
  394. package/esm/src/platform/compat/process.d.ts.map +1 -1
  395. package/esm/src/platform/compat/process.js +86 -63
  396. package/esm/src/platform/compat/react-paths.js +2 -2
  397. package/esm/src/platform/compat/runtime.d.ts.map +1 -1
  398. package/esm/src/platform/compat/runtime.js +2 -1
  399. package/esm/src/platform/compat/stdin.d.ts.map +1 -1
  400. package/esm/src/platform/compat/stdin.js +12 -7
  401. package/esm/src/platform/core-platform.d.ts +3 -2
  402. package/esm/src/platform/core-platform.d.ts.map +1 -1
  403. package/esm/src/platform/core-platform.js +25 -8
  404. package/esm/src/prompt/schemas/prompt.schema.d.ts +2 -2
  405. package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -1
  406. package/esm/src/provider/local/ai-sdk-adapter.js +3 -1
  407. package/esm/src/provider/local/env.d.ts +1 -1
  408. package/esm/src/provider/local/env.d.ts.map +1 -1
  409. package/esm/src/provider/local/env.js +4 -4
  410. package/esm/src/provider/local/local-embedding-engine.d.ts.map +1 -1
  411. package/esm/src/provider/local/local-embedding-engine.js +2 -2
  412. package/esm/src/provider/local/local-engine.d.ts +16 -1
  413. package/esm/src/provider/local/local-engine.d.ts.map +1 -1
  414. package/esm/src/provider/local/local-engine.js +38 -36
  415. package/esm/src/provider/model-registry.d.ts.map +1 -1
  416. package/esm/src/provider/model-registry.js +28 -4
  417. package/esm/src/provider/veryfront-cloud/provider.d.ts +3 -0
  418. package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -0
  419. package/esm/src/provider/veryfront-cloud/provider.js +48 -0
  420. package/esm/src/provider/veryfront-cloud/shared.d.ts +25 -0
  421. package/esm/src/provider/veryfront-cloud/shared.d.ts.map +1 -0
  422. package/esm/src/provider/veryfront-cloud/shared.js +89 -0
  423. package/esm/src/proxy/cache/memory-cache.d.ts.map +1 -1
  424. package/esm/src/proxy/cache/memory-cache.js +3 -2
  425. package/esm/src/proxy/cache/redis-cache.d.ts +1 -0
  426. package/esm/src/proxy/cache/redis-cache.d.ts.map +1 -1
  427. package/esm/src/proxy/cache/redis-cache.js +26 -19
  428. package/esm/src/proxy/cache/resilient-cache.d.ts.map +1 -1
  429. package/esm/src/proxy/cache/resilient-cache.js +11 -1
  430. package/esm/src/proxy/handler.d.ts.map +1 -1
  431. package/esm/src/proxy/handler.js +6 -4
  432. package/esm/src/proxy/logger.d.ts +1 -5
  433. package/esm/src/proxy/logger.d.ts.map +1 -1
  434. package/esm/src/proxy/logger.js +5 -4
  435. package/esm/src/proxy/main.js +9 -6
  436. package/esm/src/proxy/oauth-client.d.ts +2 -1
  437. package/esm/src/proxy/oauth-client.d.ts.map +1 -1
  438. package/esm/src/proxy/oauth-client.js +8 -3
  439. package/esm/src/proxy/renderer-router.js +1 -1
  440. package/esm/src/proxy/token-manager.d.ts +2 -1
  441. package/esm/src/proxy/token-manager.d.ts.map +1 -1
  442. package/esm/src/proxy/token-manager.js +12 -9
  443. package/esm/src/proxy/tracing.d.ts.map +1 -1
  444. package/esm/src/proxy/tracing.js +6 -5
  445. package/esm/src/react/compat/config-generator.d.ts +2 -1
  446. package/esm/src/react/compat/config-generator.d.ts.map +1 -1
  447. package/esm/src/react/compat/hooks-adapter.d.ts +4 -5
  448. package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
  449. package/esm/src/react/compat/hooks-adapter.js +30 -21
  450. package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
  451. package/esm/src/react/compat/ssr-adapter/server-loader.js +7 -2
  452. package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
  453. package/esm/src/react/compat/version-detector/version-cache.d.ts +2 -2
  454. package/esm/src/react/compat/version-detector/version-cache.d.ts.map +1 -1
  455. package/esm/src/react/compat/version-detector/version-cache.js +6 -5
  456. package/esm/src/react/components/LayoutComponent.d.ts +1 -1
  457. package/esm/src/react/components/LayoutComponent.d.ts.map +1 -1
  458. package/esm/src/react/components/ProviderComponent.d.ts +2 -1
  459. package/esm/src/react/components/ProviderComponent.d.ts.map +1 -1
  460. package/esm/src/react/components/ai/agent-card.d.ts +2 -2
  461. package/esm/src/react/components/ai/agent-card.d.ts.map +1 -1
  462. package/esm/src/react/components/ai/agent-card.js +1 -1
  463. package/esm/src/react/components/ai/chat/components/code-block.d.ts.map +1 -1
  464. package/esm/src/react/components/ai/chat/components/code-block.js +2 -1
  465. package/esm/src/react/components/ai/chat/components/message-actions.js +2 -2
  466. package/esm/src/react/components/ai/chat/components/reasoning.d.ts +0 -5
  467. package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +1 -1
  468. package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts.map +1 -1
  469. package/esm/src/react/components/ai/chat/components/upgrade-cta.js +4 -3
  470. package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts +1 -0
  471. package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts.map +1 -1
  472. package/esm/src/react/components/ai/chat/components/uploads-panel.js +3 -1
  473. package/esm/src/react/components/ai/chat/composition/message.d.ts +0 -9
  474. package/esm/src/react/components/ai/chat/composition/message.d.ts.map +1 -1
  475. package/esm/src/react/components/ai/chat/composition/message.js +2 -1
  476. package/esm/src/react/components/ai/chat/contexts/chat-context.d.ts.map +1 -1
  477. package/esm/src/react/components/ai/chat/contexts/chat-context.js +4 -1
  478. package/esm/src/react/components/ai/chat/contexts/composer-context.d.ts.map +1 -1
  479. package/esm/src/react/components/ai/chat/contexts/composer-context.js +4 -1
  480. package/esm/src/react/components/ai/chat/contexts/message-context.d.ts.map +1 -1
  481. package/esm/src/react/components/ai/chat/contexts/message-context.js +4 -1
  482. package/esm/src/react/components/ai/chat/contexts/thread-list-context.d.ts.map +1 -1
  483. package/esm/src/react/components/ai/chat/contexts/thread-list-context.js +4 -1
  484. package/esm/src/react/components/ai/chat/hooks/use-threads.js +2 -2
  485. package/esm/src/react/components/ai/theme.d.ts +0 -69
  486. package/esm/src/react/components/ai/theme.d.ts.map +1 -1
  487. package/esm/src/react/components/ai/theme.js +2 -2
  488. package/esm/src/react/head-collector.d.ts +2 -1
  489. package/esm/src/react/head-collector.d.ts.map +1 -1
  490. package/esm/src/react/primitives/input-box.d.ts.map +1 -1
  491. package/esm/src/react/primitives/input-box.js +2 -6
  492. package/esm/src/rendering/app-reserved.js +2 -2
  493. package/esm/src/rendering/app-route-resolver.js +10 -9
  494. package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
  495. package/esm/src/rendering/cache/cache-coordinator.js +3 -1
  496. package/esm/src/rendering/cache/stores/api-store.d.ts.map +1 -1
  497. package/esm/src/rendering/cache/stores/api-store.js +33 -23
  498. package/esm/src/rendering/cache/stores/filesystem-store.d.ts.map +1 -1
  499. package/esm/src/rendering/cache/stores/filesystem-store.js +10 -8
  500. package/esm/src/rendering/cache/stores/memory-store.d.ts +2 -1
  501. package/esm/src/rendering/cache/stores/memory-store.d.ts.map +1 -1
  502. package/esm/src/rendering/cache/stores/redis-store.d.ts.map +1 -1
  503. package/esm/src/rendering/cache/stores/redis-store.js +15 -7
  504. package/esm/src/rendering/component-handling.d.ts +2 -1
  505. package/esm/src/rendering/component-handling.d.ts.map +1 -1
  506. package/esm/src/rendering/component-handling.js +1 -1
  507. package/esm/src/rendering/context/render-context.d.ts.map +1 -1
  508. package/esm/src/rendering/context/render-context.js +15 -9
  509. package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
  510. package/esm/src/rendering/element-validator/primitive-checks.js +2 -1
  511. package/esm/src/rendering/factories/service-factories.d.ts.map +1 -1
  512. package/esm/src/rendering/factories/service-factories.js +3 -1
  513. package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
  514. package/esm/src/rendering/layouts/layout-applicator.js +3 -3
  515. package/esm/src/rendering/layouts/layout-collector.d.ts +2 -8
  516. package/esm/src/rendering/layouts/layout-collector.d.ts.map +1 -1
  517. package/esm/src/rendering/layouts/layout-collector.js +11 -4
  518. package/esm/src/rendering/layouts/utils/app-resolver.d.ts.map +1 -1
  519. package/esm/src/rendering/layouts/utils/app-resolver.js +7 -2
  520. package/esm/src/rendering/layouts/utils/component-loader.js +1 -1
  521. package/esm/src/rendering/layouts/utils/hash-calculator.d.ts.map +1 -1
  522. package/esm/src/rendering/layouts/utils/hash-calculator.js +10 -7
  523. package/esm/src/rendering/orchestrator/css-cache.d.ts +0 -2
  524. package/esm/src/rendering/orchestrator/css-cache.d.ts.map +1 -1
  525. package/esm/src/rendering/orchestrator/css-cache.js +2 -2
  526. package/esm/src/rendering/orchestrator/css-candidate-manifest.js +1 -1
  527. package/esm/src/rendering/orchestrator/file-resolver/candidates.js +2 -2
  528. package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
  529. package/esm/src/rendering/orchestrator/html.js +9 -5
  530. package/esm/src/rendering/orchestrator/layout.d.ts +2 -7
  531. package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
  532. package/esm/src/rendering/orchestrator/layout.js +52 -42
  533. package/esm/src/rendering/orchestrator/lifecycle.d.ts.map +1 -1
  534. package/esm/src/rendering/orchestrator/lifecycle.js +9 -2
  535. package/esm/src/rendering/orchestrator/module-collection.d.ts +1 -1
  536. package/esm/src/rendering/orchestrator/module-collection.d.ts.map +1 -1
  537. package/esm/src/rendering/orchestrator/module-collection.js +1 -1
  538. package/esm/src/rendering/orchestrator/module-loader/esm-rewriter.d.ts.map +1 -1
  539. package/esm/src/rendering/orchestrator/module-loader/esm-rewriter.js +4 -2
  540. package/esm/src/rendering/orchestrator/module-loader/index.d.ts +1 -1
  541. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  542. package/esm/src/rendering/orchestrator/module-loader/index.js +7 -7
  543. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  544. package/esm/src/rendering/orchestrator/pipeline.js +135 -119
  545. package/esm/src/rendering/page-renderer.d.ts +3 -2
  546. package/esm/src/rendering/page-renderer.d.ts.map +1 -1
  547. package/esm/src/rendering/page-rendering.d.ts +2 -1
  548. package/esm/src/rendering/page-rendering.d.ts.map +1 -1
  549. package/esm/src/rendering/page-rendering.js +3 -1
  550. package/esm/src/rendering/page-resolution/page-resolver.d.ts +2 -0
  551. package/esm/src/rendering/page-resolution/page-resolver.d.ts.map +1 -1
  552. package/esm/src/rendering/page-resolution/page-resolver.js +4 -2
  553. package/esm/src/rendering/renderer-concurrency.d.ts +0 -11
  554. package/esm/src/rendering/renderer-concurrency.d.ts.map +1 -1
  555. package/esm/src/rendering/renderer-concurrency.js +6 -5
  556. package/esm/src/rendering/renderer.d.ts +0 -12
  557. package/esm/src/rendering/renderer.d.ts.map +1 -1
  558. package/esm/src/rendering/renderer.js +16 -28
  559. package/esm/src/rendering/router-detection.d.ts +12 -3
  560. package/esm/src/rendering/router-detection.d.ts.map +1 -1
  561. package/esm/src/rendering/router-detection.js +28 -10
  562. package/esm/src/rendering/rsc/client-boot.ts +1 -1
  563. package/esm/src/rendering/rsc/client-dom.ts +9 -11
  564. package/esm/src/rendering/rsc/client-hydrator.ts +11 -8
  565. package/esm/src/rendering/rsc/hydrate-client.ts +3 -2
  566. package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
  567. package/esm/src/rendering/rsc/server-renderer/prop-serializer.js +2 -1
  568. package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
  569. package/esm/src/rendering/rsc/server-renderer/rsc-renderer.js +3 -1
  570. package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
  571. package/esm/src/rendering/rsc/server-renderer/tree-processor.js +3 -1
  572. package/esm/src/rendering/script-page-handling.js +3 -2
  573. package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
  574. package/esm/src/rendering/shared/context-aware-cache.js +6 -2
  575. package/esm/src/rendering/shared/shared-services.d.ts.map +1 -1
  576. package/esm/src/rendering/shared/shared-services.js +4 -1
  577. package/esm/src/rendering/snippet-renderer.d.ts.map +1 -1
  578. package/esm/src/rendering/snippet-renderer.js +53 -39
  579. package/esm/src/rendering/ssr-globals/dom-stubs.d.ts.map +1 -1
  580. package/esm/src/rendering/ssr-globals/dom-stubs.js +9 -4
  581. package/esm/src/rendering/ssr-globals/fetch-interceptor.d.ts.map +1 -1
  582. package/esm/src/rendering/ssr-globals/fetch-interceptor.js +6 -4
  583. package/esm/src/rendering/ssr-globals/index.d.ts.map +1 -1
  584. package/esm/src/rendering/ssr-globals/index.js +2 -1
  585. package/esm/src/rendering/ssr-renderer.d.ts +2 -1
  586. package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
  587. package/esm/src/rendering/ssr-renderer.js +4 -2
  588. package/esm/src/rendering/utils/stream-utils.js +2 -2
  589. package/esm/src/routing/api/api-route-matcher.d.ts +0 -2
  590. package/esm/src/routing/api/api-route-matcher.d.ts.map +1 -1
  591. package/esm/src/routing/api/api-route-matcher.js +8 -5
  592. package/esm/src/routing/api/handler.d.ts +1 -1
  593. package/esm/src/routing/api/handler.d.ts.map +1 -1
  594. package/esm/src/routing/api/handler.js +5 -3
  595. package/esm/src/routing/api/index.d.ts +1 -1
  596. package/esm/src/routing/api/index.d.ts.map +1 -1
  597. package/esm/src/routing/api/index.js +1 -1
  598. package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts +2 -1
  599. package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts.map +1 -1
  600. package/esm/src/routing/api/module-loader/esbuild-plugin.js +3 -2
  601. package/esm/src/routing/api/module-loader/http-validator.d.ts.map +1 -1
  602. package/esm/src/routing/api/module-loader/http-validator.js +2 -1
  603. package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
  604. package/esm/src/routing/api/module-loader/loader.js +16 -15
  605. package/esm/src/routing/api/openapi/path-utils.d.ts +2 -1
  606. package/esm/src/routing/api/openapi/path-utils.d.ts.map +1 -1
  607. package/esm/src/routing/api/openapi/spec-generator.d.ts +5 -4
  608. package/esm/src/routing/api/openapi/spec-generator.d.ts.map +1 -1
  609. package/esm/src/routing/api/openapi/spec-generator.js +5 -5
  610. package/esm/src/routing/api/openapi/types.d.ts +6 -5
  611. package/esm/src/routing/api/openapi/types.d.ts.map +1 -1
  612. package/esm/src/routing/api/route-discovery.d.ts +3 -3
  613. package/esm/src/routing/api/route-discovery.d.ts.map +1 -1
  614. package/esm/src/routing/index.d.ts +1 -1
  615. package/esm/src/routing/index.d.ts.map +1 -1
  616. package/esm/src/routing/index.js +1 -1
  617. package/esm/src/routing/matchers/index.d.ts +1 -1
  618. package/esm/src/routing/matchers/index.d.ts.map +1 -1
  619. package/esm/src/routing/matchers/index.js +1 -1
  620. package/esm/src/routing/matchers/pattern-route-matcher.d.ts +0 -2
  621. package/esm/src/routing/matchers/pattern-route-matcher.d.ts.map +1 -1
  622. package/esm/src/routing/matchers/pattern-route-matcher.js +0 -2
  623. package/esm/src/sandbox/index.d.ts +1 -1
  624. package/esm/src/sandbox/index.js +1 -1
  625. package/esm/src/sandbox/sandbox.d.ts +6 -12
  626. package/esm/src/sandbox/sandbox.d.ts.map +1 -1
  627. package/esm/src/sandbox/sandbox.js +42 -19
  628. package/esm/src/security/client/html-sanitizer.d.ts +1 -9
  629. package/esm/src/security/client/html-sanitizer.d.ts.map +1 -1
  630. package/esm/src/security/client/html-sanitizer.js +4 -14
  631. package/esm/src/security/csrf/helpers.js +4 -4
  632. package/esm/src/security/http/auth.js +3 -3
  633. package/esm/src/security/http/base-handler.js +2 -2
  634. package/esm/src/security/http/middleware/config-loader.d.ts.map +1 -1
  635. package/esm/src/security/http/middleware/config-loader.js +2 -1
  636. package/esm/src/security/http/response/fluent-methods.d.ts.map +1 -1
  637. package/esm/src/security/http/response/fluent-methods.js +4 -3
  638. package/esm/src/security/http/response/security-handler.d.ts.map +1 -1
  639. package/esm/src/security/http/response/security-handler.js +6 -2
  640. package/esm/src/security/path-validation/canonical.d.ts.map +1 -1
  641. package/esm/src/security/path-validation/canonical.js +2 -1
  642. package/esm/src/security/path-validation/index.d.ts.map +1 -1
  643. package/esm/src/security/path-validation/index.js +2 -1
  644. package/esm/src/security/path-validation/rules.d.ts.map +1 -1
  645. package/esm/src/security/path-validation/rules.js +1 -2
  646. package/esm/src/security/secure-fs.d.ts +1 -1
  647. package/esm/src/security/secure-fs.d.ts.map +1 -1
  648. package/esm/src/security/secure-fs.js +7 -1
  649. package/esm/src/server/bootstrap.d.ts.map +1 -1
  650. package/esm/src/server/bootstrap.js +5 -3
  651. package/esm/src/server/build-app-route-renderer.d.ts.map +1 -1
  652. package/esm/src/server/build-app-route-renderer.js +3 -2
  653. package/esm/src/server/build-routes.js +2 -2
  654. package/esm/src/server/build-service-worker.d.ts.map +1 -1
  655. package/esm/src/server/build-service-worker.js +2 -1
  656. package/esm/src/server/context/cache-invalidation.d.ts +2 -1
  657. package/esm/src/server/context/cache-invalidation.d.ts.map +1 -1
  658. package/esm/src/server/context/cache-invalidation.js +8 -3
  659. package/esm/src/server/context/enriched-context.d.ts +4 -3
  660. package/esm/src/server/context/enriched-context.d.ts.map +1 -1
  661. package/esm/src/server/context/enriched-context.js +2 -1
  662. package/esm/src/server/dev-server/error-overlay/html-template.d.ts.map +1 -1
  663. package/esm/src/server/dev-server/error-overlay/html-template.js +8 -2
  664. package/esm/src/server/dev-server/file-watch-setup.d.ts +5 -0
  665. package/esm/src/server/dev-server/file-watch-setup.d.ts.map +1 -1
  666. package/esm/src/server/dev-server/file-watch-setup.js +19 -4
  667. package/esm/src/server/dev-server/middleware.d.ts +0 -6
  668. package/esm/src/server/dev-server/middleware.d.ts.map +1 -1
  669. package/esm/src/server/dev-server/middleware.js +11 -9
  670. package/esm/src/server/dev-server/request-handler.d.ts.map +1 -1
  671. package/esm/src/server/dev-server/request-handler.js +12 -7
  672. package/esm/src/server/dev-server/route-discovery.d.ts +2 -2
  673. package/esm/src/server/dev-server/route-discovery.d.ts.map +1 -1
  674. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  675. package/esm/src/server/dev-server/server.js +11 -11
  676. package/esm/src/server/dev-server/types.d.ts +0 -2
  677. package/esm/src/server/dev-server/types.d.ts.map +1 -1
  678. package/esm/src/server/dev-ui/manifest.js +10 -10
  679. package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
  680. package/esm/src/server/handlers/dev/dashboard/api.js +26 -7
  681. package/esm/src/server/handlers/dev/dashboard/ui-handler.js +6 -6
  682. package/esm/src/server/handlers/dev/debug-context.handler.d.ts.map +1 -1
  683. package/esm/src/server/handlers/dev/debug-context.handler.js +4 -2
  684. package/esm/src/server/handlers/dev/endpoints.handler.d.ts.map +1 -1
  685. package/esm/src/server/handlers/dev/endpoints.handler.js +2 -1
  686. package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +2 -1
  687. package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
  688. package/esm/src/server/handlers/dev/files/esbuild-plugins.js +9 -5
  689. package/esm/src/server/handlers/dev/files/path-validator.d.ts.map +1 -1
  690. package/esm/src/server/handlers/dev/files/path-validator.js +2 -1
  691. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  692. package/esm/src/server/handlers/dev/framework-candidates.generated.js +13 -6
  693. package/esm/src/server/handlers/dev/projects/ui-handler.js +6 -6
  694. package/esm/src/server/handlers/dev/scripts/hmr-scripts.d.ts +0 -6
  695. package/esm/src/server/handlers/dev/scripts/hmr-scripts.d.ts.map +1 -1
  696. package/esm/src/server/handlers/dev/scripts/hmr-scripts.js +12 -12
  697. package/esm/src/server/handlers/dev/shared/ui-module-transform.d.ts +2 -1
  698. package/esm/src/server/handlers/dev/shared/ui-module-transform.d.ts.map +1 -1
  699. package/esm/src/server/handlers/dev/styles-candidate-scanner.js +4 -3
  700. package/esm/src/server/handlers/dev/styles-css.handler.d.ts.map +1 -1
  701. package/esm/src/server/handlers/dev/styles-css.handler.js +2 -1
  702. package/esm/src/server/handlers/monitoring/client-log.handler.d.ts.map +1 -1
  703. package/esm/src/server/handlers/monitoring/client-log.handler.js +6 -2
  704. package/esm/src/server/handlers/monitoring/health.handler.d.ts.map +1 -1
  705. package/esm/src/server/handlers/monitoring/health.handler.js +4 -2
  706. package/esm/src/server/handlers/monitoring/memory.handler.d.ts.map +1 -1
  707. package/esm/src/server/handlers/monitoring/memory.handler.js +7 -1
  708. package/esm/src/server/handlers/monitoring/metrics.handler.d.ts.map +1 -1
  709. package/esm/src/server/handlers/monitoring/metrics.handler.js +3 -0
  710. package/esm/src/server/handlers/preview/hmr-client-manager.d.ts +2 -3
  711. package/esm/src/server/handlers/preview/hmr-client-manager.d.ts.map +1 -1
  712. package/esm/src/server/handlers/preview/hmr-client-manager.js +2 -11
  713. package/esm/src/server/handlers/preview/hmr-message-router.d.ts +2 -3
  714. package/esm/src/server/handlers/preview/hmr-message-router.d.ts.map +1 -1
  715. package/esm/src/server/handlers/preview/hmr-message-router.js +2 -2
  716. package/esm/src/server/handlers/preview/hmr-ping-keepalive.js +3 -3
  717. package/esm/src/server/handlers/preview/hmr.handler.js +8 -8
  718. package/esm/src/server/handlers/preview/markdown-html-generator.d.ts +2 -1
  719. package/esm/src/server/handlers/preview/markdown-html-generator.d.ts.map +1 -1
  720. package/esm/src/server/handlers/preview/markdown-html-generator.js +2 -2
  721. package/esm/src/server/handlers/preview/markdown-preview.handler.d.ts.map +1 -1
  722. package/esm/src/server/handlers/preview/markdown-preview.handler.js +6 -5
  723. package/esm/src/server/handlers/request/api/app-router-resolver.d.ts.map +1 -1
  724. package/esm/src/server/handlers/request/api/app-router-resolver.js +94 -50
  725. package/esm/src/server/handlers/request/api/pages-api-handler.js +2 -2
  726. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +1 -1
  727. package/esm/src/server/handlers/request/openapi-docs.handler.d.ts.map +1 -1
  728. package/esm/src/server/handlers/request/openapi-docs.handler.js +3 -1
  729. package/esm/src/server/handlers/request/openapi.handler.d.ts.map +1 -1
  730. package/esm/src/server/handlers/request/openapi.handler.js +7 -5
  731. package/esm/src/server/handlers/request/rsc/index.d.ts.map +1 -1
  732. package/esm/src/server/handlers/request/rsc/index.js +1 -0
  733. package/esm/src/server/handlers/request/ssr/error-page-fallback.d.ts.map +1 -1
  734. package/esm/src/server/handlers/request/ssr/error-page-fallback.js +8 -6
  735. package/esm/src/server/handlers/request/ssr/not-found-fallback.d.ts.map +1 -1
  736. package/esm/src/server/handlers/request/ssr/not-found-fallback.js +8 -5
  737. package/esm/src/server/handlers/request/ssr/ssr.handler.js +2 -2
  738. package/esm/src/server/handlers/response/cors.d.ts +0 -2
  739. package/esm/src/server/handlers/response/cors.d.ts.map +1 -1
  740. package/esm/src/server/handlers/response/cors.js +2 -74
  741. package/esm/src/server/handlers/studio/bridge-modules.handler.d.ts +0 -5
  742. package/esm/src/server/handlers/studio/bridge-modules.handler.d.ts.map +1 -1
  743. package/esm/src/server/handlers/studio/bridge-modules.handler.js +3 -8
  744. package/esm/src/server/index.d.ts +0 -2
  745. package/esm/src/server/index.d.ts.map +1 -1
  746. package/esm/src/server/index.js +19 -19
  747. package/esm/src/server/production-server.d.ts.map +1 -1
  748. package/esm/src/server/production-server.js +14 -5
  749. package/esm/src/server/project-env/cache.js +2 -2
  750. package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
  751. package/esm/src/server/project-env/fetcher.js +2 -1
  752. package/esm/src/server/reload-notifier.d.ts +1 -1
  753. package/esm/src/server/reload-notifier.d.ts.map +1 -1
  754. package/esm/src/server/runtime-handler/adapter-factory.d.ts +3 -2
  755. package/esm/src/server/runtime-handler/adapter-factory.d.ts.map +1 -1
  756. package/esm/src/server/runtime-handler/environment-resolution.d.ts +3 -2
  757. package/esm/src/server/runtime-handler/environment-resolution.d.ts.map +1 -1
  758. package/esm/src/server/runtime-handler/handler-context-builder.d.ts +3 -2
  759. package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
  760. package/esm/src/server/runtime-handler/index.js +15 -13
  761. package/esm/src/server/runtime-handler/isolation.d.ts +1 -1
  762. package/esm/src/server/runtime-handler/isolation.d.ts.map +1 -1
  763. package/esm/src/server/runtime-handler/local-project-discovery.d.ts.map +1 -1
  764. package/esm/src/server/runtime-handler/local-project-discovery.js +14 -4
  765. package/esm/src/server/runtime-handler/project-isolation.d.ts +2 -1
  766. package/esm/src/server/runtime-handler/project-isolation.d.ts.map +1 -1
  767. package/esm/src/server/runtime-handler/project-resolution.d.ts +4 -4
  768. package/esm/src/server/runtime-handler/project-resolution.d.ts.map +1 -1
  769. package/esm/src/server/runtime-handler/request-lifecycle.d.ts +1 -1
  770. package/esm/src/server/runtime-handler/request-lifecycle.d.ts.map +1 -1
  771. package/esm/src/server/runtime-handler/request-tracker.d.ts +1 -1
  772. package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
  773. package/esm/src/server/runtime-handler/request-tracker.js +6 -2
  774. package/esm/src/server/runtime-handler/request-utils.d.ts.map +1 -1
  775. package/esm/src/server/runtime-handler/request-utils.js +1 -1
  776. package/esm/src/server/runtime-handler/tracing.d.ts +1 -1
  777. package/esm/src/server/runtime-handler/tracing.d.ts.map +1 -1
  778. package/esm/src/server/services/rsc/endpoints/action-handler.d.ts.map +1 -1
  779. package/esm/src/server/services/rsc/endpoints/action-handler.js +2 -1
  780. package/esm/src/server/services/rsc/endpoints/endpoint-router.d.ts +1 -1
  781. package/esm/src/server/services/rsc/endpoints/endpoint-router.d.ts.map +1 -1
  782. package/esm/src/server/services/rsc/endpoints/endpoint-router.js +11 -4
  783. package/esm/src/server/services/rsc/endpoints/handler-registry.d.ts +1 -1
  784. package/esm/src/server/services/rsc/endpoints/handler-registry.d.ts.map +1 -1
  785. package/esm/src/server/services/rsc/endpoints/handler-registry.js +6 -4
  786. package/esm/src/server/services/rsc/endpoints/script-handlers.d.ts +0 -2
  787. package/esm/src/server/services/rsc/endpoints/script-handlers.d.ts.map +1 -1
  788. package/esm/src/server/services/rsc/endpoints/script-handlers.js +2 -2
  789. package/esm/src/server/services/rsc/endpoints/types.d.ts +1 -0
  790. package/esm/src/server/services/rsc/endpoints/types.d.ts.map +1 -1
  791. package/esm/src/server/services/rsc/orchestrators/component-resolver.d.ts.map +1 -1
  792. package/esm/src/server/services/rsc/orchestrators/component-resolver.js +2 -1
  793. package/esm/src/server/services/rsc/orchestrators/manifest-handler.js +1 -1
  794. package/esm/src/server/services/rsc/orchestrators/page-handler.d.ts.map +1 -1
  795. package/esm/src/server/services/rsc/orchestrators/page-handler.js +2 -1
  796. package/esm/src/server/services/rsc/orchestrators/stream-handler.js +1 -1
  797. package/esm/src/server/services/static/static-file.service.d.ts +1 -1
  798. package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
  799. package/esm/src/server/services/static/static-file.service.js +6 -3
  800. package/esm/src/server/shared/renderer/adapter.d.ts.map +1 -1
  801. package/esm/src/server/shared/renderer/adapter.js +7 -4
  802. package/esm/src/server/utils/domain-lookup.d.ts +2 -1
  803. package/esm/src/server/utils/domain-lookup.d.ts.map +1 -1
  804. package/esm/src/server/utils/error-html.d.ts +2 -1
  805. package/esm/src/server/utils/error-html.d.ts.map +1 -1
  806. package/esm/src/skill/allowed-tools.d.ts +2 -1
  807. package/esm/src/skill/allowed-tools.d.ts.map +1 -1
  808. package/esm/src/skill/executor.d.ts +2 -9
  809. package/esm/src/skill/executor.d.ts.map +1 -1
  810. package/esm/src/skill/executor.js +19 -21
  811. package/esm/src/skill/parser.d.ts +2 -1
  812. package/esm/src/skill/parser.d.ts.map +1 -1
  813. package/esm/src/skill/parser.js +4 -4
  814. package/esm/src/skill/path-safety.d.ts.map +1 -1
  815. package/esm/src/skill/path-safety.js +8 -1
  816. package/esm/src/skill/tools.d.ts.map +1 -1
  817. package/esm/src/skill/tools.js +4 -2
  818. package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
  819. package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
  820. package/esm/src/task/discovery.d.ts +1 -5
  821. package/esm/src/task/discovery.d.ts.map +1 -1
  822. package/esm/src/task/discovery.js +72 -7
  823. package/esm/src/tool/factory.d.ts.map +1 -1
  824. package/esm/src/tool/factory.js +1 -3
  825. package/esm/src/tool/schema/zod-json-schema.d.ts.map +1 -1
  826. package/esm/src/tool/schema/zod-json-schema.js +2 -1
  827. package/esm/src/tool/types.d.ts +2 -14
  828. package/esm/src/tool/types.d.ts.map +1 -1
  829. package/esm/src/transforms/esm/bundle-deps-validator.d.ts.map +1 -1
  830. package/esm/src/transforms/esm/bundle-deps-validator.js +15 -7
  831. package/esm/src/transforms/esm/bundle-manifest.d.ts +3 -6
  832. package/esm/src/transforms/esm/bundle-manifest.d.ts.map +1 -1
  833. package/esm/src/transforms/esm/bundle-manifest.js +9 -4
  834. package/esm/src/transforms/esm/bundle-recovery.d.ts.map +1 -1
  835. package/esm/src/transforms/esm/bundle-recovery.js +20 -15
  836. package/esm/src/transforms/esm/http-bundler.d.ts +0 -4
  837. package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
  838. package/esm/src/transforms/esm/http-bundler.js +6 -15
  839. package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
  840. package/esm/src/transforms/esm/http-cache-helpers.js +2 -1
  841. package/esm/src/transforms/esm/http-cache-invariants.d.ts +0 -24
  842. package/esm/src/transforms/esm/http-cache-invariants.d.ts.map +1 -1
  843. package/esm/src/transforms/esm/http-cache-invariants.js +1 -27
  844. package/esm/src/transforms/esm/http-cache-types.d.ts +0 -15
  845. package/esm/src/transforms/esm/http-cache-types.d.ts.map +1 -1
  846. package/esm/src/transforms/esm/http-cache-wrapper.d.ts +2 -2
  847. package/esm/src/transforms/esm/http-cache-wrapper.d.ts.map +1 -1
  848. package/esm/src/transforms/esm/http-cache-wrapper.js +5 -3
  849. package/esm/src/transforms/esm/http-cache.d.ts +1 -3
  850. package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
  851. package/esm/src/transforms/esm/http-cache.js +19 -8
  852. package/esm/src/transforms/esm/import-parser.d.ts +2 -1
  853. package/esm/src/transforms/esm/import-parser.d.ts.map +1 -1
  854. package/esm/src/transforms/esm/import-parser.js +10 -5
  855. package/esm/src/transforms/esm/in-flight-manager.d.ts +0 -5
  856. package/esm/src/transforms/esm/in-flight-manager.d.ts.map +1 -1
  857. package/esm/src/transforms/esm/in-flight-manager.js +16 -12
  858. package/esm/src/transforms/esm/package-registry.d.ts +0 -8
  859. package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
  860. package/esm/src/transforms/esm/package-registry.js +2 -17
  861. package/esm/src/transforms/esm/source-url-embed.d.ts +0 -3
  862. package/esm/src/transforms/esm/source-url-embed.d.ts.map +1 -1
  863. package/esm/src/transforms/esm/source-url-embed.js +2 -2
  864. package/esm/src/transforms/esm/specifier-resolver.d.ts +0 -7
  865. package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
  866. package/esm/src/transforms/esm/specifier-resolver.js +1 -1
  867. package/esm/src/transforms/esm/transform-cache.d.ts +5 -29
  868. package/esm/src/transforms/esm/transform-cache.d.ts.map +1 -1
  869. package/esm/src/transforms/esm/transform-cache.js +1 -104
  870. package/esm/src/transforms/import-rewriter/strategies/import-map-strategy.d.ts.map +1 -1
  871. package/esm/src/transforms/import-rewriter/strategies/import-map-strategy.js +4 -2
  872. package/esm/src/transforms/md/utils.d.ts +0 -5
  873. package/esm/src/transforms/md/utils.d.ts.map +1 -1
  874. package/esm/src/transforms/md/utils.js +1 -1
  875. package/esm/src/transforms/mdx/compiler/import-rewriter.d.ts.map +1 -1
  876. package/esm/src/transforms/mdx/compiler/import-rewriter.js +2 -1
  877. package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
  878. package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +21 -12
  879. package/esm/src/transforms/mdx/esm-module-loader/constants.d.ts +0 -1
  880. package/esm/src/transforms/mdx/esm-module-loader/constants.d.ts.map +1 -1
  881. package/esm/src/transforms/mdx/esm-module-loader/constants.js +0 -1
  882. package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts.map +1 -1
  883. package/esm/src/transforms/mdx/esm-module-loader/import-transformer.js +13 -5
  884. package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.d.ts.map +1 -1
  885. package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +3 -4
  886. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
  887. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +17 -6
  888. package/esm/src/transforms/mdx/esm-module-loader/metadata/string-parser.d.ts.map +1 -1
  889. package/esm/src/transforms/mdx/esm-module-loader/metadata/string-parser.js +2 -1
  890. package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
  891. package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -3
  892. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts +1 -1
  893. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts.map +1 -1
  894. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.js +14 -10
  895. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts +0 -5
  896. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts.map +1 -1
  897. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.js +9 -7
  898. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
  899. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +2 -1
  900. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.js +2 -2
  901. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.d.ts +0 -14
  902. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.d.ts.map +1 -1
  903. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.js +1 -1
  904. package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts +0 -14
  905. package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts.map +1 -1
  906. package/esm/src/transforms/mdx/esm-module-loader/module-writer.js +22 -9
  907. package/esm/src/transforms/mdx/esm-module-loader/resolution/file-finder.d.ts.map +1 -1
  908. package/esm/src/transforms/mdx/esm-module-loader/resolution/file-finder.js +4 -3
  909. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +0 -13
  910. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
  911. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +2 -2
  912. package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
  913. package/esm/src/transforms/pipeline/index.js +3 -2
  914. package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
  915. package/esm/src/transforms/pipeline/stages/compile.js +5 -1
  916. package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.js +18 -18
  917. package/esm/src/transforms/pipeline/stages/ssr-vf-modules/transform.d.ts.map +1 -1
  918. package/esm/src/transforms/pipeline/stages/ssr-vf-modules/transform.js +9 -4
  919. package/esm/src/transforms/plugins/babel-node-positions.d.ts.map +1 -1
  920. package/esm/src/transforms/plugins/babel-node-positions.js +2 -1
  921. package/esm/src/transforms/plugins/plugin-loader.d.ts +0 -3
  922. package/esm/src/transforms/plugins/plugin-loader.d.ts.map +1 -1
  923. package/esm/src/transforms/plugins/rehype-node-positions.d.ts +2 -1
  924. package/esm/src/transforms/plugins/rehype-node-positions.d.ts.map +1 -1
  925. package/esm/src/transforms/shared/cross-project-import.d.ts +2 -1
  926. package/esm/src/transforms/shared/cross-project-import.d.ts.map +1 -1
  927. package/esm/src/transforms/veryfront-module-urls.d.ts +0 -1
  928. package/esm/src/transforms/veryfront-module-urls.d.ts.map +1 -1
  929. package/esm/src/transforms/veryfront-module-urls.js +0 -3
  930. package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
  931. package/esm/src/types/entities/getEntityInfo.js +16 -12
  932. package/esm/src/types/entities.d.ts +0 -5
  933. package/esm/src/types/entities.d.ts.map +1 -1
  934. package/esm/src/types/entities.js +0 -32
  935. package/esm/src/utils/box.js +1 -1
  936. package/esm/src/utils/bundle-manifest-init.d.ts +0 -2
  937. package/esm/src/utils/bundle-manifest-init.d.ts.map +1 -1
  938. package/esm/src/utils/bundle-manifest-init.js +0 -19
  939. package/esm/src/utils/bundle-manifest-kv.d.ts +2 -1
  940. package/esm/src/utils/bundle-manifest-kv.d.ts.map +1 -1
  941. package/esm/src/utils/bundle-manifest-redis.d.ts +2 -1
  942. package/esm/src/utils/bundle-manifest-redis.d.ts.map +1 -1
  943. package/esm/src/utils/cache-dir.d.ts.map +1 -1
  944. package/esm/src/utils/cache-dir.js +4 -5
  945. package/esm/src/utils/cache-file-ops.d.ts.map +1 -1
  946. package/esm/src/utils/cache-file-ops.js +2 -1
  947. package/esm/src/utils/circuit-breaker.d.ts +3 -9
  948. package/esm/src/utils/circuit-breaker.d.ts.map +1 -1
  949. package/esm/src/utils/circuit-breaker.js +13 -21
  950. package/esm/src/utils/constants/cache.js +2 -2
  951. package/esm/src/utils/env-loader.d.ts.map +1 -1
  952. package/esm/src/utils/env-loader.js +2 -1
  953. package/esm/src/utils/file-discovery.d.ts +3 -2
  954. package/esm/src/utils/file-discovery.d.ts.map +1 -1
  955. package/esm/src/utils/file-discovery.js +4 -4
  956. package/esm/src/utils/hash-utils.d.ts.map +1 -1
  957. package/esm/src/utils/hash-utils.js +5 -2
  958. package/esm/src/utils/import-lockfile.d.ts.map +1 -1
  959. package/esm/src/utils/import-lockfile.js +10 -4
  960. package/esm/src/utils/logger/core.d.ts.map +1 -1
  961. package/esm/src/utils/logger/core.js +2 -1
  962. package/esm/src/utils/logger/logger.d.ts +5 -5
  963. package/esm/src/utils/logger/logger.d.ts.map +1 -1
  964. package/esm/src/utils/logger/logger.js +12 -2
  965. package/esm/src/utils/lru-wrapper.d.ts +2 -1
  966. package/esm/src/utils/lru-wrapper.d.ts.map +1 -1
  967. package/esm/src/utils/lru-wrapper.js +3 -1
  968. package/esm/src/utils/memoize.d.ts.map +1 -1
  969. package/esm/src/utils/memoize.js +2 -2
  970. package/esm/src/utils/memory/profiler.d.ts.map +1 -1
  971. package/esm/src/utils/memory/profiler.js +15 -7
  972. package/esm/src/utils/parallel.d.ts.map +1 -1
  973. package/esm/src/utils/parallel.js +4 -1
  974. package/esm/src/utils/path-utils.d.ts.map +1 -1
  975. package/esm/src/utils/path-utils.js +13 -7
  976. package/esm/src/utils/platform.d.ts.map +1 -1
  977. package/esm/src/utils/platform.js +2 -1
  978. package/esm/src/utils/redis-client.d.ts +2 -4
  979. package/esm/src/utils/redis-client.d.ts.map +1 -1
  980. package/esm/src/utils/redis-client.js +9 -27
  981. package/esm/src/utils/route-path-utils.d.ts +3 -4
  982. package/esm/src/utils/route-path-utils.d.ts.map +1 -1
  983. package/esm/src/utils/route-path-utils.js +1 -1
  984. package/esm/src/workflow/api.d.ts +22 -2
  985. package/esm/src/workflow/api.d.ts.map +1 -1
  986. package/esm/src/workflow/api.js +14 -9
  987. package/esm/src/workflow/backends/memory.d.ts +2 -1
  988. package/esm/src/workflow/backends/memory.d.ts.map +1 -1
  989. package/esm/src/workflow/backends/memory.js +12 -7
  990. package/esm/src/workflow/backends/redis/index.d.ts.map +1 -1
  991. package/esm/src/workflow/backends/redis/index.js +35 -19
  992. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +41 -0
  993. package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -0
  994. package/esm/src/workflow/blob/veryfront-cloud-storage.js +348 -0
  995. package/esm/src/workflow/claude-code/agent.d.ts +15 -0
  996. package/esm/src/workflow/claude-code/agent.d.ts.map +1 -1
  997. package/esm/src/workflow/claude-code/agent.js +20 -7
  998. package/esm/src/workflow/claude-code/event-publisher.d.ts +2 -0
  999. package/esm/src/workflow/claude-code/event-publisher.d.ts.map +1 -1
  1000. package/esm/src/workflow/claude-code/event-publisher.js +31 -10
  1001. package/esm/src/workflow/claude-code/react/use-claude-code-stream.d.ts.map +1 -1
  1002. package/esm/src/workflow/claude-code/react/use-claude-code-stream.js +11 -3
  1003. package/esm/src/workflow/claude-code/react/use-claude-code-websocket.d.ts.map +1 -1
  1004. package/esm/src/workflow/claude-code/react/use-claude-code-websocket.js +12 -4
  1005. package/esm/src/workflow/claude-code/tool.d.ts +7 -7
  1006. package/esm/src/workflow/claude-code/tool.js +3 -3
  1007. package/esm/src/workflow/claude-code/types.d.ts +7 -6
  1008. package/esm/src/workflow/claude-code/types.d.ts.map +1 -1
  1009. package/esm/src/workflow/claude-code/websocket-publisher.d.ts +0 -15
  1010. package/esm/src/workflow/claude-code/websocket-publisher.d.ts.map +1 -1
  1011. package/esm/src/workflow/claude-code/websocket-publisher.js +28 -16
  1012. package/esm/src/workflow/claude-code/workspace-sync.d.ts.map +1 -1
  1013. package/esm/src/workflow/claude-code/workspace-sync.js +27 -16
  1014. package/esm/src/workflow/dsl/branch.d.ts.map +1 -1
  1015. package/esm/src/workflow/dsl/branch.js +7 -4
  1016. package/esm/src/workflow/dsl/loop.d.ts.map +1 -1
  1017. package/esm/src/workflow/dsl/loop.js +16 -7
  1018. package/esm/src/workflow/dsl/map.d.ts.map +1 -1
  1019. package/esm/src/workflow/dsl/map.js +9 -4
  1020. package/esm/src/workflow/dsl/parallel.d.ts.map +1 -1
  1021. package/esm/src/workflow/dsl/parallel.js +7 -2
  1022. package/esm/src/workflow/dsl/step.d.ts.map +1 -1
  1023. package/esm/src/workflow/dsl/step.js +5 -2
  1024. package/esm/src/workflow/dsl/sub-workflow.d.ts.map +1 -1
  1025. package/esm/src/workflow/dsl/sub-workflow.js +4 -1
  1026. package/esm/src/workflow/dsl/validation.d.ts.map +1 -1
  1027. package/esm/src/workflow/dsl/validation.js +2 -1
  1028. package/esm/src/workflow/dsl/wait.d.ts.map +1 -1
  1029. package/esm/src/workflow/dsl/wait.js +2 -1
  1030. package/esm/src/workflow/dsl/workflow.d.ts.map +1 -1
  1031. package/esm/src/workflow/dsl/workflow.js +6 -4
  1032. package/esm/src/workflow/executor/dag/graph.d.ts +2 -2
  1033. package/esm/src/workflow/executor/dag/graph.d.ts.map +1 -1
  1034. package/esm/src/workflow/executor/dag/graph.js +5 -2
  1035. package/esm/src/workflow/executor/dag/index.d.ts.map +1 -1
  1036. package/esm/src/workflow/executor/dag/index.js +9 -4
  1037. package/esm/src/workflow/executor/dag/utils.d.ts.map +1 -1
  1038. package/esm/src/workflow/executor/dag/utils.js +1 -0
  1039. package/esm/src/workflow/executor/step-executor.d.ts.map +1 -1
  1040. package/esm/src/workflow/executor/step-executor.js +24 -11
  1041. package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
  1042. package/esm/src/workflow/executor/workflow-executor.js +67 -34
  1043. package/esm/src/workflow/react/use-approval.d.ts.map +1 -1
  1044. package/esm/src/workflow/react/use-approval.js +9 -2
  1045. package/esm/src/workflow/react/use-workflow-list.d.ts.map +1 -1
  1046. package/esm/src/workflow/react/use-workflow-list.js +10 -3
  1047. package/esm/src/workflow/react/use-workflow-start.d.ts.map +1 -1
  1048. package/esm/src/workflow/react/use-workflow-start.js +5 -1
  1049. package/esm/src/workflow/react/use-workflow.d.ts.map +1 -1
  1050. package/esm/src/workflow/react/use-workflow.js +17 -5
  1051. package/esm/src/workflow/registry.js +2 -2
  1052. package/esm/src/workflow/runtime/approval-manager.d.ts.map +1 -1
  1053. package/esm/src/workflow/runtime/approval-manager.js +9 -6
  1054. package/esm/src/workflow/types.d.ts +0 -1
  1055. package/esm/src/workflow/types.d.ts.map +1 -1
  1056. package/esm/src/workflow/types.js +20 -11
  1057. package/esm/src/workflow/worker/dynamic-job-entrypoint.d.ts +26 -0
  1058. package/esm/src/workflow/worker/dynamic-job-entrypoint.d.ts.map +1 -1
  1059. package/esm/src/workflow/worker/dynamic-job-entrypoint.js +8 -8
  1060. package/esm/src/workflow/worker/executors/k8s.d.ts.map +1 -1
  1061. package/esm/src/workflow/worker/executors/k8s.js +5 -2
  1062. package/esm/src/workflow/worker/executors/process.d.ts.map +1 -1
  1063. package/esm/src/workflow/worker/executors/process.js +41 -30
  1064. package/esm/src/workflow/worker/job-entrypoint.d.ts +21 -0
  1065. package/esm/src/workflow/worker/job-entrypoint.d.ts.map +1 -1
  1066. package/esm/src/workflow/worker/job-entrypoint.js +7 -7
  1067. package/esm/src/workflow/worker/job-manager.d.ts.map +1 -1
  1068. package/esm/src/workflow/worker/job-manager.js +11 -4
  1069. package/esm/src/workflow/worker/workflow-worker.d.ts.map +1 -1
  1070. package/esm/src/workflow/worker/workflow-worker.js +15 -7
  1071. package/package.json +1 -1
  1072. package/src/_dnt.polyfills.ts +147 -147
  1073. package/src/cli/commands/dev/command.ts +0 -1
  1074. package/src/cli/commands/generate/integration-generator.ts +369 -34
  1075. package/src/cli/commands/start/command.ts +0 -1
  1076. package/src/cli/mcp/server.ts +18 -5
  1077. package/src/cli/shared/server-startup.ts +0 -2
  1078. package/src/cli/templates/index.ts +1 -17
  1079. package/src/cli/templates/manifest.js +12 -12
  1080. package/src/cli/ui/ansi.ts +1 -1
  1081. package/src/deno.js +1 -1
  1082. package/src/src/agent/ai-defaults.ts +4 -64
  1083. package/src/src/agent/chat-handler.ts +39 -21
  1084. package/src/src/agent/factory.ts +22 -6
  1085. package/src/src/agent/index.ts +3 -9
  1086. package/src/src/agent/memory/redis.ts +3 -2
  1087. package/src/src/agent/react/use-agent.ts +4 -4
  1088. package/src/src/agent/react/use-chat/browser-inference/browser-engine.ts +11 -2
  1089. package/src/src/agent/react/use-chat/browser-inference/types.ts +6 -6
  1090. package/src/src/agent/react/use-chat/browser-inference/worker-client.ts +1 -1
  1091. package/src/src/agent/react/use-chat/streaming/handler.ts +10 -5
  1092. package/src/src/agent/react/use-chat/types.ts +2 -2
  1093. package/src/src/agent/react/use-chat/use-chat.ts +4 -4
  1094. package/src/src/agent/react/use-voice-input.ts +2 -2
  1095. package/src/src/agent/runtime/index.ts +16 -9
  1096. package/src/src/agent/runtime/input-utils.ts +2 -1
  1097. package/src/src/agent/runtime/model-resolution.ts +13 -0
  1098. package/src/src/agent/runtime/tool-helpers.ts +2 -1
  1099. package/src/src/agent/types.ts +16 -5
  1100. package/src/src/build/bundler/code-splitter/entry-points.ts +1 -1
  1101. package/src/src/build/bundler/code-splitter/index.ts +4 -2
  1102. package/src/src/build/compiler/mdx-compiler/directory-compiler.ts +1 -1
  1103. package/src/src/build/compiler/mdx-compiler/frontmatter-parser.ts +5 -3
  1104. package/src/src/build/compiler/mdx-compiler/mdx-processor.ts +1 -1
  1105. package/src/src/build/compiler/mdx-compiler/types.ts +1 -1
  1106. package/src/src/build/compiler/mdx-compiler/validator.ts +4 -3
  1107. package/src/src/build/compiler/mdx-compiler/watcher.ts +2 -1
  1108. package/src/src/build/compiler/mdx-to-js.ts +1 -1
  1109. package/src/src/build/config/environment.ts +9 -2
  1110. package/src/src/build/embedded/preset.ts +7 -7
  1111. package/src/src/build/production-build/asset-generation.ts +2 -2
  1112. package/src/src/build/production-build/build/build-cleanup.ts +2 -9
  1113. package/src/src/build/production-build/client-runtime.ts +6 -4
  1114. package/src/src/build/production-build/templates.ts +2 -2
  1115. package/src/src/cache/backends/api.ts +14 -5
  1116. package/src/src/cache/backends/disk.ts +2 -1
  1117. package/src/src/cache/backends/factory.ts +3 -1
  1118. package/src/src/cache/backends/memory.ts +6 -3
  1119. package/src/src/cache/cache-key-builder.ts +6 -4
  1120. package/src/src/cache/config-hash.ts +1 -1
  1121. package/src/src/cache/dependency-graph.ts +2 -1
  1122. package/src/src/cache/distributed-cache-init.ts +1 -1
  1123. package/src/src/cache/keys/builders/file.ts +4 -3
  1124. package/src/src/cache/keys/builders/render.ts +7 -2
  1125. package/src/src/cache/registry.ts +8 -2
  1126. package/src/src/config/environment-config.ts +11 -2
  1127. package/src/src/config/loader.ts +21 -4
  1128. package/src/src/config/runtime-config.ts +4 -1
  1129. package/src/src/data/data-fetcher.ts +1 -2
  1130. package/src/src/data/static-data-fetcher.ts +2 -2
  1131. package/src/src/discovery/file-discovery.ts +3 -2
  1132. package/src/src/discovery/handlers/skill-handler.ts +2 -2
  1133. package/src/src/discovery/import-rewriter.ts +8 -5
  1134. package/src/src/discovery/transpiler.ts +8 -4
  1135. package/src/src/embedding/chunk.ts +8 -2
  1136. package/src/src/embedding/embedding.ts +4 -3
  1137. package/src/src/embedding/index.ts +11 -10
  1138. package/src/src/embedding/model-resolution.ts +23 -0
  1139. package/src/src/embedding/rag-store.ts +431 -0
  1140. package/src/src/embedding/react/use-uploads.ts +9 -6
  1141. package/src/src/embedding/resolve.ts +6 -1
  1142. package/src/src/embedding/types.ts +29 -17
  1143. package/src/src/embedding/upload-handler.ts +94 -9
  1144. package/src/src/embedding/upload-loader.ts +1 -1
  1145. package/src/src/embedding/veryfront-cloud/provider.ts +42 -0
  1146. package/src/src/embedding/veryfront-cloud/rag-store.ts +599 -0
  1147. package/src/src/errors/catalog/general-errors.ts +11 -0
  1148. package/src/src/errors/error-context.ts +3 -0
  1149. package/src/src/errors/error-handlers.ts +3 -2
  1150. package/src/src/errors/error-registry.ts +9 -0
  1151. package/src/src/errors/index.ts +1 -0
  1152. package/src/src/errors/logging.ts +8 -6
  1153. package/src/src/errors/types.ts +3 -1
  1154. package/src/src/errors/veryfront-error.ts +1 -2
  1155. package/src/src/html/dev-scripts.ts +1 -1
  1156. package/src/src/html/hydration-script-builder/dev-error-logger.ts +1 -1
  1157. package/src/src/html/hydration-script-builder/dev-scripts.ts +1 -1
  1158. package/src/src/html/hydration-script-builder/templates/renderer.ts +4 -3
  1159. package/src/src/html/hydration-script-builder/templates/router.ts +5 -4
  1160. package/src/src/html/styles-builder/css-hash-cache.ts +9 -8
  1161. package/src/src/html/styles-builder/css-pregeneration.ts +1 -1
  1162. package/src/src/html/styles-builder/index.ts +0 -1
  1163. package/src/src/html/styles-builder/plugin-loader.ts +48 -28
  1164. package/src/src/html/styles-builder/project-css-cache.ts +3 -3
  1165. package/src/src/html/styles-builder/tailwind-compiler-cache.ts +12 -5
  1166. package/src/src/html/styles-builder/tailwind-compiler-utils.ts +8 -6
  1167. package/src/src/html/styles-builder/tailwind-compiler.ts +6 -11
  1168. package/src/src/html/utils.ts +3 -3
  1169. package/src/src/integrations/endpoint-executor.ts +5 -2
  1170. package/src/src/integrations/types.ts +1 -1
  1171. package/src/src/issues/core.ts +8 -5
  1172. package/src/src/mcp/server.ts +4 -3
  1173. package/src/src/mcp/types.ts +2 -3
  1174. package/src/src/middleware/builtin/security/redis-rate-limit.ts +2 -1
  1175. package/src/src/middleware/builtin/timeout.ts +1 -1
  1176. package/src/src/modules/component-registry/registry.ts +5 -3
  1177. package/src/src/modules/import-map/default-import-map.ts +1 -1
  1178. package/src/src/modules/import-map/loader.ts +6 -6
  1179. package/src/src/modules/import-map/preloader.ts +12 -9
  1180. package/src/src/modules/import-map/resolver.ts +2 -1
  1181. package/src/src/modules/react-loader/ssr-module-loader/cache/memory.ts +1 -1
  1182. package/src/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.ts +5 -1
  1183. package/src/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.ts +9 -6
  1184. package/src/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.ts +9 -4
  1185. package/src/src/modules/react-loader/ssr-module-loader/loader.ts +1 -1
  1186. package/src/src/modules/react-loader/ssr-module-loader/preflight-imports.ts +3 -2
  1187. package/src/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.ts +21 -11
  1188. package/src/src/modules/react-loader/ssr-module-loader/vf-module-resolver.ts +11 -2
  1189. package/src/src/modules/react-loader/unified-loader.ts +2 -2
  1190. package/src/src/modules/server/module-batch-handler.ts +12 -6
  1191. package/src/src/modules/server/module-server.ts +12 -44
  1192. package/src/src/modules/server/ssr-import-rewriter.ts +1 -1
  1193. package/src/src/modules/server/websocket-handler.ts +1 -1
  1194. package/src/src/oauth/providers/base.ts +49 -15
  1195. package/src/src/oauth/token-store/memory.ts +5 -5
  1196. package/src/src/observability/auto-instrument/http-instrumentation.ts +2 -2
  1197. package/src/src/observability/auto-instrument/types.ts +3 -3
  1198. package/src/src/observability/error-collector.ts +7 -5
  1199. package/src/src/observability/log-buffer.ts +4 -3
  1200. package/src/src/observability/metrics/config.ts +4 -3
  1201. package/src/src/observability/simple-metrics/metrics-recorder.ts +7 -4
  1202. package/src/src/observability/simple-metrics/otel-instruments.ts +2 -2
  1203. package/src/src/observability/tracing/config.ts +2 -2
  1204. package/src/src/platform/adapters/detect.ts +0 -3
  1205. package/src/src/platform/adapters/fs/factory.ts +2 -10
  1206. package/src/src/platform/adapters/fs/github/adapter.ts +2 -1
  1207. package/src/src/platform/adapters/fs/github/github-api-client.ts +6 -2
  1208. package/src/src/platform/adapters/fs/github/stat-operations.ts +2 -1
  1209. package/src/src/platform/adapters/fs/github/types.ts +13 -6
  1210. package/src/src/platform/adapters/fs/veryfront/adapter-content-context.ts +7 -4
  1211. package/src/src/platform/adapters/fs/veryfront/adapter.ts +13 -6
  1212. package/src/src/platform/adapters/fs/veryfront/api-search-circuit-breaker.ts +1 -1
  1213. package/src/src/platform/adapters/fs/veryfront/content-metrics.ts +1 -1
  1214. package/src/src/platform/adapters/fs/veryfront/file-list-index.ts +2 -1
  1215. package/src/src/platform/adapters/fs/veryfront/in-flight-dedupe.ts +3 -3
  1216. package/src/src/platform/adapters/fs/veryfront/multi-project-adapter.ts +16 -9
  1217. package/src/src/platform/adapters/fs/veryfront/proxy-manager.ts +18 -21
  1218. package/src/src/platform/adapters/fs/veryfront/read-operations-helpers.ts +6 -5
  1219. package/src/src/platform/adapters/fs/veryfront/read-operations.ts +9 -7
  1220. package/src/src/platform/adapters/fs/veryfront/retry.ts +1 -0
  1221. package/src/src/platform/adapters/fs/veryfront/stat-operations-helpers.ts +1 -1
  1222. package/src/src/platform/adapters/fs/veryfront/stat-operations.ts +7 -3
  1223. package/src/src/platform/adapters/fs/veryfront/types.ts +1 -4
  1224. package/src/src/platform/adapters/fs/veryfront/websocket-manager.ts +37 -19
  1225. package/src/src/platform/adapters/redis/modules.ts +10 -4
  1226. package/src/src/platform/adapters/registry.ts +21 -18
  1227. package/src/src/platform/adapters/runtime/bun/filesystem-adapter.ts +5 -3
  1228. package/src/src/platform/adapters/runtime/deno/adapter.ts +23 -12
  1229. package/src/src/platform/adapters/runtime/node/filesystem-adapter.ts +2 -2
  1230. package/src/src/platform/adapters/runtime/node/http-server.ts +15 -5
  1231. package/src/src/platform/adapters/runtime/node/websocket-adapter.ts +8 -5
  1232. package/src/src/platform/adapters/runtime/shared/server-lifecycle.ts +1 -1
  1233. package/src/src/platform/adapters/runtime/shared/shared-watcher.ts +7 -4
  1234. package/src/src/platform/adapters/veryfront-api-client/client.ts +12 -6
  1235. package/src/src/platform/adapters/veryfront-api-client/operations.ts +15 -4
  1236. package/src/src/platform/adapters/veryfront-api-client/retry-handler.ts +1 -0
  1237. package/src/src/platform/cloud/resolver.ts +104 -0
  1238. package/src/src/platform/compat/console/index.ts +2 -1
  1239. package/src/src/platform/compat/dynamic-import.ts +3 -2
  1240. package/src/src/platform/compat/esbuild-init.ts +7 -6
  1241. package/src/src/platform/compat/esbuild.ts +12 -13
  1242. package/src/src/platform/compat/fs.ts +30 -15
  1243. package/src/src/platform/compat/http/node-server.ts +5 -3
  1244. package/src/src/platform/compat/http/responses.ts +4 -2
  1245. package/src/src/platform/compat/http/websocket.ts +4 -3
  1246. package/src/src/platform/compat/opaque-deps.ts +6 -1
  1247. package/src/src/platform/compat/path/basic-operations.ts +5 -9
  1248. package/src/src/platform/compat/path/parse-format.ts +5 -5
  1249. package/src/src/platform/compat/path/resolution.ts +6 -10
  1250. package/src/src/platform/compat/path/runtime.ts +2 -2
  1251. package/src/src/platform/compat/path/url-conversion.ts +2 -1
  1252. package/src/src/platform/compat/process.ts +78 -49
  1253. package/src/src/platform/compat/react-paths.ts +2 -2
  1254. package/src/src/platform/compat/runtime.ts +2 -1
  1255. package/src/src/platform/compat/stdin.ts +10 -8
  1256. package/src/src/platform/core-platform.ts +33 -10
  1257. package/src/src/provider/local/ai-sdk-adapter.ts +7 -5
  1258. package/src/src/provider/local/env.ts +6 -4
  1259. package/src/src/provider/local/local-embedding-engine.ts +10 -5
  1260. package/src/src/provider/local/local-engine.ts +76 -41
  1261. package/src/src/provider/model-registry.ts +36 -5
  1262. package/src/src/provider/veryfront-cloud/provider.ts +62 -0
  1263. package/src/src/provider/veryfront-cloud/shared.ts +136 -0
  1264. package/src/src/proxy/cache/memory-cache.ts +3 -2
  1265. package/src/src/proxy/cache/redis-cache.ts +28 -19
  1266. package/src/src/proxy/cache/resilient-cache.ts +11 -1
  1267. package/src/src/proxy/handler.ts +6 -4
  1268. package/src/src/proxy/logger.ts +6 -5
  1269. package/src/src/proxy/main.ts +11 -6
  1270. package/src/src/proxy/oauth-client.ts +9 -6
  1271. package/src/src/proxy/renderer-router.ts +1 -1
  1272. package/src/src/proxy/token-manager.ts +13 -10
  1273. package/src/src/proxy/tracing.ts +6 -5
  1274. package/src/src/react/compat/config-generator.ts +1 -1
  1275. package/src/src/react/compat/hooks-adapter.ts +44 -23
  1276. package/src/src/react/compat/ssr-adapter/server-loader.ts +7 -2
  1277. package/src/src/react/compat/version-detector/feature-detector.ts +1 -1
  1278. package/src/src/react/compat/version-detector/version-cache.ts +9 -5
  1279. package/src/src/react/components/LayoutComponent.tsx +1 -1
  1280. package/src/src/react/components/ProviderComponent.tsx +1 -1
  1281. package/src/src/react/components/ai/agent-card.tsx +3 -3
  1282. package/src/src/react/components/ai/chat/components/code-block.tsx +2 -1
  1283. package/src/src/react/components/ai/chat/components/message-actions.tsx +2 -2
  1284. package/src/src/react/components/ai/chat/components/reasoning.tsx +1 -1
  1285. package/src/src/react/components/ai/chat/components/upgrade-cta.tsx +4 -3
  1286. package/src/src/react/components/ai/chat/components/uploads-panel.tsx +17 -3
  1287. package/src/src/react/components/ai/chat/composition/message.tsx +5 -4
  1288. package/src/src/react/components/ai/chat/contexts/chat-context.tsx +4 -1
  1289. package/src/src/react/components/ai/chat/contexts/composer-context.tsx +4 -1
  1290. package/src/src/react/components/ai/chat/contexts/message-context.tsx +4 -1
  1291. package/src/src/react/components/ai/chat/contexts/thread-list-context.tsx +4 -1
  1292. package/src/src/react/components/ai/chat/hooks/use-threads.ts +2 -2
  1293. package/src/src/react/components/ai/theme.ts +2 -2
  1294. package/src/src/react/head-collector.ts +1 -1
  1295. package/src/src/react/primitives/input-box.tsx +2 -4
  1296. package/src/src/rendering/app-reserved.ts +2 -2
  1297. package/src/src/rendering/app-route-resolver.ts +10 -9
  1298. package/src/src/rendering/cache/cache-coordinator.ts +4 -1
  1299. package/src/src/rendering/cache/stores/api-store.ts +23 -14
  1300. package/src/src/rendering/cache/stores/filesystem-store.ts +10 -8
  1301. package/src/src/rendering/cache/stores/memory-store.ts +1 -1
  1302. package/src/src/rendering/cache/stores/redis-store.ts +15 -7
  1303. package/src/src/rendering/component-handling.ts +2 -2
  1304. package/src/src/rendering/context/render-context.ts +15 -6
  1305. package/src/src/rendering/element-validator/primitive-checks.ts +3 -2
  1306. package/src/src/rendering/factories/service-factories.ts +3 -1
  1307. package/src/src/rendering/layouts/layout-applicator.ts +8 -5
  1308. package/src/src/rendering/layouts/layout-collector.ts +14 -7
  1309. package/src/src/rendering/layouts/utils/app-resolver.ts +9 -6
  1310. package/src/src/rendering/layouts/utils/component-loader.ts +1 -1
  1311. package/src/src/rendering/layouts/utils/hash-calculator.ts +7 -5
  1312. package/src/src/rendering/orchestrator/css-cache.ts +2 -2
  1313. package/src/src/rendering/orchestrator/css-candidate-manifest.ts +1 -1
  1314. package/src/src/rendering/orchestrator/file-resolver/candidates.ts +2 -2
  1315. package/src/src/rendering/orchestrator/html.ts +9 -5
  1316. package/src/src/rendering/orchestrator/layout.ts +42 -31
  1317. package/src/src/rendering/orchestrator/lifecycle.ts +10 -2
  1318. package/src/src/rendering/orchestrator/module-collection.ts +2 -3
  1319. package/src/src/rendering/orchestrator/module-loader/esm-rewriter.ts +4 -1
  1320. package/src/src/rendering/orchestrator/module-loader/index.ts +11 -8
  1321. package/src/src/rendering/orchestrator/pipeline.ts +36 -25
  1322. package/src/src/rendering/page-renderer.ts +2 -2
  1323. package/src/src/rendering/page-rendering.ts +4 -2
  1324. package/src/src/rendering/page-resolution/page-resolver.ts +5 -0
  1325. package/src/src/rendering/renderer-concurrency.ts +6 -5
  1326. package/src/src/rendering/renderer.ts +16 -31
  1327. package/src/src/rendering/router-detection.ts +40 -9
  1328. package/src/src/rendering/rsc/server-renderer/component-detector.ts +1 -0
  1329. package/src/src/rendering/rsc/server-renderer/prop-serializer.ts +2 -1
  1330. package/src/src/rendering/rsc/server-renderer/rsc-renderer.ts +1 -0
  1331. package/src/src/rendering/rsc/server-renderer/tree-processor.ts +1 -0
  1332. package/src/src/rendering/script-page-handling.ts +3 -2
  1333. package/src/src/rendering/shared/context-aware-cache.ts +7 -2
  1334. package/src/src/rendering/shared/shared-services.ts +4 -1
  1335. package/src/src/rendering/snippet-renderer.ts +46 -37
  1336. package/src/src/rendering/ssr-globals/dom-stubs.ts +10 -4
  1337. package/src/src/rendering/ssr-globals/fetch-interceptor.ts +6 -4
  1338. package/src/src/rendering/ssr-globals/index.ts +2 -1
  1339. package/src/src/rendering/ssr-renderer.ts +9 -2
  1340. package/src/src/rendering/utils/stream-utils.ts +2 -2
  1341. package/src/src/routing/api/api-route-matcher.ts +10 -6
  1342. package/src/src/routing/api/handler.ts +7 -4
  1343. package/src/src/routing/api/index.ts +1 -1
  1344. package/src/src/routing/api/module-loader/esbuild-plugin.ts +4 -3
  1345. package/src/src/routing/api/module-loader/http-validator.ts +2 -1
  1346. package/src/src/routing/api/module-loader/loader.ts +15 -14
  1347. package/src/src/routing/api/openapi/path-utils.ts +1 -1
  1348. package/src/src/routing/api/openapi/spec-generator.ts +9 -8
  1349. package/src/src/routing/api/openapi/types.ts +5 -5
  1350. package/src/src/routing/api/route-discovery.ts +3 -3
  1351. package/src/src/routing/index.ts +1 -1
  1352. package/src/src/routing/matchers/index.ts +1 -1
  1353. package/src/src/routing/matchers/pattern-route-matcher.ts +0 -3
  1354. package/src/src/sandbox/index.ts +1 -1
  1355. package/src/src/sandbox/sandbox.ts +58 -23
  1356. package/src/src/security/client/html-sanitizer.ts +5 -16
  1357. package/src/src/security/csrf/helpers.ts +4 -4
  1358. package/src/src/security/http/auth.ts +3 -3
  1359. package/src/src/security/http/base-handler.ts +2 -2
  1360. package/src/src/security/http/middleware/config-loader.ts +2 -1
  1361. package/src/src/security/http/response/fluent-methods.ts +7 -3
  1362. package/src/src/security/http/response/security-handler.ts +8 -2
  1363. package/src/src/security/path-validation/canonical.ts +2 -1
  1364. package/src/src/security/path-validation/index.ts +2 -1
  1365. package/src/src/security/path-validation/rules.ts +1 -2
  1366. package/src/src/security/secure-fs.ts +8 -2
  1367. package/src/src/server/bootstrap.ts +5 -5
  1368. package/src/src/server/build-app-route-renderer.ts +3 -2
  1369. package/src/src/server/build-routes.ts +2 -2
  1370. package/src/src/server/build-service-worker.ts +2 -1
  1371. package/src/src/server/context/cache-invalidation.ts +11 -4
  1372. package/src/src/server/context/enriched-context.ts +5 -4
  1373. package/src/src/server/dev-server/error-overlay/html-template.ts +11 -2
  1374. package/src/src/server/dev-server/file-watch-setup.ts +23 -4
  1375. package/src/src/server/dev-server/middleware.ts +11 -8
  1376. package/src/src/server/dev-server/request-handler.ts +11 -7
  1377. package/src/src/server/dev-server/route-discovery.ts +2 -2
  1378. package/src/src/server/dev-server/server.ts +12 -15
  1379. package/src/src/server/dev-server/types.ts +0 -2
  1380. package/src/src/server/dev-ui/manifest.js +10 -10
  1381. package/src/src/server/handlers/dev/dashboard/api.ts +28 -9
  1382. package/src/src/server/handlers/dev/dashboard/ui-handler.ts +6 -6
  1383. package/src/src/server/handlers/dev/debug-context.handler.ts +4 -2
  1384. package/src/src/server/handlers/dev/endpoints.handler.ts +3 -1
  1385. package/src/src/server/handlers/dev/files/esbuild-plugins.ts +10 -5
  1386. package/src/src/server/handlers/dev/files/path-validator.ts +2 -1
  1387. package/src/src/server/handlers/dev/framework-candidates.generated.ts +13 -6
  1388. package/src/src/server/handlers/dev/projects/ui-handler.ts +6 -6
  1389. package/src/src/server/handlers/dev/scripts/hmr-scripts.ts +13 -13
  1390. package/src/src/server/handlers/dev/shared/ui-module-transform.ts +1 -1
  1391. package/src/src/server/handlers/dev/styles-candidate-scanner.ts +4 -3
  1392. package/src/src/server/handlers/dev/styles-css.handler.ts +2 -1
  1393. package/src/src/server/handlers/monitoring/client-log.handler.ts +9 -3
  1394. package/src/src/server/handlers/monitoring/health.handler.ts +4 -2
  1395. package/src/src/server/handlers/monitoring/memory.handler.ts +9 -1
  1396. package/src/src/server/handlers/monitoring/metrics.handler.ts +3 -0
  1397. package/src/src/server/handlers/preview/hmr-client-manager.ts +3 -12
  1398. package/src/src/server/handlers/preview/hmr-message-router.ts +3 -3
  1399. package/src/src/server/handlers/preview/hmr-ping-keepalive.ts +3 -3
  1400. package/src/src/server/handlers/preview/hmr.handler.ts +8 -8
  1401. package/src/src/server/handlers/preview/markdown-html-generator.ts +3 -3
  1402. package/src/src/server/handlers/preview/markdown-preview.handler.ts +6 -5
  1403. package/src/src/server/handlers/request/api/app-router-resolver.ts +130 -51
  1404. package/src/src/server/handlers/request/api/pages-api-handler.ts +2 -2
  1405. package/src/src/server/handlers/request/module/page-data-endpoint-handler.ts +1 -1
  1406. package/src/src/server/handlers/request/openapi-docs.handler.ts +4 -1
  1407. package/src/src/server/handlers/request/openapi.handler.ts +8 -5
  1408. package/src/src/server/handlers/request/rsc/index.ts +1 -0
  1409. package/src/src/server/handlers/request/ssr/error-page-fallback.ts +8 -6
  1410. package/src/src/server/handlers/request/ssr/not-found-fallback.ts +8 -5
  1411. package/src/src/server/handlers/request/ssr/ssr.handler.ts +2 -2
  1412. package/src/src/server/handlers/response/cors.ts +2 -82
  1413. package/src/src/server/handlers/studio/bridge-modules.handler.ts +4 -9
  1414. package/src/src/server/index.ts +20 -26
  1415. package/src/src/server/production-server.ts +22 -5
  1416. package/src/src/server/project-env/cache.ts +2 -2
  1417. package/src/src/server/project-env/fetcher.ts +2 -1
  1418. package/src/src/server/reload-notifier.ts +1 -1
  1419. package/src/src/server/runtime-handler/adapter-factory.ts +2 -2
  1420. package/src/src/server/runtime-handler/environment-resolution.ts +2 -2
  1421. package/src/src/server/runtime-handler/handler-context-builder.ts +2 -2
  1422. package/src/src/server/runtime-handler/index.ts +16 -16
  1423. package/src/src/server/runtime-handler/isolation.ts +1 -1
  1424. package/src/src/server/runtime-handler/local-project-discovery.ts +14 -4
  1425. package/src/src/server/runtime-handler/project-isolation.ts +1 -1
  1426. package/src/src/server/runtime-handler/project-resolution.ts +4 -4
  1427. package/src/src/server/runtime-handler/request-lifecycle.ts +1 -1
  1428. package/src/src/server/runtime-handler/request-tracker.ts +9 -3
  1429. package/src/src/server/runtime-handler/request-utils.ts +1 -1
  1430. package/src/src/server/runtime-handler/tracing.ts +1 -1
  1431. package/src/src/server/services/rsc/endpoints/action-handler.ts +2 -1
  1432. package/src/src/server/services/rsc/endpoints/endpoint-router.ts +12 -4
  1433. package/src/src/server/services/rsc/endpoints/handler-registry.ts +9 -4
  1434. package/src/src/server/services/rsc/endpoints/script-handlers.ts +2 -2
  1435. package/src/src/server/services/rsc/endpoints/types.ts +1 -0
  1436. package/src/src/server/services/rsc/orchestrators/component-resolver.ts +2 -1
  1437. package/src/src/server/services/rsc/orchestrators/manifest-handler.ts +1 -1
  1438. package/src/src/server/services/rsc/orchestrators/page-handler.ts +2 -1
  1439. package/src/src/server/services/rsc/orchestrators/render-handler.ts +3 -3
  1440. package/src/src/server/services/rsc/orchestrators/stream-handler.ts +1 -1
  1441. package/src/src/server/services/static/static-file.service.ts +7 -4
  1442. package/src/src/server/shared/renderer/adapter.ts +9 -4
  1443. package/src/src/server/utils/domain-lookup.ts +1 -1
  1444. package/src/src/server/utils/error-html.ts +1 -1
  1445. package/src/src/skill/allowed-tools.ts +1 -1
  1446. package/src/src/skill/executor.ts +21 -23
  1447. package/src/src/skill/parser.ts +5 -5
  1448. package/src/src/skill/path-safety.ts +11 -2
  1449. package/src/src/skill/tools.ts +5 -2
  1450. package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
  1451. package/src/src/task/discovery.ts +81 -7
  1452. package/src/src/tool/factory.ts +1 -2
  1453. package/src/src/tool/schema/zod-json-schema.ts +14 -8
  1454. package/src/src/tool/types.ts +4 -4
  1455. package/src/src/transforms/esm/bundle-deps-validator.ts +14 -7
  1456. package/src/src/transforms/esm/bundle-manifest.ts +9 -5
  1457. package/src/src/transforms/esm/bundle-recovery.ts +19 -15
  1458. package/src/src/transforms/esm/http-bundler.ts +6 -20
  1459. package/src/src/transforms/esm/http-cache-helpers.ts +2 -1
  1460. package/src/src/transforms/esm/http-cache-invariants.ts +1 -30
  1461. package/src/src/transforms/esm/http-cache-types.ts +2 -2
  1462. package/src/src/transforms/esm/http-cache-wrapper.ts +6 -4
  1463. package/src/src/transforms/esm/http-cache.ts +25 -17
  1464. package/src/src/transforms/esm/import-parser.ts +11 -6
  1465. package/src/src/transforms/esm/in-flight-manager.ts +15 -12
  1466. package/src/src/transforms/esm/package-registry.ts +2 -22
  1467. package/src/src/transforms/esm/source-url-embed.ts +2 -2
  1468. package/src/src/transforms/esm/specifier-resolver.ts +1 -1
  1469. package/src/src/transforms/esm/transform-cache.ts +5 -154
  1470. package/src/src/transforms/import-rewriter/strategies/import-map-strategy.ts +4 -2
  1471. package/src/src/transforms/md/utils.ts +1 -1
  1472. package/src/src/transforms/mdx/compiler/import-rewriter.ts +2 -1
  1473. package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +22 -12
  1474. package/src/src/transforms/mdx/esm-module-loader/constants.ts +0 -1
  1475. package/src/src/transforms/mdx/esm-module-loader/import-transformer.ts +13 -5
  1476. package/src/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.ts +5 -6
  1477. package/src/src/transforms/mdx/esm-module-loader/loader-helpers.ts +18 -14
  1478. package/src/src/transforms/mdx/esm-module-loader/metadata/string-parser.ts +2 -1
  1479. package/src/src/transforms/mdx/esm-module-loader/missing-module.ts +4 -3
  1480. package/src/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.ts +18 -15
  1481. package/src/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.ts +9 -7
  1482. package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +2 -1
  1483. package/src/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.ts +2 -2
  1484. package/src/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.ts +1 -1
  1485. package/src/src/transforms/mdx/esm-module-loader/module-writer.ts +30 -21
  1486. package/src/src/transforms/mdx/esm-module-loader/resolution/file-finder.ts +4 -3
  1487. package/src/src/transforms/mdx/esm-module-loader/types.ts +3 -3
  1488. package/src/src/transforms/mdx/esm-module-loader/utils/stub-module.ts +2 -2
  1489. package/src/src/transforms/pipeline/index.ts +3 -2
  1490. package/src/src/transforms/pipeline/stages/compile.ts +5 -1
  1491. package/src/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.ts +18 -18
  1492. package/src/src/transforms/pipeline/stages/ssr-vf-modules/transform.ts +9 -6
  1493. package/src/src/transforms/plugins/babel-node-positions.ts +2 -2
  1494. package/src/src/transforms/plugins/plugin-loader.ts +1 -1
  1495. package/src/src/transforms/plugins/rehype-node-positions.ts +1 -1
  1496. package/src/src/transforms/shared/cross-project-import.ts +1 -1
  1497. package/src/src/transforms/veryfront-module-urls.ts +0 -4
  1498. package/src/src/types/entities/getEntityInfo.ts +22 -16
  1499. package/src/src/types/entities.ts +0 -45
  1500. package/src/src/utils/box.ts +1 -1
  1501. package/src/src/utils/bundle-manifest-init.ts +0 -25
  1502. package/src/src/utils/bundle-manifest-kv.ts +1 -1
  1503. package/src/src/utils/bundle-manifest-redis.ts +1 -1
  1504. package/src/src/utils/cache-dir.ts +4 -5
  1505. package/src/src/utils/cache-file-ops.ts +2 -1
  1506. package/src/src/utils/circuit-breaker.ts +19 -28
  1507. package/src/src/utils/constants/cache.ts +2 -2
  1508. package/src/src/utils/env-loader.ts +2 -1
  1509. package/src/src/utils/file-discovery.ts +6 -6
  1510. package/src/src/utils/hash-utils.ts +6 -2
  1511. package/src/src/utils/import-lockfile.ts +12 -8
  1512. package/src/src/utils/logger/core.ts +2 -1
  1513. package/src/src/utils/logger/logger.ts +17 -7
  1514. package/src/src/utils/lru-wrapper.ts +5 -2
  1515. package/src/src/utils/memoize.ts +2 -3
  1516. package/src/src/utils/memory/profiler.ts +18 -7
  1517. package/src/src/utils/parallel.ts +5 -3
  1518. package/src/src/utils/path-utils.ts +11 -9
  1519. package/src/src/utils/platform.ts +2 -1
  1520. package/src/src/utils/redis-client.ts +11 -33
  1521. package/src/src/utils/route-path-utils.ts +3 -3
  1522. package/src/src/workflow/api.ts +9 -9
  1523. package/src/src/workflow/backends/memory.ts +13 -6
  1524. package/src/src/workflow/backends/redis/index.ts +32 -16
  1525. package/src/src/workflow/blob/veryfront-cloud-storage.ts +520 -0
  1526. package/src/src/workflow/claude-code/agent.ts +35 -8
  1527. package/src/src/workflow/claude-code/event-publisher.ts +33 -10
  1528. package/src/src/workflow/claude-code/react/use-claude-code-stream.ts +13 -4
  1529. package/src/src/workflow/claude-code/react/use-claude-code-websocket.ts +14 -5
  1530. package/src/src/workflow/claude-code/tool.ts +3 -3
  1531. package/src/src/workflow/claude-code/types.ts +5 -6
  1532. package/src/src/workflow/claude-code/websocket-publisher.ts +32 -17
  1533. package/src/src/workflow/claude-code/workspace-sync.ts +29 -18
  1534. package/src/src/workflow/dsl/branch.ts +7 -2
  1535. package/src/src/workflow/dsl/loop.ts +18 -8
  1536. package/src/src/workflow/dsl/map.ts +9 -2
  1537. package/src/src/workflow/dsl/parallel.ts +7 -4
  1538. package/src/src/workflow/dsl/step.ts +5 -2
  1539. package/src/src/workflow/dsl/sub-workflow.ts +4 -1
  1540. package/src/src/workflow/dsl/validation.ts +3 -1
  1541. package/src/src/workflow/dsl/wait.ts +2 -1
  1542. package/src/src/workflow/dsl/workflow.ts +6 -3
  1543. package/src/src/workflow/executor/dag/graph.ts +6 -3
  1544. package/src/src/workflow/executor/dag/index.ts +10 -7
  1545. package/src/src/workflow/executor/dag/utils.ts +1 -0
  1546. package/src/src/workflow/executor/step-executor.ts +33 -12
  1547. package/src/src/workflow/executor/workflow-executor.ts +73 -33
  1548. package/src/src/workflow/react/use-approval.ts +9 -2
  1549. package/src/src/workflow/react/use-workflow-list.ts +11 -2
  1550. package/src/src/workflow/react/use-workflow-start.ts +5 -3
  1551. package/src/src/workflow/react/use-workflow.ts +18 -5
  1552. package/src/src/workflow/registry.ts +2 -2
  1553. package/src/src/workflow/runtime/approval-manager.ts +10 -6
  1554. package/src/src/workflow/types.ts +24 -12
  1555. package/src/src/workflow/worker/dynamic-job-entrypoint.ts +10 -10
  1556. package/src/src/workflow/worker/executors/k8s.ts +6 -2
  1557. package/src/src/workflow/worker/executors/process.ts +41 -32
  1558. package/src/src/workflow/worker/job-entrypoint.ts +7 -8
  1559. package/src/src/workflow/worker/job-manager.ts +14 -4
  1560. package/src/src/workflow/worker/workflow-worker.ts +14 -6
  1561. package/esm/src/build/vendor-bundle.d.ts +0 -32
  1562. package/esm/src/build/vendor-bundle.d.ts.map +0 -1
  1563. package/esm/src/build/vendor-bundle.js +0 -110
  1564. package/esm/src/build/vendor-cache.d.ts +0 -18
  1565. package/esm/src/build/vendor-cache.d.ts.map +0 -1
  1566. package/esm/src/build/vendor-cache.js +0 -76
  1567. package/esm/src/embedding/upload-store.d.ts +0 -27
  1568. package/esm/src/embedding/upload-store.d.ts.map +0 -1
  1569. package/src/src/build/vendor-bundle.ts +0 -154
  1570. package/src/src/build/vendor-cache.ts +0 -111
  1571. package/src/src/embedding/upload-store.ts +0 -299
@@ -11,7 +11,7 @@ export const CLIENT_STYLES =
11
11
  ".error-container {\n max-width: 600px;\n margin: 2rem auto;\n padding: 2rem;\n background: #fee;\n border: 1px solid #fcc;\n border-radius: 8px;\n color: #c00;\n}";
12
12
 
13
13
  export const CLIENT_ROUTER_BUNDLE: string | undefined =
14
- 'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/router.ts\nimport { rendererLogger } from "#veryfront/utils";\nimport ReactDOM from "react-dom/client";\nimport {\n extractPageDataFromScript,\n NavigationHandlers,\n PageLoader,\n PageTransition,\n ViewportPrefetch\n} from "#veryfront/routing";\nvar logger = rendererLogger.component("veryfront");\nvar VeryfrontRouter = class {\n constructor(options = {}) {\n __publicField(this, "baseUrl");\n __publicField(this, "currentPath");\n __publicField(this, "root", null);\n __publicField(this, "options");\n __publicField(this, "spaMode");\n __publicField(this, "spaNavigationHandler", null);\n __publicField(this, "pageLoader");\n __publicField(this, "navigationHandlers");\n __publicField(this, "pageTransition");\n __publicField(this, "viewportPrefetch");\n __publicField(this, "handleClick");\n __publicField(this, "handlePopState");\n __publicField(this, "handleMouseOver");\n const globalOptions = this.loadGlobalOptions();\n this.options = { ...globalOptions, ...options };\n this.baseUrl = this.options.baseUrl || globalThis.location.origin;\n this.currentPath = globalThis.location.pathname;\n this.spaMode = this.options.spaMode ?? globalThis.__VERYFRONT_SPA_MODE__ ?? false;\n this.pageLoader = new PageLoader();\n this.navigationHandlers = new NavigationHandlers(\n this.options.prefetchDelay,\n this.options.prefetch\n );\n this.pageTransition = new PageTransition((root) => this.viewportPrefetch.setup(root));\n this.viewportPrefetch = new ViewportPrefetch(\n (path) => this.prefetch(path),\n this.options.prefetch\n );\n this.handleClick = this.navigationHandlers.createClickHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handlePopState = this.navigationHandlers.createPopStateHandler({\n onNavigate: (url) => this.navigate(url, false),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handleMouseOver = this.navigationHandlers.createMouseOverHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n }\n registerNavigationHandler(handler) {\n logger.debug("Registering SPA navigation handler");\n this.spaNavigationHandler = handler;\n this.spaMode = true;\n }\n loadGlobalOptions() {\n try {\n const options = globalThis.__VERYFRONT_ROUTER_OPTS__;\n if (!options) {\n logger.debug("No global options configured");\n return {};\n }\n return options;\n } catch (error) {\n logger.error("Failed to read global options:", error);\n return {};\n }\n }\n init() {\n logger.debug("Initializing client-side router");\n const rootElement = document.getElementById("root");\n if (!rootElement) {\n logger.error("Root element not found");\n return;\n }\n const ReactDOMToUse = globalThis.ReactDOM ?? ReactDOM;\n this.root = ReactDOMToUse.createRoot(rootElement);\n document.addEventListener("click", this.handleClick);\n globalThis.addEventListener("popstate", this.handlePopState);\n document.addEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.setup(document);\n this.cacheCurrentPage();\n }\n cacheCurrentPage() {\n const pageData = extractPageDataFromScript();\n if (pageData)\n this.pageLoader.setCache(this.currentPath, pageData);\n }\n async navigate(url, pushState = true) {\n logger.debug(`Navigating to ${url} (SPA mode: ${this.spaMode})`);\n this.navigationHandlers.saveScrollPosition(this.currentPath);\n this.options.onStart?.(url);\n if (pushState)\n globalThis.history.pushState({}, "", url);\n if (this.spaMode && this.spaNavigationHandler) {\n await this.loadSpaPage(url);\n } else {\n await this.loadPage(url);\n }\n this.options.onNavigate?.(url);\n }\n async loadSpaPage(path) {\n logger.debug(`Loading SPA page: ${path}`);\n try {\n const spaData = await this.pageLoader.loadSpaPageData(path);\n await this.spaNavigationHandler?.(spaData);\n this.currentPath = path;\n this.handleScrollAfterNavigation();\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load SPA page ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n }\n }\n handleScrollAfterNavigation() {\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n try {\n globalThis.scrollTo(0, isPopState ? scrollY : 0);\n } catch (error) {\n logger.warn("scroll handling failed", error);\n }\n this.navigationHandlers.clearPopStateFlag();\n }\n async loadPage(path, updateUI = true) {\n if (this.pageLoader.isCached(path)) {\n logger.debug(`Loading ${path} from cache`);\n const data = this.pageLoader.getCached(path);\n if (data) {\n if (updateUI)\n this.updatePage(data);\n return;\n }\n logger.warn(`Cache entry for ${path} was unexpectedly null, fetching fresh data`);\n }\n this.pageTransition.setLoadingState(true);\n try {\n const data = await this.pageLoader.loadPage(path);\n if (updateUI)\n this.updatePage(data);\n this.currentPath = path;\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n } finally {\n this.pageTransition.setLoadingState(false);\n }\n }\n async prefetch(path) {\n if (this.spaMode) {\n await this.pageLoader.prefetchSpaPageData(path);\n return;\n }\n await this.pageLoader.prefetch(path);\n }\n updatePage(data) {\n if (!this.root)\n return;\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n this.pageTransition.updatePage(data, isPopState, scrollY);\n this.navigationHandlers.clearPopStateFlag();\n }\n destroy() {\n document.removeEventListener("click", this.handleClick);\n globalThis.removeEventListener("popstate", this.handlePopState);\n document.removeEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.disconnect();\n this.pageLoader.clearCache();\n this.navigationHandlers.clear();\n this.pageTransition.destroy();\n }\n};\nif (typeof window !== "undefined" && globalThis.document) {\n const router = new VeryfrontRouter();\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => router.init());\n } else {\n router.init();\n }\n globalThis.veryFrontRouter = router;\n}\nexport {\n VeryfrontRouter\n};\n';
14
+ 'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/router.ts\nimport { rendererLogger } from "#veryfront/utils";\nimport ReactDOM from "react-dom/client";\nimport {\n extractPageDataFromScript,\n NavigationHandlers,\n PageLoader,\n PageTransition,\n ViewportPrefetch\n} from "#veryfront/routing";\nvar logger = rendererLogger.component("veryfront");\nvar VeryfrontRouter = class {\n constructor(options = {}) {\n __publicField(this, "baseUrl");\n __publicField(this, "currentPath");\n __publicField(this, "root", null);\n __publicField(this, "options");\n __publicField(this, "spaMode");\n __publicField(this, "spaNavigationHandler", null);\n __publicField(this, "pageLoader");\n __publicField(this, "navigationHandlers");\n __publicField(this, "pageTransition");\n __publicField(this, "viewportPrefetch");\n __publicField(this, "handleClick");\n __publicField(this, "handlePopState");\n __publicField(this, "handleMouseOver");\n const globalOptions = this.loadGlobalOptions();\n this.options = { ...globalOptions, ...options };\n this.baseUrl = this.options.baseUrl || globalThis.location.origin;\n this.currentPath = globalThis.location.pathname;\n this.spaMode = this.options.spaMode ?? globalThis.__VERYFRONT_SPA_MODE__ ?? false;\n this.pageLoader = new PageLoader();\n this.navigationHandlers = new NavigationHandlers(\n this.options.prefetchDelay,\n this.options.prefetch\n );\n this.pageTransition = new PageTransition((root) => this.viewportPrefetch.setup(root));\n this.viewportPrefetch = new ViewportPrefetch(\n (path) => this.prefetch(path),\n this.options.prefetch\n );\n this.handleClick = this.navigationHandlers.createClickHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handlePopState = this.navigationHandlers.createPopStateHandler({\n onNavigate: (url) => this.navigate(url, false),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handleMouseOver = this.navigationHandlers.createMouseOverHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n }\n registerNavigationHandler(handler) {\n logger.debug("Registering SPA navigation handler");\n this.spaNavigationHandler = handler;\n this.spaMode = true;\n }\n loadGlobalOptions() {\n try {\n const options = globalThis.__VERYFRONT_ROUTER_OPTS__;\n if (!options) {\n logger.debug("No global options configured");\n return {};\n }\n return options;\n } catch (error) {\n logger.error("Failed to read global options:", error);\n return {};\n }\n }\n init() {\n logger.debug("Initializing client-side router");\n const rootElement = document.getElementById("root");\n if (!rootElement) {\n logger.error("Root element not found");\n return;\n }\n const ReactDOMToUse = globalThis.ReactDOM ?? ReactDOM;\n this.root = ReactDOMToUse.createRoot(rootElement);\n document.addEventListener("click", this.handleClick);\n globalThis.addEventListener("popstate", this.handlePopState);\n document.addEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.setup(document);\n this.cacheCurrentPage();\n }\n cacheCurrentPage() {\n const pageData = extractPageDataFromScript();\n if (pageData)\n this.pageLoader.setCache(this.currentPath, pageData);\n }\n async navigate(url, pushState = true) {\n logger.debug(`Navigating to ${url} (SPA mode: ${this.spaMode})`);\n this.navigationHandlers.saveScrollPosition(this.currentPath);\n this.options.onStart?.(url);\n if (pushState)\n globalThis.history.pushState({}, "", url);\n if (this.spaMode && this.spaNavigationHandler) {\n await this.loadSpaPage(url);\n } else {\n await this.loadPage(url);\n }\n this.options.onNavigate?.(url);\n }\n async loadSpaPage(path) {\n logger.debug(`Loading SPA page: ${path}`);\n try {\n const spaData = await this.pageLoader.loadSpaPageData(path);\n await this.spaNavigationHandler?.(spaData);\n this.currentPath = path;\n this.handleScrollAfterNavigation();\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load SPA page ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n }\n }\n handleScrollAfterNavigation() {\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n try {\n globalThis.scrollTo(0, isPopState ? scrollY : 0);\n } catch (error) {\n logger.warn("scroll handling failed", error);\n }\n this.navigationHandlers.clearPopStateFlag();\n }\n async loadPage(path, updateUI = true) {\n if (this.pageLoader.isCached(path)) {\n logger.debug(`Loading ${path} from cache`);\n const data = this.pageLoader.getCached(path);\n if (data) {\n if (updateUI)\n this.updatePage(data);\n return;\n }\n logger.warn(`Cache entry for ${path} was unexpectedly null, fetching fresh data`);\n }\n this.pageTransition.setLoadingState(true);\n try {\n const data = await this.pageLoader.loadPage(path);\n if (updateUI)\n this.updatePage(data);\n this.currentPath = path;\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n } finally {\n this.pageTransition.setLoadingState(false);\n }\n }\n async prefetch(path) {\n if (this.spaMode) {\n await this.pageLoader.prefetchSpaPageData(path);\n return;\n }\n await this.pageLoader.prefetch(path);\n }\n updatePage(data) {\n if (!this.root)\n return;\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n this.pageTransition.updatePage(data, isPopState, scrollY);\n this.navigationHandlers.clearPopStateFlag();\n }\n destroy() {\n document.removeEventListener("click", this.handleClick);\n globalThis.removeEventListener("popstate", this.handlePopState);\n document.removeEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.disconnect();\n this.pageLoader.clearCache();\n this.navigationHandlers.clear();\n this.pageTransition.destroy();\n }\n};\nif (typeof window !== "undefined" && globalThis.document) {\n const router = new VeryfrontRouter();\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => router.init(), { once: true });\n } else {\n router.init();\n }\n globalThis.veryFrontRouter = router;\n}\nexport {\n VeryfrontRouter\n};\n';
15
15
 
16
16
  export const CLIENT_PREFETCH_BUNDLE: string | undefined =
17
- 'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/browser-logger.ts\nvar ConditionalBrowserLogger = class {\n constructor(prefix, level) {\n this.prefix = prefix;\n this.level = level;\n }\n log(minLevel, fn, message, ...args) {\n if (this.level > minLevel)\n return;\n fn?.(message, ...args);\n }\n debug(message, ...args) {\n this.log(\n 0 /* DEBUG */,\n console.debug,\n `[${this.prefix}] DEBUG: ${message}`,\n ...args\n );\n }\n info(message, ...args) {\n this.log(1 /* INFO */, console.log, `[${this.prefix}] ${message}`, ...args);\n }\n warn(message, ...args) {\n this.log(\n 2 /* WARN */,\n console.warn,\n `[${this.prefix}] WARN: ${message}`,\n ...args\n );\n }\n error(message, ...args) {\n this.log(\n 3 /* ERROR */,\n console.error,\n `[${this.prefix}] ERROR: ${message}`,\n ...args\n );\n }\n};\nfunction getBrowserLogLevel() {\n if (typeof window === "undefined")\n return 2 /* WARN */;\n const g = globalThis;\n const isDevelopment = g.__VERYFRONT_DEV__ || g.__RSC_DEV__;\n if (!isDevelopment)\n return 2 /* WARN */;\n const isDebugEnabled = g.__VERYFRONT_DEBUG__ || g.__RSC_DEBUG__;\n return isDebugEnabled ? 0 /* DEBUG */ : 1 /* INFO */;\n}\nvar defaultLevel = getBrowserLogLevel();\nvar rscLogger = new ConditionalBrowserLogger("RSC", defaultLevel);\nvar prefetchLogger = new ConditionalBrowserLogger("PREFETCH", defaultLevel);\nvar hydrateLogger = new ConditionalBrowserLogger("HYDRATE", defaultLevel);\nvar browserLogger = new ConditionalBrowserLogger("VERYFRONT", defaultLevel);\n\n// src/rendering/client/prefetch/link-observer.ts\nfunction isAnchorElement(element) {\n return typeof HTMLAnchorElement !== "undefined" ? element instanceof HTMLAnchorElement : element.tagName === "A";\n}\nvar LinkObserver = class {\n constructor(options, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "intersectionObserver", null);\n __publicField(this, "mutationObserver", null);\n __publicField(this, "prefetchedUrls");\n __publicField(this, "pendingTimeouts", /* @__PURE__ */ new Map());\n __publicField(this, "elementTimeoutMap", /* @__PURE__ */ new WeakMap());\n __publicField(this, "timeoutCounter", 0);\n this.options = options;\n this.prefetchedUrls = prefetchedUrls;\n }\n init() {\n this.createIntersectionObserver();\n this.observeLinks();\n this.setupMutationObserver();\n }\n createIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => this.handleIntersection(entries),\n { rootMargin: this.options.rootMargin }\n );\n }\n handleIntersection(entries) {\n for (const entry of entries) {\n if (!entry.isIntersecting)\n continue;\n if (!isAnchorElement(entry.target))\n continue;\n const link = entry.target;\n if (this.timeoutCounter > 1e6)\n this.timeoutCounter = 0;\n const timeoutKey = this.timeoutCounter++;\n const timeoutId = setTimeout(() => {\n this.pendingTimeouts.delete(timeoutKey);\n this.elementTimeoutMap.delete(link);\n this.options.onLinkVisible(link);\n }, this.options.delay);\n this.pendingTimeouts.set(timeoutKey, timeoutId);\n this.elementTimeoutMap.set(link, timeoutKey);\n }\n }\n observeLinks() {\n this.observeAnchors(document.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== "childList")\n continue;\n for (const node of mutation.addedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.observeElement(node);\n }\n for (const node of mutation.removedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.clearElementTimeouts(node);\n }\n }\n });\n this.mutationObserver.observe(document.body, { childList: true, subtree: true });\n }\n clearTimeoutForElement(element) {\n const timeoutKey = this.elementTimeoutMap.get(element);\n if (timeoutKey === void 0)\n return;\n const timeoutId = this.pendingTimeouts.get(timeoutKey);\n if (timeoutId !== void 0) {\n clearTimeout(timeoutId);\n this.pendingTimeouts.delete(timeoutKey);\n }\n this.elementTimeoutMap.delete(element);\n }\n clearElementTimeouts(element) {\n if (isAnchorElement(element))\n this.clearTimeoutForElement(element);\n for (const link of element.querySelectorAll("a")) {\n this.clearTimeoutForElement(link);\n }\n }\n observeElement(element) {\n if (isAnchorElement(element) && this.isValidLink(element)) {\n this.intersectionObserver?.observe(element);\n }\n this.observeAnchors(element.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n observeAnchors(links) {\n for (const link of links) {\n if (!isAnchorElement(link))\n continue;\n if (!this.isValidLink(link))\n continue;\n this.intersectionObserver?.observe(link);\n }\n }\n isValidLink(link) {\n if (link.hostname !== globalThis.location.hostname)\n return false;\n if (link.hasAttribute("download"))\n return false;\n if (link.target === "_blank")\n return false;\n const url = link.href;\n if (this.prefetchedUrls.has(url))\n return false;\n if (url === globalThis.location.href)\n return false;\n if (link.hash && link.pathname === globalThis.location.pathname)\n return false;\n if (link.dataset.noPrefetch)\n return false;\n return true;\n }\n destroy() {\n for (const timeoutId of this.pendingTimeouts.values()) {\n clearTimeout(timeoutId);\n }\n this.pendingTimeouts.clear();\n this.timeoutCounter = 0;\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = null;\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n};\n\n// src/rendering/client/prefetch/network-utils.ts\nvar NetworkUtils = class {\n constructor(allowedNetworks = ["4g", "wifi", "ethernet"]) {\n __publicField(this, "networkInfo");\n __publicField(this, "allowedNetworks");\n this.allowedNetworks = allowedNetworks;\n this.networkInfo = this.getNetworkConnection();\n }\n getNavigatorWithConnection() {\n if (typeof globalThis.navigator === "undefined")\n return null;\n return globalThis.navigator;\n }\n getNetworkConnection() {\n const nav = this.getNavigatorWithConnection();\n return nav?.connection ?? nav?.mozConnection ?? nav?.webkitConnection ?? null;\n }\n shouldPrefetch() {\n if (this.networkInfo?.saveData)\n return false;\n const effectiveType = this.networkInfo?.effectiveType;\n if (effectiveType != null && !this.allowedNetworks.includes(effectiveType))\n return false;\n return true;\n }\n onNetworkChange(callback) {\n this.networkInfo?.addEventListener?.("change", callback);\n }\n getNetworkInfo() {\n return this.networkInfo;\n }\n};\n\n// src/rendering/client/prefetch/prefetch-queue.ts\nimport { PREFETCH_QUEUE_MAX_SIZE_BYTES } from "#veryfront/utils/constants/index.ts";\nvar DEFAULT_OPTIONS = {\n maxConcurrent: 4,\n maxSize: PREFETCH_QUEUE_MAX_SIZE_BYTES,\n timeout: 5e3\n};\nfunction isAbortError(error) {\n if (typeof error !== "object" || error === null)\n return false;\n if (!("name" in error))\n return false;\n return error.name === "AbortError";\n}\nvar PrefetchQueue = class {\n constructor(options = {}, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "controllers", /* @__PURE__ */ new Map());\n __publicField(this, "prefetchedUrls");\n __publicField(this, "concurrent", 0);\n __publicField(this, "stopped", false);\n __publicField(this, "onResourcesFetched");\n this.options = { ...DEFAULT_OPTIONS, ...options };\n this.prefetchedUrls = prefetchedUrls ?? /* @__PURE__ */ new Set();\n }\n setResourceCallback(callback) {\n this.onResourcesFetched = callback;\n }\n enqueue(url) {\n void this.prefetch(url);\n }\n has(url) {\n return this.prefetchedUrls.has(url) || this.controllers.has(url);\n }\n get size() {\n return this.controllers.size;\n }\n clear() {\n this.stopAll();\n this.prefetchedUrls.clear();\n }\n start() {\n this.stopped = false;\n }\n stop() {\n this.stopped = true;\n this.stopAll();\n }\n getQueueSize() {\n return this.controllers.size;\n }\n getConcurrentCount() {\n return this.concurrent;\n }\n async prefetchLink(link) {\n if (this.stopped)\n return;\n const url = link.href;\n if (!url || this.controllers.has(url) || this.prefetchedUrls.has(url))\n return;\n if (this.concurrent >= this.options.maxConcurrent) {\n prefetchLogger.debug?.(`Prefetch queue full, skipping ${url}`);\n return;\n }\n let parsedUrl;\n try {\n parsedUrl = new URL(url);\n } catch {\n prefetchLogger.debug?.(`Invalid prefetch URL ${url}`);\n return;\n }\n const controller = new AbortController();\n this.controllers.set(url, controller);\n this.concurrent += 1;\n const timeoutId = this.options.timeout > 0 ? setTimeout(() => controller.abort(), this.options.timeout) : void 0;\n try {\n const response = await fetch(parsedUrl.toString(), {\n method: "GET",\n signal: controller.signal,\n headers: { "X-Veryfront-Prefetch": "1" }\n });\n if (!response.ok)\n return;\n if (this.isResponseTooLarge(response)) {\n prefetchLogger.debug?.(`Prefetch too large, skipping ${url}`);\n return;\n }\n this.prefetchedUrls.add(url);\n if (!this.onResourcesFetched)\n return;\n try {\n await this.onResourcesFetched(response, url);\n } catch (callbackError) {\n prefetchLogger.error?.(`Prefetch callback failed for ${url}`, callbackError);\n }\n } catch (error) {\n if (!isAbortError(error)) {\n prefetchLogger.error?.(`Failed to prefetch ${url}`, error);\n }\n } finally {\n if (timeoutId !== void 0)\n clearTimeout(timeoutId);\n this.controllers.delete(url);\n this.concurrent = Math.max(0, this.concurrent - 1);\n }\n }\n async prefetch(url) {\n const link = typeof document !== "undefined" ? document.createElement("a") : { href: url };\n link.href = url;\n await this.prefetchLink(link);\n }\n stopAll() {\n for (const controller of this.controllers.values()) {\n controller.abort();\n }\n this.controllers.clear();\n this.concurrent = 0;\n }\n isResponseTooLarge(response) {\n const rawLength = response.headers.get("content-length");\n if (rawLength === null)\n return false;\n const size = Number.parseInt(rawLength, 10);\n if (!Number.isFinite(size))\n return false;\n return size > this.options.maxSize;\n }\n};\nvar prefetchQueue = new PrefetchQueue();\n\n// src/rendering/client/prefetch/resource-hints.ts\nvar ResourceHintsManager = class {\n constructor() {\n __publicField(this, "appliedHints", /* @__PURE__ */ new Set());\n }\n applyResourceHints(hints) {\n for (const hint of hints) {\n const key = `${hint.type}:${hint.href}`;\n if (this.appliedHints.has(key))\n continue;\n const existing = document.querySelector(\n `link[rel="${hint.type}"][href="${hint.href}"]`\n );\n if (existing) {\n this.appliedHints.add(key);\n continue;\n }\n this.createAndAppendHint(hint);\n this.appliedHints.add(key);\n prefetchLogger.debug(`Added resource hint: ${hint.type} ${hint.href}`);\n }\n }\n createAndAppendHint(hint) {\n if (!document.head) {\n prefetchLogger.warn("document.head is not available, skipping resource hint");\n return;\n }\n const link = document.createElement("link");\n link.rel = hint.type;\n link.href = hint.href;\n if (hint.as)\n link.setAttribute("as", hint.as);\n if (hint.crossOrigin)\n link.setAttribute("crossorigin", hint.crossOrigin);\n if (hint.media)\n link.setAttribute("media", hint.media);\n document.head.appendChild(link);\n }\n extractResourceHints(html, prefetchedUrls) {\n try {\n const doc = new DOMParser().parseFromString(html, "text/html");\n const hints = [];\n this.extractPreloadLinks(doc, prefetchedUrls, hints);\n this.extractScripts(doc, prefetchedUrls, hints);\n this.extractStylesheets(doc, prefetchedUrls, hints);\n return hints;\n } catch (error) {\n prefetchLogger.error("Failed to parse prefetched page", error);\n return [];\n }\n }\n isValidResourceHintType(rel) {\n switch (rel) {\n case "prefetch":\n case "preload":\n case "preconnect":\n case "dns-prefetch":\n return true;\n default:\n return false;\n }\n }\n extractPreloadLinks(doc, prefetchedUrls, hints) {\n const links = doc.querySelectorAll(\n \'link[rel="preload"], link[rel="prefetch"]\'\n );\n for (const link of links) {\n const href = link.href;\n if (!href)\n continue;\n if (prefetchedUrls.has(href))\n continue;\n if (!this.isValidResourceHintType(link.rel))\n continue;\n hints.push({\n type: link.rel,\n href,\n as: link.getAttribute("as") ?? void 0\n });\n }\n }\n extractScripts(doc, prefetchedUrls, hints) {\n for (const script of doc.querySelectorAll("script[src]")) {\n const src = script.src;\n if (!src || prefetchedUrls.has(src))\n continue;\n hints.push({ type: "prefetch", href: src, as: "script" });\n }\n }\n extractStylesheets(doc, prefetchedUrls, hints) {\n for (const link of doc.querySelectorAll(\'link[rel="stylesheet"]\')) {\n const href = link.href;\n if (!href || prefetchedUrls.has(href))\n continue;\n hints.push({ type: "prefetch", href, as: "style" });\n }\n }\n static generateResourceHints(_route, assets) {\n const hints = [\n \'<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">\',\n \'<link rel="dns-prefetch" href="https://esm.sh">\',\n \'<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>\'\n ];\n for (const asset of assets) {\n if (asset.endsWith(".js")) {\n hints.push(`<link rel="modulepreload" href="${asset}">`);\n continue;\n }\n if (asset.endsWith(".css")) {\n hints.push(`<link rel="preload" as="style" href="${asset}">`);\n continue;\n }\n if (/\\.(woff2?|ttf|otf)$/.test(asset)) {\n hints.push(`<link rel="preload" as="font" href="${asset}" crossorigin>`);\n }\n }\n return hints.join("\\n");\n }\n};\n\n// src/rendering/client/prefetch.ts\nimport {\n PREFETCH_DEFAULT_DELAY_MS,\n PREFETCH_DEFAULT_TIMEOUT_MS,\n PREFETCH_MAX_SIZE_BYTES\n} from "#veryfront/utils";\nvar PrefetchManager = class {\n constructor(options = {}) {\n __publicField(this, "options");\n __publicField(this, "prefetchedUrls", /* @__PURE__ */ new Set());\n __publicField(this, "networkUtils");\n __publicField(this, "linkObserver", null);\n __publicField(this, "resourceHintsManager");\n __publicField(this, "prefetchQueue");\n this.options = {\n rootMargin: options.rootMargin ?? "50px",\n delay: options.delay ?? PREFETCH_DEFAULT_DELAY_MS,\n maxConcurrent: options.maxConcurrent ?? 2,\n allowedNetworks: options.allowedNetworks ?? ["4g", "wifi", "ethernet"],\n maxSize: options.maxSize ?? PREFETCH_MAX_SIZE_BYTES,\n timeout: options.timeout ?? PREFETCH_DEFAULT_TIMEOUT_MS\n };\n this.networkUtils = new NetworkUtils(this.options.allowedNetworks);\n this.resourceHintsManager = new ResourceHintsManager();\n this.prefetchQueue = new PrefetchQueue(\n {\n maxConcurrent: this.options.maxConcurrent,\n maxSize: this.options.maxSize,\n timeout: this.options.timeout\n },\n this.prefetchedUrls\n );\n this.prefetchQueue.setResourceCallback(\n (response, url) => this.prefetchPageResources(response, url)\n );\n }\n init() {\n prefetchLogger.info("Initializing prefetch manager");\n if (!this.networkUtils.shouldPrefetch()) {\n prefetchLogger.info("Prefetching disabled due to network conditions");\n return;\n }\n this.linkObserver = new LinkObserver(\n {\n rootMargin: this.options.rootMargin,\n delay: this.options.delay,\n onLinkVisible: (link) => this.prefetchQueue.prefetchLink(link)\n },\n this.prefetchedUrls\n );\n this.linkObserver.init();\n this.networkUtils.onNetworkChange(() => {\n if (!this.networkUtils.shouldPrefetch())\n this.prefetchQueue.stopAll();\n });\n }\n async prefetchPageResources(response, _pageUrl) {\n const html = await response.text();\n const hints = this.resourceHintsManager.extractResourceHints(html, this.prefetchedUrls);\n this.resourceHintsManager.applyResourceHints(hints);\n }\n applyResourceHints(hints) {\n this.resourceHintsManager.applyResourceHints(hints);\n }\n async prefetch(url) {\n await this.prefetchQueue.prefetch(url);\n }\n static generateResourceHints(route, assets) {\n return ResourceHintsManager.generateResourceHints(route, assets);\n }\n destroy() {\n this.linkObserver?.destroy();\n this.prefetchQueue.stopAll();\n this.prefetchedUrls.clear();\n }\n};\nfunction initPrefetch(options) {\n const prefetchManager = new PrefetchManager(options);\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => prefetchManager.init());\n } else {\n prefetchManager.init();\n }\n globalThis.veryFrontPrefetch = prefetchManager;\n return prefetchManager;\n}\nfunction resolveAutoInitOptions() {\n const setting = globalThis.__VERYFRONT_PREFETCH__;\n if (!setting)\n return null;\n if (setting === true)\n return {};\n if (typeof setting === "object")\n return setting;\n return null;\n}\nfunction shouldAutoInitPrefetch(options) {\n if (!options)\n return false;\n if (typeof window === "undefined" || typeof document === "undefined")\n return false;\n const win = window;\n const doc = document;\n if (win.__veryfrontSSRStub || doc.__veryfrontSSRStub)\n return false;\n if (typeof IntersectionObserver === "undefined")\n return false;\n if (typeof MutationObserver === "undefined")\n return false;\n return true;\n}\nvar autoInitOptions = resolveAutoInitOptions();\nif (shouldAutoInitPrefetch(autoInitOptions))\n initPrefetch(autoInitOptions);\nexport {\n PrefetchManager,\n initPrefetch\n};\n';
17
+ 'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/browser-logger.ts\nvar ConditionalBrowserLogger = class {\n constructor(prefix, level) {\n this.prefix = prefix;\n this.level = level;\n }\n log(minLevel, fn, message, ...args) {\n if (this.level > minLevel)\n return;\n fn?.(message, ...args);\n }\n debug(message, ...args) {\n this.log(\n 0 /* DEBUG */,\n console.debug,\n `[${this.prefix}] DEBUG: ${message}`,\n ...args\n );\n }\n info(message, ...args) {\n this.log(1 /* INFO */, console.log, `[${this.prefix}] ${message}`, ...args);\n }\n warn(message, ...args) {\n this.log(\n 2 /* WARN */,\n console.warn,\n `[${this.prefix}] WARN: ${message}`,\n ...args\n );\n }\n error(message, ...args) {\n this.log(\n 3 /* ERROR */,\n console.error,\n `[${this.prefix}] ERROR: ${message}`,\n ...args\n );\n }\n};\nfunction getBrowserLogLevel() {\n if (typeof window === "undefined")\n return 2 /* WARN */;\n const g = globalThis;\n const isDevelopment = g.__VERYFRONT_DEV__ || g.__RSC_DEV__;\n if (!isDevelopment)\n return 2 /* WARN */;\n const isDebugEnabled = g.__VERYFRONT_DEBUG__ || g.__RSC_DEBUG__;\n return isDebugEnabled ? 0 /* DEBUG */ : 1 /* INFO */;\n}\nvar defaultLevel = getBrowserLogLevel();\nvar rscLogger = new ConditionalBrowserLogger("RSC", defaultLevel);\nvar prefetchLogger = new ConditionalBrowserLogger("PREFETCH", defaultLevel);\nvar hydrateLogger = new ConditionalBrowserLogger("HYDRATE", defaultLevel);\nvar browserLogger = new ConditionalBrowserLogger("VERYFRONT", defaultLevel);\n\n// src/rendering/client/prefetch/link-observer.ts\nfunction isAnchorElement(element) {\n return typeof HTMLAnchorElement !== "undefined" ? element instanceof HTMLAnchorElement : element.tagName === "A";\n}\nvar LinkObserver = class {\n constructor(options, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "intersectionObserver", null);\n __publicField(this, "mutationObserver", null);\n __publicField(this, "prefetchedUrls");\n __publicField(this, "pendingTimeouts", /* @__PURE__ */ new Map());\n __publicField(this, "elementTimeoutMap", /* @__PURE__ */ new WeakMap());\n __publicField(this, "timeoutCounter", 0);\n this.options = options;\n this.prefetchedUrls = prefetchedUrls;\n }\n init() {\n this.createIntersectionObserver();\n this.observeLinks();\n this.setupMutationObserver();\n }\n createIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => this.handleIntersection(entries),\n { rootMargin: this.options.rootMargin }\n );\n }\n handleIntersection(entries) {\n for (const entry of entries) {\n if (!entry.isIntersecting)\n continue;\n if (!isAnchorElement(entry.target))\n continue;\n const link = entry.target;\n if (this.timeoutCounter > 1e6)\n this.timeoutCounter = 0;\n const timeoutKey = this.timeoutCounter++;\n const timeoutId = setTimeout(() => {\n this.pendingTimeouts.delete(timeoutKey);\n this.elementTimeoutMap.delete(link);\n this.options.onLinkVisible(link);\n }, this.options.delay);\n this.pendingTimeouts.set(timeoutKey, timeoutId);\n this.elementTimeoutMap.set(link, timeoutKey);\n }\n }\n observeLinks() {\n this.observeAnchors(document.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== "childList")\n continue;\n for (const node of mutation.addedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.observeElement(node);\n }\n for (const node of mutation.removedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.clearElementTimeouts(node);\n }\n }\n });\n this.mutationObserver.observe(document.body, { childList: true, subtree: true });\n }\n clearTimeoutForElement(element) {\n const timeoutKey = this.elementTimeoutMap.get(element);\n if (timeoutKey === void 0)\n return;\n const timeoutId = this.pendingTimeouts.get(timeoutKey);\n if (timeoutId !== void 0) {\n clearTimeout(timeoutId);\n this.pendingTimeouts.delete(timeoutKey);\n }\n this.elementTimeoutMap.delete(element);\n }\n clearElementTimeouts(element) {\n if (isAnchorElement(element))\n this.clearTimeoutForElement(element);\n for (const link of element.querySelectorAll("a")) {\n this.clearTimeoutForElement(link);\n }\n }\n observeElement(element) {\n if (isAnchorElement(element) && this.isValidLink(element)) {\n this.intersectionObserver?.observe(element);\n }\n this.observeAnchors(element.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n observeAnchors(links) {\n for (const link of links) {\n if (!isAnchorElement(link))\n continue;\n if (!this.isValidLink(link))\n continue;\n this.intersectionObserver?.observe(link);\n }\n }\n isValidLink(link) {\n if (link.hostname !== globalThis.location.hostname)\n return false;\n if (link.hasAttribute("download"))\n return false;\n if (link.target === "_blank")\n return false;\n const url = link.href;\n if (this.prefetchedUrls.has(url))\n return false;\n if (url === globalThis.location.href)\n return false;\n if (link.hash && link.pathname === globalThis.location.pathname)\n return false;\n if (link.dataset.noPrefetch)\n return false;\n return true;\n }\n destroy() {\n for (const timeoutId of this.pendingTimeouts.values()) {\n clearTimeout(timeoutId);\n }\n this.pendingTimeouts.clear();\n this.timeoutCounter = 0;\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = null;\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n};\n\n// src/rendering/client/prefetch/network-utils.ts\nvar NetworkUtils = class {\n constructor(allowedNetworks = ["4g", "wifi", "ethernet"]) {\n __publicField(this, "networkInfo");\n __publicField(this, "allowedNetworks");\n this.allowedNetworks = allowedNetworks;\n this.networkInfo = this.getNetworkConnection();\n }\n getNavigatorWithConnection() {\n if (typeof globalThis.navigator === "undefined")\n return null;\n return globalThis.navigator;\n }\n getNetworkConnection() {\n const nav = this.getNavigatorWithConnection();\n return nav?.connection ?? nav?.mozConnection ?? nav?.webkitConnection ?? null;\n }\n shouldPrefetch() {\n if (this.networkInfo?.saveData)\n return false;\n const effectiveType = this.networkInfo?.effectiveType;\n if (effectiveType != null && !this.allowedNetworks.includes(effectiveType))\n return false;\n return true;\n }\n onNetworkChange(callback) {\n this.networkInfo?.addEventListener?.("change", callback);\n }\n getNetworkInfo() {\n return this.networkInfo;\n }\n};\n\n// src/rendering/client/prefetch/prefetch-queue.ts\nimport { PREFETCH_QUEUE_MAX_SIZE_BYTES } from "#veryfront/utils/constants/index.ts";\nvar DEFAULT_OPTIONS = {\n maxConcurrent: 4,\n maxSize: PREFETCH_QUEUE_MAX_SIZE_BYTES,\n timeout: 5e3\n};\nfunction isAbortError(error) {\n if (typeof error !== "object" || error === null)\n return false;\n if (!("name" in error))\n return false;\n return error.name === "AbortError";\n}\nvar PrefetchQueue = class {\n constructor(options = {}, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "controllers", /* @__PURE__ */ new Map());\n __publicField(this, "prefetchedUrls");\n __publicField(this, "concurrent", 0);\n __publicField(this, "stopped", false);\n __publicField(this, "onResourcesFetched");\n this.options = { ...DEFAULT_OPTIONS, ...options };\n this.prefetchedUrls = prefetchedUrls ?? /* @__PURE__ */ new Set();\n }\n setResourceCallback(callback) {\n this.onResourcesFetched = callback;\n }\n enqueue(url) {\n void this.prefetch(url);\n }\n has(url) {\n return this.prefetchedUrls.has(url) || this.controllers.has(url);\n }\n get size() {\n return this.controllers.size;\n }\n clear() {\n this.stopAll();\n this.prefetchedUrls.clear();\n }\n start() {\n this.stopped = false;\n }\n stop() {\n this.stopped = true;\n this.stopAll();\n }\n getQueueSize() {\n return this.controllers.size;\n }\n getConcurrentCount() {\n return this.concurrent;\n }\n async prefetchLink(link) {\n if (this.stopped)\n return;\n const url = link.href;\n if (!url || this.controllers.has(url) || this.prefetchedUrls.has(url))\n return;\n if (this.concurrent >= this.options.maxConcurrent) {\n prefetchLogger.debug?.(`Prefetch queue full, skipping ${url}`);\n return;\n }\n let parsedUrl;\n try {\n parsedUrl = new URL(url);\n } catch (_) {\n prefetchLogger.debug?.(`Invalid prefetch URL ${url}`);\n return;\n }\n const controller = new AbortController();\n this.controllers.set(url, controller);\n this.concurrent += 1;\n const timeoutId = this.options.timeout > 0 ? setTimeout(() => controller.abort(), this.options.timeout) : void 0;\n try {\n const response = await fetch(parsedUrl.toString(), {\n method: "GET",\n signal: controller.signal,\n headers: { "X-Veryfront-Prefetch": "1" }\n });\n if (!response.ok)\n return;\n if (this.isResponseTooLarge(response)) {\n prefetchLogger.debug?.(`Prefetch too large, skipping ${url}`);\n return;\n }\n this.prefetchedUrls.add(url);\n if (!this.onResourcesFetched)\n return;\n try {\n await this.onResourcesFetched(response, url);\n } catch (callbackError) {\n prefetchLogger.error?.(`Prefetch callback failed for ${url}`, callbackError);\n }\n } catch (error) {\n if (!isAbortError(error)) {\n prefetchLogger.error?.(`Failed to prefetch ${url}`, error);\n }\n } finally {\n if (timeoutId !== void 0)\n clearTimeout(timeoutId);\n this.controllers.delete(url);\n this.concurrent = Math.max(0, this.concurrent - 1);\n }\n }\n async prefetch(url) {\n const link = typeof document !== "undefined" ? document.createElement("a") : { href: url };\n link.href = url;\n await this.prefetchLink(link);\n }\n stopAll() {\n for (const controller of this.controllers.values()) {\n controller.abort();\n }\n this.controllers.clear();\n this.concurrent = 0;\n }\n isResponseTooLarge(response) {\n const rawLength = response.headers.get("content-length");\n if (rawLength === null)\n return false;\n const size = Number.parseInt(rawLength, 10);\n if (!Number.isFinite(size))\n return false;\n return size > this.options.maxSize;\n }\n};\nvar prefetchQueue = new PrefetchQueue();\n\n// src/rendering/client/prefetch/resource-hints.ts\nvar ResourceHintsManager = class {\n constructor() {\n __publicField(this, "appliedHints", /* @__PURE__ */ new Set());\n }\n applyResourceHints(hints) {\n for (const hint of hints) {\n const key = `${hint.type}:${hint.href}`;\n if (this.appliedHints.has(key))\n continue;\n const existing = document.querySelector(\n `link[rel="${hint.type}"][href="${hint.href}"]`\n );\n if (existing) {\n this.appliedHints.add(key);\n continue;\n }\n this.createAndAppendHint(hint);\n this.appliedHints.add(key);\n prefetchLogger.debug(`Added resource hint: ${hint.type} ${hint.href}`);\n }\n }\n createAndAppendHint(hint) {\n if (!document.head) {\n prefetchLogger.warn("document.head is not available, skipping resource hint");\n return;\n }\n const link = document.createElement("link");\n link.rel = hint.type;\n link.href = hint.href;\n if (hint.as)\n link.setAttribute("as", hint.as);\n if (hint.crossOrigin)\n link.setAttribute("crossorigin", hint.crossOrigin);\n if (hint.media)\n link.setAttribute("media", hint.media);\n document.head.appendChild(link);\n }\n extractResourceHints(html, prefetchedUrls) {\n try {\n const doc = new DOMParser().parseFromString(html, "text/html");\n const hints = [];\n this.extractPreloadLinks(doc, prefetchedUrls, hints);\n this.extractScripts(doc, prefetchedUrls, hints);\n this.extractStylesheets(doc, prefetchedUrls, hints);\n return hints;\n } catch (error) {\n prefetchLogger.error("Failed to parse prefetched page", error);\n return [];\n }\n }\n isValidResourceHintType(rel) {\n switch (rel) {\n case "prefetch":\n case "preload":\n case "preconnect":\n case "dns-prefetch":\n return true;\n default:\n return false;\n }\n }\n extractPreloadLinks(doc, prefetchedUrls, hints) {\n const links = doc.querySelectorAll(\n \'link[rel="preload"], link[rel="prefetch"]\'\n );\n for (const link of links) {\n const href = link.href;\n if (!href)\n continue;\n if (prefetchedUrls.has(href))\n continue;\n if (!this.isValidResourceHintType(link.rel))\n continue;\n hints.push({\n type: link.rel,\n href,\n as: link.getAttribute("as") ?? void 0\n });\n }\n }\n extractScripts(doc, prefetchedUrls, hints) {\n for (const script of doc.querySelectorAll("script[src]")) {\n const src = script.src;\n if (!src || prefetchedUrls.has(src))\n continue;\n hints.push({ type: "prefetch", href: src, as: "script" });\n }\n }\n extractStylesheets(doc, prefetchedUrls, hints) {\n for (const link of doc.querySelectorAll(\'link[rel="stylesheet"]\')) {\n const href = link.href;\n if (!href || prefetchedUrls.has(href))\n continue;\n hints.push({ type: "prefetch", href, as: "style" });\n }\n }\n static generateResourceHints(_route, assets) {\n const hints = [\n \'<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">\',\n \'<link rel="dns-prefetch" href="https://esm.sh">\',\n \'<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>\'\n ];\n for (const asset of assets) {\n if (asset.endsWith(".js")) {\n hints.push(`<link rel="modulepreload" href="${asset}">`);\n continue;\n }\n if (asset.endsWith(".css")) {\n hints.push(`<link rel="preload" as="style" href="${asset}">`);\n continue;\n }\n if (/\\.(woff2?|ttf|otf)$/.test(asset)) {\n hints.push(`<link rel="preload" as="font" href="${asset}" crossorigin>`);\n }\n }\n return hints.join("\\n");\n }\n};\n\n// src/rendering/client/prefetch.ts\nimport {\n PREFETCH_DEFAULT_DELAY_MS,\n PREFETCH_DEFAULT_TIMEOUT_MS,\n PREFETCH_MAX_SIZE_BYTES\n} from "#veryfront/utils";\nvar PrefetchManager = class {\n constructor(options = {}) {\n __publicField(this, "options");\n __publicField(this, "prefetchedUrls", /* @__PURE__ */ new Set());\n __publicField(this, "networkUtils");\n __publicField(this, "linkObserver", null);\n __publicField(this, "resourceHintsManager");\n __publicField(this, "prefetchQueue");\n this.options = {\n rootMargin: options.rootMargin ?? "50px",\n delay: options.delay ?? PREFETCH_DEFAULT_DELAY_MS,\n maxConcurrent: options.maxConcurrent ?? 2,\n allowedNetworks: options.allowedNetworks ?? ["4g", "wifi", "ethernet"],\n maxSize: options.maxSize ?? PREFETCH_MAX_SIZE_BYTES,\n timeout: options.timeout ?? PREFETCH_DEFAULT_TIMEOUT_MS\n };\n this.networkUtils = new NetworkUtils(this.options.allowedNetworks);\n this.resourceHintsManager = new ResourceHintsManager();\n this.prefetchQueue = new PrefetchQueue(\n {\n maxConcurrent: this.options.maxConcurrent,\n maxSize: this.options.maxSize,\n timeout: this.options.timeout\n },\n this.prefetchedUrls\n );\n this.prefetchQueue.setResourceCallback(\n (response, url) => this.prefetchPageResources(response, url)\n );\n }\n init() {\n prefetchLogger.info("Initializing prefetch manager");\n if (!this.networkUtils.shouldPrefetch()) {\n prefetchLogger.info("Prefetching disabled due to network conditions");\n return;\n }\n this.linkObserver = new LinkObserver(\n {\n rootMargin: this.options.rootMargin,\n delay: this.options.delay,\n onLinkVisible: (link) => this.prefetchQueue.prefetchLink(link)\n },\n this.prefetchedUrls\n );\n this.linkObserver.init();\n this.networkUtils.onNetworkChange(() => {\n if (!this.networkUtils.shouldPrefetch())\n this.prefetchQueue.stopAll();\n });\n }\n async prefetchPageResources(response, _pageUrl) {\n const html = await response.text();\n const hints = this.resourceHintsManager.extractResourceHints(html, this.prefetchedUrls);\n this.resourceHintsManager.applyResourceHints(hints);\n }\n applyResourceHints(hints) {\n this.resourceHintsManager.applyResourceHints(hints);\n }\n async prefetch(url) {\n await this.prefetchQueue.prefetch(url);\n }\n static generateResourceHints(route, assets) {\n return ResourceHintsManager.generateResourceHints(route, assets);\n }\n destroy() {\n this.linkObserver?.destroy();\n this.prefetchQueue.stopAll();\n this.prefetchedUrls.clear();\n }\n};\nfunction initPrefetch(options) {\n const prefetchManager = new PrefetchManager(options);\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => prefetchManager.init(), { once: true });\n } else {\n prefetchManager.init();\n }\n globalThis.veryFrontPrefetch = prefetchManager;\n return prefetchManager;\n}\nfunction resolveAutoInitOptions() {\n const setting = globalThis.__VERYFRONT_PREFETCH__;\n if (!setting)\n return null;\n if (setting === true)\n return {};\n if (typeof setting === "object")\n return setting;\n return null;\n}\nfunction shouldAutoInitPrefetch(options) {\n if (!options)\n return false;\n if (typeof window === "undefined" || typeof document === "undefined")\n return false;\n const win = window;\n const doc = document;\n if (win.__veryfrontSSRStub || doc.__veryfrontSSRStub)\n return false;\n if (typeof IntersectionObserver === "undefined")\n return false;\n if (typeof MutationObserver === "undefined")\n return false;\n return true;\n}\nvar autoInitOptions = resolveAutoInitOptions();\nif (shouldAutoInitPrefetch(autoInitOptions))\n initPrefetch(autoInitOptions);\nexport {\n PrefetchManager,\n initPrefetch\n};\n';
@@ -6,9 +6,16 @@ import { tryGetCacheKeyContext } from "../cache-key-builder.js";
6
6
  import { CircuitBreakerOpen, getCircuitBreaker } from "../../utils/circuit-breaker.js";
7
7
  import type { CacheBackend } from "../types.js";
8
8
  import { getEnvValue } from "./helpers.js";
9
+ import { REQUEST_ERROR } from "../../errors/index.js";
9
10
 
10
11
  const logger = baseLogger.component("api-cache-backend");
11
12
 
13
+ const DEFAULT_TIMEOUT_MS = 10_000;
14
+ const CIRCUIT_BREAKER_RESET_TIMEOUT_MS = 15_000;
15
+ const CIRCUIT_BREAKER_FAILURE_THRESHOLD = 10;
16
+ const CIRCUIT_BREAKER_SUCCESS_THRESHOLD = 2;
17
+ const ERROR_BODY_MAX_LENGTH = 500;
18
+
12
19
  type CacheRequestContext = {
13
20
  token?: string;
14
21
  projectId?: string;
@@ -41,13 +48,13 @@ export class ApiCacheBackend implements CacheBackend {
41
48
  getEnvValue("VERYFRONT_API_BASE_URL") ??
42
49
  "https://api.veryfront.com";
43
50
  this.keyPrefix = options.keyPrefix ?? "";
44
- this.timeoutMs = options.timeoutMs ?? 10000;
51
+ this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
45
52
 
46
53
  const breakerName = options.circuitBreakerName ?? "api-cache";
47
54
  this.circuitBreaker = getCircuitBreaker(breakerName, {
48
- failureThreshold: 10,
49
- resetTimeoutMs: 15000,
50
- successThreshold: 2,
55
+ failureThreshold: CIRCUIT_BREAKER_FAILURE_THRESHOLD,
56
+ resetTimeoutMs: CIRCUIT_BREAKER_RESET_TIMEOUT_MS,
57
+ successThreshold: CIRCUIT_BREAKER_SUCCESS_THRESHOLD,
51
58
  });
52
59
  }
53
60
 
@@ -114,7 +121,9 @@ export class ApiCacheBackend implements CacheBackend {
114
121
  error: bodyError instanceof Error ? bodyError.message : String(bodyError),
115
122
  });
116
123
  }
117
- throw new Error(`HTTP ${response.status}: ${responseBody.slice(0, 500)}`);
124
+ throw REQUEST_ERROR.create({
125
+ detail: `HTTP ${response.status}: ${responseBody.slice(0, ERROR_BODY_MAX_LENGTH)}`,
126
+ });
118
127
  }
119
128
 
120
129
  return (await response.json()) as T;
@@ -4,6 +4,7 @@ import { logger } from "../../utils/index.js";
4
4
  import type { CacheBackend } from "../types.js";
5
5
 
6
6
  const CACHE_SUBDIR = "veryfront-files";
7
+ const MAX_REGEX_CACHE_SIZE = 100;
7
8
  const fsPromises = import("node:fs/promises");
8
9
 
9
10
  interface DiskCacheEnvelope {
@@ -110,7 +111,7 @@ export class DiskCacheBackend implements CacheBackend {
110
111
  if (!regex) {
111
112
  const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&");
112
113
  regex = new RegExp(`^${escaped.replace(/\*/g, ".*").replace(/\?/g, ".")}$`);
113
- if (this.regexCache.size >= 100) {
114
+ if (this.regexCache.size >= MAX_REGEX_CACHE_SIZE) {
114
115
  const firstKey = this.regexCache.keys().next().value as string | undefined;
115
116
  if (firstKey) this.regexCache.delete(firstKey);
116
117
  }
@@ -17,6 +17,8 @@ import { getEnvValue } from "./helpers.js";
17
17
 
18
18
  const logger = baseLogger.component("cache-backend");
19
19
 
20
+ const DEFAULT_MEMORY_MAX_ENTRIES = 500;
21
+
20
22
  // Re-export gateway types for backward compatibility
21
23
  export type { CodeCacheGateway, TokenizingCacheGateway };
22
24
 
@@ -47,7 +49,7 @@ export function isDiskCacheConfigured(): boolean {
47
49
  export function createCacheBackend(config: CacheBackendConfig = {}): Promise<CacheBackend> {
48
50
  const {
49
51
  keyPrefix = "",
50
- memoryMaxEntries = 500,
52
+ memoryMaxEntries = DEFAULT_MEMORY_MAX_ENTRIES,
51
53
  preferredBackend,
52
54
  apiBaseUrl,
53
55
  circuitBreakerName,
@@ -4,6 +4,9 @@ import {
4
4
  } from "../../utils/constants/cache.js";
5
5
  import type { CacheBackend } from "../types.js";
6
6
 
7
+ const DEFAULT_TTL_SECONDS = 300;
8
+ const MAX_REGEX_CACHE_SIZE = 100;
9
+
7
10
  export class MemoryCacheBackend implements CacheBackend {
8
11
  readonly type = "memory" as const;
9
12
  private store = new Map<string, { value: string; expiresAt: number; sizeBytes: number }>();
@@ -66,7 +69,7 @@ export class MemoryCacheBackend implements CacheBackend {
66
69
  return Promise.resolve(results);
67
70
  }
68
71
 
69
- set(key: string, value: string, ttlSeconds = 300): Promise<void> {
72
+ set(key: string, value: string, ttlSeconds = DEFAULT_TTL_SECONDS): Promise<void> {
70
73
  const entrySize = this.estimateSize(key, value);
71
74
 
72
75
  // Reject single entries that exceed the byte limit on their own
@@ -120,7 +123,7 @@ export class MemoryCacheBackend implements CacheBackend {
120
123
  this.currentSizeBytes += entrySize;
121
124
  this.store.set(key, {
122
125
  value,
123
- expiresAt: now + (ttl ?? 300) * 1000,
126
+ expiresAt: now + (ttl ?? DEFAULT_TTL_SECONDS) * 1000,
124
127
  sizeBytes: entrySize,
125
128
  });
126
129
  }
@@ -141,7 +144,7 @@ export class MemoryCacheBackend implements CacheBackend {
141
144
  const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&");
142
145
  regex = new RegExp(`^${escaped.replace(/\*/g, ".*").replace(/\?/g, ".")}$`);
143
146
 
144
- if (this.regexCache.size >= 100) {
147
+ if (this.regexCache.size >= MAX_REGEX_CACHE_SIZE) {
145
148
  const firstKey = this.regexCache.keys().next().value as string | undefined;
146
149
  if (firstKey) this.regexCache.delete(firstKey);
147
150
  }
@@ -3,6 +3,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import type { HandlerContext } from "../types/index.js";
4
4
  import { type CacheKeyContext, CacheKeyContextSchema } from "./schemas/index.js";
5
5
  import { buildContentHashCacheKey } from "./keys.js";
6
+ import { CACHE_INVARIANT_VIOLATION } from "../errors/index.js";
6
7
 
7
8
  type MultiProjectRequestContextType = {
8
9
  projectSlug: string;
@@ -41,10 +42,10 @@ export function getCurrentCacheKeyContext(): CacheKeyContext {
41
42
  const ctx = cacheKeyContextStorage.getStore();
42
43
  if (ctx) return ctx;
43
44
 
44
- throw new Error(
45
- "[CacheKeyBuilder] No cache context available. " +
45
+ throw CACHE_INVARIANT_VIOLATION.create({
46
+ detail: "[CacheKeyBuilder] No cache context available. " +
46
47
  "Ensure runWithCacheKeyContext() was called at request entry.",
47
- );
48
+ });
48
49
  }
49
50
 
50
51
  function getRequestContextFn(): (() => MultiProjectRequestContextType | null) | null {
@@ -55,7 +56,8 @@ function getRequestContextFn(): (() => MultiProjectRequestContextType | null) |
55
56
  | { getCurrentRequestContext?: () => MultiProjectRequestContextType | null }
56
57
  | undefined;
57
58
  _getCurrentRequestContext = mod?.getCurrentRequestContext ?? null;
58
- } catch {
59
+ } catch (_) {
60
+ // expected: multi-project adapter may not be available
59
61
  _getCurrentRequestContext = null;
60
62
  }
61
63
 
@@ -16,7 +16,7 @@ import {
16
16
  /**
17
17
  * Configuration that affects transform output.
18
18
  */
19
- export interface TransformConfig {
19
+ interface TransformConfig {
20
20
  /** React version for esm.sh URLs */
21
21
  reactVersion?: string;
22
22
  /** JSX import source */
@@ -201,7 +201,8 @@ async function buildDependencyGraph(
201
201
  buildDependencyGraph(dep, graph, contentHashes, getContent, projectDir, visited)
202
202
  ),
203
203
  );
204
- } catch {
204
+ } catch (_) {
205
+ // expected: file may not exist or imports may fail to parse
205
206
  graph.addModule(filePath, []);
206
207
  }
207
208
  }
@@ -10,7 +10,7 @@ import { isApiCacheAvailable, isDiskCacheConfigured } from "./backend.js";
10
10
 
11
11
  const logger = baseLogger.component("distributed-cache");
12
12
 
13
- export interface DistributedCacheStatus {
13
+ interface DistributedCacheStatus {
14
14
  backend: "api" | "redis" | "disk" | "memory";
15
15
  transformCache: boolean;
16
16
  ssrModuleCache: boolean;
@@ -10,6 +10,7 @@
10
10
  import { VERSION } from "../../../utils/version.js";
11
11
  import { CacheKeyPrefix, type FileOperationContext } from "../prefixes.js";
12
12
  import { hashPathWithName } from "../utils.js";
13
+ import { CACHE_INVARIANT_VIOLATION } from "../../../errors/index.js";
13
14
 
14
15
  function getSourceTypeKey(sourceType: "branch" | "release" | "environment"): string {
15
16
  return sourceType === "environment" ? "env" : sourceType;
@@ -19,9 +20,9 @@ function buildSourceQualifier(ctx: FileOperationContext): string {
19
20
  if (ctx.sourceType === "branch") return ctx.branch ?? "main";
20
21
 
21
22
  if (!ctx.releaseId) {
22
- throw new Error(
23
- `Missing releaseId for ${ctx.sourceType} sourceType (project: ${ctx.projectSlug})`,
24
- );
23
+ throw CACHE_INVARIANT_VIOLATION.create({
24
+ detail: `Missing releaseId for ${ctx.sourceType} sourceType (project: ${ctx.projectSlug})`,
25
+ });
25
26
  }
26
27
 
27
28
  if (ctx.sourceType === "release") return ctx.releaseId;
@@ -11,6 +11,7 @@ import { VERSION } from "../../../utils/version.js";
11
11
  import { CacheKeyPrefix } from "../prefixes.js";
12
12
  import type { QueryParamCacheOptions } from "../prefixes.js";
13
13
  import { sanitizeQueryParamsForCacheKey } from "../utils.js";
14
+ import { CACHE_INVARIANT_VIOLATION } from "../../../errors/index.js";
14
15
 
15
16
  export function buildRenderCachePrefix(
16
17
  projectId: string,
@@ -45,7 +46,9 @@ export function computeContentSourceId(
45
46
 
46
47
  if (environment === "production") {
47
48
  if (!releaseId) {
48
- throw new Error("Missing releaseId for production contentSourceId");
49
+ throw CACHE_INVARIANT_VIOLATION.create({
50
+ detail: "Missing releaseId for production contentSourceId",
51
+ });
49
52
  }
50
53
  return `release-${releaseId}`;
51
54
  }
@@ -92,7 +95,9 @@ export function buildProxyManagerCacheKey(
92
95
 
93
96
  if (productionMode) {
94
97
  if (!releaseId) {
95
- throw new Error(`Missing releaseId in production for ${projectSlug}`);
98
+ throw CACHE_INVARIANT_VIOLATION.create({
99
+ detail: `Missing releaseId in production for ${projectSlug}`,
100
+ });
96
101
  }
97
102
  return `${CacheKeyPrefix.PROXY}:${projectSlug}:${mode}:${releaseId}`;
98
103
  }
@@ -6,6 +6,9 @@ import type { Span } from "@opentelemetry/api";
6
6
 
7
7
  const logger = rendererLogger.component("cache-registry");
8
8
 
9
+ const DEFAULT_REDIS_SCAN_LIMIT = 1_000;
10
+ const REDIS_SCAN_BATCH_COUNT = 100;
11
+
9
12
  export interface CacheStore {
10
13
  readonly name: string;
11
14
  get(key: string): unknown;
@@ -207,7 +210,7 @@ class CacheRegistry {
207
210
  this.stores.clear();
208
211
  }
209
212
 
210
- scanRedisKeys(pattern: string, limit = 1000): Promise<string[]> {
213
+ scanRedisKeys(pattern: string, limit = DEFAULT_REDIS_SCAN_LIMIT): Promise<string[]> {
211
214
  if (!isRedisConfigured()) return Promise.resolve([]);
212
215
 
213
216
  return withSpan(
@@ -219,7 +222,10 @@ class CacheRegistry {
219
222
  let cursor = 0;
220
223
 
221
224
  do {
222
- const result = await client.scan(cursor, { MATCH: pattern, COUNT: 100 });
225
+ const result = await client.scan(cursor, {
226
+ MATCH: pattern,
227
+ COUNT: REDIS_SCAN_BATCH_COUNT,
228
+ });
223
229
  cursor = typeof result.cursor === "string"
224
230
  ? parseInt(result.cursor, 10)
225
231
  : result.cursor;
@@ -75,6 +75,11 @@ export interface EnvironmentConfig {
75
75
  veryfrontVersion: string | undefined;
76
76
  }
77
77
 
78
+ /** Default timeout for incoming HTTP requests (used when REQUEST_TIMEOUT_MS is set but unparseable) */
79
+ const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
80
+ /** Default timeout for outgoing HTTP fetch calls (used when VF_HTTP_FETCH_TIMEOUT is set but unparseable) */
81
+ const DEFAULT_HTTP_FETCH_TIMEOUT_MS = 30_000;
82
+
78
83
  const DEFAULTS = {
79
84
  apiBaseUrl: "https://api.veryfront.com",
80
85
  port: 3001,
@@ -142,8 +147,12 @@ function readEnvSnapshot(): EnvironmentConfig {
142
147
  appUrl: getEnv("APP_URL") || getEnv("NEXT_PUBLIC_APP_URL") || undefined,
143
148
 
144
149
  port: parseNumber(getEnv("PORT"), DEFAULTS.port),
145
- requestTimeoutMs: requestTimeoutRaw ? parseNumber(requestTimeoutRaw, 30000) : undefined,
146
- httpFetchTimeoutMs: httpFetchTimeoutRaw ? parseNumber(httpFetchTimeoutRaw, 30000) : undefined,
150
+ requestTimeoutMs: requestTimeoutRaw
151
+ ? parseNumber(requestTimeoutRaw, DEFAULT_REQUEST_TIMEOUT_MS)
152
+ : undefined,
153
+ httpFetchTimeoutMs: httpFetchTimeoutRaw
154
+ ? parseNumber(httpFetchTimeoutRaw, DEFAULT_HTTP_FETCH_TIMEOUT_MS)
155
+ : undefined,
147
156
  ssrMaxConcurrentTransforms: parseNumber(
148
157
  getEnv("SSR_MAX_CONCURRENT_TRANSFORMS"),
149
158
  DEFAULTS.ssrMaxConcurrentTransforms,
@@ -22,6 +22,19 @@ import { registerLRUCache } from "../cache/registry.js";
22
22
 
23
23
  const logger = serverLogger.component("config");
24
24
 
25
+ /** Cache TTL for veryfront-api filesystem in proxy mode */
26
+ const DEFAULT_FS_CACHE_TTL_MS = 60_000;
27
+ /** Maximum retry attempts for veryfront-api filesystem requests */
28
+ const DEFAULT_FS_MAX_RETRIES = 3;
29
+ /** Initial backoff delay between retries */
30
+ const DEFAULT_FS_INITIAL_DELAY_MS = 500;
31
+ /** Maximum backoff delay between retries */
32
+ const DEFAULT_FS_MAX_DELAY_MS = 5_000;
33
+ /** Maximum entries in the render cache */
34
+ const DEFAULT_RENDER_CACHE_MAX_ENTRIES = 500;
35
+ /** Maximum entries in the per-project config cache */
36
+ const DEFAULT_CONFIG_CACHE_MAX_ENTRIES = 100;
37
+
25
38
  export type { VeryfrontConfig } from "./schemas/index.js";
26
39
 
27
40
  /**
@@ -58,8 +71,12 @@ function getDefaultFsConfig(): VeryfrontConfig["fs"] {
58
71
  veryfront: {
59
72
  apiBaseUrl,
60
73
  proxyMode: true,
61
- cache: { enabled: true, ttl: 60000 },
62
- retry: { maxRetries: 3, initialDelay: 500, maxDelay: 5000 },
74
+ cache: { enabled: true, ttl: DEFAULT_FS_CACHE_TTL_MS },
75
+ retry: {
76
+ maxRetries: DEFAULT_FS_MAX_RETRIES,
77
+ initialDelay: DEFAULT_FS_INITIAL_DELAY_MS,
78
+ maxDelay: DEFAULT_FS_MAX_DELAY_MS,
79
+ },
63
80
  },
64
81
  };
65
82
  }
@@ -104,7 +121,7 @@ function createFreshDefaults(): Partial<VeryfrontConfig> {
104
121
  render: {
105
122
  type: "memory",
106
123
  ttl: undefined,
107
- maxEntries: 500,
124
+ maxEntries: DEFAULT_RENDER_CACHE_MAX_ENTRIES,
108
125
  kvPath: undefined,
109
126
  redisUrl: undefined,
110
127
  redisKeyPrefix: undefined,
@@ -130,7 +147,7 @@ function createFreshDefaults(): Partial<VeryfrontConfig> {
130
147
  }
131
148
 
132
149
  const configCacheByProject = new LRUCache<string, { revision: number; config: VeryfrontConfig }>({
133
- maxEntries: 100,
150
+ maxEntries: DEFAULT_CONFIG_CACHE_MAX_ENTRIES,
134
151
  });
135
152
 
136
153
  // Register cache for monitoring
@@ -11,6 +11,9 @@ import type { VeryfrontConfig } from "./schemas/index.js";
11
11
  import type { EnvironmentConfig } from "./environment-config.js";
12
12
  import { createTestEnvironmentConfig, getEnvironmentConfig } from "./environment-config.js";
13
13
 
14
+ /** Maximum entries in the default render cache */
15
+ const DEFAULT_RENDER_CACHE_MAX_ENTRIES = 500;
16
+
14
17
  /**
15
18
  * Runtime-specific configuration derived from environment.
16
19
  */
@@ -70,7 +73,7 @@ export const DEFAULT_CONFIG: Partial<VeryfrontConfig> = {
70
73
  dir: ".veryfront",
71
74
  render: {
72
75
  type: "memory",
73
- maxEntries: 500,
76
+ maxEntries: DEFAULT_RENDER_CACHE_MAX_ENTRIES,
74
77
  },
75
78
  },
76
79
  dev: {
@@ -12,8 +12,7 @@ export class DataFetcher {
12
12
  private staticFetcher: StaticDataFetcher;
13
13
  private pathsFetcher: StaticPathsFetcher;
14
14
 
15
- // deno-lint-ignore no-unused-vars -- adapter kept for public API compatibility
16
- constructor(adapter?: unknown) {
15
+ constructor(_adapter?: unknown) {
17
16
  this.cacheManager = new CacheManager();
18
17
  this.serverFetcher = new ServerDataFetcher();
19
18
  this.staticFetcher = new StaticDataFetcher(this.cacheManager);
@@ -258,8 +258,8 @@ export class StaticDataFetcher {
258
258
  });
259
259
  }
260
260
  });
261
- } catch {
262
- // Semaphore timeout - too many concurrent revalidations, skip this one
261
+ } catch (_) {
262
+ // expected: semaphore timeout when too many concurrent revalidations
263
263
  serverLogger.warn("DATA_REVALIDATION_SKIPPED semaphore timeout", {
264
264
  pathname,
265
265
  cacheKey,
@@ -50,7 +50,8 @@ export async function findTypeScriptFiles(
50
50
  files.push(...(await findTypeScriptFiles(filePath, context)));
51
51
  }
52
52
  }
53
- } catch {
53
+ } catch (_) {
54
+ /* expected: directory may not exist or be unreadable */
54
55
  return files;
55
56
  }
56
57
 
@@ -62,7 +63,7 @@ export async function findTypeScriptFiles(
62
63
  *
63
64
  * Only called when no fsAdapter is present — callers must guard accordingly.
64
65
  */
65
- export async function getNodeDeps(
66
+ async function getNodeDeps(
66
67
  context: FileDiscoveryContext,
67
68
  ): Promise<{ fs: typeof import("node:fs"); path: typeof import("node:path") }> {
68
69
  if (context.nodeDeps) return context.nodeDeps;
@@ -17,12 +17,12 @@ import type { FileDiscoveryContext } from "../types.js";
17
17
 
18
18
  const logger = agentLogger.component("skill-discovery");
19
19
 
20
- export interface SkillDiscoveryError {
20
+ interface SkillDiscoveryError {
21
21
  file: string;
22
22
  error: Error;
23
23
  }
24
24
 
25
- export interface SkillDiscoveryResult {
25
+ interface SkillDiscoveryResult {
26
26
  skills: Map<string, Skill>;
27
27
  errors: SkillDiscoveryError[];
28
28
  }
@@ -114,7 +114,8 @@ export async function rewriteDiscoveryImports(
114
114
  "index.js";
115
115
 
116
116
  return pathToFileURL(pathHelper.join(packagePath, entryPoint)).href;
117
- } catch {
117
+ } catch (_) {
118
+ /* expected: package.json not found at this level, walk up */
118
119
  const parent = pathHelper.dirname(searchDir);
119
120
  if (parent === searchDir) break;
120
121
  searchDir = parent;
@@ -164,7 +165,8 @@ export async function rewriteDiscoveryImports(
164
165
  const vfPackageJsonPath = pathHelper.join(vfPackagePath, "package.json");
165
166
  const pkgJson = JSON.parse(await fs.readTextFile(vfPackageJsonPath));
166
167
  exportsMap = pkgJson.exports || {};
167
- } catch {
168
+ } catch (_) {
169
+ /* expected: veryfront package.json not found, fallback to deno.json search */
168
170
  // Search for deno.json in parent directories
169
171
  let searchDir = projectDir;
170
172
 
@@ -177,8 +179,8 @@ export async function rewriteDiscoveryImports(
177
179
  vfPackagePath = searchDir;
178
180
  break;
179
181
  }
180
- } catch {
181
- // continue searching
182
+ } catch (_) {
183
+ /* expected: deno.json not found at this level */
182
184
  }
183
185
  searchDir = pathHelper.dirname(searchDir);
184
186
  }
@@ -211,7 +213,8 @@ export async function rewriteDiscoveryImports(
211
213
  const resolvedPath = pathHelper.join(vfPackagePath, exportPath);
212
214
  return `from "${pathToFileURL(resolvedPath).href}"`;
213
215
  });
214
- } catch {
216
+ } catch (_) {
217
+ /* expected: Node.js URL module unavailable in non-Node runtime */
215
218
  return transformed;
216
219
  }
217
220
 
@@ -15,6 +15,7 @@ import { getEsbuildLoader } from "../utils/path-utils.js";
15
15
  import type { FileSystemAdapter } from "../platform/adapters/base.js";
16
16
  import type { FileDiscoveryContext } from "./types.js";
17
17
  import { rewriteDiscoveryImports, rewriteForDeno } from "./import-rewriter.js";
18
+ import { COMPILATION_ERROR, FILE_NOT_FOUND } from "../errors/index.js";
18
19
  import { wrapWithCurrentContext } from "../platform/adapters/fs/veryfront/multi-project-adapter.js";
19
20
  // Static import ensures deno compile includes embedding in the binary.
20
21
  // Other modules (agent, tool, etc.) are statically imported elsewhere;
@@ -159,7 +160,10 @@ export async function importModule(
159
160
  ? await context.fsAdapter.readFile(filePath)
160
161
  : await createFileSystem().readTextFile(filePath);
161
162
  } catch (error) {
162
- throw new Error(`Failed to read file ${filePath}: ${error}`);
163
+ throw FILE_NOT_FOUND.create({
164
+ detail: `Failed to read file ${filePath}: ${error}`,
165
+ cause: error,
166
+ });
163
167
  }
164
168
 
165
169
  const loader = getEsbuildLoader(filePath);
@@ -208,9 +212,9 @@ export async function importModule(
208
212
  });
209
213
 
210
214
  if (result.errors.length > 0) {
211
- throw new Error(
212
- `Failed to transpile ${filePath}: ${result.errors[0]?.text ?? "unknown error"}`,
213
- );
215
+ throw COMPILATION_ERROR.create({
216
+ detail: `Failed to transpile ${filePath}: ${result.errors[0]?.text ?? "unknown error"}`,
217
+ });
214
218
  }
215
219
 
216
220
  const js = result.outputFiles?.[0]?.text ?? "export {}";