void 0.10.10 → 0.10.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) 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-BdUctCZD.mjs → config-CutEMNGJ.mjs} +3 -3
  14. package/dist/{config-BcAeIPe3.mjs → config-E03l1C_h.mjs} +2 -2
  15. package/dist/{create-project-CjYX23M_.mjs → create-project-DsYvl3TB.mjs} +3 -3
  16. package/dist/{db-BvKV34IK.mjs → db-PZBsLSGb.mjs} +27 -27
  17. package/dist/{delete-CThKLXfi.mjs → delete-mh6p-zkQ.mjs} +3 -3
  18. package/dist/deploy-DT8wsPZd.mjs +6990 -0
  19. package/dist/{discover-BuVVSAum.mjs → discover-CJHyvYfR.mjs} +2 -2
  20. package/dist/dist-DaKKDf8D.mjs +41 -0
  21. package/dist/{domain-DMrBabBQ.mjs → domain-DiaNQbrl.mjs} +2 -2
  22. package/dist/entry-D7yy4xVH.mjs +100 -0
  23. package/dist/{env-BfG7O71F.mjs → env-AAHU02L6.mjs} +5 -5
  24. package/dist/env-mask-Dd47NbR6.mjs +90 -0
  25. package/dist/env-public-BfiLcMBk.d.mts +140 -0
  26. package/dist/{env-types-D51bnR-c.mjs → env-types-QBj-ndax.mjs} +2 -2
  27. package/dist/env-validation-BdDlGhbN.mjs +1069 -0
  28. package/dist/{gen-Bee261SV.mjs → gen-oup1xBN0.mjs} +8 -8
  29. package/dist/{github-cmd-DfeFEasr.mjs → github-cmd-BdNaOVNa.mjs} +3 -3
  30. package/dist/{handler-imD0UVDT.d.mts → handler-Cjh8uM3Y.d.mts} +1 -1
  31. package/dist/{headers-CTAjX-UO.mjs → headers-BQknpzkn.mjs} +2 -2
  32. package/dist/index.d.mts +1 -1
  33. package/dist/index.mjs +41 -33
  34. package/dist/{init-xfwW7cLp.mjs → init-Dl2PKuQn.mjs} +13 -14
  35. package/dist/{link-Co136MEs.mjs → link-CdGHSIy-.mjs} +4 -4
  36. package/dist/{list-BKDjA3M5.mjs → list-CPwFDZ_c.mjs} +3 -3
  37. package/dist/{login-CrOTnR_6.mjs → login-BT3H8PN3.mjs} +2 -2
  38. package/dist/{logs-DlAg25ww.mjs → logs-Bt313ax7.mjs} +3 -2
  39. package/dist/{mcp-BNjMGMB0.mjs → mcp-DoM3_nhd.mjs} +7 -2
  40. package/dist/{node-CnE-SZCk.mjs → node-BDx8pmhq.mjs} +5 -5
  41. package/dist/{package-json-B0NuUWGd.mjs → package-json-Cx1osYo6.mjs} +1 -1
  42. package/dist/pages/client.d.mts +1 -1
  43. package/dist/pages/index.d.mts +1 -23
  44. package/dist/pages/index.mjs +5 -5
  45. package/dist/pages/islands-plugin.mjs +2 -2
  46. package/dist/pages/protocol.d.mts +2 -2
  47. package/dist/{plugin-inference-CJxi_fWI.mjs → plugin-inference-DMeavIJ6.mjs} +4 -98
  48. package/dist/{prepare-BRyC4TCC.mjs → prepare-DOBTY0o4.mjs} +10 -10
  49. package/dist/preset-BGrvB4Bl.mjs +539 -0
  50. package/dist/{project-cmd-B2bcKefD.mjs → project-cmd-D_w-4w5B.mjs} +13 -9
  51. package/dist/{project-paths-tpdR1mJR.mjs → project-paths-BQd7OmIo.mjs} +1 -1
  52. package/dist/project-paths-GpziKeQQ.d.mts +25 -0
  53. package/dist/{project-tsconfig-D9uSVVpA.mjs → project-tsconfig-B-QtXjLQ.mjs} +2 -2
  54. package/dist/{protocol-6hTJ04T1.d.mts → protocol-Bnb0LFp3.d.mts} +1 -1
  55. package/dist/provision-BLrCEBbI.mjs +2557 -0
  56. package/dist/requests-B8sZxaFM.mjs +50 -0
  57. package/dist/{resolve-project-D2HI3TrG.mjs → resolve-project-BBMtLLV9.mjs} +1 -1
  58. package/dist/{rollback-9dfmB-YZ.mjs → rollback-CkvTFXx5.mjs} +2 -2
  59. package/dist/{route-types-CfKfhbIg.mjs → route-types-COI2DsZv.mjs} +2 -2
  60. package/dist/{runner-h272wcPj.mjs → runner-kapo9aPs.mjs} +3 -3
  61. package/dist/{runner-pg-waxJOnBb.mjs → runner-pg-CHM76xuC.mjs} +1 -1
  62. package/dist/runtime/better-auth-pg.d.mts +1 -1
  63. package/dist/runtime/better-auth.d.mts +1 -1
  64. package/dist/runtime/env-public.d.mts +1 -139
  65. package/dist/runtime/env-public.mjs +2 -90
  66. package/dist/runtime/handler.d.mts +1 -1
  67. package/dist/runtime/live.d.mts +1 -1
  68. package/dist/runtime/validator.d.mts +1 -1
  69. package/dist/runtime/ws-server.d.mts +1 -1
  70. package/dist/runtime/ws.d.mts +2 -2
  71. package/dist/{scan-Dp_Gyzs3.mjs → scan-DEwlM_Xy.mjs} +2 -2
  72. package/dist/{scan-i7Yz54fv.mjs → scan-DYXkrasO.mjs} +4 -4
  73. package/dist/{secret-DeMnMcV0.mjs → secret-Dt32J6RI.mjs} +3 -3
  74. package/dist/{skills-DsdNDtX3.mjs → skills-CLjN0uUO.mjs} +2 -2
  75. package/dist/{subcommand-prompt-DtES-oP6.mjs → subcommand-prompt-BzV8iQZo.mjs} +1 -1
  76. package/dist/sveltekit.mjs +1 -1
  77. package/dist/{validate-DT7nFMlf.mjs → validate-Cw_RLeTj.mjs} +1 -1
  78. package/dist/{yarn-pnp-CW8LB6g_.mjs → yarn-pnp-DJn3SAHF.mjs} +1 -1
  79. package/getting-started-prompt.txt +3 -1
  80. package/package.json +5 -3
  81. package/skills/void/SKILL.md +34 -33
  82. package/skills/void/docs/guide/auth.md +8 -0
  83. package/skills/void/docs/guide/deployment.md +1 -1
  84. package/skills/void/docs/guide/env-vars.md +14 -6
  85. package/skills/void/docs/guide/queues.md +4 -0
  86. package/skills/void/docs/integrations/cloudflare.md +64 -5
  87. package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +4 -0
  88. package/skills/void/docs/node_modules/void/README.md +1 -1
  89. package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +51 -0
  90. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +64 -0
  91. package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +64 -0
  92. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +108 -0
  93. package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +183 -0
  94. package/skills/void/docs/node_modules/void/skills/void/SKILL.md +34 -33
  95. package/skills/void/docs/node_modules/void/test/e2e/README.md +85 -0
  96. package/skills/void/docs/reference/cli.md +74 -14
  97. package/dist/deploy-B02JyKP9.mjs +0 -3748
  98. package/dist/dotenv-D_UbC_vc.mjs +0 -173
  99. package/dist/env-validation-CeC2FL66.mjs +0 -163
  100. package/dist/pathe.M-eThtNZ-CQzLbt4c.mjs +0 -150
  101. package/dist/preset-CVvwCeIy.mjs +0 -208
  102. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +0 -73
  103. package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +0 -73
@@ -1,6 +1,6 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-DJK8HYOj.mjs";
2
- import { s as relative } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
3
- import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
2
+ import { s as relative } from "./dist-DaKKDf8D.mjs";
3
+ import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
4
4
  import { existsSync, statSync } from "node:fs";
5
5
  //#region src/drizzle/discover.ts
6
6
  var discover_exports = /* @__PURE__ */ __exportAll({
@@ -0,0 +1,41 @@
1
+ import nodePath from "node:path";
2
+ //#region ../../node_modules/.pnpm/pathslash@0.1.0/node_modules/pathslash/dist/index.mjs
3
+ const BACKSLASH_RE = /\\/g;
4
+ const isWindows = process.platform === "win32";
5
+ /**
6
+ * Flip backslashes to forward slashes, used to slash-ify `node:path.win32`
7
+ * output. `\\?\` (extended-length) paths are left untouched: there a forward
8
+ * slash is a literal character, not a separator.
9
+ */
10
+ const toForwardSlash = (path) => path.startsWith("\\\\?\\") ? path : path.replace(BACKSLASH_RE, "/");
11
+ const w = nodePath.win32;
12
+ function slashed(fn) {
13
+ return (...args) => toForwardSlash(fn(...args));
14
+ }
15
+ const win32 = {
16
+ resolve: slashed(w.resolve),
17
+ normalize: slashed(w.normalize),
18
+ join: slashed(w.join),
19
+ relative: slashed(w.relative),
20
+ dirname: slashed(w.dirname),
21
+ format: slashed(w.format),
22
+ parse: (path) => {
23
+ const parsed = w.parse(path);
24
+ parsed.root = toForwardSlash(parsed.root);
25
+ parsed.dir = toForwardSlash(parsed.dir);
26
+ return parsed;
27
+ },
28
+ basename: w.basename,
29
+ extname: w.extname,
30
+ isAbsolute: w.isAbsolute,
31
+ matchesGlob: w.matchesGlob,
32
+ toNamespacedPath: w.toNamespacedPath,
33
+ delimiter: w.delimiter,
34
+ sep: "/"
35
+ };
36
+ const posix = { ...nodePath.posix };
37
+ posix.posix = win32.posix = posix;
38
+ posix.win32 = win32.win32 = win32;
39
+ const { basename, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, parse, relative, resolve, sep, toNamespacedPath } = isWindows ? win32 : posix;
40
+ //#endregion
41
+ export { join as a, resolve as c, isAbsolute as i, dirname as n, normalize as o, extname as r, relative as s, basename as t };
@@ -1,5 +1,5 @@
1
- import { E as note, T as log, u as import_picocolors } from "./agents-Bmr5tFFb.mjs";
2
- import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-C9FG6Vzc.mjs";
1
+ import { E as note, T as log, u as import_picocolors } from "./agents-CtgBYqld.mjs";
2
+ import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Gb71-XkG.mjs";
3
3
  //#region src/cli/domain.ts
4
4
  async function runDomainCommand(root, args) {
5
5
  const token = getToken(root);
@@ -0,0 +1,100 @@
1
+ import { a as join, s as relative } from "./dist-DaKKDf8D.mjs";
2
+ import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import { parseSync } from "vite";
5
+ //#region src/shared/ast.ts
6
+ function isIdentifier(node) {
7
+ return node?.type === "Identifier" && typeof node.name === "string";
8
+ }
9
+ function isLiteral(node) {
10
+ return node?.type === "Literal";
11
+ }
12
+ function isMemberExpression(node) {
13
+ return node?.type === "MemberExpression";
14
+ }
15
+ function isCallExpression(node) {
16
+ return node?.type === "CallExpression";
17
+ }
18
+ function isObjectExpression(node) {
19
+ return node?.type === "ObjectExpression";
20
+ }
21
+ //#endregion
22
+ //#region src/ssr/entry.ts
23
+ const SSR_SERVER_ENTRY_RELATIVE_PATHS = ["src/main.ssr.ts", "src/main.ssr.tsx"];
24
+ const SSR_CLIENT_ENTRY_RELATIVE_PATHS = ["src/main.client.ts", "src/main.client.tsx"];
25
+ function resolveSingleEntry(root, entries, label, paths = readProjectPaths(root)) {
26
+ const matches = entries.map((entryName) => ({
27
+ relativePath: relative(root, join(paths.ssrDir, entryName)),
28
+ absolutePath: join(paths.ssrDir, entryName)
29
+ })).filter((entry) => existsSync(entry.absolutePath));
30
+ if (matches.length === 0) return null;
31
+ if (matches.length > 1) {
32
+ const names = matches.map((entry) => entry.relativePath).join(", ");
33
+ throw new Error(`ssr: Multiple ${label} entry files found: ${names}. Keep only one.`);
34
+ }
35
+ return matches[0];
36
+ }
37
+ const SSR_SERVER_ENTRY_NAMES = ["main.ssr.ts", "main.ssr.tsx"];
38
+ const SSR_CLIENT_ENTRY_NAMES = ["main.client.ts", "main.client.tsx"];
39
+ function getSsrServerEntryPath(root, paths = readProjectPaths(root)) {
40
+ return resolveSingleEntry(root, SSR_SERVER_ENTRY_NAMES, "SSR", paths)?.absolutePath ?? null;
41
+ }
42
+ function hasSsrEntry(root, paths = readProjectPaths(root)) {
43
+ return getSsrServerEntryPath(root, paths) !== null;
44
+ }
45
+ function validateServerRenderExport(entry) {
46
+ const { absolutePath, relativePath } = entry;
47
+ const source = readFileSync(absolutePath, "utf-8");
48
+ if (/\bexport\s+(?:async\s+)?function\s+render\b/.test(source) || /\bexport\s+const\s+render\b/.test(source) || /\bexport\s+default\s+(?:defineRender\b|(?:async\s+)?function\b)/.test(source)) return;
49
+ let parsed;
50
+ try {
51
+ parsed = parseSync(relativePath, source);
52
+ } catch (err) {
53
+ throw new Error(`ssr: Invalid entry '${relativePath}'. Could not parse source: '${err instanceof Error ? err.message : String(err)}'.`);
54
+ }
55
+ if (!(parsed.program.body ?? []).some((node) => {
56
+ if (node.type === "ExportDefaultDeclaration") {
57
+ const declaration = node.declaration;
58
+ if (declaration?.type === "FunctionDeclaration" || declaration?.type === "FunctionExpression" || declaration?.type === "ArrowFunctionExpression") return true;
59
+ if (declaration?.type === "CallExpression") {
60
+ const call = declaration;
61
+ return isIdentifier(call.callee) && call.callee.name === "defineRender";
62
+ }
63
+ return false;
64
+ }
65
+ if (node.type !== "ExportNamedDeclaration") return false;
66
+ if (node.exportKind === "type") return false;
67
+ const declaration = node.declaration;
68
+ if (declaration?.type === "FunctionDeclaration") {
69
+ const fn = declaration;
70
+ return isIdentifier(fn.id) && fn.id.name === "render";
71
+ }
72
+ if (declaration?.type === "VariableDeclaration") return (declaration.declarations ?? []).some((decl) => isIdentifier(decl.id) && decl.id.name === "render");
73
+ return (node.specifiers ?? []).some((specifier) => {
74
+ if (specifier.exportKind === "type") return false;
75
+ const exported = specifier.exported;
76
+ return isIdentifier(exported) && exported.name === "render";
77
+ });
78
+ })) throw new Error(`ssr: Invalid entry '${relativePath}'. Export \`render(c, assetTags)\` or \`export default defineRender(...)\`.`);
79
+ }
80
+ /**
81
+ * Validate SSR mode entry conventions.
82
+ * Returns null when SSR mode is not used.
83
+ */
84
+ function validateSsrEntries(root, paths = readProjectPaths(root)) {
85
+ const server = resolveSingleEntry(root, SSR_SERVER_ENTRY_NAMES, "SSR", paths);
86
+ const client = resolveSingleEntry(root, SSR_CLIENT_ENTRY_NAMES, "SSR client", paths);
87
+ if (!server && !client) return null;
88
+ if (server && !client) throw new Error(`ssr: Missing client entry. Add one of: ${SSR_CLIENT_ENTRY_RELATIVE_PATHS.join(", ")}.`);
89
+ if (!server && client) throw new Error(`ssr: Missing server entry. Add one of: ${SSR_SERVER_ENTRY_RELATIVE_PATHS.join(", ")}.`);
90
+ validateServerRenderExport(server);
91
+ return {
92
+ server,
93
+ client
94
+ };
95
+ }
96
+ function validateSsrEntry(root, paths = readProjectPaths(root)) {
97
+ return validateSsrEntries(root, paths)?.server.absolutePath ?? null;
98
+ }
99
+ //#endregion
100
+ export { validateSsrEntries as a, isIdentifier as c, isObjectExpression as d, hasSsrEntry as i, isLiteral as l, SSR_SERVER_ENTRY_RELATIVE_PATHS as n, validateSsrEntry as o, getSsrServerEntryPath as r, isCallExpression as s, SSR_CLIENT_ENTRY_RELATIVE_PATHS as t, isMemberExpression as u };
@@ -1,8 +1,8 @@
1
- import { a as join } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
2
- import { D as outro, E as note, T as log, a as cliTitle, w as intro } from "./agents-Bmr5tFFb.mjs";
3
- import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-C9FG6Vzc.mjs";
4
- import { r as generateEnvTypes, t as findEnvFile } from "./env-types-D51bnR-c.mjs";
5
- import { a as loadUserEnvFile, i as validateProdEnv, n as formatEnvReport, t as fetchRemoteSecretNames } from "./env-validation-CeC2FL66.mjs";
1
+ import { a as join } from "./dist-DaKKDf8D.mjs";
2
+ import { D as outro, E as note, T as log, a as cliTitle, w as intro } from "./agents-CtgBYqld.mjs";
3
+ import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Gb71-XkG.mjs";
4
+ import { r as generateEnvTypes, t as findEnvFile } from "./env-types-QBj-ndax.mjs";
5
+ import { h as loadUserEnvFile, l as fetchRemoteSecretNames, m as validateProdEnv, u as formatEnvReport } from "./env-validation-BdDlGhbN.mjs";
6
6
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
7
7
  //#region src/cli/env-example.ts
8
8
  /**
@@ -0,0 +1,90 @@
1
+ //#region src/shared/env-mask.ts
2
+ /**
3
+ * Secret redaction helpers for env-validation output.
4
+ *
5
+ * Values are redacted (replaced with `<redacted>`) whenever they flow into
6
+ * a user-visible string — `EnvValidationError` messages, CLI reports, the
7
+ * dev-server warning block. The key name is never masked (the user needs
8
+ * it to locate the offending entry).
9
+ *
10
+ * Redaction is belt-and-braces:
11
+ * 1. An explicit `.secret()` / `.public()` flag on a schema entry wins.
12
+ * 2. Otherwise, a key-name regex (`KEY|TOKEN|SECRET|…`) redacts anything
13
+ * that looks like credentials.
14
+ * 3. Even on non-secret keys, a value that itself looks high-entropy
15
+ * (`sk_…`, `ghp_…`, ≥24 characters of mixed alphanumerics) is redacted
16
+ * — catches wrong-file typos like `PORT=sk_live_abc123`.
17
+ *
18
+ * Users can opt out of the guard for local debugging via
19
+ * `VOID_ENV_UNMASK=1` in the environment; that path prints a one-shot
20
+ * notice on stderr so the loosened output is visibly attributed.
21
+ *
22
+ * This module is a leaf — no imports from non-leaf modules, safe to reach
23
+ * from both the runtime (worker bundle) and the CLI host.
24
+ */
25
+ /** Sentinel emitted in place of a redacted value. */
26
+ const REDACTED = "<redacted>";
27
+ /** Environment variable that disables redaction when set to `1`. */
28
+ const UNMASK_ENV_VAR = "VOID_ENV_UNMASK";
29
+ /**
30
+ * Regex matching env key names that almost always carry secrets.
31
+ * Case-insensitive; matched as a substring anywhere in the key.
32
+ */
33
+ const SECRET_KEY_RE = /KEY|TOKEN|SECRET|PASSWORD|PASS(WD)?|CREDENTIAL|PRIVATE|AUTH|BEARER|APIKEY|DSN/i;
34
+ /** Common secret value prefixes (Stripe, GitHub, Slack, AWS, …). */
35
+ const SECRET_VALUE_PREFIX_RE = /^(sk|pk|ghp|xoxb|AKIA)/i;
36
+ /** High-entropy alphanumeric string of ≥24 chars. */
37
+ const HIGH_ENTROPY_RE = /^[A-Za-z0-9_\-+/=.:]{24,}$/;
38
+ /** `true` when the key name heuristically denotes a secret. */
39
+ function isLikelySecretKey(name) {
40
+ return SECRET_KEY_RE.test(name);
41
+ }
42
+ /**
43
+ * `true` when the value looks like a credential regardless of key name.
44
+ * Err on the side of redacting — a false positive hides one non-secret
45
+ * debugging hint, a false negative pastes a token into a GitHub issue.
46
+ */
47
+ function isLikelySecretValue(value) {
48
+ if (typeof value !== "string" || value.length === 0) return false;
49
+ return SECRET_VALUE_PREFIX_RE.test(value) || HIGH_ENTROPY_RE.test(value);
50
+ }
51
+ /**
52
+ * Redact every occurrence of `raw` inside a validator-produced `message`
53
+ * when the key should be masked. Built-in helpers embed the raw value in
54
+ * their error strings (e.g. `Expected a number, got "not-a-number"`); we
55
+ * scrub those after the fact so third-party Standard Schema libraries —
56
+ * which have their own message format — also get reasonable redaction as
57
+ * long as the offending value was a secret-looking literal.
58
+ */
59
+ function redactMessage(key, rawValue, message, options = {}) {
60
+ if (options.unmask) return message;
61
+ if (!(options.override === "secret" || options.override !== "public" && (isLikelySecretKey(key) || isLikelySecretValue(rawValue)))) return message;
62
+ if (typeof rawValue !== "string" || rawValue.length === 0) return message;
63
+ return message.split(rawValue).join(REDACTED);
64
+ }
65
+ let unmaskResolved = null;
66
+ let unmaskNoticeShown = false;
67
+ /**
68
+ * Resolve the effective unmask flag, consulting `process.env` exactly once
69
+ * per process. On the first affirmative read, we print a one-shot notice to
70
+ * stderr so CI logs clearly show the guard is off.
71
+ */
72
+ function isUnmaskActive() {
73
+ if (unmaskResolved !== null) return unmaskResolved;
74
+ let active = false;
75
+ try {
76
+ active = globalThis.process?.env?.[UNMASK_ENV_VAR] === "1";
77
+ } catch {
78
+ active = false;
79
+ }
80
+ unmaskResolved = active;
81
+ if (active && !unmaskNoticeShown) {
82
+ unmaskNoticeShown = true;
83
+ try {
84
+ console.error(`[void/env] ${UNMASK_ENV_VAR}=1 is set — env validation errors will include raw values. Unset it before sharing logs.`);
85
+ } catch {}
86
+ }
87
+ return active;
88
+ }
89
+ //#endregion
90
+ export { isUnmaskActive as n, redactMessage as r, isLikelySecretKey as t };
@@ -0,0 +1,140 @@
1
+ import { t as StandardSchemaV1 } from "./standard-schema-DJ0HW7QP.mjs";
2
+
3
+ //#region src/runtime/env-public.d.ts
4
+ type AnyValidator = StandardSchemaV1<unknown, unknown>;
5
+ type AnySchema = Record<string, AnyValidator>;
6
+ /**
7
+ * Type-only stub for the validated env shape. Augmented by the generated
8
+ * `.void/env.d.ts` so `env.X` is typed per the user's schema. Includes an
9
+ * index signature so untyped property access returns `unknown` (rather than
10
+ * a hard error) for bindings and keys not declared in the schema.
11
+ */
12
+ interface ValidatedEnv {
13
+ readonly [key: string]: unknown;
14
+ }
15
+ type InferEnv<S extends AnySchema> = { readonly [K in keyof S]: StandardSchemaV1.InferOutput<S[K]> };
16
+ /**
17
+ * Register an env schema and return the typed `env` proxy.
18
+ *
19
+ * Calling `defineEnv` is the only required step — Void auto-discovers
20
+ * `env.ts` at project root, imports it, and uses the schema for runtime
21
+ * validation, type generation, and deploy-time secret checks.
22
+ *
23
+ * The return value is identical to the `env` export from `void/env`.
24
+ * Re-export it from your `env.ts` if you prefer the explicit
25
+ * `import { env } from "~/env"` pattern.
26
+ */
27
+ declare function defineEnv<S extends AnySchema>(schema: S): InferEnv<S>;
28
+ /**
29
+ * Internal: validate the entire schema against the worker's actual env on
30
+ * the first request per isolate. Catches bad remote-secret values and
31
+ * post-deploy drift that the deploy CLI can't see (it only knows secret
32
+ * names, not their values).
33
+ *
34
+ * Spliced into the generated worker entry by `compileWorkerEntry`. Cached
35
+ * after the first call so subsequent requests pay no cost.
36
+ *
37
+ * Async lifecycle: this function awaits any async Standard Schema
38
+ * validators (zod `refine`, arktype async narrows, etc.) and seeds the
39
+ * per-key cache with the resolved values. Subsequent reads via `env.X`
40
+ * hit the sync cache — async work only happens here, at boot. If a user
41
+ * accesses `env.X` for a key with an async validator *before* this
42
+ * function has run (e.g. during module-top-level code), the proxy will
43
+ * throw with guidance pointing back to this boot-time pre-validation.
44
+ */
45
+ declare function _validateEnvOnce(envValues: unknown): Promise<void>;
46
+ /** Internal: framework-only access to the registered schema (for plugin/CLI). */
47
+ declare function _getRegisteredSchema(): AnySchema | null;
48
+ /**
49
+ * Internal: returns `true` once `defineEnv()` has been called at least once,
50
+ * regardless of whether the caller passed an empty schema. Gives tooling a
51
+ * reliable signal — `_getRegisteredSchema()` alone can't distinguish
52
+ * `defineEnv({})` (an intentional empty schema) from "never called".
53
+ */
54
+ declare function _hasRegisteredSchema(): boolean;
55
+ /**
56
+ * Internal: extract `.default(value)` values from the registered schema as
57
+ * stringified env values. Used by the plugin and deploy CLI to seed worker
58
+ * `vars` so `c.env.X` and `process.env.X` see the same fallback that the
59
+ * typed `env.X` proxy returns.
60
+ *
61
+ * Detection is schema-agnostic: probe each validator with `undefined` and,
62
+ * if it succeeds with a non-undefined value, that value is the default.
63
+ * Works for our built-in `.default(...)` helpers and for any Standard
64
+ * Schema validator with intrinsic default behaviour. Async validators are
65
+ * skipped (we can't get a sync default).
66
+ *
67
+ * Keys with no default — required keys, plain `.optional()` — are omitted
68
+ * from the result so they don't shadow user `.env*` entries with empty
69
+ * strings.
70
+ */
71
+ declare function _getSchemaDefaults(): Record<string, string>;
72
+ declare class EnvValidationError extends Error {
73
+ readonly key: string;
74
+ readonly issues: Array<StandardSchemaV1.Issue>;
75
+ constructor(key: string, issues: Array<StandardSchemaV1.Issue>);
76
+ }
77
+ /**
78
+ * Typed env proxy. Reads from the runtime env, validating declared keys
79
+ * on first access and passing through bindings / unknown keys unchanged.
80
+ *
81
+ * Sync-only: the `get` trap must be synchronous, so validators that return
82
+ * a `Promise` cannot be awaited here. For async Standard Schema validators,
83
+ * `_validateEnvOnce()` pre-resolves them at worker boot and seeds the
84
+ * per-env cache; property reads then serve the cached value synchronously.
85
+ * If an async validator is encountered here without a prior pre-validation,
86
+ * the trap throws with guidance on how to resolve it.
87
+ */
88
+ declare const env: ValidatedEnv;
89
+ /** Aggregate report from validating an entire env object against the schema. */
90
+ type EnvValidationReport = {
91
+ valid: boolean;
92
+ missing: Array<string>;
93
+ invalid: Array<{
94
+ key: string;
95
+ messages: Array<string>;
96
+ }>;
97
+ /**
98
+ * Resolved values for keys that validated successfully. Used to seed the
99
+ * per-env cache after async pre-validation so sync `env.X` reads hit the
100
+ * cache.
101
+ */
102
+ values: Map<string, unknown>;
103
+ };
104
+ /**
105
+ * Validate an env record (e.g. merged `.env*` + remote secret list) against
106
+ * the registered schema. Used by the dev plugin (warnings), the deploy CLI
107
+ * (hard error), and `_validateEnvOnce` at worker boot.
108
+ *
109
+ * Async: awaits any validators that return a `Promise` (zod async refines,
110
+ * arktype narrows, etc.). Callers already run in async contexts.
111
+ */
112
+ declare function validateAllEnv(envValues: Record<string, unknown>): Promise<EnvValidationReport>;
113
+ declare global {
114
+ namespace Cloudflare {
115
+ interface Env {
116
+ DB: D1Database;
117
+ KV: KVNamespace;
118
+ STORAGE: R2Bucket;
119
+ AI: Ai;
120
+ SANDBOX: DurableObjectNamespace<import("@cloudflare/sandbox").Sandbox>;
121
+ /** @internal Service binding to proxy worker (AI, revalidation, future features) */
122
+ __VOID_PROXY?: Fetcher;
123
+ /** @internal Custom proxy URL override */
124
+ __VOID_PROXY_URL?: string;
125
+ /** @internal Auth token for HTTP proxy (local dev) */
126
+ __VOID_TOKEN?: string;
127
+ /** @internal Project ID for HTTP proxy (local dev) */
128
+ __VOID_PROJECT_ID?: string;
129
+ /** @internal Staging environment flag */
130
+ __VOID_STAGING?: string;
131
+ /** @internal Project ID (service binding path) */
132
+ __PROJECT_ID?: string;
133
+ /** @internal Proxy token (service binding path) */
134
+ __VOID_PROXY_TOKEN?: string;
135
+ [key: `QUEUE_${string}`]: Queue<unknown> | undefined;
136
+ }
137
+ }
138
+ }
139
+ //#endregion
140
+ export { _getSchemaDefaults as a, defineEnv as c, _getRegisteredSchema as i, env as l, EnvValidationReport as n, _hasRegisteredSchema as o, ValidatedEnv as r, _validateEnvOnce as s, EnvValidationError as t, validateAllEnv as u };
@@ -1,5 +1,5 @@
1
- import { s as relative } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
2
- import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
1
+ import { s as relative } from "./dist-DaKKDf8D.mjs";
2
+ import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
3
3
  import { i as voidWarn } from "./log-ChfPKsVd.mjs";
4
4
  import { existsSync } from "node:fs";
5
5
  //#region src/codegen/env-types.ts