void 0.1.6 → 0.7.0

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 (333) hide show
  1. package/AGENT_PROMPT.md +15 -0
  2. package/README.md +62 -123
  3. package/dist/auth-BdsJ0Aff.d.mts +43 -0
  4. package/dist/auth-cmd-Dx8oPKZC.mjs +43 -0
  5. package/dist/auth-migrations-BAtAck2g.mjs +117 -0
  6. package/dist/better-auth-shared-C9_GHSkR.d.mts +71 -0
  7. package/dist/better-auth-shared-CdYmQGry.mjs +163 -0
  8. package/dist/cache-W82I8ihI.mjs +47 -0
  9. package/dist/cancel-deploy-BOBTqqh0.mjs +59 -0
  10. package/dist/cf-access-Dee5cXxL.mjs +22 -0
  11. package/dist/chunk-DJd-R1mw.mjs +34 -0
  12. package/dist/cli/cli.d.mts +1 -0
  13. package/dist/cli/cli.mjs +1807 -0
  14. package/dist/client-snXOjrp1.mjs +565 -0
  15. package/dist/collect-CjeZgz5D.mjs +55 -0
  16. package/dist/config-BIa9HwVX.mjs +573 -0
  17. package/dist/config-BzM9Dy7T.mjs +37 -0
  18. package/dist/config-CvHtTM0q.mjs +30 -0
  19. package/dist/create-project-BIA15W7z.mjs +90 -0
  20. package/dist/db-DsRoMcfN.mjs +895 -0
  21. package/dist/defer-DcxEsVH1.mjs +49 -0
  22. package/dist/delete-DAP6yDc7.mjs +64 -0
  23. package/dist/deploy-BPKblFx6.mjs +2424 -0
  24. package/dist/discover-B7FkXBLB.mjs +40 -0
  25. package/dist/dist-DUyXJLkq.mjs +2667 -0
  26. package/dist/dist-Dayj3gCK.mjs +1287 -0
  27. package/dist/domain-BGofcQ6I.mjs +79 -0
  28. package/dist/dotenv-DwO4ti0Z.mjs +173 -0
  29. package/dist/drizzle-NnudE_UN.mjs +232 -0
  30. package/dist/env-CyG3tvU0.mjs +301 -0
  31. package/dist/env-helpers-Dr9Y7RnE.d.mts +52 -0
  32. package/dist/env-raw-BDL4TvdN.mjs +32 -0
  33. package/dist/env-types-DknSA4SO.mjs +64 -0
  34. package/dist/env-validation-DJKjR_8q.mjs +163 -0
  35. package/dist/fetch-error-BQ8sZ5Nd.mjs +266 -0
  36. package/dist/fetch-error-CVZ5CGA-.d.mts +20 -0
  37. package/dist/gen-U0Ktr4Zd.mjs +761 -0
  38. package/dist/handler-B0ds0OHJ.d.mts +269 -0
  39. package/dist/head-P-egrtFE.d.mts +45 -0
  40. package/dist/headers-DCXc7mDs.mjs +279 -0
  41. package/dist/index.d.mts +32 -0
  42. package/dist/index.mjs +4695 -0
  43. package/dist/init-C7wS5iGP.mjs +2625 -0
  44. package/dist/link-p2R6NbgN.mjs +49 -0
  45. package/dist/list-Bfel-QLc.mjs +113 -0
  46. package/dist/log-DXdqnmhF.mjs +26 -0
  47. package/dist/login-CkcXUiIu.mjs +72 -0
  48. package/dist/logs-DmkrRvx6.mjs +98 -0
  49. package/dist/magic-string.es-D6g9UnIy.mjs +1011 -0
  50. package/dist/mcp-CaQzfeUi.mjs +373 -0
  51. package/dist/node-DDfXj10V.mjs +54 -0
  52. package/dist/output-BwlcIYSR.mjs +139 -0
  53. package/dist/pages/client.d.mts +198 -0
  54. package/dist/pages/client.mjs +980 -0
  55. package/dist/pages/head-client.d.mts +15 -0
  56. package/dist/pages/head-client.mjs +90 -0
  57. package/dist/pages/head.d.mts +2 -0
  58. package/dist/pages/head.mjs +112 -0
  59. package/dist/pages/index.d.mts +38 -0
  60. package/dist/pages/index.mjs +76 -0
  61. package/dist/pages/islands-plugin.d.mts +50 -0
  62. package/dist/pages/islands-plugin.mjs +195 -0
  63. package/dist/pages/prefetch.d.mts +31 -0
  64. package/dist/pages/prefetch.mjs +90 -0
  65. package/dist/pages/protocol.d.mts +3 -0
  66. package/dist/pages/protocol.mjs +193 -0
  67. package/dist/pages/serialize.d.mts +10 -0
  68. package/dist/pages/serialize.mjs +14 -0
  69. package/dist/pathe.M-eThtNZ-D-kmWkCS.mjs +150 -0
  70. package/dist/plugin-inference-oZ6Ybu2_.mjs +2447 -0
  71. package/dist/prepare-BAtWufvm.mjs +99 -0
  72. package/dist/preset-D4I73kT4.mjs +221 -0
  73. package/dist/project-TqORyHn8.mjs +72 -0
  74. package/dist/project-cmd-B7lQp3F3.mjs +67 -0
  75. package/dist/project-slug-CKam8lF9.mjs +11 -0
  76. package/dist/project-tsconfig-DfkESbDL.mjs +63 -0
  77. package/dist/protocol-BWzXs2A2.d.mts +34 -0
  78. package/dist/providers-B3aMxWzP.mjs +67 -0
  79. package/dist/resolve-project-Br5BR03U.mjs +29 -0
  80. package/dist/rollback-gyC59l7U.mjs +92 -0
  81. package/dist/route-types-DReF1gUY.mjs +255 -0
  82. package/dist/routes-stub.d.mts +55 -0
  83. package/dist/routes-stub.mjs +1 -0
  84. package/dist/runner-6Ep3fNQu.mjs +123 -0
  85. package/dist/runner-pg-D0wWHYnr.mjs +57 -0
  86. package/dist/runtime/ai.d.mts +127 -0
  87. package/dist/runtime/ai.mjs +348 -0
  88. package/dist/runtime/auth-client-react.d.mts +8 -0
  89. package/dist/runtime/auth-client-react.mjs +6 -0
  90. package/dist/runtime/auth-client-solid.d.mts +8 -0
  91. package/dist/runtime/auth-client-solid.mjs +6 -0
  92. package/dist/runtime/auth-client-svelte.d.mts +8 -0
  93. package/dist/runtime/auth-client-svelte.mjs +6 -0
  94. package/dist/runtime/auth-client-vue.d.mts +8 -0
  95. package/dist/runtime/auth-client-vue.mjs +6 -0
  96. package/dist/runtime/auth-client.d.mts +8 -0
  97. package/dist/runtime/auth-client.mjs +6 -0
  98. package/dist/runtime/auth.d.mts +2 -0
  99. package/dist/runtime/auth.mjs +22 -0
  100. package/dist/runtime/better-auth-pg.d.mts +11 -0
  101. package/dist/runtime/better-auth-pg.mjs +51 -0
  102. package/dist/runtime/better-auth.d.mts +11 -0
  103. package/dist/runtime/better-auth.mjs +33 -0
  104. package/dist/runtime/client.d.mts +6 -0
  105. package/dist/runtime/client.mjs +5 -0
  106. package/dist/runtime/db-pg.d.mts +2 -0
  107. package/dist/runtime/db-pg.mjs +1 -0
  108. package/dist/runtime/db.d.mts +17 -0
  109. package/dist/runtime/db.mjs +30 -0
  110. package/dist/runtime/drizzle-arktype.d.mts +1 -0
  111. package/dist/runtime/drizzle-arktype.mjs +2 -0
  112. package/dist/runtime/drizzle-valibot.d.mts +1 -0
  113. package/dist/runtime/drizzle-valibot.mjs +2 -0
  114. package/dist/runtime/drizzle-zod.d.mts +1 -0
  115. package/dist/runtime/drizzle-zod.mjs +2 -0
  116. package/dist/runtime/env-helpers.d.mts +2 -0
  117. package/dist/runtime/env-helpers.mjs +173 -0
  118. package/dist/runtime/env-public-client.d.mts +22 -0
  119. package/dist/runtime/env-public-client.mjs +54 -0
  120. package/dist/runtime/env-public.d.mts +143 -0
  121. package/dist/runtime/env-public.mjs +366 -0
  122. package/dist/runtime/env.d.mts +13 -0
  123. package/dist/runtime/env.mjs +51 -0
  124. package/dist/runtime/fetch-stream.d.mts +51 -0
  125. package/dist/runtime/fetch-stream.mjs +81 -0
  126. package/dist/runtime/fetch.d.mts +59 -0
  127. package/dist/runtime/fetch.mjs +18 -0
  128. package/dist/runtime/handler.d.mts +3 -0
  129. package/dist/runtime/handler.mjs +85 -0
  130. package/dist/runtime/isr.d.mts +26 -0
  131. package/dist/runtime/isr.mjs +43 -0
  132. package/dist/runtime/kv.d.mts +48 -0
  133. package/dist/runtime/kv.mjs +106 -0
  134. package/dist/runtime/log.d.mts +24 -0
  135. package/dist/runtime/log.mjs +31 -0
  136. package/dist/runtime/migration-handler-pg.d.mts +6 -0
  137. package/dist/runtime/migration-handler-pg.mjs +85 -0
  138. package/dist/runtime/migration-handler.d.mts +19 -0
  139. package/dist/runtime/migration-handler.mjs +92 -0
  140. package/dist/runtime/queues.d.mts +7 -0
  141. package/dist/runtime/queues.mjs +8 -0
  142. package/dist/runtime/remote/binding-handler.d.mts +15 -0
  143. package/dist/runtime/remote/binding-handler.mjs +208 -0
  144. package/dist/runtime/remote/index.d.mts +8 -0
  145. package/dist/runtime/remote/index.mjs +461 -0
  146. package/dist/runtime/response.d.mts +14 -0
  147. package/dist/runtime/response.mjs +30 -0
  148. package/dist/runtime/sandbox.d.mts +17 -0
  149. package/dist/runtime/sandbox.mjs +19 -0
  150. package/dist/runtime/schema-d1.d.mts +1 -0
  151. package/dist/runtime/schema-d1.mjs +2 -0
  152. package/dist/runtime/schema-pg.d.mts +1 -0
  153. package/dist/runtime/schema-pg.mjs +2 -0
  154. package/dist/runtime/seed.d.mts +30 -0
  155. package/dist/runtime/seed.mjs +6 -0
  156. package/dist/runtime/storage.d.mts +7 -0
  157. package/dist/runtime/storage.mjs +14 -0
  158. package/dist/runtime/validator.d.mts +2 -0
  159. package/dist/runtime/validator.mjs +72 -0
  160. package/dist/runtime/ws-server.d.mts +26 -0
  161. package/dist/runtime/ws-server.mjs +296 -0
  162. package/dist/runtime/ws.d.mts +123 -0
  163. package/dist/runtime/ws.mjs +103 -0
  164. package/dist/scan-Ba4hFwlH.mjs +324 -0
  165. package/dist/scan-C6HMEIdW.mjs +318 -0
  166. package/dist/secret-CeRSukgM.mjs +109 -0
  167. package/dist/skills-ipldjlKE.mjs +62 -0
  168. package/dist/standard-schema-9CRjx-uR.d.mts +42 -0
  169. package/dist/subcommand-prompt-BKjuNAPb.mjs +349 -0
  170. package/dist/sveltekit.d.mts +20 -0
  171. package/dist/sveltekit.mjs +61 -0
  172. package/dist/types-mHOEwpW4.d.mts +57 -0
  173. package/dist/validate-CaMavMxu.mjs +146 -0
  174. package/dist/yarn-pnp-BFqMV_bl.mjs +196 -0
  175. package/getting-started-prompt.txt +26 -0
  176. package/package.json +322 -30
  177. package/schema.json +364 -0
  178. package/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
  179. package/skills/void/SKILL.md +75 -0
  180. package/skills/void/command/void.md +7 -0
  181. package/skills/void/docs/guide/ai.md +235 -0
  182. package/skills/void/docs/guide/app-types.md +103 -0
  183. package/skills/void/docs/guide/auth.md +257 -0
  184. package/skills/void/docs/guide/database/d1.md +106 -0
  185. package/skills/void/docs/guide/database/postgresql.md +106 -0
  186. package/skills/void/docs/guide/database.md +418 -0
  187. package/skills/void/docs/guide/deployment.md +98 -0
  188. package/skills/void/docs/guide/edge/headers.md +79 -0
  189. package/skills/void/docs/guide/edge/prerendering.md +83 -0
  190. package/skills/void/docs/guide/edge/redirects.md +116 -0
  191. package/skills/void/docs/guide/edge/revalidation.md +131 -0
  192. package/skills/void/docs/guide/edge/rewrites.md +354 -0
  193. package/skills/void/docs/guide/edge/static-assets.md +72 -0
  194. package/skills/void/docs/guide/env-vars.md +298 -0
  195. package/skills/void/docs/guide/index.md +80 -0
  196. package/skills/void/docs/guide/jobs.md +91 -0
  197. package/skills/void/docs/guide/kv.md +107 -0
  198. package/skills/void/docs/guide/pages-routing/actions-and-forms.md +419 -0
  199. package/skills/void/docs/guide/pages-routing/head.md +130 -0
  200. package/skills/void/docs/guide/pages-routing/islands.md +405 -0
  201. package/skills/void/docs/guide/pages-routing/layouts.md +362 -0
  202. package/skills/void/docs/guide/pages-routing/loaders.md +267 -0
  203. package/skills/void/docs/guide/pages-routing/markdown.md +625 -0
  204. package/skills/void/docs/guide/pages-routing/overview.md +236 -0
  205. package/skills/void/docs/guide/pages-routing/view-transitions.md +140 -0
  206. package/skills/void/docs/guide/queues.md +140 -0
  207. package/skills/void/docs/guide/quickstart.md +233 -0
  208. package/skills/void/docs/guide/remote-dev.md +67 -0
  209. package/skills/void/docs/guide/sandboxes.md +82 -0
  210. package/skills/void/docs/guide/server-routing.md +246 -0
  211. package/skills/void/docs/guide/ssg.md +74 -0
  212. package/skills/void/docs/guide/ssr.md +105 -0
  213. package/skills/void/docs/guide/storage.md +67 -0
  214. package/skills/void/docs/guide/type-safety.md +179 -0
  215. package/skills/void/docs/guide/typed-fetch.md +113 -0
  216. package/skills/void/docs/guide/websockets.md +190 -0
  217. package/skills/void/docs/index.md +48 -0
  218. package/skills/void/docs/integrations/agents.md +84 -0
  219. package/skills/void/docs/integrations/cloudflare.md +284 -0
  220. package/skills/void/docs/integrations/frameworks/analog.md +182 -0
  221. package/skills/void/docs/integrations/frameworks/astro.md +197 -0
  222. package/skills/void/docs/integrations/frameworks/nuxt.md +164 -0
  223. package/skills/void/docs/integrations/frameworks/overview.md +136 -0
  224. package/skills/void/docs/integrations/frameworks/react-router.md +137 -0
  225. package/skills/void/docs/integrations/frameworks/sveltekit.md +191 -0
  226. package/skills/void/docs/integrations/frameworks/tanstack-start.md +140 -0
  227. package/skills/void/docs/integrations/hono.md +97 -0
  228. package/skills/void/docs/integrations/nodejs-bun-deno.md +210 -0
  229. package/skills/void/docs/node_modules/@iconify/vue/README.md +408 -0
  230. package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +5 -0
  231. package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +103 -0
  232. package/skills/void/docs/node_modules/oxc-minify/README.md +78 -0
  233. package/skills/void/docs/node_modules/reka-ui/README.md +80 -0
  234. package/skills/void/docs/node_modules/vitepress/README.md +28 -0
  235. package/skills/void/docs/node_modules/vitepress/template/api-examples.md +49 -0
  236. package/skills/void/docs/node_modules/vitepress/template/index.md +28 -0
  237. package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +85 -0
  238. package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +101 -0
  239. package/skills/void/docs/node_modules/void/AGENTS.md +204 -0
  240. package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +15 -0
  241. package/skills/void/docs/node_modules/void/README.md +89 -0
  242. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +591 -0
  243. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +375 -0
  244. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +174 -0
  245. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +37 -0
  246. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +135 -0
  247. package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +189 -0
  248. package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +143 -0
  249. package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +1272 -0
  250. package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +19 -0
  251. package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +15 -0
  252. package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +15 -0
  253. package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +15 -0
  254. package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +22 -0
  255. package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +69 -0
  256. package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +152 -0
  257. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +9 -0
  258. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +9 -0
  259. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +15 -0
  260. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +24 -0
  261. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +565 -0
  262. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +124 -0
  263. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +600 -0
  264. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +386 -0
  265. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +95 -0
  266. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +101 -0
  267. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +73 -0
  268. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +15 -0
  269. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +25 -0
  270. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +55 -0
  271. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +2230 -0
  272. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +20 -0
  273. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +58 -0
  274. package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +165 -0
  275. package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +20 -0
  276. package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +32 -0
  277. package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +99 -0
  278. package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +108 -0
  279. package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +51 -0
  280. package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +79 -0
  281. package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +44 -0
  282. package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +51 -0
  283. package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +65 -0
  284. package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +390 -0
  285. package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +48 -0
  286. package/skills/void/docs/node_modules/void/node_modules/hono/README.md +85 -0
  287. package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +452 -0
  288. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  289. package/{LICENSE → skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md} +21 -21
  290. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +364 -0
  291. package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +41 -0
  292. package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +325 -0
  293. package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +398 -0
  294. package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +73 -0
  295. package/skills/void/docs/node_modules/void/node_modules/pg/README.md +95 -0
  296. package/skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md +21 -0
  297. package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +135 -0
  298. package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +21 -0
  299. package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +25 -0
  300. package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +55 -0
  301. package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +9 -0
  302. package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +94 -0
  303. package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +2230 -0
  304. package/skills/void/docs/node_modules/void/node_modules/vite/README.md +20 -0
  305. package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +63 -0
  306. package/skills/void/docs/node_modules/void/node_modules/zod/README.md +191 -0
  307. package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
  308. package/skills/void/docs/node_modules/void/skills/void/SKILL.md +75 -0
  309. package/skills/void/docs/node_modules/void/skills/void/command/void.md +7 -0
  310. package/skills/void/docs/reference/api.md +917 -0
  311. package/skills/void/docs/reference/cli.md +561 -0
  312. package/skills/void/docs/reference/config.md +408 -0
  313. package/skills/void/docs/reference/resource-inference.md +149 -0
  314. package/skills/void/docs/reference/structure.md +176 -0
  315. package/.npmignore +0 -29
  316. package/.travis.yml +0 -9
  317. package/favicon.ico +0 -0
  318. package/index.js +0 -14
  319. package/lib/Job.js +0 -150
  320. package/lib/Void.js +0 -99
  321. package/lib/scan.js +0 -19
  322. package/test/credentials.js +0 -20
  323. package/test/job.js +0 -64
  324. package/test/static/dir1/test6.html +0 -0
  325. package/test/static/dir2/test7.html +0 -0
  326. package/test/static/dir2/test8.html +0 -0
  327. package/test/static/dir2/test9.html +0 -0
  328. package/test/static/test1.html +0 -0
  329. package/test/static/test2.html +0 -0
  330. package/test/static/test3.html +0 -0
  331. package/test/void.js +0 -31
  332. /package/{test/static/dir1/test4.html → skills/void/docs/integrations/auth-providers.md} +0 -0
  333. /package/{test/static/dir1/test5.html → skills/void/docs/integrations/payment-processors.md} +0 -0
@@ -0,0 +1,269 @@
1
+ import { n as HeadDescriptor } from "./head-P-egrtFE.mjs";
2
+ import { r as AuthUser, t as AuthSession } from "./auth-BdsJ0Aff.mjs";
3
+ import { t as StandardSchemaV1 } from "./standard-schema-9CRjx-uR.mjs";
4
+ import * as _$_cloudflare_sandbox0 from "@cloudflare/sandbox";
5
+ import { Context, Env, MiddlewareHandler } from "hono";
6
+ import { RewriteDestination } from "void/routes";
7
+
8
+ //#region src/runtime/validator.d.ts
9
+ interface ValidatorSlots {
10
+ body?: StandardSchemaV1;
11
+ query?: StandardSchemaV1;
12
+ params?: StandardSchemaV1;
13
+ }
14
+ interface ValidationSuccess<V extends ValidatorSlots> {
15
+ ok: true;
16
+ input: HandlerInput<V>;
17
+ }
18
+ interface ValidationFailure {
19
+ ok: false;
20
+ response: Response;
21
+ }
22
+ type HandlerInput<V extends ValidatorSlots> = { [K in keyof V as V[K] extends StandardSchemaV1 ? K : never]: V[K] extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<V[K]> : never };
23
+ declare function runValidation<V extends ValidatorSlots>(validators: V, c: CloudContext): Promise<ValidationSuccess<V> | ValidationFailure>;
24
+ //#endregion
25
+ //#region src/pages/validation-error.d.ts
26
+ declare class ValidationError extends Error {
27
+ readonly errors: Record<string, string>;
28
+ constructor(errors: Record<string, string>);
29
+ }
30
+ //#endregion
31
+ //#region src/pages/defer.d.ts
32
+ /** Reactive wrapper for a deferred prop on non-React clients. */
33
+ type DeferredState<T> = {
34
+ readonly loading: true;
35
+ readonly value: null;
36
+ readonly error: null;
37
+ } | {
38
+ readonly loading: false;
39
+ readonly value: T;
40
+ readonly error: null;
41
+ } | {
42
+ readonly loading: false;
43
+ readonly value: null;
44
+ readonly error: Error;
45
+ };
46
+ /**
47
+ * Deferred props are represented as framework-native resources on the client.
48
+ * React treats them as promises consumed with `use()`, while the other adapters
49
+ * expose the historical `{ loading, value, error }` state object.
50
+ */
51
+ type Deferred<T> = DeferredState<T> & Promise<T>;
52
+ /** Extract the props type from a typed handler (loader). */
53
+ type InferProps<T> = T extends {
54
+ __output: infer R;
55
+ } ? R : never;
56
+ declare function defer<T>(resolver: (c: CloudContext) => Promise<T>): Deferred<T>;
57
+ declare function defer<T>(group: string, resolver: (c: CloudContext) => Promise<T>): Deferred<T>;
58
+ //#endregion
59
+ //#region src/runtime/handler.d.ts
60
+ /**
61
+ * Thrown when `c.rewrite()` is called with a destination whose final path
62
+ * segment ends in a known static-asset extension (e.g. `/hero.png`,
63
+ * `/app.css`). Runtime rewrites only reach routes and SSR entries inside
64
+ * the worker — static asset handlers run in front of the worker, so a
65
+ * `c.rewrite()` into an asset path re-enters the Hono router, matches
66
+ * nothing, and returns a 404. Fail at the call site so users reach for
67
+ * static `routing.rewrites` instead of debugging a mystery 404.
68
+ */
69
+ declare class VoidAssetRewriteError extends Error {
70
+ override name: string;
71
+ constructor(destination: string);
72
+ }
73
+ /**
74
+ * Hono environment type for Void workers.
75
+ *
76
+ * Includes standard Cloudflare bindings plus request-scoped auth
77
+ * variables populated by Better Auth middleware.
78
+ */
79
+ interface CloudContextVariables {
80
+ user: AuthUser | null;
81
+ session: AuthSession | null;
82
+ headDefaults?: HeadDescriptor;
83
+ [key: string]: unknown;
84
+ }
85
+ /**
86
+ * Hono `Bindings` shape for Void workers.
87
+ *
88
+ * Augmented by the generated `.void/env.d.ts` so user-declared env keys
89
+ * become typed on `c.env`. The index signature keeps untyped access
90
+ * working for bindings that aren't in the schema (queues, custom
91
+ * bindings, etc.).
92
+ */
93
+ interface CloudBindings {
94
+ DB: D1Database;
95
+ KV: KVNamespace;
96
+ STORAGE: R2Bucket;
97
+ AI: Ai;
98
+ SANDBOX: DurableObjectNamespace<_$_cloudflare_sandbox0.Sandbox>;
99
+ [key: string]: unknown;
100
+ }
101
+ interface CloudEnv extends Env {
102
+ Bindings: CloudBindings;
103
+ Variables: CloudContextVariables;
104
+ }
105
+ declare module "hono" {
106
+ interface Context {
107
+ /**
108
+ * Rewrite the request to a different internal path without changing the browser URL.
109
+ *
110
+ * Must be called inside a `defineMiddleware` handler and the result must be returned:
111
+ *
112
+ * ```ts
113
+ * export default defineMiddleware(async (c, next) => {
114
+ * if (!hasLocalePrefix(c.req.path)) {
115
+ * return c.rewrite(`/en${c.req.path}`);
116
+ * }
117
+ * return next();
118
+ * });
119
+ * ```
120
+ *
121
+ * The request is re-dispatched through the Hono router with the new pathname.
122
+ * The re-dispatched request is tracked internally so that static routing rules
123
+ * do not re-evaluate on it. Your middleware is responsible for its own loop
124
+ * prevention (e.g., checking if the path already has a prefix).
125
+ *
126
+ * The `path` type is `RewriteDestination`, which is `keyof RouteMap | (string & {})`.
127
+ * Known routes autocomplete, but any string is still accepted so dynamic paths
128
+ * (e.g. `` `/users/${id}` ``) continue to work. When `.void/routes.d.ts` has not
129
+ * been generated yet, `RouteMap` is empty and this is equivalent to `string`.
130
+ */
131
+ rewrite: (path: RewriteDestination) => Promise<Response>;
132
+ /**
133
+ * Returns the URL the client actually requested — the pre-rewrite URL as
134
+ * a `URL` object — or `null` when the current request was not rewritten.
135
+ *
136
+ * Set on every Void-managed request, whether the rewrite came from a
137
+ * static rule (`routing.rewrites`, `routing.fallbacks`, `_redirects`
138
+ * `200`/`200!`) or `c.rewrite()` in middleware. Useful for canonical
139
+ * link generation and locale negotiation that must reference the URL
140
+ * the user actually requested.
141
+ */
142
+ originalUrl: () => URL | null;
143
+ /**
144
+ * Returns `true` when the current request was re-dispatched by a rewrite,
145
+ * `false` otherwise. Equivalent to `c.originalUrl() !== null`.
146
+ *
147
+ * Use this to skip side-effectful work that would otherwise double-fire
148
+ * on the second pass of middleware (request logging, rate-limit
149
+ * increments, auth audit trails). Static rewrites (edge dispatch,
150
+ * `routing.rewrites`, `routing.fallbacks`, `_redirects` `200`/`200!`)
151
+ * and `c.rewrite()` in middleware both set the flag.
152
+ */
153
+ isRewritten: () => boolean;
154
+ }
155
+ }
156
+ /**
157
+ * Hono {@link Context} pre-typed with {@link CloudEnv}.
158
+ *
159
+ * This is the type of the `c` parameter in route handlers and middleware
160
+ * created with {@link defineHandler} and {@link defineMiddleware}.
161
+ */
162
+ type CloudContext = Context<CloudEnv>;
163
+ type HandlerFn = (c: CloudContext) => unknown | Promise<unknown>;
164
+ type MiddlewareFn = MiddlewareHandler<CloudEnv>;
165
+ /** Pre-rendered asset tags injected by the SSR build. */
166
+ interface RenderAssetTags {
167
+ /** CSS stylesheet links for `<head>`. */
168
+ css: string;
169
+ /** JS modulepreload links for `<head>` (only when page needs JS). */
170
+ preloads: string;
171
+ /** Script tags for `</body>` (only when page needs JS). */
172
+ body: string;
173
+ }
174
+ type RenderFn = (c: CloudContext, assetTags: RenderAssetTags) => Response | Promise<Response>;
175
+ type JobController = ScheduledController;
176
+ type JobExecutionContext = ExecutionContext;
177
+ type ScheduledFn = (controller: JobController, env: CloudEnv["Bindings"], ctx: JobExecutionContext) => unknown | Promise<unknown>;
178
+ type QueueRetryOptions = {
179
+ delaySeconds?: number;
180
+ };
181
+ /** A single message in a queue batch. */
182
+ type QueueMessage<T = unknown> = {
183
+ readonly id: string;
184
+ readonly timestamp: Date;
185
+ readonly body: T;
186
+ readonly attempts: number;
187
+ ack(): void;
188
+ retry(options?: QueueRetryOptions): void;
189
+ };
190
+ /** A batch of queue messages delivered to a consumer handler. */
191
+ type QueueBatch<T = unknown> = {
192
+ readonly queue: string;
193
+ readonly messages: Array<QueueMessage<T>>;
194
+ ackAll(): void;
195
+ retryAll(options?: QueueRetryOptions): void;
196
+ };
197
+ type QueueFn<T = unknown> = (batch: QueueBatch<T>, env: CloudEnv["Bindings"]) => void | Promise<void>;
198
+ /**
199
+ * A typed queue handler with a phantom type carrier for the payload type.
200
+ * `__payload` exists at the type level only —
201
+ * TypeScript's `typeof import(...)` reads it for codegen.
202
+ */
203
+ interface TypedQueueHandler<T = unknown> {
204
+ (batch: QueueBatch<T>, env: CloudEnv["Bindings"]): void | Promise<void>;
205
+ readonly __payload: T;
206
+ }
207
+ /**
208
+ * A typed handler with phantom type carriers for validators and return type.
209
+ * `__validators` and `__output` exist at the type level only —
210
+ * TypeScript's `typeof import(...)` reads them for codegen.
211
+ */
212
+ interface TypedHandler<V extends ValidatorSlots = {}, R = unknown> {
213
+ (c: CloudContext): Promise<Response> | Response | unknown | Promise<unknown>;
214
+ readonly __validators: V;
215
+ readonly __output: R;
216
+ }
217
+ /**
218
+ * Define a route handler, optionally composed with per-route middleware.
219
+ *
220
+ * Single argument: identity wrapper (backwards compatible).
221
+ * Multiple arguments: middleware chain + final handler, composed at runtime.
222
+ */
223
+ declare function defineHandler<R>(handler: (c: CloudContext) => R | Response | Promise<R | Response>): TypedHandler<{}, Exclude<Awaited<R>, Response>>;
224
+ declare function defineHandler(m1: MiddlewareFn, handler: HandlerFn): TypedHandler;
225
+ declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, handler: HandlerFn): TypedHandler;
226
+ declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, m3: MiddlewareFn, handler: HandlerFn): TypedHandler;
227
+ declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, m3: MiddlewareFn, m4: MiddlewareFn, handler: HandlerFn): TypedHandler;
228
+ declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, m3: MiddlewareFn, m4: MiddlewareFn, m5: MiddlewareFn, handler: HandlerFn): TypedHandler;
229
+ /**
230
+ * Create a handler with input validation using Standard Schema validators.
231
+ *
232
+ * ```ts
233
+ * export const POST = defineHandler.withValidator({
234
+ * body: mySchema,
235
+ * })((c, { body }) => {
236
+ * return { received: body };
237
+ * });
238
+ * ```
239
+ */
240
+ declare namespace defineHandler {
241
+ function withValidator<V extends ValidatorSlots>(validators: V): <R>(handler: (c: CloudContext, input: HandlerInput<V>) => R) => TypedHandler<V, R>;
242
+ }
243
+ /**
244
+ * Identity function that provides type inference for middleware.
245
+ * At runtime it simply returns the function passed to it.
246
+ */
247
+ declare function defineMiddleware(handler: MiddlewareHandler<CloudEnv>): MiddlewareHandler<CloudEnv>;
248
+ /**
249
+ * Identity function that provides type inference for scheduled jobs.
250
+ * At runtime it simply returns the function passed to it.
251
+ */
252
+ declare function defineScheduled(handler: ScheduledFn): ScheduledFn;
253
+ /**
254
+ * Identity function that provides type inference for SSR render entry.
255
+ * The second argument includes asset tags for client scripts/styles.
256
+ */
257
+ declare function defineRender(handler: RenderFn): RenderFn;
258
+ /**
259
+ * Identity function that provides type inference for page `head()` exports.
260
+ * At runtime it simply returns the function passed to it.
261
+ */
262
+ declare function defineHead<P = Record<string, unknown>>(handler: (c: CloudContext, props: P) => HeadDescriptor | undefined): (c: CloudContext, props: P) => HeadDescriptor | undefined;
263
+ /**
264
+ * Identity function that provides type inference for queue consumers.
265
+ * At runtime it simply returns the function passed to it.
266
+ */
267
+ declare function defineQueue<T = unknown>(handler: QueueFn<T>): TypedQueueHandler<T>;
268
+ //#endregion
269
+ export { HandlerInput as C, ValidationError as S, runValidation as T, defineScheduled as _, QueueBatch as a, InferProps as b, RenderAssetTags as c, VoidAssetRewriteError as d, defineHandler as f, defineRender as g, defineQueue as h, CloudEnv as i, TypedHandler as l, defineMiddleware as m, CloudContext as n, QueueMessage as o, defineHead as p, CloudContextVariables as r, QueueRetryOptions as s, CloudBindings as t, TypedQueueHandler as u, Deferred as v, ValidatorSlots as w, defer as x, DeferredState as y };
@@ -0,0 +1,45 @@
1
+ //#region src/pages/head.d.ts
2
+ /** Shape of a single page's head metadata. */
3
+ interface HeadDescriptor {
4
+ title?: string;
5
+ meta?: Array<{
6
+ name?: string;
7
+ property?: string;
8
+ content?: string;
9
+ charset?: string;
10
+ }>;
11
+ link?: Array<{
12
+ rel: string;
13
+ href: string;
14
+ [key: string]: string | undefined;
15
+ }>;
16
+ script?: Array<{
17
+ src?: string;
18
+ innerHTML?: string;
19
+ [key: string]: string | undefined;
20
+ }>;
21
+ htmlAttrs?: Record<string, string>;
22
+ bodyAttrs?: Record<string, string>;
23
+ }
24
+ /** Extended head config with template support (used in void.json). */
25
+ interface HeadConfig extends HeadDescriptor {
26
+ /** Title template — `%s` is replaced with the page title. */
27
+ titleTemplate?: string;
28
+ }
29
+ /**
30
+ * Merge head descriptors with precedence: page > middleware > config.
31
+ *
32
+ * - `title`: page wins; `titleTemplate` from config wraps it (`%s` replaced)
33
+ * - `meta`: page overrides entries with same `name`/`property`; others appended
34
+ * - `link`/`script`: concatenated (config first, then middleware, then page)
35
+ * - `htmlAttrs`/`bodyAttrs`: shallow merge, page wins conflicts
36
+ */
37
+ declare function resolveHead(configHead: HeadConfig | undefined, middlewareHead: HeadDescriptor | undefined, pageHead: HeadDescriptor | undefined): HeadDescriptor | undefined;
38
+ /** Serialize a HeadDescriptor to HTML tags for injection into `<head>`. */
39
+ declare function renderHeadToString(head: HeadDescriptor): string;
40
+ /** Serialize htmlAttrs to an attribute string (includes leading space). */
41
+ declare function renderHtmlAttrs(head: HeadDescriptor): string;
42
+ /** Serialize bodyAttrs to an attribute string (includes leading space). */
43
+ declare function renderBodyAttrs(head: HeadDescriptor): string;
44
+ //#endregion
45
+ export { renderHtmlAttrs as a, renderHeadToString as i, HeadDescriptor as n, resolveHead as o, renderBodyAttrs as r, HeadConfig as t };
@@ -0,0 +1,279 @@
1
+ import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
+ import { a as convertRedirectsConfig, d as parseHostPrefixedSource, i as convertHeadersConfig, o as convertRewritesConfig, r as convertFallbacksConfig, s as countSplats, t as VALID_REDIRECT_STATUSES, u as isProtocolRelative } from "./config-BIa9HwVX.mjs";
3
+ import { i as voidWarn } from "./log-DXdqnmhF.mjs";
4
+ import { existsSync, readFileSync } from "node:fs";
5
+ //#region src/cli/headers.ts
6
+ /**
7
+ * Parse a Cloudflare/Netlify `_headers` file into HeaderRule[].
8
+ *
9
+ * Format:
10
+ * - Non-indented lines = path pattern (starts a new block)
11
+ * - Indented lines = `Header-Name: value` (split on first `:`)
12
+ * - Lines starting with `#` are comments
13
+ * - `! Header-Name` unset directives are skipped (last-match-wins handles this)
14
+ *
15
+ * Output is sorted by pattern length ascending (shortest first) so that
16
+ * more-specific patterns come last — matching dispatch's last-match-wins semantics.
17
+ *
18
+ * Returns `undefined` if the file doesn't exist or yields no valid rules.
19
+ */
20
+ function parseHeadersFile(dir) {
21
+ const filePath = join(dir, "_headers");
22
+ if (!existsSync(filePath)) return;
23
+ const content = readFileSync(filePath, "utf-8");
24
+ const rules = [];
25
+ let current = null;
26
+ for (const line of content.split("\n")) {
27
+ const trimmed = line.trimEnd();
28
+ if (trimmed === "" || trimmed.startsWith("#")) continue;
29
+ if (line[0] === " " || line[0] === " ") {
30
+ if (!current) continue;
31
+ const stripped = trimmed.trimStart();
32
+ if (stripped.startsWith("!")) continue;
33
+ const colonIdx = stripped.indexOf(":");
34
+ if (colonIdx === -1) continue;
35
+ const name = stripped.slice(0, colonIdx).trim();
36
+ const value = stripped.slice(colonIdx + 1).trim();
37
+ if (name) current.headers.push([name, value]);
38
+ } else {
39
+ if (current && current.headers.length > 0) rules.push(current);
40
+ current = {
41
+ pattern: trimmed,
42
+ headers: []
43
+ };
44
+ }
45
+ }
46
+ if (current && current.headers.length > 0) rules.push(current);
47
+ if (rules.length === 0) return;
48
+ rules.sort((a, b) => a.pattern.length - b.pattern.length);
49
+ return rules;
50
+ }
51
+ /**
52
+ * Parse a `_redirects` file.
53
+ *
54
+ * Format: `source destination [status]` per line (status defaults to 302).
55
+ * Lines starting with # are comments. Includes 3xx redirects and 200 rewrites.
56
+ *
57
+ * Force suffix (`!`) semantics:
58
+ * - On status 200: toggles `force: true` (Netlify-compat). The plain form
59
+ * fires only when the static asset would 404; the force form fires
60
+ * unconditionally, overriding any matching static asset.
61
+ * - On 3xx (301/302/307/308): silently stripped. A redirect always changes
62
+ * the URL, so `!` is redundant. We count these in `redundantForceOn3xx`
63
+ * so the deploy command can surface a single aggregated lint warning
64
+ * rather than one per line — Netlify users pasting their `_redirects`
65
+ * file shouldn't be punished for harmless cruft.
66
+ *
67
+ * Returns `undefined` when the file doesn't exist or yields no valid rules.
68
+ * Otherwise returns `{rules, redundantForceOn3xx}`.
69
+ */
70
+ function parseRedirectsFile(dir) {
71
+ const filePath = join(dir, "_redirects");
72
+ if (!existsSync(filePath)) return;
73
+ const content = readFileSync(filePath, "utf-8");
74
+ const rules = [];
75
+ let redundantForceOn3xx = 0;
76
+ const rawLines = content.split("\n");
77
+ for (let i = 0; i < rawLines.length; i++) {
78
+ const lineNumber = i + 1;
79
+ const trimmed = rawLines[i].trim();
80
+ if (!trimmed || trimmed.startsWith("#")) continue;
81
+ const parts = trimmed.split(/\s+/);
82
+ if (parts.length < 2) continue;
83
+ const origin = `_redirects:${lineNumber}`;
84
+ const [rawSource, destination, statusStr] = parts;
85
+ const parsedSource = parseHostPrefixedSource(rawSource);
86
+ if ("error" in parsedSource) {
87
+ voidWarn(`Skipping _redirects entry "${rawSource} ${destination}${statusStr ? ` ${statusStr}` : ""}" (line ${lineNumber}): source ${parsedSource.error}.`);
88
+ continue;
89
+ }
90
+ const { host, path: source } = parsedSource;
91
+ if (countSplats(source) > 1) {
92
+ voidWarn(`Skipping _redirects entry "${rawSource} ${destination}${statusStr ? ` ${statusStr}` : ""}" (line ${lineNumber}): source must contain at most one "*" wildcard (captured as :splat).`);
93
+ continue;
94
+ }
95
+ let status;
96
+ let force = false;
97
+ if (statusStr) if (statusStr.endsWith("!")) {
98
+ const numericPart = statusStr.slice(0, -1);
99
+ status = parseInt(numericPart, 10);
100
+ if (status === 200) force = true;
101
+ else if (status >= 300 && status < 400) redundantForceOn3xx++;
102
+ } else status = parseInt(statusStr, 10);
103
+ else status = 302;
104
+ if (status === 200) {
105
+ if (!destination.startsWith("/")) {
106
+ voidWarn(`Skipping _redirects rewrite "${rawSource} ${destination} ${force ? "200!" : "200"}": destination must start with "/" (only internal paths are supported).`);
107
+ continue;
108
+ }
109
+ if (isProtocolRelative(destination)) {
110
+ voidWarn(`Skipping _redirects rewrite "${rawSource} ${destination} ${force ? "200!" : "200"}": destination must not start with "//" (protocol-relative URLs parse as cross-origin; only internal paths are supported).`);
111
+ continue;
112
+ }
113
+ if (destination.includes("?")) {
114
+ voidWarn(`Skipping _redirects rewrite "${rawSource} ${destination} ${force ? "200!" : "200"}": destination must not contain "?" (query strings are not supported in rewrite destinations; the incoming request's query is preserved automatically).`);
115
+ continue;
116
+ }
117
+ rules.push({
118
+ source,
119
+ destination,
120
+ status,
121
+ force,
122
+ origin,
123
+ ...host && { host }
124
+ });
125
+ } else if (status >= 300 && status < 400) {
126
+ if (!VALID_REDIRECT_STATUSES.has(status)) {
127
+ voidWarn(`Skipping _redirects entry "${rawSource} ${destination} ${statusStr}" (line ${lineNumber}): redirect status must be 301, 302, 303, 307, or 308.`);
128
+ continue;
129
+ }
130
+ rules.push({
131
+ source,
132
+ destination,
133
+ status,
134
+ origin,
135
+ ...host && { host }
136
+ });
137
+ }
138
+ }
139
+ if (rules.length === 0 && redundantForceOn3xx === 0) return;
140
+ return {
141
+ rules,
142
+ redundantForceOn3xx
143
+ };
144
+ }
145
+ /**
146
+ * Split parsed `_redirects` rules into "always-apply" and "asset-miss only"
147
+ * buckets. Rules with `status: 200` and `force === false` are fallbacks — they
148
+ * should only fire when the static asset resolver would 404. All other rules
149
+ * (3xx redirects and forced `200!` rewrites) stay in the "always" bucket and
150
+ * are merged with `routing.rewrites` / `routing.redirects` from void.json.
151
+ */
152
+ function splitRedirectRulesByForce(rules) {
153
+ const always = [];
154
+ const fallbacks = [];
155
+ if (!rules) return {
156
+ always,
157
+ fallbacks
158
+ };
159
+ for (const rule of rules) if (rule.status === 200 && rule.force !== true) fallbacks.push(rule);
160
+ else always.push(rule);
161
+ return {
162
+ always,
163
+ fallbacks
164
+ };
165
+ }
166
+ /**
167
+ * Merge file-based rules (`_redirects`, `_headers`) in `dir` with routing
168
+ * rules from `void.json`. Shared between the deploy pipeline and the dev
169
+ * plugin so both surfaces produce identical rule tables.
170
+ *
171
+ * Ordering for routing rules (redirects/rewrites/fallbacks): `void.json`
172
+ * rules first, then `_redirects` file rules. Because the router evaluates
173
+ * routing rules with first-match-wins semantics, `void.json` entries
174
+ * override `_redirects` entries for the same source — matching the
175
+ * documented precedence (`docs/guide/edge/rewrites.md`). This holds even
176
+ * though `_redirects` is conceptually "closer to the build output".
177
+ *
178
+ * Header rules use the inverse order — `_redirects`/`_headers` last —
179
+ * because header rules are last-match-wins (`_headers` is Netlify-style
180
+ * last-wins). The asymmetry is intentional and matches dispatch.
181
+ *
182
+ * Phase split:
183
+ * - `_redirects` `200!` (force) + 3xx entries → `redirectRules` (always-fire)
184
+ * - `_redirects` plain `200` entries → `fallbackRules` (asset-miss)
185
+ * - `routing.redirects` + `routing.rewrites` → `redirectRules`
186
+ * - `routing.fallbacks` → `fallbackRules`
187
+ *
188
+ * Returns `fallbackRules === undefined` when empty so callers that default to
189
+ * "no post-asset phase" behave identically to the old deploy code.
190
+ *
191
+ * Duplicate linting is NOT called here (callers decide which warning surface
192
+ * to use — CLI vs. Vite logger). `redundantForceOn3xx` is returned raw for
193
+ * the same reason.
194
+ */
195
+ function mergeRoutingRules(opts) {
196
+ const { dir, routing } = opts;
197
+ const fileDir = dir !== null && existsSync(dir) ? dir : null;
198
+ const fileHeaders = fileDir !== null ? parseHeadersFile(fileDir) : void 0;
199
+ const fileParsed = fileDir !== null ? parseRedirectsFile(fileDir) : void 0;
200
+ const { always: fileAlways, fallbacks: fileFallbacks } = splitRedirectRulesByForce(fileParsed?.rules);
201
+ const cfgHeaders = convertHeadersConfig(routing?.headers);
202
+ const cfgRedirects = convertRedirectsConfig(routing?.redirects);
203
+ const cfgRewrites = convertRewritesConfig(routing?.rewrites);
204
+ const cfgFallbacks = convertFallbacksConfig(routing?.fallbacks);
205
+ const headerRules = [...fileHeaders ?? [], ...cfgHeaders ?? []];
206
+ const redirectRules = [
207
+ ...cfgRedirects ?? [],
208
+ ...cfgRewrites ?? [],
209
+ ...fileAlways
210
+ ];
211
+ const mergedFallbacks = [...cfgFallbacks ?? [], ...fileFallbacks];
212
+ return {
213
+ headerRules,
214
+ redirectRules,
215
+ fallbackRules: mergedFallbacks.length > 0 ? mergedFallbacks : void 0,
216
+ redundantForceOn3xx: fileParsed?.redundantForceOn3xx ?? 0
217
+ };
218
+ }
219
+ /**
220
+ * Warn when a rule's `destination` contains a literal `*`. The platform's
221
+ * `substituteParams` only replaces `:name` tokens (e.g. `:splat`, `:id`) —
222
+ * bare `*` in destinations is a literal character, not a capture reference,
223
+ * and will silently pass through to the rewritten/redirected URL.
224
+ *
225
+ * Users who write `/old/*` → `/new/*` almost always intended `:splat` to
226
+ * reflect the captured portion of the source wildcard. Surface the mistake
227
+ * with a single aggregated warning at the same surface as
228
+ * `lintDuplicateSources` — per-phase, near the merge site — rather than
229
+ * failing the deploy: a `*` in a destination is well-formed output, just
230
+ * probably not what was meant.
231
+ *
232
+ * Only reported once per rule — the count of `*` in the destination is
233
+ * irrelevant, a single occurrence is already suspicious.
234
+ */
235
+ function lintDestinationSplats(rules, phaseName) {
236
+ if (!rules || rules.length === 0) return;
237
+ const affected = rules.filter((r) => r.destination.includes("*"));
238
+ if (affected.length === 0) return;
239
+ voidWarn(`destinations in ${phaseName} contain a literal "*" — splat tokens are not substituted in destinations; use ":splat" (or other named params) or rewrite the destination:\n${affected.map((r) => ` ${r.source} → ${r.destination} (${r.origin ?? "<unknown>"})`).join("\n")}`);
240
+ }
241
+ /**
242
+ * Warn when the same `source` pattern appears more than once within a single
243
+ * merged phase (pre-asset `redirectRules` or post-asset `fallbackRules`).
244
+ *
245
+ * Sources are scoped to the phase: a pattern appearing once in redirects and
246
+ * once in fallbacks is *not* a collision, because those lists run in separate
247
+ * phases and don't shadow each other. Within a single phase the dispatcher
248
+ * uses first-match-wins semantics, so a duplicate silently hides the later
249
+ * entry. This lint never fails the deploy; it surfaces the collision so the
250
+ * user can decide whether to fix it.
251
+ *
252
+ * Only exact string duplicates are reported. Subset-shadow cases (e.g. `/*`
253
+ * overshadowing `/docs`) are out of scope — pattern-aware analysis would be
254
+ * both harder and noisier.
255
+ *
256
+ * Emits a single aggregated warning summarizing every duplicated source, each
257
+ * annotated with the `origin` of every occurrence (e.g. `_redirects:12` vs
258
+ * `void.json#routing.rewrites`). Aggregation avoids a wall of per-pair
259
+ * warnings on configs with many collisions.
260
+ */
261
+ function lintDuplicateSources(rules, phaseName) {
262
+ if (!rules || rules.length < 2) return;
263
+ const bySource = /* @__PURE__ */ new Map();
264
+ for (const rule of rules) {
265
+ const existing = bySource.get(rule.source);
266
+ if (existing) existing.push(rule);
267
+ else bySource.set(rule.source, [rule]);
268
+ }
269
+ const lines = [];
270
+ for (const [source, occurrences] of bySource) {
271
+ if (occurrences.length < 2) continue;
272
+ const origins = occurrences.map((r) => r.origin ?? "<unknown>").join(", ");
273
+ lines.push(` ${source} — ${origins}`);
274
+ }
275
+ if (lines.length === 0) return;
276
+ voidWarn(`duplicate rule sources detected in ${phaseName} (first match wins — the earlier entry takes effect):\n${lines.join("\n")}`);
277
+ }
278
+ //#endregion
279
+ export { parseRedirectsFile as i, lintDuplicateSources as n, mergeRoutingRules as r, lintDestinationSplats as t };
@@ -0,0 +1,32 @@
1
+ import { n as HeadDescriptor } from "./head-P-egrtFE.mjs";
2
+ import { r as AuthUser } from "./auth-BdsJ0Aff.mjs";
3
+ import { C as HandlerInput, _ as defineScheduled, a as QueueBatch, b as InferProps, c as RenderAssetTags, d as VoidAssetRewriteError, f as defineHandler, g as defineRender, h as defineQueue, i as CloudEnv, l as TypedHandler, m as defineMiddleware, n as CloudContext, o as QueueMessage, p as defineHead, r as CloudContextVariables, s as QueueRetryOptions, u as TypedQueueHandler, v as Deferred, w as ValidatorSlots, x as defer, y as DeferredState } from "./handler-B0ds0OHJ.mjs";
4
+ import { QueueMap } from "./runtime/queues.mjs";
5
+ import { PluginConfig } from "@cloudflare/vite-plugin";
6
+ import { Plugin } from "vite";
7
+
8
+ //#region src/index.d.ts
9
+ /**
10
+ * Void plugin — the main entry point.
11
+ *
12
+ * Composes:
13
+ * 1. Routing plugin (file-based routing from routes/ and middleware/)
14
+ * 2. Migration plugin (auto-apply .sql migrations on dev startup)
15
+ * 3. @cloudflare/vite-plugin (workerd runtime, HMR, builds)
16
+ *
17
+ * Binding inference runs synchronously here so results are available
18
+ * before the Cloudflare plugin initializes.
19
+ *
20
+ * If the user has a `wrangler.jsonc` / `wrangler.json` in their project root,
21
+ * the Cloudflare plugin reads it and provides the resolved config to our
22
+ * config function. Bindings already defined there (with real IDs for
23
+ * production deployment) are preserved — we only add inferred bindings
24
+ * that are missing. This allows `vite build && wrangler deploy` to work
25
+ * for deploying directly to Cloudflare without the Void platform.
26
+ */
27
+ declare function voidPlugin(options?: {
28
+ persistTo?: string;
29
+ auxiliaryWorkers?: PluginConfig["auxiliaryWorkers"];
30
+ }): Array<Plugin>;
31
+ //#endregion
32
+ export { type AuthUser, type CloudContext, type CloudContextVariables, type CloudEnv, type Deferred, type DeferredState, type HandlerInput, type HeadDescriptor, type InferProps, type QueueBatch, type QueueMap, type QueueMessage, type QueueRetryOptions, type RenderAssetTags, type TypedHandler, type TypedQueueHandler, type ValidatorSlots, VoidAssetRewriteError, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };