void 0.10.7 → 0.10.10

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 (47) hide show
  1. package/dist/{auth-cmd-DlgNwByu.mjs → auth-cmd-Cw1edJdZ.mjs} +2 -2
  2. package/dist/{build-cmd-Br8qL0rA.mjs → build-cmd-C6kNDJBv.mjs} +1 -1
  3. package/dist/{cache-wH-mP8UE.mjs → cache-DIUSnIjJ.mjs} +1 -1
  4. package/dist/{cancel-deploy-BEBOEgtu.mjs → cancel-deploy-BosnzEHC.mjs} +1 -1
  5. package/dist/cli/cli.mjs +77 -28
  6. package/dist/{client-Cj96iiBH.mjs → client-C9FG6Vzc.mjs} +8 -0
  7. package/dist/{config-1twldYCW.mjs → config-BcAeIPe3.mjs} +6 -0
  8. package/dist/{create-project-DD9n8Ho-.mjs → create-project-CjYX23M_.mjs} +1 -1
  9. package/dist/{db-DjKE2-A-.mjs → db-BvKV34IK.mjs} +4 -4
  10. package/dist/{delete-D2kr3Kmk.mjs → delete-CThKLXfi.mjs} +1 -1
  11. package/dist/{deploy-C4PbkFyE.mjs → deploy-B02JyKP9.mjs} +59 -16
  12. package/dist/{domain-_luIsM_B.mjs → domain-DMrBabBQ.mjs} +1 -1
  13. package/dist/{env-CO5XAS9t.mjs → env-BfG7O71F.mjs} +1 -1
  14. package/dist/env-raw-Cx8ElDdj.mjs +58 -0
  15. package/dist/{gen-Cf79J4aw.mjs → gen-Bee261SV.mjs} +1 -1
  16. package/dist/{github-cmd-DnqxyOsb.mjs → github-cmd-DfeFEasr.mjs} +178 -45
  17. package/dist/{headers-BwvFGhkx.mjs → headers-CTAjX-UO.mjs} +1 -1
  18. package/dist/index.d.mts +13 -1
  19. package/dist/index.mjs +70 -31
  20. package/dist/{init-KirOzVDs.mjs → init-xfwW7cLp.mjs} +4 -4
  21. package/dist/{link-CUmiosyb.mjs → link-Co136MEs.mjs} +2 -2
  22. package/dist/{list-3GEw7b6m.mjs → list-BKDjA3M5.mjs} +1 -1
  23. package/dist/{login-DJReaT_Q.mjs → login-CrOTnR_6.mjs} +1 -1
  24. package/dist/{logs-D-rQ56Lq.mjs → logs-DlAg25ww.mjs} +1 -1
  25. package/dist/{mcp-D7yc0dXY.mjs → mcp-BNjMGMB0.mjs} +1 -1
  26. package/dist/{node-yFFk626c.mjs → node-CnE-SZCk.mjs} +1 -1
  27. package/dist/pages/index.mjs +2 -2
  28. package/dist/{prepare-C_cVurhP.mjs → prepare-BRyC4TCC.mjs} +1 -1
  29. package/dist/{project-cmd-DnU7u9QF.mjs → project-cmd-B2bcKefD.mjs} +8 -8
  30. package/dist/{rollback-Yh7bCKob.mjs → rollback-9dfmB-YZ.mjs} +1 -1
  31. package/dist/runtime/ai.mjs +113 -15
  32. package/dist/runtime/env-public.mjs +9 -4
  33. package/dist/runtime/env.d.mts +14 -1
  34. package/dist/runtime/env.mjs +24 -10
  35. package/dist/runtime/isr-cache.d.mts +207 -0
  36. package/dist/runtime/isr-cache.mjs +523 -0
  37. package/dist/runtime/isr.d.mts +4 -3
  38. package/dist/runtime/isr.mjs +44 -5
  39. package/dist/runtime/live.mjs +1 -1
  40. package/dist/runtime/sandbox.mjs +1 -1
  41. package/dist/{secret-u7FRvg8d.mjs → secret-DeMnMcV0.mjs} +1 -1
  42. package/package.json +3 -2
  43. package/schema.json +11 -0
  44. package/skills/void/docs/integrations/cloudflare.md +107 -0
  45. package/skills/void/docs/node_modules/void/{AGENTS.md → CLAUDE.md} +14 -0
  46. package/skills/void/docs/reference/cli.md +29 -2
  47. package/dist/env-raw-CoS20LHP.mjs +0 -32
@@ -1,6 +1,6 @@
1
1
  import { T as log } from "./agents-Bmr5tFFb.mjs";
2
- import { f as getToken, g as removeToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
3
- import { n as runLoginCommand } from "./login-DJReaT_Q.mjs";
2
+ import { f as getToken, g as removeToken, n as PlatformClient } from "./client-C9FG6Vzc.mjs";
3
+ import { n as runLoginCommand } from "./login-CrOTnR_6.mjs";
4
4
  import { execSync } from "node:child_process";
5
5
  //#region src/cli/auth-cmd.ts
6
6
  async function runAuthCommand(root, args) {
@@ -1,5 +1,5 @@
1
1
  import { D as outro, T as log, a as cliTitle, 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, t as PlatformApiError } from "./client-Cj96iiBH.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient, t as PlatformApiError } from "./client-C9FG6Vzc.mjs";
3
3
  import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D2HI3TrG.mjs";
4
4
  import { appendFileSync, writeFileSync } from "node:fs";
5
5
  //#region src/cli/build-cmd.ts
@@ -1,5 +1,5 @@
1
1
  import { D as outro, T as log, a as cliTitle, o as createSpinner, s as dim, w as intro } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-C9FG6Vzc.mjs";
3
3
  import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D2HI3TrG.mjs";
4
4
  //#region src/cli/cache.ts
5
5
  async function runPurgeCacheCommand(root, projectSlug) {
@@ -1,5 +1,5 @@
1
1
  import { D as outro, S as confirm, T as log, a as cliTitle, j as isCancel, w as intro } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-C9FG6Vzc.mjs";
3
3
  //#region src/cli/cancel-deploy.ts
4
4
  const ACTIVE_STATUSES = /* @__PURE__ */ new Set([
5
5
  "pending",
package/dist/cli/cli.mjs CHANGED
@@ -638,6 +638,11 @@ const githubSubcommands = [
638
638
  arg: "[project]",
639
639
  description: "Show a project's GitHub connection (repo, branch, executor, workflow)"
640
640
  },
641
+ {
642
+ name: "disconnect",
643
+ arg: "[project]",
644
+ description: "Disconnect a project from its GitHub repository"
645
+ },
641
646
  {
642
647
  name: "link",
643
648
  description: "Link your GitHub account to Void"
@@ -780,7 +785,29 @@ function parseGithubArgs(args) {
780
785
  projectName
781
786
  };
782
787
  }
783
- throw new Error("github: Usage: void github <install|installations|connect|update|status|link|join>.");
788
+ if (subcommand === "disconnect") {
789
+ let projectName = "";
790
+ let yes = false;
791
+ for (let i = 0; i < rest.length; i++) {
792
+ const arg = rest[i];
793
+ if (arg === "--yes" || arg === "-y") yes = true;
794
+ else if (arg === "--project") {
795
+ if (i + 1 >= rest.length) throw new Error("github: --project requires a value.");
796
+ const value = rest[++i];
797
+ if (value.trim() === "") throw new Error("github: --project requires a value.");
798
+ if (projectName) throw new Error(`github: Unexpected argument '${value}'.`);
799
+ projectName = value;
800
+ } else if (arg.startsWith("-")) throw new Error(`github: Unexpected argument '${arg}'.`);
801
+ else if (projectName) throw new Error(`github: Unexpected argument '${arg}'.`);
802
+ else projectName = arg;
803
+ }
804
+ return {
805
+ subcommand,
806
+ projectName,
807
+ yes
808
+ };
809
+ }
810
+ throw new Error("github: Usage: void github <install|installations|connect|update|status|disconnect|link|join>.");
784
811
  }
785
812
  //#endregion
786
813
  //#region src/cli/ascii.ts
@@ -1098,6 +1125,10 @@ const HELP_TREE = {
1098
1125
  command: "status [project]",
1099
1126
  description: "Show a project's GitHub connection (repo, branch, executor, workflow)"
1100
1127
  },
1128
+ {
1129
+ command: "disconnect [project]",
1130
+ description: "Disconnect a project from its GitHub repository"
1131
+ },
1101
1132
  {
1102
1133
  command: "link",
1103
1134
  description: "Link your GitHub account to Void"
@@ -1199,6 +1230,24 @@ const HELP_TREE = {
1199
1230
  command: "void github status my-app",
1200
1231
  description: "Show a specific project connection"
1201
1232
  }]
1233
+ },
1234
+ disconnect: {
1235
+ summary: "Disconnect a project from its GitHub repository.",
1236
+ usage: ["void github disconnect [project] [options]"],
1237
+ options: [{
1238
+ command: "--project <name>",
1239
+ description: "Project name (alias for positional)"
1240
+ }, {
1241
+ command: "--yes",
1242
+ description: "Skip the confirmation prompt (required in non-interactive shells)"
1243
+ }],
1244
+ examples: [{
1245
+ command: "void github disconnect",
1246
+ description: "Disconnect the linked project's repository"
1247
+ }, {
1248
+ command: "void github disconnect my-app --yes",
1249
+ description: "Disconnect a specific project without confirmation"
1250
+ }]
1202
1251
  }
1203
1252
  }
1204
1253
  },
@@ -1948,7 +1997,7 @@ else if (command === "deploy") {
1948
1997
  log.error(err instanceof Error ? err.message : String(err));
1949
1998
  process.exit(1);
1950
1999
  }
1951
- import("../deploy-C4PbkFyE.mjs").then((n) => n.t).then(({ runDeploy }) => {
2000
+ import("../deploy-B02JyKP9.mjs").then((n) => n.t).then(({ runDeploy }) => {
1952
2001
  runDeploy(root, {
1953
2002
  projectSlug: deployArgs.projectSlug,
1954
2003
  dir: deployArgs.dir,
@@ -1960,15 +2009,15 @@ else if (command === "deploy") {
1960
2009
  process.exit(1);
1961
2010
  });
1962
2011
  });
1963
- } else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-DlgNwByu.mjs").then(({ runAuthCommand }) => runAuthCommand(root, parsed)));
1964
- else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-DnU7u9QF.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
1965
- else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-u7FRvg8d.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
1966
- else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-_luIsM_B.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
1967
- else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-DjKE2-A-.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
1968
- else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-CO5XAS9t.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
1969
- else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-Cf79J4aw.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
1970
- else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-DnqxyOsb.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
1971
- else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-Br8qL0rA.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)));
2012
+ } else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-Cw1edJdZ.mjs").then(({ runAuthCommand }) => runAuthCommand(root, parsed)));
2013
+ else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-B2bcKefD.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
2014
+ else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-DeMnMcV0.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
2015
+ else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-DMrBabBQ.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
2016
+ else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-BvKV34IK.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
2017
+ else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-BfG7O71F.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
2018
+ else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-Bee261SV.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
2019
+ else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-DfeFEasr.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
2020
+ else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-C6kNDJBv.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)));
1972
2021
  else if (command === "prepare") {
1973
2022
  const root = process.cwd();
1974
2023
  let prepareArgs;
@@ -1978,7 +2027,7 @@ else if (command === "prepare") {
1978
2027
  log.error(err instanceof Error ? err.message : String(err));
1979
2028
  process.exit(1);
1980
2029
  }
1981
- import("../prepare-C_cVurhP.mjs").then(({ runPrepareCommand }) => {
2030
+ import("../prepare-BRyC4TCC.mjs").then(({ runPrepareCommand }) => {
1982
2031
  runPrepareCommand(root, prepareArgs).catch((err) => {
1983
2032
  log.error(err.message ?? err);
1984
2033
  process.exit(1);
@@ -1986,7 +2035,7 @@ else if (command === "prepare") {
1986
2035
  });
1987
2036
  } else if (command === "init") {
1988
2037
  const root = process.cwd();
1989
- import("../init-KirOzVDs.mjs").then(({ runInitCommand, parseInitArgs }) => {
2038
+ import("../init-xfwW7cLp.mjs").then(({ runInitCommand, parseInitArgs }) => {
1990
2039
  let initArgs;
1991
2040
  try {
1992
2041
  initArgs = parseInitArgs(args.slice(1));
@@ -1999,7 +2048,7 @@ else if (command === "prepare") {
1999
2048
  process.exit(1);
2000
2049
  });
2001
2050
  });
2002
- } else if (command === "mcp") import("../mcp-D7yc0dXY.mjs").then(({ runMcp }) => {
2051
+ } else if (command === "mcp") import("../mcp-BNjMGMB0.mjs").then(({ runMcp }) => {
2003
2052
  runMcp();
2004
2053
  });
2005
2054
  else if (command === "-v" || command === "--version") {
@@ -2040,7 +2089,7 @@ else if (command === "-v" || command === "--version") {
2040
2089
  },
2041
2090
  {
2042
2091
  name: "github",
2043
- hint: "install | installations | connect | update | status | link | join",
2092
+ hint: "install | installations | connect | update | status | disconnect | link | join",
2044
2093
  description: "Connect a GitHub repository for automatic deploys"
2045
2094
  },
2046
2095
  {
@@ -2085,31 +2134,31 @@ else if (command === "-v" || command === "--version") {
2085
2134
  const root = process.cwd();
2086
2135
  switch (cmd) {
2087
2136
  case "init": {
2088
- const { runInitCommand, parseInitArgs } = await import("../init-KirOzVDs.mjs");
2137
+ const { runInitCommand, parseInitArgs } = await import("../init-xfwW7cLp.mjs");
2089
2138
  await runInitCommand(root, parseInitArgs([]));
2090
2139
  return;
2091
2140
  }
2092
2141
  case "deploy": {
2093
- const { runDeploy } = await import("../deploy-C4PbkFyE.mjs").then((n) => n.t);
2142
+ const { runDeploy } = await import("../deploy-B02JyKP9.mjs").then((n) => n.t);
2094
2143
  await runDeploy(root);
2095
2144
  return;
2096
2145
  }
2097
2146
  case "mcp": {
2098
- const { runMcp } = await import("../mcp-D7yc0dXY.mjs");
2147
+ const { runMcp } = await import("../mcp-BNjMGMB0.mjs");
2099
2148
  runMcp();
2100
2149
  return;
2101
2150
  }
2102
- case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-DlgNwByu.mjs").then(({ runAuthCommand }) => runAuthCommand(r, p)));
2103
- case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-DnU7u9QF.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
2104
- case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-u7FRvg8d.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
2105
- case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-_luIsM_B.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
2106
- case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-DnqxyOsb.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
2107
- case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-Br8qL0rA.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
2108
- case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-DjKE2-A-.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
2109
- case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-CO5XAS9t.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
2110
- case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-Cf79J4aw.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
2151
+ case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-Cw1edJdZ.mjs").then(({ runAuthCommand }) => runAuthCommand(r, p)));
2152
+ case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-B2bcKefD.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
2153
+ case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-DeMnMcV0.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
2154
+ case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-DMrBabBQ.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
2155
+ case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-DfeFEasr.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
2156
+ case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-C6kNDJBv.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
2157
+ case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-BvKV34IK.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
2158
+ case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-BfG7O71F.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
2159
+ case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-Bee261SV.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
2111
2160
  case "prepare": {
2112
- const { runPrepareCommand } = await import("../prepare-C_cVurhP.mjs");
2161
+ const { runPrepareCommand } = await import("../prepare-BRyC4TCC.mjs");
2113
2162
  await runPrepareCommand(root, parsePrepareArgs([]));
2114
2163
  return;
2115
2164
  }
@@ -975,6 +975,14 @@ var PlatformClient = class {
975
975
  if (!res.ok) await throwPlatformApiError("Failed to update GitHub connection", res);
976
976
  return res.json();
977
977
  }
978
+ async deleteGithubConnection(projectId) {
979
+ const res = await fetch(`${this.baseUrl}/projects/${projectId}/github`, {
980
+ method: "DELETE",
981
+ headers: { ...this.authHeaders }
982
+ });
983
+ if (!res.ok) await throwPlatformApiError("Failed to disconnect GitHub repository", res);
984
+ return res.json();
985
+ }
978
986
  async getGithubLinkUrl(redirect, codeChallenge) {
979
987
  const params = new URLSearchParams({
980
988
  redirect,
@@ -430,6 +430,12 @@ function readConfig(root) {
430
430
  if (obj.database !== void 0) {
431
431
  if (typeof obj.database !== "string" || !VALID_DATABASE_VALUES.has(obj.database)) throw new Error(`config: "database" in ${CONFIG_FILE} must be "pg".`);
432
432
  }
433
+ if (obj.ai !== void 0) {
434
+ if (typeof obj.ai !== "object" || obj.ai === null || Array.isArray(obj.ai)) throw new Error(`config: "ai" in ${CONFIG_FILE} must be an object.`);
435
+ const aiCfg = obj.ai;
436
+ for (const key of Object.keys(aiCfg)) if (key !== "gateway") throw new Error(`config: Unknown key 'ai.${key}' in ${CONFIG_FILE}. Valid: gateway.`);
437
+ if (aiCfg.gateway !== void 0 && (typeof aiCfg.gateway !== "string" || aiCfg.gateway.length === 0)) throw new Error(`config: "ai.gateway" in ${CONFIG_FILE} must be a non-empty string.`);
438
+ }
433
439
  return obj;
434
440
  }
435
441
  /** Returns true if the target is a non-Cloudflare runtime (Node.js, Bun, Deno). */
@@ -1,6 +1,6 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-DJK8HYOj.mjs";
2
2
  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-Bmr5tFFb.mjs";
3
- import { S as writeProjectConfig, d as getSiteDomain, t as PlatformApiError } from "./client-Cj96iiBH.mjs";
3
+ import { S as writeProjectConfig, d as getSiteDomain, t as PlatformApiError } from "./client-C9FG6Vzc.mjs";
4
4
  import { n as inferDefaultSlug } from "./resolve-project-D2HI3TrG.mjs";
5
5
  //#region src/cli/project-slug.ts
6
6
  var project_slug_exports = /* @__PURE__ */ __exportAll({ validateProjectSlug: () => validateProjectSlug });
@@ -2,12 +2,12 @@ import { a as join, c as resolve, r as extname, s as relative } from "./pathe.M-
2
2
  import { D as outro, S as confirm, T as log, a as cliTitle, j as isCancel, s as dim, u as import_picocolors, w as intro } from "./agents-Bmr5tFFb.mjs";
3
3
  import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
4
4
  import { t as cfAccessHeaders } from "./cf-access-Bqw81xAf.mjs";
5
- import { b as readProjectConfig, f as getToken, m as isStagingMode, n as PlatformClient, t as PlatformApiError } from "./client-Cj96iiBH.mjs";
6
- import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-1twldYCW.mjs";
5
+ import { b as readProjectConfig, f as getToken, m as isStagingMode, n as PlatformClient, t as PlatformApiError } from "./client-C9FG6Vzc.mjs";
6
+ import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-BcAeIPe3.mjs";
7
7
  import { r as detectFramework } from "./plugin-inference-CJxi_fWI.mjs";
8
8
  import { c as collectMigrations, d as stripSqlExt, f as writeJournal, n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence, u as readJournal } from "./validate-DT7nFMlf.mjs";
9
9
  import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-D-3_D-Gl.mjs";
10
- import { formatTimestamp } from "./gen-Cf79J4aw.mjs";
10
+ import { formatTimestamp } from "./gen-Bee261SV.mjs";
11
11
  import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
12
12
  import { fileURLToPath, pathToFileURL } from "node:url";
13
13
  import { execFileSync } from "node:child_process";
@@ -947,7 +947,7 @@ async function runExport(root, args, dialect) {
947
947
  }
948
948
  }
949
949
  async function runSetUrl(root) {
950
- const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-1twldYCW.mjs").then((n) => n.n);
950
+ const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-BcAeIPe3.mjs").then((n) => n.n);
951
951
  if (getDialect(readVoidConfig(root)) !== "postgresql") {
952
952
  log.error("db: This command is only for PostgreSQL projects. Set \"database\": \"pg\" in void.json.");
953
953
  process.exit(1);
@@ -1,5 +1,5 @@
1
1
  import { A as text, D as outro, E as note, T as log, a as cliTitle, j as isCancel, o as createSpinner, w as intro, x as cancel } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, f as getToken, n as PlatformClient, x as removeProjectConfig } from "./client-Cj96iiBH.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient, x as removeProjectConfig } from "./client-C9FG6Vzc.mjs";
3
3
  import { r as resolveProjectBySlug } from "./resolve-project-D2HI3TrG.mjs";
4
4
  //#region src/cli/delete.ts
5
5
  async function runDeleteCommand(root, slug, options) {
@@ -4,8 +4,8 @@ import { D as outro, E as note, S as confirm, T as log, a as cliTitle, j as isCa
4
4
  import { i as resolveProjectPaths, n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
5
5
  import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes, s as findVoidAuthConfig } from "./scan-i7Yz54fv.mjs";
6
6
  import { t as cfAccessHeaders } from "./cf-access-Bqw81xAf.mjs";
7
- import { C as ensureCloudflaredToken, S as writeProjectConfig, a as isExpiredTokenError, b as readProjectConfig, f as getToken, i as isCliOutdatedError, m as isStagingMode, n as PlatformClient, o as parsePlatformErrorBody, p as getTokenSource, t as PlatformApiError, u as getApiUrl } from "./client-Cj96iiBH.mjs";
8
- import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-1twldYCW.mjs";
7
+ import { C as ensureCloudflaredToken, S as writeProjectConfig, a as isExpiredTokenError, b as readProjectConfig, f as getToken, i as isCliOutdatedError, m as isStagingMode, n as PlatformClient, o as parsePlatformErrorBody, p as getTokenSource, t as PlatformApiError, u as getApiUrl } from "./client-C9FG6Vzc.mjs";
8
+ import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-BcAeIPe3.mjs";
9
9
  import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-CJxi_fWI.mjs";
10
10
  import { i as voidWarn, r as voidLog } from "./log-ChfPKsVd.mjs";
11
11
  import { n as mergeAndExpand, r as parseDotenvFile } from "./dotenv-D_UbC_vc.mjs";
@@ -16,11 +16,11 @@ import { n as writeDrizzleConfig } from "./config-BdUctCZD.mjs";
16
16
  import { a as buildMigrationPlanBundle, c as collectMigrations, r as validateMigrations, t as assertJournalCoherence } from "./validate-DT7nFMlf.mjs";
17
17
  import { t as scanPages } from "./scan-Dp_Gyzs3.mjs";
18
18
  import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-D-3_D-Gl.mjs";
19
- import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DD9n8Ho-.mjs";
19
+ import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-CjYX23M_.mjs";
20
20
  import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D2HI3TrG.mjs";
21
21
  import { t as collectGitDeployMetadata } from "./git-metadata-CBKaL0v5.mjs";
22
- import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-BwvFGhkx.mjs";
23
- import { t as promptForLoginToken } from "./login-DJReaT_Q.mjs";
22
+ import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-CTAjX-UO.mjs";
23
+ import { t as promptForLoginToken } from "./login-CrOTnR_6.mjs";
24
24
  import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-CVvwCeIy.mjs";
25
25
  import { createRequire } from "node:module";
26
26
  import { copyFileSync, cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
@@ -575,6 +575,58 @@ function stripInternalEnvKeys(input) {
575
575
  };
576
576
  }
577
577
  //#endregion
578
+ //#region src/isr-config.ts
579
+ /**
580
+ * Whether a resolved `revalidate` value represents an active ISR configuration.
581
+ *
582
+ * Mirrors the presence check used when writing the deploy manifest
583
+ * (`packages/void/src/cli/package.ts`): `null`/`undefined`/`0`/`{}` are treated
584
+ * as "no ISR", a positive number or a non-empty path map is treated as "ISR on".
585
+ */
586
+ function hasRevalidate(r) {
587
+ if (r == null) return false;
588
+ if (typeof r === "number") return r > 0;
589
+ if (typeof r === "object") return Object.keys(r).length > 0;
590
+ return false;
591
+ }
592
+ /**
593
+ * Merge the app's `void.json` `routing.revalidate` config with per-page
594
+ * `export const revalidate` rules discovered by the page scan, producing the
595
+ * final revalidate map that gets baked into the deploy manifest (managed
596
+ * `void deploy`) or the self-hosted worker build.
597
+ *
598
+ * This is the single source of truth for the merge so the managed and
599
+ * self-host build paths cannot diverge. Behaviour is preserved verbatim from
600
+ * the original inline logic in `void deploy`:
601
+ *
602
+ * - Config value seeds the result (`number | Record<string, number> | undefined`).
603
+ * - Per-page rules (page pattern → revalidate seconds) are collected from the
604
+ * already-computed page scan (`null` when the app has no pages dir).
605
+ * - When there are per-page rules:
606
+ * - config is a plain number → path map with per-page entries first and the
607
+ * config number applied to `"*"` as a fallback;
608
+ * - config is an object map → per-page entries first (higher precedence in
609
+ * first-match ordering), then the config entries;
610
+ * - config is absent → the per-page rules alone.
611
+ * - Empty results (no config, no per-page rules) return `undefined`.
612
+ */
613
+ function collectRevalidate(config, pageScan) {
614
+ const vcRevalidate = config.routing?.revalidate;
615
+ let revalidate;
616
+ if (vcRevalidate != null) revalidate = vcRevalidate;
617
+ if (pageScan) {
618
+ const perPageRules = {};
619
+ for (const page of pageScan.pages) if (page.revalidate != null) {
620
+ const key = page.pattern.replace(/:[A-Za-z0-9_]+\{[^}]*\}/g, "*");
621
+ perPageRules[key] = page.revalidate;
622
+ }
623
+ if (Object.keys(perPageRules).length > 0) if (typeof revalidate === "number") revalidate = Object.fromEntries([...Object.entries(perPageRules), ["*", revalidate]]);
624
+ else if (typeof revalidate === "object") revalidate = Object.fromEntries([...Object.entries(perPageRules), ...Object.entries(revalidate)]);
625
+ else revalidate = perPageRules;
626
+ }
627
+ return revalidate;
628
+ }
629
+ //#endregion
578
630
  //#region src/prerender.ts
579
631
  const PRERENDER_PATHS_ENDPOINT = "/__void/prerender-paths";
580
632
  const STATIC_PAGE_DATA_DIR = "_void/pages";
@@ -3307,20 +3359,11 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3307
3359
  const hasMiddleware = routeScan.middleware.length > 0;
3308
3360
  const hasWebSockets = webSockets.length > 0;
3309
3361
  const isSsr = isFrameworkMode ? true : Boolean(validateSsrEntry(root, paths)) || hasPages && deployConfig.output !== "static";
3310
- const vcRevalidate = readConfig(root).routing?.revalidate;
3311
- let revalidate;
3312
- if (vcRevalidate != null) revalidate = vcRevalidate;
3313
3362
  const pageScan = existsSync(paths.pagesDir) ? routeScan.pages.pages.length > 0 ? routeScan.pages : await scanPages(root, {
3314
3363
  output: deployConfig.output,
3315
3364
  paths
3316
3365
  }) : null;
3317
- if (pageScan) {
3318
- const perPageRules = {};
3319
- for (const page of pageScan.pages) if (page.revalidate != null) perPageRules[page.pattern] = page.revalidate;
3320
- if (Object.keys(perPageRules).length > 0) if (typeof revalidate === "number") revalidate = Object.fromEntries([...Object.entries(perPageRules), ["*", revalidate]]);
3321
- else if (typeof revalidate === "object") revalidate = Object.fromEntries([...Object.entries(perPageRules), ...Object.entries(revalidate)]);
3322
- else revalidate = perPageRules;
3323
- }
3366
+ const revalidate = collectRevalidate(deployConfig, pageScan);
3324
3367
  if (deployConfig.output === "static" && pageScan && !isSsr) {
3325
3368
  if (pageScan.pages.every((p) => p.shouldPrerender && (p.params.length === 0 && !p.catchAll || p.hasGetPrerenderPaths)) && !(hasRoutes || hasMiddleware || hasWebSockets || authEnabled || liveConfig !== void 0) && schedules.length === 0 && queues.length === 0) {
3326
3369
  log.info("All pages prerendered — deploying as static site");
@@ -3702,4 +3745,4 @@ function resolveWorkerDirName(distDir, fwPreset, buildCommand) {
3702
3745
  throw new Error("deploy: Worker output not found. Expected dist/ssr/ or dist/rsc/.");
3703
3746
  }
3704
3747
  //#endregion
3705
- export { hasApiRoutes as C, resolveSandboxConfig as S, resolveAssetRoutingPolicy as T, readWranglerCompat as _, prerenderPagesNode as a, SANDBOX_MIGRATION_TAG as b, stripInternalEnvKeys as c, ensureWranglerCompatibilityDate as d, ensureWranglerNodejsAlsFlag as f, readExistingLiveBindingConfig as g, normalizeWranglerCompatibilityFlags as h, prerenderPages as i, LIVE_MIGRATION_TAG as l, nextDurableObjectMigrationTag as m, resolveDistDir as n, filterLoadedEnv as o, hasDurableObjectSqliteMigration as p, resolveWorkerDirName as r, resolveRemoteMode as s, deploy_exports as t, ensureWranglerCompat as u, resolveLiveBindingConfig as v, hasDocumentRoutes as w, isSandboxEnabled as x, syncWranglerBindings as y };
3748
+ export { isSandboxEnabled as C, resolveAssetRoutingPolicy as D, hasDocumentRoutes as E, SANDBOX_MIGRATION_TAG as S, hasApiRoutes as T, normalizeWranglerCompatibilityFlags as _, prerenderPagesNode as a, resolveLiveBindingConfig as b, filterLoadedEnv as c, LIVE_MIGRATION_TAG as d, ensureWranglerCompat as f, nextDurableObjectMigrationTag as g, hasDurableObjectSqliteMigration as h, prerenderPages as i, resolveRemoteMode as l, ensureWranglerNodejsAlsFlag as m, resolveDistDir as n, collectRevalidate as o, ensureWranglerCompatibilityDate as p, resolveWorkerDirName as r, hasRevalidate as s, deploy_exports as t, stripInternalEnvKeys as u, readExistingLiveBindingConfig as v, resolveSandboxConfig as w, syncWranglerBindings as x, readWranglerCompat as y };
@@ -1,5 +1,5 @@
1
1
  import { E as note, T as log, u as import_picocolors } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-C9FG6Vzc.mjs";
3
3
  //#region src/cli/domain.ts
4
4
  async function runDomainCommand(root, args) {
5
5
  const token = getToken(root);
@@ -1,6 +1,6 @@
1
1
  import { a as join } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
2
2
  import { D as outro, E as note, T as log, a as cliTitle, w as intro } from "./agents-Bmr5tFFb.mjs";
3
- import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
3
+ import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-C9FG6Vzc.mjs";
4
4
  import { r as generateEnvTypes, t as findEnvFile } from "./env-types-D51bnR-c.mjs";
5
5
  import { a as loadUserEnvFile, i as validateProdEnv, n as formatEnvReport, t as fetchRemoteSecretNames } from "./env-validation-CeC2FL66.mjs";
6
6
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -0,0 +1,58 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ //#region src/runtime/env-raw.ts
3
+ /**
4
+ * Raw runtime env resolution — framework-internal only.
5
+ *
6
+ * This module is NOT exported in package.json, so it cannot be imported
7
+ * via "void/..." subpaths. Only framework modules using relative imports
8
+ * (isr.ts, ai.ts, env.ts) can access it.
9
+ */
10
+ /** Prefixes for platform-internal bindings that must be hidden from user code. */
11
+ const INTERNAL_BINDING_PREFIXES = ["__VOID_", "__PROJECT_"];
12
+ /**
13
+ * Exact binding names that must be hidden from user code even though they carry
14
+ * no internal prefix. `ISR_CACHE` (the self-host ISR KV namespace) is a plain
15
+ * binding name, but it is a framework internal — route handlers read the ISR
16
+ * cache through `handleIsr`/`revalidate()` on the raw env, never via `c.env` or
17
+ * the public `void/env` API. Single source of truth shared by the generated
18
+ * `c.env` filter (`router/compile.ts`) and the runtime `env` filter (`env.ts`).
19
+ *
20
+ * Unlike the prefix internals, these are hidden ONLY when ISR is active for the
21
+ * isolate (see {@link isIsrActive}). In a non-ISR app, `ISR_CACHE` is an
22
+ * ordinary user binding and stays visible everywhere — matching the build-time
23
+ * `isr` gate on the generated `c.env` filter.
24
+ */
25
+ const INTERNAL_BINDING_EXACT_NAMES = ["ISR_CACHE"];
26
+ /**
27
+ * ISR is active for this isolate iff the framework has stamped the compile-time
28
+ * deployment id onto the raw env (`__VOID_ISR_DEPLOYMENT_ID`). The generated
29
+ * worker entry stamps it at the top of `fetch()` (and in cron/queue handlers)
30
+ * only for ISR-emitting builds, so its presence is a reliable runtime signal
31
+ * that `ISR_CACHE` should be treated as a framework internal. The id itself is a
32
+ * `__VOID_`-prefixed binding that is always hidden and framework-controlled, so
33
+ * a user cannot forge it.
34
+ */
35
+ function isIsrActive(rawEnv) {
36
+ return rawEnv.__VOID_ISR_DEPLOYMENT_ID != null;
37
+ }
38
+ const envContext = new AsyncLocalStorage();
39
+ let cloudflareEnv;
40
+ if (typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers") import("cloudflare:workers").then((mod) => {
41
+ cloudflareEnv = asEnv(mod.env) ?? void 0;
42
+ }).catch(() => {});
43
+ function asEnv(value) {
44
+ if (typeof value !== "object" || value === null) return null;
45
+ if ("then" in value && typeof value.then === "function") return null;
46
+ return value;
47
+ }
48
+ function getNuxtEnv() {
49
+ return asEnv(globalThis.__env__);
50
+ }
51
+ /** Resolve raw env from AsyncLocalStorage, Nuxt globals, or CF module env. */
52
+ function getRawRuntimeEnv() {
53
+ return envContext.getStore() ?? getNuxtEnv() ?? cloudflareEnv ?? (() => {
54
+ throw new Error("env: Cloudflare env is unavailable. Use void runtime bindings inside Nuxt/SvelteKit/Analog server request handlers or Worker handlers.");
55
+ })();
56
+ }
57
+ //#endregion
58
+ export { getRawRuntimeEnv as a, envContext as i, INTERNAL_BINDING_PREFIXES as n, isIsrActive as o, asEnv as r, INTERNAL_BINDING_EXACT_NAMES as t };
@@ -2,7 +2,7 @@ import { a as join, n as dirname, s as relative } from "./pathe.M-eThtNZ-CQzLbt4
2
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
3
  import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
4
4
  import { n as ensureProjectTsconfig } from "./project-tsconfig-D9uSVVpA.mjs";
5
- import { c as getDatabaseDialect, f as readConfig } from "./config-1twldYCW.mjs";
5
+ import { c as getDatabaseDialect, f as readConfig } from "./config-BcAeIPe3.mjs";
6
6
  import { n as writeDrizzleConfig } from "./config-BdUctCZD.mjs";
7
7
  import { c as collectMigrations, n as listDrizzleArtifacts, t as assertJournalCoherence, u as readJournal } from "./validate-DT7nFMlf.mjs";
8
8
  import { t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-CW8LB6g_.mjs";