void 0.10.8 → 0.10.11

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 (116) hide show
  1. package/AGENT_PROMPT.md +4 -0
  2. package/README.md +1 -1
  3. package/dist/{agents-Bmr5tFFb.mjs → agents-CtgBYqld.mjs} +1 -1
  4. package/dist/{auth-cmd-DlgNwByu.mjs → auth-cmd-BqsdZJp5.mjs} +3 -3
  5. package/dist/{better-auth-shared-BvnM9px6.d.mts → better-auth-shared-DealXecJ.d.mts} +1 -1
  6. package/dist/{build-cmd-Br8qL0rA.mjs → build-cmd-Bujrv5q-.mjs} +3 -3
  7. package/dist/{cache-wH-mP8UE.mjs → cache-C11V8Fxq.mjs} +3 -3
  8. package/dist/{cancel-deploy-BEBOEgtu.mjs → cancel-deploy-fwFYF04b.mjs} +2 -2
  9. package/dist/cli/cli.mjs +175 -43
  10. package/dist/cli/env-schema-probe.d.mts +96 -0
  11. package/dist/cli/env-schema-probe.mjs +272 -0
  12. package/dist/{client-Cj96iiBH.mjs → client-Gb71-XkG.mjs} +20 -2
  13. package/dist/{config-BdUctCZD.mjs → config-CutEMNGJ.mjs} +3 -3
  14. package/dist/{config-1twldYCW.mjs → config-E03l1C_h.mjs} +8 -2
  15. package/dist/{create-project-DD9n8Ho-.mjs → create-project-DsYvl3TB.mjs} +3 -3
  16. package/dist/{db-DjKE2-A-.mjs → db-PZBsLSGb.mjs} +27 -27
  17. package/dist/{delete-D2kr3Kmk.mjs → delete-mh6p-zkQ.mjs} +3 -3
  18. package/dist/deploy-DT8wsPZd.mjs +6990 -0
  19. package/dist/{discover-BuVVSAum.mjs → discover-CJHyvYfR.mjs} +2 -2
  20. package/dist/dist-DaKKDf8D.mjs +41 -0
  21. package/dist/{domain-_luIsM_B.mjs → domain-DiaNQbrl.mjs} +2 -2
  22. package/dist/entry-D7yy4xVH.mjs +100 -0
  23. package/dist/{env-CO5XAS9t.mjs → env-AAHU02L6.mjs} +5 -5
  24. package/dist/env-mask-Dd47NbR6.mjs +90 -0
  25. package/dist/env-public-BfiLcMBk.d.mts +140 -0
  26. package/dist/env-raw-Cx8ElDdj.mjs +58 -0
  27. package/dist/{env-types-D51bnR-c.mjs → env-types-QBj-ndax.mjs} +2 -2
  28. package/dist/env-validation-BdDlGhbN.mjs +1069 -0
  29. package/dist/{gen-Cf79J4aw.mjs → gen-oup1xBN0.mjs} +8 -8
  30. package/dist/{github-cmd-B6OX9c7d.mjs → github-cmd-BdNaOVNa.mjs} +102 -3
  31. package/dist/{handler-imD0UVDT.d.mts → handler-Cjh8uM3Y.d.mts} +1 -1
  32. package/dist/{headers-BwvFGhkx.mjs → headers-BQknpzkn.mjs} +2 -2
  33. package/dist/index.d.mts +14 -2
  34. package/dist/index.mjs +102 -55
  35. package/dist/{init-KirOzVDs.mjs → init-Dl2PKuQn.mjs} +13 -14
  36. package/dist/{link-CUmiosyb.mjs → link-CdGHSIy-.mjs} +4 -4
  37. package/dist/{list-3GEw7b6m.mjs → list-CPwFDZ_c.mjs} +3 -3
  38. package/dist/{login-DJReaT_Q.mjs → login-BT3H8PN3.mjs} +2 -2
  39. package/dist/{logs-D-rQ56Lq.mjs → logs-Bt313ax7.mjs} +3 -2
  40. package/dist/{mcp-D7yc0dXY.mjs → mcp-DoM3_nhd.mjs} +7 -2
  41. package/dist/{node-yFFk626c.mjs → node-BDx8pmhq.mjs} +5 -5
  42. package/dist/{package-json-B0NuUWGd.mjs → package-json-Cx1osYo6.mjs} +1 -1
  43. package/dist/pages/client.d.mts +1 -1
  44. package/dist/pages/index.d.mts +1 -23
  45. package/dist/pages/index.mjs +5 -5
  46. package/dist/pages/islands-plugin.mjs +2 -2
  47. package/dist/pages/protocol.d.mts +2 -2
  48. package/dist/{plugin-inference-CJxi_fWI.mjs → plugin-inference-DMeavIJ6.mjs} +4 -98
  49. package/dist/{prepare-C_cVurhP.mjs → prepare-DOBTY0o4.mjs} +10 -10
  50. package/dist/preset-BGrvB4Bl.mjs +539 -0
  51. package/dist/{project-cmd-DnU7u9QF.mjs → project-cmd-D_w-4w5B.mjs} +13 -9
  52. package/dist/{project-paths-tpdR1mJR.mjs → project-paths-BQd7OmIo.mjs} +1 -1
  53. package/dist/project-paths-GpziKeQQ.d.mts +25 -0
  54. package/dist/{project-tsconfig-D9uSVVpA.mjs → project-tsconfig-B-QtXjLQ.mjs} +2 -2
  55. package/dist/{protocol-6hTJ04T1.d.mts → protocol-Bnb0LFp3.d.mts} +1 -1
  56. package/dist/provision-BLrCEBbI.mjs +2557 -0
  57. package/dist/requests-B8sZxaFM.mjs +50 -0
  58. package/dist/{resolve-project-D2HI3TrG.mjs → resolve-project-BBMtLLV9.mjs} +1 -1
  59. package/dist/{rollback-Yh7bCKob.mjs → rollback-CkvTFXx5.mjs} +2 -2
  60. package/dist/{route-types-CfKfhbIg.mjs → route-types-COI2DsZv.mjs} +2 -2
  61. package/dist/{runner-h272wcPj.mjs → runner-kapo9aPs.mjs} +3 -3
  62. package/dist/{runner-pg-waxJOnBb.mjs → runner-pg-CHM76xuC.mjs} +1 -1
  63. package/dist/runtime/ai.mjs +113 -15
  64. package/dist/runtime/better-auth-pg.d.mts +1 -1
  65. package/dist/runtime/better-auth.d.mts +1 -1
  66. package/dist/runtime/env-public.d.mts +1 -139
  67. package/dist/runtime/env-public.mjs +10 -93
  68. package/dist/runtime/env.d.mts +14 -1
  69. package/dist/runtime/env.mjs +24 -10
  70. package/dist/runtime/handler.d.mts +1 -1
  71. package/dist/runtime/isr-cache.d.mts +207 -0
  72. package/dist/runtime/isr-cache.mjs +523 -0
  73. package/dist/runtime/isr.d.mts +4 -3
  74. package/dist/runtime/isr.mjs +44 -5
  75. package/dist/runtime/live.d.mts +1 -1
  76. package/dist/runtime/live.mjs +1 -1
  77. package/dist/runtime/sandbox.mjs +1 -1
  78. package/dist/runtime/validator.d.mts +1 -1
  79. package/dist/runtime/ws-server.d.mts +1 -1
  80. package/dist/runtime/ws.d.mts +2 -2
  81. package/dist/{scan-Dp_Gyzs3.mjs → scan-DEwlM_Xy.mjs} +2 -2
  82. package/dist/{scan-i7Yz54fv.mjs → scan-DYXkrasO.mjs} +4 -4
  83. package/dist/{secret-u7FRvg8d.mjs → secret-Dt32J6RI.mjs} +3 -3
  84. package/dist/{skills-DsdNDtX3.mjs → skills-CLjN0uUO.mjs} +2 -2
  85. package/dist/{subcommand-prompt-DtES-oP6.mjs → subcommand-prompt-BzV8iQZo.mjs} +1 -1
  86. package/dist/sveltekit.mjs +1 -1
  87. package/dist/{validate-DT7nFMlf.mjs → validate-Cw_RLeTj.mjs} +1 -1
  88. package/dist/{yarn-pnp-CW8LB6g_.mjs → yarn-pnp-DJn3SAHF.mjs} +1 -1
  89. package/getting-started-prompt.txt +3 -1
  90. package/package.json +6 -3
  91. package/schema.json +11 -0
  92. package/skills/void/SKILL.md +34 -33
  93. package/skills/void/docs/guide/auth.md +8 -0
  94. package/skills/void/docs/guide/deployment.md +1 -1
  95. package/skills/void/docs/guide/env-vars.md +14 -6
  96. package/skills/void/docs/guide/queues.md +4 -0
  97. package/skills/void/docs/integrations/cloudflare.md +171 -5
  98. package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +4 -0
  99. package/skills/void/docs/node_modules/void/{AGENTS.md → CLAUDE.md} +14 -0
  100. package/skills/void/docs/node_modules/void/README.md +1 -1
  101. package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +51 -0
  102. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +64 -0
  103. package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +64 -0
  104. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +108 -0
  105. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +183 -0
  106. package/skills/void/docs/node_modules/void/skills/void/SKILL.md +34 -33
  107. package/skills/void/docs/node_modules/void/test/e2e/README.md +85 -0
  108. package/skills/void/docs/reference/cli.md +97 -14
  109. package/dist/deploy-C4PbkFyE.mjs +0 -3705
  110. package/dist/dotenv-D_UbC_vc.mjs +0 -173
  111. package/dist/env-raw-CoS20LHP.mjs +0 -32
  112. package/dist/env-validation-CeC2FL66.mjs +0 -163
  113. package/dist/pathe.M-eThtNZ-CQzLbt4c.mjs +0 -150
  114. package/dist/preset-CVvwCeIy.mjs +0 -208
  115. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +0 -73
  116. package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +0 -73
@@ -1,11 +1,11 @@
1
- import { a as join, n as dirname, s as relative } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
2
- import { D as outro, T as log, a as cliTitle, j as isCancel, k as select, w as intro, x as cancel } from "./agents-Bmr5tFFb.mjs";
3
- import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
4
- import { n as ensureProjectTsconfig } from "./project-tsconfig-D9uSVVpA.mjs";
5
- import { c as getDatabaseDialect, f as readConfig } from "./config-1twldYCW.mjs";
6
- import { n as writeDrizzleConfig } from "./config-BdUctCZD.mjs";
7
- import { c as collectMigrations, n as listDrizzleArtifacts, t as assertJournalCoherence, u as readJournal } from "./validate-DT7nFMlf.mjs";
8
- import { t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-CW8LB6g_.mjs";
1
+ import { a as join, n as dirname, s as relative } from "./dist-DaKKDf8D.mjs";
2
+ import { D as outro, T as log, a as cliTitle, j as isCancel, k as select, w as intro, x as cancel } from "./agents-CtgBYqld.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
4
+ import { n as ensureProjectTsconfig } from "./project-tsconfig-B-QtXjLQ.mjs";
5
+ import { c as getDatabaseDialect, f as readConfig } from "./config-E03l1C_h.mjs";
6
+ import { n as writeDrizzleConfig } from "./config-CutEMNGJ.mjs";
7
+ import { c as collectMigrations, n as listDrizzleArtifacts, t as assertJournalCoherence, u as readJournal } from "./validate-Cw_RLeTj.mjs";
8
+ import { t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DJn3SAHF.mjs";
9
9
  import { existsSync, mkdirSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import { spawnSync } from "node:child_process";
@@ -1,6 +1,6 @@
1
- import { A as text, T as log, j as isCancel, k as select, u as import_picocolors, x as cancel } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, c as createCodeChallenge, f as getToken, h as openBrowser, l as createCodeVerifier, n as PlatformClient, o as parsePlatformErrorBody, s as awaitBrowserCallback, t as PlatformApiError } from "./client-Cj96iiBH.mjs";
3
- import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D2HI3TrG.mjs";
1
+ import { A as text, S as confirm, T as log, j as isCancel, k as select, u as import_picocolors, x as cancel } from "./agents-CtgBYqld.mjs";
2
+ import { b as readProjectConfig, c as createCodeChallenge, f as getToken, h as openBrowser, l as createCodeVerifier, n as PlatformClient, o as parsePlatformErrorBody, s as awaitBrowserCallback, t as PlatformApiError } from "./client-Gb71-XkG.mjs";
3
+ import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-BBMtLLV9.mjs";
4
4
  import { t as collectGitDeployMetadata } from "./git-metadata-CBKaL0v5.mjs";
5
5
  import { randomBytes } from "node:crypto";
6
6
  //#region src/cli/github-cmd.ts
@@ -103,6 +103,7 @@ async function runGithubCommand(root, args) {
103
103
  case "connect": return runConnect(root, client, args);
104
104
  case "update": return runGithubUpdate(root, client, args);
105
105
  case "status": return runStatus(root, client, args);
106
+ case "disconnect": return runGithubDisconnect(root, client, args);
106
107
  case "link": return runGithubLink(root, client);
107
108
  case "join": return runGithubJoin(root, client);
108
109
  }
@@ -738,5 +739,103 @@ async function runStatus(root, client, args) {
738
739
  }
739
740
  log.message(formatConnection(connection));
740
741
  }
742
+ /**
743
+ * `void github disconnect [project]` — remove a project's GitHub connection so
744
+ * pushes no longer auto-deploy. The server (DELETE /projects/:id/github)
745
+ * terminalizes any in-flight builds (revoking their deploy tokens) before
746
+ * dropping the connection row. Destructive, so a TTY run confirms first; --yes
747
+ * skips the prompt and is REQUIRED in a non-interactive shell. A project with no
748
+ * connection is already in the goal state — report it and exit 0.
749
+ */
750
+ async function runGithubDisconnect(root, client, args) {
751
+ const isTTY = process.stdin.isTTY === true;
752
+ let projectId;
753
+ const requestedSlug = getRequestedProjectSlug({ projectSlug: args.projectName || void 0 });
754
+ if (requestedSlug) {
755
+ const resolved = resolveProjectBySlug(await client.listProjects(), requestedSlug);
756
+ if (!resolved) {
757
+ log.error(`disconnect: No project found with slug '${requestedSlug}'.`);
758
+ process.exit(1);
759
+ }
760
+ projectId = resolved.projectId;
761
+ } else {
762
+ const linked = readProjectConfig(root);
763
+ if (linked) projectId = linked.projectId;
764
+ else if (!isTTY) {
765
+ log.error("disconnect: No project specified. Pass a project name or --project <name>, set VOID_PROJECT, or link one with `void project link`.");
766
+ process.exit(1);
767
+ } else {
768
+ const projects = await client.listProjects();
769
+ if (projects.length === 0) {
770
+ log.error("No projects found. Create one first with `void deploy`.");
771
+ process.exit(1);
772
+ }
773
+ const picked = await select({
774
+ message: "Select a project:",
775
+ options: projects.map((p) => ({
776
+ value: p.id,
777
+ label: p.slug
778
+ }))
779
+ });
780
+ if (isCancel(picked)) {
781
+ cancel("Cancelled.");
782
+ process.exit(0);
783
+ }
784
+ projectId = picked;
785
+ }
786
+ }
787
+ let connection;
788
+ try {
789
+ connection = await client.getGithubConnection(projectId);
790
+ } catch (err) {
791
+ if (err instanceof PlatformApiError) {
792
+ const body = parsePlatformErrorBody(err.body);
793
+ const code = body?.error ?? body?.message ?? "";
794
+ if (err.status === 404 && code.includes("connection not found")) {
795
+ log.info("This project is not connected to a GitHub repository. Nothing to disconnect.");
796
+ return;
797
+ }
798
+ const message = describeConnectError(err.status, code);
799
+ if (message !== null) {
800
+ log.error(`disconnect: ${message}`);
801
+ process.exit(1);
802
+ }
803
+ }
804
+ throw err;
805
+ }
806
+ if (!args.yes) {
807
+ if (!isTTY) {
808
+ log.error("disconnect: Refusing to disconnect without confirmation in a non-interactive shell. Re-run with --yes.");
809
+ process.exit(1);
810
+ }
811
+ const ok = await confirm({
812
+ message: `Disconnect ${connection.repo_full_name} from this project? This cancels any in-flight builds.`,
813
+ initialValue: false
814
+ });
815
+ if (isCancel(ok)) {
816
+ cancel("Cancelled.");
817
+ process.exit(0);
818
+ }
819
+ if (!ok) {
820
+ log.info("Disconnect cancelled.");
821
+ return;
822
+ }
823
+ }
824
+ try {
825
+ await client.deleteGithubConnection(projectId);
826
+ } catch (err) {
827
+ if (err instanceof PlatformApiError) {
828
+ const body = parsePlatformErrorBody(err.body);
829
+ const code = body?.error ?? body?.message ?? "";
830
+ const message = describeConnectError(err.status, code);
831
+ if (message !== null) {
832
+ log.error(`disconnect: ${message}`);
833
+ process.exit(1);
834
+ }
835
+ }
836
+ throw err;
837
+ }
838
+ log.success(`Disconnected ${connection.repo_full_name}.`);
839
+ }
741
840
  //#endregion
742
841
  export { runGithubCommand };
@@ -1,6 +1,6 @@
1
+ import { t as StandardSchemaV1 } from "./standard-schema-DJ0HW7QP.mjs";
1
2
  import { n as HeadDescriptor } from "./head-nmvOgFjd.mjs";
2
3
  import { r as AuthUser, t as AuthSession } from "./auth-qgMlYp7Z.mjs";
3
- import { t as StandardSchemaV1 } from "./standard-schema-DJ0HW7QP.mjs";
4
4
  import { Context, Env, MiddlewareHandler } from "hono";
5
5
  import { RewriteDestination } from "void/routes";
6
6
 
@@ -1,5 +1,5 @@
1
- import { a as join } from "./pathe.M-eThtNZ-CQzLbt4c.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-1twldYCW.mjs";
1
+ import { a as join } from "./dist-DaKKDf8D.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-E03l1C_h.mjs";
3
3
  import { i as voidWarn } from "./log-ChfPKsVd.mjs";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  //#region src/cli/headers.ts
package/dist/index.d.mts CHANGED
@@ -1,12 +1,24 @@
1
1
  import { n as HeadDescriptor } from "./head-nmvOgFjd.mjs";
2
2
  import { r as AuthUser } from "./auth-qgMlYp7Z.mjs";
3
- import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, x as DeferredState, y as defineScheduled } from "./handler-imD0UVDT.mjs";
3
+ import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, x as DeferredState, y as defineScheduled } from "./handler-Cjh8uM3Y.mjs";
4
4
  import { QueueMap } from "./runtime/queues.mjs";
5
5
  import { PluginConfig } from "@cloudflare/vite-plugin";
6
6
  import { Plugin } from "vite";
7
7
 
8
8
  //#region src/index.d.ts
9
9
  /**
10
+ * Decide whether to inject a Workers AI binding into the built wrangler config.
11
+ *
12
+ * Build-only: dev/miniflare has no local Workers AI, so serve must never bind
13
+ * `env.AI` (dev uses the P2 `__VOID_TOKEN` proxy path instead).
14
+ *
15
+ * `!resolvedAi` is load-bearing: mergeBindings' return is defu-merged over the
16
+ * resolved root-wrangler config and wins, so skipping when the user already
17
+ * declared an `ai` binding avoids clobbering theirs. `!resultAi` is harmless
18
+ * defense-in-depth (nothing else in mergeBindings sets `result.ai`).
19
+ */
20
+ declare function shouldBindWorkersAi(command: string, needsAI: boolean, resolvedAi: unknown, resultAi: unknown): boolean;
21
+ /**
10
22
  * Void plugin — the main entry point.
11
23
  *
12
24
  * Composes:
@@ -29,4 +41,4 @@ declare function voidPlugin(options?: {
29
41
  auxiliaryWorkers?: PluginConfig["auxiliaryWorkers"];
30
42
  }): Array<Plugin>;
31
43
  //#endregion
32
- export { type AuthUser, type BasicAuthOptions, 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, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
44
+ export { type AuthUser, type BasicAuthOptions, 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, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, shouldBindWorkersAi, voidPlugin };
package/dist/index.mjs CHANGED
@@ -1,24 +1,25 @@
1
1
  import { r as __toESM } from "./rolldown-runtime-DJK8HYOj.mjs";
2
- import { a as join, n as dirname, s as relative } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
3
- import { M as require_picocolors } from "./agents-Bmr5tFFb.mjs";
4
- import { C as hasApiRoutes, S as resolveSandboxConfig, T as resolveAssetRoutingPolicy, _ as readWranglerCompat, a as prerenderPagesNode, b as SANDBOX_MIGRATION_TAG, c as stripInternalEnvKeys, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as readExistingLiveBindingConfig, h as normalizeWranglerCompatibilityFlags, i as prerenderPages, l as LIVE_MIGRATION_TAG, m as nextDurableObjectMigrationTag, n as resolveDistDir, o as filterLoadedEnv, p as hasDurableObjectSqliteMigration, r as resolveWorkerDirName, s as resolveRemoteMode, u as ensureWranglerCompat, v as resolveLiveBindingConfig, w as hasDocumentRoutes, x as isSandboxEnabled, y as syncWranglerBindings } from "./deploy-C4PbkFyE.mjs";
5
- import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-tpdR1mJR.mjs";
6
- import { a as scanQueuesSync, c as loadVoidAuthConfig, i as scanWebSocketRoutesSync, n as scanRoutePatternsSync, o as scanJobsSync, r as scanRoutes, s as findVoidAuthConfig, t as scanMiddlewareSync } from "./scan-i7Yz54fv.mjs";
7
- import { b as readProjectConfig, f as getToken, m as isStagingMode } from "./client-Cj96iiBH.mjs";
8
- import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-D9uSVVpA.mjs";
9
- import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-1twldYCW.mjs";
10
- import { a as SSR_CLIENT_ENTRY_RELATIVE_PATHS, c as validateSsrEntries, f as isIdentifier, g as walk, i as inferProjectBindings, l as validateSsrEntry, m as isMemberExpression, n as FRAMEWORK_SCAN_DIRS, o as SSR_SERVER_ENTRY_RELATIVE_PATHS, p as isLiteral, r as detectFramework, t as DEFAULT_SCAN_DIRS, u as inferBindingsFromSource } from "./plugin-inference-CJxi_fWI.mjs";
2
+ import { a as join, n as dirname, s as relative } from "./dist-DaKKDf8D.mjs";
3
+ import { M as require_picocolors } from "./agents-CtgBYqld.mjs";
4
+ import { A as resolveAssetRoutingPolicy, C as syncWranglerBindings, D as resolveSandboxConfig, E as isSandboxEnabled, O as hasApiRoutes, S as resolveLiveBindingConfig, T as SANDBOX_MIGRATION_TAG, _ as nextDurableObjectMigrationTag, a as prerenderPagesNode, c as filterLoadedEnv, d as LIVE_MIGRATION_TAG, g as hasDurableObjectSqliteMigration, h as ensureWranglerNodejsAlsFlag, i as prerenderPages, k as hasDocumentRoutes, l as resolveRemoteMode, m as ensureWranglerCompatibilityDate, n as resolveDistDir, o as collectRevalidate, p as ensureWranglerCompat, r as resolveWorkerDirName, s as hasRevalidate, u as stripInternalEnvKeys, v as normalizeWranglerCompatibilityFlags, x as readWranglerCompat, y as readExistingLiveBindingConfig } from "./deploy-DT8wsPZd.mjs";
5
+ import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-BQd7OmIo.mjs";
6
+ import { a as scanQueuesSync, c as loadVoidAuthConfig, i as scanWebSocketRoutesSync, n as scanRoutePatternsSync, o as scanJobsSync, r as scanRoutes, s as findVoidAuthConfig, t as scanMiddlewareSync } from "./scan-DYXkrasO.mjs";
7
+ import { b as readProjectConfig, f as getToken, m as isStagingMode } from "./client-Gb71-XkG.mjs";
8
+ import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-B-QtXjLQ.mjs";
9
+ import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-E03l1C_h.mjs";
10
+ import { a as inferBindingsFromSource, i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, o as walk, r as detectFramework, t as DEFAULT_SCAN_DIRS } from "./plugin-inference-DMeavIJ6.mjs";
11
+ import { a as validateSsrEntries, c as isIdentifier, l as isLiteral, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS, u as isMemberExpression } from "./entry-D7yy4xVH.mjs";
11
12
  import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-ChfPKsVd.mjs";
12
- import { r as parseDotenvFile } from "./dotenv-D_UbC_vc.mjs";
13
- import { i as generateVoidAuthDrizzleSchema, n as generateQueueTypes, o as DRIZZLE_OPERATORS, r as generateVoidAuthDatabaseModule, s as generateDbDts, t as generateRouteTypes } from "./route-types-CfKfhbIg.mjs";
14
- import { t as discoverSchema } from "./discover-BuVVSAum.mjs";
13
+ import { l as parseDotenvFile } from "./preset-BGrvB4Bl.mjs";
14
+ import { i as generateVoidAuthDrizzleSchema, n as generateQueueTypes, o as DRIZZLE_OPERATORS, r as generateVoidAuthDatabaseModule, s as generateDbDts, t as generateRouteTypes } from "./route-types-COI2DsZv.mjs";
15
+ import { t as discoverSchema } from "./discover-CJHyvYfR.mjs";
15
16
  import { t as MagicString } from "./magic-string.es-ZQjdJFFn.mjs";
16
- import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-D51bnR-c.mjs";
17
- import { a as loadUserEnvFile } from "./env-validation-CeC2FL66.mjs";
18
- import { i as resolveLayoutIds } from "./scan-Dp_Gyzs3.mjs";
17
+ import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-QBj-ndax.mjs";
18
+ import { h as loadUserEnvFile } from "./env-validation-BdDlGhbN.mjs";
19
+ import { i as resolveLayoutIds } from "./scan-DEwlM_Xy.mjs";
19
20
  import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-D-3_D-Gl.mjs";
20
- import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-BwvFGhkx.mjs";
21
- import { t as INTERNAL_BINDING_PREFIXES } from "./env-raw-CoS20LHP.mjs";
21
+ import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-BQknpzkn.mjs";
22
+ import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./env-raw-Cx8ElDdj.mjs";
22
23
  import { n as defer } from "./defer-YsYDUoii.mjs";
23
24
  import { VoidAssetRewriteError, basicAuth, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled } from "./runtime/handler.mjs";
24
25
  import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, rmSync, writeFileSync, writeSync } from "node:fs";
@@ -654,7 +655,7 @@ export function createDb(d1) {
654
655
  const migrationsDir = paths.migrationsDir;
655
656
  if (!(existsSync(migrationsDir) && readdirSync(migrationsDir).some((f) => f.endsWith(".sql")))) {
656
657
  if (dialect === "sqlite") {
657
- const { getApplicationTables, getMiniflareDatabasePath } = await import("./runner-h272wcPj.mjs");
658
+ const { getApplicationTables, getMiniflareDatabasePath } = await import("./runner-kapo9aPs.mjs");
658
659
  if ((await getApplicationTables(getMiniflareDatabasePath(options.localD1PersistRoot ?? join(root, ".void"), options.localD1DatabaseId ?? "local")).catch(() => [])).length > 0) return;
659
660
  }
660
661
  voidWarn(`Schema found but no migrations in ${paths.sourceRelative("db/migrations")}/.\n \`void db push\` syncs the schema to your local DB without creating migration files.
@@ -1654,9 +1655,9 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
1654
1655
  else warn();
1655
1656
  return;
1656
1657
  }
1657
- const { runPgMigrations, getPgAppliedMigrations } = await import("./runner-pg-waxJOnBb.mjs");
1658
- const { collectMigrations } = await import("./validate-DT7nFMlf.mjs").then((n) => n.l);
1659
- const { validateMigrations } = await import("./validate-DT7nFMlf.mjs").then((n) => n.i);
1658
+ const { runPgMigrations, getPgAppliedMigrations } = await import("./runner-pg-CHM76xuC.mjs");
1659
+ const { collectMigrations } = await import("./validate-Cw_RLeTj.mjs").then((n) => n.l);
1660
+ const { validateMigrations } = await import("./validate-Cw_RLeTj.mjs").then((n) => n.i);
1660
1661
  const allMigrations = collectMigrations(migrationsDir);
1661
1662
  const pgApplied = await getPgAppliedMigrations(url);
1662
1663
  const pgAppliedSet = new Set(pgApplied);
@@ -1669,9 +1670,9 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
1669
1670
  const applied = await runPgMigrations(migrationsDir, url);
1670
1671
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
1671
1672
  } else if (hasSqlMigrations) {
1672
- const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-h272wcPj.mjs");
1673
- const { collectMigrations } = await import("./validate-DT7nFMlf.mjs").then((n) => n.l);
1674
- const { validateMigrations } = await import("./validate-DT7nFMlf.mjs").then((n) => n.i);
1673
+ const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-kapo9aPs.mjs");
1674
+ const { collectMigrations } = await import("./validate-Cw_RLeTj.mjs").then((n) => n.l);
1675
+ const { validateMigrations } = await import("./validate-Cw_RLeTj.mjs").then((n) => n.i);
1675
1676
  const dbPath = getMiniflareDatabasePath(persistRoot, databaseId);
1676
1677
  const allMigrations = collectMigrations(migrationsDir);
1677
1678
  const appliedRows = await getAppliedMigrations(dbPath);
@@ -1686,7 +1687,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
1686
1687
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
1687
1688
  }
1688
1689
  if (auth?.enabled) {
1689
- const { runLocalVoidAuthMigrations } = await import("./node-yFFk626c.mjs");
1690
+ const { runLocalVoidAuthMigrations } = await import("./node-BDx8pmhq.mjs");
1690
1691
  await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth.configPath);
1691
1692
  voidLog("Applied Better Auth migrations");
1692
1693
  }
@@ -2534,7 +2535,7 @@ function pushDefaultErrorPageHelpers(lines, options) {
2534
2535
  * - Middleware registered via app.use()
2535
2536
  * - Routes registered with lazy-loaded handlers and auto-conversion
2536
2537
  */
2537
- function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, ssr, options, pages = null) {
2538
+ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, ssr, options, pages = null, mergedRevalidate) {
2538
2539
  const lines = [];
2539
2540
  const auth = options.auth;
2540
2541
  const webSockets = scan.websockets ?? [];
@@ -2621,7 +2622,7 @@ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, s
2621
2622
  lines.push("function __voidAnnotateRouting(response, trace) {");
2622
2623
  lines.push(" if (!__VOID_DEV_ROUTING || !response) return response;");
2623
2624
  lines.push(" const headers = new Headers(response.headers);");
2624
- lines.push(" try { headers.set(\"X-Void-Routing\", trace); } catch { return response; }");
2625
+ lines.push(" headers.set(\"X-Void-Routing\", trace);");
2625
2626
  lines.push(" return new Response(response.body, { status: response.status, statusText: response.statusText, headers });");
2626
2627
  lines.push("}");
2627
2628
  lines.push("");
@@ -3134,6 +3135,8 @@ window.__vite_plugin_react_preamble_installed__ = true;
3134
3135
  lines.push("function __getRawEnv() { return __rawEnvStore.getStore(); }");
3135
3136
  lines.push(`export const __VOID_BUILD_KEY = ${JSON.stringify(crypto.randomUUID())};`);
3136
3137
  lines.push(`export const __VOID_DEV_TRIGGER_TOKEN = ${JSON.stringify(options.devTriggerToken ?? crypto.randomUUID())};`);
3138
+ lines.push(`export const __VOID_ISR_REVALIDATE = ${JSON.stringify(mergedRevalidate)};`);
3139
+ lines.push(`export const __VOID_ISR_DEPLOYMENT_ID = ${JSON.stringify(crypto.randomUUID())};`);
3137
3140
  lines.push("");
3138
3141
  lines.push(`export default app;`);
3139
3142
  return lines.join("\n");
@@ -3613,7 +3616,7 @@ ${spaFallbackCode}
3613
3616
  * remote mode (`__VOID_REMOTE`) and replace local bindings with
3614
3617
  * proxy-backed versions.
3615
3618
  */
3616
- function compileWorkerEntry(hasQueues = false, remote, assetsDir = "assets", webSocketClasses = [], runtimeEnvPath = "void/_env", envSchemaModule, sandbox, serveSpaFallback = false, live) {
3619
+ function compileWorkerEntry(hasQueues = false, remote, assetsDir = "assets", webSocketClasses = [], runtimeEnvPath = "void/_env", envSchemaModule, sandbox, serveSpaFallback = false, live, isr) {
3617
3620
  const remotePath = remote?.remotePath;
3618
3621
  const remoteBindingNames = JSON.stringify(remote?.bindingNames);
3619
3622
  const createRemoteEnvCall = `createRemoteEnv(env${remote?.bindingNames ? `, ${remoteBindingNames}` : ""})`;
@@ -3633,7 +3636,8 @@ function compileWorkerEntry(hasQueues = false, remote, assetsDir = "assets", web
3633
3636
  const remoteImport = remote ? `import { createRemoteEnv } from ${JSON.stringify(remote.remotePath)};\n` : "";
3634
3637
  const envSchemaImport = envSchemaModule ? `import ${JSON.stringify(envSchemaModule.importPath)};\nimport { _validateEnvOnce } from ${JSON.stringify(envSchemaModule.helperPath)};\n` : "";
3635
3638
  const envValidateCall = envSchemaModule ? " await _validateEnvOnce(env);\n" : "";
3636
- const prefixCheck = INTERNAL_BINDING_PREFIXES.map((p) => `prop.startsWith(${JSON.stringify(p)})`).join(" || ");
3639
+ const exactNames = isr ? INTERNAL_BINDING_EXACT_NAMES : [];
3640
+ const prefixCheck = [...INTERNAL_BINDING_PREFIXES.map((p) => `prop.startsWith(${JSON.stringify(p)})`), ...exactNames.map((n) => `prop === ${JSON.stringify(n)}`)].join(" || ");
3637
3641
  const filterBindingsHelper = `
3638
3642
  function __filterInternalBindings(env) {
3639
3643
  return new Proxy(env, {
@@ -3647,7 +3651,7 @@ function __filterInternalBindings(env) {
3647
3651
  },
3648
3652
  ownKeys(target) {
3649
3653
  return Reflect.ownKeys(target).filter(
3650
- (key) => typeof key !== "string" || (${INTERNAL_BINDING_PREFIXES.map((p) => `!key.startsWith(${JSON.stringify(p)})`).join(" && ")})
3654
+ (key) => typeof key !== "string" || (${[...INTERNAL_BINDING_PREFIXES.map((p) => `!key.startsWith(${JSON.stringify(p)})`), ...exactNames.map((n) => `key !== ${JSON.stringify(n)}`)].join(" && ")})
3651
3655
  );
3652
3656
  },
3653
3657
  getOwnPropertyDescriptor(target, prop) {
@@ -3658,27 +3662,36 @@ function __filterInternalBindings(env) {
3658
3662
  }
3659
3663
  `;
3660
3664
  const assetHelper = compileAssetFallbackHelper(assetsDir, serveSpaFallback);
3665
+ const isrImport = isr ? `import { handleIsr } from ${JSON.stringify(isr.runtimePath)};\nimport { __VOID_ISR_REVALIDATE, __VOID_ISR_DEPLOYMENT_ID } from 'virtual:void-routes';\n` : "";
3666
+ const isrEnvCapture = isr ? ` env.__VOID_ISR_DEPLOYMENT_ID ??= __VOID_ISR_DEPLOYMENT_ID;\n env.__VOID_ISR_HOST = new URL(request.url).hostname;\n` : "";
3667
+ const isrDeploymentStamp = isr ? ` env.__VOID_ISR_DEPLOYMENT_ID ??= __VOID_ISR_DEPLOYMENT_ID;\n` : "";
3668
+ const renderBlock = isr ? ` const __render = async (req) => serveWithAssets(req, env, await app.fetch(req, userEnv, ctx));
3669
+ if (env.ISR_CACHE) {
3670
+ const __isr = await handleIsr(request, env, ctx, { revalidate: __VOID_ISR_REVALIDATE, deploymentId: __VOID_ISR_DEPLOYMENT_ID }, __render);
3671
+ if (__isr) return __isr;
3672
+ }
3673
+ return __render(request);` : ` return serveWithAssets(request, env, await app.fetch(request, userEnv, ctx));`;
3661
3674
  const fetchHandler = remotePath ? `async (request, env, ctx) => {
3662
3675
  ${envValidateCall} const ws = await __voidHandleWebSocket(request, env);
3663
3676
  if (ws) return ws;
3664
3677
  if (env.__VOID_REMOTE === "1") env = ${createRemoteEnvCall};
3665
- return __withRawEnv(env, () => {
3678
+ ${isrEnvCapture} return __withRawEnv(env, () => {
3666
3679
  const userEnv = __filterInternalBindings(env);
3667
3680
  return withRuntimeEnv(env, async () => {
3668
3681
  const internal = await __handleInternal(request, env, ctx);
3669
3682
  if (internal) return internal;
3670
- return serveWithAssets(request, env, await app.fetch(request, userEnv, ctx));
3683
+ ${renderBlock}
3671
3684
  });
3672
3685
  });
3673
3686
  }` : `async (request, env, ctx) => {
3674
3687
  ${envValidateCall} const ws = await __voidHandleWebSocket(request, env);
3675
3688
  if (ws) return ws;
3676
- return __withRawEnv(env, () => {
3689
+ ${isrEnvCapture} return __withRawEnv(env, () => {
3677
3690
  const userEnv = __filterInternalBindings(env);
3678
3691
  return withRuntimeEnv(env, async () => {
3679
3692
  const internal = await __handleInternal(request, env, ctx);
3680
3693
  if (internal) return internal;
3681
- return serveWithAssets(request, env, await app.fetch(request, userEnv, ctx));
3694
+ ${renderBlock}
3682
3695
  });
3683
3696
  });
3684
3697
  }`;
@@ -3704,18 +3717,18 @@ ${envValidateCall} const ws = await __voidHandleWebSocket(request, env);
3704
3717
  }`;
3705
3718
  const scheduledHandler = remotePath ? `async function handleScheduled(controller, env, ctx) {
3706
3719
  ${envValidateCall} if (env.__VOID_REMOTE === "1") env = ${createRemoteEnvCall};
3707
- const userEnv = __filterInternalBindings(env);
3720
+ ${isrDeploymentStamp} const userEnv = __filterInternalBindings(env);
3708
3721
  return withRuntimeEnv(env, () => scheduled(controller, userEnv, ctx));
3709
3722
  }` : `async function handleScheduled(controller, env, ctx) {
3710
- ${envValidateCall} const userEnv = __filterInternalBindings(env);
3723
+ ${envValidateCall}${isrDeploymentStamp} const userEnv = __filterInternalBindings(env);
3711
3724
  return withRuntimeEnv(env, () => scheduled(controller, userEnv, ctx));
3712
3725
  }`;
3713
3726
  if (hasQueues) return `${sandboxImport}${liveRuntimeImport}import app, { scheduled, __voidCollectPrerenderPaths, __voidHandleInternalRoute, __voidHandleWebSocket, __withRawEnv, __processQueue${webSocketClasses.length > 0 ? `, ${webSocketClasses.join(", ")}` : ""}${liveRouteImport} } from 'virtual:void-routes';
3714
- ${runtimeEnvImport}${envSchemaImport}${remoteImport}${filterBindingsHelper}${assetHelper}
3727
+ ${runtimeEnvImport}${envSchemaImport}${remoteImport}${isrImport}${filterBindingsHelper}${assetHelper}
3715
3728
  ${internalRouteHelper}
3716
3729
  ${scheduledHandler}
3717
3730
  async function queue(batch, env, ctx) {
3718
- ${envValidateCall}${remotePath ? ` if (env.__VOID_REMOTE === "1") env = ${createRemoteEnvCall};\n` : ""} const userEnv = __filterInternalBindings(env);
3731
+ ${envValidateCall}${remotePath ? ` if (env.__VOID_REMOTE === "1") env = ${createRemoteEnvCall};\n` : ""}${isrDeploymentStamp} const userEnv = __filterInternalBindings(env);
3719
3732
  const messages = [...batch.messages].map(m => ({
3720
3733
  id: m.id, timestamp: m.timestamp.toISOString(),
3721
3734
  body: m.body, attempts: m.attempts,
@@ -3740,7 +3753,7 @@ ${liveExport}
3740
3753
  ${sandboxExport}
3741
3754
  export default { fetch: ${fetchHandler}, scheduled: handleScheduled, queue };`;
3742
3755
  return `${sandboxImport}${liveRuntimeImport}import app, { scheduled, __voidCollectPrerenderPaths, __voidHandleInternalRoute, __voidHandleWebSocket, __withRawEnv${webSocketClasses.length > 0 ? `, ${webSocketClasses.join(", ")}` : ""}${liveRouteImport} } from 'virtual:void-routes';
3743
- ${runtimeEnvImport}${envSchemaImport}${remoteImport}${filterBindingsHelper}${assetHelper}
3756
+ ${runtimeEnvImport}${envSchemaImport}${remoteImport}${isrImport}${filterBindingsHelper}${assetHelper}
3744
3757
  ${internalRouteHelper}
3745
3758
  ${scheduledHandler}
3746
3759
  ${webSocketClasses.map((name) => `export { ${name} };`).join("\n")}
@@ -4362,6 +4375,7 @@ function routingPlugin(root, options) {
4362
4375
  compileOptions.auth.authDatabasePath = databasePath;
4363
4376
  }
4364
4377
  let resolvedConfig = null;
4378
+ let isrRevalidate;
4365
4379
  function resolveAuthClientPath(config) {
4366
4380
  if (config.plugins.some((plugin) => plugin.name === "void-react:pages")) return explicitAuthClientPaths.react;
4367
4381
  if (config.plugins.some((plugin) => plugin.name === "void-vue:pages")) return explicitAuthClientPaths.vue;
@@ -4484,8 +4498,8 @@ function routingPlugin(root, options) {
4484
4498
  if (!options.target) {
4485
4499
  const migrationsDir = paths.migrationsDir;
4486
4500
  if (existsSync(migrationsDir) || compileOptions.auth) {
4487
- const { collectMigrations } = await import("./validate-DT7nFMlf.mjs").then((n) => n.l);
4488
- const { buildMigrationPlanBundle } = await import("./validate-DT7nFMlf.mjs").then((n) => n.s);
4501
+ const { collectMigrations } = await import("./validate-Cw_RLeTj.mjs").then((n) => n.l);
4502
+ const { buildMigrationPlanBundle } = await import("./validate-Cw_RLeTj.mjs").then((n) => n.s);
4489
4503
  const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
4490
4504
  const dialect = getDatabaseDialect(readConfig(root));
4491
4505
  compileOptions.migrationHandlerPath = resolveFile(dialect === "postgresql" ? "#self/runtime/migration-handler-pg" : "#self/runtime/migration-handler");
@@ -4497,11 +4511,17 @@ function routingPlugin(root, options) {
4497
4511
  if (options.target) {
4498
4512
  writeFileIfChanged(join(outDir, "app.ts"), compileNodeApp(options.target, compileOptions.honoPath, getEnvSchemaModule()));
4499
4513
  writeFileIfChanged(join(outDir, "index.ts"), compileNodeServer(options.target));
4500
- } else writeFileIfChanged(join(outDir, "entry.ts"), compileWorkerEntry(scan.queues.length > 0, remote, resolvedConfig?.build.assetsDir, (scan.websockets ?? []).map((route) => route.className), compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4501
- bindingName: options.sandboxBindingName,
4502
- className: options.sandboxClassName,
4503
- runtimePath: sandboxRuntimePath
4504
- } : false, shouldServeSpaFallback(), options.live));
4514
+ } else {
4515
+ const merged = collectRevalidate(readConfig(root), scan.pages);
4516
+ const emitIsr = !options.target && resolvedConfig?.command === "build" && !process.env.VOID_DEPLOY_PROJECT_ID && hasRevalidate(merged);
4517
+ isrRevalidate = emitIsr ? merged : void 0;
4518
+ const isr = emitIsr ? { runtimePath: resolveFile("#self/runtime/isr-cache") } : void 0;
4519
+ writeFileIfChanged(join(outDir, "entry.ts"), compileWorkerEntry(scan.queues.length > 0, remote, resolvedConfig?.build.assetsDir, (scan.websockets ?? []).map((route) => route.className), compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4520
+ bindingName: options.sandboxBindingName,
4521
+ className: options.sandboxClassName,
4522
+ runtimePath: sandboxRuntimePath
4523
+ } : false, shouldServeSpaFallback(), options.live, isr));
4524
+ }
4505
4525
  },
4506
4526
  resolveId: {
4507
4527
  filter: { id: RESOLVE_ID_FILTER },
@@ -4525,7 +4545,7 @@ function routingPlugin(root, options) {
4525
4545
  }
4526
4546
  if (id !== VIRTUAL_ROUTES_ID) return;
4527
4547
  if (!scan) await rescan();
4528
- return compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, ssr, compileOptions, getPagesCompileOptions());
4548
+ return compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, ssr, compileOptions, getPagesCompileOptions(), isrRevalidate);
4529
4549
  }
4530
4550
  },
4531
4551
  configureServer(devServer) {
@@ -4799,6 +4819,20 @@ export default {
4799
4819
  function hasBinding(list, name) {
4800
4820
  return Array.isArray(list) && list.some((b) => b.binding === name);
4801
4821
  }
4822
+ /**
4823
+ * Decide whether to inject a Workers AI binding into the built wrangler config.
4824
+ *
4825
+ * Build-only: dev/miniflare has no local Workers AI, so serve must never bind
4826
+ * `env.AI` (dev uses the P2 `__VOID_TOKEN` proxy path instead).
4827
+ *
4828
+ * `!resolvedAi` is load-bearing: mergeBindings' return is defu-merged over the
4829
+ * resolved root-wrangler config and wins, so skipping when the user already
4830
+ * declared an `ai` binding avoids clobbering theirs. `!resultAi` is harmless
4831
+ * defense-in-depth (nothing else in mergeBindings sets `result.ai`).
4832
+ */
4833
+ function shouldBindWorkersAi(command, needsAI, resolvedAi, resultAi) {
4834
+ return needsAI && command === "build" && !resultAi && !resolvedAi;
4835
+ }
4802
4836
  const CLOUDFLARE_BUILTIN_IMPORT = /^cloudflare:/;
4803
4837
  const SANDBOX_SDK_IMPORT = "@cloudflare/sandbox";
4804
4838
  const SANDBOX_SDK_IMPORT_FILTER = /^@cloudflare\/sandbox$/;
@@ -4915,10 +4949,10 @@ const STAGING_API_URL = "https://api.staging.void.cloud";
4915
4949
  * block the server. On completion, writes project.json and restarts the server.
4916
4950
  */
4917
4951
  async function runAiSetupPrompt(root, token, staging, server) {
4918
- const { select, text, isCancel, log } = await import("./agents-Bmr5tFFb.mjs").then((n) => n.C);
4919
- const { PlatformClient } = await import("./client-Cj96iiBH.mjs").then((n) => n.r);
4920
- const { writeProjectConfig } = await import("./client-Cj96iiBH.mjs").then((n) => n.y);
4921
- const { inferDefaultSlug } = await import("./resolve-project-D2HI3TrG.mjs").then((n) => n.i);
4952
+ const { select, text, isCancel, log } = await import("./agents-CtgBYqld.mjs").then((n) => n.C);
4953
+ const { PlatformClient } = await import("./client-Gb71-XkG.mjs").then((n) => n.r);
4954
+ const { writeProjectConfig } = await import("./client-Gb71-XkG.mjs").then((n) => n.y);
4955
+ const { inferDefaultSlug } = await import("./resolve-project-BBMtLLV9.mjs").then((n) => n.i);
4922
4956
  const client = new PlatformClient(token, staging ? STAGING_API_URL : DEFAULT_API_URL);
4923
4957
  let projects;
4924
4958
  try {
@@ -4944,8 +4978,8 @@ async function runAiSetupPrompt(root, token, staging, server) {
4944
4978
  let projectId;
4945
4979
  let slug;
4946
4980
  if (result === "__create__") {
4947
- const { validateProjectSlug } = await import("./create-project-DD9n8Ho-.mjs").then((n) => n.a);
4948
- const { createProjectWithSlugRetry } = await import("./create-project-DD9n8Ho-.mjs").then((n) => n.t);
4981
+ const { validateProjectSlug } = await import("./create-project-DsYvl3TB.mjs").then((n) => n.a);
4982
+ const { createProjectWithSlugRetry } = await import("./create-project-DsYvl3TB.mjs").then((n) => n.t);
4949
4983
  let created;
4950
4984
  try {
4951
4985
  created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
@@ -5200,6 +5234,12 @@ function voidPlugin(options) {
5200
5234
  binding: r2Name,
5201
5235
  bucket_name: "default"
5202
5236
  }];
5237
+ if (shouldBindWorkersAi(viteCommand, bindings.needsAI, resolved.ai, result.ai)) result.ai = { binding: "AI" };
5238
+ if (config.ai?.gateway) {
5239
+ const vars = result.vars ?? {};
5240
+ vars.__VOID_AI_GATEWAY = config.ai.gateway;
5241
+ result.vars = vars;
5242
+ }
5203
5243
  if (queues.length > 0) result.queues = {
5204
5244
  producers: queues.map((q) => ({
5205
5245
  queue: q.name,
@@ -5288,12 +5328,19 @@ function voidPlugin(options) {
5288
5328
  for (const [key, value] of Object.entries(defaults)) if (vars[key] === void 0) vars[key] = value;
5289
5329
  workerConfig.vars = vars;
5290
5330
  }
5331
+ let voidDeployBuildConfig;
5291
5332
  const envPlugin = {
5292
5333
  name: "void:env",
5334
+ api: { getVoidDeployBuildConfig: () => voidDeployBuildConfig },
5293
5335
  config(userConfig, { mode, command }) {
5294
5336
  viteCommand = command;
5295
5337
  const ignored = ["**/.void/**"];
5296
- const { sanitized: env, stripped } = stripInternalEnvKeys(filterLoadedEnv(loadEnv(mode, typeof userConfig.envDir === "string" && userConfig.envDir.length > 0 ? join(root, userConfig.envDir) : root, "")));
5338
+ const rawEnvDir = typeof userConfig.envDir === "string" && userConfig.envDir.length > 0 ? userConfig.envDir : void 0;
5339
+ voidDeployBuildConfig = {
5340
+ mode,
5341
+ envDir: rawEnvDir
5342
+ };
5343
+ const { sanitized: env, stripped } = stripInternalEnvKeys(filterLoadedEnv(loadEnv(mode, rawEnvDir ? join(root, rawEnvDir) : root, "")));
5297
5344
  if (stripped.length > 0) voidWarn(`Ignoring internal env keys from .env files: ${stripped.join(", ")}. These are reserved for Void runtime use.`);
5298
5345
  workerConfig.vars = {
5299
5346
  ...workerConfig.vars,
@@ -5579,4 +5626,4 @@ function voidPlugin(options) {
5579
5626
  ];
5580
5627
  }
5581
5628
  //#endregion
5582
- export { VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
5629
+ export { VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, shouldBindWorkersAi, voidPlugin };
@@ -1,17 +1,16 @@
1
- import { a as join, c as resolve, i as isAbsolute, n as dirname, s as relative, t as basename } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
2
- import { A as text, D as outro, E as note, S as confirm, T as log, a as cliTitle, j as isCancel, k as select, n as getAgentById, r as getPackageDir, t as detectAgents, w as intro, x as cancel } from "./agents-Bmr5tFFb.mjs";
3
- import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
4
- import { S as writeProjectConfig, b as readProjectConfig, f as getToken, m as isStagingMode, n as PlatformClient } from "./client-Cj96iiBH.mjs";
5
- import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-D9uSVVpA.mjs";
6
- import { c as getDatabaseDialect, f as readConfig } from "./config-1twldYCW.mjs";
7
- import { r as detectFramework } from "./plugin-inference-CJxi_fWI.mjs";
8
- import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-D_UbC_vc.mjs";
1
+ import { a as join, c as resolve, i as isAbsolute, n as dirname, s as relative, t as basename } from "./dist-DaKKDf8D.mjs";
2
+ import { A as text, D as outro, E as note, S as confirm, T as log, a as cliTitle, j as isCancel, k as select, n as getAgentById, r as getPackageDir, t as detectAgents, w as intro, x as cancel } from "./agents-CtgBYqld.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
4
+ import { S as writeProjectConfig, b as readProjectConfig, f as getToken, m as isStagingMode, n as PlatformClient } from "./client-Gb71-XkG.mjs";
5
+ import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-B-QtXjLQ.mjs";
6
+ import { c as getDatabaseDialect, f as readConfig } from "./config-E03l1C_h.mjs";
7
+ import { r as detectFramework } from "./plugin-inference-DMeavIJ6.mjs";
8
+ import { l as parseDotenvFile, r as formatProjectCommand, s as expandDotenv } from "./preset-BGrvB4Bl.mjs";
9
9
  import { t as MagicString } from "./magic-string.es-ZQjdJFFn.mjs";
10
- import { n as writeDrizzleConfig } from "./config-BdUctCZD.mjs";
11
- import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DD9n8Ho-.mjs";
12
- import { t as promptForLoginToken } from "./login-DJReaT_Q.mjs";
13
- import { r as formatProjectCommand } from "./preset-CVvwCeIy.mjs";
14
- import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-CW8LB6g_.mjs";
10
+ import { n as writeDrizzleConfig } from "./config-CutEMNGJ.mjs";
11
+ import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DsYvl3TB.mjs";
12
+ import { t as promptForLoginToken } from "./login-BT3H8PN3.mjs";
13
+ import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-DJn3SAHF.mjs";
15
14
  import { createRequire } from "node:module";
16
15
  import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
17
16
  import { fileURLToPath } from "node:url";
@@ -2796,7 +2795,7 @@ async function runInitCommand(root, initArgs) {
2796
2795
  const agentSetup = await resolveAgentSetup(root);
2797
2796
  injectAgentBlock(root, agentSetup.instructionFilePath);
2798
2797
  if (agentSetup.agents.length > 0) {
2799
- const { linkSkillsForSpecificAgents } = await import("./skills-DsdNDtX3.mjs");
2798
+ const { linkSkillsForSpecificAgents } = await import("./skills-CLjN0uUO.mjs");
2800
2799
  linkSkillsForSpecificAgents(root, agentSetup.agents);
2801
2800
  } else log.info("Skills linking skipped for generic agent setup");
2802
2801
  setupMcpConfig(root, agentSetup.agents);
@@ -1,7 +1,7 @@
1
- import { D as outro, T as log, a as cliTitle, u as import_picocolors, w as intro, x as cancel } from "./agents-Bmr5tFFb.mjs";
2
- import { S as writeProjectConfig, b as readProjectConfig, d as getSiteDomain, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
3
- import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DD9n8Ho-.mjs";
4
- import { r as resolveProjectBySlug } from "./resolve-project-D2HI3TrG.mjs";
1
+ import { D as outro, T as log, a as cliTitle, u as import_picocolors, w as intro, x as cancel } from "./agents-CtgBYqld.mjs";
2
+ import { S as writeProjectConfig, b as readProjectConfig, d as getSiteDomain, f as getToken, n as PlatformClient } from "./client-Gb71-XkG.mjs";
3
+ import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DsYvl3TB.mjs";
4
+ import { r as resolveProjectBySlug } from "./resolve-project-BBMtLLV9.mjs";
5
5
  //#region src/cli/link.ts
6
6
  async function runLink(root, slug) {
7
7
  console.log();
@@ -1,6 +1,6 @@
1
- import { D as outro, T as log, a as cliTitle, c as ensureUtc, f as tablePrefix, s as dim, u as import_picocolors, w as intro } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
3
- import { r as resolveProjectBySlug } from "./resolve-project-D2HI3TrG.mjs";
1
+ import { D as outro, T as log, a as cliTitle, c as ensureUtc, f as tablePrefix, s as dim, u as import_picocolors, w as intro } from "./agents-CtgBYqld.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Gb71-XkG.mjs";
3
+ import { r as resolveProjectBySlug } from "./resolve-project-BBMtLLV9.mjs";
4
4
  //#region src/cli/list.ts
5
5
  async function runListCommand(root, slug) {
6
6
  console.log();
@@ -1,5 +1,5 @@
1
- import { D as outro, T as log, a as cliTitle, j as isCancel, k as select, o as createSpinner, u as import_picocolors, w as intro, x as cancel } from "./agents-Bmr5tFFb.mjs";
2
- import { _ as runLogin, a as isExpiredTokenError, f as getToken, g as removeToken, m as isStagingMode, n as PlatformClient, p as getTokenSource, v as saveToken } from "./client-Cj96iiBH.mjs";
1
+ import { D as outro, T as log, a as cliTitle, j as isCancel, k as select, o as createSpinner, u as import_picocolors, w as intro, x as cancel } from "./agents-CtgBYqld.mjs";
2
+ import { _ as runLogin, a as isExpiredTokenError, f as getToken, g as removeToken, m as isStagingMode, n as PlatformClient, p as getTokenSource, v as saveToken } from "./client-Gb71-XkG.mjs";
3
3
  //#region src/cli/login.ts
4
4
  async function promptForLoginToken(root = process.cwd()) {
5
5
  const provider = await select({