void 1.12.0 → 1.12.2

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 (123) hide show
  1. package/dist/{account-cmd-D_0qJ9fx.mjs → account-cmd-CdJQba_Q.mjs} +4 -4
  2. package/dist/{application-analysis-Cx2S63z5.mjs → application-analysis-DVeN8yoi.mjs} +1 -1
  3. package/dist/{application-routing-BAXpnawu.mjs → application-routing-KKw4Y84h.mjs} +1 -1
  4. package/dist/{auth-Boz0lrb3.mjs → auth-A7cZ8aXA.mjs} +1 -1
  5. package/dist/{auth-DlLDymuc.mjs → auth-CqwJwItO.mjs} +1 -1
  6. package/dist/{auth-link-C97r9p2N.mjs → auth-link-D9MWA_dj.mjs} +4 -4
  7. package/dist/{auth-router-BmzEgzYx.mjs → auth-router-FskgTU3B.mjs} +1 -1
  8. package/dist/{build-cmd-BaFsyZrz.mjs → build-cmd-B7OJ0U5R.mjs} +2 -2
  9. package/dist/build-id-4IV4hC1-.mjs +13 -0
  10. package/dist/{cache-xO711ATQ.mjs → cache-wSpi3aeM.mjs} +2 -2
  11. package/dist/{cancel-deploy-Di11ynsr.mjs → cancel-deploy-DMWzkAlb.mjs} +2 -2
  12. package/dist/{cf-access-FaIm95jA.mjs → cf-access-DHklo7Rg.mjs} +33 -19
  13. package/dist/{cf-build-output-Ca201_n1.mjs → cf-build-output-Cso7Vh-t.mjs} +4 -2
  14. package/dist/cf-build-output-Wpk_e5CI.mjs +1 -0
  15. package/dist/cli/cli.mjs +1 -1
  16. package/dist/cli/cloudflare-operation-process.mjs +1 -1
  17. package/dist/cli/db-execute-process.d.mts +2 -0
  18. package/dist/cli/db-execute-process.mjs +57 -0
  19. package/dist/{cli-main-DlW6lB8s.mjs → cli-main-DaLrQfPS.mjs} +37 -344
  20. package/dist/{client-ImIe7Mjq.mjs → client-DE2m2ldh.mjs} +4 -4
  21. package/dist/{client-DkYzDEC0.mjs → client-eLZwqkPH.mjs} +1 -1
  22. package/dist/{cloudflare-operations-BF0PSErW.mjs → cloudflare-operations-BIRQkYwL.mjs} +14 -8
  23. package/dist/cloudflare-operations-ByjFGats.mjs +1 -0
  24. package/dist/{connect-DDRQGfFE.mjs → connect-WG4TcR_d.mjs} +4 -4
  25. package/dist/{create-project-CY7sP8sI.mjs → create-project-8FdN6D2i.mjs} +2 -2
  26. package/dist/{create-project-Dro3K-az.mjs → create-project-CbuDH5Hv.mjs} +1 -1
  27. package/dist/{db-DmlaWVBu.mjs → db-BSuWV1PI.mjs} +1348 -69
  28. package/dist/db-args-BvMwAber.mjs +1 -0
  29. package/dist/db-args-CiQVg8SJ.mjs +321 -0
  30. package/dist/{delete-Uuq9ch6o.mjs → delete-WtLEfap2.mjs} +2 -2
  31. package/dist/{deploy-B9E7_rHC.mjs → deploy-DtJeunLF.mjs} +14 -14
  32. package/dist/{deploy-BB3rsZbP.mjs → deploy-GT4CW5fs.mjs} +1 -1
  33. package/dist/{deploy-managed-static-IKZyuc1W.mjs → deploy-managed-static-BWBsxOww.mjs} +5 -5
  34. package/dist/{deploy-security-notice-C3LalelR.mjs → deploy-security-notice-IRGy6Edf.mjs} +2 -2
  35. package/dist/deploy.mjs +4 -4
  36. package/dist/{domain-B_xY1yZ5.mjs → domain-mweyYXSw.mjs} +3 -3
  37. package/dist/{email-BIC15L7a.mjs → email-DoDqRH6i.mjs} +5 -5
  38. package/dist/{email-cloudflare-C447nOqq.mjs → email-cloudflare-DeYH3Ke7.mjs} +2 -2
  39. package/dist/{env-DJPZYHT5.mjs → env-DaAoYR2-.mjs} +3 -3
  40. package/dist/{gen-DiTZlDx8.mjs → gen-aOtHhZLD.mjs} +1 -1
  41. package/dist/gen-vhBDHs3q.mjs +1 -0
  42. package/dist/{github-cmd-DPmby8x-.mjs → github-cmd-BR19Ffdz.mjs} +2 -2
  43. package/dist/{help-9wfMyXHb.mjs → help-DvClCzqL.mjs} +9 -1
  44. package/dist/help-fKPzcTJv.mjs +1 -0
  45. package/dist/index.mjs +16 -206
  46. package/dist/{info-BWEWaOBo.mjs → info-P6MBiVJi.mjs} +2 -2
  47. package/dist/{init-BuTPVLPO.mjs → init-B2VZ2Hut.mjs} +63 -18
  48. package/dist/installed-packages-tfmYd-cC.mjs +198 -0
  49. package/dist/{link-BiesPyT4.mjs → link-Dyz9IGcM.mjs} +3 -3
  50. package/dist/{list-CkonftPQ.mjs → list-VGYBMjmx.mjs} +4 -4
  51. package/dist/login-BbSQTZ6d.mjs +1 -0
  52. package/dist/{login-BSOSah1j.mjs → login-jUBgfvzk.mjs} +3 -3
  53. package/dist/{logs-HOBUnroa.mjs → logs-kS1wuR4b.mjs} +3 -3
  54. package/dist/module-references-DWQmO6TW.mjs +27 -0
  55. package/dist/{mysql-sql-CB52k8tQ.mjs → mysql-lock-D8xtnI-D.mjs} +1 -118
  56. package/dist/mysql-sql-BIE7bc4Z.mjs +124 -0
  57. package/dist/{operator-ai-logging-ZDqqhnIq.mjs → operator-ai-logging-DD0n6zc2.mjs} +3 -3
  58. package/dist/{operator-args-DCkWbgT-.mjs → operator-args-nvetCWuz.mjs} +1 -1
  59. package/dist/{operator-auth-BjoPLgja.mjs → operator-auth-DMvn-y9X.mjs} +1 -1
  60. package/dist/{operator-client-DzebIntv.mjs → operator-client-dFNnXfyB.mjs} +4 -3
  61. package/dist/operator-cmd-jnjzuJKX.mjs +1 -0
  62. package/dist/{operator-cmd-AZoeI9Pl.mjs → operator-cmd-wML5HNfS.mjs} +13 -9
  63. package/dist/{operator-security-Bo26FP01.mjs → operator-security-D5MToU0p.mjs} +1 -1
  64. package/dist/pages/client.mjs +77 -9
  65. package/dist/pages/index.d.mts +6 -0
  66. package/dist/pages/index.mjs +276 -6
  67. package/dist/pages/protocol.mjs +1 -1
  68. package/dist/platform-args-CMwMoiLp.mjs +1 -0
  69. package/dist/{platform-args-lwCyQ6Xy.mjs → platform-args-CvZSuhYS.mjs} +1 -1
  70. package/dist/{platform-auth-config-DLRMPw1G.mjs → platform-auth-config-Bv3oQ2gE.mjs} +7 -7
  71. package/dist/{platform-auth-protection-HSmLmD3d.mjs → platform-auth-protection-OqzfhXwx.mjs} +5 -5
  72. package/dist/{platform-auth-recovery-BXPhTlKa.mjs → platform-auth-recovery-rmIYjXST.mjs} +4 -4
  73. package/dist/{platform-cmd-CqRjxFEU.mjs → platform-cmd-B3rO4RhU.mjs} +1 -1
  74. package/dist/{platform-cmd-DJ-fOYhL.mjs → platform-cmd-D_4z2Ijv.mjs} +6 -6
  75. package/dist/{platform-domain-CRsRJOws.mjs → platform-domain-CUq9odbd.mjs} +2 -2
  76. package/dist/{platform-lifecycle-bx_kpqo7.mjs → platform-lifecycle-DOSYo0UI.mjs} +1 -1
  77. package/dist/{platform-lifecycle-fau3VKv6.mjs → platform-lifecycle-DuoVruij.mjs} +138 -43
  78. package/dist/{platform-management-BRGhD-oF.mjs → platform-management-D_gt3qLb.mjs} +1 -1
  79. package/dist/{platform-management-CnKBdDx5.mjs → platform-management-MmO9IubR.mjs} +4 -4
  80. package/dist/{platform-plans-config-2C3_5EDs.mjs → platform-plans-config-DiydtNKY.mjs} +3 -3
  81. package/dist/{platform-recovery-poxgOOAY.mjs → platform-recovery-P_FVslfd.mjs} +2 -2
  82. package/dist/{platform-setup-DYylapHD.mjs → platform-setup-Lph9i-rh.mjs} +1 -1
  83. package/dist/{plugin-inference-7O11_E4H.mjs → plugin-inference-COlq96WJ.mjs} +2 -27
  84. package/dist/prepare-DcwigRUS.mjs +1 -0
  85. package/dist/{prepare-DWjn1Lzd.mjs → prepare-WvijE289.mjs} +1 -1
  86. package/dist/{prepare-BbvlKreR.mjs → prepare-co1o1FFd.mjs} +1 -1
  87. package/dist/{project-cmd-DyUEFi2b.mjs → project-cmd-BWJTplpc.mjs} +18 -18
  88. package/dist/{project-security-DZEQgnsS.mjs → project-security-BV1xfj1K.mjs} +1 -1
  89. package/dist/{project-security--tYGFPGo.mjs → project-security-CY_aahvW.mjs} +2 -2
  90. package/dist/{project-team-BszTHgzC.mjs → project-team-BlIFXlmT.mjs} +2 -2
  91. package/dist/{project-token-DBDy4NdV.mjs → project-token-CMsB7I1-.mjs} +2 -2
  92. package/dist/{project-zero-trust-D9sUouij.mjs → project-zero-trust-BI6pdpx4.mjs} +2 -2
  93. package/dist/{protocol-CE3wP-H1.mjs → protocol-4rEnumif.mjs} +10 -3
  94. package/dist/{redirect-DD825Stf.mjs → redirect-Dyvuil0Q.mjs} +5 -2
  95. package/dist/{requests-CBokjiOi.mjs → requests-CfmJxNYg.mjs} +2 -2
  96. package/dist/{rollback-CEeHNFUn.mjs → rollback-DL5HuAsM.mjs} +3 -3
  97. package/dist/{runner-mysql-3XDKrn-g.mjs → runner-mysql-D549vGGm.mjs} +2 -1
  98. package/dist/{runner-mysql-r688x6Y9.mjs → runner-mysql-DOjbj-N1.mjs} +1 -1
  99. package/dist/runtime/db/migrations/mysql-handler.mjs +2 -1
  100. package/dist/runtime/routing/index.mjs +2 -2
  101. package/dist/{secret-Deqo3n_N.mjs → secret-C-WBaUSS.mjs} +3 -3
  102. package/docs/guide/jobs.md +1 -1
  103. package/docs/guide/pages-routing/actions-and-forms.md +36 -15
  104. package/docs/guide/pages-routing/errors.md +3 -1
  105. package/docs/guide/pages-routing/overview.md +20 -0
  106. package/docs/guide/platform/administration/zero-trust.md +1 -1
  107. package/docs/guide/platform/installation/maintenance.md +5 -3
  108. package/docs/guide/queues.md +1 -1
  109. package/docs/integrations/frameworks/sveltekit.md +1 -1
  110. package/docs/reference/api/pages.md +4 -0
  111. package/docs/reference/cli/database.md +42 -6
  112. package/docs/reference/cli/platform-security.md +1 -1
  113. package/docs/reference/cli/platform-zero-trust.md +4 -3
  114. package/docs/reference/cli/setup.md +4 -0
  115. package/package.json +7 -7
  116. package/dist/cf-build-output-Dy7N0hQN.mjs +0 -1
  117. package/dist/cloudflare-operations-dpRD-2Px.mjs +0 -1
  118. package/dist/gen-CQDiPi8m.mjs +0 -1
  119. package/dist/help-Dy3w4rPq.mjs +0 -1
  120. package/dist/login-DWCZeCX9.mjs +0 -1
  121. package/dist/operator-cmd-DEnHFmJF.mjs +0 -1
  122. package/dist/platform-args-DNbNZ_RR.mjs +0 -1
  123. package/dist/prepare-BmG2E6TI.mjs +0 -1
@@ -0,0 +1,198 @@
1
+ import { a as join, n as dirname, o as normalize } from "./dist-DMYe8CZJ.mjs";
2
+ import { t as staticModuleReferences } from "./module-references-DWQmO6TW.mjs";
3
+ import module from "node:module";
4
+ import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
5
+ import { parseSync } from "vite";
6
+ // src/installed-packages.ts
7
+ function readManifest(dir) {
8
+ try {
9
+ return JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
10
+ } catch {
11
+ return;
12
+ }
13
+ }
14
+ /** The directory Node loads `name` from for code in `fromDir`. Ignores `exports`. */
15
+ function findInstalledPackage(name, fromDir) {
16
+ const pnp = module.findPnpApi?.(fromDir);
17
+ if (pnp) try {
18
+ const manifest = pnp.resolveToUnqualified(`${name}/package.json`, `${fromDir}/`);
19
+ return manifest ? dirname(manifest) : void 0;
20
+ } catch {
21
+ return;
22
+ }
23
+ for (let dir = fromDir;; dir = dirname(dir)) {
24
+ const candidate = join(dir, "node_modules", name);
25
+ if (existsSync(join(candidate, "package.json"))) return realpathSync(candidate);
26
+ if (dirname(dir) === dir) return;
27
+ }
28
+ }
29
+ function isVoidPackage(name) {
30
+ return name === "void" || name.startsWith("@void/");
31
+ }
32
+ /** The `exports` conditions that an import matches in Vite's SSR graph. */
33
+ const IMPORT_CONDITIONS = /* @__PURE__ */ new Set([
34
+ "node",
35
+ "import",
36
+ "module",
37
+ "default"
38
+ ]);
39
+ /**
40
+ * Vite's SSR graph also matches `production` or `development`, as NODE_ENV says. Vite sets
41
+ * NODE_ENV before it runs the plugin hooks that call this.
42
+ */
43
+ function matchesImport(condition) {
44
+ const mode = process.env.NODE_ENV === "production" ? "production" : "development";
45
+ return IMPORT_CONDITIONS.has(condition) || condition === mode;
46
+ }
47
+ /** The target an import picks from an `exports` value: its first matching key, as in Node. */
48
+ function importTarget(value) {
49
+ if (typeof value === "string") return value;
50
+ if (Array.isArray(value)) {
51
+ for (const item of value) {
52
+ const target = importTarget(item);
53
+ if (target) return target;
54
+ }
55
+ return;
56
+ }
57
+ if (!value || typeof value !== "object") return;
58
+ for (const [key, item] of Object.entries(value)) {
59
+ const target = matchesImport(key) ? importTarget(item) : void 0;
60
+ if (target) return target;
61
+ }
62
+ }
63
+ function isFile(path) {
64
+ try {
65
+ return statSync(path).isFile();
66
+ } catch {
67
+ return false;
68
+ }
69
+ }
70
+ /** The file an import of the package loads: `exports` ".", then `module`, then `main`. */
71
+ function findImportEntry(dir, manifest) {
72
+ const exports = manifest.exports;
73
+ const entry = importTarget(exports && typeof exports === "object" && Object.keys(exports).some((key) => key.startsWith(".")) ? exports["."] : exports) ?? (typeof manifest.module === "string" ? manifest.module : void 0) ?? (typeof manifest.main === "string" ? manifest.main : "index.js");
74
+ for (const candidate of [
75
+ entry,
76
+ `${entry}.js`,
77
+ `${entry}/index.js`
78
+ ]) {
79
+ const file = join(dir, candidate);
80
+ if (isFile(file)) return file;
81
+ }
82
+ }
83
+ /** Whether Node loads a `.mjs` or `.js` file in the package as an ES module. */
84
+ function isEsmFile(file, dir, manifest) {
85
+ if (file.endsWith(".mjs")) return true;
86
+ if (!file.endsWith(".js")) return false;
87
+ for (let scope = dirname(file); scope.startsWith(`${dir}/`); scope = dirname(scope)) {
88
+ const nested = readManifest(scope);
89
+ if (nested) return nested.type === "module";
90
+ }
91
+ return manifest.type === "module";
92
+ }
93
+ /** A dynamic `import()` argument that is a single string literal naming a relative file. */
94
+ const RELATIVE_LITERAL = /^(["'])(\.{1,2}\/[^"']*)\1$/;
95
+ /** The relative files that a module's imports, re-exports and `import()` calls name. */
96
+ function relativeImports(code, parsed) {
97
+ const specifiers = staticModuleReferences(parsed, code).map((reference) => reference.source);
98
+ for (const { moduleRequest } of parsed.module.dynamicImports) {
99
+ const literal = RELATIVE_LITERAL.exec(code.slice(moduleRequest.start, moduleRequest.end));
100
+ if (literal) specifiers.push(literal[2]);
101
+ }
102
+ return specifiers.filter((specifier) => /^\.{1,2}\//.test(specifier));
103
+ }
104
+ /** The most files of one package that the check reads. A package with more stays with Node. */
105
+ const MAX_PACKAGE_MODULES = 2e3;
106
+ /**
107
+ * Vite's SSR module runner evaluates an inlined package as ES modules. The package's import
108
+ * entry and every file it reaches through relative imports must be one. So the ES module
109
+ * wrapper in Node's dual-package guide, or any ES module of the package that imports a
110
+ * CommonJS file, keeps the package with Node.
111
+ */
112
+ function shipsEsm(packageDir, manifest) {
113
+ const dir = normalize(packageDir);
114
+ const entry = findImportEntry(dir, manifest);
115
+ if (!entry) return false;
116
+ const files = [entry];
117
+ const seen = new Set(files);
118
+ for (const file of files) {
119
+ if (!isEsmFile(file, dir, manifest)) return false;
120
+ let code;
121
+ try {
122
+ code = readFileSync(file, "utf8");
123
+ } catch {
124
+ return false;
125
+ }
126
+ const parsed = parseSync(file, code, {
127
+ lang: "js",
128
+ sourceType: "module"
129
+ });
130
+ if (parsed.errors.length > 0) return false;
131
+ for (const specifier of relativeImports(code, parsed)) {
132
+ const next = join(dirname(file), specifier);
133
+ if (/\.[cm]?js$/.test(next) && !seen.has(next)) {
134
+ if (seen.size >= MAX_PACKAGE_MODULES) return false;
135
+ seen.add(next);
136
+ files.push(next);
137
+ }
138
+ }
139
+ }
140
+ return true;
141
+ }
142
+ /**
143
+ * Installed ES module packages that list `void` or an `@void/` package as a dependency, among
144
+ * the app's own dependencies and, through them, the packages they depend on (the rule
145
+ * vite-plugin-svelte applies to Svelte libraries). Vite leaves a package in node_modules to Node,
146
+ * whose `void/*` imports then skip Void's plugins: the generated `void/db` and the Node target's
147
+ * guard. Listing these packages in `ssr.noExternal` keeps them in Vite's graph.
148
+ */
149
+ function findVoidDependentPackages(root) {
150
+ const app = readManifest(root);
151
+ if (!app) return [];
152
+ const found = /* @__PURE__ */ new Set();
153
+ const seen = /* @__PURE__ */ new Set();
154
+ const visit = (names, fromDir) => {
155
+ for (const name of names) {
156
+ if (isVoidPackage(name)) continue;
157
+ const dir = findInstalledPackage(name, fromDir);
158
+ if (!dir || seen.has(dir)) continue;
159
+ seen.add(dir);
160
+ const manifest = readManifest(dir);
161
+ const dependencies = {
162
+ ...manifest?.dependencies,
163
+ ...manifest?.optionalDependencies
164
+ };
165
+ if (!manifest || !Object.keys({
166
+ ...dependencies,
167
+ ...manifest.peerDependencies
168
+ }).some(isVoidPackage) || !shipsEsm(dir, manifest)) continue;
169
+ found.add(name);
170
+ visit(Object.keys(dependencies), dir);
171
+ }
172
+ };
173
+ visit(Object.keys({
174
+ ...app.dependencies,
175
+ ...app.devDependencies,
176
+ ...app.optionalDependencies
177
+ }), root);
178
+ return [...found].sort();
179
+ }
180
+ /** `name` and every package it depends on, as installed for code in `fromDir`. */
181
+ function findDependencyClosure(name, fromDir) {
182
+ const found = /* @__PURE__ */ new Set();
183
+ const seen = /* @__PURE__ */ new Set();
184
+ const visit = (dependency, from) => {
185
+ const dir = findInstalledPackage(dependency, from);
186
+ if (!dir || seen.has(dir)) return;
187
+ seen.add(dir);
188
+ found.add(dependency);
189
+ const manifest = readManifest(dir);
190
+ for (const next of Object.keys({
191
+ ...manifest?.dependencies,
192
+ ...manifest?.optionalDependencies
193
+ })) visit(next, dir);
194
+ };
195
+ visit(name, fromDir);
196
+ return [...found].sort();
197
+ }
198
+ export { findInstalledPackage as n, findVoidDependentPackages as r, findDependencyClosure as t };
@@ -1,7 +1,7 @@
1
1
  import { H as outro, L as log, O as cancel } from "./dist-Cr_xGE_K.mjs";
2
- import { c as getToken, s as getSiteDomain } from "./auth-DlLDymuc.mjs";
3
- import { r as PlatformClient } from "./client-ImIe7Mjq.mjs";
4
- import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-CY7sP8sI.mjs";
2
+ import { c as getToken, s as getSiteDomain } from "./auth-CqwJwItO.mjs";
3
+ import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
+ import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-8FdN6D2i.mjs";
5
5
  import { h as import_picocolors, y as printSuccess } from "./output-BZLnu0z8.mjs";
6
6
  import { r as readProjectConfig, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-dh9431bN.mjs";
7
7
  import { a as resolveProjectBySlug } from "./resolve-project-8WZ3iVmr.mjs";
@@ -1,7 +1,7 @@
1
1
  import { H as outro, L as log } from "./dist-Cr_xGE_K.mjs";
2
- import { c as getToken } from "./auth-DlLDymuc.mjs";
3
- import { r as PlatformClient } from "./client-ImIe7Mjq.mjs";
4
- import { r as readSecurityStatusQuietly, t as formatProjectStatusSecurityLine } from "./deploy-security-notice-C3LalelR.mjs";
2
+ import { c as getToken } from "./auth-CqwJwItO.mjs";
3
+ import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
+ import { r as readSecurityStatusQuietly, t as formatProjectStatusSecurityLine } from "./deploy-security-notice-IRGy6Edf.mjs";
5
5
  import { S as tablePrefix, b as sanitizeTerminalText, c as formatCount, d as formatRelativeTime, h as import_picocolors, o as dim } from "./output-BZLnu0z8.mjs";
6
6
  import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-dh9431bN.mjs";
7
7
  import { a as resolveProjectBySlug } from "./resolve-project-8WZ3iVmr.mjs";
@@ -43,7 +43,7 @@ async function runListCommand(root, slug) {
43
43
  }
44
44
  async function showCloudflareDeployments(root, slug) {
45
45
  if (slug) throw new Error("project: A project name selects a Void platform project and is not used for direct Cloudflare apps.");
46
- const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-dpRD-2Px.mjs");
46
+ const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-ByjFGats.mjs");
47
47
  const status = await readCloudflareWorkerStatus(resolveCloudflareOperationContext(root));
48
48
  if (status.versions.length === 0) {
49
49
  outro(`No deployments for ${status.workerName}.`);
@@ -0,0 +1 @@
1
+ export { r as selectPlatformLoginMethod } from "./login-jUBgfvzk.mjs";
@@ -1,6 +1,6 @@
1
1
  import { H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./dist-Cr_xGE_K.mjs";
2
- import { a as getApiUrl, c as getToken, f as removeToken, l as getTokenSource, m as savePlatformToken, p as runPlatformLogin } from "./auth-DlLDymuc.mjs";
3
- import { a as isExpiredTokenError, r as PlatformClient } from "./client-ImIe7Mjq.mjs";
2
+ import { a as getApiUrl, c as getToken, f as removeToken, l as getTokenSource, m as savePlatformToken, p as runPlatformLogin } from "./auth-CqwJwItO.mjs";
3
+ import { a as isExpiredTokenError, r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
4
  import { a as createSpinner, f as formatUrl, h as import_picocolors, y as printSuccess } from "./output-BZLnu0z8.mjs";
5
5
  // src/cli/login.ts
6
6
  async function selectPlatformLoginMethod(platform, requestedId) {
@@ -32,7 +32,7 @@ async function selectPlatformLoginMethod(platform, requestedId) {
32
32
  }
33
33
  async function promptForLoginToken(root = process.cwd(), platform) {
34
34
  const apiUrl = platform?.apiUrl ?? getApiUrl(root);
35
- const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await (await import("./platform-cmd-CqRjxFEU.mjs")).discoverPlatform(apiUrl));
35
+ const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await (await import("./platform-cmd-B3rO4RhU.mjs")).discoverPlatform(apiUrl));
36
36
  const s = createSpinner();
37
37
  s.start(`Opening browser for ${providerName} login...`);
38
38
  try {
@@ -1,6 +1,6 @@
1
1
  import { $ as wrapTextWithPrefix, H as outro, L as log } from "./dist-Cr_xGE_K.mjs";
2
- import { c as getToken } from "./auth-DlLDymuc.mjs";
3
- import { r as PlatformClient } from "./client-ImIe7Mjq.mjs";
2
+ import { c as getToken } from "./auth-CqwJwItO.mjs";
3
+ import { r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
4
  import { c as formatCount, h as import_picocolors, o as dim, s as errorStackFrames } from "./output-BZLnu0z8.mjs";
5
5
  import { t as MINIMAL_RUNTIME_LOGS_NOTE } from "./platform-runtime-logs-CdJGnk3f.mjs";
6
6
  import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-dh9431bN.mjs";
@@ -10,7 +10,7 @@ async function runLogsCommand(root, filter, range, deployment, level) {
10
10
  console.log();
11
11
  const platform = readDeploymentPlatform(root);
12
12
  if (platform === "cloudflare") {
13
- const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-dpRD-2Px.mjs");
13
+ const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-ByjFGats.mjs");
14
14
  if (range !== "1h") log.warn("Cloudflare tail streams live logs; --range does not select historical entries.");
15
15
  if (level && level !== "all" && level !== "error") log.warn("Cloudflare tail cannot filter individual console levels; showing all invocation logs.");
16
16
  await tailCloudflareWorker(resolveCloudflareOperationContext(root), {
@@ -0,0 +1,27 @@
1
+ // src/shared/module-references.ts
2
+ /** Runtime imports and re-exports, in source order, including empty export lists. */
3
+ function staticModuleReferences(parsed, code) {
4
+ const { staticImports, staticExports } = parsed.module;
5
+ if (!(/\bexport\s*(?:\/|\{\s*(?:\}|\/))/.test(code) || staticImports.some((item) => item.entries.length === 0 && code.slice(item.start, item.moduleRequest.start).trim() !== "import"))) return [...staticImports.filter((item) => item.entries.length === 0 || item.entries.some((entry) => !entry.isType)).map((item) => ({
6
+ source: item.moduleRequest.value,
7
+ start: item.start,
8
+ end: item.end
9
+ })), ...staticExports.flatMap((item) => {
10
+ const entry = item.entries.find((entry) => !entry.isType && entry.moduleRequest);
11
+ return entry?.moduleRequest ? [{
12
+ source: entry.moduleRequest.value,
13
+ start: item.start,
14
+ end: item.end
15
+ }] : [];
16
+ })].sort((a, b) => a.start - b.start);
17
+ return parsed.program.body.flatMap((statement) => {
18
+ if (statement.type !== "ImportDeclaration" && statement.type !== "ExportNamedDeclaration" && statement.type !== "ExportAllDeclaration") return [];
19
+ if (!statement.source || "importKind" in statement && statement.importKind === "type" || "exportKind" in statement && statement.exportKind === "type" || "specifiers" in statement && statement.specifiers.length > 0 && statement.specifiers.every((specifier) => "importKind" in specifier && specifier.importKind === "type" || "exportKind" in specifier && specifier.exportKind === "type")) return [];
20
+ return [{
21
+ source: statement.source.value,
22
+ start: statement.start,
23
+ end: statement.end
24
+ }];
25
+ });
26
+ }
27
+ export { staticModuleReferences as t };
@@ -1,4 +1,3 @@
1
- import { n as splitMigrationSql } from "./d1-handler-C1LH2K2s.mjs";
2
1
  import { isRecord } from "@void/deploy-core";
3
2
  import { createHash, randomUUID } from "node:crypto";
4
3
  // src/runtime/db/migrations/mysql-lock.ts
@@ -143,120 +142,4 @@ function affectedRows(result) {
143
142
  function isMissingTable(error) {
144
143
  return isRecord(error) && (error.code === "ER_NO_SUCH_TABLE" || error.errno === 1146);
145
144
  }
146
- // src/runtime/db/migrations/mysql-sql.ts
147
- /**
148
- * Splits a MySQL migration file into the statements Void runs one query at a time. Hyperdrive
149
- * does not accept several statements in one query, and a file that runs statement by statement
150
- * can tell whether a failure left earlier statements committed.
151
- *
152
- * The file first splits at drizzle-kit `--> statement-breakpoint` lines. Each part then splits at
153
- * semicolons outside strings, quoted names and comments, and drops comments after its last
154
- * statement. A statement that defines a trigger, routine or event keeps the rest of its part with
155
- * it: the semicolons in its BEGIN ... END body cannot be told apart from the ones between
156
- * statements without a parser.
157
- */
158
- function splitMySqlMigrationSql(sql) {
159
- return splitMySqlMigrationStatements(sql).map((statement) => statement.sql);
160
- }
161
- /** {@link splitMySqlMigrationSql}, with each statement marked. */
162
- function splitMySqlMigrationStatements(sql) {
163
- return splitMigrationSql(sql).flatMap((part) => {
164
- const statements = splitMySqlStatements(part);
165
- return statements.length > 0 ? statements : [{
166
- sql: part,
167
- program: false
168
- }];
169
- });
170
- }
171
- /**
172
- * The start of a statement whose body can hold semicolons: a stored program, after options such
173
- * as DEFINER, or a compound statement that MariaDB also runs outside one. It is matched against
174
- * the statement with quoted text and comments blanked out, so a column named `event` or a plain
175
- * `BEGIN` transaction does not match.
176
- */
177
- const COMPOUND_START = new RegExp([
178
- `^\\s*(?:CREATE|ALTER)\\s+(?:(?!(?:TABLE|INDEX|VIEW|DATABASE|SCHEMA|USER|ROLE|TABLESPACE|SERVER|UNIQUE|FULLTEXT|SPATIAL|TEMPORARY)\\b)\\S+\\s+){0,8}?(?:TRIGGER|PROCEDURE|FUNCTION|EVENT|PACKAGE)\\b`,
179
- String.raw`^\s*BEGIN\s+NOT\s+ATOMIC\b`,
180
- String.raw`^\s*(?:\w+\s*:\s*)?(?:BEGIN|IF|CASE|LOOP|REPEAT|WHILE)\b(?!\s*(?:WORK\s*)?$)`
181
- ].join("|"), "i");
182
- /** The statements in `sql`, without the comments around them. */
183
- function splitMySqlStatements(sql) {
184
- const statements = [];
185
- let bare = "";
186
- let start = -1;
187
- let end = -1;
188
- let compound = false;
189
- let index = 0;
190
- const take = (from, to) => {
191
- if (start === -1) start = from;
192
- end = to;
193
- };
194
- while (index < sql.length) {
195
- const character = sql[index];
196
- const next = sql[index + 1];
197
- if (character === "'" || character === "\"" || character === "`") {
198
- const close = skipQuoted(sql, index, character);
199
- take(index, close);
200
- bare += " ";
201
- index = close;
202
- continue;
203
- }
204
- if (character === "#" || character === "-" && next === "-" && !/\S/.test(sql[index + 2] ?? " ")) {
205
- const newline = sql.indexOf("\n", index);
206
- index = newline === -1 ? sql.length : newline;
207
- bare += " ";
208
- continue;
209
- }
210
- if (character === "/" && next === "*") {
211
- const close = sql.indexOf("*/", index + 2);
212
- const commentEnd = close === -1 ? sql.length : close + 2;
213
- if (sql[index + 2] === "!" || sql[index + 2] === "+") take(index, commentEnd);
214
- bare += " ";
215
- index = commentEnd;
216
- continue;
217
- }
218
- if (character === ";" && !compound) {
219
- if (start !== -1 && COMPOUND_START.test(bare)) compound = true;
220
- else {
221
- if (start !== -1) statements.push({
222
- sql: sql.slice(start, index + 1),
223
- program: false
224
- });
225
- start = -1;
226
- end = -1;
227
- bare = "";
228
- index++;
229
- continue;
230
- }
231
- }
232
- bare += character;
233
- if (!/\s/.test(character)) take(index, index + 1);
234
- index++;
235
- }
236
- if (start !== -1) statements.push({
237
- sql: sql.slice(start, end),
238
- program: compound
239
- });
240
- return statements;
241
- }
242
- /** The index after the quoted string or name that opens at `open`. */
243
- function skipQuoted(sql, open, quote) {
244
- let index = open + 1;
245
- while (index < sql.length) {
246
- const character = sql[index];
247
- if (character === "\\" && quote !== "`") {
248
- index += 2;
249
- continue;
250
- }
251
- if (character === quote) {
252
- if (sql[index + 1] === quote) {
253
- index += 2;
254
- continue;
255
- }
256
- return index + 1;
257
- }
258
- index++;
259
- }
260
- return sql.length;
261
- }
262
- export { mySqlMigrationLockError as a, holdMySqlMigrationLease as i, splitMySqlMigrationStatements as n, mySqlMigrationLockName as o, acquireMySqlMigrationLease as r, readMySqlMigrationLease as s, splitMySqlMigrationSql as t };
145
+ export { readMySqlMigrationLease as a, mySqlMigrationLockName as i, holdMySqlMigrationLease as n, mySqlMigrationLockError as r, acquireMySqlMigrationLease as t };
@@ -0,0 +1,124 @@
1
+ import { n as splitMigrationSql } from "./d1-handler-C1LH2K2s.mjs";
2
+ // src/runtime/db/migrations/mysql-sql.ts
3
+ /**
4
+ * Splits a MySQL migration file into the statements Void runs one query at a time. Hyperdrive
5
+ * does not accept several statements in one query, and a file that runs statement by statement
6
+ * can tell whether a failure left earlier statements committed.
7
+ *
8
+ * The file first splits at drizzle-kit `--> statement-breakpoint` lines. Each part then splits at
9
+ * semicolons outside strings, quoted names and comments, and drops comments after its last
10
+ * statement. A statement that defines a trigger, routine or event keeps the rest of its part with
11
+ * it: the semicolons in its BEGIN ... END body cannot be told apart from the ones between
12
+ * statements without a parser.
13
+ */
14
+ function splitMySqlMigrationSql(sql) {
15
+ return splitMySqlMigrationStatements(sql).map((statement) => statement.sql);
16
+ }
17
+ /** {@link splitMySqlMigrationSql}, with each statement marked. */
18
+ function splitMySqlMigrationStatements(sql) {
19
+ return splitMigrationSql(sql).flatMap((part) => {
20
+ const statements = splitMySqlStatements(part);
21
+ return statements.length > 0 ? statements : [{
22
+ sql: part,
23
+ program: false
24
+ }];
25
+ });
26
+ }
27
+ /**
28
+ * The start of a statement whose body can hold semicolons: a stored program, after options such
29
+ * as DEFINER, or a compound statement that MariaDB also runs outside one. It is matched against
30
+ * the statement with quoted text and comments blanked out, so a column named `event` or a plain
31
+ * `BEGIN` transaction does not match.
32
+ */
33
+ const COMPOUND_START = new RegExp([
34
+ `^\\s*(?:CREATE|ALTER)\\s+(?:(?!(?:TABLE|INDEX|VIEW|DATABASE|SCHEMA|USER|ROLE|TABLESPACE|SERVER|UNIQUE|FULLTEXT|SPATIAL|TEMPORARY)\\b)\\S+\\s+){0,8}?(?:TRIGGER|PROCEDURE|FUNCTION|EVENT|PACKAGE)\\b`,
35
+ String.raw`^\s*BEGIN\s+NOT\s+ATOMIC\b`,
36
+ String.raw`^\s*(?:\w+\s*:\s*)?(?:BEGIN|IF|CASE|LOOP|REPEAT|WHILE)\b(?!\s*(?:WORK\s*)?$)`
37
+ ].join("|"), "i");
38
+ /** The statements in `sql`, without the comments around them. */
39
+ function splitMySqlStatements(sql) {
40
+ const statements = [];
41
+ let bare = "";
42
+ let start = -1;
43
+ let end = -1;
44
+ let compound = false;
45
+ let index = 0;
46
+ const take = (from, to) => {
47
+ if (start === -1) start = from;
48
+ end = to;
49
+ };
50
+ while (index < sql.length) {
51
+ const character = sql[index];
52
+ const next = sql[index + 1];
53
+ if (character === "'" || character === "\"" || character === "`") {
54
+ const close = skipMySqlQuoted(sql, index, character);
55
+ take(index, close);
56
+ bare += " ";
57
+ index = close;
58
+ continue;
59
+ }
60
+ if (character === "#" || character === "-" && next === "-" && !/\S/.test(sql[index + 2] ?? " ")) {
61
+ const newline = sql.indexOf("\n", index);
62
+ index = newline === -1 ? sql.length : newline;
63
+ bare += " ";
64
+ continue;
65
+ }
66
+ if (character === "/" && next === "*") {
67
+ const close = sql.indexOf("*/", index + 2);
68
+ const commentEnd = close === -1 ? sql.length : close + 2;
69
+ if (sql[index + 2] === "!" || sql[index + 2] === "+") take(index, commentEnd);
70
+ bare += " ";
71
+ index = commentEnd;
72
+ continue;
73
+ }
74
+ if (character === ";" && !compound) {
75
+ if (start !== -1 && COMPOUND_START.test(bare)) compound = true;
76
+ else {
77
+ if (start !== -1) statements.push({
78
+ sql: sql.slice(start, index + 1),
79
+ program: false
80
+ });
81
+ start = -1;
82
+ end = -1;
83
+ bare = "";
84
+ index++;
85
+ continue;
86
+ }
87
+ }
88
+ bare += character;
89
+ if (!/\s/.test(character)) take(index, index + 1);
90
+ index++;
91
+ }
92
+ if (start !== -1) statements.push({
93
+ sql: sql.slice(start, end),
94
+ program: compound
95
+ });
96
+ return statements;
97
+ }
98
+ /**
99
+ * The index after the quoted string or name that opens at `open`. Pass `backslashEscapes: false`
100
+ * for a server in `NO_BACKSLASH_ESCAPES` mode, where a backslash is an ordinary character.
101
+ */
102
+ function skipMySqlQuoted(sql, open, quote, backslashEscapes = true) {
103
+ return closeMySqlQuoted(sql, open, quote, backslashEscapes) ?? sql.length;
104
+ }
105
+ /** Like `skipMySqlQuoted`, but `undefined` when the quote is still open at the end of the SQL. */
106
+ function closeMySqlQuoted(sql, open, quote, backslashEscapes = true) {
107
+ let index = open + 1;
108
+ while (index < sql.length) {
109
+ const character = sql[index];
110
+ if (character === "\\" && quote !== "`" && backslashEscapes) {
111
+ index += 2;
112
+ continue;
113
+ }
114
+ if (character === quote) {
115
+ if (sql[index + 1] === quote) {
116
+ index += 2;
117
+ continue;
118
+ }
119
+ return index + 1;
120
+ }
121
+ index++;
122
+ }
123
+ }
124
+ export { splitMySqlMigrationSql as n, splitMySqlMigrationStatements as r, closeMySqlQuoted as t };
@@ -1,7 +1,7 @@
1
1
  import { t as cfAccessHeaders } from "./cf-access-DmkKPcAI.mjs";
2
2
  import { t as hasOwnKey } from "./has-own-key-D9QEnAkF.mjs";
3
- import { t as ensurePlatformAccessToken } from "./cf-access-FaIm95jA.mjs";
4
- import { r as OperatorClientError } from "./operator-client-DzebIntv.mjs";
3
+ import { t as ensurePlatformAccessToken } from "./cf-access-DHklo7Rg.mjs";
4
+ import { r as OperatorClientError } from "./operator-client-dFNnXfyB.mjs";
5
5
  import { b as sanitizeTerminalText } from "./output-BZLnu0z8.mjs";
6
6
  import { n as readPlatformDiscoveryResponse } from "./platform-discovery-CLxtixHJ.mjs";
7
7
  import { AI_LOGGING_SETTLE_MS } from "@void/platform/ai-logging";
@@ -114,7 +114,7 @@ async function assertAiLoggingPlatform(origin) {
114
114
  const probe = await probePlatformVersion(origin);
115
115
  if (probe.kind === "unknown") return;
116
116
  if (probe.kind === "version") {
117
- const { isOlderPlatformVersion } = await import("./client-DkYzDEC0.mjs");
117
+ const { isOlderPlatformVersion } = await import("./client-eLZwqkPH.mjs");
118
118
  if (isOlderPlatformVersion(probe.version, "1.8.0") !== true) return;
119
119
  }
120
120
  throw new OperatorClientError("This platform does not support AI logging policies. Run `void platform upgrade`.", "unsupported");
@@ -1,4 +1,4 @@
1
- import { t as OPERATOR_MAX_TIMEOUT_MS } from "./operator-client-DzebIntv.mjs";
1
+ import { t as OPERATOR_MAX_TIMEOUT_MS } from "./operator-client-dFNnXfyB.mjs";
2
2
  import { t as hasOwnKey } from "./has-own-key-D9QEnAkF.mjs";
3
3
  import { parsePlatformLoginId } from "@void/platform";
4
4
  import { parseSecurityDigits } from "@void/platform/security-policy";
@@ -1,5 +1,5 @@
1
1
  import { C as deleteKeyringPassword, T as writeKeyringPassword, c as normalizePlatformApiUrl, i as getActivePlatformConnection, r as findPlatformConnections, u as platformCredentialAccount, w as readKeyringPassword } from "./platform-registry-DHH6fivm.mjs";
2
- import { n as OperatorClient, r as OperatorClientError } from "./operator-client-DzebIntv.mjs";
2
+ import { n as OperatorClient, r as OperatorClientError } from "./operator-client-dFNnXfyB.mjs";
3
3
  /** Operator authority never comes from repository-controlled metadata. */
4
4
  function resolveOperatorOrigin(connection = "") {
5
5
  if (connection) {
@@ -1,5 +1,5 @@
1
1
  import { t as cfAccessHeaders } from "./cf-access-DmkKPcAI.mjs";
2
- import { t as ensurePlatformAccessToken } from "./cf-access-FaIm95jA.mjs";
2
+ import { t as ensurePlatformAccessToken } from "./cf-access-DHklo7Rg.mjs";
3
3
  import { c as normalizePlatformApiUrl } from "./platform-registry-DHH6fivm.mjs";
4
4
  const OPERATOR_MAX_TIMEOUT_MS = 36e5;
5
5
  var OperatorClientError = class extends Error {
@@ -59,8 +59,9 @@ var OperatorClient = class {
59
59
  });
60
60
  } catch (error) {
61
61
  if (options.signal?.aborted) throw error;
62
- if (timeoutController.signal.aborted) throw new OperatorClientError(`Operator request exceeded the ${timeoutMs / 1e3}-second timeout. ${options.method === "POST" ? "Its outcome may be unknown; inspect platform state before retrying." : "Check connectivity and try again."}`, "request_timeout");
63
- throw new OperatorClientError(`Operator request to ${this.origin} failed. ${options.method === "POST" ? "Its outcome may be unknown; inspect platform state before retrying." : "Check connectivity and try again."}`, "connection_failed");
62
+ const next = options.method === "POST" ? options.unknownOutcome ?? "Its outcome may be unknown; inspect platform state before retrying." : "Check connectivity and try again.";
63
+ if (timeoutController.signal.aborted) throw new OperatorClientError(`Operator request exceeded the ${timeoutMs / 1e3}-second timeout. ${next}`, "request_timeout");
64
+ throw new OperatorClientError(`Operator request to ${this.origin} failed. ${next}`, "connection_failed");
64
65
  }
65
66
  if (response.status >= 300 && response.status < 400) throw new OperatorClientError("The operator API redirected the request. Credentials were not forwarded; use the exact platform API origin.", "redirect_rejected", response.status);
66
67
  let data;
@@ -0,0 +1 @@
1
+ export { s as runOperatorCommand } from "./operator-cmd-wML5HNfS.mjs";