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
@@ -31,6 +31,7 @@ import { MessageActions as ActionsImpl } from "../components/message-actions.js"
31
31
  import { MessageFeedback as FeedbackImpl } from "../components/message-feedback.js";
32
32
  import { BranchPicker as BranchPickerImpl } from "../components/branch-picker.js";
33
33
  import { ReasoningCard } from "../components/reasoning.js";
34
+ import { SkillBadge } from "../components/skill-badge.js";
34
35
  import { ToolCallCard } from "../components/tool-ui.js";
35
36
  import { StepIndicator } from "../components/step-indicator.js";
36
37
  import { Sources as SourcesImpl } from "../components/sources.js";
@@ -40,6 +41,7 @@ import {
40
41
  extractSourcesFromParts,
41
42
  getTextContent,
42
43
  groupPartsInOrder,
44
+ isSkillToolPart,
43
45
  } from "../utils/message-parts.js";
44
46
 
45
47
  // ---------------------------------------------------------------------------
@@ -241,9 +243,14 @@ function MessageContent({
241
243
  )
242
244
  : null;
243
245
  }
246
+ const isSkill = isSkillToolPart(group.tool);
244
247
  return (
245
- <div key={group.tool.toolCallId} className="my-3">
246
- {renderTool ? renderTool(group.tool) : <ToolCallCard tool={group.tool} />}
248
+ <div key={group.tool.toolCallId} className={isSkill ? "my-2" : "my-3"}>
249
+ {renderTool
250
+ ? renderTool(group.tool)
251
+ : isSkill
252
+ ? <SkillBadge tool={group.tool} />
253
+ : <ToolCallCard tool={group.tool} />}
247
254
  </div>
248
255
  );
249
256
  })}
@@ -98,6 +98,7 @@ export { MessageActions, type MessageActionsProps } from "./components/message-a
98
98
  export { MessageEditForm, type MessageEditFormProps } from "./components/message-edit-form.js";
99
99
  export { BranchPicker, type BranchPickerProps } from "./components/branch-picker.js";
100
100
  export { DropZoneOverlay, type DropZoneOverlayProps } from "./components/drop-zone.js";
101
+ export { SkillBadge, type SkillBadgeProps } from "./components/skill-badge.js";
101
102
  export { ToolCallCard, ToolStatusBadge } from "./components/tool-ui.js";
102
103
  export { InferenceBadge, type InferenceBadgeProps } from "./components/inference-badge.js";
103
104
  export { UpgradeCTA, type UpgradeCTAProps } from "./components/upgrade-cta.js";
@@ -142,6 +143,7 @@ export {
142
143
  getTextContent,
143
144
  groupPartsInOrder,
144
145
  isReasoningPart,
146
+ isSkillToolPart,
145
147
  isToolPart,
146
148
  type PartGroup,
147
149
  } from "./utils/message-parts.js";
@@ -218,6 +220,8 @@ export interface ChatProps {
218
220
  showMessageActions?: boolean;
219
221
  models?: ModelOption[];
220
222
  model?: string;
223
+ /** The actual resolved model after auto-upgrade (used for avatar display) */
224
+ activeModel?: string;
221
225
  onModelChange?: (model: string) => void;
222
226
  inferenceMode?: InferenceMode;
223
227
  browserStatus?: BrowserInferenceStatus | null;
@@ -282,6 +286,7 @@ export const Chat = React.forwardRef<HTMLDivElement, ChatProps>(function Chat(
282
286
  showMessageActions = true,
283
287
  models,
284
288
  model,
289
+ activeModel,
285
290
  onModelChange,
286
291
  inferenceMode,
287
292
  browserStatus,
@@ -445,7 +450,7 @@ export const Chat = React.forwardRef<HTMLDivElement, ChatProps>(function Chat(
445
450
  theme={theme}
446
451
  renderMessage={renderMessage}
447
452
  renderTool={renderTool}
448
- model={model}
453
+ model={activeModel || model}
449
454
  showMessageActions={showMessageActions}
450
455
  showSources={showSources}
451
456
  showSteps={showSteps}
@@ -28,6 +28,17 @@ export function isToolPart(part: UIMessagePart): part is ToolUIPart | DynamicToo
28
28
  return part.type.startsWith("tool-") && part.type !== "tool-result";
29
29
  }
30
30
 
31
+ const SKILL_TOOL_NAMES: ReadonlySet<string> = new Set([
32
+ "load-skill",
33
+ "load-skill-reference",
34
+ "execute-skill-script",
35
+ ]);
36
+
37
+ /** Check if a tool part is a skill-related tool (load-skill, load-skill-reference, execute-skill-script) */
38
+ export function isSkillToolPart(tool: ToolUIPart | DynamicToolUIPart): boolean {
39
+ return SKILL_TOOL_NAMES.has(tool.toolName);
40
+ }
41
+
31
42
  /** Check if a part is a reasoning part */
32
43
  export function isReasoningPart(
33
44
  part: UIMessagePart,
@@ -24,6 +24,7 @@ export interface ChatWithSidebarChatController {
24
24
  isLoading?: ChatProps["isLoading"];
25
25
  error?: ChatProps["error"];
26
26
  model?: ChatProps["model"];
27
+ activeModel?: ChatProps["activeModel"];
27
28
  onModelChange?: ChatProps["onModelChange"];
28
29
  inferenceMode?: ChatProps["inferenceMode"];
29
30
  browserStatus?: ChatProps["browserStatus"];
@@ -170,6 +171,7 @@ export const ChatWithSidebar = React.forwardRef<HTMLDivElement, ChatWithSidebarP
170
171
  showScrollButton: features?.scrollButton,
171
172
  showMessageActions: features?.messageActions,
172
173
  models: models?.options,
174
+ activeModel: chat.activeModel,
173
175
  inferenceMode: chat.inferenceMode,
174
176
  browserStatus: chat.browserStatus,
175
177
  showSources: features?.sources,
@@ -84,6 +84,7 @@ export {
84
84
  InlineCitation,
85
85
  type InlineCitationProps,
86
86
  isReasoningPart,
87
+ isSkillToolPart,
87
88
  isToolPart,
88
89
  Loader,
89
90
  MessageActions,
@@ -99,6 +100,8 @@ export {
99
100
  ReasoningCard,
100
101
  RichCodeBlock,
101
102
  Shimmer,
103
+ SkillBadge,
104
+ type SkillBadgeProps,
102
105
  type Source,
103
106
  Sources,
104
107
  type SourcesProps,
@@ -10,8 +10,15 @@ export {
10
10
  type CacheLookupResult,
11
11
  } from "./cache-coordinator.js";
12
12
  export type { CachePayload, CacheStore } from "./types.js";
13
- export { APICacheStore, type APICacheStoreOptions } from "./stores/index.js";
14
- export { FilesystemCacheStore, type FilesystemCacheStoreOptions } from "./stores/index.js";
15
- export { KVCacheStore, type KVCacheStoreOptions } from "./stores/index.js";
16
- export { MemoryCacheStore, type MemoryCacheStoreOptions } from "./stores/index.js";
17
- export { RedisCacheStore, type RedisCacheStoreOptions } from "./stores/index.js";
13
+ export {
14
+ APICacheStore,
15
+ type APICacheStoreOptions,
16
+ FilesystemCacheStore,
17
+ type FilesystemCacheStoreOptions,
18
+ KVCacheStore,
19
+ type KVCacheStoreOptions,
20
+ MemoryCacheStore,
21
+ type MemoryCacheStoreOptions,
22
+ RedisCacheStore,
23
+ type RedisCacheStoreOptions,
24
+ } from "./stores/index.js";
@@ -30,7 +30,7 @@ import { join } from "../../platform/compat/path/index.js";
30
30
  import type { MdxBundle, PageBundle } from "../../types/index.js";
31
31
  import type { RuntimeAdapter } from "../../platform/adapters/base.js";
32
32
  import { isExtendedFSAdapter } from "../../platform/adapters/fs/wrapper.js";
33
- import type { CacheCoordinator } from "../cache/cache-coordinator.js";
33
+ import type { CacheLookupResult } from "../cache/cache-coordinator.js";
34
34
  import type { PageRenderer } from "../page-renderer.js";
35
35
  import type { PageResolver } from "../page-resolution/index.js";
36
36
  import type { LayoutOrchestrator } from "./layout.js";
@@ -77,9 +77,19 @@ const resolvePageDataLog = logger.component("resolve-page-data");
77
77
  // Re-export test helper for backward compatibility
78
78
  export { __injectCssCacheForTests } from "./css-cache.js";
79
79
 
80
+ /**
81
+ * Minimal cache interface used by RenderPipeline.
82
+ * Decoupled from the concrete CacheCoordinator class so that Renderer
83
+ * can supply a context-aware adapter without an unsafe `as any` cast.
84
+ */
85
+ export interface PipelineCacheCoordinator {
86
+ checkCache(slug: string, cacheKey?: string): Promise<CacheLookupResult>;
87
+ persistResult(result: RenderResult, slug: string, cacheKey?: string): Promise<void>;
88
+ }
89
+
80
90
  export interface RenderPipelineConfig {
81
91
  pageResolver: PageResolver;
82
- cacheCoordinator: CacheCoordinator;
92
+ cacheCoordinator: PipelineCacheCoordinator;
83
93
  pageRenderer: PageRenderer;
84
94
  layoutOrchestrator: LayoutOrchestrator;
85
95
  ssrOrchestrator: SSROrchestrator;
@@ -518,7 +518,7 @@ export class Renderer {
518
518
 
519
519
  const pipeline = new RenderPipeline({
520
520
  pageResolver,
521
- cacheCoordinator: pipelineCacheCoordinator as any,
521
+ cacheCoordinator: pipelineCacheCoordinator,
522
522
  pageRenderer,
523
523
  layoutOrchestrator,
524
524
  ssrOrchestrator,
@@ -70,11 +70,6 @@ export class ContextAwareCacheCoordinator {
70
70
  await this.store.delete(cacheKey);
71
71
 
72
72
  logger.debug("Cache expired", {
73
- slug,
74
- projectId: ctx.projectId,
75
- });
76
-
77
- logger.debug("Cache miss", {
78
73
  slug,
79
74
  cacheKey,
80
75
  projectId: ctx.projectId,
@@ -9,8 +9,6 @@ export {
9
9
  CacheRepositoryOptionsSchema,
10
10
  type CacheStats,
11
11
  CacheStatsSchema,
12
- type FileSystemRepositoryOptions,
13
- FileSystemRepositoryOptionsSchema,
14
12
  type RepositoryContext,
15
13
  RepositoryContextSchema,
16
14
  } from "./repository.schema.js";
@@ -21,22 +21,7 @@ export const CacheRepositoryOptionsSchema = z.object({
21
21
  maxEntries: z.number().int().positive().optional(),
22
22
  });
23
23
 
24
- export const FileSystemRepositoryOptionsSchema = z.object({
25
- baseDir: z.string(),
26
- securityContext: z
27
- .enum([
28
- "user-input",
29
- "static-serving",
30
- "build",
31
- "internal",
32
- "route-discovery",
33
- "module-loading",
34
- ])
35
- .optional(),
36
- });
37
-
38
24
  // Inferred types
39
25
  export type RepositoryContext = z.infer<typeof RepositoryContextSchema>;
40
26
  export type CacheStats = z.infer<typeof CacheStatsSchema>;
41
27
  export type CacheRepositoryOptions = z.infer<typeof CacheRepositoryOptionsSchema>;
42
- export type FileSystemRepositoryOptions = z.infer<typeof FileSystemRepositoryOptionsSchema>;
@@ -1,12 +1,7 @@
1
1
  import type { DirEntry, FileInfo } from "../platform/adapters/base.js";
2
2
 
3
3
  // Re-export schema-based types
4
- export type {
5
- CacheRepositoryOptions,
6
- CacheStats,
7
- FileSystemRepositoryOptions,
8
- RepositoryContext,
9
- } from "./schemas/index.js";
4
+ export type { CacheRepositoryOptions, CacheStats, RepositoryContext } from "./schemas/index.js";
10
5
 
11
6
  // Import for use in interface definitions
12
7
  import type { CacheStats, RepositoryContext } from "./schemas/index.js";
@@ -16,9 +16,28 @@ import { isDeno, isNode } from "../../../platform/compat/runtime.js";
16
16
  import { withSpan } from "../../../observability/tracing/otlp-setup.js";
17
17
  import { isCompiledBinary } from "../../../utils/index.js";
18
18
  import { wrapWithCurrentContext } from "../../../platform/adapters/fs/veryfront/multi-project-adapter.js";
19
+ import { isWithinDirectory } from "../../../security/path-validation.js";
19
20
 
20
21
  const logger = serverLogger.component("api");
21
22
 
23
+ /**
24
+ * Validates that a module path is contained within the project directory.
25
+ * Prevents path traversal attacks that could load arbitrary files from the host.
26
+ */
27
+ function validateModulePath(modulePath: string, projectDir: string): void {
28
+ const resolved = pathHelper.resolve(modulePath);
29
+ const resolvedProject = pathHelper.resolve(projectDir);
30
+
31
+ if (!isWithinDirectory(resolvedProject, resolved)) {
32
+ throw toError(
33
+ createError({
34
+ type: "api",
35
+ message: `[API] module path escapes project directory: ${modulePath}`,
36
+ }),
37
+ );
38
+ }
39
+ }
40
+
22
41
  /** Node.js built-in module names — shared across the CJS shim, esbuild externals, and Deno rewrites. */
23
42
  const NODE_BUILTINS = [
24
43
  "assert",
@@ -82,13 +101,22 @@ async function readProjectDependencies(
82
101
  function generateCompiledBinaryRequireShim(projectDir: string): string {
83
102
  const builtinSet = JSON.stringify(NODE_BUILTINS);
84
103
  const safeProjectDir = JSON.stringify(projectDir + "/package.json");
104
+ const safeProjectRoot = JSON.stringify(pathHelper.resolve(projectDir));
85
105
 
86
106
  return `
87
107
  import { createRequire as __vf_createRequire } from "node:module";
88
108
  import { dirname as __vf_dirname, resolve as __vf_resolve } from "node:path";
89
109
  var __vf_builtinRequire = __vf_createRequire(${safeProjectDir});
90
110
  var __vf_builtinSet = new Set(${builtinSet});
111
+ var __vf_projectRoot = ${safeProjectRoot};
91
112
  var __vf_cache = Object.create(null);
113
+ function __vf_assertContained(resolved) {
114
+ var norm = __vf_resolve(resolved).replace(/\\\\/g, "/");
115
+ var root = __vf_projectRoot.replace(/\\\\/g, "/");
116
+ if (!norm.startsWith(root + "/") && norm !== root) {
117
+ throw new Error("CJS loader blocked path outside project: " + resolved);
118
+ }
119
+ }
92
120
  function __vf_loadCjs(id, parentDir) {
93
121
  if (id.startsWith("node:")) return __vf_builtinRequire(id);
94
122
  if (__vf_builtinSet.has(id)) return __vf_builtinRequire(id);
@@ -103,6 +131,7 @@ function __vf_loadCjs(id, parentDir) {
103
131
  try { Deno.statSync(resolved + exts[i]); resolved += exts[i]; break; } catch {}
104
132
  }
105
133
  }
134
+ __vf_assertContained(resolved);
106
135
  } else {
107
136
  resolved = __vf_builtinRequire.resolve(id);
108
137
  }
@@ -189,6 +218,8 @@ export function loadHandlerModule(options: LoadModuleOptions): Promise<APIRoute
189
218
  const { projectDir, modulePath, adapter, config } = options;
190
219
  const fs = createFileSystem();
191
220
 
221
+ validateModulePath(modulePath, projectDir);
222
+
192
223
  try {
193
224
  const module = await loadModule({ modulePath, projectDir, adapter, fs, config });
194
225
  return extractAPIRouteHandlers(module);
@@ -312,6 +343,13 @@ function createImportMapPlugin(
312
343
  ? resolvedPath
313
344
  : pathHelper.resolve(projectDir, resolvedPath);
314
345
 
346
+ if (!isWithinDirectory(pathHelper.resolve(projectDir), absolutePath)) {
347
+ logger.error(
348
+ `[API] Import map entry escapes project directory: ${args.path} -> ${absolutePath}`,
349
+ );
350
+ return { errors: [{ text: `Import map path escapes project: ${args.path}` }] };
351
+ }
352
+
315
353
  logger.debug(`Import map resolved: ${args.path} -> ${absolutePath}`);
316
354
 
317
355
  return { path: absolutePath, namespace: "import-map" };
@@ -325,6 +363,7 @@ function createImportMapPlugin(
325
363
  adapter,
326
364
  args.path,
327
365
  FILE_EXTENSIONS,
366
+ projectDir,
328
367
  );
329
368
 
330
369
  return {
@@ -344,7 +383,10 @@ function createImportMapPlugin(
344
383
  }
345
384
 
346
385
  /** Resolves relative imports through the adapter's virtual FS for remote projects. */
347
- function createAdapterResolvePlugin(adapter: RuntimeAdapter): Plugin {
386
+ function createAdapterResolvePlugin(
387
+ adapter: RuntimeAdapter,
388
+ projectDir: string,
389
+ ): Plugin {
348
390
  return {
349
391
  name: "vf-adapter-resolve",
350
392
  setup(build) {
@@ -355,6 +397,16 @@ function createAdapterResolvePlugin(adapter: RuntimeAdapter): Plugin {
355
397
  if (!baseDir) return undefined;
356
398
 
357
399
  const absolutePath = pathHelper.resolve(baseDir, args.path);
400
+
401
+ if (!isWithinDirectory(pathHelper.resolve(projectDir), absolutePath)) {
402
+ logger.error(
403
+ `[API] Adapter resolve path escapes project: ${args.path} -> ${absolutePath}`,
404
+ );
405
+ return {
406
+ errors: [{ text: `Relative import escapes project: ${args.path}` }],
407
+ };
408
+ }
409
+
358
410
  logger.debug(
359
411
  `[API] Adapter resolve: ${args.path} (from ${
360
412
  args.importer || "stdin"
@@ -376,6 +428,7 @@ function createAdapterResolvePlugin(adapter: RuntimeAdapter): Plugin {
376
428
  adapter,
377
429
  args.path,
378
430
  FILE_EXTENSIONS,
431
+ projectDir,
379
432
  );
380
433
 
381
434
  return {
@@ -408,6 +461,7 @@ function loadAndTranspileModule(
408
461
  adapter,
409
462
  modulePath,
410
463
  FILE_EXTENSIONS,
464
+ projectDir,
411
465
  );
412
466
 
413
467
  if (!source) {
@@ -495,7 +549,7 @@ function loadAndTranspileModule(
495
549
  },
496
550
  plugins: [
497
551
  createImportMapPlugin(projectDir, adapter, config),
498
- createAdapterResolvePlugin(adapter),
552
+ createAdapterResolvePlugin(adapter, projectDir),
499
553
  createHTTPPlugin(allowedHosts),
500
554
  ],
501
555
  });
@@ -524,9 +578,25 @@ async function readFileWithExtensions(
524
578
  adapter: RuntimeAdapter,
525
579
  basePath: string,
526
580
  extensions: string[],
581
+ projectDir?: string,
527
582
  ): Promise<{ filePath: string; contents: string }> {
583
+ const resolvedProjectDir = projectDir ? pathHelper.resolve(projectDir) : undefined;
584
+
528
585
  for (const ext of extensions) {
529
586
  const filePath = ext ? basePath + ext : basePath;
587
+
588
+ if (resolvedProjectDir) {
589
+ const resolved = pathHelper.resolve(filePath);
590
+ if (!isWithinDirectory(resolvedProjectDir, resolved)) {
591
+ throw toError(
592
+ createError({
593
+ type: "api",
594
+ message: `[API] file path escapes project directory: ${filePath}`,
595
+ }),
596
+ );
597
+ }
598
+ }
599
+
530
600
  try {
531
601
  const contents = await adapter.fs.readFile(filePath);
532
602
  return { filePath, contents };
@@ -974,11 +1044,26 @@ async function registerVfModules(subpaths: Set<string>): Promise<void> {
974
1044
  Record<string, unknown>
975
1045
  >;
976
1046
 
1047
+ // __VERYFRONT_MODULES__ is populated by the discovery transpiler via hash
1048
+ // imports (#veryfront/...) which resolve correctly in compiled binaries.
1049
+ // Check it first before attempting bare specifier dynamic imports.
1050
+ const discoveryModules = (dntShim.dntGlobalThis as Record<string, unknown>).__VERYFRONT_MODULES__ as
1051
+ | Record<string, Record<string, unknown>>
1052
+ | undefined;
1053
+
977
1054
  for (const subpath of subpaths) {
978
1055
  if (modules[subpath]) continue;
979
1056
 
1057
+ const specifier = `veryfront/${subpath}`;
1058
+
1059
+ const fromDiscovery = discoveryModules?.[specifier];
1060
+ if (fromDiscovery) {
1061
+ modules[subpath] = fromDiscovery;
1062
+ logger.debug(`[API] Registered module ${specifier} from discovery globals`);
1063
+ continue;
1064
+ }
1065
+
980
1066
  try {
981
- const specifier = `veryfront/${subpath}`;
982
1067
  modules[subpath] = await import(specifier) as Record<string, unknown>;
983
1068
  logger.debug(`[API] Registered module ${specifier} on globalThis`);
984
1069
  } catch (e) {
@@ -97,45 +97,6 @@ export function extractPathParams(pattern: string): PathParam[] {
97
97
  return params;
98
98
  }
99
99
 
100
- /**
101
- * Convert file path to route pattern.
102
- *
103
- * Transforms a file system path to an API route pattern.
104
- *
105
- * @param filePath - File path relative to pages/api or app directory
106
- * @param routePrefix - Prefix to add (e.g., "/api")
107
- * @returns Route pattern
108
- *
109
- * @example
110
- * ```typescript
111
- * filePathToPattern("users/[id]/route.ts", "/api")
112
- * // → "/api/users/[id]"
113
- *
114
- * filePathToPattern("users/[id].ts", "/api")
115
- * // → "/api/users/[id]"
116
- * ```
117
- */
118
- export function filePathToPattern(filePath: string, routePrefix: string = ""): string {
119
- let pattern = filePath
120
- .replace(/\.(ts|tsx|js|jsx)$/, "")
121
- .replace(/\/route$/, "")
122
- .replace(/\/index$/, "");
123
-
124
- if (!pattern.startsWith("/")) pattern = `/${pattern}`;
125
-
126
- if (routePrefix && !pattern.startsWith(routePrefix)) {
127
- pattern = `${routePrefix}${pattern}`;
128
- }
129
-
130
- pattern = pattern.replace(/\/+/g, "/");
131
-
132
- if (pattern.length > 1 && pattern.endsWith("/")) {
133
- pattern = pattern.slice(0, -1);
134
- }
135
-
136
- return pattern;
137
- }
138
-
139
100
  /**
140
101
  * Generate a unique operation ID from method and path.
141
102
  *
@@ -11,6 +11,7 @@ import type { VeryfrontConfig } from "../../../config/index.js";
11
11
  import type { DynamicRouter, RouteEntry } from "../api-route-matcher.js";
12
12
  import { loadHandlerModule } from "../module-loader/loader.js";
13
13
  import {
14
+ getDefaultStatusDescription,
14
15
  OPENAPI_METADATA,
15
16
  type OpenAPIOperation,
16
17
  type OpenAPIParameter,
@@ -261,23 +262,3 @@ function toYaml(obj: unknown, indent: number): string {
261
262
 
262
263
  return String(obj);
263
264
  }
264
-
265
- function getDefaultStatusDescription(statusCode: number): string {
266
- const descriptions: Record<number, string> = {
267
- 200: "Successful response",
268
- 201: "Resource created",
269
- 204: "No content",
270
- 400: "Bad request",
271
- 401: "Unauthorized",
272
- 403: "Forbidden",
273
- 404: "Not found",
274
- 409: "Conflict",
275
- 422: "Unprocessable entity",
276
- 429: "Too many requests",
277
- 500: "Internal server error",
278
- 502: "Bad gateway",
279
- 503: "Service unavailable",
280
- };
281
-
282
- return descriptions[statusCode] || `Response with status ${statusCode}`;
283
- }
@@ -113,3 +113,23 @@ export interface OpenAPIResponse {
113
113
  "application/json"?: { schema: JsonSchema };
114
114
  };
115
115
  }
116
+
117
+ const STATUS_DESCRIPTIONS: Record<number, string> = {
118
+ 200: "Successful response",
119
+ 201: "Resource created",
120
+ 204: "No content",
121
+ 400: "Bad request",
122
+ 401: "Unauthorized",
123
+ 403: "Forbidden",
124
+ 404: "Not found",
125
+ 409: "Conflict",
126
+ 422: "Unprocessable entity",
127
+ 429: "Too many requests",
128
+ 500: "Internal server error",
129
+ 502: "Bad gateway",
130
+ 503: "Service unavailable",
131
+ };
132
+
133
+ export function getDefaultStatusDescription(statusCode: number): string {
134
+ return STATUS_DESCRIPTIONS[statusCode] ?? `Response with status ${statusCode}`;
135
+ }
@@ -40,13 +40,17 @@ export class Sandbox {
40
40
  private apiUrl: string,
41
41
  ) {}
42
42
 
43
- /** Create a new sandbox session. Claims a warm pod or creates a new one. */
44
- static async create(options: SandboxOptions): Promise<Sandbox> {
45
- const apiUrl = options.apiUrl ||
43
+ private static resolveApiUrl(options: SandboxOptions): string {
44
+ return options.apiUrl ||
46
45
  (typeof dntShim.Deno !== "undefined"
47
46
  ? dntShim.Deno.env.get("VERYFRONT_API_URL")
48
47
  : process.env.VERYFRONT_API_URL) ||
49
48
  "https://api.veryfront.com";
49
+ }
50
+
51
+ /** Create a new sandbox session. Claims a warm pod or creates a new one. */
52
+ static async create(options: SandboxOptions): Promise<Sandbox> {
53
+ const apiUrl = Sandbox.resolveApiUrl(options);
50
54
 
51
55
  const res = await dntShim.fetch(`${apiUrl}/sandbox-sessions`, {
52
56
  method: "POST",
@@ -72,11 +76,7 @@ export class Sandbox {
72
76
 
73
77
  /** Reconnect to an existing sandbox session. */
74
78
  static async get(id: string, options: SandboxOptions): Promise<Sandbox> {
75
- const apiUrl = options.apiUrl ||
76
- (typeof dntShim.Deno !== "undefined"
77
- ? dntShim.Deno.env.get("VERYFRONT_API_URL")
78
- : process.env.VERYFRONT_API_URL) ||
79
- "https://api.veryfront.com";
79
+ const apiUrl = Sandbox.resolveApiUrl(options);
80
80
 
81
81
  const res = await dntShim.fetch(`${apiUrl}/sandbox-sessions/${id}`, {
82
82
  headers: { Authorization: `Bearer ${options.authToken}` },
@@ -1,10 +1,6 @@
1
- import { DEV_LOCALHOST_ORIGINS } from "../../../config/index.js";
2
-
3
1
  export const DEFAULT_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
4
2
  export const DEFAULT_HEADERS = ["Content-Type", "Authorization"];
5
3
  export const DEFAULT_MAX_AGE = 86400;
6
4
 
7
- export { DEV_LOCALHOST_ORIGINS };
8
-
9
5
  export const HTTP_NO_CONTENT = 204;
10
6
  export const HTTP_FORBIDDEN = 403;
@@ -4,14 +4,8 @@
4
4
  * @module security/http/response
5
5
  */
6
6
 
7
- export type { CacheStrategy, CORSConfig, ResponseBuilderConfig, SecurityConfig } from "./types.js";
8
- export { CACHE_DURATIONS, CONTENT_TYPES } from "./constants.js";
7
+ export type { CacheStrategy, ResponseBuilderConfig } from "./types.js";
8
+ export { CACHE_DURATIONS } from "./constants.js";
9
9
  export { createResponseBuilder, ResponseBuilder } from "./builder.js";
10
- export { applyCORSHeaders, shouldApplyCORS } from "../cors/index.js";
11
- export {
12
- applySecurityHeaders,
13
- buildCSP,
14
- generateNonce,
15
- getSecurityHeader,
16
- } from "./security-handler.js";
10
+ export { applySecurityHeaders, generateNonce, getSecurityHeader } from "./security-handler.js";
17
11
  export { buildCacheControl } from "./cache-handler.js";
@@ -103,25 +103,7 @@ export function buildEnrichedContext(options: BuildEnrichedContextOptions): Enri
103
103
  };
104
104
  }
105
105
 
106
- export function toRequestContext(enriched: EnrichedContext): {
107
- token: string;
108
- slug: string;
109
- branch: string | null;
110
- mode: Environment;
111
- } {
112
- return {
113
- token: enriched.token,
114
- slug: enriched.projectSlug,
115
- branch: enriched.branch,
116
- mode: enriched.environment,
117
- };
118
- }
119
-
120
- export function shouldEnableCacheFromEnriched(enriched: EnrichedContext): boolean {
121
- return !enriched.isLocalProject && enriched.environment !== "preview";
122
- }
123
-
124
- export function shouldUseNoCacheHeadersFromEnriched(enriched: EnrichedContext): boolean {
106
+ function shouldUseNoCacheHeadersFromEnriched(enriched: EnrichedContext): boolean {
125
107
  return enriched.isLocalProject || enriched.environment === "preview";
126
108
  }
127
109