veryfront 0.1.1237 → 0.1.1239

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 (493) hide show
  1. package/esm/cli/auth/login.d.ts +24 -2
  2. package/esm/cli/auth/login.d.ts.map +1 -1
  3. package/esm/cli/auth/login.js +444 -35
  4. package/esm/cli/commands/build/error-handler.d.ts.map +1 -1
  5. package/esm/cli/commands/build/error-handler.js +41 -3
  6. package/esm/cli/commands/build/handler.d.ts.map +1 -1
  7. package/esm/cli/commands/build/handler.js +1 -1
  8. package/esm/cli/commands/dev/command.d.ts.map +1 -1
  9. package/esm/cli/commands/dev/command.js +14 -1
  10. package/esm/cli/commands/dev/inference-status.d.ts +6 -0
  11. package/esm/cli/commands/dev/inference-status.d.ts.map +1 -1
  12. package/esm/cli/commands/dev/inference-status.js +14 -2
  13. package/esm/cli/commands/generate/command.d.ts.map +1 -1
  14. package/esm/cli/commands/generate/command.js +61 -0
  15. package/esm/cli/commands/init/init-command.d.ts.map +1 -1
  16. package/esm/cli/commands/init/init-command.js +23 -31
  17. package/esm/cli/commands/install/registry.d.ts.map +1 -1
  18. package/esm/cli/commands/install/registry.js +6 -9
  19. package/esm/cli/commands/login/command-help.d.ts.map +1 -1
  20. package/esm/cli/commands/login/command-help.js +3 -1
  21. package/esm/cli/commands/pull/command.d.ts +1 -0
  22. package/esm/cli/commands/pull/command.d.ts.map +1 -1
  23. package/esm/cli/commands/pull/command.js +49 -6
  24. package/esm/cli/commands/push/command-help.d.ts.map +1 -1
  25. package/esm/cli/commands/push/command-help.js +7 -0
  26. package/esm/cli/commands/push/command.d.ts +23 -12
  27. package/esm/cli/commands/push/command.d.ts.map +1 -1
  28. package/esm/cli/commands/push/command.js +461 -44
  29. package/esm/cli/commands/push/plan.d.ts +35 -0
  30. package/esm/cli/commands/push/plan.d.ts.map +1 -0
  31. package/esm/cli/commands/push/plan.js +96 -0
  32. package/esm/cli/commands/schedule/handler.d.ts +21 -2
  33. package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
  34. package/esm/cli/commands/schedule/handler.js +74 -27
  35. package/esm/cli/commands/schema/command-help.js +1 -1
  36. package/esm/cli/commands/up/command.js +1 -1
  37. package/esm/cli/commands/webhook/handler.d.ts.map +1 -1
  38. package/esm/cli/commands/webhook/handler.js +3 -1
  39. package/esm/cli/router.d.ts.map +1 -1
  40. package/esm/cli/router.js +27 -5
  41. package/esm/cli/shared/args.d.ts +15 -1
  42. package/esm/cli/shared/args.d.ts.map +1 -1
  43. package/esm/cli/shared/args.js +56 -3
  44. package/esm/cli/shared/config.d.ts +11 -2
  45. package/esm/cli/shared/config.d.ts.map +1 -1
  46. package/esm/cli/shared/config.js +72 -27
  47. package/esm/cli/shared/project-creation.js +1 -1
  48. package/esm/cli/sync/state.d.ts +20 -0
  49. package/esm/cli/sync/state.d.ts.map +1 -0
  50. package/esm/cli/sync/state.js +193 -0
  51. package/esm/deno.js +2 -2
  52. package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.d.ts.map +1 -1
  53. package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.js +852 -21
  54. package/esm/extensions/ext-observability-sentry/src/policy.d.ts +2 -0
  55. package/esm/extensions/ext-observability-sentry/src/policy.d.ts.map +1 -1
  56. package/esm/extensions/ext-observability-sentry/src/policy.js +214 -3
  57. package/esm/src/agent/conversation/delegation-policy.d.ts +2 -0
  58. package/esm/src/agent/conversation/delegation-policy.d.ts.map +1 -1
  59. package/esm/src/agent/conversation/delegation-policy.js +13 -3
  60. package/esm/src/agent/conversation/hosted-terminal.d.ts.map +1 -1
  61. package/esm/src/agent/conversation/hosted-terminal.js +6 -2
  62. package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
  63. package/esm/src/agent/conversation/run-chunk-mirror.js +14 -2
  64. package/esm/src/agent/factory.d.ts.map +1 -1
  65. package/esm/src/agent/factory.js +22 -11
  66. package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +2 -0
  67. package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
  68. package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +6 -1
  69. package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +2 -1
  70. package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
  71. package/esm/src/agent/hosted/child-fork-execution-runner.js +6 -3
  72. package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +12 -3
  73. package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -1
  74. package/esm/src/agent/hosted/child-fork-step-message-preparation.js +16 -3
  75. package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts +1 -1
  76. package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -1
  77. package/esm/src/agent/hosted/cloud-agent-chat-execution.js +3 -3
  78. package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +11 -0
  79. package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -1
  80. package/esm/src/agent/hosted/cloud-agent-child-tools.js +2 -3
  81. package/esm/src/agent/hosted/cloud-agent-config.d.ts +1 -0
  82. package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -1
  83. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts +16 -1
  84. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts.map +1 -1
  85. package/esm/src/agent/hosted/cloud-runtime-system-messages.js +13 -3
  86. package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -1
  87. package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
  88. package/esm/src/agent/hosted/default-chat-runtime.js +18 -7
  89. package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts +2 -1
  90. package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts.map +1 -1
  91. package/esm/src/agent/hosted/default-invoke-agent-tool.js +11 -3
  92. package/esm/src/agent/hosted/default-project-steering-refresh.d.ts +2 -1
  93. package/esm/src/agent/hosted/default-project-steering-refresh.d.ts.map +1 -1
  94. package/esm/src/agent/hosted/default-project-steering-refresh.js +4 -1
  95. package/esm/src/agent/hosted/runtime-state-resolver.d.ts +6 -4
  96. package/esm/src/agent/hosted/runtime-state-resolver.d.ts.map +1 -1
  97. package/esm/src/agent/hosted/runtime-state-resolver.js +8 -11
  98. package/esm/src/agent/index.d.ts +3 -3
  99. package/esm/src/agent/index.d.ts.map +1 -1
  100. package/esm/src/agent/project/agent-runtime.d.ts.map +1 -1
  101. package/esm/src/agent/project/agent-runtime.js +6 -3
  102. package/esm/src/agent/runtime/agent-definition.d.ts +68 -66
  103. package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
  104. package/esm/src/agent/runtime/agent-definition.js +15 -2
  105. package/esm/src/agent/runtime/agent-invocation-contract.d.ts +2 -0
  106. package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
  107. package/esm/src/agent/runtime/agent-markdown-adapter.js +1 -1
  108. package/esm/src/agent/runtime/agent-runtime-step.d.ts +11 -5
  109. package/esm/src/agent/runtime/agent-runtime-step.d.ts.map +1 -1
  110. package/esm/src/agent/runtime/agent-runtime-step.js +23 -6
  111. package/esm/src/agent/runtime/call-context.d.ts +42 -11
  112. package/esm/src/agent/runtime/call-context.d.ts.map +1 -1
  113. package/esm/src/agent/runtime/call-context.js +480 -42
  114. package/esm/src/agent/runtime/chat-stream-handler.d.ts +18 -0
  115. package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
  116. package/esm/src/agent/runtime/chat-stream-handler.js +38 -18
  117. package/esm/src/agent/runtime/effective-agent-system.d.ts +13 -4
  118. package/esm/src/agent/runtime/effective-agent-system.d.ts.map +1 -1
  119. package/esm/src/agent/runtime/effective-agent-system.js +29 -0
  120. package/esm/src/agent/runtime/index.d.ts +1 -0
  121. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  122. package/esm/src/agent/runtime/index.js +638 -53
  123. package/esm/src/agent/runtime/load-skill-tool.d.ts +33 -3
  124. package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -1
  125. package/esm/src/agent/runtime/load-skill-tool.js +152 -21
  126. package/esm/src/agent/runtime/model-resolution.d.ts +3 -0
  127. package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
  128. package/esm/src/agent/runtime/model-resolution.js +14 -0
  129. package/esm/src/agent/runtime/model-transport.d.ts +1 -0
  130. package/esm/src/agent/runtime/model-transport.d.ts.map +1 -1
  131. package/esm/src/agent/runtime/model-transport.js +5 -2
  132. package/esm/src/agent/runtime/run-runtime-context.d.ts +4 -0
  133. package/esm/src/agent/runtime/run-runtime-context.d.ts.map +1 -1
  134. package/esm/src/agent/runtime/run-runtime-context.js +9 -3
  135. package/esm/src/agent/runtime/runtime-tool-config.d.ts +1 -0
  136. package/esm/src/agent/runtime/runtime-tool-config.d.ts.map +1 -1
  137. package/esm/src/agent/runtime/skill-prompt.d.ts +3 -0
  138. package/esm/src/agent/runtime/skill-prompt.d.ts.map +1 -1
  139. package/esm/src/agent/runtime/skill-prompt.js +113 -25
  140. package/esm/src/agent/runtime/streamed-assistant-message.d.ts +22 -2
  141. package/esm/src/agent/runtime/streamed-assistant-message.d.ts.map +1 -1
  142. package/esm/src/agent/runtime/streamed-assistant-message.js +26 -5
  143. package/esm/src/agent/runtime/tool-inventory.d.ts.map +1 -1
  144. package/esm/src/agent/runtime/tool-inventory.js +13 -9
  145. package/esm/src/agent/runtime/tool-result-continuation.d.ts +4 -2
  146. package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
  147. package/esm/src/agent/runtime/tool-result-continuation.js +24 -20
  148. package/esm/src/agent/schemas/agent.schema.d.ts +2 -2
  149. package/esm/src/agent/service/runtime.js +1 -1
  150. package/esm/src/agent/streaming/fork-runtime-stream.d.ts +5 -4
  151. package/esm/src/agent/streaming/fork-runtime-stream.d.ts.map +1 -1
  152. package/esm/src/agent/types.d.ts +14 -1
  153. package/esm/src/agent/types.d.ts.map +1 -1
  154. package/esm/src/chat/chat-ui-message-helpers.d.ts.map +1 -1
  155. package/esm/src/chat/chat-ui-message-helpers.js +75 -16
  156. package/esm/src/config/loader.d.ts.map +1 -1
  157. package/esm/src/config/loader.js +37 -1
  158. package/esm/src/errors/catalog/build-errors.d.ts.map +1 -1
  159. package/esm/src/errors/catalog/build-errors.js +14 -0
  160. package/esm/src/errors/error-registry/build.d.ts +2 -0
  161. package/esm/src/errors/error-registry/build.d.ts.map +1 -1
  162. package/esm/src/errors/error-registry/build.js +8 -0
  163. package/esm/src/errors/error-registry/deploy.d.ts +4 -0
  164. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -1
  165. package/esm/src/errors/error-registry/deploy.js +16 -0
  166. package/esm/src/errors/error-registry.d.ts +3 -0
  167. package/esm/src/errors/error-registry.d.ts.map +1 -1
  168. package/esm/src/errors/index.d.ts +2 -1
  169. package/esm/src/errors/index.d.ts.map +1 -1
  170. package/esm/src/errors/index.js +4 -3
  171. package/esm/src/errors/tenant-classification.d.ts +25 -0
  172. package/esm/src/errors/tenant-classification.d.ts.map +1 -0
  173. package/esm/src/errors/tenant-classification.js +61 -0
  174. package/esm/src/extensions/builtin-extensions.d.ts +10 -15
  175. package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
  176. package/esm/src/extensions/builtin-extensions.js +32 -26
  177. package/esm/src/extensions/deferred-extension.d.ts +4 -4
  178. package/esm/src/extensions/deferred-extension.js +4 -4
  179. package/esm/src/extensions/index.d.ts +1 -0
  180. package/esm/src/extensions/index.d.ts.map +1 -1
  181. package/esm/src/extensions/index.js +1 -0
  182. package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
  183. package/esm/src/integrations/_data.d.ts.map +1 -1
  184. package/esm/src/integrations/_data.js +6 -0
  185. package/esm/src/integrations/schema.d.ts +8 -0
  186. package/esm/src/integrations/schema.d.ts.map +1 -1
  187. package/esm/src/integrations/schema.js +3 -0
  188. package/esm/src/integrations/types.d.ts +2 -0
  189. package/esm/src/integrations/types.d.ts.map +1 -1
  190. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  191. package/esm/src/internal-agents/run-stream.js +35 -20
  192. package/esm/src/internal-agents/run-system-prompt.d.ts +7 -2
  193. package/esm/src/internal-agents/run-system-prompt.d.ts.map +1 -1
  194. package/esm/src/internal-agents/run-system-prompt.js +19 -13
  195. package/esm/src/internal-agents/schema.d.ts +2 -0
  196. package/esm/src/internal-agents/schema.d.ts.map +1 -1
  197. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
  198. package/esm/src/modules/react-loader/ssr-module-loader/loader.js +2 -18
  199. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts +11 -0
  200. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts.map +1 -1
  201. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.js +53 -6
  202. package/esm/src/observability/application-error-contract.d.ts +4 -0
  203. package/esm/src/observability/application-error-contract.d.ts.map +1 -1
  204. package/esm/src/observability/application-errors.d.ts.map +1 -1
  205. package/esm/src/observability/application-errors.js +64 -3
  206. package/esm/src/platform/adapters/runtime/deno/http-server.d.ts.map +1 -1
  207. package/esm/src/platform/adapters/runtime/deno/http-server.js +2 -10
  208. package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts +14 -0
  209. package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts.map +1 -1
  210. package/esm/src/platform/adapters/runtime/shared/request-peer.js +82 -0
  211. package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
  212. package/esm/src/provider/runtime-loader/provider-http.d.ts +5 -1
  213. package/esm/src/provider/runtime-loader/provider-http.d.ts.map +1 -1
  214. package/esm/src/provider/runtime-loader/provider-http.js +55 -17
  215. package/esm/src/provider/shared/index.d.ts +1 -0
  216. package/esm/src/provider/shared/index.d.ts.map +1 -1
  217. package/esm/src/provider/shared/index.js +2 -0
  218. package/esm/src/provider/types.d.ts +1 -0
  219. package/esm/src/provider/types.d.ts.map +1 -1
  220. package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts +3 -0
  221. package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts.map +1 -0
  222. package/esm/src/react/components/ui/adapter/builtin/combobox.js +204 -0
  223. package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts +3 -0
  224. package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts.map +1 -0
  225. package/esm/src/react/components/ui/adapter/builtin/dialog.js +20 -0
  226. package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts +3 -0
  227. package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts.map +1 -0
  228. package/esm/src/react/components/ui/adapter/builtin/drawer.js +21 -0
  229. package/esm/src/react/components/ui/adapter/builtin/index.d.ts.map +1 -1
  230. package/esm/src/react/components/ui/adapter/builtin/index.js +10 -0
  231. package/esm/src/react/components/ui/adapter/builtin/popover.d.ts +3 -0
  232. package/esm/src/react/components/ui/adapter/builtin/popover.d.ts.map +1 -0
  233. package/esm/src/react/components/ui/adapter/builtin/popover.js +28 -0
  234. package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts +3 -0
  235. package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts.map +1 -0
  236. package/esm/src/react/components/ui/adapter/builtin/tabs.js +73 -0
  237. package/esm/src/react/components/ui/adapter/context.d.ts.map +1 -1
  238. package/esm/src/react/components/ui/adapter/context.js +10 -0
  239. package/esm/src/react/components/ui/adapter/contract.d.ts +212 -0
  240. package/esm/src/react/components/ui/adapter/contract.d.ts.map +1 -1
  241. package/esm/src/react/components/ui/adapter/token-scope.d.ts +24 -0
  242. package/esm/src/react/components/ui/adapter/token-scope.d.ts.map +1 -0
  243. package/esm/src/react/components/ui/adapter/token-scope.js +26 -0
  244. package/esm/src/react/components/ui/alert-dialog.d.ts +101 -0
  245. package/esm/src/react/components/ui/alert-dialog.d.ts.map +1 -0
  246. package/esm/src/react/components/ui/alert-dialog.js +181 -0
  247. package/esm/src/react/components/ui/aspect-ratio.d.ts +18 -0
  248. package/esm/src/react/components/ui/aspect-ratio.d.ts.map +1 -0
  249. package/esm/src/react/components/ui/aspect-ratio.js +13 -0
  250. package/esm/src/react/components/ui/autocomplete.d.ts +67 -0
  251. package/esm/src/react/components/ui/autocomplete.d.ts.map +1 -0
  252. package/esm/src/react/components/ui/autocomplete.js +59 -0
  253. package/esm/src/react/components/ui/breadcrumb.d.ts +86 -0
  254. package/esm/src/react/components/ui/breadcrumb.d.ts.map +1 -0
  255. package/esm/src/react/components/ui/breadcrumb.js +67 -0
  256. package/esm/src/react/components/ui/calendar.d.ts +40 -0
  257. package/esm/src/react/components/ui/calendar.d.ts.map +1 -0
  258. package/esm/src/react/components/ui/calendar.js +170 -0
  259. package/esm/src/react/components/ui/combobox.d.ts +74 -0
  260. package/esm/src/react/components/ui/combobox.d.ts.map +1 -0
  261. package/esm/src/react/components/ui/combobox.js +100 -0
  262. package/esm/src/react/components/ui/context-menu.d.ts +116 -0
  263. package/esm/src/react/components/ui/context-menu.d.ts.map +1 -0
  264. package/esm/src/react/components/ui/context-menu.js +168 -0
  265. package/esm/src/react/components/ui/date-picker.d.ts +69 -0
  266. package/esm/src/react/components/ui/date-picker.d.ts.map +1 -0
  267. package/esm/src/react/components/ui/date-picker.js +96 -0
  268. package/esm/src/react/components/ui/dialog.d.ts +41 -11
  269. package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
  270. package/esm/src/react/components/ui/dialog.js +47 -28
  271. package/esm/src/react/components/ui/drawer.d.ts +31 -8
  272. package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
  273. package/esm/src/react/components/ui/drawer.js +33 -22
  274. package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
  275. package/esm/src/react/components/ui/dropdown-menu.js +7 -75
  276. package/esm/src/react/components/ui/field.d.ts +70 -0
  277. package/esm/src/react/components/ui/field.d.ts.map +1 -0
  278. package/esm/src/react/components/ui/field.js +161 -0
  279. package/esm/src/react/components/ui/file-type.d.ts +9 -8
  280. package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
  281. package/esm/src/react/components/ui/file-type.js +8 -8
  282. package/esm/src/react/components/ui/hover-card.d.ts +82 -0
  283. package/esm/src/react/components/ui/hover-card.d.ts.map +1 -0
  284. package/esm/src/react/components/ui/hover-card.js +140 -0
  285. package/esm/src/react/components/ui/index.d.ts +23 -2
  286. package/esm/src/react/components/ui/index.d.ts.map +1 -1
  287. package/esm/src/react/components/ui/index.js +21 -0
  288. package/esm/src/react/components/ui/input-otp.d.ts +37 -0
  289. package/esm/src/react/components/ui/input-otp.d.ts.map +1 -0
  290. package/esm/src/react/components/ui/input-otp.js +42 -0
  291. package/esm/src/react/components/ui/menu-keyboard.d.ts +8 -0
  292. package/esm/src/react/components/ui/menu-keyboard.d.ts.map +1 -0
  293. package/esm/src/react/components/ui/menu-keyboard.js +76 -0
  294. package/esm/src/react/components/ui/menubar.d.ts +98 -0
  295. package/esm/src/react/components/ui/menubar.d.ts.map +1 -0
  296. package/esm/src/react/components/ui/menubar.js +173 -0
  297. package/esm/src/react/components/ui/meter.d.ts +45 -0
  298. package/esm/src/react/components/ui/meter.d.ts.map +1 -0
  299. package/esm/src/react/components/ui/meter.js +59 -0
  300. package/esm/src/react/components/ui/modal-surface.d.ts +7 -1
  301. package/esm/src/react/components/ui/modal-surface.d.ts.map +1 -1
  302. package/esm/src/react/components/ui/modal-surface.js +23 -6
  303. package/esm/src/react/components/ui/navigation-menu.d.ts +101 -0
  304. package/esm/src/react/components/ui/navigation-menu.d.ts.map +1 -0
  305. package/esm/src/react/components/ui/navigation-menu.js +195 -0
  306. package/esm/src/react/components/ui/number-field.d.ts +46 -0
  307. package/esm/src/react/components/ui/number-field.d.ts.map +1 -0
  308. package/esm/src/react/components/ui/number-field.js +121 -0
  309. package/esm/src/react/components/ui/pagination.d.ts +77 -0
  310. package/esm/src/react/components/ui/pagination.d.ts.map +1 -0
  311. package/esm/src/react/components/ui/pagination.js +62 -0
  312. package/esm/src/react/components/ui/popover.d.ts +42 -13
  313. package/esm/src/react/components/ui/popover.d.ts.map +1 -1
  314. package/esm/src/react/components/ui/popover.js +25 -12
  315. package/esm/src/react/components/ui/scroll-area.d.ts +38 -0
  316. package/esm/src/react/components/ui/scroll-area.d.ts.map +1 -0
  317. package/esm/src/react/components/ui/scroll-area.js +35 -0
  318. package/esm/src/react/components/ui/separator.d.ts +20 -0
  319. package/esm/src/react/components/ui/separator.d.ts.map +1 -0
  320. package/esm/src/react/components/ui/separator.js +13 -0
  321. package/esm/src/react/components/ui/slider.d.ts +44 -0
  322. package/esm/src/react/components/ui/slider.d.ts.map +1 -0
  323. package/esm/src/react/components/ui/slider.js +46 -0
  324. package/esm/src/react/components/ui/status.d.ts +6 -5
  325. package/esm/src/react/components/ui/status.d.ts.map +1 -1
  326. package/esm/src/react/components/ui/status.js +4 -4
  327. package/esm/src/react/components/ui/tabs.d.ts +32 -9
  328. package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
  329. package/esm/src/react/components/ui/tabs.js +46 -22
  330. package/esm/src/react/components/ui/toggle.d.ts +26 -0
  331. package/esm/src/react/components/ui/toggle.d.ts.map +1 -0
  332. package/esm/src/react/components/ui/toggle.js +29 -0
  333. package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts +2 -1
  334. package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts.map +1 -1
  335. package/esm/src/react/components/ui/use-isomorphic-layout-effect.js +6 -3
  336. package/esm/src/rendering/chunk-optimizer/source-imports.d.ts.map +1 -1
  337. package/esm/src/rendering/chunk-optimizer/source-imports.js +4 -114
  338. package/esm/src/rendering/orchestrator/css-candidate-manifest.d.ts.map +1 -1
  339. package/esm/src/rendering/orchestrator/css-candidate-manifest.js +30 -1
  340. package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts +10 -0
  341. package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts.map +1 -1
  342. package/esm/src/rendering/orchestrator/module-loader/build-failure.js +50 -3
  343. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts +2 -0
  344. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
  345. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +21 -6
  346. package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -1
  347. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  348. package/esm/src/rendering/orchestrator/module-loader/index.js +190 -7
  349. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +4 -0
  350. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
  351. package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +374 -7
  352. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  353. package/esm/src/rendering/orchestrator/pipeline.js +12 -1
  354. package/esm/src/runs/runs-client.d.ts +2 -4
  355. package/esm/src/runs/runs-client.d.ts.map +1 -1
  356. package/esm/src/runs/schemas.d.ts +18 -8
  357. package/esm/src/runs/schemas.d.ts.map +1 -1
  358. package/esm/src/runs/schemas.js +26 -0
  359. package/esm/src/runtime/model-call-context.d.ts +6 -1
  360. package/esm/src/runtime/model-call-context.d.ts.map +1 -1
  361. package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
  362. package/esm/src/runtime/runtime-bridge.js +133 -15
  363. package/esm/src/schedule/factory.d.ts +8 -2
  364. package/esm/src/schedule/factory.d.ts.map +1 -1
  365. package/esm/src/schedule/factory.js +0 -8
  366. package/esm/src/schedule/index.d.ts +10 -1
  367. package/esm/src/schedule/index.d.ts.map +1 -1
  368. package/esm/src/schedule/index.js +9 -0
  369. package/esm/src/schedule/types.d.ts +30 -11
  370. package/esm/src/schedule/types.d.ts.map +1 -1
  371. package/esm/src/schedule/validation.d.ts +17 -0
  372. package/esm/src/schedule/validation.d.ts.map +1 -1
  373. package/esm/src/schedule/validation.js +93 -5
  374. package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
  375. package/esm/src/security/sandbox/worker-pool.js +6 -1
  376. package/esm/src/server/bootstrap.d.ts.map +1 -1
  377. package/esm/src/server/bootstrap.js +6 -0
  378. package/esm/src/server/dev-server/index.d.ts +1 -1
  379. package/esm/src/server/dev-server/index.d.ts.map +1 -1
  380. package/esm/src/server/dev-server/server.d.ts +7 -3
  381. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  382. package/esm/src/server/dev-server/server.js +12 -3
  383. package/esm/src/server/dev-server/types.d.ts +7 -1
  384. package/esm/src/server/dev-server/types.d.ts.map +1 -1
  385. package/esm/src/server/dev-server.d.ts +1 -1
  386. package/esm/src/server/dev-server.d.ts.map +1 -1
  387. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  388. package/esm/src/server/handlers/dev/framework-candidates.generated.js +2509 -34
  389. package/esm/src/server/handlers/dev/projects/index.d.ts.map +1 -1
  390. package/esm/src/server/handlers/dev/projects/index.js +3 -0
  391. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  392. package/esm/src/server/handlers/request/agent-stream.handler.js +29 -24
  393. package/esm/src/server/index.d.ts +3 -3
  394. package/esm/src/server/index.d.ts.map +1 -1
  395. package/esm/src/server/index.js +10 -5
  396. package/esm/src/server/node-handler.d.ts.map +1 -1
  397. package/esm/src/server/node-handler.js +4 -1
  398. package/esm/src/server/production-server.d.ts.map +1 -1
  399. package/esm/src/server/production-server.js +2 -1
  400. package/esm/src/server/project-env/cache.d.ts +17 -0
  401. package/esm/src/server/project-env/cache.d.ts.map +1 -1
  402. package/esm/src/server/project-env/cache.js +78 -2
  403. package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
  404. package/esm/src/server/project-env/fetcher.js +24 -14
  405. package/esm/src/server/project-env/index.d.ts +1 -1
  406. package/esm/src/server/project-env/index.d.ts.map +1 -1
  407. package/esm/src/server/project-env/index.js +1 -1
  408. package/esm/src/server/project-env/internal-authorization.d.ts +7 -0
  409. package/esm/src/server/project-env/internal-authorization.d.ts.map +1 -0
  410. package/esm/src/server/project-env/internal-authorization.js +32 -0
  411. package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
  412. package/esm/src/server/runtime-handler/index.js +1 -1
  413. package/esm/src/server/runtime-handler/projects-handler.d.ts +1 -1
  414. package/esm/src/server/runtime-handler/projects-handler.d.ts.map +1 -1
  415. package/esm/src/server/runtime-handler/projects-handler.js +4 -2
  416. package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
  417. package/esm/src/transforms/esm/http-bundler.js +6 -5
  418. package/esm/src/transforms/esm/http-cache-helpers.d.ts +11 -0
  419. package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
  420. package/esm/src/transforms/esm/http-cache-helpers.js +35 -0
  421. package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
  422. package/esm/src/transforms/esm/http-cache.js +16 -10
  423. package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
  424. package/esm/src/transforms/esm/specifier-resolver.js +87 -7
  425. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts +2 -0
  426. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts.map +1 -1
  427. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.js +11 -6
  428. package/esm/src/transforms/md/compiler/md-compiler.d.ts.map +1 -1
  429. package/esm/src/transforms/md/compiler/md-compiler.js +12 -5
  430. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +2 -0
  431. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -1
  432. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +33 -1
  433. package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts.map +1 -1
  434. package/esm/src/transforms/mdx/compiler/mdx-compiler.js +46 -7
  435. package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
  436. package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +8 -2
  437. package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +1 -0
  438. package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
  439. package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +3 -0
  440. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts +4 -0
  441. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
  442. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +44 -8
  443. package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts +2 -0
  444. package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
  445. package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -0
  446. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
  447. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +5 -1
  448. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts +2 -0
  449. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts.map +1 -1
  450. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.js +50 -11
  451. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts +24 -12
  452. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts.map +1 -1
  453. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.js +201 -18
  454. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +5 -0
  455. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
  456. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts +22 -2
  457. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts.map +1 -1
  458. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.js +2080 -129
  459. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts +11 -1
  460. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts.map +1 -1
  461. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +32 -15
  462. package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
  463. package/esm/src/transforms/pipeline/stages/compile.js +44 -0
  464. package/esm/src/transforms/shared/specifier-suffix.d.ts +25 -0
  465. package/esm/src/transforms/shared/specifier-suffix.d.ts.map +1 -0
  466. package/esm/src/transforms/shared/specifier-suffix.js +43 -0
  467. package/esm/src/trigger/index.d.ts +2 -2
  468. package/esm/src/trigger/index.d.ts.map +1 -1
  469. package/esm/src/trigger/index.js +1 -1
  470. package/esm/src/trigger/local-runner.d.ts +2 -2
  471. package/esm/src/trigger/local-runner.d.ts.map +1 -1
  472. package/esm/src/trigger/local-runner.js +11 -4
  473. package/esm/src/trigger/target.d.ts +97 -5
  474. package/esm/src/trigger/target.d.ts.map +1 -1
  475. package/esm/src/trigger/target.js +175 -5
  476. package/esm/src/utils/version-constant.d.ts +1 -1
  477. package/esm/src/utils/version-constant.js +1 -1
  478. package/esm/src/webhook/types.d.ts +21 -6
  479. package/esm/src/webhook/types.d.ts.map +1 -1
  480. package/esm/src/webhook/validation.d.ts.map +1 -1
  481. package/esm/src/webhook/validation.js +27 -39
  482. package/esm/templates/index.d.ts +1 -1
  483. package/esm/templates/index.d.ts.map +1 -1
  484. package/esm/templates/loader.d.ts +6 -6
  485. package/esm/templates/loader.d.ts.map +1 -1
  486. package/esm/templates/loader.js +34 -18
  487. package/esm/templates/manifest.generated.d.ts +3 -0
  488. package/esm/templates/manifest.generated.d.ts.map +1 -0
  489. package/esm/templates/manifest.generated.js +2 -0
  490. package/package.json +8 -8
  491. package/esm/templates/manifest.d.ts +0 -664
  492. package/esm/templates/manifest.d.ts.map +0 -1
  493. package/esm/templates/manifest.js +0 -662
@@ -0,0 +1,32 @@
1
+ import { getHostEnv } from "../../platform/compat/process.js";
2
+ import { encodeBase64 } from "../../utils/index.js";
3
+ import { getEnvSource } from "../../utils/env-loader.js";
4
+ const INTERNAL_USER_ENV = "VERYFRONT_API_INTERNAL_USER";
5
+ const INTERNAL_PASS_ENV = "VERYFRONT_API_INTERNAL_PASS";
6
+ const LOCAL_CLI_PROXY_MODE_ENV = "VERYFRONT_CLI_LOCAL_PROXY_MODE";
7
+ /** Whether project env reads require the hosted runtime's internal API credential. */
8
+ export function requiresProjectEnvInternalAuthorization() {
9
+ if (getHostEnv("PROXY_MODE") !== "1")
10
+ return false;
11
+ const isLocalCliProxyMode = getHostEnv(LOCAL_CLI_PROXY_MODE_ENV) === "1" &&
12
+ getEnvSource(LOCAL_CLI_PROXY_MODE_ENV).source === "process";
13
+ return !isLocalCliProxyMode;
14
+ }
15
+ /** Name the missing hosted runtime credentials without exposing their values. */
16
+ export function getMissingProjectEnvInternalCredentialDetail() {
17
+ const missing = [
18
+ getHostEnv(INTERNAL_USER_ENV) ? undefined : INTERNAL_USER_ENV,
19
+ getHostEnv(INTERNAL_PASS_ENV) ? undefined : INTERNAL_PASS_ENV,
20
+ ].filter((name) => name !== undefined);
21
+ return missing.length > 0
22
+ ? `${missing.join(" and ")} must be set in hosted proxy mode`
23
+ : undefined;
24
+ }
25
+ /** Build the internal API authorization header when both credentials are present. */
26
+ export function getProjectEnvInternalAuthorization() {
27
+ const username = getHostEnv(INTERNAL_USER_ENV);
28
+ const password = getHostEnv(INTERNAL_PASS_ENV);
29
+ if (!username || !password)
30
+ return undefined;
31
+ return `Basic ${encodeBase64(`${username}:${password}`)}`;
32
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/server/runtime-handler/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAsCpD,O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ectDir
376
376
  updateRequestProfileContext({ projectSlug: projectRes.projectSlug });
377
377
  setProjectAttributes(spanInfo.span, projectRes.projectSlug, projectRes.proxyEnv);
378
378
  // Handle projects discovery UI
379
- if (shouldHandleProjectsUI(url.pathname, projectRes.projectSlug, projectRes.parsedDomain)) {
379
+ if (shouldHandleProjectsUI(request, url.pathname, projectRes.projectSlug, projectRes.parsedDomain)) {
380
380
  const response = await handleProjectsRequest(request, url, buildMinimalContext(projectDir, adapter, securityLoader.getSecurityConfig(), isDebugEnabled(), config));
381
381
  if (response)
382
382
  return response;
@@ -11,7 +11,7 @@ import type { ParsedDomain } from "../utils/domain-parser.js";
11
11
  /**
12
12
  * Check if the request should be handled by the projects discovery UI.
13
13
  */
14
- export declare function shouldHandleProjectsUI(pathname: string, projectSlug: string | undefined, parsedDomain: ParsedDomain): boolean;
14
+ export declare function shouldHandleProjectsUI(req: Request, pathname: string, projectSlug: string | undefined, parsedDomain: ParsedDomain): boolean;
15
15
  /**
16
16
  * Handle the projects discovery UI requests.
17
17
  * Returns a response or null if not handled.
@@ -1 +1 @@
1
- {"version":3,"file":"projects-handler.d.ts","sourceRoot":"","sources":["../../../../src/src/server/runtime-handler/projects-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,YAAY,EAAE,YAAY,GACzB,OAAO,CAWT;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAgC1B"}
1
+ {"version":3,"file":"projects-handler.d.ts","sourceRoot":"","sources":["../../../../src/src/server/runtime-handler/projects-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,YAAY,EAAE,YAAY,GACzB,OAAO,CAYT;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAgC1B"}
@@ -9,16 +9,18 @@
9
9
  import { createFileSystem } from "../../platform/compat/fs.js";
10
10
  import { cwd } from "../../platform/compat/process.js";
11
11
  import { serverLogger } from "../../utils/index.js";
12
+ import { isTrustedLocalControlRequest } from "../../security/http/local-control-request.js";
12
13
  import { defaultDiscoveryCache, standardProjectDirs } from "./local-project-discovery.js";
13
14
  const logger = serverLogger.component("projects-handler");
14
15
  /**
15
16
  * Check if the request should be handled by the projects discovery UI.
16
17
  */
17
- export function shouldHandleProjectsUI(pathname, projectSlug, parsedDomain) {
18
+ export function shouldHandleProjectsUI(req, pathname, projectSlug, parsedDomain) {
18
19
  const isProjectsPath = pathname === "/" ||
19
20
  pathname.startsWith("/_projects") ||
20
21
  pathname === "/_vf/api/projects";
21
- return (!projectSlug &&
22
+ return (isTrustedLocalControlRequest(req) &&
23
+ !projectSlug &&
22
24
  !parsedDomain.slug &&
23
25
  parsedDomain.isVeryfrontDomain &&
24
26
  isProjectsPath);
@@ -1 +1 @@
1
- {"version":3,"file":"http-bundler.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-bundler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAG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iB,CAC/B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyD1B"}
@@ -15,6 +15,7 @@ import { readHttpModuleText } from "../shared/http-module-response.js";
15
15
  import { sanitizeUrlForSpan } from "../../utils/logger/redact.js";
16
16
  import { snapshotThrowableDiagnostic } from "../../errors/safe-diagnostics.js";
17
17
  import { MAX_TIMER_DELAY_MS } from "../../utils/constants/limits.js";
18
+ import { describeHtmlModuleResponse } from "./http-cache-helpers.js";
18
19
  const LOG_PREFIX = "[HTTP-HANDLER]";
19
20
  /**
20
21
  * User agent string for HTTP fetches.
@@ -141,11 +142,11 @@ export function createHTTPPlugin(options = {}) {
141
142
  /<title>ESM[^<]*<\/title>/i.test(contents.slice(0, 500));
142
143
  if (isHtmlContent) {
143
144
  logger.warn(`${LOG_PREFIX} Received HTML instead of JS for ${safeUrl}`);
144
- return {
145
- errors: [{
146
- text: `Received HTML instead of JavaScript from ${safeUrl}. Package may not exist or failed to build on esm.sh.`,
147
- }],
148
- };
145
+ // Blaming esm.sh for every host that answers HTML sends the reader
146
+ // to a registry that was never involved. The shared helper reports
147
+ // the real cause, including an unresolved "@/" alias that fell
148
+ // through to the site origin (VERYFRONT-SERVER-G).
149
+ return { errors: [{ text: describeHtmlModuleResponse(safeUrl) }] };
149
150
  }
150
151
  return { contents, loader: "js" };
151
152
  }
@@ -79,6 +79,15 @@ export declare function getEffectiveHttpCacheRequest<T extends HttpCacheIdentity
79
79
  * separate local files.
80
80
  */
81
81
  export declare function isCanonicalReactEsmUrl(rawUrl: string): boolean;
82
+ /**
83
+ * Diagnostic for an HTTP module fetch that answered with HTML.
84
+ *
85
+ * Only esm.sh gets the "package failed to build" explanation. For any other
86
+ * host, direct the reader to verify that the import resolves to JavaScript.
87
+ * A path starting with "/@/" is the "@/" project alias in absolute form, so it
88
+ * gets a specific alias-resolution instruction.
89
+ */
90
+ export declare function describeHtmlModuleResponse(rawUrl: string): string;
82
91
  export declare function isExternalScheme(specifier: string): boolean;
83
92
  export declare function isRelative(specifier: string): boolean;
84
93
  /**
@@ -101,6 +110,8 @@ export declare function isInternalBare(specifier: string): boolean;
101
110
  export declare const SERVER_ESM_TARGET = "node";
102
111
  export declare function normalizeEsmShUrl(url: URL): void;
103
112
  export declare function normalizeHttpUrl(raw: string): string;
113
+ /** Build an opaque identity for correlating one exact HTTP module request. */
114
+ export declare function fingerprintHttpModuleRequest(rawUrl: string): Promise<string>;
104
115
  export declare function resolveBareSpecifier(specifier: string, importMap: ImportMapConfig, reactVersion?: string): string;
105
116
  /**
106
117
  * Check if cached HTTP bundle code has file:// paths from a different environment.
@@ -1 +1 @@
1
- {"version":3,"file":"http-cache-helpers.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAsNhE;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,EAAE,CAAC;IACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;IACvB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,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AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAoBrF"}
@@ -182,6 +182,7 @@ function decodeEncodedCommas(value) {
182
182
  return decoded;
183
183
  }
184
184
  const HTTP_CACHE_REQUEST_IDENTITY_CONTEXT = Symbol("http-cache-request-identity-context");
185
+ const HTTP_MODULE_REQUEST_FINGERPRINT_NAMESPACE = "veryfront:http-module-request:v1";
185
186
  function compareImportMapKeys(left, right) {
186
187
  return left[0] < right[0] ? -1 : left[0] > right[0] ? 1 : 0;
187
188
  }
@@ -358,6 +359,36 @@ export function getEffectiveHttpCacheRequest(rawUrl, options) {
358
359
  export function isCanonicalReactEsmUrl(rawUrl) {
359
360
  return getCanonicalReactEsmVersion(rawUrl) !== null;
360
361
  }
362
+ /**
363
+ * Diagnostic for an HTTP module fetch that answered with HTML.
364
+ *
365
+ * Only esm.sh gets the "package failed to build" explanation. For any other
366
+ * host, direct the reader to verify that the import resolves to JavaScript.
367
+ * A path starting with "/@/" is the "@/" project alias in absolute form, so it
368
+ * gets a specific alias-resolution instruction.
369
+ */
370
+ export function describeHtmlModuleResponse(rawUrl) {
371
+ let hostname = "";
372
+ let pathname = "";
373
+ try {
374
+ const url = new IntrinsicURL(rawUrl);
375
+ hostname = getURLHostname(url);
376
+ pathname = getURLPathname(url);
377
+ }
378
+ catch (_) {
379
+ /* expected: URL may be malformed */
380
+ }
381
+ const received = `Received HTML instead of JavaScript from ${rawUrl}.`;
382
+ if (hostname === "esm.sh") {
383
+ return `${received} The package may not exist or failed to build on esm.sh.`;
384
+ }
385
+ const resolutionInstruction = stringStartsWith(pathname, "/@/")
386
+ ? 'Verify that the "@/" alias import resolves to a project module and does not fall ' +
387
+ "through to the site origin."
388
+ : "Verify that the import resolves to a JavaScript module and does not fall through " +
389
+ "to the site origin.";
390
+ return `${received} ${resolutionInstruction}`;
391
+ }
361
392
  export function isExternalScheme(specifier) {
362
393
  return stringStartsWith(specifier, "node:") ||
363
394
  stringStartsWith(specifier, "data:") ||
@@ -455,6 +486,10 @@ export function normalizeHttpUrl(raw) {
455
486
  return raw;
456
487
  }
457
488
  }
489
+ /** Build an opaque identity for correlating one exact HTTP module request. */
490
+ export function fingerprintHttpModuleRequest(rawUrl) {
491
+ return computeHash(`${HTTP_MODULE_REQUEST_FINGERPRINT_NAMESPACE}\0${normalizeHttpUrl(rawUrl)}`);
492
+ }
458
493
  export function resolveBareSpecifier(specifier, importMap, reactVersion = DEFAULT_REACT_VERSION) {
459
494
  const reactMap = getReactImportMap(reactVersion);
460
495
  const reactMapped = reactMap[specifier];
@@ -1 +1 @@
1
- {"version":3,"file":"http-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAGL,KAAK,YAAY,EAMjB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAElB,gBAAgB,EAEhB,KAAK,OAAO,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAA2B,MAAM,4BAA4B,CAAC;AAYxF,OAAO,EACL,0BAA0B,EAU3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EAKvB,MAAM,uBAAuB,CAAC;AAa/B,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,QACT,CAAC;AAgOlC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GACnB,CAAC;AAGF,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,gB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AC,CAOjB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,wBAAwB,GAClC,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAClD,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,wBAAwB,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAErF;AAGD,eAAO,MAAM,wBAAwB,0BAAoB,CAAC"}
@@ -29,7 +29,7 @@ import { guardedOutboundFetch, OutboundRequestBlockedError, } from "../../securi
29
29
  // Extracted modules
30
30
  import { embedSourceUrl, extractSourceUrl } from "./source-url-embed.js";
31
31
  import { isDegradedArtifact } from "./degraded-artifact.js";
32
- import { buildHttpCacheIdentity, buildHttpCacheIdentityMetadata, deriveHttpCacheRequestOptions, ensureAbsoluteDir, ensurePreparedHttpCacheRequestOptions, getEffectiveHttpCacheRequest, hashHttpCacheIdentity, hasIncompatibleFilePaths, isHttpUrl, normalizeHttpUrl, prepareHttpCacheRequestOptions, } from "./http-cache-helpers.js";
32
+ import { buildHttpCacheIdentity, buildHttpCacheIdentityMetadata, deriveHttpCacheRequestOptions, describeHtmlModuleResponse, ensureAbsoluteDir, ensurePreparedHttpCacheRequestOptions, fingerprintHttpModuleRequest, getEffectiveHttpCacheRequest, hashHttpCacheIdentity, hasIncompatibleFilePaths, isHttpUrl, normalizeHttpUrl, prepareHttpCacheRequestOptions, } from "./http-cache-helpers.js";
33
33
  import { extractBundleDeps, validateBundleDepsExist } from "./bundle-deps-validator.js";
34
34
  import { bundleAccumulatorStorage, createBundleAccumulator, trackCachedBundleGraph, trackWrittenBundle, } from "./bundle-accumulator.js";
35
35
  import { isHttpBundleCodeWithinLimit, MAX_CACHED_HTTP_BUNDLE_BYTES, readCachedHttpBundleFile, } from "./http-bundle-file.js";
@@ -97,6 +97,12 @@ async function publishHttpBundleGeneration(cacheKey, cachePath, code, fs, abortS
97
97
  }
98
98
  }
99
99
  }
100
+ function terminalHttpModuleFetchError(detail, context = {}) {
101
+ return BUILD_FAILED.create({
102
+ detail,
103
+ context: { phase: "http-module-fetch", ...context },
104
+ });
105
+ }
100
106
  class HttpModuleResponseError extends Error {
101
107
  status;
102
108
  constructor(status) {
@@ -198,17 +204,17 @@ async function fetchHttpModule(url, abortSignal) {
198
204
  }
199
205
  catch (error) {
200
206
  if (error instanceof HttpModuleResponseError) {
201
- throw BUILD_FAILED.create({ detail: `Failed to fetch ${safeUrl}: ${error.status}` });
207
+ throw terminalHttpModuleFetchError(`Failed to fetch ${safeUrl}: ${error.status}`, {
208
+ httpStatus: error.status,
209
+ httpModuleUrl: safeUrl,
210
+ httpModuleRequestFingerprint: await fingerprintHttpModuleRequest(url),
211
+ });
202
212
  }
203
213
  if (error instanceof HttpModuleRequestError) {
204
- throw BUILD_FAILED.create({
205
- detail: `Failed to fetch ${safeUrl}: ${error.requestErrorType}`,
206
- });
214
+ throw terminalHttpModuleFetchError(`Failed to fetch ${safeUrl}: ${error.requestErrorType}`);
207
215
  }
208
216
  if (error instanceof HttpModuleBodyError) {
209
- throw BUILD_FAILED.create({
210
- detail: `Failed to fetch ${safeUrl}: ${error.message}`,
211
- });
217
+ throw terminalHttpModuleFetchError(`Failed to fetch ${safeUrl}: ${error.message}`);
212
218
  }
213
219
  if (error instanceof OutboundRequestBlockedError) {
214
220
  // Preserve the policy-denial type so downstream specifier resolution can
@@ -396,12 +402,12 @@ async function cacheHttpModuleInternal(url, options) {
396
402
  const contentType = fetchedModule.contentType;
397
403
  const isHtmlContent = contentType.includes("text/html") || looksLikeHtmlNotJs(code);
398
404
  if (isHtmlContent) {
399
- logger.error("[HTTP-CACHE] Received HTML instead of JavaScript, likely an esm.sh error page", {
405
+ logger.error("[HTTP-CACHE] Received HTML instead of JavaScript", {
400
406
  url: safeUrl,
401
407
  contentType,
402
408
  });
403
409
  throw BUNDLE_ERROR.create({
404
- detail: `Received HTML instead of JavaScript from ${safeUrl}. The package may not exist or failed to build on esm.sh.`,
410
+ detail: describeHtmlModuleResponse(safeUrl),
405
411
  });
406
412
  }
407
413
  reportProgress({
@@ -1 +1 @@
1
- {"version":3,"file":"specifier-resolver.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/specifier-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,OAAO,EACL,KAAK,YAAY,EAQlB,MAAM,yBAAyB,CAAC;AAcjC,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AA0I/F,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpD;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,iBAAiB,GACjC,OAAO,CAAC,qBAAqB,CAAC,CAoChC;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,iBAAiB,GACjC,OAAO,CAAC,eAAe,CAAC,CAY1B"}
1
+ {"version":3,"file":"specifier-resolver.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/specifier-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,OAAO,EACL,KAAK,YAAY,EAWlB,MAAM,yBAAyB,CAAC;AAgDjC,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAoM/F,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpD;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,iBAAiB,GACjC,OAAO,CAAC,qBAAqB,CAAC,CAoChC;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,iBAAiB,GACjC,OAAO,CAAC,eAAe,CAAC,CAY1B"}
@@ -7,24 +7,53 @@
7
7
  * @module transforms/esm/specifier-resolver
8
8
  */
9
9
  import { basename } from "../../platform/compat/path/index.js";
10
+ import { BUILD_FAILED } from "../../errors/index.js";
11
+ import { snapshotVeryfrontError } from "../../errors/types.js";
10
12
  import { resolveImport } from "../../modules/import-map/resolver.js";
11
13
  import { OutboundRequestBlockedError } from "../../security/http/outbound-fetch.js";
12
- import { appendSameOriginSSRDependencyPinningKey } from "../import-rewriter/url-builder.js";
14
+ import { appendSameOriginSSRDependencyPinningKey, normalizeExtension, } from "../import-rewriter/url-builder.js";
15
+ import { splitSpecifierSuffix } from "../shared/specifier-suffix.js";
13
16
  import { parseBarePackageSpecifier } from "../shared/package-specifier.js";
14
17
  import { isServerOnlyPackage } from "../shared/server-only-packages.js";
15
18
  import { parseImports, replaceSpecifiers } from "./lexer.js";
16
- import { isCanonicalReactEsmUrl, isExternalScheme, isHttpUrl, isInternalBare, isParentHttpModule, isRelative, resolveBareSpecifier, } from "./http-cache-helpers.js";
19
+ import { fingerprintHttpModuleRequest, getEffectiveHttpCacheRequest, isCanonicalReactEsmUrl, isExternalScheme, isHttpUrl, isInternalBare, isParentHttpModule, isRelative, normalizeHttpUrl, resolveBareSpecifier, } from "./http-cache-helpers.js";
17
20
  const ReflectApply = Reflect.apply;
21
+ const RegExpTest = RegExp.prototype.test;
18
22
  const StringSlice = String.prototype.slice;
19
23
  const StringStartsWith = String.prototype.startsWith;
24
+ function regexpTest(pattern, value) {
25
+ return ReflectApply(RegExpTest, pattern, [value]);
26
+ }
20
27
  function stringSlice(value, start, end) {
21
28
  return ReflectApply(StringSlice, value, end === undefined ? [start] : [start, end]);
22
29
  }
23
30
  function stringStartsWith(value, search) {
24
31
  return ReflectApply(StringStartsWith, value, [search]);
25
32
  }
33
+ function classifyAuthoredPackageFetchError(error, requestedPackageFingerprint) {
34
+ const snapshot = snapshotVeryfrontError(error);
35
+ const context = snapshot?.context;
36
+ if (snapshot?.slug !== BUILD_FAILED.slug ||
37
+ typeof context !== "object" || context === null ||
38
+ typeof requestedPackageFingerprint !== "string" ||
39
+ context.httpStatus !== 404 ||
40
+ context.httpModuleRequestFingerprint !==
41
+ requestedPackageFingerprint) {
42
+ return error;
43
+ }
44
+ return BUILD_FAILED.create({
45
+ message: snapshot.message,
46
+ detail: snapshot.detail,
47
+ cause: error,
48
+ context: {
49
+ httpStatus: 404,
50
+ httpModuleRequestFingerprint: requestedPackageFingerprint,
51
+ tenantBuildFailure: true,
52
+ },
53
+ });
54
+ }
26
55
  function parseHttpBase(value) {
27
- if (!value || !/^https?:\/\//i.test(value))
56
+ if (!value || !regexpTest(/^https?:\/\//i, value))
28
57
  return undefined;
29
58
  try {
30
59
  return new URL(value);
@@ -34,7 +63,7 @@ function parseHttpBase(value) {
34
63
  }
35
64
  }
36
65
  function canonicalizeHttpSpecifier(specifier, baseUrl, moduleServerOrigin) {
37
- if (/^https?:\/\//i.test(specifier))
66
+ if (regexpTest(/^https?:\/\//i, specifier))
38
67
  return new URL(specifier).toString();
39
68
  if (!stringStartsWith(specifier, "//"))
40
69
  return specifier;
@@ -67,13 +96,41 @@ async function resolveSpecifier(specifier, baseUrl, options, cacheHttpModule) {
67
96
  specifier = canonicalizeHttpSpecifier(specifier, baseUrl, options.moduleServerOrigin);
68
97
  if (isExternalScheme(specifier))
69
98
  return null;
99
+ // The "@/" project alias always denotes the project's own module transport.
100
+ // An alias that escaped every upstream rewrite must land there too: treating
101
+ // it as a bare specifier would route it to esm.sh as a bogus scoped package,
102
+ // and a project import map that maps "@/" to a relative prefix would resolve
103
+ // it against the page's public origin, which answers with HTML
104
+ // (VERYFRONT-SERVER-G).
105
+ //
106
+ // The URL shape is not invented here. It reproduces `AliasStrategy.rewrite`
107
+ // (transforms/import-rewriter/strategies/alias-strategy.ts), the framework's
108
+ // canonical "@/" rewriter, which emits this same shape for both its `ssr` and
109
+ // its browser target: `normalizeExtension`, then append `.js` unless the
110
+ // result already ends in a JS-like or CSS extension. A different shape here
111
+ // would resolve one specifier to two different module URLs.
112
+ if (stringStartsWith(specifier, "@/")) {
113
+ const mappedAlias = resolveImport(specifier, options.importMap);
114
+ if (mappedAlias !== specifier && isLocalMappedSpecifier(mappedAlias))
115
+ return mappedAlias;
116
+ const { path: pathOnly, suffix } = splitSpecifierSuffix(stringSlice(specifier, 2));
117
+ const normalizedPath = normalizeExtension(pathOnly);
118
+ const jsPath = regexpTest(/\.(js|mjs|cjs|css)$/, normalizedPath)
119
+ ? normalizedPath
120
+ : `${normalizedPath}.js`;
121
+ const projectModulePath = `/_vf_modules/${jsPath}${suffix}`;
122
+ const moduleServerOrigin = parseHttpBase(options.moduleServerOrigin);
123
+ if (!moduleServerOrigin)
124
+ return projectModulePath;
125
+ return resolveSpecifier(new URL(projectModulePath, moduleServerOrigin).toString(), baseUrl, options, cacheHttpModule);
126
+ }
70
127
  // Server-only packages (`redis`, `pg`, …), including their explicit `npm:`
71
128
  // form, must never be routed through esm.sh. esm.sh either 500s building them
72
129
  // or emits a browser bundle with Node built-ins stubbed that can never
73
130
  // connect. The framework's adapters only `import()` them behind a lazy,
74
131
  // configured code path, so leaving the specifier external lets the runtime
75
132
  // resolve the real package (node_modules on Node, npm: on Deno) if and when
76
- // the backend is actually used and costs nothing when it is not.
133
+ // the backend is actually used, and costs nothing when it is not.
77
134
  const serverOnlyCandidate = stringStartsWith(specifier, "npm:")
78
135
  ? stringSlice(specifier, 4)
79
136
  : specifier;
@@ -90,7 +147,16 @@ async function resolveSpecifier(specifier, baseUrl, options, cacheHttpModule) {
90
147
  }
91
148
  if (stringStartsWith(specifier, "npm:")) {
92
149
  const bareSpecifier = stringSlice(specifier, 4);
93
- const cached = await cacheHttpModule(`https://esm.sh/${bareSpecifier}`, options);
150
+ const requestedPackageUrl = `https://esm.sh/${bareSpecifier}`;
151
+ let cached;
152
+ try {
153
+ cached = await cacheHttpModule(requestedPackageUrl, options);
154
+ }
155
+ catch (error) {
156
+ const effective = getEffectiveHttpCacheRequest(requestedPackageUrl, options);
157
+ const requestedPackageFingerprint = await fingerprintHttpModuleRequest(normalizeHttpUrl(effective.url));
158
+ throw classifyAuthoredPackageFetchError(error, requestedPackageFingerprint);
159
+ }
94
160
  if (!cached)
95
161
  return bareSpecifier;
96
162
  if (isParentHttpModule(baseUrl)) {
@@ -136,7 +202,21 @@ async function resolveSpecifier(specifier, baseUrl, options, cacheHttpModule) {
136
202
  return null;
137
203
  if (isLocalMappedSpecifier(mapped))
138
204
  return mapped;
139
- return resolveSpecifier(mapped, baseUrl, options, cacheHttpModule);
205
+ let requestedPackageUrl;
206
+ const cacheAuthoredPackage = async (url, cacheOptions) => {
207
+ const effective = getEffectiveHttpCacheRequest(url, cacheOptions);
208
+ requestedPackageUrl ??= normalizeHttpUrl(effective.url);
209
+ return await cacheHttpModule(url, cacheOptions);
210
+ };
211
+ try {
212
+ return await resolveSpecifier(mapped, baseUrl, options, cacheAuthoredPackage);
213
+ }
214
+ catch (error) {
215
+ const requestedPackageFingerprint = requestedPackageUrl === undefined
216
+ ? undefined
217
+ : await fingerprintHttpModuleRequest(requestedPackageUrl);
218
+ throw classifyAuthoredPackageFetchError(error, requestedPackageFingerprint);
219
+ }
140
220
  }
141
221
  /**
142
222
  * Build a map of specifier replacements by resolving all imports in the code.
@@ -1,4 +1,6 @@
1
1
  import type { ImportRewriteStrategy, ImportSpecifierInfo, RewriteContext, RewriteResult } from "../types.js";
2
+ /** Rewrite a project alias through the canonical SSR module-path rule. */
3
+ export declare function rewriteSsrProjectAliasSpecifier(specifier: string): string | null;
2
4
  export declare class AliasStrategy implements ImportRewriteStrategy {
3
5
  readonly name = "alias";
4
6
  readonly priority = 1;
@@ -1 +1 @@
1
- {"version":3,"file":"alias-strategy.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/import-rewriter/strategies/alias-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAIrB,qBAAa,aAAc,YAAW,qBAAqB;IACzD,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO;IAIzD,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,cAAc,GAAG,aAAa;CAmDvE;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
1
+ {"version":3,"file":"alias-strategy.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/import-rewriter/strategies/alias-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAIrB,0EAA0E;AAC1E,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOhF;AAED,qBAAa,aAAc,YAAW,qBAAqB;IACzD,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO;IAIzD,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,cAAc,GAAG,aAAa;CA8CvE;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
@@ -1,5 +1,15 @@
1
1
  import { appendDependencyPinningPathKey, normalizeExtension } from "../url-builder.js";
2
2
  import { getProjectRelativePath } from "../project-paths.js";
3
+ /** Rewrite a project alias through the canonical SSR module-path rule. */
4
+ export function rewriteSsrProjectAliasSpecifier(specifier) {
5
+ if (!specifier.startsWith("@/"))
6
+ return null;
7
+ let normalizedPath = normalizeExtension(specifier.slice(2));
8
+ if (!/\.(tsx?|jsx?|mjs|cjs|mdx|css)$/.test(normalizedPath)) {
9
+ normalizedPath = `${normalizedPath}.js`;
10
+ }
11
+ return `/_vf_modules/${normalizedPath}`;
12
+ }
3
13
  export class AliasStrategy {
4
14
  name = "alias";
5
15
  priority = 1;
@@ -10,15 +20,10 @@ export class AliasStrategy {
10
20
  const path = info.specifier.slice(2);
11
21
  // SSR uses /_vf_modules/ paths for HTTP module resolution
12
22
  if (ctx.target === "ssr") {
13
- let normalizedPath = normalizeExtension(path);
14
- // Add .js if no extension present
15
- if (!/\.(tsx?|jsx?|mjs|cjs|mdx|css)$/.test(normalizedPath)) {
16
- normalizedPath = `${normalizedPath}.js`;
17
- }
18
23
  // The SSR adapter adds `ssr`, routing, cache-buster, and dependency
19
24
  // snapshot params together after this strategy runs. Keeping this URL
20
25
  // query-free ensures its `.js` matcher still sees the edge.
21
- return { specifier: `/_vf_modules/${normalizedPath}` };
26
+ return { specifier: rewriteSsrProjectAliasSpecifier(info.specifier) ?? info.specifier };
22
27
  }
23
28
  // Browser: Use /_vf_modules/ absolute paths when moduleServerUrl is configured.
24
29
  // This avoids relative path calculation issues when the file index path structure
@@ -1 +1 @@
1
- {"version":3,"file":"md-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/md/compiler/md-compiler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EAExB,MAAM,sCAAsC,CAAC;AAM9C,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,uBAAuB,CAAC,CAsClC"}
1
+ {"version":3,"file":"md-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/md/compiler/md-compiler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EAExB,MAAM,sCAAsC,CAAC;AAW9C,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,uBAAuB,CAAC,CAwClC"}
@@ -1,8 +1,12 @@
1
1
  import { rendererLogger } from "../../../utils/index.js";
2
2
  import { resolve as resolveContract } from "../../../extensions/contracts.js";
3
- import { createError, toError } from "../../../errors/index.js";
3
+ import { MARKDOWN_COMPILE_ERROR, VeryfrontError } from "../../../errors/index.js";
4
4
  import { withSpan } from "../../../observability/tracing/otlp-setup.js";
5
+ import { isFrontmatterSyntaxError } from "../../mdx/compiler/frontmatter-extractor.js";
5
6
  const logger = rendererLogger.component("md-compiler");
7
+ function isMarkdownSourceCompileError(error) {
8
+ return isFrontmatterSyntaxError(error);
9
+ }
6
10
  export function compileMarkdownRuntime(mode, projectDir, content, frontmatter, filePath, target = "server", baseUrl, studioEmbed) {
7
11
  return withSpan("transforms.compileMarkdownRuntime", async () => {
8
12
  try {
@@ -25,10 +29,13 @@ export function compileMarkdownRuntime(mode, projectDir, content, frontmatter, f
25
29
  error: err.message,
26
30
  stack: err.stack,
27
31
  });
28
- throw toError(createError({
29
- type: "build",
30
- message: `Markdown compilation error: ${err.message} | file: ${filePath ?? "<memory>"}`,
31
- }));
32
+ if (err instanceof VeryfrontError || !isMarkdownSourceCompileError(err)) {
33
+ throw err;
34
+ }
35
+ throw MARKDOWN_COMPILE_ERROR.create({
36
+ detail: `Markdown compilation error: ${err.message} | file: ${filePath ?? "<memory>"}`,
37
+ cause: err,
38
+ });
32
39
  }
33
40
  }, {
34
41
  "md.filePath": filePath ?? "memory",
@@ -2,5 +2,7 @@ export interface FrontmatterExtractionResult {
2
2
  body: string;
3
3
  frontmatter: Record<string, unknown>;
4
4
  }
5
+ /** Return true when an error came from MDX or Markdown YAML frontmatter parsing. */
6
+ export declare function isFrontmatterSyntaxError(error: unknown): error is SyntaxError;
5
7
  export declare function extractFrontmatter(content: string, providedFrontmatter?: Record<string, unknown>): FrontmatterExtractionResult;
6
8
  //# sourceMappingURL=frontmatter-extractor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter-extractor.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/frontmatter-extractor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AA0CD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5C,2BAA2B,CAc7B"}
1
+ {"version":3,"file":"frontmatter-extractor.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/frontmatter-extractor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAQD,oFAAoF;AACpF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAU7E;AAsDD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5C,2BAA2B,CAc7B"}
@@ -1,9 +1,41 @@
1
1
  import { rendererLogger as logger } from "../../../utils/logger/logger.js";
2
2
  import { extract } from "../../../platform/compat/std/front-matter-yaml.js";
3
+ const FRONTMATTER_SYNTAX_ERROR = Symbol.for("veryfront.transforms.mdx.frontmatter-syntax-error");
4
+ const ObjectDefineProperty = Object.defineProperty;
5
+ const ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
6
+ const ReflectApply = Reflect.apply;
7
+ const ReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
8
+ /** Return true when an error came from MDX or Markdown YAML frontmatter parsing. */
9
+ export function isFrontmatterSyntaxError(error) {
10
+ try {
11
+ if (!(error instanceof SyntaxError))
12
+ return false;
13
+ const descriptor = ReflectGetOwnPropertyDescriptor(error, FRONTMATTER_SYNTAX_ERROR);
14
+ return descriptor !== undefined &&
15
+ ReflectApply(ObjectPrototypeHasOwnProperty, descriptor, ["value"]) === true &&
16
+ descriptor.value === true;
17
+ }
18
+ catch {
19
+ return false;
20
+ }
21
+ }
22
+ function createFrontmatterSyntaxError(cause) {
23
+ const error = new SyntaxError(`Invalid YAML frontmatter: ${cause.message}`, { cause });
24
+ ObjectDefineProperty(error, FRONTMATTER_SYNTAX_ERROR, { value: true });
25
+ return error;
26
+ }
3
27
  function extractYamlFrontmatter(content) {
4
28
  if (!content.trim().startsWith("---"))
5
29
  return { body: content, frontmatter: {} };
6
- const extracted = extract(content);
30
+ let extracted;
31
+ try {
32
+ extracted = extract(content);
33
+ }
34
+ catch (error) {
35
+ if (error instanceof SyntaxError)
36
+ throw createFrontmatterSyntaxError(error);
37
+ throw error;
38
+ }
7
39
  return {
8
40
  body: extracted.body,
9
41
  frontmatter: extracted.attrs,
@@ -1 +1 @@
1
- {"version":3,"file":"mdx-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/mdx-compiler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EAExB,MAAM,sCAAsC,CAAC;AAM9C,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,uBAAuB,CAAC,CAuClC"}
1
+ {"version":3,"file":"mdx-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/mdx-compiler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EAExB,MAAM,sCAAsC,CAAC;AA4C9C,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,uBAAuB,CAAC,CAwClC"}