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,1807 @@
1
+ #!/usr/bin/env node
2
+ import { a as join } from "../pathe.M-eThtNZ-D-kmWkCS.mjs";
3
+ import { c as sectionTitle, o as helpLine, s as import_picocolors, t as categoryTitle } from "../output-BwlcIYSR.mjs";
4
+ import { c as R, u as Se, y as ye } from "../dist-Dayj3gCK.mjs";
5
+ import { existsSync, readFileSync } from "node:fs";
6
+ import { fileURLToPath } from "node:url";
7
+ import { parseArgs } from "node:util";
8
+ //#region src/cli/agents.ts
9
+ function getPackageDir() {
10
+ let dir = join(fileURLToPath(import.meta.url), "..");
11
+ for (let i = 0; i < 5; i++) {
12
+ if (existsSync(join(dir, "package.json"))) {
13
+ if (JSON.parse(readFileSync(join(dir, "package.json"), "utf-8")).name === "void") return dir;
14
+ }
15
+ dir = join(dir, "..");
16
+ }
17
+ throw new Error("Could not find void package root");
18
+ }
19
+ const agents = {
20
+ "claude-code": {
21
+ displayName: "Claude Code",
22
+ skillsDir: ".claude/skills",
23
+ detect: (root) => existsSync(join(root, ".claude")) || existsSync(join(root, "CLAUDE.md")),
24
+ mcpConfig: [{
25
+ filePath: ".claude/settings.json",
26
+ rootKey: "mcpServers"
27
+ }, {
28
+ filePath: ".claude/settings.local.json",
29
+ rootKey: "mcpServers"
30
+ }]
31
+ },
32
+ amp: {
33
+ displayName: "Amp",
34
+ skillsDir: ".agents/skills",
35
+ detect: (root) => existsSync(join(root, ".agents")),
36
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
37
+ },
38
+ codex: {
39
+ displayName: "Codex",
40
+ skillsDir: ".agents/skills",
41
+ detect: (root) => existsSync(join(root, ".codex")),
42
+ mcpHint: "codex mcp add void -- npx void mcp"
43
+ },
44
+ cursor: {
45
+ displayName: "Cursor",
46
+ skillsDir: ".agents/skills",
47
+ detect: (root) => existsSync(join(root, ".cursor")),
48
+ mcpConfig: [{
49
+ filePath: ".cursor/mcp.json",
50
+ rootKey: "mcpServers"
51
+ }]
52
+ },
53
+ windsurf: {
54
+ displayName: "Windsurf",
55
+ skillsDir: ".windsurf/skills",
56
+ detect: (root) => existsSync(join(root, ".windsurf")),
57
+ mcpConfig: [{
58
+ filePath: ".windsurf/mcp.json",
59
+ rootKey: "mcpServers"
60
+ }]
61
+ },
62
+ "gemini-cli": {
63
+ displayName: "Gemini CLI",
64
+ skillsDir: ".agents/skills",
65
+ detect: (root) => existsSync(join(root, ".gemini")),
66
+ mcpHint: "gemini mcp add void -- npx void mcp"
67
+ },
68
+ "github-copilot": {
69
+ displayName: "GitHub Copilot",
70
+ skillsDir: ".agents/skills",
71
+ detect: (root) => existsSync(join(root, ".github", "copilot-instructions.md")) || existsSync(join(root, ".vscode", "mcp.json")),
72
+ mcpConfig: [{
73
+ filePath: ".vscode/mcp.json",
74
+ rootKey: "servers",
75
+ extraFields: { type: "stdio" }
76
+ }]
77
+ },
78
+ cline: {
79
+ displayName: "Cline",
80
+ skillsDir: ".cline/skills",
81
+ detect: (root) => existsSync(join(root, ".cline")),
82
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
83
+ },
84
+ roo: {
85
+ displayName: "Roo Code",
86
+ skillsDir: ".roo/skills",
87
+ detect: (root) => existsSync(join(root, ".roo")),
88
+ mcpConfig: [{
89
+ filePath: ".roo/mcp.json",
90
+ rootKey: "mcpServers"
91
+ }]
92
+ },
93
+ kilo: {
94
+ displayName: "Kilo Code",
95
+ skillsDir: ".kilocode/skills",
96
+ detect: (root) => existsSync(join(root, ".kilocode")),
97
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
98
+ },
99
+ continue: {
100
+ displayName: "Continue",
101
+ skillsDir: ".continue/skills",
102
+ detect: (root) => existsSync(join(root, ".continue")),
103
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
104
+ },
105
+ goose: {
106
+ displayName: "Goose",
107
+ skillsDir: ".goose/skills",
108
+ detect: (root) => existsSync(join(root, ".goose")),
109
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
110
+ },
111
+ opencode: {
112
+ displayName: "OpenCode",
113
+ skillsDir: ".agents/skills",
114
+ detect: (root) => existsSync(join(root, ".opencode")),
115
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
116
+ },
117
+ trae: {
118
+ displayName: "Trae",
119
+ skillsDir: ".trae/skills",
120
+ detect: (root) => existsSync(join(root, ".trae")),
121
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
122
+ },
123
+ junie: {
124
+ displayName: "Junie",
125
+ skillsDir: ".junie/skills",
126
+ detect: (root) => existsSync(join(root, ".junie")),
127
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
128
+ },
129
+ "kiro-cli": {
130
+ displayName: "Kiro CLI",
131
+ skillsDir: ".kiro/skills",
132
+ detect: (root) => existsSync(join(root, ".kiro")),
133
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
134
+ },
135
+ zencoder: {
136
+ displayName: "Zencoder",
137
+ skillsDir: ".zencoder/skills",
138
+ detect: (root) => existsSync(join(root, ".zencoder")),
139
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
140
+ },
141
+ "qwen-code": {
142
+ displayName: "Qwen Code",
143
+ skillsDir: ".qwen/skills",
144
+ detect: (root) => existsSync(join(root, ".qwen")),
145
+ mcpHint: "Run `npx void mcp` — this starts a stdio MCP server. See your agent's docs for how to add a local MCP server."
146
+ }
147
+ };
148
+ function getAgentById(id) {
149
+ return agents[id];
150
+ }
151
+ function detectAgents(root) {
152
+ return Object.values(agents).filter((a) => a.detect(root));
153
+ }
154
+ //#endregion
155
+ //#region src/cli/args.ts
156
+ function parseDeployArgs(args) {
157
+ let parsed;
158
+ try {
159
+ parsed = parseArgs({
160
+ args,
161
+ options: {
162
+ project: { type: "string" },
163
+ dir: { type: "string" },
164
+ spa: { type: "boolean" },
165
+ "skip-build": { type: "boolean" }
166
+ },
167
+ allowPositionals: true,
168
+ strict: true,
169
+ tokens: true
170
+ });
171
+ } catch (error) {
172
+ const message = error instanceof Error ? error.message : String(error);
173
+ if (message.includes("argument missing") || message.includes("argument is ambiguous")) throw new Error("deploy: --project requires a slug.");
174
+ const unknownOptionMatch = message.match(/Unknown option '([^']+)'/);
175
+ if (unknownOptionMatch) throw new Error(`deploy: Unknown option '${unknownOptionMatch[1]}'.`);
176
+ throw new Error(`deploy: ${message}.`);
177
+ }
178
+ if ((parsed.tokens ?? []).filter((token) => token.kind === "option" && token.name === "project").length > 1) throw new Error("deploy: --project can only be specified once.");
179
+ if (parsed.positionals.length > 0) throw new Error(`deploy: Unexpected argument '${parsed.positionals[0]}'.`);
180
+ const projectValue = parsed.values.project;
181
+ const projectSlug = typeof projectValue === "string" ? projectValue : void 0;
182
+ if (typeof projectSlug === "string" && projectSlug.startsWith("-")) throw new Error("deploy: --project requires a slug.");
183
+ return {
184
+ projectSlug,
185
+ dir: typeof parsed.values.dir === "string" ? parsed.values.dir : void 0,
186
+ spa: parsed.values.spa === true ? true : void 0,
187
+ skipBuild: parsed.values["skip-build"] === true ? true : void 0
188
+ };
189
+ }
190
+ //#endregion
191
+ //#region src/cli/auth-args.ts
192
+ const authSubcommands = [
193
+ {
194
+ name: "login",
195
+ description: "Log in with GitHub or Google"
196
+ },
197
+ {
198
+ name: "logout",
199
+ description: "Log out and remove credentials"
200
+ },
201
+ {
202
+ name: "whoami",
203
+ description: "Show the logged-in username"
204
+ },
205
+ {
206
+ name: "token",
207
+ description: "Copy auth token to clipboard"
208
+ }
209
+ ];
210
+ function parseAuthArgs(args) {
211
+ const [subcommand, extra] = args;
212
+ if (!subcommand || ![
213
+ "login",
214
+ "logout",
215
+ "whoami",
216
+ "token"
217
+ ].includes(subcommand)) throw new Error("auth: Usage: void auth <login|logout|whoami|token>.");
218
+ if (extra) throw new Error(`auth: Unexpected argument '${extra}'.`);
219
+ return { subcommand };
220
+ }
221
+ //#endregion
222
+ //#region src/cli/db-args.ts
223
+ const dbSubcommands = [
224
+ {
225
+ name: "push",
226
+ description: "Push schema to local D1 (no migration files)"
227
+ },
228
+ {
229
+ name: "generate",
230
+ description: "Generate SQL migrations from schema changes"
231
+ },
232
+ {
233
+ name: "status",
234
+ description: "Show migration status (local + remote)"
235
+ },
236
+ {
237
+ name: "reset",
238
+ description: "Reset local DB and re-run migrations"
239
+ },
240
+ {
241
+ name: "seed",
242
+ description: "Reset local DB, run migrations, and seed",
243
+ flags: [{
244
+ name: "--file",
245
+ arg: "<path>",
246
+ description: "Seed from a specific file"
247
+ }]
248
+ },
249
+ {
250
+ name: "execute",
251
+ arg: "<sql>",
252
+ description: "Run SQL against the local database"
253
+ },
254
+ {
255
+ name: "migrate",
256
+ description: "Apply pending migrations",
257
+ flags: [{
258
+ name: "--remote",
259
+ description: "Apply to the remote database"
260
+ }]
261
+ },
262
+ {
263
+ name: "studio",
264
+ description: "Open Drizzle Studio for the local database"
265
+ },
266
+ {
267
+ name: "set-url",
268
+ description: "Update the PostgreSQL connection string for deployment"
269
+ },
270
+ {
271
+ name: "rename-migrations",
272
+ description: "Rename migrations to timestamp-based format"
273
+ },
274
+ {
275
+ name: "export",
276
+ description: "Export local database as SQL",
277
+ flags: [
278
+ {
279
+ name: "--output",
280
+ arg: "<path>",
281
+ description: "Export to a specific file path"
282
+ },
283
+ {
284
+ name: "--no-data",
285
+ description: "Schema only (no INSERT statements)"
286
+ },
287
+ {
288
+ name: "--no-schema",
289
+ description: "Data only (no CREATE TABLE)"
290
+ },
291
+ {
292
+ name: "--table",
293
+ arg: "<name>",
294
+ description: "Export a single table"
295
+ }
296
+ ]
297
+ }
298
+ ];
299
+ function parseDbArgs(args) {
300
+ const parsed = parseArgs({
301
+ args,
302
+ options: {
303
+ file: { type: "string" },
304
+ output: { type: "string" },
305
+ "no-data": { type: "boolean" },
306
+ "no-schema": { type: "boolean" },
307
+ table: { type: "string" },
308
+ remote: { type: "boolean" }
309
+ },
310
+ allowPositionals: true,
311
+ strict: true
312
+ });
313
+ const [action, ...rest] = parsed.positionals;
314
+ if (action === "push") {
315
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
316
+ return { action };
317
+ }
318
+ if (action === "generate") {
319
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
320
+ return { action };
321
+ }
322
+ if (action === "status") {
323
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
324
+ return { action };
325
+ }
326
+ if (action === "reset") {
327
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
328
+ return { action };
329
+ }
330
+ if (action === "seed") {
331
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
332
+ return {
333
+ action,
334
+ file: typeof parsed.values.file === "string" ? parsed.values.file : void 0
335
+ };
336
+ }
337
+ if (action === "execute") {
338
+ const command = rest[0];
339
+ if (rest.length > 1) throw new Error(`db: Unexpected argument '${rest[1]}'.`);
340
+ const file = typeof parsed.values.file === "string" ? parsed.values.file : void 0;
341
+ if (!command && !file) throw new Error("db: Usage: void db execute <sql> or void db execute --file <path>.");
342
+ if (command && file) throw new Error("db: Provide either SQL inline or --file, not both.");
343
+ return {
344
+ action,
345
+ command,
346
+ file
347
+ };
348
+ }
349
+ if (action === "migrate") {
350
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
351
+ return {
352
+ action,
353
+ remote: parsed.values.remote === true ? true : void 0
354
+ };
355
+ }
356
+ if (action === "studio") {
357
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
358
+ return { action };
359
+ }
360
+ if (action === "set-url") {
361
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
362
+ return { action };
363
+ }
364
+ if (action === "rename-migrations") {
365
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
366
+ return { action };
367
+ }
368
+ if (action === "export") {
369
+ if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
370
+ return {
371
+ action,
372
+ output: typeof parsed.values.output === "string" ? parsed.values.output : void 0,
373
+ noData: parsed.values["no-data"] === true ? true : void 0,
374
+ noSchema: parsed.values["no-schema"] === true ? true : void 0,
375
+ table: typeof parsed.values.table === "string" ? parsed.values.table : void 0
376
+ };
377
+ }
378
+ throw new Error("db: Usage: void db <push|generate|status|reset|seed|execute|migrate|studio|export|set-url|rename-migrations>.");
379
+ }
380
+ //#endregion
381
+ //#region src/cli/domain-args.ts
382
+ const domainSubcommands = [
383
+ {
384
+ name: "add",
385
+ arg: "<hostname>",
386
+ description: "Add a custom domain"
387
+ },
388
+ {
389
+ name: "delete",
390
+ arg: "<hostname>",
391
+ description: "Remove a custom domain"
392
+ },
393
+ {
394
+ name: "list",
395
+ description: "List custom domains + status"
396
+ },
397
+ {
398
+ name: "status",
399
+ arg: "<hostname>",
400
+ description: "Check domain verification status"
401
+ }
402
+ ];
403
+ function parseDomainArgs(args) {
404
+ const subcommand = args[0];
405
+ if (!subcommand || ![
406
+ "add",
407
+ "delete",
408
+ "list",
409
+ "status"
410
+ ].includes(subcommand)) throw new Error("domain: Usage: void domain <add|delete|list|status> [hostname] [--project <name>].");
411
+ let hostname;
412
+ let projectSlug;
413
+ const rest = args.slice(1);
414
+ for (let i = 0; i < rest.length; i++) if (rest[i] === "--project" && rest[i + 1]) projectSlug = rest[++i];
415
+ else if (!hostname) hostname = rest[i];
416
+ if ((subcommand === "add" || subcommand === "delete" || subcommand === "status") && !hostname) throw new Error(`domain: Usage: void domain ${subcommand} <hostname> [--project <name>].`);
417
+ return {
418
+ subcommand,
419
+ hostname,
420
+ projectSlug
421
+ };
422
+ }
423
+ //#endregion
424
+ //#region src/cli/env-args.ts
425
+ const envSubcommands = [
426
+ {
427
+ name: "check",
428
+ description: "Validate env.ts schema against .env files (and optionally remote secrets)",
429
+ flags: [{
430
+ name: "--remote",
431
+ description: "Also check that required keys exist as remote secrets"
432
+ }]
433
+ },
434
+ {
435
+ name: "types",
436
+ description: "Regenerate .void/env.d.ts from env.ts"
437
+ },
438
+ {
439
+ name: "example",
440
+ description: "Refresh the void-managed block in .env.example",
441
+ flags: [{
442
+ name: "--force",
443
+ description: "Suppress the \"appended block\" notice (for scripted runs)"
444
+ }]
445
+ }
446
+ ];
447
+ function parseEnvArgs(args) {
448
+ const [subcommand, ...rest] = args;
449
+ if (subcommand === "check") {
450
+ const parsed = parseArgs({
451
+ args: rest,
452
+ options: { remote: { type: "boolean" } },
453
+ allowPositionals: true,
454
+ strict: true
455
+ });
456
+ if (parsed.positionals.length > 0) throw new Error(`env: Unexpected argument '${parsed.positionals[0]}'.`);
457
+ return {
458
+ subcommand: "check",
459
+ useRemoteSecrets: !!parsed.values.remote
460
+ };
461
+ }
462
+ if (subcommand === "types") {
463
+ if (rest.length > 0) throw new Error(`env: Unexpected argument '${rest[0]}'.`);
464
+ return { subcommand: "types" };
465
+ }
466
+ if (subcommand === "example") {
467
+ const parsed = parseArgs({
468
+ args: rest,
469
+ options: { force: { type: "boolean" } },
470
+ allowPositionals: true,
471
+ strict: true
472
+ });
473
+ if (parsed.positionals.length > 0) throw new Error(`env: Unexpected argument '${parsed.positionals[0]}'.`);
474
+ return {
475
+ subcommand: "example",
476
+ force: !!parsed.values.force
477
+ };
478
+ }
479
+ throw new Error("env: Usage: void env <check|types|example>.");
480
+ }
481
+ //#endregion
482
+ //#region src/cli/gen-args.ts
483
+ const genSubcommands = [
484
+ {
485
+ name: "model",
486
+ arg: "<name>",
487
+ description: "Generate migration + CRUD routes + db types",
488
+ followUp: {
489
+ type: "repeat-input",
490
+ placeholder: "name:type or name:type?"
491
+ }
492
+ },
493
+ {
494
+ name: "migration",
495
+ arg: "<name>",
496
+ description: "Generate an empty migration file"
497
+ },
498
+ {
499
+ name: "route",
500
+ arg: "<path>",
501
+ description: "Generate a route with handler exports",
502
+ followUp: {
503
+ type: "multi-select",
504
+ flag: "--methods",
505
+ options: [
506
+ {
507
+ value: "get",
508
+ label: "GET",
509
+ selected: true
510
+ },
511
+ {
512
+ value: "post",
513
+ label: "POST"
514
+ },
515
+ {
516
+ value: "put",
517
+ label: "PUT"
518
+ },
519
+ {
520
+ value: "patch",
521
+ label: "PATCH"
522
+ },
523
+ {
524
+ value: "delete",
525
+ label: "DELETE"
526
+ }
527
+ ]
528
+ }
529
+ },
530
+ {
531
+ name: "middleware",
532
+ arg: "<name>",
533
+ description: "Generate a numbered middleware file"
534
+ },
535
+ {
536
+ name: "ssr",
537
+ description: "Generate SSR entry + client + App component",
538
+ flags: [
539
+ {
540
+ name: "--react",
541
+ description: "Use React"
542
+ },
543
+ {
544
+ name: "--vue",
545
+ description: "Use Vue"
546
+ },
547
+ {
548
+ name: "--svelte",
549
+ description: "Use Svelte"
550
+ },
551
+ {
552
+ name: "--solid",
553
+ description: "Use Solid"
554
+ }
555
+ ]
556
+ },
557
+ {
558
+ name: "cron",
559
+ arg: "<name>",
560
+ description: "Generate a cron job file"
561
+ },
562
+ {
563
+ name: "queue",
564
+ arg: "<name>",
565
+ description: "Generate a queue consumer file"
566
+ }
567
+ ];
568
+ const COLUMN_TYPES = new Set([
569
+ "string",
570
+ "text",
571
+ "datetime",
572
+ "integer",
573
+ "boolean",
574
+ "real",
575
+ "blob"
576
+ ]);
577
+ const VALID_METHODS = new Set([
578
+ "get",
579
+ "post",
580
+ "put",
581
+ "patch",
582
+ "delete"
583
+ ]);
584
+ function parseModelArgs(args) {
585
+ const [name, ...rest] = args;
586
+ if (!name) throw new Error("gen: Usage: void gen model <name> [columns...].");
587
+ if (!/^[a-z_][a-z0-9_]*$/.test(name)) throw new Error("gen: Model name must be lowercase alphanumeric with underscores and no leading digits.");
588
+ const columns = [];
589
+ for (const col of rest) {
590
+ const match = col.match(/^([a-z_][a-z0-9_]*):([a-z]+)(\?)?$/);
591
+ if (!match) throw new Error(`gen: Invalid column format '${col}'. Use name:type or name:type?.`);
592
+ const [, colName, colType, nullable] = match;
593
+ if (!COLUMN_TYPES.has(colType)) throw new Error(`gen: Unknown column type '${colType}'. Use one of: ${[...COLUMN_TYPES].join(", ")}.`);
594
+ columns.push({
595
+ name: colName,
596
+ type: colType,
597
+ nullable: !!nullable
598
+ });
599
+ }
600
+ return {
601
+ subcommand: "model",
602
+ name,
603
+ columns
604
+ };
605
+ }
606
+ function parseMigrationArgs(args) {
607
+ const [name, extra] = args;
608
+ if (!name) throw new Error("gen: Usage: void gen migration <name>.");
609
+ if (extra) throw new Error(`gen: Unexpected argument '${extra}'.`);
610
+ if (!/^[a-z_][a-z0-9_]*$/.test(name)) throw new Error("gen: Migration name must be lowercase alphanumeric with underscores and no leading digits.");
611
+ return {
612
+ subcommand: "migration",
613
+ name
614
+ };
615
+ }
616
+ function parseRouteArgs(args) {
617
+ const parsed = parseArgs({
618
+ args,
619
+ options: { methods: { type: "string" } },
620
+ allowPositionals: true,
621
+ strict: true
622
+ });
623
+ const [routePath, extra] = parsed.positionals;
624
+ if (!routePath) throw new Error("gen: Usage: void gen route <path> [--methods get,post,...].");
625
+ if (extra) throw new Error(`gen: Unexpected argument '${extra}'.`);
626
+ let methods = ["get"];
627
+ if (typeof parsed.values.methods === "string") {
628
+ methods = parsed.values.methods.split(",").map((m) => m.trim().toLowerCase());
629
+ for (const m of methods) if (!VALID_METHODS.has(m)) throw new Error(`gen: Unknown HTTP method '${m}'. Use one of: ${[...VALID_METHODS].join(", ")}.`);
630
+ }
631
+ return {
632
+ subcommand: "route",
633
+ path: routePath.replace(/^\/+/, ""),
634
+ methods
635
+ };
636
+ }
637
+ function parseMiddlewareArgs(args) {
638
+ const [name, extra] = args;
639
+ if (!name) throw new Error("gen: Usage: void gen middleware <name>.");
640
+ if (extra) throw new Error(`gen: Unexpected argument '${extra}'.`);
641
+ return {
642
+ subcommand: "middleware",
643
+ name
644
+ };
645
+ }
646
+ function parseSsrArgs(args) {
647
+ const parsed = parseArgs({
648
+ args,
649
+ options: {
650
+ react: { type: "boolean" },
651
+ vue: { type: "boolean" },
652
+ svelte: { type: "boolean" },
653
+ solid: { type: "boolean" }
654
+ },
655
+ allowPositionals: true,
656
+ strict: true
657
+ });
658
+ if (parsed.positionals.length > 0) throw new Error(`gen: Unexpected argument '${parsed.positionals[0]}'.`);
659
+ const frameworks = [
660
+ "react",
661
+ "vue",
662
+ "svelte",
663
+ "solid"
664
+ ].filter((f) => parsed.values[f]);
665
+ if (frameworks.length > 1) throw new Error("gen: Specify only one framework flag.");
666
+ return {
667
+ subcommand: "ssr",
668
+ framework: frameworks[0]
669
+ };
670
+ }
671
+ function parseCronArgs(args) {
672
+ const [name, extra] = args;
673
+ if (!name) throw new Error("gen: Usage: void gen cron <name>.");
674
+ if (extra) throw new Error(`gen: Unexpected argument '${extra}'.`);
675
+ if (!/^[a-z_][a-z0-9_-]*$/.test(name)) throw new Error("gen: Cron name must be lowercase alphanumeric with underscores or hyphens and no leading digits.");
676
+ return {
677
+ subcommand: "cron",
678
+ name
679
+ };
680
+ }
681
+ function parseQueueArgs(args) {
682
+ const [name, extra] = args;
683
+ if (!name) throw new Error("gen: Usage: void gen queue <name>.");
684
+ if (extra) throw new Error(`gen: Unexpected argument '${extra}'.`);
685
+ if (!/^[a-z_][a-z0-9_-]*$/.test(name)) throw new Error("gen: Queue name must be lowercase alphanumeric with underscores or hyphens and no leading digits.");
686
+ return {
687
+ subcommand: "queue",
688
+ name
689
+ };
690
+ }
691
+ function parseGenArgs(args) {
692
+ const [subcommand, ...rest] = args;
693
+ if (subcommand === "model") return parseModelArgs(rest);
694
+ if (subcommand === "migration") return parseMigrationArgs(rest);
695
+ if (subcommand === "route") return parseRouteArgs(rest);
696
+ if (subcommand === "middleware") return parseMiddlewareArgs(rest);
697
+ if (subcommand === "ssr") return parseSsrArgs(rest);
698
+ if (subcommand === "cron") return parseCronArgs(rest);
699
+ if (subcommand === "queue") return parseQueueArgs(rest);
700
+ throw new Error("gen: Usage: void gen <model|migration|route|middleware|ssr|cron|queue>.");
701
+ }
702
+ //#endregion
703
+ //#region src/cli/ascii.ts
704
+ const asciiArts = [
705
+ `
706
+ ▄ ▄ ▄▄▄ ▄ ▐▌
707
+ █ █ █ █ ▄ ▐▌
708
+ ▀▄▀ ▀▄▄▄▀ █ ▗▞▀▜▌
709
+ █ ▝▚▄▟▌`,
710
+ `
711
+ oo dP
712
+ 88
713
+ dP .dP .d8888b. dP .d888b88
714
+ 88 d8' 88' \`88 88 88' \`88
715
+ 88 .88' 88. .88 88 88. .88
716
+ 8888P' \`88888P' dP \`88888P8`,
717
+ `
718
+ _ __
719
+ _ ______ (__)___/ /
720
+ | | / / __ \\/ / __ /
721
+ | |/ / /_/ / / /_/ /
722
+ |___/\\____/_/\\__,_/`
723
+ ];
724
+ //#endregion
725
+ //#region src/cli/help.ts
726
+ const HELP_TREE = {
727
+ init: {
728
+ summary: "Set up Void in a new or existing project.",
729
+ usage: ["void init [options]"],
730
+ options: [
731
+ {
732
+ command: "--agents",
733
+ description: "Set up agent instructions, skills, and MCP config"
734
+ },
735
+ {
736
+ command: "--tsconfig",
737
+ description: "Only update tsconfig.json"
738
+ },
739
+ {
740
+ command: "--github",
741
+ description: "Only create GitHub Actions workflow"
742
+ }
743
+ ],
744
+ examples: [{
745
+ command: "void init",
746
+ description: "Scaffold or configure the current project"
747
+ }, {
748
+ command: "void init --agents",
749
+ description: "Install agent instructions and MCP config"
750
+ }]
751
+ },
752
+ deploy: {
753
+ summary: "Build and deploy the current project to Void.",
754
+ usage: ["void deploy [options]"],
755
+ options: [
756
+ {
757
+ command: "--project <name>",
758
+ description: "Deploy target project name"
759
+ },
760
+ {
761
+ command: "--dir <path>",
762
+ description: "Deploy a static directory and skip build"
763
+ },
764
+ {
765
+ command: "--spa",
766
+ description: "Use SPA mode for static deploys"
767
+ },
768
+ {
769
+ command: "--skip-build",
770
+ description: "Skip the build step and use existing output"
771
+ }
772
+ ],
773
+ examples: [
774
+ {
775
+ command: "void deploy",
776
+ description: "Deploy the linked project"
777
+ },
778
+ {
779
+ command: "void deploy --project my-app",
780
+ description: "Deploy to a specific project"
781
+ },
782
+ {
783
+ command: "void deploy --dir dist --spa",
784
+ description: "Deploy a static SPA directory"
785
+ }
786
+ ]
787
+ },
788
+ auth: {
789
+ summary: "Log in, log out, and inspect local auth state.",
790
+ usage: ["void auth <command>"],
791
+ commands: [
792
+ {
793
+ command: "login",
794
+ description: "Log in with GitHub or Google"
795
+ },
796
+ {
797
+ command: "logout",
798
+ description: "Log out and remove credentials"
799
+ },
800
+ {
801
+ command: "whoami",
802
+ description: "Show the logged-in username"
803
+ },
804
+ {
805
+ command: "token",
806
+ description: "Copy auth token to clipboard"
807
+ }
808
+ ],
809
+ children: {
810
+ login: basicSubcommand("Log in with GitHub or Google.", "void auth login"),
811
+ logout: basicSubcommand("Log out and remove credentials.", "void auth logout"),
812
+ whoami: basicSubcommand("Show the logged-in username.", "void auth whoami"),
813
+ token: basicSubcommand("Copy auth token to clipboard.", "void auth token")
814
+ }
815
+ },
816
+ project: {
817
+ summary: "Manage Void projects and deployments.",
818
+ usage: ["void project <command>"],
819
+ commands: [
820
+ {
821
+ command: "status [name]",
822
+ description: "Show deployments for a project"
823
+ },
824
+ {
825
+ command: "link [name]",
826
+ description: "Link this directory to a project"
827
+ },
828
+ {
829
+ command: "list",
830
+ description: "List your projects"
831
+ },
832
+ {
833
+ command: "logs",
834
+ description: "Show runtime logs from the deployed project"
835
+ },
836
+ {
837
+ command: "rollback [deployId]",
838
+ description: "Roll back to a previous deployment"
839
+ },
840
+ {
841
+ command: "cancel [deployId]",
842
+ description: "Cancel an active deployment"
843
+ },
844
+ {
845
+ command: "delete [name]",
846
+ description: "Delete a project and all its resources"
847
+ },
848
+ {
849
+ command: "purge-cache",
850
+ description: "Purge all cached pages"
851
+ }
852
+ ],
853
+ children: {
854
+ status: basicSubcommand("Show deployments for a project.", "void project status [name]", "void project status my-app"),
855
+ link: basicSubcommand("Link this directory to a Void project.", "void project link [name]", "void project link my-app"),
856
+ list: basicSubcommand("List your projects.", "void project list"),
857
+ logs: {
858
+ summary: "Show runtime logs from the deployed project.",
859
+ usage: ["void project logs [options]"],
860
+ options: [
861
+ {
862
+ command: "--filter <text>",
863
+ description: "Substring search over log messages"
864
+ },
865
+ {
866
+ command: "--level <level>",
867
+ description: "Filter by level: error|warn|info|log|debug|all (default: all)"
868
+ },
869
+ {
870
+ command: "--range <range>",
871
+ description: "Time range to query (default: 1h)"
872
+ },
873
+ {
874
+ command: "--deployment <id>",
875
+ description: "Limit logs to one deployment"
876
+ }
877
+ ],
878
+ examples: [
879
+ {
880
+ command: "void project logs --range 30m",
881
+ description: "Show recent project logs"
882
+ },
883
+ {
884
+ command: "void project logs --level error",
885
+ description: "Show only error-level entries and exceptions"
886
+ },
887
+ {
888
+ command: "void project logs --filter websocket",
889
+ description: "Substring search over log messages"
890
+ }
891
+ ]
892
+ },
893
+ rollback: basicSubcommand("Roll back to a previous deployment.", "void project rollback [deployId]"),
894
+ cancel: basicSubcommand("Cancel an active deployment.", "void project cancel [deployId]"),
895
+ delete: {
896
+ summary: "Delete a project and all its resources.",
897
+ usage: ["void project delete [name] [options]"],
898
+ options: [{
899
+ command: "--force, -f",
900
+ description: "Delete without confirmation"
901
+ }],
902
+ examples: [{
903
+ command: "void project delete my-app",
904
+ description: "Delete a project"
905
+ }]
906
+ },
907
+ "purge-cache": {
908
+ summary: "Purge all cached pages for a project.",
909
+ usage: ["void project purge-cache [options]"],
910
+ options: [{
911
+ command: "--project <name>",
912
+ description: "Project name override"
913
+ }]
914
+ }
915
+ }
916
+ },
917
+ secret: {
918
+ summary: "Manage production secrets for Void projects.",
919
+ usage: ["void secret <command>"],
920
+ commands: [
921
+ {
922
+ command: "list",
923
+ description: "List project secrets"
924
+ },
925
+ {
926
+ command: "put <name>",
927
+ description: "Set a project secret"
928
+ },
929
+ {
930
+ command: "delete <name>",
931
+ description: "Delete a project secret"
932
+ },
933
+ {
934
+ command: "sync <file>",
935
+ description: "Sync secrets from a dotenv file"
936
+ }
937
+ ],
938
+ children: {
939
+ list: withProjectOption("List project secrets.", "void secret list [options]"),
940
+ put: withProjectOption("Set a project secret.", "void secret put <name> [options]"),
941
+ delete: withProjectOption("Delete a project secret.", "void secret delete <name> [options]"),
942
+ sync: withProjectOption("Sync secrets from a dotenv file.", "void secret sync <file> [options]")
943
+ }
944
+ },
945
+ domain: {
946
+ summary: "Configure custom domains for Void projects.",
947
+ usage: ["void domain <command>"],
948
+ commands: [
949
+ {
950
+ command: "add <hostname>",
951
+ description: "Add a custom domain"
952
+ },
953
+ {
954
+ command: "delete <hostname>",
955
+ description: "Remove a custom domain"
956
+ },
957
+ {
958
+ command: "list",
959
+ description: "List custom domains and status"
960
+ },
961
+ {
962
+ command: "status <hostname>",
963
+ description: "Check domain verification status"
964
+ }
965
+ ],
966
+ children: {
967
+ add: withProjectOption("Add a custom domain.", "void domain add <hostname> [options]"),
968
+ delete: withProjectOption("Remove a custom domain.", "void domain delete <hostname> [options]"),
969
+ list: withProjectOption("List custom domains and status.", "void domain list [options]"),
970
+ status: withProjectOption("Check domain verification status.", "void domain status <hostname> [options]")
971
+ }
972
+ },
973
+ db: {
974
+ summary: "Manage local and remote database state.",
975
+ usage: ["void db <command>"],
976
+ commands: [
977
+ {
978
+ command: "push",
979
+ description: "Push schema to local D1 without migration files"
980
+ },
981
+ {
982
+ command: "generate",
983
+ description: "Generate SQL migrations from schema changes"
984
+ },
985
+ {
986
+ command: "status",
987
+ description: "Show migration status (local and remote)"
988
+ },
989
+ {
990
+ command: "reset",
991
+ description: "Reset local DB and re-run migrations"
992
+ },
993
+ {
994
+ command: "seed",
995
+ description: "Reset local DB, run migrations, and seed"
996
+ },
997
+ {
998
+ command: "execute <sql>",
999
+ description: "Run SQL against the local database"
1000
+ },
1001
+ {
1002
+ command: "migrate",
1003
+ description: "Apply pending migrations"
1004
+ },
1005
+ {
1006
+ command: "studio",
1007
+ description: "Open Drizzle Studio for the local database"
1008
+ },
1009
+ {
1010
+ command: "export",
1011
+ description: "Export local database as SQL"
1012
+ },
1013
+ {
1014
+ command: "set-url",
1015
+ description: "Update the PostgreSQL connection string"
1016
+ },
1017
+ {
1018
+ command: "rename-migrations",
1019
+ description: "Rename migrations to timestamp format"
1020
+ }
1021
+ ],
1022
+ children: {
1023
+ push: basicSubcommand("Push schema to local D1 without migration files.", "void db push"),
1024
+ generate: basicSubcommand("Generate SQL migrations from schema changes.", "void db generate"),
1025
+ status: basicSubcommand("Show migration status for local and remote DBs.", "void db status"),
1026
+ reset: basicSubcommand("Reset local DB and re-run migrations.", "void db reset"),
1027
+ seed: {
1028
+ summary: "Reset local DB, run migrations, and seed data.",
1029
+ usage: ["void db seed [options]"],
1030
+ options: [{
1031
+ command: "--file <path>",
1032
+ description: "Seed from a specific file"
1033
+ }]
1034
+ },
1035
+ execute: {
1036
+ summary: "Run SQL against the local database.",
1037
+ usage: ["void db execute <sql>", "void db execute --file <path>"],
1038
+ options: [{
1039
+ command: "--file <path>",
1040
+ description: "Run SQL from a file instead"
1041
+ }],
1042
+ examples: [{
1043
+ command: "void db execute \"select * from users\"",
1044
+ description: "Run inline SQL"
1045
+ }, {
1046
+ command: "void db execute --file query.sql",
1047
+ description: "Run SQL from a file"
1048
+ }]
1049
+ },
1050
+ migrate: {
1051
+ summary: "Apply pending migrations.",
1052
+ usage: ["void db migrate [options]"],
1053
+ options: [{
1054
+ command: "--remote",
1055
+ description: "Apply to the remote database"
1056
+ }]
1057
+ },
1058
+ studio: basicSubcommand("Open Drizzle Studio for the local database.", "void db studio"),
1059
+ export: {
1060
+ summary: "Export local database contents as SQL.",
1061
+ usage: ["void db export [options]"],
1062
+ options: [
1063
+ {
1064
+ command: "--output <path>",
1065
+ description: "Export to a specific file path"
1066
+ },
1067
+ {
1068
+ command: "--no-data",
1069
+ description: "Schema only (no INSERT statements)"
1070
+ },
1071
+ {
1072
+ command: "--no-schema",
1073
+ description: "Data only (no CREATE TABLE)"
1074
+ },
1075
+ {
1076
+ command: "--table <name>",
1077
+ description: "Export a single table"
1078
+ }
1079
+ ]
1080
+ },
1081
+ "set-url": basicSubcommand("Update the PostgreSQL connection string for deployment.", "void db set-url"),
1082
+ "rename-migrations": basicSubcommand("Rename migrations to timestamp-based format.", "void db rename-migrations")
1083
+ }
1084
+ },
1085
+ env: {
1086
+ summary: "Validate env.ts and generate environment artifacts.",
1087
+ usage: ["void env <command>"],
1088
+ commands: [
1089
+ {
1090
+ command: "check",
1091
+ description: "Validate env.ts against .env files"
1092
+ },
1093
+ {
1094
+ command: "types",
1095
+ description: "Regenerate .void/env.d.ts from env.ts"
1096
+ },
1097
+ {
1098
+ command: "example",
1099
+ description: "Generate .env.example from env.ts schema"
1100
+ }
1101
+ ],
1102
+ children: {
1103
+ check: {
1104
+ summary: "Validate env.ts against .env files and optionally remote secrets.",
1105
+ usage: ["void env check [options]"],
1106
+ options: [{
1107
+ command: "--remote",
1108
+ description: "Also check required keys as remote secrets"
1109
+ }]
1110
+ },
1111
+ types: basicSubcommand("Regenerate .void/env.d.ts from env.ts.", "void env types"),
1112
+ example: {
1113
+ summary: "Refresh the Void-managed block in .env.example.",
1114
+ usage: ["void env example [options]"],
1115
+ options: [{
1116
+ command: "--force",
1117
+ description: "Suppress the appended block notice"
1118
+ }]
1119
+ }
1120
+ }
1121
+ },
1122
+ gen: {
1123
+ summary: "Scaffold routes, models, background jobs, and framework entries.",
1124
+ usage: ["void gen <command>"],
1125
+ commands: [
1126
+ {
1127
+ command: "model <name> [cols...]",
1128
+ description: "Generate migration, CRUD routes, and DB types"
1129
+ },
1130
+ {
1131
+ command: "migration <name>",
1132
+ description: "Generate an empty migration file"
1133
+ },
1134
+ {
1135
+ command: "route <path>",
1136
+ description: "Generate a route with handler exports"
1137
+ },
1138
+ {
1139
+ command: "middleware <name>",
1140
+ description: "Generate a numbered middleware file"
1141
+ },
1142
+ {
1143
+ command: "ssr",
1144
+ description: "Generate SSR entry, client, and App component"
1145
+ },
1146
+ {
1147
+ command: "cron <name>",
1148
+ description: "Generate a cron job file"
1149
+ },
1150
+ {
1151
+ command: "queue <name>",
1152
+ description: "Generate a queue consumer file"
1153
+ }
1154
+ ],
1155
+ children: {
1156
+ model: {
1157
+ summary: "Generate a migration, CRUD routes, and database types.",
1158
+ usage: ["void gen model <name> [columns...]"],
1159
+ examples: [{
1160
+ command: "void gen model post title:string body:text",
1161
+ description: "Create a model"
1162
+ }]
1163
+ },
1164
+ migration: basicSubcommand("Generate an empty migration file.", "void gen migration <name>"),
1165
+ route: {
1166
+ summary: "Generate a route with handler exports.",
1167
+ usage: ["void gen route <path> [options]"],
1168
+ options: [{
1169
+ command: "--methods <list>",
1170
+ description: "Comma-separated methods (default: get)"
1171
+ }],
1172
+ examples: [{
1173
+ command: "void gen route api/posts --methods get,post",
1174
+ description: "Create a route"
1175
+ }]
1176
+ },
1177
+ middleware: basicSubcommand("Generate a numbered middleware file.", "void gen middleware <name>"),
1178
+ ssr: {
1179
+ summary: "Generate SSR entry, client, and App component.",
1180
+ usage: ["void gen ssr [options]"],
1181
+ options: [
1182
+ {
1183
+ command: "--react",
1184
+ description: "Use React"
1185
+ },
1186
+ {
1187
+ command: "--vue",
1188
+ description: "Use Vue"
1189
+ },
1190
+ {
1191
+ command: "--svelte",
1192
+ description: "Use Svelte"
1193
+ },
1194
+ {
1195
+ command: "--solid",
1196
+ description: "Use Solid"
1197
+ }
1198
+ ]
1199
+ },
1200
+ cron: basicSubcommand("Generate a cron job file.", "void gen cron <name>"),
1201
+ queue: basicSubcommand("Generate a queue consumer file.", "void gen queue <name>")
1202
+ }
1203
+ },
1204
+ prepare: {
1205
+ summary: "Generate .void artifacts without starting Vite.",
1206
+ usage: ["void prepare"],
1207
+ examples: [{
1208
+ command: "void prepare",
1209
+ description: "Refresh generated project types"
1210
+ }]
1211
+ },
1212
+ mcp: {
1213
+ summary: "Start the Void MCP server over stdio for AI agents.",
1214
+ usage: ["void mcp"]
1215
+ }
1216
+ };
1217
+ function basicSubcommand(summary, usage, example) {
1218
+ return {
1219
+ summary,
1220
+ usage: [usage],
1221
+ examples: example ? [{
1222
+ command: example,
1223
+ description: summary
1224
+ }] : void 0
1225
+ };
1226
+ }
1227
+ function withProjectOption(summary, usage) {
1228
+ return {
1229
+ summary,
1230
+ usage: [usage],
1231
+ options: [{
1232
+ command: "--project <name>",
1233
+ description: "Project name override"
1234
+ }]
1235
+ };
1236
+ }
1237
+ function printGlobalHelp() {
1238
+ printVoidHeader();
1239
+ Se([
1240
+ globalCommandLine(["init"], "void init"),
1241
+ ...globalOptionLines(["init"]),
1242
+ "",
1243
+ globalCommandLine(["deploy"], "void deploy"),
1244
+ ...globalOptionLines(["deploy"]),
1245
+ "",
1246
+ ...globalCommandGroup("auth"),
1247
+ "",
1248
+ ...globalCommandGroup("project"),
1249
+ "",
1250
+ categoryTitle("secrets"),
1251
+ ...globalCommandLines("secret"),
1252
+ "",
1253
+ ...globalCommandGroup("domain"),
1254
+ "",
1255
+ categoryTitle("database"),
1256
+ ...globalCommandLines("db", {
1257
+ execute: "execute <sql>",
1258
+ export: "export [--output <path>]",
1259
+ seed: "seed [--file <path>]"
1260
+ }),
1261
+ ...globalOptionLines(["db", "execute"]),
1262
+ ...globalOptionLines(["db", "export"]),
1263
+ "",
1264
+ ...globalCommandGroup("env"),
1265
+ ...globalOptionLines(["env", "check"]),
1266
+ ...globalOptionLines(["env", "example"]),
1267
+ "",
1268
+ categoryTitle("codegen"),
1269
+ globalCommandLine(["prepare"], "void prepare"),
1270
+ ...globalCommandLines("gen", { route: "route <path> [--methods]" }),
1271
+ "",
1272
+ categoryTitle("agent"),
1273
+ helpLine("void init --agents", requiredOption(["init"], "--agents").description),
1274
+ globalCommandLine(["mcp"], "void mcp"),
1275
+ "",
1276
+ categoryTitle("help"),
1277
+ helpLine("void help <command>", "Show command-specific help"),
1278
+ helpLine("void <command> --help", "Show command-specific help")
1279
+ ].join("\n"), sectionTitle("Commands"));
1280
+ Se([helpLine("VOID_TOKEN", "Auth token (or use `void auth login`)"), helpLine("VOID_PROJECT", "Deploy target project name override")].join("\n"), sectionTitle("Environment"));
1281
+ ye("https://void.cloud");
1282
+ }
1283
+ function printVoidHeader() {
1284
+ const version = JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
1285
+ const art = asciiArts[Math.floor(Math.random() * asciiArts.length)];
1286
+ console.log(import_picocolors.default.blue(`${art} v${version}\n`));
1287
+ }
1288
+ function getHelpPath(args) {
1289
+ if (args.length === 0) return null;
1290
+ const command = args[0];
1291
+ if (command === "help") return args.slice(1);
1292
+ if (command === "--help" || command === "-h") return [];
1293
+ if (args[1] === "help") return [command, ...args.slice(2)];
1294
+ const helpIndex = args.findIndex((arg) => arg === "--help" || arg === "-h");
1295
+ if (helpIndex === -1) return null;
1296
+ return getKnownHelpPrefix(args.slice(0, helpIndex));
1297
+ }
1298
+ function printHelpPage(path) {
1299
+ const page = findHelpPage(path);
1300
+ if (!page) throw new Error(`Unknown help topic: ${formatHelpPath(path)}`);
1301
+ const lines = [
1302
+ page.summary,
1303
+ "",
1304
+ categoryTitle("Usage"),
1305
+ ...page.usage.map((usage) => ` ${usage}`)
1306
+ ];
1307
+ appendHelpSection(lines, "Commands", page.commands);
1308
+ appendHelpSection(lines, "Options", page.options);
1309
+ appendHelpSection(lines, "Examples", page.examples);
1310
+ if (page.commands) lines.push("", `Run \`void help ${path.join(" ")} <command>\` for command-specific help.`);
1311
+ Se(lines.join("\n"), sectionTitle(`void ${path.join(" ")}`));
1312
+ }
1313
+ function appendHelpSection(lines, title, entries) {
1314
+ if (!entries || entries.length === 0) return;
1315
+ lines.push("", categoryTitle(title));
1316
+ for (const entry of entries) lines.push(helpLine(entry.command, entry.description));
1317
+ }
1318
+ function globalCommandGroup(group) {
1319
+ return [categoryTitle(group), ...globalCommandLines(group)];
1320
+ }
1321
+ function globalCommandLines(group, commandOverrides) {
1322
+ return (requiredPage([group]).commands ?? []).map((command) => helpLine(`void ${group} ${commandOverrides?.[command.command.split(" ")[0]] ?? command.command}`, command.description));
1323
+ }
1324
+ function globalCommandLine(path, command) {
1325
+ return helpLine(command, formatGlobalDescription(requiredPage(path).summary));
1326
+ }
1327
+ function globalOptionLines(path) {
1328
+ return (requiredPage(path).options ?? []).map((option) => helpLine(` ${option.command}`, option.description));
1329
+ }
1330
+ function requiredOption(path, command) {
1331
+ const option = requiredPage(path).options?.find((entry) => entry.command === command);
1332
+ if (!option) throw new Error(`Missing help option: ${formatHelpPath(path)} ${command}`);
1333
+ return option;
1334
+ }
1335
+ function requiredPage(path) {
1336
+ const page = findHelpPage(path);
1337
+ if (!page) throw new Error(`Missing help page: ${formatHelpPath(path)}`);
1338
+ return page;
1339
+ }
1340
+ function formatGlobalDescription(summary) {
1341
+ return summary.replace(/\.$/, "");
1342
+ }
1343
+ function findHelpPage(path) {
1344
+ let tree = HELP_TREE;
1345
+ let page = null;
1346
+ for (const part of path) {
1347
+ const node = tree?.[part];
1348
+ if (!node) return null;
1349
+ page = node;
1350
+ tree = node.children;
1351
+ }
1352
+ return page;
1353
+ }
1354
+ function getKnownHelpPrefix(args) {
1355
+ let tree = HELP_TREE;
1356
+ const path = [];
1357
+ for (const arg of args) {
1358
+ if (arg.startsWith("-")) break;
1359
+ const node = tree?.[arg];
1360
+ if (!node) {
1361
+ if (path.length === 0) return [arg];
1362
+ if (tree) return [...path, arg];
1363
+ break;
1364
+ }
1365
+ path.push(arg);
1366
+ tree = node.children;
1367
+ }
1368
+ return path;
1369
+ }
1370
+ function formatHelpPath(path) {
1371
+ return path.length === 0 ? "help" : path.join(" ");
1372
+ }
1373
+ //#endregion
1374
+ //#region src/cli/prepare-args.ts
1375
+ function parsePrepareArgs(args) {
1376
+ const parsed = parseArgs({
1377
+ args,
1378
+ options: {},
1379
+ allowPositionals: true,
1380
+ strict: true
1381
+ });
1382
+ if (parsed.positionals.length > 0) throw new Error(`prepare: Unexpected argument '${parsed.positionals[0]}'.`);
1383
+ return {};
1384
+ }
1385
+ //#endregion
1386
+ //#region src/cli/project-args.ts
1387
+ const LOG_LEVELS = new Set([
1388
+ "error",
1389
+ "warn",
1390
+ "info",
1391
+ "log",
1392
+ "debug",
1393
+ "all"
1394
+ ]);
1395
+ const projectSubcommands = [
1396
+ {
1397
+ name: "status",
1398
+ arg: "[name]",
1399
+ description: "Show deployments (omit name for linked project)"
1400
+ },
1401
+ {
1402
+ name: "link",
1403
+ arg: "[name]",
1404
+ description: "Link directory to a project"
1405
+ },
1406
+ {
1407
+ name: "list",
1408
+ description: "List your projects"
1409
+ },
1410
+ {
1411
+ name: "logs",
1412
+ description: "Show runtime logs from the deployed project"
1413
+ },
1414
+ {
1415
+ name: "rollback",
1416
+ arg: "[deployId]",
1417
+ description: "Roll back to a previous deployment"
1418
+ },
1419
+ {
1420
+ name: "cancel",
1421
+ arg: "[deployId]",
1422
+ description: "Cancel an active deployment"
1423
+ },
1424
+ {
1425
+ name: "delete",
1426
+ arg: "[name]",
1427
+ description: "Delete a project (omit name to delete linked project)"
1428
+ },
1429
+ {
1430
+ name: "purge-cache",
1431
+ description: "Purge all cached pages"
1432
+ }
1433
+ ];
1434
+ function parseProjectArgs(args) {
1435
+ const [subcommand, ...rest] = args;
1436
+ if (subcommand === "status") {
1437
+ const [name, extra] = rest;
1438
+ if (extra) throw new Error(`project: Unexpected argument '${extra}'.`);
1439
+ return {
1440
+ subcommand,
1441
+ name: name ?? ""
1442
+ };
1443
+ }
1444
+ if (subcommand === "link") {
1445
+ const [name, extra] = rest;
1446
+ if (extra) throw new Error(`project: Unexpected argument '${extra}'.`);
1447
+ return {
1448
+ subcommand,
1449
+ name: name ?? ""
1450
+ };
1451
+ }
1452
+ if (subcommand === "list") {
1453
+ if (rest.length > 0) throw new Error(`project: Unexpected argument '${rest[0]}'.`);
1454
+ return { subcommand };
1455
+ }
1456
+ if (subcommand === "logs") {
1457
+ let filter = "";
1458
+ let range = "1h";
1459
+ let deployment = "";
1460
+ let level = "";
1461
+ for (let i = 0; i < rest.length; i++) if (rest[i] === "--filter" && rest[i + 1]) filter = rest[++i];
1462
+ else if (rest[i] === "--range" && rest[i + 1]) range = rest[++i];
1463
+ else if (rest[i] === "--deployment" && rest[i + 1]) deployment = rest[++i];
1464
+ else if (rest[i] === "--level" && rest[i + 1]) {
1465
+ const value = rest[++i];
1466
+ if (!LOG_LEVELS.has(value)) throw new Error(`project: Invalid --level '${value}'. Use one of error|warn|info|log|debug|all.`);
1467
+ level = value;
1468
+ } else throw new Error(`project: Unexpected argument '${rest[i]}'.`);
1469
+ return {
1470
+ subcommand,
1471
+ filter,
1472
+ range,
1473
+ deployment,
1474
+ level
1475
+ };
1476
+ }
1477
+ if (subcommand === "rollback") {
1478
+ const [deployId, extra] = rest;
1479
+ if (extra) throw new Error(`project: Unexpected argument '${extra}'.`);
1480
+ return {
1481
+ subcommand,
1482
+ deployId: deployId ?? ""
1483
+ };
1484
+ }
1485
+ if (subcommand === "cancel") {
1486
+ const [deployId, extra] = rest;
1487
+ if (extra) throw new Error(`project: Unexpected argument '${extra}'.`);
1488
+ return {
1489
+ subcommand,
1490
+ deployId: deployId ?? ""
1491
+ };
1492
+ }
1493
+ if (subcommand === "delete") {
1494
+ let name = "";
1495
+ let force = false;
1496
+ for (const arg of rest) if (arg === "--force" || arg === "-f") force = true;
1497
+ else if (arg.startsWith("-")) throw new Error(`project: Unknown flag '${arg}'.`);
1498
+ else if (name) throw new Error(`project: Unexpected argument '${arg}'.`);
1499
+ else name = arg;
1500
+ return {
1501
+ subcommand,
1502
+ name,
1503
+ force
1504
+ };
1505
+ }
1506
+ if (subcommand === "purge-cache") {
1507
+ let projectSlug = "";
1508
+ for (let i = 0; i < rest.length; i++) if (rest[i] === "--project" && rest[i + 1]) projectSlug = rest[++i];
1509
+ else throw new Error(`project: Unexpected argument '${rest[i]}'.`);
1510
+ return {
1511
+ subcommand,
1512
+ projectSlug
1513
+ };
1514
+ }
1515
+ throw new Error("project: Usage: void project <status|link|list|logs|rollback|cancel|delete|purge-cache>.");
1516
+ }
1517
+ //#endregion
1518
+ //#region src/cli/secret-args.ts
1519
+ const secretSubcommands = [
1520
+ {
1521
+ name: "list",
1522
+ description: "List project secrets"
1523
+ },
1524
+ {
1525
+ name: "put",
1526
+ arg: "<name>",
1527
+ description: "Set a project secret"
1528
+ },
1529
+ {
1530
+ name: "delete",
1531
+ arg: "<name>",
1532
+ description: "Delete a project secret"
1533
+ },
1534
+ {
1535
+ name: "sync",
1536
+ arg: "<file>",
1537
+ description: "Sync secrets from a dotenv file"
1538
+ }
1539
+ ];
1540
+ function parseSecretArgs(args) {
1541
+ const parsed = parseArgs({
1542
+ args,
1543
+ options: { project: { type: "string" } },
1544
+ allowPositionals: true,
1545
+ strict: true,
1546
+ tokens: true
1547
+ });
1548
+ if ((parsed.tokens ?? []).filter((t) => t.kind === "option" && t.name === "project").length > 1) throw new Error("secret: --project can only be specified once.");
1549
+ const projectValue = parsed.values.project;
1550
+ const projectName = typeof projectValue === "string" ? projectValue : void 0;
1551
+ if (projectName?.startsWith("-")) throw new Error("secret: --project requires a name.");
1552
+ const [action, name, value, extra] = parsed.positionals;
1553
+ if (extra) throw new Error(`secret: Unexpected argument '${extra}'.`);
1554
+ if (action === "list") {
1555
+ if (name) throw new Error("secret: Usage: void secret list [--project <name>].");
1556
+ return {
1557
+ action,
1558
+ projectName
1559
+ };
1560
+ }
1561
+ if (action === "put") {
1562
+ if (!name) throw new Error("secret: Usage: void secret put <name> [--project <name>].");
1563
+ if (value) throw new Error("secret: Usage: void secret put <name> [--project <name>].");
1564
+ const eqIndex = name.indexOf("=");
1565
+ if (eqIndex === -1) return {
1566
+ action,
1567
+ name,
1568
+ projectName
1569
+ };
1570
+ const key = name.slice(0, eqIndex);
1571
+ const inlineValue = name.slice(eqIndex + 1);
1572
+ if (!key || !inlineValue) throw new Error("secret: Usage: void secret put <name> [--project <name>].");
1573
+ return {
1574
+ action,
1575
+ name: key,
1576
+ value: inlineValue,
1577
+ projectName
1578
+ };
1579
+ }
1580
+ if (action === "delete") {
1581
+ if (!name) throw new Error("secret: Usage: void secret delete <name> [--project <name>].");
1582
+ if (value) throw new Error("secret: Usage: void secret delete <name> [--project <name>].");
1583
+ return {
1584
+ action,
1585
+ name,
1586
+ projectName
1587
+ };
1588
+ }
1589
+ if (action === "sync") {
1590
+ if (!name) throw new Error("secret: Usage: void secret sync <file> [--project <name>].");
1591
+ if (value) throw new Error("secret: Usage: void secret sync <file> [--project <name>].");
1592
+ return {
1593
+ action,
1594
+ file: name,
1595
+ projectName
1596
+ };
1597
+ }
1598
+ throw new Error("secret: Usage: void secret <list|put|delete|sync> ...");
1599
+ }
1600
+ //#endregion
1601
+ //#region src/cli/cli.ts
1602
+ function buildArgs(result, trailingArgs) {
1603
+ const out = [result.subcommand];
1604
+ if (result.arg) out.push(result.arg);
1605
+ if (result.extraArgs) out.push(...result.extraArgs);
1606
+ if (result.flags) for (const [flag, value] of Object.entries(result.flags)) {
1607
+ out.push(flag);
1608
+ if (typeof value === "string") out.push(value);
1609
+ }
1610
+ for (const a of trailingArgs) if (a.startsWith("-")) out.push(a);
1611
+ return out;
1612
+ }
1613
+ async function runSubcommandGroup(command, subcommands, parse, run) {
1614
+ const root = process.cwd();
1615
+ const sub = args[1];
1616
+ try {
1617
+ if ((!sub || sub.startsWith("-")) && process.stdin.isTTY) {
1618
+ const { promptSubcommand } = await import("../subcommand-prompt-BKjuNAPb.mjs");
1619
+ const result = await promptSubcommand(command, subcommands);
1620
+ if (!result) process.exit(0);
1621
+ await run(root, parse(buildArgs(result, args.slice(1))));
1622
+ } else await run(root, parse(args.slice(1)));
1623
+ } catch (err) {
1624
+ R.error(err instanceof Error ? err.message : String(err));
1625
+ process.exit(1);
1626
+ }
1627
+ }
1628
+ const args = process.argv.slice(2);
1629
+ const command = args[0];
1630
+ const helpPath = getHelpPath(args);
1631
+ if (helpPath) if (helpPath.length === 0) printGlobalHelp();
1632
+ else try {
1633
+ printHelpPage(helpPath);
1634
+ } catch (err) {
1635
+ R.error(err instanceof Error ? err.message : String(err));
1636
+ process.exit(1);
1637
+ }
1638
+ else if (command === "deploy") {
1639
+ const root = process.cwd();
1640
+ let deployArgs;
1641
+ try {
1642
+ deployArgs = parseDeployArgs(args.slice(1));
1643
+ } catch (err) {
1644
+ R.error(err instanceof Error ? err.message : String(err));
1645
+ process.exit(1);
1646
+ }
1647
+ import("../deploy-BPKblFx6.mjs").then((n) => n.t).then(({ runDeploy }) => {
1648
+ runDeploy(root, {
1649
+ projectSlug: deployArgs.projectSlug,
1650
+ dir: deployArgs.dir,
1651
+ spa: deployArgs.spa,
1652
+ skipBuild: deployArgs.skipBuild
1653
+ }).catch((err) => {
1654
+ R.error(err.message ?? err);
1655
+ process.exit(1);
1656
+ });
1657
+ });
1658
+ } else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-Dx8oPKZC.mjs").then(({ runAuthCommand }) => runAuthCommand(root, parsed)));
1659
+ else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-B7lQp3F3.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
1660
+ else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-CeRSukgM.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
1661
+ else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-BGofcQ6I.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
1662
+ else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-DsRoMcfN.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
1663
+ else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-CyG3tvU0.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
1664
+ else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-U0Ktr4Zd.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
1665
+ else if (command === "prepare") {
1666
+ const root = process.cwd();
1667
+ let prepareArgs;
1668
+ try {
1669
+ prepareArgs = parsePrepareArgs(args.slice(1));
1670
+ } catch (err) {
1671
+ R.error(err instanceof Error ? err.message : String(err));
1672
+ process.exit(1);
1673
+ }
1674
+ import("../prepare-BAtWufvm.mjs").then(({ runPrepareCommand }) => {
1675
+ runPrepareCommand(root, prepareArgs).catch((err) => {
1676
+ R.error(err.message ?? err);
1677
+ process.exit(1);
1678
+ });
1679
+ });
1680
+ } else if (command === "init") {
1681
+ const root = process.cwd();
1682
+ import("../init-C7wS5iGP.mjs").then(({ runInitCommand, parseInitArgs }) => {
1683
+ let initArgs;
1684
+ try {
1685
+ initArgs = parseInitArgs(args.slice(1));
1686
+ } catch (err) {
1687
+ R.error(err instanceof Error ? err.message : String(err));
1688
+ process.exit(1);
1689
+ }
1690
+ runInitCommand(root, initArgs).catch((err) => {
1691
+ R.error(err.message ?? err);
1692
+ process.exit(1);
1693
+ });
1694
+ });
1695
+ } else if (command === "mcp") import("../mcp-CaQzfeUi.mjs").then(({ runMcp }) => {
1696
+ runMcp();
1697
+ });
1698
+ else if (command === "-v" || command === "--version") {
1699
+ const version = JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
1700
+ console.log(version);
1701
+ } else if (command && command !== "help" && command !== "--help" && command !== "-h") {
1702
+ R.error(`cli: Unknown command '${command}'. Run \`void --help\` for usage.`);
1703
+ process.exit(1);
1704
+ } else if (!command && process.stdin.isTTY) {
1705
+ const topLevelCommands = [
1706
+ {
1707
+ name: "init",
1708
+ description: "Set up void in a new or existing project"
1709
+ },
1710
+ {
1711
+ name: "deploy",
1712
+ description: "Build and deploy to Void"
1713
+ },
1714
+ {
1715
+ name: "auth",
1716
+ hint: "login | logout | whoami | token",
1717
+ description: "Login, logout, and token management"
1718
+ },
1719
+ {
1720
+ name: "project",
1721
+ hint: "status | link | list | logs | rollback | delete | purge-cache",
1722
+ description: "Manage projects and deployments"
1723
+ },
1724
+ {
1725
+ name: "secret",
1726
+ hint: "list | put | delete | sync",
1727
+ description: "Manage project secrets"
1728
+ },
1729
+ {
1730
+ name: "domain",
1731
+ hint: "add | delete | list | status",
1732
+ description: "Configure custom domains"
1733
+ },
1734
+ {
1735
+ name: "db",
1736
+ hint: "status | reset | seed | execute | migrate | studio | export | rename-migrations",
1737
+ description: "Database migrations and management"
1738
+ },
1739
+ {
1740
+ name: "env",
1741
+ hint: "check | types | example",
1742
+ description: "Validate env.ts, generate types, or scaffold .env.example"
1743
+ },
1744
+ {
1745
+ name: "gen",
1746
+ hint: "model | migration | route | middleware | ssr | cron | queue",
1747
+ description: "Scaffold routes, models, and more"
1748
+ },
1749
+ {
1750
+ name: "prepare",
1751
+ description: "Generate .void artifacts without starting Vite"
1752
+ },
1753
+ {
1754
+ name: "mcp",
1755
+ description: "Start MCP server (for AI agents)"
1756
+ },
1757
+ {
1758
+ name: "help",
1759
+ description: "Show help message"
1760
+ }
1761
+ ];
1762
+ (async () => {
1763
+ printVoidHeader();
1764
+ const { promptSubcommand } = await import("../subcommand-prompt-BKjuNAPb.mjs");
1765
+ const result = await promptSubcommand("", topLevelCommands);
1766
+ if (!result) process.exit(0);
1767
+ const cmd = result.subcommand;
1768
+ const root = process.cwd();
1769
+ switch (cmd) {
1770
+ case "init": {
1771
+ const { runInitCommand, parseInitArgs } = await import("../init-C7wS5iGP.mjs");
1772
+ await runInitCommand(root, parseInitArgs([]));
1773
+ return;
1774
+ }
1775
+ case "deploy": {
1776
+ const { runDeploy } = await import("../deploy-BPKblFx6.mjs").then((n) => n.t);
1777
+ await runDeploy(root);
1778
+ return;
1779
+ }
1780
+ case "mcp": {
1781
+ const { runMcp } = await import("../mcp-CaQzfeUi.mjs");
1782
+ runMcp();
1783
+ return;
1784
+ }
1785
+ case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-Dx8oPKZC.mjs").then(({ runAuthCommand }) => runAuthCommand(r, p)));
1786
+ case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-B7lQp3F3.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
1787
+ case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-CeRSukgM.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
1788
+ case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-BGofcQ6I.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
1789
+ case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-DsRoMcfN.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
1790
+ case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-CyG3tvU0.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
1791
+ case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-U0Ktr4Zd.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
1792
+ case "prepare": {
1793
+ const { runPrepareCommand } = await import("../prepare-BAtWufvm.mjs");
1794
+ await runPrepareCommand(root, parsePrepareArgs([]));
1795
+ return;
1796
+ }
1797
+ case "help":
1798
+ printGlobalHelp();
1799
+ return;
1800
+ }
1801
+ })().catch((err) => {
1802
+ R.error(err instanceof Error ? err.message : String(err));
1803
+ process.exit(1);
1804
+ });
1805
+ } else printGlobalHelp();
1806
+ //#endregion
1807
+ export { getAgentById as n, getPackageDir as r, detectAgents as t };