veryfront 0.1.48 → 0.1.49

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 (524) hide show
  1. package/esm/cli/app/components/inline-input.d.ts +1 -4
  2. package/esm/cli/app/components/inline-input.d.ts.map +1 -1
  3. package/esm/cli/app/components/inline-input.js +1 -1
  4. package/esm/cli/app/components/list-select.d.ts +0 -8
  5. package/esm/cli/app/components/list-select.d.ts.map +1 -1
  6. package/esm/cli/app/components/list-select.js +0 -13
  7. package/esm/cli/app/operations/project-creation.d.ts +2 -14
  8. package/esm/cli/app/operations/project-creation.d.ts.map +1 -1
  9. package/esm/cli/app/operations/project-creation.js +3 -68
  10. package/esm/cli/app/shell.js +1 -1
  11. package/esm/cli/app/utils.d.ts +1 -2
  12. package/esm/cli/app/utils.d.ts.map +1 -1
  13. package/esm/cli/app/utils.js +1 -17
  14. package/esm/cli/app/views/dashboard.d.ts +0 -4
  15. package/esm/cli/app/views/dashboard.d.ts.map +1 -1
  16. package/esm/cli/app/views/dashboard.js +0 -15
  17. package/esm/cli/app/views/startup.d.ts +0 -4
  18. package/esm/cli/app/views/startup.d.ts.map +1 -1
  19. package/esm/cli/app/views/startup.js +0 -7
  20. package/esm/cli/auth/login.d.ts.map +1 -1
  21. package/esm/cli/auth/login.js +1 -2
  22. package/esm/cli/auth/token-store.js +1 -1
  23. package/esm/cli/auth/utils.d.ts +2 -1
  24. package/esm/cli/auth/utils.d.ts.map +1 -1
  25. package/esm/cli/commands/generate/integration-generator.js +1 -1
  26. package/esm/cli/commands/install/types.d.ts +2 -2
  27. package/esm/cli/help/formatters.d.ts +1 -1
  28. package/esm/cli/help/formatters.d.ts.map +1 -1
  29. package/esm/cli/help/formatters.js +8 -4
  30. package/esm/cli/help/main-help.d.ts.map +1 -1
  31. package/esm/cli/help/main-help.js +2 -2
  32. package/esm/cli/mcp/server.d.ts +0 -1
  33. package/esm/cli/mcp/server.d.ts.map +1 -1
  34. package/esm/cli/mcp/server.js +2 -5
  35. package/esm/cli/mcp/tools/dev-tools.d.ts +1 -1
  36. package/esm/cli/mcp/tools/dev-tools.d.ts.map +1 -1
  37. package/esm/cli/mcp/tools/dev-tools.js +1 -2
  38. package/esm/cli/mcp/tools/scaffold-tools.d.ts +2 -2
  39. package/esm/cli/mcp/tools.d.ts +1 -2
  40. package/esm/cli/mcp/tools.d.ts.map +1 -1
  41. package/esm/cli/mcp/tools.js +1 -2
  42. package/esm/cli/shared/reserve-slug.d.ts.map +1 -1
  43. package/esm/cli/shared/reserve-slug.js +1 -3
  44. package/esm/cli/sync/ignore.d.ts +1 -1
  45. package/esm/cli/sync/ignore.d.ts.map +1 -1
  46. package/esm/cli/sync/ignore.js +22 -18
  47. package/esm/cli/ui/colors.d.ts +0 -1
  48. package/esm/cli/ui/colors.d.ts.map +1 -1
  49. package/esm/cli/ui/colors.js +0 -10
  50. package/esm/cli/ui/dot-matrix.d.ts.map +1 -1
  51. package/esm/cli/ui/dot-matrix.js +2 -5
  52. package/esm/cli/ui/tui.js +2 -3
  53. package/esm/cli/utils/index.js +1 -2
  54. package/esm/cli/utils/package-manager.d.ts.map +1 -1
  55. package/esm/cli/utils/package-manager.js +3 -4
  56. package/esm/deno.d.ts +3 -0
  57. package/esm/deno.js +22 -19
  58. package/esm/src/agent/chat-handler.d.ts.map +1 -1
  59. package/esm/src/agent/chat-handler.js +8 -23
  60. package/esm/src/agent/factory.d.ts +0 -8
  61. package/esm/src/agent/factory.d.ts.map +1 -1
  62. package/esm/src/agent/factory.js +50 -1
  63. package/esm/src/agent/index.d.ts +16 -1
  64. package/esm/src/agent/index.d.ts.map +1 -1
  65. package/esm/src/agent/index.js +16 -1
  66. package/esm/src/agent/memory/memory.d.ts +2 -2
  67. package/esm/src/agent/memory/memory.d.ts.map +1 -1
  68. package/esm/src/agent/memory/memory.js +0 -1
  69. package/esm/src/agent/react/use-chat/types.d.ts +2 -0
  70. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  71. package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
  72. package/esm/src/agent/react/use-chat/use-chat.js +15 -9
  73. package/esm/src/agent/runtime/index.d.ts +18 -0
  74. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  75. package/esm/src/agent/runtime/index.js +167 -36
  76. package/esm/src/agent/runtime/tool-helpers.d.ts +6 -1
  77. package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
  78. package/esm/src/agent/runtime/tool-helpers.js +10 -1
  79. package/esm/src/agent/schemas/agent.schema.d.ts +4 -4
  80. package/esm/src/agent/types.d.ts +10 -0
  81. package/esm/src/agent/types.d.ts.map +1 -1
  82. package/esm/src/ai/registry-manager.d.ts.map +1 -1
  83. package/esm/src/ai/registry-manager.js +2 -1
  84. package/esm/src/build/bundler/code-splitter/manifest-builder.d.ts +0 -2
  85. package/esm/src/build/bundler/code-splitter/manifest-builder.d.ts.map +1 -1
  86. package/esm/src/build/bundler/code-splitter/manifest-builder.js +1 -1
  87. package/esm/src/build/compiler/mdx-compiler/validator.d.ts.map +1 -1
  88. package/esm/src/build/compiler/mdx-compiler/validator.js +2 -3
  89. package/esm/src/build/compiler/mdx-to-js.d.ts +0 -2
  90. package/esm/src/build/compiler/mdx-to-js.d.ts.map +1 -1
  91. package/esm/src/build/compiler/mdx-to-js.js +0 -81
  92. package/esm/src/build/index.d.ts +0 -6
  93. package/esm/src/build/index.d.ts.map +1 -1
  94. package/esm/src/build/index.js +0 -1
  95. package/esm/src/build/production-build/build/route-collector.d.ts.map +1 -1
  96. package/esm/src/build/production-build/build/route-collector.js +2 -3
  97. package/esm/src/build/production-build/templates.d.ts +5 -9
  98. package/esm/src/build/production-build/templates.d.ts.map +1 -1
  99. package/esm/src/build/production-build/templates.js +6 -18
  100. package/esm/src/build/vendor-cache.d.ts.map +1 -1
  101. package/esm/src/build/vendor-cache.js +0 -5
  102. package/esm/src/cache/tokenizing-gateway.d.ts +0 -2
  103. package/esm/src/cache/tokenizing-gateway.d.ts.map +1 -1
  104. package/esm/src/cache/tokenizing-gateway.js +1 -3
  105. package/esm/src/chat/index.d.ts +2 -2
  106. package/esm/src/chat/index.d.ts.map +1 -1
  107. package/esm/src/chat/index.js +1 -1
  108. package/esm/src/config/define-config.d.ts.map +1 -1
  109. package/esm/src/config/define-config.js +28 -25
  110. package/esm/src/config/loader.d.ts.map +1 -1
  111. package/esm/src/config/loader.js +10 -7
  112. package/esm/src/config/schemas/config.schema.d.ts +58 -12
  113. package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
  114. package/esm/src/config/schemas/config.schema.js +12 -0
  115. package/esm/src/data/data-fetcher.d.ts +1 -2
  116. package/esm/src/data/data-fetcher.d.ts.map +1 -1
  117. package/esm/src/data/data-fetcher.js +14 -15
  118. package/esm/src/data/server-data-fetcher.d.ts +0 -3
  119. package/esm/src/data/server-data-fetcher.d.ts.map +1 -1
  120. package/esm/src/data/server-data-fetcher.js +1 -8
  121. package/esm/src/data/static-data-fetcher.d.ts +1 -3
  122. package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
  123. package/esm/src/data/static-data-fetcher.js +1 -3
  124. package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
  125. package/esm/src/discovery/discovery-engine.js +19 -1
  126. package/esm/src/discovery/discovery-utils.d.ts +0 -4
  127. package/esm/src/discovery/discovery-utils.d.ts.map +1 -1
  128. package/esm/src/discovery/discovery-utils.js +0 -6
  129. package/esm/src/discovery/file-discovery.d.ts +3 -1
  130. package/esm/src/discovery/file-discovery.d.ts.map +1 -1
  131. package/esm/src/discovery/file-discovery.js +3 -8
  132. package/esm/src/discovery/handlers/index.d.ts +1 -0
  133. package/esm/src/discovery/handlers/index.d.ts.map +1 -1
  134. package/esm/src/discovery/handlers/index.js +1 -0
  135. package/esm/src/discovery/handlers/skill-handler.d.ts +26 -0
  136. package/esm/src/discovery/handlers/skill-handler.d.ts.map +1 -0
  137. package/esm/src/discovery/handlers/skill-handler.js +87 -0
  138. package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -1
  139. package/esm/src/discovery/handlers/task-handler.js +1 -5
  140. package/esm/src/discovery/transpiler.d.ts.map +1 -1
  141. package/esm/src/discovery/transpiler.js +7 -4
  142. package/esm/src/discovery/types.d.ts +3 -0
  143. package/esm/src/discovery/types.d.ts.map +1 -1
  144. package/esm/src/embedding/resolve.d.ts.map +1 -1
  145. package/esm/src/embedding/resolve.js +1 -3
  146. package/esm/src/embedding/upload-handler.d.ts.map +1 -1
  147. package/esm/src/embedding/upload-handler.js +4 -3
  148. package/esm/src/embedding/upload-store.js +4 -4
  149. package/esm/src/errors/error-registry.d.ts +2 -1
  150. package/esm/src/errors/error-registry.d.ts.map +1 -1
  151. package/esm/src/errors/http-error.d.ts +1 -2
  152. package/esm/src/errors/http-error.d.ts.map +1 -1
  153. package/esm/src/errors/http-error.js +2 -2
  154. package/esm/src/errors/middleware/cli-error-boundary.d.ts.map +1 -1
  155. package/esm/src/errors/middleware/cli-error-boundary.js +13 -2
  156. package/esm/src/errors/middleware/wrap-unknown.d.ts +0 -7
  157. package/esm/src/errors/middleware/wrap-unknown.d.ts.map +1 -1
  158. package/esm/src/errors/middleware/wrap-unknown.js +0 -9
  159. package/esm/src/errors/veryfront-error.d.ts +0 -3
  160. package/esm/src/errors/veryfront-error.d.ts.map +1 -1
  161. package/esm/src/errors/veryfront-error.js +0 -5
  162. package/esm/src/html/schemas/html.schema.d.ts +2 -2
  163. package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
  164. package/esm/src/html/styles-builder/css-hash-cache.js +1 -2
  165. package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
  166. package/esm/src/html/styles-builder/plugin-loader.js +50 -21
  167. package/esm/src/html/styles-builder/tailwind-compiler-cache.d.ts.map +1 -1
  168. package/esm/src/html/styles-builder/tailwind-compiler-cache.js +12 -4
  169. package/esm/src/html/utils.d.ts +0 -7
  170. package/esm/src/html/utils.d.ts.map +1 -1
  171. package/esm/src/html/utils.js +0 -25
  172. package/esm/src/modules/component-registry/registry.d.ts +0 -3
  173. package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
  174. package/esm/src/modules/component-registry/registry.js +0 -3
  175. package/esm/src/oauth/handlers/callback-handler.d.ts +2 -0
  176. package/esm/src/oauth/handlers/callback-handler.d.ts.map +1 -1
  177. package/esm/src/oauth/handlers/callback-handler.js +10 -4
  178. package/esm/src/oauth/providers/common.d.ts.map +1 -1
  179. package/esm/src/oauth/providers/common.js +0 -23
  180. package/esm/src/observability/auto-instrument/react-instrumentation.js +2 -1
  181. package/esm/src/observability/instruments/instruments-factory.d.ts +1 -1
  182. package/esm/src/observability/instruments/instruments-factory.d.ts.map +1 -1
  183. package/esm/src/observability/instruments/instruments-factory.js +5 -4
  184. package/esm/src/observability/metrics/config.js +5 -4
  185. package/esm/src/observability/metrics/manager.js +1 -1
  186. package/esm/src/observability/tracing/span-operations.d.ts.map +1 -1
  187. package/esm/src/observability/tracing/span-operations.js +14 -8
  188. package/esm/src/platform/compat/console/node.d.ts +0 -1
  189. package/esm/src/platform/compat/console/node.d.ts.map +1 -1
  190. package/esm/src/platform/compat/console/node.js +4 -11
  191. package/esm/src/platform/compat/fs.d.ts.map +1 -1
  192. package/esm/src/platform/compat/fs.js +4 -2
  193. package/esm/src/platform/compat/opaque-deps.d.ts +4 -2
  194. package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -1
  195. package/esm/src/platform/compat/opaque-deps.js +1 -1
  196. package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
  197. package/esm/src/platform/compat/path/basic-operations.js +8 -7
  198. package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
  199. package/esm/src/platform/compat/path/resolution.js +15 -10
  200. package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -1
  201. package/esm/src/platform/compat/path/url-conversion.js +3 -2
  202. package/esm/src/platform/compat/process.d.ts +2 -14
  203. package/esm/src/platform/compat/process.d.ts.map +1 -1
  204. package/esm/src/platform/compat/process.js +92 -70
  205. package/esm/src/provider/index.d.ts +1 -1
  206. package/esm/src/provider/index.d.ts.map +1 -1
  207. package/esm/src/provider/index.js +1 -1
  208. package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -1
  209. package/esm/src/provider/local/ai-sdk-adapter.js +18 -18
  210. package/esm/src/provider/local/env.d.ts.map +1 -1
  211. package/esm/src/provider/local/env.js +2 -1
  212. package/esm/src/provider/model-registry.d.ts +10 -0
  213. package/esm/src/provider/model-registry.d.ts.map +1 -1
  214. package/esm/src/provider/model-registry.js +43 -0
  215. package/esm/src/proxy/retry.d.ts +3 -3
  216. package/esm/src/proxy/retry.d.ts.map +1 -1
  217. package/esm/src/proxy/retry.js +0 -7
  218. package/esm/src/proxy/tracing.d.ts +1 -5
  219. package/esm/src/proxy/tracing.d.ts.map +1 -1
  220. package/esm/src/proxy/tracing.js +1 -7
  221. package/esm/src/react/components/ai/chat/components/code-block.js +1 -1
  222. package/esm/src/react/components/ai/chat/components/skill-badge.d.ts +12 -0
  223. package/esm/src/react/components/ai/chat/components/skill-badge.d.ts.map +1 -0
  224. package/esm/src/react/components/ai/chat/components/skill-badge.js +34 -0
  225. package/esm/src/react/components/ai/chat/components/step-indicator.js +4 -4
  226. package/esm/src/react/components/ai/chat/composition/chat-message-list.d.ts.map +1 -1
  227. package/esm/src/react/components/ai/chat/composition/chat-message-list.js +8 -2
  228. package/esm/src/react/components/ai/chat/composition/message.d.ts.map +1 -1
  229. package/esm/src/react/components/ai/chat/composition/message.js +8 -2
  230. package/esm/src/react/components/ai/chat/index.d.ts +4 -1
  231. package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
  232. package/esm/src/react/components/ai/chat/index.js +4 -3
  233. package/esm/src/react/components/ai/chat/utils/message-parts.d.ts +2 -0
  234. package/esm/src/react/components/ai/chat/utils/message-parts.d.ts.map +1 -1
  235. package/esm/src/react/components/ai/chat/utils/message-parts.js +9 -0
  236. package/esm/src/react/components/ai/chat-with-sidebar.d.ts +1 -0
  237. package/esm/src/react/components/ai/chat-with-sidebar.d.ts.map +1 -1
  238. package/esm/src/react/components/ai/chat-with-sidebar.js +1 -0
  239. package/esm/src/react/components/ai/chat.d.ts +1 -1
  240. package/esm/src/react/components/ai/chat.d.ts.map +1 -1
  241. package/esm/src/react/components/ai/chat.js +1 -1
  242. package/esm/src/rendering/cache/index.d.ts +1 -5
  243. package/esm/src/rendering/cache/index.d.ts.map +1 -1
  244. package/esm/src/rendering/cache/index.js +1 -5
  245. package/esm/src/rendering/orchestrator/pipeline.d.ts +11 -2
  246. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  247. package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
  248. package/esm/src/rendering/shared/context-aware-cache.js +0 -4
  249. package/esm/src/repositories/schemas/index.d.ts +1 -1
  250. package/esm/src/repositories/schemas/index.d.ts.map +1 -1
  251. package/esm/src/repositories/schemas/index.js +1 -1
  252. package/esm/src/repositories/schemas/repository.schema.d.ts +0 -11
  253. package/esm/src/repositories/schemas/repository.schema.d.ts.map +1 -1
  254. package/esm/src/repositories/schemas/repository.schema.js +0 -13
  255. package/esm/src/repositories/types.d.ts +1 -1
  256. package/esm/src/repositories/types.d.ts.map +1 -1
  257. package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
  258. package/esm/src/routing/api/module-loader/loader.js +63 -7
  259. package/esm/src/routing/api/openapi/path-utils.d.ts +0 -19
  260. package/esm/src/routing/api/openapi/path-utils.d.ts.map +1 -1
  261. package/esm/src/routing/api/openapi/path-utils.js +0 -34
  262. package/esm/src/routing/api/openapi/spec-generator.d.ts.map +1 -1
  263. package/esm/src/routing/api/openapi/spec-generator.js +1 -19
  264. package/esm/src/routing/api/openapi/types.d.ts +1 -0
  265. package/esm/src/routing/api/openapi/types.d.ts.map +1 -1
  266. package/esm/src/routing/api/openapi/types.js +18 -0
  267. package/esm/src/sandbox/sandbox.d.ts +1 -0
  268. package/esm/src/sandbox/sandbox.d.ts.map +1 -1
  269. package/esm/src/sandbox/sandbox.js +7 -8
  270. package/esm/src/security/http/cors/constants.d.ts +0 -2
  271. package/esm/src/security/http/cors/constants.d.ts.map +1 -1
  272. package/esm/src/security/http/cors/constants.js +0 -2
  273. package/esm/src/security/http/response/index.d.ts +3 -4
  274. package/esm/src/security/http/response/index.d.ts.map +1 -1
  275. package/esm/src/security/http/response/index.js +2 -3
  276. package/esm/src/server/context/enriched-context.d.ts +0 -8
  277. package/esm/src/server/context/enriched-context.d.ts.map +1 -1
  278. package/esm/src/server/context/enriched-context.js +1 -12
  279. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  280. package/esm/src/server/dev-server/server.js +11 -4
  281. package/esm/src/server/dev-ui/manifest.d.ts +20 -20
  282. package/esm/src/server/dev-ui/manifest.js +20 -20
  283. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  284. package/esm/src/server/handlers/dev/framework-candidates.generated.js +426 -179
  285. package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
  286. package/esm/src/server/runtime-handler/index.js +14 -24
  287. package/esm/src/server/shared/renderer/memory/pressure.d.ts +0 -7
  288. package/esm/src/server/shared/renderer/memory/pressure.d.ts.map +1 -1
  289. package/esm/src/server/shared/renderer/memory/pressure.js +1 -13
  290. package/esm/src/server/utils/domain-lookup.d.ts +0 -4
  291. package/esm/src/server/utils/domain-lookup.d.ts.map +1 -1
  292. package/esm/src/server/utils/domain-lookup.js +0 -3
  293. package/esm/src/skill/allowed-tools.d.ts +54 -0
  294. package/esm/src/skill/allowed-tools.d.ts.map +1 -0
  295. package/esm/src/skill/allowed-tools.js +87 -0
  296. package/esm/src/skill/executor.d.ts +28 -0
  297. package/esm/src/skill/executor.d.ts.map +1 -0
  298. package/esm/src/skill/executor.js +187 -0
  299. package/esm/src/skill/index.d.ts +19 -0
  300. package/esm/src/skill/index.d.ts.map +1 -0
  301. package/esm/src/skill/index.js +24 -0
  302. package/esm/src/skill/parser.d.ts +30 -0
  303. package/esm/src/skill/parser.d.ts.map +1 -0
  304. package/esm/src/skill/parser.js +162 -0
  305. package/esm/src/skill/path-safety.d.ts +22 -0
  306. package/esm/src/skill/path-safety.d.ts.map +1 -0
  307. package/esm/src/skill/path-safety.js +156 -0
  308. package/esm/src/skill/prompt-augmentation.d.ts +19 -0
  309. package/esm/src/skill/prompt-augmentation.d.ts.map +1 -0
  310. package/esm/src/skill/prompt-augmentation.js +36 -0
  311. package/esm/src/skill/registry.d.ts +25 -0
  312. package/esm/src/skill/registry.d.ts.map +1 -0
  313. package/esm/src/skill/registry.js +42 -0
  314. package/esm/src/skill/tools.d.ts +27 -0
  315. package/esm/src/skill/tools.d.ts.map +1 -0
  316. package/esm/src/skill/tools.js +149 -0
  317. package/esm/src/skill/types.d.ts +85 -0
  318. package/esm/src/skill/types.d.ts.map +1 -0
  319. package/esm/src/skill/types.js +27 -0
  320. package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
  321. package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
  322. package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
  323. package/esm/src/studio/element-selector-injector.d.ts +0 -2
  324. package/esm/src/studio/element-selector-injector.d.ts.map +1 -1
  325. package/esm/src/task/runner.d.ts +6 -0
  326. package/esm/src/task/runner.d.ts.map +1 -1
  327. package/esm/src/task/runner.js +8 -8
  328. package/esm/src/tool/factory.js +31 -39
  329. package/esm/src/transforms/esm/http-cache-helpers.d.ts +0 -8
  330. package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
  331. package/esm/src/transforms/esm/http-cache-helpers.js +0 -20
  332. package/esm/src/transforms/esm/path-resolver.d.ts +0 -14
  333. package/esm/src/transforms/esm/path-resolver.d.ts.map +1 -1
  334. package/esm/src/transforms/esm/path-resolver.js +1 -92
  335. package/esm/src/transforms/esm/source-url-embed.d.ts +0 -14
  336. package/esm/src/transforms/esm/source-url-embed.d.ts.map +1 -1
  337. package/esm/src/transforms/esm/source-url-embed.js +0 -47
  338. package/esm/src/transforms/esm/transform-cache.d.ts.map +1 -1
  339. package/esm/src/transforms/esm/transform-cache.js +2 -6
  340. package/esm/src/transforms/mdx/index.d.ts +0 -1
  341. package/esm/src/transforms/mdx/index.d.ts.map +1 -1
  342. package/esm/src/transforms/mdx/index.js +0 -4
  343. package/esm/src/transforms/pipeline/context.d.ts +0 -1
  344. package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
  345. package/esm/src/transforms/pipeline/context.js +0 -1
  346. package/esm/src/transforms/pipeline/index.d.ts +1 -2
  347. package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
  348. package/esm/src/transforms/pipeline/index.js +0 -3
  349. package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
  350. package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +0 -1
  351. package/esm/src/types/entities/getEntityInfo.js +1 -1
  352. package/esm/src/types/index.d.ts +2 -13
  353. package/esm/src/types/index.d.ts.map +1 -1
  354. package/esm/src/types/server.d.ts +2 -1
  355. package/esm/src/types/server.d.ts.map +1 -1
  356. package/esm/src/utils/cache-file-ops.d.ts +1 -1
  357. package/esm/src/utils/cache-file-ops.d.ts.map +1 -1
  358. package/esm/src/utils/cache-file-ops.js +5 -6
  359. package/esm/src/utils/lru-wrapper.d.ts.map +1 -1
  360. package/esm/src/utils/lru-wrapper.js +2 -4
  361. package/esm/src/workflow/claude-code/event-publisher.d.ts +0 -4
  362. package/esm/src/workflow/claude-code/event-publisher.d.ts.map +1 -1
  363. package/esm/src/workflow/claude-code/event-publisher.js +2 -6
  364. package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
  365. package/esm/src/workflow/executor/workflow-executor.js +6 -1
  366. package/esm/src/workflow/react/use-workflow-list.d.ts.map +1 -1
  367. package/esm/src/workflow/react/use-workflow-list.js +2 -1
  368. package/esm/src/workflow/schemas/workflow.schema.d.ts +8 -8
  369. package/package.json +1 -2
  370. package/src/cli/app/components/inline-input.ts +0 -5
  371. package/src/cli/app/components/list-select.ts +0 -21
  372. package/src/cli/app/operations/project-creation.ts +4 -109
  373. package/src/cli/app/shell.ts +1 -1
  374. package/src/cli/app/utils.ts +0 -22
  375. package/src/cli/app/views/dashboard.ts +0 -17
  376. package/src/cli/app/views/startup.ts +0 -13
  377. package/src/cli/auth/login.ts +1 -2
  378. package/src/cli/auth/token-store.ts +1 -1
  379. package/src/cli/auth/utils.ts +2 -1
  380. package/src/cli/commands/generate/integration-generator.ts +1 -1
  381. package/src/cli/help/formatters.ts +11 -4
  382. package/src/cli/help/main-help.ts +2 -3
  383. package/src/cli/mcp/server.ts +2 -5
  384. package/src/cli/mcp/tools/dev-tools.ts +1 -2
  385. package/src/cli/mcp/tools.ts +8 -2
  386. package/src/cli/shared/reserve-slug.ts +1 -4
  387. package/src/cli/sync/ignore.ts +26 -21
  388. package/src/cli/ui/colors.ts +0 -12
  389. package/src/cli/ui/dot-matrix.ts +3 -6
  390. package/src/cli/ui/tui.ts +3 -3
  391. package/src/cli/utils/index.ts +1 -1
  392. package/src/cli/utils/package-manager.ts +3 -4
  393. package/src/deno.js +22 -19
  394. package/src/src/agent/chat-handler.ts +8 -23
  395. package/src/src/agent/factory.ts +58 -9
  396. package/src/src/agent/index.ts +16 -1
  397. package/src/src/agent/memory/memory.ts +0 -9
  398. package/src/src/agent/react/use-chat/types.ts +2 -0
  399. package/src/src/agent/react/use-chat/use-chat.ts +15 -9
  400. package/src/src/agent/runtime/index.ts +213 -35
  401. package/src/src/agent/runtime/tool-helpers.ts +9 -0
  402. package/src/src/agent/types.ts +10 -0
  403. package/src/src/ai/registry-manager.ts +2 -1
  404. package/src/src/build/bundler/code-splitter/manifest-builder.ts +1 -1
  405. package/src/src/build/compiler/mdx-compiler/validator.ts +3 -7
  406. package/src/src/build/compiler/mdx-to-js.ts +0 -101
  407. package/src/src/build/index.ts +0 -8
  408. package/src/src/build/production-build/build/route-collector.ts +2 -4
  409. package/src/src/build/production-build/templates.ts +9 -18
  410. package/src/src/build/vendor-cache.ts +0 -6
  411. package/src/src/cache/tokenizing-gateway.ts +1 -9
  412. package/src/src/chat/index.ts +3 -0
  413. package/src/src/config/define-config.ts +30 -29
  414. package/src/src/config/loader.ts +10 -9
  415. package/src/src/config/schemas/config.schema.ts +12 -0
  416. package/src/src/data/data-fetcher.ts +15 -21
  417. package/src/src/data/server-data-fetcher.ts +1 -8
  418. package/src/src/data/static-data-fetcher.ts +1 -6
  419. package/src/src/discovery/discovery-engine.ts +27 -0
  420. package/src/src/discovery/discovery-utils.ts +0 -7
  421. package/src/src/discovery/file-discovery.ts +3 -9
  422. package/src/src/discovery/handlers/index.ts +1 -0
  423. package/src/src/discovery/handlers/skill-handler.ts +123 -0
  424. package/src/src/discovery/handlers/task-handler.ts +1 -5
  425. package/src/src/discovery/transpiler.ts +7 -4
  426. package/src/src/discovery/types.ts +3 -0
  427. package/src/src/embedding/resolve.ts +1 -3
  428. package/src/src/embedding/upload-handler.ts +7 -3
  429. package/src/src/embedding/upload-store.ts +4 -4
  430. package/src/src/errors/error-registry.ts +2 -2
  431. package/src/src/errors/http-error.ts +7 -3
  432. package/src/src/errors/middleware/cli-error-boundary.ts +28 -2
  433. package/src/src/errors/middleware/wrap-unknown.ts +0 -10
  434. package/src/src/errors/veryfront-error.ts +0 -9
  435. package/src/src/html/styles-builder/css-hash-cache.ts +5 -2
  436. package/src/src/html/styles-builder/plugin-loader.ts +58 -21
  437. package/src/src/html/styles-builder/tailwind-compiler-cache.ts +11 -4
  438. package/src/src/html/utils.ts +0 -33
  439. package/src/src/modules/component-registry/registry.ts +0 -3
  440. package/src/src/modules/server/websocket-handler.ts +1 -1
  441. package/src/src/oauth/handlers/callback-handler.ts +17 -5
  442. package/src/src/oauth/providers/base.ts +3 -3
  443. package/src/src/oauth/providers/common.ts +0 -23
  444. package/src/src/observability/auto-instrument/react-instrumentation.ts +2 -2
  445. package/src/src/observability/instruments/instruments-factory.ts +6 -6
  446. package/src/src/observability/metrics/config.ts +5 -5
  447. package/src/src/observability/metrics/manager.ts +1 -1
  448. package/src/src/observability/tracing/span-operations.ts +14 -9
  449. package/src/src/platform/compat/console/node.ts +4 -14
  450. package/src/src/platform/compat/fs.ts +14 -3
  451. package/src/src/platform/compat/opaque-deps.ts +10 -5
  452. package/src/src/platform/compat/path/basic-operations.ts +9 -7
  453. package/src/src/platform/compat/path/resolution.ts +15 -8
  454. package/src/src/platform/compat/path/url-conversion.ts +10 -6
  455. package/src/src/platform/compat/process.ts +133 -76
  456. package/src/src/provider/index.ts +1 -0
  457. package/src/src/provider/local/ai-sdk-adapter.ts +40 -37
  458. package/src/src/provider/local/env.ts +4 -1
  459. package/src/src/provider/model-registry.ts +47 -0
  460. package/src/src/proxy/retry.ts +0 -9
  461. package/src/src/proxy/tracing.ts +1 -9
  462. package/src/src/react/components/ai/chat/components/code-block.tsx +1 -1
  463. package/src/src/react/components/ai/chat/components/skill-badge.tsx +51 -0
  464. package/src/src/react/components/ai/chat/components/step-indicator.tsx +4 -4
  465. package/src/src/react/components/ai/chat/composition/chat-message-list.tsx +9 -2
  466. package/src/src/react/components/ai/chat/composition/message.tsx +9 -2
  467. package/src/src/react/components/ai/chat/index.tsx +6 -1
  468. package/src/src/react/components/ai/chat/utils/message-parts.ts +11 -0
  469. package/src/src/react/components/ai/chat-with-sidebar.tsx +2 -0
  470. package/src/src/react/components/ai/chat.tsx +3 -0
  471. package/src/src/rendering/cache/index.ts +12 -5
  472. package/src/src/rendering/orchestrator/pipeline.ts +12 -2
  473. package/src/src/rendering/renderer.ts +1 -1
  474. package/src/src/rendering/shared/context-aware-cache.ts +0 -5
  475. package/src/src/repositories/schemas/index.ts +0 -2
  476. package/src/src/repositories/schemas/repository.schema.ts +0 -15
  477. package/src/src/repositories/types.ts +1 -6
  478. package/src/src/routing/api/module-loader/loader.ts +88 -3
  479. package/src/src/routing/api/openapi/path-utils.ts +0 -39
  480. package/src/src/routing/api/openapi/spec-generator.ts +1 -20
  481. package/src/src/routing/api/openapi/types.ts +20 -0
  482. package/src/src/sandbox/sandbox.ts +8 -8
  483. package/src/src/security/http/cors/constants.ts +0 -4
  484. package/src/src/security/http/response/index.ts +3 -9
  485. package/src/src/server/context/enriched-context.ts +1 -19
  486. package/src/src/server/dev-server/server.ts +11 -4
  487. package/src/src/server/dev-ui/manifest.js +20 -20
  488. package/src/src/server/handlers/dev/framework-candidates.generated.ts +426 -179
  489. package/src/src/server/runtime-handler/index.ts +17 -28
  490. package/src/src/server/shared/renderer/memory/pressure.ts +2 -15
  491. package/src/src/server/utils/domain-lookup.ts +0 -4
  492. package/src/src/skill/allowed-tools.ts +107 -0
  493. package/src/src/skill/executor.ts +215 -0
  494. package/src/src/skill/index.ts +60 -0
  495. package/src/src/skill/parser.ts +214 -0
  496. package/src/src/skill/path-safety.ts +203 -0
  497. package/src/src/skill/prompt-augmentation.ts +48 -0
  498. package/src/src/skill/registry.ts +51 -0
  499. package/src/src/skill/tools.ts +197 -0
  500. package/src/src/skill/types.ts +107 -0
  501. package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
  502. package/src/src/studio/element-selector-injector.ts +0 -2
  503. package/src/src/task/runner.ts +10 -8
  504. package/src/src/tool/factory.ts +54 -54
  505. package/src/src/transforms/esm/http-cache-helpers.ts +0 -20
  506. package/src/src/transforms/esm/path-resolver.ts +1 -140
  507. package/src/src/transforms/esm/source-url-embed.ts +0 -53
  508. package/src/src/transforms/esm/transform-cache.ts +3 -7
  509. package/src/src/transforms/mdx/index.ts +0 -5
  510. package/src/src/transforms/pipeline/context.ts +0 -2
  511. package/src/src/transforms/pipeline/index.ts +0 -4
  512. package/src/src/transforms/pipeline/stages/ssr-http-cache.ts +0 -1
  513. package/src/src/types/entities/getEntityInfo.ts +1 -1
  514. package/src/src/types/index.ts +1 -20
  515. package/src/src/types/server.ts +1 -1
  516. package/src/src/utils/cache-file-ops.ts +5 -5
  517. package/src/src/utils/lru-wrapper.ts +2 -8
  518. package/src/src/workflow/claude-code/event-publisher.ts +13 -4
  519. package/src/src/workflow/executor/workflow-executor.ts +7 -2
  520. package/src/src/workflow/react/use-workflow-list.ts +3 -2
  521. package/esm/src/transforms/mdx/parser.d.ts +0 -4
  522. package/esm/src/transforms/mdx/parser.d.ts.map +0 -1
  523. package/esm/src/transforms/mdx/parser.js +0 -49
  524. package/src/src/transforms/mdx/parser.ts +0 -65
@@ -2,10 +2,7 @@ import { compile as compileMdx } from "@mdx-js/mdx";
2
2
  import { bundlerLogger as logger } from "../../utils/index.js";
3
3
  import * as esbuild from "esbuild";
4
4
  import { extract } from "../../platform/compat/std/front-matter-yaml.js";
5
- import { dirname, join } from "../../platform/compat/path/index.js";
6
5
  import type { RuntimeAdapter } from "../../platform/adapters/base.js";
7
- import { createFileSystem } from "../../platform/compat/fs.js";
8
- import { createSecureFs } from "../../security/index.js";
9
6
  import { createError, toError } from "../../errors/veryfront-error.js";
10
7
 
11
8
  export interface MDXFrontmatter {
@@ -22,8 +19,6 @@ export interface CompileToJSOptions {
22
19
  adapter: RuntimeAdapter;
23
20
  }
24
21
 
25
- const fs = createFileSystem();
26
-
27
22
  function getComponentName(imp: { name: string; path: string }): string {
28
23
  return imp.path.split("/").pop()?.replace(/\.(jsx?|tsx?)$/, "") ?? imp.name;
29
24
  }
@@ -143,99 +138,3 @@ export default function MDXPage({ components = {} }) {
143
138
 
144
139
  return { code: result.code, frontmatter };
145
140
  }
146
-
147
- export async function compileMDXFile(
148
- mdxPath: string,
149
- outputDir: string,
150
- options: CompileToJSOptions,
151
- ): Promise<void> {
152
- const secureFs = createSecureFs({
153
- baseDir: options.projectDir,
154
- adapter: options.adapter,
155
- context: "build",
156
- throwOnError: true,
157
- });
158
-
159
- try {
160
- const content = await secureFs.readFile(mdxPath);
161
- const { code } = await compileMDXToJS(mdxPath, content, options);
162
-
163
- const relativePath = mdxPath.replace(options.projectDir, "").replace(/^\//, "");
164
- const outputPath = join(outputDir, relativePath.replace(".mdx", ".mdx.js"));
165
-
166
- await secureFs.mkdir(dirname(outputPath), { recursive: true });
167
- await secureFs.writeFile(outputPath, code);
168
-
169
- logger.info(`Compiled MDX: ${mdxPath} -> ${outputPath}`);
170
- } catch (error) {
171
- logger.error(`Failed to compile MDX file ${mdxPath}:`, error);
172
- throw error;
173
- }
174
- }
175
-
176
- export async function compileProjectMDX(
177
- projectDir: string,
178
- outputDir: string,
179
- options: Omit<CompileToJSOptions, "projectDir">,
180
- ): Promise<void> {
181
- const compileOptions: CompileToJSOptions = { ...options, projectDir };
182
-
183
- const componentsDir = join(projectDir, "components");
184
- const components: string[] = [];
185
-
186
- try {
187
- for await (const entry of fs.readDir(componentsDir)) {
188
- if (!entry.isFile || !/\.(jsx?|tsx?)$/.test(entry.name)) continue;
189
- components.push(entry.name.replace(/\.(jsx?|tsx?)$/, ""));
190
- }
191
- } catch {
192
- // Components directory might not exist
193
- }
194
-
195
- compileOptions.components = components;
196
-
197
- const mdxFiles: string[] = [];
198
- const VERYFRONT_EXCLUDED_DIRS = new Set([
199
- "cache",
200
- "compiled",
201
- "tmp",
202
- "temp",
203
- "output",
204
- "optimized-images",
205
- "css",
206
- ]);
207
-
208
- async function findMDXFiles(dir: string): Promise<void> {
209
- try {
210
- for await (const entry of fs.readDir(dir)) {
211
- const path = join(dir, entry.name);
212
-
213
- if (entry.isFile && (entry.name.endsWith(".mdx") || entry.name.endsWith(".md"))) {
214
- mdxFiles.push(path);
215
- continue;
216
- }
217
-
218
- if (!entry.isDirectory || entry.name === "node_modules") continue;
219
- if (entry.name.startsWith(".") && entry.name !== ".veryfront") continue;
220
- if (dir.includes(".veryfront") && VERYFRONT_EXCLUDED_DIRS.has(entry.name)) continue;
221
-
222
- await findMDXFiles(path);
223
- }
224
- } catch {
225
- // Directory might not exist
226
- }
227
- }
228
-
229
- await findMDXFiles(join(projectDir, "pages"));
230
- await findMDXFiles(join(projectDir, "layouts"));
231
- await findMDXFiles(join(projectDir, "providers"));
232
- await findMDXFiles(join(projectDir, ".veryfront"));
233
-
234
- logger.info(`Found ${mdxFiles.length} MDX files to compile`);
235
-
236
- for (const mdxFile of mdxFiles) {
237
- await compileMDXFile(mdxFile, outputDir, compileOptions);
238
- }
239
-
240
- logger.info(`Compiled ${mdxFiles.length} MDX files to ${outputDir}`);
241
- }
@@ -9,11 +9,3 @@ export { compileMDXToJS } from "./compiler/mdx-to-js.js";
9
9
  export { compileAllMDX, watchMDX } from "./compiler/mdx-compiler/index.js";
10
10
  export { buildProduction } from "./production-build/build/build-orchestrator.js";
11
11
  export { buildEmbeddedPreset } from "./embedded/preset.js";
12
-
13
- export interface EmbeddedPresetOptions {
14
- projectDir: string;
15
- outDir: string;
16
- runtime: "deno" | "node" | "bun";
17
- }
18
-
19
- export const EMBEDDED_PRESET_ID = "veryfront-embedded";
@@ -38,11 +38,9 @@ export async function collectAllRoutes(
38
38
 
39
39
  logger.info(`Collected routes: ${pages.length} pages, ${app.length} app`);
40
40
 
41
- if (app.length === 0) {
42
- return { pages, app };
41
+ if (app.length > 0) {
42
+ logger.info(`App routes: ${app.map((r) => r.path).join(", ")}`);
43
43
  }
44
44
 
45
- logger.info(`App routes: ${app.map((r) => r.path).join(", ")}`);
46
-
47
45
  return { pages, app };
48
46
  }
@@ -1,26 +1,17 @@
1
1
  /**
2
2
  * Embedded templates for production builds
3
3
  * These are embedded as strings to avoid file system dependencies in npm bundle
4
+ *
5
+ * AUTO-GENERATED by scripts/build/prebundle-client-scripts.ts
6
+ * Do not edit manually — run `deno task build` to regenerate.
4
7
  * @module
5
8
  */
6
9
 
7
- /**
8
- * Client-side CSS styles for error display in production builds
9
- */
10
- export const CLIENT_STYLES = `.error-container {
11
- max-width: 600px;
12
- margin: 2rem auto;
13
- padding: 2rem;
14
- background: #fee;
15
- border: 1px solid #fcc;
16
- border-radius: 8px;
17
- color: #c00;
18
- }`;
10
+ export const CLIENT_STYLES =
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}";
19
12
 
20
- /**
21
- * Pre-bundled client router script for npm builds
22
- * Placeholder - this is auto-generated during build:npm
23
- */
24
- export let CLIENT_ROUTER_BUNDLE: string | undefined;
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';
25
15
 
26
- export let CLIENT_PREFETCH_BUNDLE: string | undefined;
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';
@@ -80,14 +80,8 @@ function isLruIntervalDisabled(): boolean {
80
80
  return globalFlag === true || getDisableLruIntervalEnv();
81
81
  }
82
82
 
83
- // Default singleton instance for backward compatibility
84
83
  let defaultInstance: VendorCacheManager | undefined;
85
84
 
86
- function _getDefaultInstance(): VendorCacheManager {
87
- defaultInstance ??= new VendorCacheManager();
88
- return defaultInstance;
89
- }
90
-
91
85
  const TRANSFORM_VERSION = "3";
92
86
 
93
87
  export async function generateVendorCacheKey(
@@ -15,12 +15,7 @@
15
15
 
16
16
  import { logger } from "../utils/index.js";
17
17
  import type { CacheBackend } from "./types.js";
18
- import {
19
- assertPortableCode,
20
- CACHE_INVARIANT_VIOLATION,
21
- detokenizeAllCachePaths,
22
- tokenizeAllVeryFrontPaths,
23
- } from "./paths.js";
18
+ import { assertPortableCode, detokenizeAllCachePaths, tokenizeAllVeryFrontPaths } from "./paths.js";
24
19
 
25
20
  /**
26
21
  * Gateway interface for code storage in distributed cache.
@@ -281,6 +276,3 @@ export function createTokenizingGateway(
281
276
  ): TokenizingCacheGateway {
282
277
  return new TokenizingCacheGateway(backend, name);
283
278
  }
284
-
285
- // Re-export error definition for consumers
286
- export { CACHE_INVARIANT_VIOLATION };
@@ -133,6 +133,7 @@ export {
133
133
  InferenceBadge,
134
134
  InlineCitation,
135
135
  isReasoningPart,
136
+ isSkillToolPart,
136
137
  isToolPart,
137
138
  Loader,
138
139
  MessageActions,
@@ -143,6 +144,7 @@ export {
143
144
  ReasoningCard,
144
145
  RichCodeBlock,
145
146
  Shimmer,
147
+ SkillBadge,
146
148
  Sources,
147
149
  StepIndicator,
148
150
  Suggestion,
@@ -186,6 +188,7 @@ export type {
186
188
  PartGroup,
187
189
  QuickAction,
188
190
  QuickActionsProps,
191
+ SkillBadgeProps,
189
192
  Source,
190
193
  SourcesProps,
191
194
  StepIndicatorProps,
@@ -20,48 +20,49 @@ export function mergeConfigs(...configs: Partial<VeryfrontConfig>[]): VeryfrontC
20
20
  export async function validateConfig(config: unknown): Promise<void> {
21
21
  if (!config || typeof config !== "object") {
22
22
  throw toError(
23
- createError({
24
- type: "config",
25
- message: "Configuration must be an object",
26
- }),
23
+ createError({ type: "config", message: "Configuration must be an object" }),
27
24
  );
28
25
  }
29
26
 
30
27
  const cfg = config as Record<string, unknown>;
31
28
 
29
+ await validatePort(cfg);
30
+ validateOutDir(cfg);
31
+ }
32
+
33
+ async function validatePort(cfg: Record<string, unknown>): Promise<void> {
32
34
  const dev = cfg.dev;
33
35
  const port = dev && typeof dev === "object" ? (dev as Record<string, unknown>).port : undefined;
36
+ if (port === undefined) return;
34
37
 
35
- if (port !== undefined) {
36
- const { MIN_PORT, MAX_PORT } = await import("../utils/constants/index.js");
38
+ const { MIN_PORT, MAX_PORT } = await import("../utils/constants/index.js");
39
+ if (typeof port === "number" && port >= MIN_PORT && port <= MAX_PORT) return;
37
40
 
38
- if (typeof port !== "number" || port < MIN_PORT || port > MAX_PORT) {
39
- throw toError(
40
- createError({
41
- type: "config",
42
- message: `dev.port must be a number between ${MIN_PORT} and ${MAX_PORT}`,
43
- context: {
44
- field: "dev.port",
45
- value: port,
46
- expected: `number between ${MIN_PORT} and ${MAX_PORT}`,
47
- },
48
- }),
49
- );
50
- }
51
- }
41
+ throw toError(
42
+ createError({
43
+ type: "config",
44
+ message: `dev.port must be a number between ${MIN_PORT} and ${MAX_PORT}`,
45
+ context: {
46
+ field: "dev.port",
47
+ value: port,
48
+ expected: `number between ${MIN_PORT} and ${MAX_PORT}`,
49
+ },
50
+ }),
51
+ );
52
+ }
52
53
 
54
+ function validateOutDir(cfg: Record<string, unknown>): void {
53
55
  const build = cfg.build;
54
56
  const outDir = build && typeof build === "object"
55
57
  ? (build as Record<string, unknown>).outDir
56
58
  : undefined;
59
+ if (outDir === undefined || typeof outDir === "string") return;
57
60
 
58
- if (outDir !== undefined && typeof outDir !== "string") {
59
- throw toError(
60
- createError({
61
- type: "config",
62
- message: "build.outDir must be a string",
63
- context: { field: "build.outDir", value: outDir, expected: "string" },
64
- }),
65
- );
66
- }
61
+ throw toError(
62
+ createError({
63
+ type: "config",
64
+ message: "build.outDir must be a string",
65
+ context: { field: "build.outDir", value: outDir, expected: "string" },
66
+ }),
67
+ );
67
68
  }
@@ -141,18 +141,19 @@ let cacheRevision = 0;
141
141
  function validateCorsConfig(userConfig: unknown): void {
142
142
  if (!userConfig || typeof userConfig !== "object") return;
143
143
 
144
- const security = (userConfig as Record<string, unknown>).security as
145
- | Record<string, unknown>
146
- | undefined;
147
- const cors = security?.cors;
144
+ const cfg = userConfig as Record<string, unknown>;
145
+ const security = cfg.security as Record<string, unknown> | undefined;
146
+ if (!security) return;
147
+
148
+ const cors = security.cors;
148
149
  if (!cors || typeof cors !== "object" || Array.isArray(cors)) return;
149
150
 
150
151
  const origin = (cors as Record<string, unknown>).origin;
151
- if (origin !== undefined && typeof origin !== "string") {
152
- throw CONFIG_VALIDATION_FAILED.create({
153
- detail: "security.cors.origin must be a string. Expected boolean or { origin?: string }",
154
- });
155
- }
152
+ if (origin === undefined || typeof origin === "string") return;
153
+
154
+ throw CONFIG_VALIDATION_FAILED.create({
155
+ detail: "security.cors.origin must be a string. Expected boolean or { origin?: string }",
156
+ });
156
157
  }
157
158
 
158
159
  function validateConfigShape(userConfig: unknown): void {
@@ -397,6 +397,18 @@ export const veryfrontConfigSchema = z
397
397
  })
398
398
  .partial()
399
399
  .optional(),
400
+ skills: z
401
+ .object({
402
+ discovery: z
403
+ .object({
404
+ enabled: z.boolean().optional(),
405
+ paths: z.array(z.string()).optional(),
406
+ })
407
+ .partial()
408
+ .optional(),
409
+ })
410
+ .partial()
411
+ .optional(),
400
412
  mcp: z
401
413
  .object({
402
414
  enabled: z.boolean().optional(),
@@ -1,5 +1,3 @@
1
- // Direct import from base.ts to avoid circular dependency through barrel
2
- import type { RuntimeAdapter } from "../platform/adapters/base.js";
3
1
  import { withSpan } from "../observability/tracing/otlp-setup.js";
4
2
  import { SpanNames } from "../observability/tracing/span-names.js";
5
3
  import { CacheManager } from "./data-fetching-cache.js";
@@ -14,10 +12,11 @@ export class DataFetcher {
14
12
  private staticFetcher: StaticDataFetcher;
15
13
  private pathsFetcher: StaticPathsFetcher;
16
14
 
17
- constructor(adapter?: RuntimeAdapter) {
15
+ // deno-lint-ignore no-unused-vars -- adapter kept for public API compatibility
16
+ constructor(adapter?: unknown) {
18
17
  this.cacheManager = new CacheManager();
19
- this.serverFetcher = new ServerDataFetcher(adapter);
20
- this.staticFetcher = new StaticDataFetcher(this.cacheManager, adapter);
18
+ this.serverFetcher = new ServerDataFetcher();
19
+ this.staticFetcher = new StaticDataFetcher(this.cacheManager);
21
20
  this.pathsFetcher = new StaticPathsFetcher();
22
21
  }
23
22
 
@@ -27,26 +26,21 @@ export class DataFetcher {
27
26
  mode: "development" | "production" = "development",
28
27
  ): Promise<DataResult> {
29
28
  const preferServerData = mode === "development" || !pageModule.getStaticData;
29
+ const useServer = preferServerData && !!pageModule.getServerData;
30
+ const useStatic = !useServer && !!pageModule.getStaticData;
30
31
 
31
- let fetchType: "server" | "static" | "none" = "none";
32
- if (preferServerData && pageModule.getServerData) {
33
- fetchType = "server";
34
- } else if (pageModule.getStaticData) {
35
- fetchType = "static";
36
- }
32
+ const fetchType: "server" | "static" | "none" = useServer
33
+ ? "server"
34
+ : useStatic
35
+ ? "static"
36
+ : "none";
37
37
 
38
38
  return withSpan(
39
39
  SpanNames.DATA_FETCH,
40
- async () => {
41
- if (preferServerData && pageModule.getServerData) {
42
- return this.serverFetcher.fetch(pageModule, context);
43
- }
44
-
45
- if (pageModule.getStaticData) {
46
- return this.staticFetcher.fetch(pageModule, context);
47
- }
48
-
49
- return { props: {} };
40
+ () => {
41
+ if (useServer) return this.serverFetcher.fetch(pageModule, context);
42
+ if (useStatic) return this.staticFetcher.fetch(pageModule, context);
43
+ return Promise.resolve({ props: {} });
50
44
  },
51
45
  {
52
46
  "data.fetch_type": fetchType,
@@ -1,5 +1,3 @@
1
- // Direct import from base.ts to avoid circular dependency through barrel
2
- import type { RuntimeAdapter } from "../platform/adapters/base.js";
3
1
  import type { DataContext, DataResult, PageWithData } from "./types.js";
4
2
  import { serverLogger } from "../utils/index.js";
5
3
  import { DATA_FETCH_TIMEOUT_MS } from "../config/defaults.js";
@@ -8,8 +6,6 @@ import { withSpan } from "../observability/tracing/otlp-setup.js";
8
6
  import { CircuitBreakerOpen, getCircuitBreaker } from "../utils/circuit-breaker.js";
9
7
 
10
8
  export class ServerDataFetcher {
11
- constructor(private adapter?: RuntimeAdapter) {}
12
-
13
9
  fetch(pageModule: PageWithData, context: DataContext): Promise<DataResult> {
14
10
  if (typeof pageModule.getServerData !== "function") {
15
11
  return Promise.resolve({ props: {} });
@@ -30,12 +26,9 @@ export class ServerDataFetcher {
30
26
  const start = performance.now();
31
27
 
32
28
  try {
33
- const getServerData = pageModule.getServerData;
34
- if (!getServerData) throw new Error(`No getServerData function on ${pathname}`);
35
-
36
29
  const result = await circuitBreaker.execute(() =>
37
30
  withTimeoutThrow(
38
- Promise.resolve(getServerData(context)),
31
+ Promise.resolve(pageModule.getServerData!(context)),
39
32
  DATA_FETCH_TIMEOUT_MS,
40
33
  `getServerData for ${pathname}`,
41
34
  )
@@ -1,5 +1,3 @@
1
- // Direct import from base.ts to avoid circular dependency through barrel
2
- import type { RuntimeAdapter } from "../platform/adapters/base.js";
3
1
  import type { CacheManager } from "./data-fetching-cache.js";
4
2
  import type { DataContext, DataResult, PageWithData } from "./types.js";
5
3
  import { serverLogger } from "../utils/index.js";
@@ -56,10 +54,7 @@ function getProjectId(context: DataContext, fallback: string): string {
56
54
  export class StaticDataFetcher {
57
55
  private pendingRevalidations = new Map<string, Promise<void>>();
58
56
 
59
- constructor(
60
- private cacheManager: CacheManager,
61
- private adapter?: RuntimeAdapter,
62
- ) {}
57
+ constructor(private cacheManager: CacheManager) {}
63
58
 
64
59
  async fetch(pageModule: PageWithData, context: DataContext): Promise<DataResult> {
65
60
  if (typeof pageModule.getStaticData !== "function") return { props: {} };
@@ -8,6 +8,7 @@
8
8
  import { detectPlatform } from "../platform/core-platform.js";
9
9
  import { agentLogger } from "../utils/logger/logger.js";
10
10
  import { ensureError } from "../errors/veryfront-error.js";
11
+ import { registerSkill, skillRegistry } from "../skill/registry.js";
11
12
  import type {
12
13
  DiscoveryConfig,
13
14
  DiscoveryHandler,
@@ -18,12 +19,14 @@ import { importModule } from "./transpiler.js";
18
19
  import { findTypeScriptFiles } from "./file-discovery.js";
19
20
  import {
20
21
  agentHandler,
22
+ discoverSkills,
21
23
  promptHandler,
22
24
  resourceHandler,
23
25
  taskHandler,
24
26
  toolHandler,
25
27
  workflowHandler,
26
28
  } from "./handlers/index.js";
29
+ import { join } from "../platform/compat/path/index.js";
27
30
 
28
31
  const logger = agentLogger.component("discovery");
29
32
 
@@ -87,6 +90,7 @@ export async function discoverAll(config: DiscoveryConfig): Promise<DiscoveryRes
87
90
  const result: DiscoveryResult = {
88
91
  tools: new Map(),
89
92
  agents: new Map(),
93
+ skills: new Map(),
90
94
  resources: new Map(),
91
95
  prompts: new Map(),
92
96
  workflows: new Map(),
@@ -124,5 +128,28 @@ export async function discoverAll(config: DiscoveryConfig): Promise<DiscoveryRes
124
128
  await discoverItems(`${baseDir}/${dir}`, result, context, taskHandler, config.verbose);
125
129
  }
126
130
 
131
+ // Clear stale skills before rediscovery so deleted/renamed skills are removed.
132
+ skillRegistry.clear();
133
+
134
+ // Discover skills (parallel path — markdown-based, not TypeScript import)
135
+ for (const dir of config.skillDirs ?? ["skills"]) {
136
+ const skillResult = await discoverSkills(
137
+ join(baseDir, dir),
138
+ context,
139
+ config.verbose,
140
+ );
141
+ for (const [id, skill] of skillResult.skills) {
142
+ if (result.skills.has(id)) {
143
+ logger.warn(`Duplicate skill "${id}" across discovery roots; keeping first registration`);
144
+ continue;
145
+ }
146
+ registerSkill(id, skill);
147
+ result.skills.set(id, skill);
148
+ }
149
+ result.errors.push(
150
+ ...skillResult.errors.map((e) => ({ file: e.file, error: e.error })),
151
+ );
152
+ }
153
+
127
154
  return result;
128
155
  }
@@ -36,13 +36,6 @@ export function trackAgentPath(id: string, filePath: string): void {
36
36
  discoveredAgentPaths.set(id, filePath);
37
37
  }
38
38
 
39
- /**
40
- * Get all tracked agent paths
41
- */
42
- export function getTrackedAgentPaths(): Map<string, string> {
43
- return discoveredAgentPaths;
44
- }
45
-
46
39
  /**
47
40
  * Clear tracked agent paths
48
41
  */
@@ -58,21 +58,15 @@ export async function findTypeScriptFiles(
58
58
  }
59
59
 
60
60
  /**
61
- * Get Node.js fs and path modules (cached on context)
61
+ * Get Node.js fs and path modules (cached on context).
62
+ *
63
+ * Only called when no fsAdapter is present — callers must guard accordingly.
62
64
  */
63
65
  export async function getNodeDeps(
64
66
  context: FileDiscoveryContext,
65
67
  ): Promise<{ fs: typeof import("node:fs"); path: typeof import("node:path") }> {
66
68
  if (context.nodeDeps) return context.nodeDeps;
67
69
 
68
- if (context.fsAdapter) {
69
- context.nodeDeps = {
70
- fs: {} as typeof import("node:fs"),
71
- path: {} as typeof import("node:path"),
72
- };
73
- return context.nodeDeps;
74
- }
75
-
76
70
  const [fsModule, pathModule] = await Promise.all([import("node:fs"), import("node:path")]);
77
71
  context.nodeDeps = { fs: fsModule, path: pathModule };
78
72
  return context.nodeDeps;
@@ -10,3 +10,4 @@ export { resourceHandler } from "./resource-handler.js";
10
10
  export { promptHandler } from "./prompt-handler.js";
11
11
  export { workflowHandler } from "./workflow-handler.js";
12
12
  export { taskHandler } from "./task-handler.js";
13
+ export { discoverSkills } from "./skill-handler.js";