void 0.10.10 → 0.10.12

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 (109) hide show
  1. package/AGENT_PROMPT.md +4 -0
  2. package/README.md +1 -1
  3. package/dist/{agents-Bmr5tFFb.mjs → agents-CtgBYqld.mjs} +1 -1
  4. package/dist/{auth-cmd-Cw1edJdZ.mjs → auth-cmd-BqsdZJp5.mjs} +3 -3
  5. package/dist/{better-auth-shared-BvnM9px6.d.mts → better-auth-shared-DealXecJ.d.mts} +1 -1
  6. package/dist/{build-cmd-C6kNDJBv.mjs → build-cmd-Bujrv5q-.mjs} +3 -3
  7. package/dist/{cache-DIUSnIjJ.mjs → cache-C11V8Fxq.mjs} +3 -3
  8. package/dist/{cancel-deploy-BosnzEHC.mjs → cancel-deploy-fwFYF04b.mjs} +2 -2
  9. package/dist/cli/cli.mjs +124 -41
  10. package/dist/cli/env-schema-probe.d.mts +96 -0
  11. package/dist/cli/env-schema-probe.mjs +272 -0
  12. package/dist/{client-C9FG6Vzc.mjs → client-Gb71-XkG.mjs} +12 -2
  13. package/dist/{config-BcAeIPe3.mjs → config-BkTvs43g.mjs} +15 -2
  14. package/dist/{config-BdUctCZD.mjs → config-CutEMNGJ.mjs} +3 -3
  15. package/dist/{create-project-CjYX23M_.mjs → create-project-DsYvl3TB.mjs} +3 -3
  16. package/dist/{db-BvKV34IK.mjs → db-DOiJMRt2.mjs} +27 -27
  17. package/dist/{delete-CThKLXfi.mjs → delete-mh6p-zkQ.mjs} +3 -3
  18. package/dist/deploy-u7Rv9q_q.mjs +7126 -0
  19. package/dist/{discover-BuVVSAum.mjs → discover-CJHyvYfR.mjs} +2 -2
  20. package/dist/dist-DaKKDf8D.mjs +41 -0
  21. package/dist/{domain-DMrBabBQ.mjs → domain-DiaNQbrl.mjs} +2 -2
  22. package/dist/entry-D7yy4xVH.mjs +100 -0
  23. package/dist/{env-BfG7O71F.mjs → env-CZy5MorI.mjs} +5 -5
  24. package/dist/env-mask-Dd47NbR6.mjs +90 -0
  25. package/dist/env-public-BfiLcMBk.d.mts +140 -0
  26. package/dist/{env-types-D51bnR-c.mjs → env-types-QBj-ndax.mjs} +2 -2
  27. package/dist/env-validation-Dea3v3ej.mjs +1069 -0
  28. package/dist/{gen-Bee261SV.mjs → gen-o_w-8yI8.mjs} +8 -8
  29. package/dist/{git-metadata-CBKaL0v5.mjs → git-metadata-D-gurjzG.mjs} +6 -5
  30. package/dist/{github-cmd-DfeFEasr.mjs → github-cmd-DKcGUNsj.mjs} +4 -4
  31. package/dist/{handler-imD0UVDT.d.mts → handler-Cjh8uM3Y.d.mts} +1 -1
  32. package/dist/{headers-CTAjX-UO.mjs → headers-nsHIFixA.mjs} +2 -2
  33. package/dist/index.d.mts +1 -1
  34. package/dist/index.mjs +98 -52
  35. package/dist/{init-xfwW7cLp.mjs → init-3rgHKBVi.mjs} +13 -14
  36. package/dist/{link-Co136MEs.mjs → link-CdGHSIy-.mjs} +4 -4
  37. package/dist/{list-BKDjA3M5.mjs → list-CPwFDZ_c.mjs} +3 -3
  38. package/dist/{login-CrOTnR_6.mjs → login-BT3H8PN3.mjs} +2 -2
  39. package/dist/{logs-DlAg25ww.mjs → logs-Bt313ax7.mjs} +3 -2
  40. package/dist/{mcp-BNjMGMB0.mjs → mcp-DoM3_nhd.mjs} +7 -2
  41. package/dist/{node-CnE-SZCk.mjs → node-Da0UcsGA.mjs} +5 -5
  42. package/dist/{package-json-B0NuUWGd.mjs → package-json-Cx1osYo6.mjs} +1 -1
  43. package/dist/pages/client.d.mts +1 -1
  44. package/dist/pages/index.d.mts +1 -23
  45. package/dist/pages/index.mjs +5 -5
  46. package/dist/pages/islands-plugin.mjs +2 -2
  47. package/dist/pages/protocol.d.mts +2 -2
  48. package/dist/{plugin-inference-CJxi_fWI.mjs → plugin-inference-DMeavIJ6.mjs} +4 -98
  49. package/dist/{prepare-BRyC4TCC.mjs → prepare-BoKHgMNx.mjs} +10 -10
  50. package/dist/preset-BjyR3lzz.mjs +592 -0
  51. package/dist/{project-cmd-B2bcKefD.mjs → project-cmd-D_w-4w5B.mjs} +13 -9
  52. package/dist/{project-paths-tpdR1mJR.mjs → project-paths-BQd7OmIo.mjs} +1 -1
  53. package/dist/project-paths-GpziKeQQ.d.mts +25 -0
  54. package/dist/{project-tsconfig-D9uSVVpA.mjs → project-tsconfig-B-QtXjLQ.mjs} +2 -2
  55. package/dist/{protocol-6hTJ04T1.d.mts → protocol-Bnb0LFp3.d.mts} +1 -1
  56. package/dist/provision-rShh6MKY.mjs +2557 -0
  57. package/dist/requests-B8sZxaFM.mjs +50 -0
  58. package/dist/{resolve-project-D2HI3TrG.mjs → resolve-project-BBMtLLV9.mjs} +1 -1
  59. package/dist/{rollback-9dfmB-YZ.mjs → rollback-CkvTFXx5.mjs} +2 -2
  60. package/dist/{route-types-CfKfhbIg.mjs → route-types-COI2DsZv.mjs} +2 -2
  61. package/dist/{runner-h272wcPj.mjs → runner-kapo9aPs.mjs} +3 -3
  62. package/dist/{runner-pg-waxJOnBb.mjs → runner-pg-CHM76xuC.mjs} +1 -1
  63. package/dist/runtime/better-auth-pg.d.mts +1 -1
  64. package/dist/runtime/better-auth.d.mts +1 -1
  65. package/dist/runtime/env-public.d.mts +1 -139
  66. package/dist/runtime/env-public.mjs +2 -90
  67. package/dist/runtime/handler.d.mts +1 -1
  68. package/dist/runtime/live.d.mts +1 -1
  69. package/dist/runtime/validator.d.mts +1 -1
  70. package/dist/runtime/ws-server.d.mts +1 -1
  71. package/dist/runtime/ws.d.mts +2 -2
  72. package/dist/{scan-Dp_Gyzs3.mjs → scan-DEwlM_Xy.mjs} +2 -2
  73. package/dist/{scan-i7Yz54fv.mjs → scan-DYXkrasO.mjs} +4 -4
  74. package/dist/{secret-DeMnMcV0.mjs → secret-Dt32J6RI.mjs} +3 -3
  75. package/dist/{skills-DsdNDtX3.mjs → skills-CLjN0uUO.mjs} +2 -2
  76. package/dist/{subcommand-prompt-DtES-oP6.mjs → subcommand-prompt-BzV8iQZo.mjs} +1 -1
  77. package/dist/sveltekit.mjs +1 -1
  78. package/dist/{validate-DT7nFMlf.mjs → validate-Cw_RLeTj.mjs} +1 -1
  79. package/dist/{yarn-pnp-CW8LB6g_.mjs → yarn-pnp-DJn3SAHF.mjs} +1 -1
  80. package/getting-started-prompt.txt +3 -1
  81. package/package.json +5 -3
  82. package/schema.json +5 -0
  83. package/skills/void/SKILL.md +34 -33
  84. package/skills/void/docs/guide/app-types.md +43 -0
  85. package/skills/void/docs/guide/auth.md +8 -0
  86. package/skills/void/docs/guide/deployment.md +1 -1
  87. package/skills/void/docs/guide/edge/static-assets.md +23 -0
  88. package/skills/void/docs/guide/env-vars.md +14 -6
  89. package/skills/void/docs/guide/queues.md +4 -0
  90. package/skills/void/docs/integrations/cloudflare.md +64 -5
  91. package/skills/void/docs/integrations/frameworks/overview.md +1 -0
  92. package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +4 -0
  93. package/skills/void/docs/node_modules/void/README.md +1 -1
  94. package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +51 -0
  95. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +64 -0
  96. package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +64 -0
  97. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +108 -0
  98. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +183 -0
  99. package/skills/void/docs/node_modules/void/skills/void/SKILL.md +34 -33
  100. package/skills/void/docs/node_modules/void/test/e2e/README.md +85 -0
  101. package/skills/void/docs/reference/cli.md +74 -14
  102. package/skills/void/docs/reference/config.md +27 -1
  103. package/dist/deploy-B02JyKP9.mjs +0 -3748
  104. package/dist/dotenv-D_UbC_vc.mjs +0 -173
  105. package/dist/env-validation-CeC2FL66.mjs +0 -163
  106. package/dist/pathe.M-eThtNZ-CQzLbt4c.mjs +0 -150
  107. package/dist/preset-CVvwCeIy.mjs +0 -208
  108. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +0 -73
  109. package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +0 -73
@@ -0,0 +1,272 @@
1
+ import { a as join } from "../dist-DaKKDf8D.mjs";
2
+ import { writeSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
+ import { spawnSync } from "node:child_process";
5
+ //#region src/cli/env-schema-probe.ts
6
+ /**
7
+ * The self-host `void deploy --backend cloudflare` orchestrator validates the REAL
8
+ * build artifact (`dist/ssr/wrangler.json` `vars`) instead of predicting it. Two
9
+ * pieces still need project code, and BOTH run here — in an ISOLATED SUBPROCESS —
10
+ * because the orchestrator runs in a credential-bearing PARENT (CF Access service
11
+ * token / `CLOUDFLARE_API_TOKEN` in `process.env`) and must NOT evaluate arbitrary
12
+ * project code in-process:
13
+ *
14
+ * 1. `facts` — the env-INSENSITIVE schema facts (required-secret NAMES + the
15
+ * `.secret()` flags), fixed by env.ts's structure. The child ALSO resolves the
16
+ * Vite config here purely to read the final `{ envDir, mode }` and reject a
17
+ * custom `envDir` or a non-`production` build mode (v1 supports neither): the
18
+ * build generates the auth artifact under the project root while the worker
19
+ * `vars` come from the build's `envDir`, so a custom `envDir` could validate a
20
+ * different table set than the worker ships. Resolving the config runs the full
21
+ * plugin pipeline (arbitrary code, timers/`beforeExit` risk) — safe HERE in the
22
+ * child (which `process.exit`s), never in the credentialed parent.
23
+ * 2. `validate-emitted` — validate the REAL emitted worker `vars` (post-build
24
+ * ground truth) against the schema's Standard-Schema validators and return the
25
+ * FAILING key NAMES only. A required var shipped with an INVALID value (fails
26
+ * the validator) must fail the deploy closed before any remote mutation, not
27
+ * only at worker boot.
28
+ *
29
+ * Three hardening rules apply to the child:
30
+ * - the framed result is written to a DEDICATED file descriptor (fd 3), NOT
31
+ * stdout, so anything the user's code prints while evaluating can never
32
+ * truncate or interleave with the result;
33
+ * - the caller scrubs the FULL wrangler-auth credential set from the child env
34
+ * (neither derivation needs credentials);
35
+ * - the parent NEVER captures the child's stdout/stderr — they are IGNORED
36
+ * (fds 1 + 2), never buffered — so a leaking env.ts / validator cannot print a
37
+ * raw secret to the terminal or CI log, and every failure surfaces as a stable
38
+ * classification only.
39
+ */
40
+ /** argv[2] sentinel that switches this module from library import to child-process entry. */
41
+ const PROBE_MARKER = "__void-deploy-env-schema-probe__";
42
+ /** The dedicated fd the child writes its framed result to (see stdio config below). */
43
+ const RESULT_FD = 3;
44
+ /**
45
+ * Default spawner: run THIS module as a child and read ONLY the dedicated fd-3
46
+ * result. stdin is ignored, stdout/stderr are IGNORED (fds 1 + 2) so a broken /
47
+ * leaking env.ts can never print a raw secret to the terminal or a captured CI log,
48
+ * and fd 3 is a pipe carrying the framed JSON result. `spawnSync`'s `output` array
49
+ * is indexed by fd, so `output[3]` is the result channel — isolated from stdout
50
+ * entirely (and unaffected by ignoring fds 1 + 2).
51
+ */
52
+ const defaultSpawn = (command, args, options) => {
53
+ const result = spawnSync(command, args, {
54
+ cwd: options.cwd,
55
+ env: options.env,
56
+ stdio: [
57
+ "ignore",
58
+ "ignore",
59
+ "ignore",
60
+ "pipe"
61
+ ],
62
+ encoding: "utf-8"
63
+ });
64
+ const fd3 = result.output?.[RESULT_FD];
65
+ return {
66
+ status: result.status,
67
+ fd3: typeof fd3 === "string" ? fd3 : fd3 == null ? null : String(fd3),
68
+ error: result.error ?? null,
69
+ signal: result.signal ?? null
70
+ };
71
+ };
72
+ /**
73
+ * Spawn THIS module as a child (`node <self> <marker> <json>`) under the scrubbed
74
+ * `env` for one operation, and return its framed fd-3 result. The child inherits
75
+ * ONLY `env` (the caller scrubs the full wrangler-auth credential set), so the
76
+ * arbitrary project code never sees the parent's credentials. `import.meta.url` is
77
+ * this module's own path — a named build entry (`dist/cli/env-schema-probe.mjs`),
78
+ * stable in source and dist — so the child re-enters here and hits the {@link
79
+ * PROBE_MARKER} branch. Throws (caller fails closed) on a spawn error, a signal-kill,
80
+ * a nonzero exit, or a missing/unparseable result — exactly the cases where the
81
+ * project code itself could not be evaluated. NEVER echoes the child's
82
+ * stdout/stderr (never captured), so no env value the child may have printed can
83
+ * reach the thrown error.
84
+ */
85
+ async function spawnEnvSchemaProbe(op, input, env, spawn) {
86
+ const childInput = {
87
+ op,
88
+ root: input.root
89
+ };
90
+ const self = fileURLToPath(import.meta.url);
91
+ const result = spawn(process.execPath, [
92
+ self,
93
+ PROBE_MARKER,
94
+ JSON.stringify(childInput)
95
+ ], {
96
+ cwd: input.root,
97
+ env
98
+ });
99
+ if (result.error) throw new Error(`could not spawn the env-schema probe: ${result.error.message}`);
100
+ if (result.signal) throw new Error(`the env-schema probe was killed by signal ${result.signal}`);
101
+ if (result.status !== 0) throw new Error(`the env-schema probe exited with code ${String(result.status)}.`);
102
+ const parsed = parseProbeResult(result.fd3 ?? "");
103
+ if (!parsed) throw new Error("the env-schema probe produced no parseable result.");
104
+ return parsed;
105
+ }
106
+ /**
107
+ * PARENT side (`facts`): return the env-insensitive schema facts + the v1 envDir/mode
108
+ * narrowing. Runs pre-build so a custom envDir / non-production mode / broken env.ts
109
+ * fails fast, before any account op.
110
+ */
111
+ async function resolveEnvSchemaFactsViaSubprocess(input, env, spawn = defaultSpawn) {
112
+ const result = await spawnEnvSchemaProbe("facts", input, env, spawn);
113
+ if (result.kind === "invalid-keys") throw new Error("the env-schema probe returned an unexpected result for the facts operation.");
114
+ return result;
115
+ }
116
+ /**
117
+ * PARENT side (`validate-emitted`): validate the REAL emitted worker `vars` against
118
+ * the schema validators and return the FAILING key NAMES only. Runs post-build so
119
+ * the values validated are exactly what the worker ships.
120
+ */
121
+ async function validateEmittedVarsViaSubprocess(input, env, spawn = defaultSpawn) {
122
+ const result = await spawnEnvSchemaProbe("validate-emitted", input, env, spawn);
123
+ if (result.kind === "ok" || result.kind === "reject") throw new Error("the env-schema probe returned an unexpected result for the validate-emitted operation.");
124
+ return result;
125
+ }
126
+ /**
127
+ * Parse the child's framed result from the DEDICATED fd-3 channel. The whole buffer
128
+ * is the JSON result (nothing else writes to fd 3), so no sentinel scan is needed —
129
+ * that is the truncation fix: config/env.ts stdout noise lives on a different fd and
130
+ * can never reach here. Returns undefined on a missing/unparseable/ill-shaped result
131
+ * so the caller fails closed.
132
+ */
133
+ function parseProbeResult(fd3) {
134
+ const trimmed = fd3.trim();
135
+ if (!trimmed) return;
136
+ let parsed;
137
+ try {
138
+ parsed = JSON.parse(trimmed);
139
+ } catch {
140
+ return;
141
+ }
142
+ if (!parsed || typeof parsed !== "object") return;
143
+ const record = parsed;
144
+ if (record.kind === "ok" && isSchemaFacts(record.facts)) return {
145
+ kind: "ok",
146
+ facts: record.facts
147
+ };
148
+ if (record.kind === "reject" && (record.reason === "custom-envdir" || record.reason === "non-production-mode")) return {
149
+ kind: "reject",
150
+ reason: record.reason
151
+ };
152
+ if (record.kind === "invalid-keys" && Array.isArray(record.invalidKeys) && record.invalidKeys.every((k) => typeof k === "string")) return {
153
+ kind: "invalid-keys",
154
+ invalidKeys: record.invalidKeys
155
+ };
156
+ if (record.kind === "schema-error" && (record.reason === "schema-load-failed" || record.reason === "schema-validation-error")) return {
157
+ kind: "schema-error",
158
+ reason: record.reason
159
+ };
160
+ }
161
+ /** Structural guard for the values-free facts the child returns. */
162
+ function isSchemaFacts(value) {
163
+ if (!value || typeof value !== "object") return false;
164
+ const f = value;
165
+ return typeof f.hasSchema === "boolean" && Array.isArray(f.requiredKeys) && f.requiredKeys.every((k) => typeof k === "string") && Array.isArray(f.secretKeys) && f.secretKeys.every((k) => typeof k === "string");
166
+ }
167
+ /** Write the framed result to the dedicated fd 3 (synchronous → flushed before exit). */
168
+ function emitResult(result) {
169
+ writeSync(RESULT_FD, JSON.stringify(result));
170
+ }
171
+ /**
172
+ * Read the RAW (root-relative, unnormalized) envDir the build's worker-vars loader
173
+ * actually uses, straight from the `void:env` config hook's captured value (exposed on
174
+ * that plugin's `api.getVoidDeployBuildConfig`). This is the only faithful input to the
175
+ * build's OWN `join(root, rawEnvDir)` computation: Vite's `resolved.envDir` is already
176
+ * normalized (`path.resolve`), which loses the distinction an absolute-root envDir needs.
177
+ * Returns `undefined` when the hook is absent (a non-void config), which the caller
178
+ * treats as "no custom raw envDir" and falls back to Vite's normalized view.
179
+ */
180
+ function readBuildRawEnvDir(plugins) {
181
+ return (plugins.find((p) => p.name === "void:env")?.api)?.getVoidDeployBuildConfig?.()?.envDir;
182
+ }
183
+ /**
184
+ * CHILD side (`facts`): resolve the Vite config HERE (the FULL plugin pipeline the
185
+ * real `vite build` runs, under the scrubbed env — never in the parent) purely to
186
+ * read the effective `{ envDir, mode }` and reject a custom envDir / non-production
187
+ * mode; then, when accepted, import the user's env.ts and derive the env-insensitive
188
+ * schema facts. All heavy imports are DYNAMIC so a plain library import of this
189
+ * module (by the CLI, for the parent-side helper) never pulls Vite / env-validation /
190
+ * the user's env.ts in.
191
+ */
192
+ async function runFactsChild(root) {
193
+ const { resolveConfig } = await import("vite");
194
+ const resolved = await resolveConfig({ root }, "build", "production", "production");
195
+ const rawEnvDir = readBuildRawEnvDir(resolved.plugins);
196
+ const buildVarsDir = rawEnvDir ? join(resolved.root, rawEnvDir) : resolved.root;
197
+ if (resolved.envDir === false || resolved.envDir !== resolved.root || buildVarsDir !== resolved.root) {
198
+ emitResult({
199
+ kind: "reject",
200
+ reason: "custom-envdir"
201
+ });
202
+ return;
203
+ }
204
+ if (resolved.mode !== "production") {
205
+ emitResult({
206
+ kind: "reject",
207
+ reason: "non-production-mode"
208
+ });
209
+ return;
210
+ }
211
+ const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-Dea3v3ej.mjs").then((n) => n.c);
212
+ try {
213
+ emitResult({
214
+ kind: "ok",
215
+ facts: await deriveSelfHostSchemaFacts(root)
216
+ });
217
+ } catch (err) {
218
+ if (err instanceof SelfHostSchemaError) {
219
+ emitResult({
220
+ kind: "schema-error",
221
+ reason: err.reason
222
+ });
223
+ return;
224
+ }
225
+ throw err;
226
+ }
227
+ }
228
+ /**
229
+ * CHILD side (`validate-emitted`): read the REAL emitted worker `vars` the build
230
+ * baked into `dist/ssr/wrangler.json` (ground truth), validate them against the
231
+ * schema's validators, and emit the FAILING key NAMES only. The parent already
232
+ * confirmed the artifact exists, so a read failure here is a probe-infrastructure
233
+ * fault → fail closed as a values-free schema error.
234
+ */
235
+ async function runValidateEmittedChild(root) {
236
+ const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-Dea3v3ej.mjs").then((n) => n.c);
237
+ const emitted = readEmittedWorkerVars(root);
238
+ if (!emitted.ok) {
239
+ emitResult({
240
+ kind: "schema-error",
241
+ reason: "schema-load-failed"
242
+ });
243
+ return;
244
+ }
245
+ try {
246
+ emitResult({
247
+ kind: "invalid-keys",
248
+ invalidKeys: await computeInvalidEmittedKeys(root, emitted.vars)
249
+ });
250
+ } catch (err) {
251
+ if (err instanceof SelfHostSchemaError) {
252
+ emitResult({
253
+ kind: "schema-error",
254
+ reason: err.reason
255
+ });
256
+ return;
257
+ }
258
+ throw err;
259
+ }
260
+ }
261
+ /** Dispatch the child to the requested operation. */
262
+ async function runEnvSchemaProbeChild(rawInput) {
263
+ const input = JSON.parse(rawInput);
264
+ if (input.op === "validate-emitted") {
265
+ await runValidateEmittedChild(input.root);
266
+ return;
267
+ }
268
+ await runFactsChild(input.root);
269
+ }
270
+ if (process.argv[2] === PROBE_MARKER) runEnvSchemaProbeChild(process.argv[3] ?? "null").then(() => process.exit(0), () => process.exit(1));
271
+ //#endregion
272
+ export { resolveEnvSchemaFactsViaSubprocess, validateEmittedVarsViaSubprocess };
@@ -1,6 +1,6 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-DJK8HYOj.mjs";
2
- import { a as join, n as dirname } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
3
- import { r as getPackageDir, u as import_picocolors } from "./agents-Bmr5tFFb.mjs";
2
+ import { a as join, n as dirname } from "./dist-DaKKDf8D.mjs";
3
+ import { r as getPackageDir, u as import_picocolors } from "./agents-CtgBYqld.mjs";
4
4
  import { t as cfAccessHeaders } from "./cf-access-Bqw81xAf.mjs";
5
5
  import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
6
6
  import { createHash, randomBytes } from "node:crypto";
@@ -905,6 +905,16 @@ var PlatformClient = class {
905
905
  if (!res.ok) await throwPlatformApiError("Failed to fetch logs", res);
906
906
  return (await res.json()).data;
907
907
  }
908
+ async getRequests(projectId, since, limit = 200, status) {
909
+ const params = new URLSearchParams({
910
+ since,
911
+ limit: String(limit)
912
+ });
913
+ if (status && status !== "all") params.set("status", status);
914
+ const res = await fetch(`${this.baseUrl}/projects/${projectId}/requests?${params}`, { headers: { ...this.authHeaders } });
915
+ if (!res.ok) await throwPlatformApiError("Failed to fetch requests", res);
916
+ return (await res.json()).data;
917
+ }
908
918
  async listBuilds(projectId, limit = 20) {
909
919
  const params = new URLSearchParams({ limit: String(limit) });
910
920
  const res = await fetch(`${this.baseUrl}/projects/${projectId}/builds?${params}`, { headers: { ...this.authHeaders } });
@@ -1,10 +1,11 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-DJK8HYOj.mjs";
2
- import { a as join } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
3
- import { a as validateSourceDir } from "./project-paths-tpdR1mJR.mjs";
2
+ import { a as join } from "./dist-DaKKDf8D.mjs";
3
+ import { a as validateSourceDir } from "./project-paths-BQd7OmIo.mjs";
4
4
  import { i as isVoidAuthProvider, t as VOID_AUTH_PROVIDERS } from "./providers-CJlNS3kT.mjs";
5
5
  import { readFileSync } from "node:fs";
6
6
  //#region src/config.ts
7
7
  var config_exports = /* @__PURE__ */ __exportAll({
8
+ VALID_NOT_FOUND_HANDLING: () => VALID_NOT_FOUND_HANDLING,
8
9
  VALID_REDIRECT_STATUSES: () => VALID_REDIRECT_STATUSES,
9
10
  assertSingleSplat: () => assertSingleSplat,
10
11
  assertUniqueCaptureNames: () => assertUniqueCaptureNames,
@@ -35,6 +36,15 @@ const VALID_APP_TYPES = /* @__PURE__ */ new Set([
35
36
  ]);
36
37
  const VALID_OUTPUTS = /* @__PURE__ */ new Set(["server", "static"]);
37
38
  /**
39
+ * Accepted `routing.notFound` values. Source of truth for the framework, the
40
+ * `AssetConfig.not_found_handling` field, and the schema.json enum.
41
+ */
42
+ const VALID_NOT_FOUND_HANDLING = /* @__PURE__ */ new Set([
43
+ "single-page-application",
44
+ "404-page",
45
+ "none"
46
+ ]);
47
+ /**
38
48
  * Allowed 3xx redirect statuses. Source of truth for the framework, the
39
49
  * `_redirects` parser (`cli/headers.ts`), and the schema.json enum. 303 is
40
50
  * included for POST→GET after-submit patterns; 304/305/306 aren't
@@ -279,6 +289,9 @@ function readConfig(root) {
279
289
  if (obj.routing !== void 0) {
280
290
  if (typeof obj.routing !== "object" || obj.routing === null || Array.isArray(obj.routing)) throw new Error(`config: "routing" in ${CONFIG_FILE} must be an object.`);
281
291
  const routing = obj.routing;
292
+ if (routing.notFound !== void 0) {
293
+ if (typeof routing.notFound !== "string" || !VALID_NOT_FOUND_HANDLING.has(routing.notFound)) throw new Error(`config: "routing.notFound" in ${CONFIG_FILE} must be one of: ${[...VALID_NOT_FOUND_HANDLING].join(", ")}.`);
294
+ }
282
295
  if (routing.revalidate !== void 0) if (typeof routing.revalidate === "number") {
283
296
  if (!Number.isFinite(routing.revalidate) || routing.revalidate < 0) throw new Error(`config: "routing.revalidate" in ${CONFIG_FILE} must be a non-negative finite number.`);
284
297
  } else if (typeof routing.revalidate === "object" && routing.revalidate !== null && !Array.isArray(routing.revalidate)) {
@@ -1,7 +1,7 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-DJK8HYOj.mjs";
2
- import { a as join, s as relative } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
3
- import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
4
- import { r as schemaSpecifier, t as discoverSchema } from "./discover-BuVVSAum.mjs";
2
+ import { a as join, s as relative } from "./dist-DaKKDf8D.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
4
+ import { r as schemaSpecifier, t as discoverSchema } from "./discover-CJHyvYfR.mjs";
5
5
  import { mkdirSync, writeFileSync } from "node:fs";
6
6
  //#region src/drizzle/config.ts
7
7
  var config_exports = /* @__PURE__ */ __exportAll({ writeDrizzleConfig: () => writeDrizzleConfig });
@@ -1,7 +1,7 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-DJK8HYOj.mjs";
2
- import { A as text, S as confirm, T as log, j as isCancel, k as select, u as import_picocolors, x as cancel } from "./agents-Bmr5tFFb.mjs";
3
- import { S as writeProjectConfig, d as getSiteDomain, t as PlatformApiError } from "./client-C9FG6Vzc.mjs";
4
- import { n as inferDefaultSlug } from "./resolve-project-D2HI3TrG.mjs";
2
+ import { A as text, S as confirm, T as log, j as isCancel, k as select, u as import_picocolors, x as cancel } from "./agents-CtgBYqld.mjs";
3
+ import { S as writeProjectConfig, d as getSiteDomain, t as PlatformApiError } from "./client-Gb71-XkG.mjs";
4
+ import { n as inferDefaultSlug } from "./resolve-project-BBMtLLV9.mjs";
5
5
  //#region src/cli/project-slug.ts
6
6
  var project_slug_exports = /* @__PURE__ */ __exportAll({ validateProjectSlug: () => validateProjectSlug });
7
7
  function validateProjectSlug(value) {
@@ -1,13 +1,13 @@
1
- import { a as join, c as resolve, r as extname, s as relative } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
2
- import { D as outro, S as confirm, T as log, a as cliTitle, j as isCancel, s as dim, u as import_picocolors, w as intro } from "./agents-Bmr5tFFb.mjs";
3
- import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
1
+ import { a as join, c as resolve, r as extname, s as relative } from "./dist-DaKKDf8D.mjs";
2
+ import { D as outro, S as confirm, T as log, a as cliTitle, j as isCancel, s as dim, u as import_picocolors, w as intro } from "./agents-CtgBYqld.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
4
4
  import { t as cfAccessHeaders } from "./cf-access-Bqw81xAf.mjs";
5
- import { b as readProjectConfig, f as getToken, m as isStagingMode, n as PlatformClient, t as PlatformApiError } from "./client-C9FG6Vzc.mjs";
6
- import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-BcAeIPe3.mjs";
7
- import { r as detectFramework } from "./plugin-inference-CJxi_fWI.mjs";
8
- import { c as collectMigrations, d as stripSqlExt, f as writeJournal, n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence, u as readJournal } from "./validate-DT7nFMlf.mjs";
5
+ import { b as readProjectConfig, f as getToken, m as isStagingMode, n as PlatformClient, t as PlatformApiError } from "./client-Gb71-XkG.mjs";
6
+ import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-BkTvs43g.mjs";
7
+ import { r as detectFramework } from "./plugin-inference-DMeavIJ6.mjs";
8
+ import { c as collectMigrations, d as stripSqlExt, f as writeJournal, n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence, u as readJournal } from "./validate-Cw_RLeTj.mjs";
9
9
  import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-D-3_D-Gl.mjs";
10
- import { formatTimestamp } from "./gen-Bee261SV.mjs";
10
+ import { formatTimestamp } from "./gen-o_w-8yI8.mjs";
11
11
  import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
12
12
  import { fileURLToPath, pathToFileURL } from "node:url";
13
13
  import { execFileSync } from "node:child_process";
@@ -96,13 +96,13 @@ async function runDbCommand(root, args) {
96
96
  else await runExport(root, args, dialect);
97
97
  }
98
98
  async function runPush(root, dialect) {
99
- const { writeDrizzleConfig } = await import("./config-BdUctCZD.mjs").then((n) => n.t);
99
+ const { writeDrizzleConfig } = await import("./config-CutEMNGJ.mjs").then((n) => n.t);
100
100
  let configPath;
101
101
  if (dialect === "postgresql") configPath = writeDrizzleConfig(root, getPgUrl(root), "postgresql");
102
102
  else {
103
103
  const { mkdirSync } = await import("node:fs");
104
104
  const { dirname } = await import("node:path");
105
- const { getMiniflareDatabasePath } = await import("./runner-h272wcPj.mjs");
105
+ const { getMiniflareDatabasePath } = await import("./runner-kapo9aPs.mjs");
106
106
  const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
107
107
  mkdirSync(dirname(dbPath), { recursive: true });
108
108
  configPath = writeDrizzleConfig(root, dbPath);
@@ -119,7 +119,7 @@ async function runPush(root, dialect) {
119
119
  outro("Done.");
120
120
  }
121
121
  async function runGenerate(root, dialect) {
122
- const { writeDrizzleConfig } = await import("./config-BdUctCZD.mjs").then((n) => n.t);
122
+ const { writeDrizzleConfig } = await import("./config-CutEMNGJ.mjs").then((n) => n.t);
123
123
  const configPath = dialect === "postgresql" ? writeDrizzleConfig(root, "postgresql://dummy", "postgresql") : writeDrizzleConfig(root, ":memory:");
124
124
  try {
125
125
  runDrizzleKit(root, [
@@ -160,7 +160,7 @@ async function runStatus(root, dialect) {
160
160
  localApplied = [];
161
161
  }
162
162
  else {
163
- const { getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-h272wcPj.mjs");
163
+ const { getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-kapo9aPs.mjs");
164
164
  localApplied = await getAppliedMigrations(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
165
165
  }
166
166
  const localSet = new Set(localApplied.map((m) => m.name));
@@ -218,7 +218,7 @@ async function resetDatabase(root, dialect) {
218
218
  });
219
219
  return migrations.length;
220
220
  }
221
- const { getMiniflareDatabasePath, runMigrations } = await import("./runner-h272wcPj.mjs");
221
+ const { getMiniflareDatabasePath, runMigrations } = await import("./runner-kapo9aPs.mjs");
222
222
  const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
223
223
  rmSync(dbPath, { force: true });
224
224
  rmSync(dbPath + "-wal", { force: true });
@@ -245,7 +245,7 @@ async function runSeed(root, file, dialect) {
245
245
  outro("Done.");
246
246
  return;
247
247
  }
248
- const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-h272wcPj.mjs");
248
+ const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-kapo9aPs.mjs");
249
249
  const db = await openSqliteDatabase(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
250
250
  try {
251
251
  db.exec(sql);
@@ -408,7 +408,7 @@ async function runExecute(root, command, file, dialect, remote) {
408
408
  outro("Done.");
409
409
  return;
410
410
  }
411
- const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-h272wcPj.mjs");
411
+ const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-kapo9aPs.mjs");
412
412
  const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
413
413
  if (!existsSync(dbPath)) {
414
414
  log.error("No local database found. Run `void dev` first.");
@@ -511,7 +511,7 @@ async function runMigrate(root, dialect, remote) {
511
511
  return;
512
512
  }
513
513
  if (dialect === "postgresql") {
514
- const { applyPgMigrations } = await import("./runner-pg-waxJOnBb.mjs");
514
+ const { applyPgMigrations } = await import("./runner-pg-CHM76xuC.mjs");
515
515
  const applied = await withPgClient(root, async (client) => {
516
516
  let existingRows = [];
517
517
  try {
@@ -535,7 +535,7 @@ async function runMigrate(root, dialect, remote) {
535
535
  outro("Done.");
536
536
  return;
537
537
  }
538
- const { getMiniflareDatabasePath, getAppliedMigrations, runMigrations } = await import("./runner-h272wcPj.mjs");
538
+ const { getMiniflareDatabasePath, getAppliedMigrations, runMigrations } = await import("./runner-kapo9aPs.mjs");
539
539
  const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
540
540
  try {
541
541
  const existingRows = await getAppliedMigrations(dbPath);
@@ -570,7 +570,7 @@ async function runStudio(root, dialect, remote) {
570
570
  process.exit(1);
571
571
  }
572
572
  const dbUrl = await fetchRemoteDatabaseUrl(new PlatformClient(token, { root }), projectConfig.projectId);
573
- const { writeDrizzleConfig } = await import("./config-BdUctCZD.mjs").then((n) => n.t);
573
+ const { writeDrizzleConfig } = await import("./config-CutEMNGJ.mjs").then((n) => n.t);
574
574
  const configPath = writeDrizzleConfig(root, dbUrl, "postgresql");
575
575
  log.info("Opening Drizzle Studio (remote)...");
576
576
  try {
@@ -585,7 +585,7 @@ async function runStudio(root, dialect, remote) {
585
585
  return;
586
586
  }
587
587
  if (dialect === "postgresql") {
588
- const { writeDrizzleConfig } = await import("./config-BdUctCZD.mjs").then((n) => n.t);
588
+ const { writeDrizzleConfig } = await import("./config-CutEMNGJ.mjs").then((n) => n.t);
589
589
  const configPath = writeDrizzleConfig(root, getPgUrl(root), "postgresql");
590
590
  log.info("Opening Drizzle Studio...");
591
591
  try {
@@ -599,8 +599,8 @@ async function runStudio(root, dialect, remote) {
599
599
  }
600
600
  return;
601
601
  }
602
- const { writeDrizzleConfig } = await import("./config-BdUctCZD.mjs").then((n) => n.t);
603
- const { getMiniflareDatabasePath } = await import("./runner-h272wcPj.mjs");
602
+ const { writeDrizzleConfig } = await import("./config-CutEMNGJ.mjs").then((n) => n.t);
603
+ const { getMiniflareDatabasePath } = await import("./runner-kapo9aPs.mjs");
604
604
  const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
605
605
  if (!existsSync(dbPath)) {
606
606
  log.error("No local database found. Run `void dev` first.");
@@ -820,7 +820,7 @@ async function runRenameMigrations(root, dialect) {
820
820
  process.exit(1);
821
821
  }
822
822
  else {
823
- const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-h272wcPj.mjs");
823
+ const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-kapo9aPs.mjs");
824
824
  const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
825
825
  if (existsSync(dbPath)) try {
826
826
  const db = await openSqliteDatabase(dbPath);
@@ -899,7 +899,7 @@ async function runExport(root, args, dialect) {
899
899
  } else process.stdout.write(output);
900
900
  return;
901
901
  }
902
- const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-h272wcPj.mjs");
902
+ const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-kapo9aPs.mjs");
903
903
  const dbPath = getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local");
904
904
  if (!existsSync(dbPath)) {
905
905
  log.error("No local database found. Run `void dev` first.", errOut);
@@ -947,7 +947,7 @@ async function runExport(root, args, dialect) {
947
947
  }
948
948
  }
949
949
  async function runSetUrl(root) {
950
- const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-BcAeIPe3.mjs").then((n) => n.n);
950
+ const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-BkTvs43g.mjs").then((n) => n.n);
951
951
  if (getDialect(readVoidConfig(root)) !== "postgresql") {
952
952
  log.error("db: This command is only for PostgreSQL projects. Set \"database\": \"pg\" in void.json.");
953
953
  process.exit(1);
@@ -962,7 +962,7 @@ async function runSetUrl(root) {
962
962
  log.error("No project linked. Run `void deploy` first or link a project.");
963
963
  process.exit(1);
964
964
  }
965
- const { text: promptText, isCancel: isCancelCheck } = await import("./agents-Bmr5tFFb.mjs").then((n) => n.C);
965
+ const { text: promptText, isCancel: isCancelCheck } = await import("./agents-CtgBYqld.mjs").then((n) => n.C);
966
966
  const connectionString = await promptText({
967
967
  message: "Enter your PostgreSQL connection string:",
968
968
  placeholder: "postgresql://user:pass@host:5432/dbname",
@@ -1028,7 +1028,7 @@ async function runSeedModule(root, seedPath, dialect) {
1028
1028
  return;
1029
1029
  }
1030
1030
  const { drizzle } = await import("drizzle-orm/better-sqlite3");
1031
- const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-h272wcPj.mjs");
1031
+ const { getMiniflareDatabasePath, openSqliteDatabase } = await import("./runner-kapo9aPs.mjs");
1032
1032
  const sqlite = await openSqliteDatabase(getMiniflareDatabasePath(getLocalD1PersistRoot(root), "local"));
1033
1033
  try {
1034
1034
  const options = getDrizzleSchemaOptions(schema);
@@ -1048,7 +1048,7 @@ async function loadSeedFunction(seedPath) {
1048
1048
  return seed;
1049
1049
  }
1050
1050
  async function loadSeedSchema(root) {
1051
- const { discoverSchema } = await import("./discover-BuVVSAum.mjs").then((n) => n.n);
1051
+ const { discoverSchema } = await import("./discover-CJHyvYfR.mjs").then((n) => n.n);
1052
1052
  const location = discoverSchema(root, readProjectPaths(root));
1053
1053
  if (!location) return {};
1054
1054
  if (location.type === "file") {
@@ -1,6 +1,6 @@
1
- import { A as text, D as outro, E as note, T as log, a as cliTitle, j as isCancel, o as createSpinner, w as intro, x as cancel } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, f as getToken, n as PlatformClient, x as removeProjectConfig } from "./client-C9FG6Vzc.mjs";
3
- import { r as resolveProjectBySlug } from "./resolve-project-D2HI3TrG.mjs";
1
+ import { A as text, D as outro, E as note, T as log, a as cliTitle, j as isCancel, o as createSpinner, w as intro, x as cancel } from "./agents-CtgBYqld.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient, x as removeProjectConfig } from "./client-Gb71-XkG.mjs";
3
+ import { r as resolveProjectBySlug } from "./resolve-project-BBMtLLV9.mjs";
4
4
  //#region src/cli/delete.ts
5
5
  async function runDeleteCommand(root, slug, options) {
6
6
  console.log();