void 0.21.6 → 0.21.7

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 (31) hide show
  1. package/dist/{account-cmd-DGt9cpRe.mjs → account-cmd-CQ2wi4Th.mjs} +2 -2
  2. package/dist/{auth-link-Cl9vOuf7.mjs → auth-link-B_lceSHK.mjs} +2 -2
  3. package/dist/{auth-router-D4ZcMUSf.mjs → auth-router-cZq0HuWe.mjs} +4 -4
  4. package/dist/cli/cf-compat.mjs +30 -18
  5. package/dist/cli/cli.mjs +18 -18
  6. package/dist/{cloudflare-auth-B9jPCkV2.mjs → cloudflare-auth-C4_GPZr0.mjs} +5 -1
  7. package/dist/{cloudflare-cmd-BjNxR1XF.mjs → cloudflare-cmd-bSmZ1d5L.mjs} +1 -1
  8. package/dist/{cloudflare-connect-CCUozPOe.mjs → cloudflare-connect-jAwacxxP.mjs} +1 -1
  9. package/dist/{connect-4Ph5Y0QE.mjs → connect-BY38i-9E.mjs} +3 -3
  10. package/dist/{db-CyHAAGkK.mjs → db-BIo37Y7H.mjs} +1 -1
  11. package/dist/{deploy-f1j5MyEP.mjs → deploy-BM_LoBXC.mjs} +1 -1
  12. package/dist/{deploy-CAOwIvwP.mjs → deploy-C0JaQSWS.mjs} +49 -10
  13. package/dist/{email-BXBtqadx.mjs → email-dMnE_Lat.mjs} +1 -1
  14. package/dist/index.mjs +1 -1
  15. package/dist/{init-CRGDXzVC.mjs → init-CJSnEcuj.mjs} +3 -3
  16. package/dist/{login-BQyISZuW.mjs → login-DZldyb8c.mjs} +1 -1
  17. package/dist/login-t6rndSRW.mjs +2 -0
  18. package/dist/{operator-cmd-Co-PeaeD.mjs → operator-cmd-B9dbG3Od.mjs} +2 -2
  19. package/dist/{platform-auth-config-TSw8edHw.mjs → platform-auth-config-Bex45lQt.mjs} +2 -2
  20. package/dist/{platform-auth-protection-Ba1XqGhn.mjs → platform-auth-protection-Dma02l6-.mjs} +2 -2
  21. package/dist/{platform-auth-recovery-BkT3EsF2.mjs → platform-auth-recovery-COOhMCvx.mjs} +2 -2
  22. package/dist/{platform-cmd-CRSKfu8k.mjs → platform-cmd-BtxZrT6w.mjs} +3 -3
  23. package/dist/{platform-cmd-C8OqhqPt.mjs → platform-cmd-CjNB09OF.mjs} +1 -1
  24. package/dist/{platform-domain-j9YCXRm6.mjs → platform-domain-DppaTARe.mjs} +2 -2
  25. package/dist/{platform-lifecycle-78H0XQUA.mjs → platform-lifecycle-BpDlxT3t.mjs} +7 -7
  26. package/dist/{platform-lifecycle-DDc9zCeJ.mjs → platform-lifecycle-CYll-oKE.mjs} +1 -1
  27. package/dist/{platform-management-6w8-DUjC.mjs → platform-management-BKYenDlE.mjs} +1 -1
  28. package/dist/{platform-management-DzKNsMlt.mjs → platform-management-BS5r6Ao8.mjs} +1 -1
  29. package/dist/{platform-recovery-Do8VOyDE.mjs → platform-recovery-dJ5Me-I0.mjs} +2 -2
  30. package/package.json +7 -7
  31. package/dist/login-r2gL8l7B.mjs +0 -2
@@ -1,13 +1,13 @@
1
1
  import { c as getToken, p as removeToken } from "./auth-DLNN0D3Z.mjs";
2
2
  import { j as log } from "./dist-Dn6nn2IU.mjs";
3
3
  import { n as PlatformClient } from "./client-QTl6ko_D.mjs";
4
- import { n as runLoginCommand } from "./login-BQyISZuW.mjs";
4
+ import { n as runLoginCommand } from "./login-DZldyb8c.mjs";
5
5
  import { execSync } from "node:child_process";
6
6
  //#region src/cli/account-cmd.ts
7
7
  async function runAccountCommand(root, args) {
8
8
  switch (args.subcommand) {
9
9
  case "login": return runLoginCommand(root);
10
- case "link": return import("./auth-link-Cl9vOuf7.mjs").then(({ runAuthLink }) => runAuthLink(root, args.connectionId));
10
+ case "link": return import("./auth-link-B_lceSHK.mjs").then(({ runAuthLink }) => runAuthLink(root, args.connectionId));
11
11
  case "logout":
12
12
  if (removeToken(root)) log.success("Logged out.");
13
13
  else log.info("Not logged in.");
@@ -1,8 +1,8 @@
1
1
  import { a as getApiUrl, c as getToken, d as openBrowser, g as savePlatformToken, h as runPlatformLogin } from "./auth-DLNN0D3Z.mjs";
2
2
  import { j as log } from "./dist-Dn6nn2IU.mjs";
3
3
  import { n as PlatformClient } from "./client-QTl6ko_D.mjs";
4
- import { r as selectPlatformLoginMethod } from "./login-BQyISZuW.mjs";
5
- import { t as discoverPlatform } from "./platform-cmd-CRSKfu8k.mjs";
4
+ import { r as selectPlatformLoginMethod } from "./login-DZldyb8c.mjs";
5
+ import { t as discoverPlatform } from "./platform-cmd-BtxZrT6w.mjs";
6
6
  import { execFile } from "node:child_process";
7
7
  //#region src/cli/auth-link.ts
8
8
  async function runAuthLink(root, connectionId) {
@@ -37,7 +37,7 @@ async function chooseDestination(root, args, interactive) {
37
37
  }
38
38
  async function runAuthRouter(root, args, interactive = Boolean(process.stdin.isTTY)) {
39
39
  if (args.subcommand === "link") {
40
- const { runAccountCommand } = await import("./account-cmd-DGt9cpRe.mjs");
40
+ const { runAccountCommand } = await import("./account-cmd-CQ2wi4Th.mjs");
41
41
  await runAccountCommand(root, {
42
42
  subcommand: "link",
43
43
  ...args.connectionId ? { connectionId: args.connectionId } : {}
@@ -45,17 +45,17 @@ async function runAuthRouter(root, args, interactive = Boolean(process.stdin.isT
45
45
  return;
46
46
  }
47
47
  if (args.subcommand === "token") {
48
- const { runAccountCommand } = await import("./account-cmd-DGt9cpRe.mjs");
48
+ const { runAccountCommand } = await import("./account-cmd-CQ2wi4Th.mjs");
49
49
  await runAccountCommand(root, { subcommand: "token" });
50
50
  return;
51
51
  }
52
52
  const destination = await chooseDestination(root, args, interactive);
53
53
  if (destination.platform === "cloudflare") {
54
- const { runCloudflareCommand } = await import("./cloudflare-cmd-BjNxR1XF.mjs");
54
+ const { runCloudflareCommand } = await import("./cloudflare-cmd-bSmZ1d5L.mjs");
55
55
  await runCloudflareCommand(root, { subcommand: args.subcommand === "whoami" || args.subcommand === "status" ? "status" : args.subcommand });
56
56
  return;
57
57
  }
58
- const { runAccountCommand } = await import("./account-cmd-DGt9cpRe.mjs");
58
+ const { runAccountCommand } = await import("./account-cmd-CQ2wi4Th.mjs");
59
59
  const subcommand = args.subcommand === "status" ? "whoami" : args.subcommand;
60
60
  if (!destination.apiUrl) {
61
61
  await runAccountCommand(root, { subcommand });
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as join, n as dirname, u as resolve } from "../dist-BVqXeR_h.mjs";
3
3
  import { t as prepareCfBuildOutput } from "../cf-build-output-CGT03qCD.mjs";
4
- import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
5
- import { fileURLToPath } from "node:url";
4
+ import { copyFileSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
5
+ import { fileURLToPath, pathToFileURL } from "node:url";
6
6
  import { tmpdir } from "node:os";
7
7
  import { spawnSync } from "node:child_process";
8
8
  import { parse } from "jsonc-parser";
@@ -21,7 +21,8 @@ function cfEnvironment() {
21
21
  ...process.env,
22
22
  CF_DELEGATION: "1",
23
23
  CF_SEND_TELEMETRY: "false",
24
- CF_NO_OSC_PROGRESS: "1"
24
+ CF_NO_OSC_PROGRESS: "1",
25
+ CLOUDFLARE_AUTH_USE_KEYRING: "true"
25
26
  };
26
27
  if (env.HTTP_PROXY || env.HTTPS_PROXY || env.http_proxy || env.https_proxy) env.NODE_USE_ENV_PROXY = "1";
27
28
  for (const [canonical, alias] of [
@@ -39,10 +40,9 @@ function result(status, stdout = "", stderr = "") {
39
40
  stderr
40
41
  };
41
42
  }
42
- function runCf(command, cwd = process.cwd(), useLoginProfile = false) {
43
+ function runCf(command, cwd = process.cwd()) {
43
44
  const env = cfEnvironment();
44
45
  env.CF_QUIET = "1";
45
- if (useLoginProfile) delete env.CLOUDFLARE_AUTH_USE_KEYRING;
46
46
  const child = spawnSync(process.execPath, [cf, ...command], {
47
47
  cwd,
48
48
  env,
@@ -169,7 +169,7 @@ async function cloudflareApiGet(path, failure, extraHeaders = {}) {
169
169
  try {
170
170
  const response = await fetch$1(url, {
171
171
  headers: {
172
- ...apiHeaders(),
172
+ ...await apiHeaders(),
173
173
  ...extraHeaders
174
174
  },
175
175
  redirect: "error",
@@ -190,7 +190,7 @@ async function clearWorkerCronSchedules(worker) {
190
190
  const response = await fetch$1(endpoint, {
191
191
  method: "PUT",
192
192
  headers: {
193
- ...apiHeaders(),
193
+ ...await apiHeaders(),
194
194
  "Content-Type": "application/json"
195
195
  },
196
196
  body: "[]",
@@ -245,14 +245,14 @@ async function readVersionResources(worker, versionId) {
245
245
  if (!Array.isArray(resources.bindings) || !resources.script || !resources.script_runtime) throw new Error("Cloudflare Worker version resources were incomplete.");
246
246
  return resources;
247
247
  }
248
- function apiHeaders() {
248
+ async function apiHeaders() {
249
249
  const key = process.env.CLOUDFLARE_API_KEY ?? process.env.CF_API_KEY;
250
250
  const email = process.env.CLOUDFLARE_EMAIL ?? process.env.CF_EMAIL;
251
251
  if (key && email) return {
252
252
  "X-Auth-Key": key,
253
253
  "X-Auth-Email": email
254
254
  };
255
- const credential = sessionCredential();
255
+ const credential = await sessionCredential();
256
256
  if (!credential) throw new Error("Cloudflare session bearer is unavailable.");
257
257
  return { Authorization: `Bearer ${credential.token}` };
258
258
  }
@@ -269,25 +269,37 @@ async function withSecretFile(content, action) {
269
269
  });
270
270
  }
271
271
  }
272
- function sessionCredential() {
272
+ async function sessionCredential() {
273
273
  const token = process.env.CLOUDFLARE_API_TOKEN || process.env.CF_API_TOKEN;
274
274
  if (token) return {
275
275
  type: "api_token",
276
276
  token
277
277
  };
278
- const identity = runCf(["auth", "whoami"], process.cwd(), true);
278
+ const identity = runCf(["auth", "whoami"]);
279
279
  if (identity.status !== 0) return null;
280
280
  const state = object(parsedJson(identity.stdout));
281
281
  if (state.authenticated !== true || state.tokenValid !== true) return null;
282
- const source = state.authSource;
283
- if (typeof source !== "string" || !source.startsWith("OAuth token from ")) return null;
284
- const credential = object(parsedJson(readFileSync(source.slice(17), "utf8")));
285
- return typeof credential.oauth_token === "string" && credential.oauth_token ? {
282
+ if (typeof state.authSource !== "string" || !state.authSource.startsWith("OAuth token")) return null;
283
+ const dist = join(dirname(fileURLToPath(import.meta.resolve("cf/package.json"))), "dist");
284
+ const entry = readdirSync(dist).find((name) => /^cf-[^/]+\.mjs$/.test(name));
285
+ if (!entry) throw new Error("The bundled Cloudflare credential reader is unavailable.");
286
+ const module = await import(pathToFileURL(join(dist, entry)).href);
287
+ if (typeof module.t !== "function") throw new Error("The bundled Cloudflare credential reader is unavailable.");
288
+ const noop = () => {};
289
+ const stored = module.t({ logger: {
290
+ debug: noop,
291
+ info: noop,
292
+ log: noop,
293
+ warn: noop,
294
+ error: noop
295
+ } }).readAuthCredentials();
296
+ const credential = stored && typeof stored === "object" ? stored : null;
297
+ return credential && typeof credential.oauth_token === "string" && credential.oauth_token ? {
286
298
  type: "oauth",
287
299
  token: credential.oauth_token
288
300
  } : null;
289
301
  }
290
- function auth() {
302
+ async function auth() {
291
303
  if (args[0] === "login") return runInteractiveCf([
292
304
  "auth",
293
305
  "login",
@@ -308,7 +320,7 @@ function auth() {
308
320
  }), called.stderr);
309
321
  }
310
322
  if (args[0] === "auth" && args[1] === "token") {
311
- const credential = sessionCredential();
323
+ const credential = await sessionCredential();
312
324
  return credential ? result(0, `${JSON.stringify(credential)}\n`) : result(1, "", "Cloudflare session has no OAuth bearer.");
313
325
  }
314
326
  return result(1, "", "Unsupported Cloudflare authentication operation.");
@@ -843,7 +855,7 @@ async function tail() {
843
855
  ] });
844
856
  const endpoint = `${(process.env.CLOUDFLARE_API_BASE_URL ?? "https://api.cloudflare.com/client/v4").replace(/\/$/, "")}/accounts/${encodeURIComponent(accountId)}/workers/scripts/${encodeURIComponent(worker)}/tails`;
845
857
  const headers = {
846
- ...apiHeaders(),
858
+ ...await apiHeaders(),
847
859
  "Content-Type": "application/json"
848
860
  };
849
861
  const stopped = new AbortController();
package/dist/cli/cli.mjs CHANGED
@@ -2020,7 +2020,7 @@ if (helpPath) {
2020
2020
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
2021
2021
  process.exit(1);
2022
2022
  }
2023
- import("../deploy-f1j5MyEP.mjs").then(({ runDeploy }) => {
2023
+ import("../deploy-BM_LoBXC.mjs").then(({ runDeploy }) => {
2024
2024
  runDeploy(root, {
2025
2025
  projectSlug: deployArgs.projectSlug,
2026
2026
  dir: deployArgs.dir,
@@ -2039,21 +2039,21 @@ if (helpPath) {
2039
2039
  });
2040
2040
  } else if (command === "connect") (async () => {
2041
2041
  const parsed = parseConnectArgs(args.slice(1));
2042
- const { runConnectCommand } = await import("../connect-4Ph5Y0QE.mjs");
2042
+ const { runConnectCommand } = await import("../connect-BY38i-9E.mjs");
2043
2043
  await runConnectCommand(process.cwd(), parsed);
2044
2044
  })().catch((err) => {
2045
2045
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
2046
2046
  process.exit(1);
2047
2047
  });
2048
- else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-D4ZcMUSf.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed)));
2049
- else if (command === "account") runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-DGt9cpRe.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed)));
2050
- else if (command === "platform") runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-C8OqhqPt.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed)));
2051
- else if (command === "cloudflare") runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-BjNxR1XF.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed)));
2048
+ else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-cZq0HuWe.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed)));
2049
+ else if (command === "account") runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-CQ2wi4Th.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed)));
2050
+ else if (command === "platform") runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-CjNB09OF.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed)));
2051
+ else if (command === "cloudflare") runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-bSmZ1d5L.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed)));
2052
2052
  else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-B44I8J_W.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
2053
2053
  else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-DN9sSNiV.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
2054
2054
  else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-Dmhvb2oU.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
2055
- else if (command === "email") runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-BXBtqadx.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed)));
2056
- else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-CyHAAGkK.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
2055
+ else if (command === "email") runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-dMnE_Lat.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed)));
2056
+ else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-BIo37Y7H.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
2057
2057
  else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-Csi-tMbT.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
2058
2058
  else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-Vnv2f65C.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
2059
2059
  else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-BED3_9JD.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
@@ -2075,7 +2075,7 @@ else if (command === "prepare") {
2075
2075
  });
2076
2076
  } else if (command === "init") {
2077
2077
  const root = process.cwd();
2078
- import("../init-CRGDXzVC.mjs").then(({ runInitCommand, parseInitArgs }) => {
2078
+ import("../init-CJSnEcuj.mjs").then(({ runInitCommand, parseInitArgs }) => {
2079
2079
  let initArgs;
2080
2080
  try {
2081
2081
  initArgs = parseInitArgs(args.slice(1));
@@ -2207,12 +2207,12 @@ else if (command === "prepare") {
2207
2207
  const root = process.cwd();
2208
2208
  switch (cmd) {
2209
2209
  case "connect": {
2210
- const { runConnectCommand } = await import("../connect-4Ph5Y0QE.mjs");
2210
+ const { runConnectCommand } = await import("../connect-BY38i-9E.mjs");
2211
2211
  await runConnectCommand(root, parseConnectArgs([]));
2212
2212
  return;
2213
2213
  }
2214
2214
  case "init": {
2215
- const { runInitCommand, parseInitArgs } = await import("../init-CRGDXzVC.mjs");
2215
+ const { runInitCommand, parseInitArgs } = await import("../init-CJSnEcuj.mjs");
2216
2216
  await runInitCommand(root, parseInitArgs([]));
2217
2217
  return;
2218
2218
  }
@@ -2222,21 +2222,21 @@ else if (command === "prepare") {
2222
2222
  return;
2223
2223
  }
2224
2224
  case "deploy": {
2225
- const { runDeploy } = await import("../deploy-f1j5MyEP.mjs");
2225
+ const { runDeploy } = await import("../deploy-BM_LoBXC.mjs");
2226
2226
  await runDeploy(root);
2227
2227
  return;
2228
2228
  }
2229
- case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-router-D4ZcMUSf.mjs").then(({ runAuthRouter }) => runAuthRouter(r, p)));
2230
- case "account": return runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (r, p) => import("../account-cmd-DGt9cpRe.mjs").then(({ runAccountCommand }) => runAccountCommand(r, p)));
2231
- case "platform": return runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (r, p) => import("../platform-cmd-C8OqhqPt.mjs").then(({ runPlatformCommand }) => runPlatformCommand(r, p)));
2232
- case "cloudflare": return runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (r, p) => import("../cloudflare-cmd-BjNxR1XF.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(r, p)));
2229
+ case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-router-cZq0HuWe.mjs").then(({ runAuthRouter }) => runAuthRouter(r, p)));
2230
+ case "account": return runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (r, p) => import("../account-cmd-CQ2wi4Th.mjs").then(({ runAccountCommand }) => runAccountCommand(r, p)));
2231
+ case "platform": return runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (r, p) => import("../platform-cmd-CjNB09OF.mjs").then(({ runPlatformCommand }) => runPlatformCommand(r, p)));
2232
+ case "cloudflare": return runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (r, p) => import("../cloudflare-cmd-bSmZ1d5L.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(r, p)));
2233
2233
  case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-B44I8J_W.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
2234
2234
  case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-DN9sSNiV.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
2235
2235
  case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-Dmhvb2oU.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
2236
2236
  case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-BED3_9JD.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
2237
2237
  case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-Dpt0jd-x.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
2238
- case "email": return runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (r, p) => import("../email-BXBtqadx.mjs").then(({ runEmailCommand }) => runEmailCommand(r, p)));
2239
- case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-CyHAAGkK.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
2238
+ case "email": return runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (r, p) => import("../email-dMnE_Lat.mjs").then(({ runEmailCommand }) => runEmailCommand(r, p)));
2239
+ case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-BIo37Y7H.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
2240
2240
  case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-Csi-tMbT.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
2241
2241
  case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-Vnv2f65C.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
2242
2242
  case "prepare": {
@@ -173,7 +173,11 @@ function cloudflareAuthEnvironment(source = process.env) {
173
173
  "WRANGLER_OUTPUT_FILE_PATH",
174
174
  "WRANGLER_LOG_SANITIZE"
175
175
  ]);
176
- for (const key of Object.keys(env)) if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN|VOID_ACCESS_CREDENTIALS|VOID_ACCESS_ORIGIN)$/i.test(key) || scrubbedWranglerKeys.has(key.toUpperCase())) delete env[key];
176
+ for (const key of Object.keys(env)) {
177
+ if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN|VOID_ACCESS_CREDENTIALS|VOID_ACCESS_ORIGIN)$/i.test(key) || scrubbedWranglerKeys.has(key.toUpperCase())) delete env[key];
178
+ if (key.toUpperCase() === "CLOUDFLARE_AUTH_USE_KEYRING") delete env[key];
179
+ }
180
+ env.CLOUDFLARE_AUTH_USE_KEYRING = "true";
177
181
  return env;
178
182
  }
179
183
  function isCleanExit(result) {
@@ -1,7 +1,7 @@
1
1
  import { t as basename } from "./dist-BVqXeR_h.mjs";
2
2
  import { v as readRootWranglerConfig } from "./wrangler-BymcxrRa.mjs";
3
3
  import { j as log } from "./dist-Dn6nn2IU.mjs";
4
- import { a as createBundledCloudflareAuthRunner, i as cloudflareCredentialOverrides, o as ensureCloudflareAuthentication, s as parseCloudflareAuthSession } from "./cloudflare-auth-B9jPCkV2.mjs";
4
+ import { a as createBundledCloudflareAuthRunner, i as cloudflareCredentialOverrides, o as ensureCloudflareAuthentication, s as parseCloudflareAuthSession } from "./cloudflare-auth-C4_GPZr0.mjs";
5
5
  //#region src/cli/cloudflare-cmd.ts
6
6
  async function runCloudflareCommand(root, args) {
7
7
  const runWrangler = createBundledCloudflareAuthRunner(root);
@@ -1,7 +1,7 @@
1
1
  import { a as join, t as basename } from "./dist-BVqXeR_h.mjs";
2
2
  import { i as LATEST_KNOWN_COMPAT_DATE, k as writeProvisionedWranglerConfig, v as readRootWranglerConfig } from "./wrangler-BymcxrRa.mjs";
3
3
  import { I as select, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
4
- import { a as createBundledCloudflareAuthRunner, o as ensureCloudflareAuthentication } from "./cloudflare-auth-B9jPCkV2.mjs";
4
+ import { a as createBundledCloudflareAuthRunner, o as ensureCloudflareAuthentication } from "./cloudflare-auth-C4_GPZr0.mjs";
5
5
  import { existsSync } from "node:fs";
6
6
  //#region src/cli/cloudflare-connect.ts
7
7
  async function connectCloudflare(root, interactive = Boolean(process.stdin.isTTY)) {
@@ -3,9 +3,9 @@ import { o as listPlatformConnections, s as normalizePlatformApiUrl } from "./pl
3
3
  import { i as readDeploymentPlatform, l as writeDeploymentPlatform, u as writePlatformSelection } from "./project-C0Fqu05O.mjs";
4
4
  import { I as select, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
5
5
  import { i as isExpiredTokenError, n as PlatformClient } from "./client-QTl6ko_D.mjs";
6
- import { t as promptForLoginToken } from "./login-BQyISZuW.mjs";
7
- import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-CRSKfu8k.mjs";
8
- import { t as connectCloudflare } from "./cloudflare-connect-CCUozPOe.mjs";
6
+ import { t as promptForLoginToken } from "./login-DZldyb8c.mjs";
7
+ import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-BtxZrT6w.mjs";
8
+ import { t as connectCloudflare } from "./cloudflare-connect-jAwacxxP.mjs";
9
9
  //#region src/cli/connect.ts
10
10
  async function selectVoidPlatform(interactive) {
11
11
  if (!interactive) throw new Error("connect: Supply a Void platform URL in non-interactive mode.");
@@ -862,7 +862,7 @@ async function runMigrate(root, dialect, remote) {
862
862
  log.error(getErrorMessage(error));
863
863
  process.exit(1);
864
864
  }
865
- const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-f1j5MyEP.mjs");
865
+ const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-BM_LoBXC.mjs");
866
866
  const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations);
867
867
  if (!applySet.ok) {
868
868
  log.error(applySet.reason);
@@ -1,2 +1,2 @@
1
- import { A as parseRootWranglerConfig, J as runDeploy, f as checkWranglerMigrationApplySet } from "./deploy-CAOwIvwP.mjs";
1
+ import { A as parseRootWranglerConfig, J as runDeploy, f as checkWranglerMigrationApplySet } from "./deploy-C0JaQSWS.mjs";
2
2
  export { checkWranglerMigrationApplySet, parseRootWranglerConfig, runDeploy };
@@ -36,7 +36,7 @@ import { i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r
36
36
  import { n as getPackageDir } from "./agents-B_pX_HmQ.mjs";
37
37
  import { i as isExpiredTokenError, n as PlatformClient, o as parsePlatformErrorBody, r as isCliOutdatedError, s as platformErrorMessage, t as PlatformApiError } from "./client-QTl6ko_D.mjs";
38
38
  import { a as resolveProjectCommand, i as hasBackendFiles, n as detectPreset, o as resolveWranglerArgv, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-UHj9ARyP.mjs";
39
- import { o as ensureCloudflareAuthentication, r as cloudflareAuthNeedsTerminal, t as CloudflareAuthenticationError } from "./cloudflare-auth-B9jPCkV2.mjs";
39
+ import { i as cloudflareCredentialOverrides, o as ensureCloudflareAuthentication, r as cloudflareAuthNeedsTerminal, s as parseCloudflareAuthSession, t as CloudflareAuthenticationError } from "./cloudflare-auth-C4_GPZr0.mjs";
40
40
  import { n as writeVoidProjectConfig } from "./config-write-BSduPMY8.mjs";
41
41
  import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-B8KuoYsO.mjs";
42
42
  import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-sMZXpk_S.mjs";
@@ -44,7 +44,7 @@ import { t as formatCloudflareUserMessage } from "./cloudflare-user-output-Q-k0Q
44
44
  import { a as promptProjectSetupAction, i as promptProjectSelection, r as promptAndCreateProject } from "./create-project-DBfFSZKY.mjs";
45
45
  import { t as getRequestedProjectSlug } from "./resolve-project-BG5ORGID.mjs";
46
46
  import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
47
- import { t as promptForLoginToken } from "./login-BQyISZuW.mjs";
47
+ import { t as promptForLoginToken } from "./login-DZldyb8c.mjs";
48
48
  import { createRequire } from "node:module";
49
49
  import { copyFileSync, cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
50
50
  import { fileURLToPath } from "node:url";
@@ -56,7 +56,7 @@ import { execFile, execSync, spawn, spawnSync } from "node:child_process";
56
56
  import { applyEdits, modify, parse } from "jsonc-parser";
57
57
  import { isDeepStrictEqual } from "node:util";
58
58
  import { Minimatch } from "minimatch";
59
- import { activateCloudflareVersion, assertCloudflareBindingsPreserved, assertCloudflareDurableObjectLifecycleSupported, assertExistingCloudflareConfig, encodeCloudflareVersionMessage, extractWorkersDevSubdomain, normalizeWorkersDevSubdomain, parseRootWranglerConfig, parseRootWranglerConfig as parseRootWranglerConfig$1, readBindingFieldPresence, readCloudflareTriggerConfig, readConfigEntryString, readExistingCloudflareWorker, readStoredResourceName, readWranglerTopLevelString, renderCloudflareStaticEntry, resolveD1MigrateTarget, stageCloudflareStaticAssets, writeCloudflareFrameworkDeployConfig, writeCloudflareStaticDeployConfig } from "@void/deploy-cloudflare";
59
+ import { CloudflareWorkerInspectionError, activateCloudflareVersion, assertCloudflareBindingsPreserved, assertCloudflareDurableObjectLifecycleSupported, assertExistingCloudflareConfig, encodeCloudflareVersionMessage, extractWorkersDevSubdomain, normalizeWorkersDevSubdomain, parseRootWranglerConfig, parseRootWranglerConfig as parseRootWranglerConfig$1, readBindingFieldPresence, readCloudflareTriggerConfig, readConfigEntryString, readExistingCloudflareWorker, readStoredResourceName, readWranglerTopLevelString, renderCloudflareStaticEntry, resolveD1MigrateTarget, stageCloudflareStaticAssets, writeCloudflareFrameworkDeployConfig, writeCloudflareStaticDeployConfig } from "@void/deploy-cloudflare";
60
60
  import { getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, readBuildOutput } from "@cloudflare/build-output-utils";
61
61
  import ignore from "ignore";
62
62
  import { hash } from "blake3-jit";
@@ -2071,8 +2071,10 @@ async function uploadAssets(options) {
2071
2071
  byHash.set(hash, path);
2072
2072
  }
2073
2073
  const session = await apiResult(`${options.accountUrl}/workers/scripts/${encodeURIComponent(options.workerName)}/assets-upload-session`, options.token, "POST", { manifest }, options.verifyUploader);
2074
- let jwt = requiredString(session.jwt, "asset upload token");
2074
+ const uploadJwt = requiredString(session.jwt, "asset upload token");
2075
2075
  if (!Array.isArray(session.buckets)) throw new Error("Cloudflare did not provide asset upload batches.");
2076
+ if (session.buckets.length === 0) return uploadJwt;
2077
+ let completionJwt;
2076
2078
  for (const bucket of session.buckets) {
2077
2079
  if (!Array.isArray(bucket) || !bucket.every((hash) => typeof hash === "string")) throw new Error("Cloudflare returned an invalid asset upload batch.");
2078
2080
  const form = new FormData();
@@ -2081,9 +2083,10 @@ async function uploadAssets(options) {
2081
2083
  if (!path) throw new Error("Cloudflare requested an asset outside the verified Worker output.");
2082
2084
  form.append(hash, readFileSync(path).toString("base64"));
2083
2085
  }
2084
- jwt = requiredString((await apiResult(`${options.accountUrl}/workers/assets/upload?base64=true`, jwt, "POST", form, options.verifyUploader)).jwt, "asset completion token");
2086
+ const uploaded = await apiResult(`${options.accountUrl}/workers/assets/upload?base64=true`, uploadJwt, "POST", form, options.verifyUploader);
2087
+ if (uploaded.jwt !== void 0) completionJwt = requiredString(uploaded.jwt, "asset completion token");
2085
2088
  }
2086
- return jwt;
2089
+ return requiredString(completionJwt, "asset completion token");
2087
2090
  }
2088
2091
  /** The Workers beta API is the only upload endpoint that accepts a version UUID as an inheritance source. */
2089
2092
  async function uploadPinnedCloudflareVersion(options) {
@@ -6748,6 +6751,42 @@ function createDeployWranglerRunner(root, accountId, apiBaseUrl) {
6748
6751
  };
6749
6752
  };
6750
6753
  }
6754
+ /** Retry an existing-Worker read only when a fresh identity check proves the session is gone. */
6755
+ async function prepareExistingCloudflareDeployWithAuth(options, beforeRun) {
6756
+ try {
6757
+ return await prepareExistingCloudflareDeploy(options);
6758
+ } catch (error) {
6759
+ if (!(error instanceof CloudflareWorkerInspectionError)) throw error;
6760
+ if (!beforeRun()) throw new CloudflareAuthenticationError("The Cloudflare uploader changed during Worker verification.", "uploader-changed");
6761
+ const whoamiArgs = [...existingWranglerConfigArgs(options.configPath), "--env="];
6762
+ const identity = await options.runWrangler([
6763
+ "whoami",
6764
+ "--json",
6765
+ ...whoamiArgs
6766
+ ], { capture: true });
6767
+ const session = isCleanWranglerExit(identity) ? parseCloudflareAuthSession(identity.stdout) : null;
6768
+ const wrongAccount = session !== null && session.accounts.length > 0 && !session.accounts.some((account) => account.id === options.accountId);
6769
+ if (session && !wrongAccount) throw error;
6770
+ let loggedOut = false;
6771
+ try {
6772
+ loggedOut = JSON.parse(identity.stdout).loggedIn === false;
6773
+ } catch {}
6774
+ if (!(loggedOut || wrongAccount || /authentication is required|not authenticated|no api token|invalid.*token|expired.*token|unauthorized/i.test(identity.stderr)) || identity.signal || identity.error) throw new Error("Could not verify the Cloudflare session after the Worker check failed. Run `void cloudflare status` and retry.");
6775
+ const overrides = cloudflareCredentialOverrides();
6776
+ if (overrides.length > 0) throw new Error(`Cloudflare credentials from ${overrides.join(", ")} were rejected or cannot access account ${options.accountId}. Correct or unset them, then retry the deploy.`);
6777
+ if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error(wrongAccount ? `The Cloudflare session cannot access account ${options.accountId}. Run \`void cloudflare login\` with the correct user, or set a token for that account in CI, then retry.` : "Cloudflare authentication expired or is unavailable. Run `void cloudflare login` in a terminal, or set CLOUDFLARE_API_TOKEN in CI, then retry.");
6778
+ log.warn(wrongAccount ? "The current Cloudflare session cannot access the deployment account. Signing in before retrying the Worker check." : "Cloudflare session is unavailable. Signing in before retrying the Worker check.");
6779
+ if (!(await ensureCloudflareAuthentication({
6780
+ forceLogin: true,
6781
+ requireAccounts: true,
6782
+ beforeRun,
6783
+ runWrangler: (args, capture) => options.runWrangler([...args], { capture }),
6784
+ whoamiArgs
6785
+ })).accounts.some((account) => account.id === options.accountId)) throw new Error(`The signed-in Cloudflare user cannot access account ${options.accountId}. Sign in with a user who can access it, then retry.`);
6786
+ if (!beforeRun()) throw new CloudflareAuthenticationError("The Cloudflare uploader changed during sign-in.", "uploader-changed");
6787
+ return await prepareExistingCloudflareDeploy(options);
6788
+ }
6789
+ }
6751
6790
  async function chooseCloudflareDeployAccount(options) {
6752
6791
  const accounts = (await ensureCloudflareAuthentication({
6753
6792
  beforeRun: options.beforeWranglerRun,
@@ -7414,7 +7453,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
7414
7453
  if (options.reuseExistingWorker || initialCloudflareLink) {
7415
7454
  if (authEnabled || needsSandbox || needsAI || expectedCrons.length || desired.queues.length || preBuildMigrations.length) throw new Error("Link the existing site without adding runtime features, auth setup, or database migrations. Make those changes in a later deployment.");
7416
7455
  approvedHandoffKv = approvedCloudflareIsrBinding(voidConfig, rootConfig);
7417
- existingWorker = await prepareExistingCloudflareDeploy({
7456
+ existingWorker = await prepareExistingCloudflareDeployWithAuth({
7418
7457
  root,
7419
7458
  configPath,
7420
7459
  accountId,
@@ -7423,7 +7462,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
7423
7462
  runWrangler,
7424
7463
  readExistingWorker: deps.readExistingWorker,
7425
7464
  approvedKv: approvedHandoffKv
7426
- });
7465
+ }, assertUploaderStillPinned);
7427
7466
  pinnedHandoffLink = readCloudflareLink(root);
7428
7467
  if (!pinnedHandoffLink) throw new Error("The pending Cloudflare handoff was not saved before deployment.");
7429
7468
  rootConfig = parseRootWranglerConfig(configPath);
@@ -8206,7 +8245,7 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
8206
8245
  log.error(`deploy: ${getErrorMessage(error)}`);
8207
8246
  return exit(1);
8208
8247
  }
8209
- const existingWorker = await prepareExistingCloudflareDeploy({
8248
+ const existingWorker = await prepareExistingCloudflareDeployWithAuth({
8210
8249
  root,
8211
8250
  configPath,
8212
8251
  accountId,
@@ -8214,7 +8253,7 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
8214
8253
  pinnedLink: initialCloudflareLink,
8215
8254
  runWrangler,
8216
8255
  readExistingWorker: deps.readExistingWorker
8217
- });
8256
+ }, uploaderIsPinned);
8218
8257
  const pinnedHandoffLink = existingWorker ? readCloudflareLink(root) : null;
8219
8258
  if (existingWorker && !pinnedHandoffLink) throw new Error("The pending Cloudflare handoff was not saved before deployment.");
8220
8259
  rootConfig = parseRootWranglerConfig(configPath);
@@ -1,6 +1,6 @@
1
1
  import { a as join } from "./dist-BVqXeR_h.mjs";
2
2
  import { c as import_picocolors, i as createSpinner } from "./output-CCH48AMM.mjs";
3
- import { L as resolveDeployTransport, O as isWranglerNonInteractiveOrCI, X as runWranglerAuthToken, _ as deriveWorkerName, _t as findEmailConfigConflicts, bt as renderEmailChecklist, gt as createNodeEmailDns, h as createDeployWranglerRunner, ht as applyEmailSetup, k as loadProvisionModule, v as discoverRootWranglerConfig, vt as preflightEmail, yt as renderAddressMap } from "./deploy-CAOwIvwP.mjs";
3
+ import { L as resolveDeployTransport, O as isWranglerNonInteractiveOrCI, X as runWranglerAuthToken, _ as deriveWorkerName, _t as findEmailConfigConflicts, bt as renderEmailChecklist, gt as createNodeEmailDns, h as createDeployWranglerRunner, ht as applyEmailSetup, k as loadProvisionModule, v as discoverRootWranglerConfig, vt as preflightEmail, yt as renderAddressMap } from "./deploy-C0JaQSWS.mjs";
4
4
  import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
5
5
  import { c as getToken, d as openBrowser } from "./auth-DLNN0D3Z.mjs";
6
6
  import { o as readProjectConfig } from "./project-C0Fqu05O.mjs";
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
2
2
  import { a as join, l as relative, n as dirname, u as resolve } from "./dist-BVqXeR_h.mjs";
3
3
  import { d as require_picocolors } from "./output-CCH48AMM.mjs";
4
- import { G as resolveWorkerDirName, St as hasDocumentRoutes, V as resolveDistDir, ct as prerenderPagesNode, dt as collectRevalidate, ft as hasRevalidate, mt as SEND_EMAIL_BINDING, ot as generateQueueResolverSource, pt as scanDurableObjectModules, st as prerenderPages, ut as collectPages, wt as resolveAssetRoutingPolicy, xt as hasApiRoutes } from "./deploy-CAOwIvwP.mjs";
4
+ import { G as resolveWorkerDirName, St as hasDocumentRoutes, V as resolveDistDir, ct as prerenderPagesNode, dt as collectRevalidate, ft as hasRevalidate, mt as SEND_EMAIL_BINDING, ot as generateQueueResolverSource, pt as scanDurableObjectModules, st as prerenderPages, ut as collectPages, wt as resolveAssetRoutingPolicy, xt as hasApiRoutes } from "./deploy-C0JaQSWS.mjs";
5
5
  import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-GgcMozYz.mjs";
6
6
  import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-DPByhVck.mjs";
7
7
  import { r as scopedAccessCredentials } from "./cf-access-DRsQRe6k.mjs";
@@ -17,9 +17,9 @@ import { r as formatProjectCommand } from "./preset-UHj9ARyP.mjs";
17
17
  import { n as writeVoidProjectConfig, t as canRewriteVoidProjectConfig } from "./config-write-BSduPMY8.mjs";
18
18
  import { i as migrateFrameworkAdapterPaths, t as migrateLegacyVoidConfig } from "./migrate-B8KuoYsO.mjs";
19
19
  import { i as promptProjectSelection, r as promptAndCreateProject } from "./create-project-DBfFSZKY.mjs";
20
- import { t as promptForLoginToken } from "./login-BQyISZuW.mjs";
21
- import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-CRSKfu8k.mjs";
22
- import { t as connectCloudflare } from "./cloudflare-connect-CCUozPOe.mjs";
20
+ import { t as promptForLoginToken } from "./login-DZldyb8c.mjs";
21
+ import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-BtxZrT6w.mjs";
22
+ import { t as connectCloudflare } from "./cloudflare-connect-jAwacxxP.mjs";
23
23
  import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-BV4AzNul.mjs";
24
24
  import { createRequire } from "node:module";
25
25
  import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
@@ -29,7 +29,7 @@ async function selectPlatformLoginMethod(platform, requestedId) {
29
29
  return methods.find((method) => method.id === provider);
30
30
  }
31
31
  async function promptForLoginToken(root = process.cwd(), platform) {
32
- const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-C8OqhqPt.mjs").then(({ discoverPlatform }) => discoverPlatform(getApiUrl(root))));
32
+ const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-CjNB09OF.mjs").then(({ discoverPlatform }) => discoverPlatform(getApiUrl(root))));
33
33
  const s = createSpinner();
34
34
  s.start(`Opening browser for ${providerName} login...`);
35
35
  try {
@@ -0,0 +1,2 @@
1
+ import { r as selectPlatformLoginMethod } from "./login-DZldyb8c.mjs";
2
+ export { selectPlatformLoginMethod };
@@ -137,8 +137,8 @@ async function runAuth(origin, args) {
137
137
  if (args.action === "login" || args.action === "token" && args.tokenStdin) {
138
138
  if (!args.tokenStdin && !process.stdin.isTTY) throw new OperatorClientError("Browser login requires an interactive terminal. Use --token-stdin to exchange an API session.", "interactive_login_required");
139
139
  const apiToken = args.tokenStdin ? await readOperatorApiTokenStdin() : await (async () => {
140
- const { discoverPlatform } = await import("./platform-cmd-C8OqhqPt.mjs");
141
- const { selectPlatformLoginMethod } = await import("./login-r2gL8l7B.mjs");
140
+ const { discoverPlatform } = await import("./platform-cmd-CjNB09OF.mjs");
141
+ const { selectPlatformLoginMethod } = await import("./login-t6rndSRW.mjs");
142
142
  const { runPlatformLogin } = await import("./auth-CZuiVsFh.mjs");
143
143
  return runPlatformLogin(origin, (await selectPlatformLoginMethod(await discoverPlatform(origin), args.providerExplicit ? args.provider : void 0)).id, (url) => process.stderr.write(`Sign in at ${url}\n`));
144
144
  })();
@@ -140,11 +140,11 @@ async function configurationInput(args, existing) {
140
140
  }
141
141
  async function runPlatformAuthConfig(args) {
142
142
  if (args.action === "recover") {
143
- const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-BkT3EsF2.mjs");
143
+ const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-COOhMCvx.mjs");
144
144
  return runPlatformAuthRecovery(args);
145
145
  }
146
146
  if (args.action === "protection") {
147
- const { runPlatformProtectionConfig } = await import("./platform-auth-protection-Ba1XqGhn.mjs");
147
+ const { runPlatformProtectionConfig } = await import("./platform-auth-protection-Dma02l6-.mjs");
148
148
  return runPlatformProtectionConfig(args);
149
149
  }
150
150
  const origin = resolveOperatorOrigin(args.connection);
@@ -4,8 +4,8 @@ import { n as ensurePlatformAccessToken } from "./cf-access-P0iZnu0q.mjs";
4
4
  import { E as confirm, W as isCancel } from "./dist-Dn6nn2IU.mjs";
5
5
  import { n as OperatorClient } from "./operator-client-DUwumHpQ.mjs";
6
6
  import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-8KnOVXVd.mjs";
7
- import { D as preparePlatformAccessSetup, E as parsePlatformAccessSetupSpec, O as PlatformCloudflareClient, T as checkpointPlatformAccessResources, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-78H0XQUA.mjs";
8
- import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
7
+ import { D as preparePlatformAccessSetup, E as parsePlatformAccessSetupSpec, O as PlatformCloudflareClient, T as checkpointPlatformAccessResources, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-BpDlxT3t.mjs";
8
+ import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-BKYenDlE.mjs";
9
9
  import { createHmac } from "node:crypto";
10
10
  import { parsePlatformAccessProtection, platformProtectionProofMessage } from "@void/platform";
11
11
  import { readFile } from "node:fs/promises";
@@ -2,8 +2,8 @@ import { d as openBrowser } from "./auth-DLNN0D3Z.mjs";
2
2
  import { d as readInstallationRecoverySecrets, h as resolveInstallationManifest, t as acquirePlatformLifecycleLock } from "./platform-registry-QBa4DK32.mjs";
3
3
  import { E as confirm, W as isCancel } from "./dist-Dn6nn2IU.mjs";
4
4
  import { a as resolveOperatorOrigin } from "./operator-auth-8KnOVXVd.mjs";
5
- import { O as PlatformCloudflareClient, f as platformDatabaseClientUrl, n as resolvePlatformInstallDatabaseUrl, s as acquirePlatformDatabaseLifecycleLockConnection, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-78H0XQUA.mjs";
6
- import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
5
+ import { O as PlatformCloudflareClient, f as platformDatabaseClientUrl, n as resolvePlatformInstallDatabaseUrl, s as acquirePlatformDatabaseLifecycleLockConnection, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-BpDlxT3t.mjs";
6
+ import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-BKYenDlE.mjs";
7
7
  import { createCipheriv, createDecipheriv, createHash, createHmac, hkdfSync, randomBytes, randomUUID } from "node:crypto";
8
8
  import { execFile } from "node:child_process";
9
9
  import { parsePlatformAccessProtection, parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration, platformAuthenticationRecoveryMessage, validatePlatformAdmissionPolicy } from "@void/platform";
@@ -92,12 +92,12 @@ function saveDiscoveredPlatform(discovery) {
92
92
  }
93
93
  async function runPlatformCommand(_root, args) {
94
94
  if (args.subcommand === "config") {
95
- const { runPlatformAuthConfig } = await import("./platform-auth-config-TSw8edHw.mjs");
95
+ const { runPlatformAuthConfig } = await import("./platform-auth-config-Bex45lQt.mjs");
96
96
  await runPlatformAuthConfig(args);
97
97
  return;
98
98
  }
99
99
  if (args.subcommand === "operator") {
100
- const { runOperatorCommand } = await import("./operator-cmd-Co-PeaeD.mjs");
100
+ const { runOperatorCommand } = await import("./operator-cmd-B9dbG3Od.mjs");
101
101
  await runOperatorCommand(args);
102
102
  return;
103
103
  }
@@ -129,7 +129,7 @@ async function runPlatformCommand(_root, args) {
129
129
  console.log(`Capabilities: ${Object.entries(discovery.capabilities).filter(([, enabled]) => enabled).map(([name]) => name).join(", ")}`);
130
130
  return;
131
131
  }
132
- const { runPlatformLifecycleCommand } = await import("./platform-lifecycle-DDc9zCeJ.mjs");
132
+ const { runPlatformLifecycleCommand } = await import("./platform-lifecycle-CYll-oKE.mjs");
133
133
  await runPlatformLifecycleCommand(args);
134
134
  }
135
135
  //#endregion
@@ -1,2 +1,2 @@
1
- import { r as runPlatformCommand, t as discoverPlatform } from "./platform-cmd-CRSKfu8k.mjs";
1
+ import { r as runPlatformCommand, t as discoverPlatform } from "./platform-cmd-BtxZrT6w.mjs";
2
2
  export { discoverPlatform, runPlatformCommand };
@@ -1,8 +1,8 @@
1
1
  import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
2
2
  import { d as readInstallationRecoverySecrets, g as savePlatformConnection, t as acquirePlatformLifecycleLock, v as writeInstallationManifest } from "./platform-registry-QBa4DK32.mjs";
3
3
  import { B as text, E as confirm, N as note, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
4
- import { C as assertPlatformOperatorCredentialCanApplyPlan, O as PlatformCloudflareClient, _ as createPlatformInstallPlan, c as createPlatformHealthProbeToken, h as recordPlatformWorkerTraffic, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, p as recordResource, t as assertNoninteractivePlatformMutationAcknowledged, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-78H0XQUA.mjs";
5
- import { a as resolveInstalledPlatformManifest, c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
4
+ import { C as assertPlatformOperatorCredentialCanApplyPlan, O as PlatformCloudflareClient, _ as createPlatformInstallPlan, c as createPlatformHealthProbeToken, h as recordPlatformWorkerTraffic, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, p as recordResource, t as assertNoninteractivePlatformMutationAcknowledged, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-BpDlxT3t.mjs";
5
+ import { a as resolveInstalledPlatformManifest, c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-BKYenDlE.mjs";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { PLATFORM_APPLICATION_KEY, PLATFORM_REMOTE_INSTALLATION_MANIFEST_KEY, createApplicationRoutes, createPlatformDeploymentManifest, normalizeApplicationDomain } from "@void/platform";
8
8
  //#region src/cli/platform-domain.ts
@@ -7,7 +7,7 @@ import { a as listInstallationManifests, d as readInstallationRecoverySecrets, f
7
7
  import { n as ensurePlatformAccessToken } from "./cf-access-P0iZnu0q.mjs";
8
8
  import { B as text$1, E as confirm, F as password, G as settings, I as select, K as u$1, M as multiselect, N as note, O as intro, P as outro, R as symbol, U as CANCEL_SYMBOL, W as isCancel, g as S_PASSWORD_MASK, i as S_BAR_END, j as log, r as S_BAR } from "./dist-Dn6nn2IU.mjs";
9
9
  import { o as resolveWranglerArgv } from "./preset-UHj9ARyP.mjs";
10
- import { c as runCloudflareAuthCommand, n as announceCloudflareLogin } from "./cloudflare-auth-B9jPCkV2.mjs";
10
+ import { c as runCloudflareAuthCommand, n as announceCloudflareLogin } from "./cloudflare-auth-C4_GPZr0.mjs";
11
11
  import { _ as resolvePinnedApiBaseUrl, o as createDefaultRunWrangler } from "./provision-BhreDAOS.mjs";
12
12
  import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
13
13
  import { createHash, createHmac, randomBytes, randomUUID } from "node:crypto";
@@ -1499,7 +1499,7 @@ async function verifyInstalledPlatformAccessProtection(input) {
1499
1499
  }
1500
1500
  const existingWorkers = input.plan.actions.filter((action) => action.kind === "worker" && action.action === "update").map((action) => action.name);
1501
1501
  if (existingWorkers.length) {
1502
- const { verifyProtectionWorkerOrigins } = await import("./platform-auth-protection-Ba1XqGhn.mjs");
1502
+ const { verifyProtectionWorkerOrigins } = await import("./platform-auth-protection-Dma02l6-.mjs");
1503
1503
  await verifyProtectionWorkerOrigins({
1504
1504
  request: input.client.request.bind(input.client),
1505
1505
  listWorkerDomains: input.client.listWorkerDomains.bind(input.client),
@@ -5568,14 +5568,14 @@ function resolvePlatformInstallDatabaseUrl(checkpoint, manifest = null) {
5568
5568
  }
5569
5569
  async function runPlatformLifecycleCommand(args) {
5570
5570
  if (args.subcommand === "domain") {
5571
- const { runPlatformDomainCommand } = await import("./platform-domain-j9YCXRm6.mjs");
5571
+ const { runPlatformDomainCommand } = await import("./platform-domain-DppaTARe.mjs");
5572
5572
  await runPlatformDomainCommand(args);
5573
5573
  return;
5574
5574
  }
5575
5575
  if (args.subcommand === "discover") {
5576
5576
  const client = new PlatformCloudflareClient((await resolvePlatformCloudflareCredential()).token);
5577
5577
  const accountId = await selectAccount(await readAccounts(client), args.account);
5578
- const { recoverPlatformInstallations } = await import("./platform-recovery-Do8VOyDE.mjs");
5578
+ const { recoverPlatformInstallations } = await import("./platform-recovery-dJ5Me-I0.mjs");
5579
5579
  const recovered = await recoverPlatformInstallations(client, accountId, void 0, args.selector);
5580
5580
  if (recovered.length === 0) {
5581
5581
  log.info(`No recoverable Void platform installations were found in ${accountId}.`);
@@ -5585,7 +5585,7 @@ async function runPlatformLifecycleCommand(args) {
5585
5585
  return;
5586
5586
  }
5587
5587
  if (args.subcommand !== "install") {
5588
- const { runInstalledPlatformCommand } = await import("./platform-management-DzKNsMlt.mjs");
5588
+ const { runInstalledPlatformCommand } = await import("./platform-management-BS5r6Ao8.mjs");
5589
5589
  await runInstalledPlatformCommand(args);
5590
5590
  return;
5591
5591
  }
@@ -5809,7 +5809,7 @@ async function runPlatformLifecycleCommand(args) {
5809
5809
  progress?.stop("Read the saved installation.");
5810
5810
  progress = void 0;
5811
5811
  if (authoritative) {
5812
- const { selectAuthoritativePlatformManifest } = await import("./platform-management-DzKNsMlt.mjs");
5812
+ const { selectAuthoritativePlatformManifest } = await import("./platform-management-BS5r6Ao8.mjs");
5813
5813
  const selected = selectAuthoritativePlatformManifest(existing, authoritative);
5814
5814
  authoritativeProvisionIntents = true;
5815
5815
  if (!args.plan && JSON.stringify(selected) !== JSON.stringify(existing)) writeInstallationManifest(selected);
@@ -6038,7 +6038,7 @@ async function runPlatformLifecycleCommand(args) {
6038
6038
  })).actions.filter((action) => action.kind === "worker"),
6039
6039
  revalidateBeforeWorkerDeploy: (manifest, action) => revalidatePlatformInstallAction(client, plan, manifest, action),
6040
6040
  verifyExistingOwnership: async (manifest, databaseCheckpointExists) => {
6041
- const { verifyPlatformInstallationOwnership } = await import("./platform-management-DzKNsMlt.mjs");
6041
+ const { verifyPlatformInstallationOwnership } = await import("./platform-management-BS5r6Ao8.mjs");
6042
6042
  const retainedReplacementKeys = new Set(plan.actions.filter((action) => {
6043
6043
  const previous = manifest.resources.find((resource) => resource.key === action.key);
6044
6044
  return action.action === "create" && previous && previous.name !== action.name;
@@ -1,2 +1,2 @@
1
- import { r as runPlatformLifecycleCommand } from "./platform-lifecycle-78H0XQUA.mjs";
1
+ import { r as runPlatformLifecycleCommand } from "./platform-lifecycle-BpDlxT3t.mjs";
2
2
  export { runPlatformLifecycleCommand };
@@ -1,7 +1,7 @@
1
1
  import { i as createSpinner } from "./output-CCH48AMM.mjs";
2
2
  import { a as listInstallationManifests, d as readInstallationRecoverySecrets, h as resolveInstallationManifest, m as removePlatformConnectionForInstallation, p as removeInstallationRecoverySecrets, t as acquirePlatformLifecycleLock, v as writeInstallationManifest } from "./platform-registry-QBa4DK32.mjs";
3
3
  import { E as confirm, I as select, N as note, P as outro, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
4
- import { A as hyperdriveOriginFromConnectionString, C as assertPlatformOperatorCredentialCanApplyPlan, M as verifyPlatformRuntimeTokenPermissions, O as PlatformCloudflareClient, S as platformDatabaseNameFromOwnerUrl, _ as createPlatformInstallPlan, a as REMOTE_INSTALLATION_MANIFEST_KEY, b as platformProvisionIntentHash, d as loadPlatformRuntime, g as trackedPlatformWorkerTraffic, j as hyperdriveOriginMatches, k as hyperdriveOriginConfigHash, l as createPlatformInstallationSecrets, m as resolveBootstrapGitHubId, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, t as assertNoninteractivePlatformMutationAcknowledged, u as installPlatform, v as formatPlatformInstallPlan, w as resolvePlatformCloudflareCredential, x as revalidatePlatformInstallAction, y as platformAdoptionIntentHash } from "./platform-lifecycle-78H0XQUA.mjs";
4
+ import { A as hyperdriveOriginFromConnectionString, C as assertPlatformOperatorCredentialCanApplyPlan, M as verifyPlatformRuntimeTokenPermissions, O as PlatformCloudflareClient, S as platformDatabaseNameFromOwnerUrl, _ as createPlatformInstallPlan, a as REMOTE_INSTALLATION_MANIFEST_KEY, b as platformProvisionIntentHash, d as loadPlatformRuntime, g as trackedPlatformWorkerTraffic, j as hyperdriveOriginMatches, k as hyperdriveOriginConfigHash, l as createPlatformInstallationSecrets, m as resolveBootstrapGitHubId, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, t as assertNoninteractivePlatformMutationAcknowledged, u as installPlatform, v as formatPlatformInstallPlan, w as resolvePlatformCloudflareCredential, x as revalidatePlatformInstallAction, y as platformAdoptionIntentHash } from "./platform-lifecycle-BpDlxT3t.mjs";
5
5
  import { createHash } from "node:crypto";
6
6
  import { PLATFORM_DISABLED_KEY, PLATFORM_DISABLED_VALUE, PLATFORM_R2_OWNERSHIP_MARKER_KEY, createPlatformResourceOwnershipMarker, parsePlatformInstallationManifest, parsePlatformResourceOwnershipMarker, recordInstallationResource, recordInstallationStep, setInstallationDesiredState, transitionInstallation } from "@void/platform";
7
7
  //#region src/cli/platform-management.ts
@@ -1,2 +1,2 @@
1
- import { c as selectAuthoritativePlatformManifest, s as runInstalledPlatformCommand, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
1
+ import { c as selectAuthoritativePlatformManifest, s as runInstalledPlatformCommand, u as verifyPlatformInstallationOwnership } from "./platform-management-BKYenDlE.mjs";
2
2
  export { runInstalledPlatformCommand, selectAuthoritativePlatformManifest, verifyPlatformInstallationOwnership };
@@ -1,7 +1,7 @@
1
1
  import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
2
2
  import { a as listInstallationManifests, g as savePlatformConnection, t as acquirePlatformLifecycleLock, v as writeInstallationManifest } from "./platform-registry-QBa4DK32.mjs";
3
- import { _ as createPlatformInstallPlan, a as REMOTE_INSTALLATION_MANIFEST_KEY } from "./platform-lifecycle-78H0XQUA.mjs";
4
- import { i as recoverDurablyMarkedProvisionIntents, r as isPlatformManifestMonotonicExtension, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
3
+ import { _ as createPlatformInstallPlan, a as REMOTE_INSTALLATION_MANIFEST_KEY } from "./platform-lifecycle-BpDlxT3t.mjs";
4
+ import { i as recoverDurablyMarkedProvisionIntents, r as isPlatformManifestMonotonicExtension, u as verifyPlatformInstallationOwnership } from "./platform-management-BKYenDlE.mjs";
5
5
  import { parsePlatformInstallationManifest, setInstallationEndpoints } from "@void/platform";
6
6
  //#region src/cli/platform-recovery.ts
7
7
  async function recoverPlatformInstallations(client, accountId, verifyEndpoint = verifyInstallationEndpoint, selector = "") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "void",
3
- "version": "0.21.6",
3
+ "version": "0.21.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/voidzero-dev/void.git",
@@ -325,11 +325,11 @@
325
325
  "@cloudflare/vite-plugin": "1.54.7",
326
326
  "@cloudflare/workers-types": "^4.20260702.1",
327
327
  "@napi-rs/keyring": "2.0.0",
328
- "@void/deploy-cloudflare": "0.21.6",
329
- "@void/deploy-core": "0.21.6",
330
- "@void/edge": "0.21.6",
331
- "@void/isr": "0.21.6",
332
- "@void/platform": "0.21.6",
328
+ "@void/deploy-cloudflare": "0.21.7",
329
+ "@void/deploy-core": "0.21.7",
330
+ "@void/edge": "0.21.7",
331
+ "@void/isr": "0.21.7",
332
+ "@void/platform": "0.21.7",
333
333
  "acorn": "^8.15.0",
334
334
  "better-auth": "^1.7.3",
335
335
  "better-sqlite3": "^13.0.3",
@@ -379,7 +379,7 @@
379
379
  "zod": "^4.6.1"
380
380
  },
381
381
  "peerDependencies": {
382
- "@void/md": "0.21.6",
382
+ "@void/md": "0.21.7",
383
383
  "arktype": ">=2.0.0",
384
384
  "valibot": ">=1.0.0-beta.7",
385
385
  "vite": "^8.0.0",
@@ -1,2 +0,0 @@
1
- import { r as selectPlatformLoginMethod } from "./login-BQyISZuW.mjs";
2
- export { selectPlatformLoginMethod };