@voltro/cli 0.56.0 → 0.57.0

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 (115) hide show
  1. package/CHANGELOG.md +194 -0
  2. package/dist/apiBuild-B83Cb2Rv.js +2 -0
  3. package/dist/{apiBuild-Bdaetr37.js → apiBuild-DDr2aNFd.js} +2 -2
  4. package/dist/bin.js +1 -1
  5. package/dist/{build-CI36wL4R.js → build-QKP6Bm0J.js} +191 -187
  6. package/dist/{checkCommand-D0QV_zM_.js → checkCommand-BISqx1OJ.js} +1 -1
  7. package/dist/{checkCommand-CAwFXrxA.js → checkCommand-DUtMWjcR.js} +4 -4
  8. package/dist/{codegenCommand-CidbQzbv.js → codegenCommand-DnVuDxwT.js} +10 -10
  9. package/dist/{commands-CWjfThXv.js → commands-CRbxgxv0.js} +22 -22
  10. package/dist/{dashboardCommand-BekcY5Ls.js → dashboardCommand-Bf_-Ne3P.js} +5 -5
  11. package/dist/{dataCommand-2pccgbIy.js → dataCommand-BoBJJ-Gb.js} +2 -2
  12. package/dist/{dbCommand-DpK_vQET.js → dbCommand-CMAIz-Bf.js} +3 -3
  13. package/dist/dbCommand-DHi_RuDl.js +2 -0
  14. package/dist/dev-Bl9HqtV7.js +3 -0
  15. package/dist/{dev-Dw263KPu.js → dev-DOEJXicj.js} +2109 -2092
  16. package/dist/{doctorCommand-aR_bFmIi.js → doctorCommand-BrWu67JZ.js} +331 -189
  17. package/dist/doctorCommand-DrQv9SL3.js +2 -0
  18. package/dist/{dormancyCommand-eXTQMbHU.js → dormancyCommand-xn2y-pJm.js} +1 -1
  19. package/dist/{embeddingsCommand-CTmiQvwa.js → embeddingsCommand-Cn5MbRDM.js} +1 -1
  20. package/dist/emptyResultHeadline-Csa5fZOF.js +18 -0
  21. package/dist/{envCommand-BDUgV7EM.js → envCommand-UJmJIbs9.js} +8 -8
  22. package/dist/{evolveCommand-YV8qW1LU.js → evolveCommand-Db30twUy.js} +1 -1
  23. package/dist/frameworkTableAssembly-B96WCNJA.js +2 -0
  24. package/dist/{frameworkTableAssembly-DNOFXfEQ.js → frameworkTableAssembly-vfkzuzEo.js} +104 -85
  25. package/dist/index.js +1 -1
  26. package/dist/inspect-B0hL41s0.js +2 -0
  27. package/dist/{inspect-CNYvNXPU.js → inspect-DZnan87F.js} +68 -52
  28. package/dist/{logsCmd-BU8uCdys.js → logsCmd-C5y9HyrG.js} +58 -53
  29. package/dist/{manifestBuild-CEkjfpwc.js → manifestBuild-DnbFKF6w.js} +1 -1
  30. package/dist/manifestBuild-UXrnUcXP.js +2 -0
  31. package/dist/{migrate-SICulyz1.js → migrate-DtC3lu7H.js} +4 -4
  32. package/dist/{probeCommand-6HxEkNDG.js → probeCommand-C5fuN6Z2.js} +1 -1
  33. package/dist/{runtimeTrace-DgYMc09E.js → runtimeTrace-BQL_lfz6.js} +1 -1
  34. package/dist/{sdkgen-PY-umd6O.js → sdkgen-CMUPrDjH.js} +1 -1
  35. package/dist/{serveCommand-DIJ3ma76.js → serveCommand-B_w-Mpb_.js} +1013 -954
  36. package/dist/serveCommand-Dtb48ffg.js +2 -0
  37. package/dist/serveEntry.js +1 -1
  38. package/dist/{start-B9NGB8gn.js → start-YaUehtDV.js} +564 -571
  39. package/dist/{start-BFQQkL1i.js → start-s25GAIgn.js} +1 -1
  40. package/dist/startEntry.js +1 -1
  41. package/dist/{tracesCmd-BWYDqMy6.js → tracesCmd-C1qKa94g.js} +68 -63
  42. package/dist/{webDev-C2dRz9s5.js → webDev-B6ZMX42w.js} +1 -1
  43. package/dist/{webDev-C53hJdcL.js → webDev-BgdkyjP6.js} +881 -774
  44. package/dist/{webhooksCommand-uuPu8qQX.js → webhooksCommand-CYXTNvXq.js} +2 -2
  45. package/package.json +19 -19
  46. package/templates/AGENTS.md +1 -1
  47. package/templates/agent-docs/_index.md +1 -1
  48. package/templates/agent-docs/_manifest.json +1 -1
  49. package/templates/agent-docs/ai.md +1 -1
  50. package/templates/agent-docs/authentication.md +34 -19
  51. package/templates/agent-docs/cli.md +48 -0
  52. package/templates/agent-docs/configuration.md +29 -4
  53. package/templates/agent-docs/database/scaling.md +10 -1
  54. package/templates/agent-docs/deployment.md +22 -0
  55. package/templates/agent-docs/plugins/audit.md +21 -5
  56. package/templates/agent-docs/plugins/billing.md +2 -0
  57. package/templates/agent-docs/reference.md +1 -0
  58. package/templates/agent-docs/scheduling.md +23 -0
  59. package/templates/agent-docs/schema-driven-ui.md +81 -0
  60. package/templates/agent-docs/whats-new.md +100 -403
  61. package/templates/apps/api-ai/package.json +6 -6
  62. package/templates/apps/api-auth/package.json +8 -8
  63. package/templates/apps/api-backend/package.json +7 -7
  64. package/templates/apps/api-backend-deactivation/package.json +7 -7
  65. package/templates/apps/api-backend-mail/package.json +8 -8
  66. package/templates/apps/api-backend-mariadb/package.json +9 -9
  67. package/templates/apps/api-backend-sqlite/package.json +8 -8
  68. package/templates/apps/api-backend-storage/package.json +8 -8
  69. package/templates/apps/api-cms/package.json +9 -9
  70. package/templates/apps/api-collab/package.json +8 -8
  71. package/templates/apps/api-data-advanced/package.json +8 -8
  72. package/templates/apps/api-durable/package.json +8 -8
  73. package/templates/apps/api-feature-flags/package.json +9 -9
  74. package/templates/apps/api-governance/package.json +8 -8
  75. package/templates/apps/api-kv/package.json +8 -8
  76. package/templates/apps/api-moderation/package.json +8 -8
  77. package/templates/apps/api-observability/package.json +8 -8
  78. package/templates/apps/api-ratelimit/package.json +8 -8
  79. package/templates/apps/api-rbac/package.json +8 -8
  80. package/templates/apps/api-rest/package.json +7 -7
  81. package/templates/apps/api-row-history/package.json +8 -8
  82. package/templates/apps/api-saas/package.json +11 -11
  83. package/templates/apps/api-saas-starter/package.json +10 -10
  84. package/templates/apps/api-search/package.json +8 -8
  85. package/templates/apps/api-status/package.json +8 -8
  86. package/templates/apps/api-webhooks/package.json +9 -9
  87. package/templates/apps/changelog/package.json +7 -7
  88. package/templates/apps/edge-functions/package.json +2 -2
  89. package/templates/apps/frontend-admin/package.json +7 -7
  90. package/templates/apps/frontend-app/package.json +8 -8
  91. package/templates/apps/frontend-auth/package.json +7 -7
  92. package/templates/apps/frontend-blank/package.json +6 -6
  93. package/templates/apps/frontend-cms/package.json +8 -8
  94. package/templates/apps/frontend-collab/package.json +9 -9
  95. package/templates/apps/frontend-contact/package.json +7 -7
  96. package/templates/apps/frontend-dashboard/package.json +6 -6
  97. package/templates/apps/frontend-docs/package.json +8 -8
  98. package/templates/apps/frontend-i18n/package.json +6 -6
  99. package/templates/apps/frontend-landing/package.json +7 -7
  100. package/templates/apps/frontend-portal/package.json +7 -7
  101. package/templates/apps/frontend-saas/package.json +7 -7
  102. package/templates/apps/frontend-spa/package.json +6 -6
  103. package/templates/apps/frontend-ssr/package.json +6 -6
  104. package/templates/apps/frontend-ssr-api/package.json +7 -7
  105. package/templates/apps/frontend-static-blog/package.json +8 -8
  106. package/templates/apps/frontend-status/package.json +7 -7
  107. package/templates/apps/mobile-app/package.json +4 -4
  108. package/dist/apiBuild-Vw1figjO.js +0 -2
  109. package/dist/dbCommand-DrycGWWt.js +0 -2
  110. package/dist/dev-B9Gz0k85.js +0 -3
  111. package/dist/doctorCommand-BMWs6aVm.js +0 -2
  112. package/dist/frameworkTableAssembly-CGNC0qr7.js +0 -2
  113. package/dist/inspect-S2rWy1Ys.js +0 -2
  114. package/dist/manifestBuild-DIa_s6u0.js +0 -2
  115. package/dist/serveCommand-BITS8Hpj.js +0 -2
@@ -1,32 +1,32 @@
1
1
  import { n as e } from "./loadEnv-D9nEOClM.js";
2
2
  import { t } from "./bootRefusal-pgvDxlrU.js";
3
- import { A as n, I as r, M as i, O as a, g as o, j as s, o as c } from "./inspect-CNYvNXPU.js";
3
+ import { A as n, I as r, M as i, O as a, g as o, j as s, o as c } from "./inspect-DZnan87F.js";
4
4
  import { r as l } from "./appPort-B_HpJ_ck.js";
5
5
  import { M as u, _ as d, c as f, g as p, v as m, y as h } from "./fileConventions-l-RIXbx8.js";
6
6
  import { n as g, t as _ } from "./workspaceDeps-RKEkX92S.js";
7
7
  import { n as v } from "./agentsMd-BaLC10Na.js";
8
8
  import { c as y, f as ee, p as b, t as x } from "./renderModeScan-43yQ2opo.js";
9
- import { a as S, c as C, d as w, f as T, i as E, l as te, o as ne, p as D, r as O, s as re, t as k } from "./imagePipeline-CBZmjT4i.js";
10
- import { d as A, n as j } from "./fontPipeline-Tsh8kZfA.js";
11
- import { t as M } from "./pageConvention-CMpfDN6r.js";
9
+ import { a as S, c as C, d as w, f as T, i as E, l as D, o as O, p as te, r as k, s as ne, t as A } from "./imagePipeline-CBZmjT4i.js";
10
+ import { d as j, n as M } from "./fontPipeline-Tsh8kZfA.js";
11
+ import { t as re } from "./pageConvention-CMpfDN6r.js";
12
12
  import { i as ie, n as ae, r as oe, t as se } from "./runtimeRegistry-DMeKfTHP.js";
13
13
  import { n as ce } from "./logFileSink-B4uP8pvf.js";
14
14
  import { basename as le, dirname as N, extname as ue, join as P, relative as F, resolve as I, sep as de } from "node:path";
15
- import { existsSync as L, mkdirSync as R, promises as z, readFileSync as B, readdirSync as V, statSync as fe, unwatchFile as pe, watchFile as H, writeFileSync as me } from "node:fs";
16
- import { fileURLToPath as he, pathToFileURL as U } from "node:url";
17
- import { addSink as ge, createLogger as W, printReadyBlock as _e } from "@voltro/logger";
18
- import { replicaId as ve } from "@voltro/protocol/identity";
19
- import { classifyRequestOrigin as ye, currentTraceContext as be, resolveOriginGuardConfig as xe, resolveSecret as Se } from "@voltro/runtime";
20
- import { Metric as G, MetricBoundaries as Ce } from "effect";
21
- import { createRequire as we } from "node:module";
22
- import { homedir as Te } from "node:os";
23
- import { FRAMEWORK_ENV_CATALOG as Ee, appEnvEntries as De, checkEnvNaming as Oe, formatEnvErrors as ke, installEnvSnapshot as Ae, isEnvContract as je, pluginEnvEntries as Me, renderDotEnvExample as Ne, resolveEnv as Pe } from "@voltro/env";
24
- import { __installPublicEnv as Fe } from "@voltro/env/public";
25
- import { mkdir as K, readFile as Ie, writeFile as q } from "node:fs/promises";
15
+ import { existsSync as L, mkdirSync as R, promises as z, readFileSync as B, readdirSync as V, statSync as H, unwatchFile as fe, watchFile as pe, writeFileSync as U } from "node:fs";
16
+ import { fileURLToPath as W, pathToFileURL as G } from "node:url";
17
+ import { addSink as me, createLogger as K, printReadyBlock as he } from "@voltro/logger";
18
+ import { replicaId as ge } from "@voltro/protocol/identity";
19
+ import { classifyRequestOrigin as _e, currentTraceContext as ve, resolveOriginGuardConfig as ye, resolveSecret as be } from "@voltro/runtime";
20
+ import { Metric as xe, MetricBoundaries as Se } from "effect";
21
+ import { createRequire as Ce } from "node:module";
22
+ import { homedir as we } from "node:os";
23
+ import { FRAMEWORK_ENV_CATALOG as Te, appEnvEntries as Ee, checkEnvNaming as De, formatEnvErrors as Oe, installEnvSnapshot as ke, isEnvContract as Ae, pluginEnvEntries as je, renderDotEnvExample as Me, resolveEnv as Ne } from "@voltro/env";
24
+ import { __installPublicEnv as Pe } from "@voltro/env/public";
25
+ import { mkdir as Fe, readFile as Ie, writeFile as q } from "node:fs/promises";
26
26
  import { createHash as J, createHmac as Le, randomBytes as Re, timingSafeEqual as ze } from "node:crypto";
27
27
  import { spawn as Be } from "node:child_process";
28
- import { createConnection as Y } from "node:net";
29
- import { FORM_FLASH_SCRIPT_ID as Ve, FORM_KEY_FIELD as He, FORM_PATH_PREFIX as Ue, FORM_PATH_PREFIX as We, FORM_REDIRECT_FIELD as Ge, formDataToInput as Ke, validateFields as qe } from "@voltro/client/form";
28
+ import { createConnection as Ve } from "node:net";
29
+ import { FORM_FLASH_SCRIPT_ID as Y, FORM_KEY_FIELD as He, FORM_PATH_PREFIX as Ue, FORM_PATH_PREFIX as We, FORM_REDIRECT_FIELD as Ge, formDataToInput as Ke, validateFields as qe } from "@voltro/client/form";
30
30
  import { buildFeed as Je, contentArtifactPath as Ye, getCollection as Xe, getEntry as Ze, invalidateContentCache as Qe, registeredCollections as $e, setContentAssetResolver as et, setContentRoot as tt, validateReferences as nt } from "@voltro/content";
31
31
  import { PassThrough as rt } from "node:stream";
32
32
  //#region src/inspectEvents.ts
@@ -38,7 +38,7 @@ var it = 256, at = (e = it) => {
38
38
  ts: Date.now(),
39
39
  channel: r,
40
40
  payload: i,
41
- origin: ve()
41
+ origin: ge()
42
42
  };
43
43
  t.push(a), t.length > e && t.shift();
44
44
  for (let e of n) try {
@@ -84,7 +84,7 @@ ${n.length > 0 ? n : " // (no public variables declared)"}
84
84
  }
85
85
  }
86
86
  `, i = P(e, "src");
87
- await K(i, { recursive: !0 }), await q(P(i, "voltro-env.d.ts"), r, "utf8");
87
+ await Fe(i, { recursive: !0 }), await q(P(i, "voltro-env.d.ts"), r, "utf8");
88
88
  }, ht = async (e, t) => {
89
89
  let n = `${ut}
90
90
  import { __installPublicEnv } from '@voltro/env/public'
@@ -94,20 +94,78 @@ export const publicEnvValues = ${JSON.stringify(t, null, 2)} as const
94
94
  // Set the browser/SSR-shared global the \`publicEnv\` accessor reads.
95
95
  __installPublicEnv(publicEnvValues)
96
96
  `;
97
- await K(e, { recursive: !0 }), await q(P(e, "env.public.ts"), n, "utf8");
98
- }, gt = async (e) => {
99
- let t = je(e.rawEnv) ? e.rawEnv : void 0, n = await Pe({
97
+ await Fe(e, { recursive: !0 }), await q(P(e, "env.public.ts"), n, "utf8");
98
+ }, gt = (e, t) => {
99
+ let n = new Set(Object.keys(Ae(e) ? e.vars : {})), r = /* @__PURE__ */ new Map();
100
+ for (let [e, i] of (t ?? []).entries()) {
101
+ let t = i.name ?? `plugin #${e + 1}`;
102
+ for (let e of i.declaredEnv ?? []) {
103
+ if (n.has(e.name)) continue;
104
+ let i = r.get(e.name);
105
+ if (i === void 0) {
106
+ if (!e.required) continue;
107
+ r.set(e.name, {
108
+ name: e.name,
109
+ secret: e.secret,
110
+ requiredBy: t,
111
+ ...e.description === void 0 ? {} : { description: e.description }
112
+ });
113
+ continue;
114
+ }
115
+ r.set(e.name, {
116
+ ...i,
117
+ secret: i.secret || e.secret,
118
+ requiredBy: i.requiredBy.includes(t) ? i.requiredBy : `${i.requiredBy} and ${t}`
119
+ });
120
+ }
121
+ }
122
+ return [...r.values()];
123
+ }, _t = async (e, t = {}) => {
124
+ let n = t.readEnv ?? ((e) => process.env[e]), r = t.readSecret ?? be, i = [];
125
+ for (let t of e) {
126
+ let e;
127
+ try {
128
+ e = t.secret ? await r(t.name) : n(t.name);
129
+ } catch (e) {
130
+ i.push({
131
+ name: t.name,
132
+ requiredBy: t.requiredBy,
133
+ reason: "unreadable",
134
+ detail: e instanceof Error ? e.message : String(e),
135
+ ...t.description === void 0 ? {} : { description: t.description }
136
+ });
137
+ continue;
138
+ }
139
+ (e === void 0 || e === "") && i.push({
140
+ name: t.name,
141
+ requiredBy: t.requiredBy,
142
+ reason: "missing",
143
+ ...t.description === void 0 ? {} : { description: t.description }
144
+ });
145
+ }
146
+ return i;
147
+ }, vt = (e) => {
148
+ let t = e.map((e) => {
149
+ let t = e.reason === "missing" ? ` • ${e.name} — required by ${e.requiredBy}, and nothing set it` : ` • ${e.name} — required by ${e.requiredBy}, and the secrets backend could not answer: ${e.detail ?? "no detail"}`;
150
+ return e.description === void 0 ? t : `${t}\n ${e.description}`;
151
+ });
152
+ return `plugin environment validation failed (${e.length} ${e.length === 1 ? "variable" : "variables"}):\n${t.join("\n")}\n → set the variable, or pass the value as a plugin option if the plugin takes one, or
153
+ declare it yourself in app.config.ts's \`env\` (an app declaration overrides a plugin's).`;
154
+ }, yt = async (e) => {
155
+ let t = Ae(e.rawEnv) ? e.rawEnv : void 0, n = await Ne({
100
156
  contract: t,
101
- resolveSecret: Se
102
- }), r = [...n.errors, ...Oe(t, e.appType)];
103
- if (r.length > 0) throw Error(ke(r));
104
- Ae(n.values), e.appType === "web" && Fe(n.publicValues);
105
- let i = t ? Object.keys(t.vars).length : 0;
106
- if (i > 0) {
157
+ resolveSecret: be
158
+ }), r = [...n.errors, ...De(t, e.appType)];
159
+ if (r.length > 0) throw Error(Oe(r));
160
+ let i = await _t(gt(e.rawEnv, e.plugins));
161
+ if (i.length > 0) throw Error(vt(i));
162
+ ke(n.values), e.appType === "web" && Pe(n.publicValues);
163
+ let a = t ? Object.keys(t.vars).length : 0;
164
+ if (a > 0) {
107
165
  let r = Object.keys(n.publicValues).length;
108
- if (e.log.info(`env: ${i} declared var(s) validated`, {
166
+ if (e.log.info(`env: ${a} declared var(s) validated`, {
109
167
  public: r,
110
- secret: i - r
168
+ secret: a - r
111
169
  }), e.appType === "web" && t) {
112
170
  let n = Object.entries(t.vars).filter(([, e]) => e.access === "secret").map(([e]) => e);
113
171
  n.length > 0 && e.log.warn(`env: ${n.length} secret var(s) declared on a web app — secrets are reachable only from server-side render code and are NEVER bundled. Prefer declaring secrets on the api.`, { keys: n });
@@ -117,16 +175,16 @@ __installPublicEnv(publicEnvValues)
117
175
  resolved: n,
118
176
  contract: t
119
177
  };
120
- }, _t = (e) => {
121
- let t = De(e.contract), n = (e.plugins ?? []).flatMap((e) => Me(e.name, e.declaredEnv)), r = e.includeFramework === !1 ? [] : Ee, i = /* @__PURE__ */ new Set(), a = [];
178
+ }, bt = (e) => {
179
+ let t = Ee(e.contract), n = (e.plugins ?? []).flatMap((e) => je(e.name, e.declaredEnv)), r = e.includeFramework === !1 ? [] : Te, i = /* @__PURE__ */ new Set(), a = [];
122
180
  for (let e of [
123
181
  ...t,
124
182
  ...n,
125
183
  ...r
126
184
  ]) i.has(e.key) || (i.add(e.key), a.push(e));
127
185
  return a;
128
- }, vt = (e, t, n = (e) => process.env[e]) => {
129
- let r = _t(t).map((e) => {
186
+ }, xt = (e, t, n = (e) => process.env[e]) => {
187
+ let r = bt(t).map((e) => {
130
188
  let t = n(e.key) !== void 0;
131
189
  return {
132
190
  ...e,
@@ -143,16 +201,16 @@ __installPublicEnv(publicEnvValues)
143
201
  missingRequired: r.filter((e) => e.required && !e.isSet && e.default === void 0).length
144
202
  }
145
203
  };
146
- }, yt = (e, t) => {
147
- let n = _t({
204
+ }, St = (e, t) => {
205
+ let n = bt({
148
206
  ...e,
149
207
  includeFramework: !1
150
208
  });
151
- return Ne(n, {
209
+ return Me(n, {
152
210
  includeFramework: e.includeFramework !== !1,
153
211
  ...t ? { header: t } : {}
154
212
  });
155
- }, bt = 500, xt = (e, t, n = {}) => {
213
+ }, Ct = 500, wt = (e, t, n = {}) => {
156
214
  if (e.length === 0) return () => {};
157
215
  let r = (e) => n.root ? F(n.root, e) : e, i = !1, a = (e) => {
158
216
  i || (i = !0, t.warn(`.env changed (${r(e)}) — hard-restarting: process.env is read once at boot, a reload would keep stale values`, { file: r(e) }), Promise.resolve().then(() => n.onBeforeRestart?.()).catch((e) => t.warn(".env restart: onBeforeRestart failed (continuing)", {}, e)).finally(() => {
@@ -170,22 +228,22 @@ __installPublicEnv(publicEnvValues)
170
228
  });
171
229
  }));
172
230
  };
173
- for (let t of e) H(t, { interval: bt }, (e, n) => {
231
+ for (let t of e) pe(t, { interval: Ct }, (e, n) => {
174
232
  e.mtimeMs !== n.mtimeMs && a(t);
175
233
  });
176
234
  return t.info("watching .env files for changes", {
177
235
  files: e.map(r),
178
- intervalMs: bt
236
+ intervalMs: Ct
179
237
  }), () => {
180
- for (let t of e) pe(t);
238
+ for (let t of e) fe(t);
181
239
  };
182
- }, St = [{
240
+ }, Tt = [{
183
241
  host: "127.0.0.1",
184
242
  family: "IPv4"
185
243
  }, {
186
244
  host: "::1",
187
245
  family: "IPv6"
188
- }], Ct = (e, t, n) => new Promise((r) => {
246
+ }], Et = (e, t, n) => new Promise((r) => {
189
247
  let i = !1, a = (e) => {
190
248
  if (!i) {
191
249
  i = !0;
@@ -194,15 +252,15 @@ __installPublicEnv(publicEnvValues)
194
252
  } catch {}
195
253
  r(e);
196
254
  }
197
- }, o = Y({
255
+ }, o = Ve({
198
256
  host: e,
199
257
  port: t
200
258
  });
201
259
  o.once("connect", () => a(!0)), o.once("error", () => a(!1)), o.setTimeout(n, () => a(!1));
202
- }), wt = async (e, t = 400) => ({ families: (await Promise.all(St.map(async (n) => ({
260
+ }), Dt = async (e, t = 400) => ({ families: (await Promise.all(Tt.map(async (n) => ({
203
261
  family: n.family,
204
- taken: await Ct(n.host, e, t)
205
- })))).filter((e) => e.taken).map((e) => e.family) }), Tt = (e, t, n) => [
262
+ taken: await Et(n.host, e, t)
263
+ })))).filter((e) => e.taken).map((e) => e.family) }), Ot = (e, t, n) => [
206
264
  `${t}: port ${e} is already being served (${n.join(" + ")}).`,
207
265
  "",
208
266
  " Refusing to start. This is NOT a spurious check — a second listener can",
@@ -217,10 +275,10 @@ __installPublicEnv(publicEnvValues)
217
275
  "",
218
276
  " Then re-run. To use a different port instead, change `port` in",
219
277
  " app.config.ts."
220
- ].join("\n"), Et = async (e, n) => {
221
- let { families: r } = await wt(e);
222
- if (r.length !== 0) throw t(Tt(e, n, r));
223
- }, Dt = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", Ot = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, kt = (e) => {
278
+ ].join("\n"), kt = async (e, n) => {
279
+ let { families: r } = await Dt(e);
280
+ if (r.length !== 0) throw t(Ot(e, n, r));
281
+ }, At = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", jt = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, Mt = (e) => {
224
282
  let t = [], n = e;
225
283
  for (let e = 0; e < 12; e++) {
226
284
  let e = P(n, "node_modules");
@@ -230,7 +288,7 @@ __installPublicEnv(publicEnvValues)
230
288
  n = r;
231
289
  }
232
290
  return t;
233
- }, At = (e) => {
291
+ }, Nt = (e) => {
234
292
  let t = /* @__PURE__ */ new Set([e]), n = e;
235
293
  for (let e = 0; e < 12; e++) {
236
294
  for (let e of ["pnpm-workspace.yaml", "pnpm-workspace.yml"]) {
@@ -268,9 +326,9 @@ __installPublicEnv(publicEnvValues)
268
326
  n = e;
269
327
  }
270
328
  return [...t];
271
- }, jt = (e) => {
329
+ }, Pt = (e) => {
272
330
  let t = [];
273
- for (let n of At(e)) {
331
+ for (let n of Nt(e)) {
274
332
  let e = P(n, "node_modules", "@voltro"), r;
275
333
  try {
276
334
  r = V(e);
@@ -278,7 +336,7 @@ __installPublicEnv(publicEnvValues)
278
336
  continue;
279
337
  }
280
338
  for (let n of r) {
281
- let r = P(e, n), i = Mt(r);
339
+ let r = P(e, n), i = Ft(r);
282
340
  i !== void 0 && t.push({
283
341
  pkg: `@voltro/${n}`,
284
342
  version: i,
@@ -287,14 +345,14 @@ __installPublicEnv(publicEnvValues)
287
345
  }
288
346
  }
289
347
  return t;
290
- }, Mt = (e) => {
348
+ }, Ft = (e) => {
291
349
  try {
292
350
  let t = JSON.parse(B(P(e, "package.json"), "utf8"));
293
351
  return typeof t.version == "string" ? t.version : void 0;
294
352
  } catch {
295
353
  return;
296
354
  }
297
- }, Nt = (e) => {
355
+ }, It = (e) => {
298
356
  let t = [], n;
299
357
  try {
300
358
  n = V(e);
@@ -302,7 +360,7 @@ __installPublicEnv(publicEnvValues)
302
360
  return t;
303
361
  }
304
362
  for (let r of n) {
305
- if (r.startsWith(".") || Ot.test(r)) continue;
363
+ if (r.startsWith(".") || jt.test(r)) continue;
306
364
  let n = P(e, r);
307
365
  if (r.startsWith("@")) {
308
366
  let e;
@@ -318,7 +376,7 @@ __installPublicEnv(publicEnvValues)
318
376
  continue;
319
377
  }
320
378
  try {
321
- if (!fe(n).isDirectory()) continue;
379
+ if (!H(n).isDirectory()) continue;
322
380
  } catch {
323
381
  continue;
324
382
  }
@@ -328,17 +386,17 @@ __installPublicEnv(publicEnvValues)
328
386
  });
329
387
  }
330
388
  return t;
331
- }, Pt = (e) => {
389
+ }, Lt = (e) => {
332
390
  let t = /* @__PURE__ */ new Map(), n = (e, n, r) => {
333
- if (!Dt(e)) return;
391
+ if (!At(e)) return;
334
392
  let i = t.get(e) ?? /* @__PURE__ */ new Map();
335
393
  i.has(n) || i.set(n, r), t.set(e, i);
336
394
  };
337
- for (let t of kt(e)) for (let { pkg: e, dir: r } of Nt(t)) {
338
- let t = Mt(r);
395
+ for (let t of Mt(e)) for (let { pkg: e, dir: r } of It(t)) {
396
+ let t = Ft(r);
339
397
  t !== void 0 && n(e, t, r);
340
398
  }
341
- for (let { pkg: t, version: r, dir: i } of jt(e)) n(t, r, i);
399
+ for (let { pkg: t, version: r, dir: i } of Pt(e)) n(t, r, i);
342
400
  let r = [];
343
401
  for (let [n, i] of t) i.size < 2 || r.push({
344
402
  pkg: n,
@@ -346,7 +404,7 @@ __installPublicEnv(publicEnvValues)
346
404
  paths: [...i.values()].map((t) => F(e, t)).sort()
347
405
  });
348
406
  return r.sort((e, t) => e.pkg.localeCompare(t.pkg));
349
- }, Ft = (e) => {
407
+ }, Rt = (e) => {
350
408
  if (e.length !== 0) return [
351
409
  `• ${e.length} package(s) resolved at more than one version:`,
352
410
  ...e.flatMap((e) => [` ${e.pkg} — ${e.versions.join(", ")}`, ...e.paths.map((e) => ` ${e}`)]),
@@ -364,11 +422,11 @@ __installPublicEnv(publicEnvValues)
364
422
  " instrument), then reinstall. Do not silence the generated file — it is where",
365
423
  " a genuine mistake in your own descriptors surfaces."
366
424
  ].join("\n");
367
- }, It = (e) => {
425
+ }, zt = (e) => {
368
426
  let t = /* @__PURE__ */ new Map();
369
- for (let n of kt(e)) for (let { pkg: e, dir: r } of Nt(n)) {
427
+ for (let n of Mt(e)) for (let { pkg: e, dir: r } of It(n)) {
370
428
  if (!e.startsWith("@voltro/")) continue;
371
- let n = Mt(r);
429
+ let n = Ft(r);
372
430
  n !== void 0 && !t.has(e) && t.set(e, n);
373
431
  }
374
432
  if (t.size < 2) return;
@@ -383,7 +441,7 @@ __installPublicEnv(publicEnvValues)
383
441
  version: t
384
442
  })).sort((e, t) => e.pkg.localeCompare(t.pkg))
385
443
  };
386
- }, Lt = (e) => {
444
+ }, Bt = (e) => {
387
445
  if (e !== void 0) return [
388
446
  `• ${e.behind.length} @voltro/* package(s) are not on ${e.majority}:`,
389
447
  ...e.behind.map((e) => ` ${e.pkg} ${e.version}`),
@@ -401,59 +459,59 @@ __installPublicEnv(publicEnvValues)
401
459
  " its pattern: the one that produced this report was `@voltro/[a-z-]+`,",
402
460
  " which silently skips `@voltro/i18n` because the name contains digits."
403
461
  ].join("\n");
404
- }, Rt = (e, t) => {
405
- let n = It(e);
462
+ }, Vt = (e, t) => {
463
+ let n = zt(e);
406
464
  n !== void 0 && t.warn?.(`@voltro/* version skew: ${n.behind.length} package(s) are not on ${n.majority}`, {
407
465
  majority: n.majority,
408
466
  behind: n.behind.map((e) => `${e.pkg}@${e.version}`),
409
467
  fix: "the framework ships in lockstep; bump the listed packages and reinstall"
410
468
  });
411
- }, zt = W({ scope: "vite" }), Bt = /\x1b\[[0-9;]*m/g, Vt = /^\s*\[?vite\]?\s*(\([a-z-]+\)\s*)?/, Ht = (e) => e.replace(Bt, "").replace(Vt, "").trim(), Ut = /proxy error/i, Wt = [
469
+ }, Ht = K({ scope: "vite" }), Ut = /\x1b\[[0-9;]*m/g, Wt = /^\s*\[?vite\]?\s*(\([a-z-]+\)\s*)?/, Gt = (e) => e.replace(Ut, "").replace(Wt, "").trim(), Kt = /proxy error/i, qt = [
412
470
  "ECONNREFUSED",
413
471
  "ECONNRESET",
414
472
  "ECONNABORTED",
415
473
  "EPIPE",
416
474
  "ETIMEDOUT"
417
- ], Gt = (e, t = 0) => {
475
+ ], Jt = (e, t = 0) => {
418
476
  if (e == null || t > 5) return !1;
419
477
  let n = e;
420
- return typeof n.code == "string" && Wt.includes(n.code) || typeof n.message == "string" && Wt.some((e) => n.message.includes(e)) || Array.isArray(n.errors) && n.errors.some((e) => Gt(e, t + 1)) ? !0 : Gt(n.cause, t + 1);
421
- }, Kt = 4e3, qt = () => {
478
+ return typeof n.code == "string" && qt.includes(n.code) || typeof n.message == "string" && qt.some((e) => n.message.includes(e)) || Array.isArray(n.errors) && n.errors.some((e) => Jt(e, t + 1)) ? !0 : Jt(n.cause, t + 1);
479
+ }, Yt = 4e3, Xt = () => {
422
480
  let e = /* @__PURE__ */ new Set(), t = 0, n = {
423
481
  hasWarned: !1,
424
482
  info: (e) => {
425
- let t = Ht(e);
426
- t.length !== 0 && zt.info(t);
483
+ let t = Gt(e);
484
+ t.length !== 0 && Ht.info(t);
427
485
  },
428
486
  warn: (e) => {
429
487
  n.hasWarned = !0;
430
- let t = Ht(e);
431
- t.length !== 0 && zt.warn(t);
488
+ let t = Gt(e);
489
+ t.length !== 0 && Ht.warn(t);
432
490
  },
433
491
  warnOnce: (t) => {
434
- let r = Ht(t);
435
- e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && zt.warn(r));
492
+ let r = Gt(t);
493
+ e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && Ht.warn(r));
436
494
  },
437
495
  error: (e, n) => {
438
- let r = Ht(e), i = n?.error;
496
+ let r = Gt(e), i = n?.error;
439
497
  if (r.length !== 0) {
440
- if (Ut.test(r) && Gt(i)) {
498
+ if (Kt.test(r) && Jt(i)) {
441
499
  let e = Date.now();
442
- e - t > Kt && (t = e, zt.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
500
+ e - t > Yt && (t = e, Ht.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
443
501
  return;
444
502
  }
445
- zt.error(r, {}, i);
503
+ Ht.error(r, {}, i);
446
504
  }
447
505
  },
448
506
  clearScreen: () => {},
449
507
  hasErrorLogged: (e) => !1
450
508
  };
451
509
  return n;
452
- }, Jt = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), Yt = (e) => {
510
+ }, Zt = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), Qt = (e) => {
453
511
  try {
454
512
  let t = P(e, "tsconfig.json");
455
513
  if (!L(t)) return [];
456
- let n = JSON.parse(Jt(B(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = n.baseUrl ?? ".", a = I(e, i), o = [];
514
+ let n = JSON.parse(Zt(B(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = n.baseUrl ?? ".", a = I(e, i), o = [];
457
515
  for (let [e, t] of Object.entries(r)) {
458
516
  let n = t[0];
459
517
  if (!n) continue;
@@ -475,12 +533,12 @@ __installPublicEnv(publicEnvValues)
475
533
  } catch {
476
534
  return [];
477
535
  }
478
- }, Xt = (e = process.env) => {
536
+ }, $t = (e = process.env) => {
479
537
  let t = e.VOLTRO_DEV_SSR_COMPILE_CONCURRENCY;
480
538
  if (t === void 0 || t.trim() === "") return 4;
481
539
  let n = Number(t);
482
540
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 4;
483
- }, Zt = (e) => {
541
+ }, en = (e) => {
484
542
  let t = Math.max(1, Math.floor(e)), n = 0, r = [], i = () => n < t ? (n++, Promise.resolve()) : new Promise((e) => r.push(e)), a = () => {
485
543
  let e = r.shift();
486
544
  e ? e() : n--;
@@ -498,8 +556,8 @@ __installPublicEnv(publicEnvValues)
498
556
  return n;
499
557
  }
500
558
  };
501
- }, Qt = (e) => {
502
- let t = Zt(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
559
+ }, tn = (e) => {
560
+ let t = en(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
503
561
  return {
504
562
  load: (i, a) => {
505
563
  if (r.has(i)) return a();
@@ -529,23 +587,23 @@ __installPublicEnv(publicEnvValues)
529
587
  return r.size;
530
588
  }
531
589
  };
532
- }, $t = 1048576, en = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), tn = (e) => JSON.stringify(e).replace(/</g, "\\u003c"), nn = (e, t) => {
533
- let n = `<script type="application/json" id="${Ve}">${tn(t)}<\/script>`;
590
+ }, nn = 1048576, rn = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), an = (e) => JSON.stringify(e).replace(/</g, "\\u003c"), on = (e, t) => {
591
+ let n = `<script type="application/json" id="${Y}">${an(t)}<\/script>`;
534
592
  return e.includes("</body>") ? e.replace("</body>", `${n}</body>`) : e + n;
535
- }, rn = (e) => {
536
- let t = Object.entries(e.errors).map(([e, t]) => `<li><strong>${en(e)}</strong>: ${en(t)}</li>`).join("");
537
- return `<!doctype html><html><head><meta charset="utf-8"><title>Form submission failed</title></head><body><h1>Submission failed</h1>${e.formError === void 0 ? "" : `<p>${en(e.formError)}</p>`}<ul>${t}</ul><p><a href="javascript:history.back()">Go back</a> to correct the form.</p></body></html>`;
593
+ }, sn = (e) => {
594
+ let t = Object.entries(e.errors).map(([e, t]) => `<li><strong>${rn(e)}</strong>: ${rn(t)}</li>`).join("");
595
+ return `<!doctype html><html><head><meta charset="utf-8"><title>Form submission failed</title></head><body><h1>Submission failed</h1>${e.formError === void 0 ? "" : `<p>${rn(e.formError)}</p>`}<ul>${t}</ul><p><a href="javascript:history.back()">Go back</a> to correct the form.</p></body></html>`;
538
596
  }, X = (e, t, n, r = "text/plain; charset=utf-8") => {
539
597
  e.statusCode = t, e.setHeader("content-type", r), e.end(n);
540
- }, an = (e, t, n) => {
598
+ }, cn = (e, t, n) => {
541
599
  e.setHeader("cache-control", "no-store"), X(e, t, n, "text/html; charset=utf-8");
542
- }, on = (e) => {
600
+ }, ln = (e) => {
543
601
  if (e !== void 0 && e !== "" && !(!e.startsWith("/") || e.startsWith("//") || e.includes("\\"))) return e;
544
- }, sn = (e, t) => {
602
+ }, un = (e, t) => {
545
603
  if (e === void 0 || t === void 0 || t.length === 0) return;
546
604
  let n = e.replace(/^\/+/, "").split(/[/?#]/)[0];
547
605
  if (n !== void 0 && n !== "") return t.includes(n) ? n : void 0;
548
- }, cn = (e) => {
606
+ }, dn = (e) => {
549
607
  let t = e.referer;
550
608
  if (t !== void 0) try {
551
609
  let e = new URL(t);
@@ -553,10 +611,10 @@ __installPublicEnv(publicEnvValues)
553
611
  } catch {
554
612
  return;
555
613
  }
556
- }, ln = (e) => new Promise((t) => {
614
+ }, fn = (e) => new Promise((t) => {
557
615
  let n = [], r = 0;
558
616
  e.on("data", (i) => {
559
- if (r += i.length, r > $t) {
617
+ if (r += i.length, r > nn) {
560
618
  e.removeAllListeners("data"), e.removeAllListeners("end"), t({ ok: !1 });
561
619
  return;
562
620
  }
@@ -565,32 +623,32 @@ __installPublicEnv(publicEnvValues)
565
623
  ok: !0,
566
624
  body: Buffer.concat(n).toString("utf8")
567
625
  })), e.on("error", () => t({ ok: !1 }));
568
- }), un = (e) => {
626
+ }), pn = (e) => {
569
627
  let t = {};
570
628
  for (let [n, r] of Object.entries(e.headers)) typeof r == "string" ? t[n.toLowerCase()] = r : Array.isArray(r) && (t[n.toLowerCase()] = r.join(", "));
571
629
  return t;
572
- }, dn = (e) => {
573
- let t = e.originGuard ?? xe(void 0, process.env);
630
+ }, mn = (e) => {
631
+ let t = e.originGuard ?? ye(void 0, process.env);
574
632
  return async (n, r, i) => {
575
633
  let a = (n.url ?? "/").split("?")[0];
576
634
  if (!a.startsWith(Ue)) return !1;
577
635
  if (n.method !== "POST") return r.setHeader("allow", "POST"), X(r, 405, "method not allowed — a /form/* endpoint accepts native form POSTs only"), !0;
578
- let o = un(n);
579
- if (!ye({
636
+ let o = pn(n);
637
+ if (!_e({
580
638
  headers: o,
581
639
  config: t
582
640
  }).allowed) return X(r, 403, "origin not allowed"), !0;
583
641
  if ((o["content-type"] ?? "").includes("multipart/form-data")) return X(r, 415, "file uploads need JavaScript — the no-JS form path accepts application/x-www-form-urlencoded only"), !0;
584
- let s = await ln(n);
585
- if (!s.ok) return X(r, 413, `form body exceeds ${$t} bytes`), !0;
642
+ let s = await fn(n);
643
+ if (!s.ok) return X(r, 413, `form body exceeds ${nn} bytes`), !0;
586
644
  let c = new URLSearchParams(s.body), l = decodeURIComponent(a.slice(Ue.length)), u = (await e.loadDescriptors())?.[l];
587
645
  if (u === void 0 || u.kind !== "mutation") return X(r, 404, `no mutation '${l}' — /form/* serves declared mutations only`), !0;
588
- let d = c.get(He) ?? l, f = on(c.get(Ge) ?? void 0), p = [];
646
+ let d = c.get(He) ?? l, f = ln(c.get(Ge) ?? void 0), p = [];
589
647
  for (let [e, t] of c) e !== He && e !== Ge && p.push([e, t]);
590
648
  let m = u.input;
591
649
  if (m === void 0) return X(r, 404, `mutation '${l}' carries no input schema — the no-JS path cannot map its POST`), !0;
592
- let h = Ke(m, p), g = qe(m, h, { locale: await e.resolveLocale(o, cn(o)) }), _ = async (t) => {
593
- let n = cn(o);
650
+ let h = Ke(m, p), g = qe(m, h, { locale: await e.resolveLocale(o, dn(o)) }), _ = async (t) => {
651
+ let n = dn(o);
594
652
  if (n !== void 0) {
595
653
  if (i !== void 0) {
596
654
  i(n, t);
@@ -602,11 +660,11 @@ __installPublicEnv(publicEnvValues)
602
660
  flash: t
603
661
  });
604
662
  if (a !== void 0) {
605
- an(r, 422, nn(a, t));
663
+ cn(r, 422, on(a, t));
606
664
  return;
607
665
  }
608
666
  }
609
- an(r, 422, rn(t));
667
+ cn(r, 422, sn(t));
610
668
  };
611
669
  if (!g.valid) return await _({
612
670
  formKey: d,
@@ -626,10 +684,10 @@ __installPublicEnv(publicEnvValues)
626
684
  formError: t?.message ?? t?._tag ?? "The server rejected this submission. Please try again."
627
685
  }), !0;
628
686
  }
629
- let y = f ?? cn(o) ?? "/";
687
+ let y = f ?? dn(o) ?? "/";
630
688
  return r.statusCode = 303, r.setHeader("location", y), r.end(), !0;
631
689
  };
632
- }, fn = /^\s*(?:import|export)\s[^;'"]*?['"]([^'"]+)['"]/gm, pn = [
690
+ }, hn = /^\s*(?:import|export)\s[^;'"]*?['"]([^'"]+)['"]/gm, gn = [
633
691
  "",
634
692
  ".tsx",
635
693
  ".ts",
@@ -637,19 +695,19 @@ __installPublicEnv(publicEnvValues)
637
695
  ".js",
638
696
  "/index.tsx",
639
697
  "/index.ts"
640
- ], mn = (e) => /\.island\.(tsx|ts|jsx|js)$/.test(e), hn = ["@voltro/web", "@voltro/i18n"], gn = ["@voltro/client", "@voltro/ui"], _n = (e, t) => e === t || e.startsWith(`${t}/`), vn = (e) => e !== "@voltro/web/islands" && hn.some((t) => _n(e, t)), yn = (e) => {
698
+ ], _n = (e) => /\.island\.(tsx|ts|jsx|js)$/.test(e), vn = ["@voltro/web", "@voltro/i18n"], yn = ["@voltro/client", "@voltro/ui"], bn = (e, t) => e === t || e.startsWith(`${t}/`), xn = (e) => e !== "@voltro/web/islands" && vn.some((t) => bn(e, t)), Sn = (e) => {
641
699
  let t = [];
642
- for (let n of e.matchAll(fn)) t.push(n[1]);
700
+ for (let n of e.matchAll(hn)) t.push(n[1]);
643
701
  return t;
644
- }, bn = async (e, t) => {
702
+ }, Cn = async (e, t) => {
645
703
  let n = I(N(e), t);
646
- for (let e of pn) {
704
+ for (let e of gn) {
647
705
  let t = n + e;
648
706
  try {
649
707
  if ((await z.stat(t)).isFile()) return t;
650
708
  } catch {}
651
709
  }
652
- }, xn = async (e, t) => {
710
+ }, wn = async (e, t) => {
653
711
  let n = P(e, "src", "pages", t), r = /* @__PURE__ */ new Set(), i = [], a = !1, o = [], s = async (t, n) => {
654
712
  let c = `${t}\u0000${n ? "i" : "p"}`;
655
713
  if (r.has(c)) return;
@@ -660,64 +718,64 @@ __installPublicEnv(publicEnvValues)
660
718
  } catch {
661
719
  return;
662
720
  }
663
- for (let r of yn(l)) {
721
+ for (let r of Sn(l)) {
664
722
  if (n) {
665
- if (vn(r)) {
723
+ if (xn(r)) {
666
724
  o.push([F(e, t).split(de).join("/"), r]);
667
725
  continue;
668
726
  }
669
- if (gn.some((e) => _n(r, e))) {
727
+ if (yn.some((e) => bn(r, e))) {
670
728
  a = !0;
671
729
  continue;
672
730
  }
673
731
  }
674
732
  if (!r.startsWith(".")) continue;
675
- let c = await bn(t, r);
733
+ let c = await Cn(t, r);
676
734
  if (c === void 0) continue;
677
- let l = n || mn(c);
678
- if (!n && mn(c)) {
735
+ let l = n || _n(c);
736
+ if (!n && _n(c)) {
679
737
  let t = F(e, c).split(de).join("/");
680
738
  i.includes(t) || i.push(t);
681
739
  }
682
740
  await s(c, l);
683
741
  }
684
742
  };
685
- return await s(n, mn(n)), mn(n) && i.unshift(F(e, n).split(de).join("/")), {
743
+ return await s(n, _n(n)), _n(n) && i.unshift(F(e, n).split(de).join("/")), {
686
744
  islandFiles: i,
687
745
  usesClient: a,
688
746
  violations: o
689
747
  };
690
- }, Sn = (e) => {
748
+ }, Tn = (e) => {
691
749
  let t = /^export const interactive\s*=\s*['"](full|islands|none)['"]/m.exec(e);
692
750
  return t === null ? void 0 : t[1];
693
- }, Cn = (e) => {
751
+ }, En = (e) => {
694
752
  let t = e.indexOf("</head>"), n = t === -1 ? e : e.slice(0, t), r = [];
695
753
  for (let e of n.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)) {
696
754
  let t = e[1] ?? "";
697
755
  /\bsrc\s*=/.test(t) || /type\s*=\s*["']module["']/.test(t) || r.push(e[0]);
698
756
  }
699
757
  return r.map((e) => ` ${e}`).join("\n");
700
- }, wn = (e) => [...e.matchAll(/<link\b[^>]*\brel\s*=\s*["']stylesheet["'][^>]*>/gi)].map((e) => e[0]), Tn = (e, t) => {
701
- let n = wn(t).filter((t) => !e.includes(t));
758
+ }, Dn = (e) => [...e.matchAll(/<link\b[^>]*\brel\s*=\s*["']stylesheet["'][^>]*>/gi)].map((e) => e[0]), On = (e, t) => {
759
+ let n = Dn(t).filter((t) => !e.includes(t));
702
760
  if (n.length === 0) return e;
703
761
  let r = n.map((e) => ` ${e}`).join("\n");
704
762
  return e.includes("</head>") ? e.replace("</head>", `${r}\n </head>`) : e + r;
705
- }, En = (e) => {
763
+ }, kn = (e) => {
706
764
  let t = e.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
707
765
  return t === "" ? "root" : t;
708
- }, Dn = class extends Error {
766
+ }, An = class extends Error {
709
767
  constructor(e, t) {
710
768
  let n = t.map(([e, t]) => ` ${e} imports '${t}'`).join("\n");
711
769
  super(`interactive: 'islands' page '${e}' has island code importing the framework barrel:\n${n}\n\nAn island hydrates in its own provider-less root — router hooks, <Link> and useT() throw there, and the '@voltro/web' barrel additionally pulls the Effect runtime into the slim islands entry (the bytes this mode exists to shed).\n\nFix: import island()/hydration APIs from '@voltro/web/islands' (the react-only subpath), move router/i18n-dependent UI out of the island, and keep island files to react + relative browser-safe imports. '@voltro/client' IS allowed — a useSubscription island gets the client boot automatically.`), this.name = "IslandsEntryViolation";
712
770
  }
713
- }, On = async (e) => {
771
+ }, jn = async (e) => {
714
772
  let t = P(e.webRoot, ".framework", "island-shells"), n = [];
715
773
  if (e.pages.length === 0) return n;
716
774
  await z.mkdir(t, { recursive: !0 });
717
775
  for (let r of e.pages) {
718
- let i = await xn(e.webRoot, r.file);
719
- if (i.violations.length > 0) throw new Dn(r.pattern, i.violations);
720
- let a = En(r.pattern), o = `island-shells/${a}.tsx`, s = `island-shells/${a}.html`, c = i.islandFiles.map((e) => `import '../../${e}'`).join("\n"), l = i.usesClient ? [
776
+ let i = await wn(e.webRoot, r.file);
777
+ if (i.violations.length > 0) throw new An(r.pattern, i.violations);
778
+ let a = kn(r.pattern), o = `island-shells/${a}.tsx`, s = `island-shells/${a}.html`, c = i.islandFiles.map((e) => `import '../../${e}'`).join("\n"), l = i.usesClient ? [
721
779
  `// GENERATED by voltro — the islands entry for '${r.pattern}' (client boot:`,
722
780
  "// an island here imports @voltro/client, so the roots get a live runtime).",
723
781
  ...e.apiImports ?? [],
@@ -762,13 +820,13 @@ __installPublicEnv(publicEnvValues)
762
820
  });
763
821
  }
764
822
  return n;
765
- }, kn = W({ scope: "voltro:images" }), An = /[?&]image(?:&|$)/, jn = /\.(png|jpe?g|webp|avif)(\?|$)/i, Mn = {
823
+ }, Mn = K({ scope: "voltro:images" }), Nn = /[?&]image(?:&|$)/, Pn = /\.(png|jpe?g|webp|avif)(\?|$)/i, Fn = {
766
824
  avif: "image/avif",
767
825
  webp: "image/webp",
768
826
  jpeg: "image/jpeg",
769
827
  png: "image/png"
770
- }, Nn = (e) => J("sha256").update(e).digest("hex").slice(0, 12), Pn = (e) => `export default ${JSON.stringify(e)}\n`, Fn = (e) => {
771
- let t = e.config ?? k, n = S(e.root), r = /* @__PURE__ */ new Map(), i = "/", a = !1;
828
+ }, In = (e) => J("sha256").update(e).digest("hex").slice(0, 12), Ln = (e) => `export default ${JSON.stringify(e)}\n`, Rn = (e) => {
829
+ let t = e.config ?? A, n = S(e.root), r = /* @__PURE__ */ new Map(), i = "/", a = !1;
772
830
  return {
773
831
  name: "voltro:image-assets",
774
832
  enforce: "pre",
@@ -776,20 +834,20 @@ __installPublicEnv(publicEnvValues)
776
834
  i = e.base, a = e.command === "build";
777
835
  },
778
836
  async load(o) {
779
- if (!An.test(o) || !jn.test(o)) return null;
780
- let s = o.split("?")[0], c = s, l = await te(c);
781
- if (l === null && s.startsWith("/") && (c = P(e.root, s.slice(1)), l = await te(c)), l === null && this.error(`?image import points at a file that does not exist or is unreadable: ${s}`), await C() === null) {
782
- T(kn);
837
+ if (!Nn.test(o) || !Pn.test(o)) return null;
838
+ let s = o.split("?")[0], c = s, l = await D(c);
839
+ if (l === null && s.startsWith("/") && (c = P(e.root, s.slice(1)), l = await D(c)), l === null && this.error(`?image import points at a file that does not exist or is unreadable: ${s}`), await C() === null) {
840
+ T(Mn);
783
841
  let t;
784
842
  if (a || e.urlMode === "build-urls") {
785
- let e = `assets/${Nn(c)}${c.slice(c.lastIndexOf("."))}`;
843
+ let e = `assets/${In(c)}${c.slice(c.lastIndexOf("."))}`;
786
844
  a && this.emitFile({
787
845
  type: "asset",
788
846
  fileName: e,
789
847
  source: Buffer.from(l)
790
848
  }), t = `${i}${e}`;
791
849
  } else t = `/@fs${c}`;
792
- return Pn({
850
+ return Ln({
793
851
  src: t,
794
852
  width: 0,
795
853
  height: 0,
@@ -815,31 +873,31 @@ __installPublicEnv(publicEnvValues)
815
873
  }), r.set(`${t.format}:${t.width}`, `${i}${n}`);
816
874
  }
817
875
  let o = (t) => e.widths.map((e) => `${r.get(`${t}:${e}`)} ${e}w`).join(", ");
818
- return Pn({
876
+ return Ln({
819
877
  src: r.get(`${e.fallbackFormat}:${e.widths[e.widths.length - 1]}`),
820
878
  width: e.width,
821
879
  height: e.height,
822
880
  blurDataURL: e.blurDataURL,
823
881
  srcSet: o(e.fallbackFormat),
824
882
  sources: t.formats.map((e) => ({
825
- type: Mn[e],
883
+ type: Fn[e],
826
884
  srcSet: o(e)
827
885
  }))
828
886
  });
829
887
  }
830
- let u = await re(l);
888
+ let u = await ne(l);
831
889
  u === null && this.error(`?image import is not a raster image sharp can read: ${c}`);
832
- let d = J("sha256").update(l).digest("hex").slice(0, 16), f = await O(l, d, n), p = Nn(c);
890
+ let d = J("sha256").update(l).digest("hex").slice(0, 16), f = await k(l, d, n), p = In(c);
833
891
  r.set(p, c);
834
- let m = D(u.width), h = u.format === "png" ? "png" : "jpeg", g = (e, t) => `/_voltro/image/${p}?w=${e}&f=${t}`, _ = (e) => m.map((t) => `${g(t, e)} ${t}w`).join(", ");
835
- return Pn({
892
+ let m = te(u.width), h = u.format === "png" ? "png" : "jpeg", g = (e, t) => `/_voltro/image/${p}?w=${e}&f=${t}`, _ = (e) => m.map((t) => `${g(t, e)} ${t}w`).join(", ");
893
+ return Ln({
836
894
  src: g(m[m.length - 1], h),
837
895
  width: u.width,
838
896
  height: u.height,
839
897
  blurDataURL: f ?? "",
840
898
  srcSet: _(h),
841
899
  sources: t.formats.map((e) => ({
842
- type: Mn[e],
900
+ type: Fn[e],
843
901
  srcSet: _(e)
844
902
  }))
845
903
  });
@@ -853,11 +911,11 @@ __installPublicEnv(publicEnvValues)
853
911
  return;
854
912
  }
855
913
  let c = Number(a.searchParams.get("w")), l = a.searchParams.get("f") ?? "";
856
- if (!Number.isInteger(c) || c <= 0 || c > 8192 || Mn[l] === void 0) {
914
+ if (!Number.isInteger(c) || c <= 0 || c > 8192 || Fn[l] === void 0) {
857
915
  i.statusCode = 400, i.end("bad transform params");
858
916
  return;
859
917
  }
860
- let u = await te(s);
918
+ let u = await D(s);
861
919
  if (u === null) {
862
920
  i.statusCode = 404, i.end("source asset gone");
863
921
  return;
@@ -871,76 +929,76 @@ __installPublicEnv(publicEnvValues)
871
929
  cacheDir: n
872
930
  });
873
931
  if (f === null) {
874
- T(kn), i.statusCode = 200, i.setHeader("content-type", Mn[l] ?? "application/octet-stream"), i.end(Buffer.from(u));
932
+ T(Mn), i.statusCode = 200, i.setHeader("content-type", Fn[l] ?? "application/octet-stream"), i.end(Buffer.from(u));
875
933
  return;
876
934
  }
877
- i.statusCode = 200, i.setHeader("content-type", Mn[l]), i.setHeader("cache-control", "max-age=31536000, immutable"), i.end(Buffer.from(f));
935
+ i.statusCode = 200, i.setHeader("content-type", Fn[l]), i.setHeader("cache-control", "max-age=31536000, immutable"), i.end(Buffer.from(f));
878
936
  })().catch((e) => {
879
- kn.warn("image transform failed", {}, e), a();
937
+ Mn.warn("image transform failed", {}, e), a();
880
938
  });
881
939
  });
882
940
  }
883
941
  };
884
- }, In = W({ scope: "voltro:fonts" }), Ln = /* @__PURE__ */ new Map(), Rn = async (e, t) => {
942
+ }, zn = K({ scope: "voltro:fonts" }), Bn = /* @__PURE__ */ new Map(), Vn = async (e, t) => {
885
943
  if (t === void 0 || t.length === 0) return null;
886
- let n = Ln.get(e);
887
- return n === void 0 && (n = j(t, async (t) => new Uint8Array(await Ie(P(e, t)))).then((e) => {
888
- for (let t of e.warnings) A(t, In);
944
+ let n = Bn.get(e);
945
+ return n === void 0 && (n = M(t, async (t) => new Uint8Array(await Ie(P(e, t)))).then((e) => {
946
+ for (let t of e.warnings) j(t, zn);
889
947
  return e;
890
- }), Ln.set(e, n)), n;
891
- }, zn = {
948
+ }), Bn.set(e, n)), n;
949
+ }, Hn = {
892
950
  woff2: "font/woff2",
893
951
  woff: "font/woff",
894
952
  otf: "font/otf",
895
953
  ttf: "font/ttf"
896
- }, Bn = (e, t) => ({
954
+ }, Un = (e, t) => ({
897
955
  name: "voltro:font-assets",
898
956
  configureServer(n) {
899
957
  n.middlewares.use("/assets/fonts", (n, r, i) => {
900
958
  (async () => {
901
- let a = await Rn(e, t), o = (n.url ?? "/").replace(/^\//, "").split("?")[0], s = a?.files.find((e) => e.fileName === `assets/fonts/${o}`);
959
+ let a = await Vn(e, t), o = (n.url ?? "/").replace(/^\//, "").split("?")[0], s = a?.files.find((e) => e.fileName === `assets/fonts/${o}`);
902
960
  if (s === void 0) {
903
961
  i();
904
962
  return;
905
963
  }
906
964
  let c = o.slice(o.lastIndexOf(".") + 1);
907
- r.statusCode = 200, r.setHeader("content-type", zn[c] ?? "application/octet-stream"), r.setHeader("cache-control", "max-age=31536000, immutable"), r.end(Buffer.from(s.bytes));
965
+ r.statusCode = 200, r.setHeader("content-type", Hn[c] ?? "application/octet-stream"), r.setHeader("cache-control", "max-age=31536000, immutable"), r.end(Buffer.from(s.bytes));
908
966
  })().catch(() => i());
909
967
  });
910
968
  }
911
- }), Vn = W({ scope: "voltro:content" }), Hn = (e) => {
969
+ }), Wn = K({ scope: "voltro:content" }), Gn = (e) => {
912
970
  tt(e);
913
- }, Un = (e, t) => `/assets/content-media/${e}${t}`, Wn = "assets/content-media", Gn = (e) => {
971
+ }, Kn = (e, t) => `/assets/content-media/${e}${t}`, qn = "assets/content-media", Jn = (e) => {
914
972
  let t = /* @__PURE__ */ new Map(), n = [];
915
973
  return et(({ src: r, entryFile: i }) => {
916
- let [a = "", o = ""] = Yn(r), s = I(N(i), decodeURIComponent(a)), c = t.get(s);
974
+ let [a = "", o = ""] = Qn(r), s = I(N(i), decodeURIComponent(a)), c = t.get(s);
917
975
  if (c !== void 0) return c + o;
918
976
  if (!L(s)) {
919
977
  let e = F(process.cwd(), s);
920
978
  return n.includes(e) || n.push(e), r;
921
979
  }
922
- let l = B(s), u = J("sha256").update(l).digest("hex").slice(0, 16), d = ue(s).toLowerCase(), f = Un(u, d), p = P(e, Wn, `${u}${d}`);
923
- return R(N(p), { recursive: !0 }), me(p, l), t.set(s, f), f + o;
980
+ let l = B(s), u = J("sha256").update(l).digest("hex").slice(0, 16), d = ue(s).toLowerCase(), f = Kn(u, d), p = P(e, qn, `${u}${d}`);
981
+ return R(N(p), { recursive: !0 }), U(p, l), t.set(s, f), f + o;
924
982
  }), { missing: n };
925
- }, Kn = () => {
983
+ }, Yn = () => {
926
984
  et(({ src: e, entryFile: t }) => {
927
- let [n = "", r = ""] = Yn(e), i = I(N(t), decodeURIComponent(n));
985
+ let [n = "", r = ""] = Qn(e), i = I(N(t), decodeURIComponent(n));
928
986
  if (!L(i)) return e;
929
987
  let a = B(i), o = J("sha256").update(a).digest("hex").slice(0, 16);
930
- return qn.set(o, i), Un(o, ue(i).toLowerCase()) + r;
988
+ return Xn.set(o, i), Kn(o, ue(i).toLowerCase()) + r;
931
989
  });
932
- }, qn = /* @__PURE__ */ new Map(), Jn = (e) => {
990
+ }, Xn = /* @__PURE__ */ new Map(), Zn = (e) => {
933
991
  let t = /^\/assets\/content-media\/([0-9a-f]{16})(\.[a-z0-9]+)$/i.exec(e);
934
992
  if (t === null) return null;
935
- let n = qn.get(t[1].toLowerCase());
993
+ let n = Xn.get(t[1].toLowerCase());
936
994
  return n === void 0 || !L(n) ? null : {
937
995
  bytes: B(n),
938
- contentType: Zn(t[2])
996
+ contentType: er(t[2])
939
997
  };
940
- }, Yn = (e) => {
998
+ }, Qn = (e) => {
941
999
  let t = e.search(/[?#]/);
942
1000
  return t === -1 ? [e, ""] : [e.slice(0, t), e.slice(t)];
943
- }, Xn = {
1001
+ }, $n = {
944
1002
  ".png": "image/png",
945
1003
  ".jpg": "image/jpeg",
946
1004
  ".jpeg": "image/jpeg",
@@ -949,7 +1007,7 @@ __installPublicEnv(publicEnvValues)
949
1007
  ".webp": "image/webp",
950
1008
  ".avif": "image/avif",
951
1009
  ".ico": "image/x-icon"
952
- }, Zn = (e) => Xn[e.toLowerCase()] ?? "application/octet-stream", Qn = async (e, t) => {
1010
+ }, er = (e) => $n[e.toLowerCase()] ?? "application/octet-stream", tr = async (e, t) => {
953
1011
  let n = await Xe(e.collection, e.locale === void 0 ? {} : { locale: e.locale });
954
1012
  return Je(n, {
955
1013
  title: e.title,
@@ -958,42 +1016,42 @@ __installPublicEnv(publicEnvValues)
958
1016
  feedPath: e.path,
959
1017
  item: e.item
960
1018
  });
961
- }, $n = async (e, t, n) => {
1019
+ }, nr = async (e, t, n) => {
962
1020
  if (t.length !== 0) {
963
1021
  if (n === void 0 || n === "") throw Error("config.feeds needs seo.siteUrl — RSS links must be absolute. Set seo: { siteUrl } in app.config.ts.");
964
1022
  for (let r of t) {
965
- let t = await Qn(r, n), i = P(e, r.path.replace(/^\/+/, ""));
966
- await K(N(i), { recursive: !0 }), await q(i, t), Vn.info(`feed: ${r.path} (${r.collection})`);
1023
+ let t = await tr(r, n), i = P(e, r.path.replace(/^\/+/, ""));
1024
+ await Fe(N(i), { recursive: !0 }), await q(i, t), Wn.info(`feed: ${r.path} (${r.collection})`);
967
1025
  }
968
1026
  }
969
- }, er = async (e, t) => {
1027
+ }, rr = async (e, t) => {
970
1028
  let n = await Xe(e, t === void 0 ? {} : { locale: t });
971
1029
  return JSON.stringify(n.map(({ html: e, body: t, headings: n, ...r }) => r));
972
- }, tr = async (e, t, n) => {
1030
+ }, ir = async (e, t, n) => {
973
1031
  let r = await Ze(e, t, n === void 0 ? {} : { locale: n });
974
1032
  if (r === null) return null;
975
1033
  let { body: i, ...a } = r;
976
1034
  return JSON.stringify(a);
977
- }, nr = async (e) => {
1035
+ }, ar = async (e) => {
978
1036
  await nt();
979
- let t = Gn(e), n = 0;
1037
+ let t = Jn(e), n = 0;
980
1038
  for (let t of $e()) {
981
1039
  let r = t.i18n?.locales ?? [void 0];
982
1040
  for (let i of r) {
983
- let r = await er(t.name, i), a = P(e, Ye(t.name, i));
984
- await K(N(a), { recursive: !0 }), await q(a, r), n += 1;
1041
+ let r = await rr(t.name, i), a = P(e, Ye(t.name, i));
1042
+ await Fe(N(a), { recursive: !0 }), await q(a, r), n += 1;
985
1043
  let o = JSON.parse(r);
986
1044
  for (let { slug: r } of o) {
987
- let a = await tr(t.name, r, i);
1045
+ let a = await ir(t.name, r, i);
988
1046
  if (a === null) continue;
989
1047
  let o = P(e, Ye(t.name, i, r));
990
- await K(N(o), { recursive: !0 }), await q(o, a), n += 1;
1048
+ await Fe(N(o), { recursive: !0 }), await q(o, a), n += 1;
991
1049
  }
992
1050
  }
993
1051
  }
994
1052
  if (t.missing.length > 0) throw Error(`content: ${t.missing.length} image reference(s) in markdown point at files that do not exist:\n` + t.missing.map((e) => ` - ${e}`).join("\n") + "\n\nA relative image is resolved against the markdown file that references it. Fix the path, or use an absolute `/…` src for an asset you serve yourself.");
995
- return n > 0 && Vn.info(`content: ${n} artifact(s) into dist/assets/content`), n;
996
- }, rr = async (e) => {
1053
+ return n > 0 && Wn.info(`content: ${n} artifact(s) into dist/assets/content`), n;
1054
+ }, or = async (e) => {
997
1055
  let t = /^\/assets\/content\/([A-Za-z0-9_-]+)(?:\.([A-Za-z0-9-]+))?\/(.+)$/.exec(e);
998
1056
  if (t === null) return null;
999
1057
  let [, n, r, i] = t;
@@ -1001,9 +1059,9 @@ __installPublicEnv(publicEnvValues)
1001
1059
  try {
1002
1060
  if (i === "index.json") return {
1003
1061
  status: 200,
1004
- body: await er(n, r)
1062
+ body: await rr(n, r)
1005
1063
  };
1006
- let e = await tr(n, i.replace(/\.json$/, ""), r);
1064
+ let e = await ir(n, i.replace(/\.json$/, ""), r);
1007
1065
  return e === null ? {
1008
1066
  status: 404,
1009
1067
  body: "\"not found\""
@@ -1012,12 +1070,12 @@ __installPublicEnv(publicEnvValues)
1012
1070
  body: e
1013
1071
  };
1014
1072
  } catch (t) {
1015
- return Vn.warn("content request failed", { pathname: e }, t), {
1073
+ return Wn.warn("content request failed", { pathname: e }, t), {
1016
1074
  status: 500,
1017
1075
  body: "\"content error\""
1018
1076
  };
1019
1077
  }
1020
- }, ir = async (e) => {
1078
+ }, sr = async (e) => {
1021
1079
  let { readdir: t } = await import("node:fs/promises"), n = [], r;
1022
1080
  try {
1023
1081
  r = await t(e, { withFileTypes: !0 });
@@ -1027,14 +1085,14 @@ __installPublicEnv(publicEnvValues)
1027
1085
  for (let t of r) {
1028
1086
  if (t.name.startsWith(".") || t.name === "node_modules") continue;
1029
1087
  let r = P(e, t.name);
1030
- t.isDirectory() ? n.push(...await ir(r)) : /\.collection\.tsx?$/.test(t.name) && n.push(r);
1088
+ t.isDirectory() ? n.push(...await sr(r)) : /\.collection\.tsx?$/.test(t.name) && n.push(r);
1031
1089
  }
1032
1090
  return n;
1033
- }, ar = (e, t = [], n) => ({
1091
+ }, cr = (e, t = [], n) => ({
1034
1092
  name: "voltro:content",
1035
1093
  configureServer(r) {
1036
- Kn(), r.middlewares.use("/assets/content-media", (e, t, n) => {
1037
- let r = Jn(`/assets/content-media${(e.url ?? "/").split("?")[0]}`);
1094
+ Yn(), r.middlewares.use("/assets/content-media", (e, t, n) => {
1095
+ let r = Zn(`/assets/content-media${(e.url ?? "/").split("?")[0]}`);
1038
1096
  if (r === null) {
1039
1097
  n();
1040
1098
  return;
@@ -1042,10 +1100,10 @@ __installPublicEnv(publicEnvValues)
1042
1100
  t.setHeader("content-type", r.contentType), t.end(r.bytes);
1043
1101
  });
1044
1102
  let i = null, a = () => (i ??= (async () => {
1045
- for (let t of await ir(P(e, "src"))) try {
1103
+ for (let t of await sr(P(e, "src"))) try {
1046
1104
  await r.ssrLoadModule(t);
1047
1105
  } catch (e) {
1048
- Vn.warn("failed to load collection module", { file: t }, e);
1106
+ Wn.warn("failed to load collection module", { file: t }, e);
1049
1107
  }
1050
1108
  })(), i);
1051
1109
  r.watcher.add(P(e, "content")), r.watcher.on("all", (t, n) => {
@@ -1054,16 +1112,16 @@ __installPublicEnv(publicEnvValues)
1054
1112
  for (let e of t) r.middlewares.use(e.path, (t, r) => {
1055
1113
  (async () => {
1056
1114
  await a();
1057
- let t = await Qn(e, n ?? "http://localhost");
1115
+ let t = await tr(e, n ?? "http://localhost");
1058
1116
  r.setHeader("content-type", "application/rss+xml"), r.end(t);
1059
1117
  })().catch((t) => {
1060
- Vn.warn("feed render failed", { path: e.path }, t), r.statusCode = 500, r.end("feed error");
1118
+ Wn.warn("feed render failed", { path: e.path }, t), r.statusCode = 500, r.end("feed error");
1061
1119
  });
1062
1120
  });
1063
1121
  r.middlewares.use("/assets/content", (e, t, n) => {
1064
1122
  (async () => {
1065
1123
  await a();
1066
- let r = await rr(`/assets/content${(e.url ?? "/").split("?")[0]}`);
1124
+ let r = await or(`/assets/content${(e.url ?? "/").split("?")[0]}`);
1067
1125
  if (r === null) {
1068
1126
  n();
1069
1127
  return;
@@ -1072,24 +1130,24 @@ __installPublicEnv(publicEnvValues)
1072
1130
  })().catch(() => n());
1073
1131
  });
1074
1132
  }
1075
- }), or, sr = async () => {
1076
- if (or !== void 0) return or;
1133
+ }), lr, ur = async () => {
1134
+ if (lr !== void 0) return lr;
1077
1135
  try {
1078
1136
  let e = await import("satori");
1079
- or = e.default ?? e;
1137
+ lr = e.default ?? e;
1080
1138
  } catch {
1081
- or = null;
1139
+ lr = null;
1082
1140
  }
1083
- return or;
1084
- }, cr, lr = async () => {
1085
- if (cr !== void 0) return cr;
1141
+ return lr;
1142
+ }, dr, fr = async () => {
1143
+ if (dr !== void 0) return dr;
1086
1144
  try {
1087
- cr = await import("@resvg/resvg-js");
1145
+ dr = await import("@resvg/resvg-js");
1088
1146
  } catch {
1089
- cr = null;
1147
+ dr = null;
1090
1148
  }
1091
- return cr;
1092
- }, ur = async (e, t) => {
1149
+ return dr;
1150
+ }, pr = async (e, t) => {
1093
1151
  if (t === void 0 || t.length === 0) throw Error("ogImage needs a declared font: satori cannot render text without a font buffer, and there is no bundled default (that would ship a license artifact most projects replace). Declare one in app.config.ts — fonts: [{ family: 'Inter', src: [{ path: 'src/fonts/Inter.woff2' }] }] — see the Fonts docs.");
1094
1152
  let n = [];
1095
1153
  for (let r of t) for (let t of r.src) {
@@ -1102,8 +1160,8 @@ __installPublicEnv(publicEnvValues)
1102
1160
  });
1103
1161
  }
1104
1162
  return n;
1105
- }, dr = async (e) => {
1106
- let t = await sr(), n = await lr();
1163
+ }, mr = async (e) => {
1164
+ let t = await ur(), n = await fr();
1107
1165
  if (t === null || n === null) {
1108
1166
  let e = [t === null ? "satori" : null, n === null ? "@resvg/resvg-js" : null].filter((e) => e !== null).join(" + ");
1109
1167
  throw Error(`ogImage cannot render: ${e} is not loadable. Both ship as optional dependencies of @voltro/cli — if your installer omitted optional dependencies, run \`pnpm add -D satori @resvg/resvg-js\` in this app.`);
@@ -1120,7 +1178,7 @@ __installPublicEnv(publicEnvValues)
1120
1178
  svg: r,
1121
1179
  png: new Uint8Array(new n.Resvg(r).render().asPng())
1122
1180
  };
1123
- }, fr = (e, t, n, r) => `${e}\u0000${t}\u0000${n}\u0000${r}`, pr = (e, t) => Le("sha256", e).update(t).digest("hex"), mr = () => {
1181
+ }, hr = (e, t, n, r) => `${e}\u0000${t}\u0000${n}\u0000${r}`, gr = (e, t) => Le("sha256", e).update(t).digest("hex"), _r = () => {
1124
1182
  let e = process.env.VOLTRO_OG_SECRET;
1125
1183
  return e !== void 0 && e !== "" ? {
1126
1184
  secret: e,
@@ -1129,12 +1187,12 @@ __installPublicEnv(publicEnvValues)
1129
1187
  secret: Re(32).toString("hex"),
1130
1188
  fromEnv: !1
1131
1189
  };
1132
- }, hr = "/_voltro/og", gr = (e) => {
1133
- let t = e.ttlMs ?? 36e5, n, r = () => (n ??= ur(e.root, e.fonts), n);
1190
+ }, vr = "/_voltro/og", yr = (e) => {
1191
+ let t = e.ttlMs ?? 36e5, n, r = () => (n ??= pr(e.root, e.fonts), n);
1134
1192
  return {
1135
1193
  signOgUrl: ({ pattern: t, params: n, tenant: r, locale: i }) => {
1136
- let a = JSON.stringify(n), o = r ?? "", s = i ?? "", c = pr(e.secret, fr(t, a, o, s));
1137
- return `${hr}?${new URLSearchParams({
1194
+ let a = JSON.stringify(n), o = r ?? "", s = i ?? "", c = gr(e.secret, hr(t, a, o, s));
1195
+ return `${vr}?${new URLSearchParams({
1138
1196
  route: t,
1139
1197
  p: a,
1140
1198
  ...o === "" ? {} : { t: o },
@@ -1144,7 +1202,7 @@ __installPublicEnv(publicEnvValues)
1144
1202
  },
1145
1203
  handle: async (n) => {
1146
1204
  if (n.pathname !== "/_voltro/og") return null;
1147
- let i = n.searchParams.get("route") ?? "", a = n.searchParams.get("p") ?? "{}", o = n.searchParams.get("t") ?? "", s = n.searchParams.get("l") ?? "", c = n.searchParams.get("sig") ?? "", l = pr(e.secret, fr(i, a, o, s)), u = Buffer.from(c, "utf8"), d = Buffer.from(l, "utf8");
1205
+ let i = n.searchParams.get("route") ?? "", a = n.searchParams.get("p") ?? "{}", o = n.searchParams.get("t") ?? "", s = n.searchParams.get("l") ?? "", c = n.searchParams.get("sig") ?? "", l = gr(e.secret, hr(i, a, o, s)), u = Buffer.from(c, "utf8"), d = Buffer.from(l, "utf8");
1148
1206
  if (u.length !== d.length || !ze(u, d)) return {
1149
1207
  status: 403,
1150
1208
  headers: { "content-type": "text/plain" },
@@ -1170,7 +1228,7 @@ __installPublicEnv(publicEnvValues)
1170
1228
  headers: { "content-type": "text/plain" },
1171
1229
  body: new TextEncoder().encode("page has no ogImage")
1172
1230
  };
1173
- let { png: g } = await dr({
1231
+ let { png: g } = await mr({
1174
1232
  element: await h({
1175
1233
  params: JSON.parse(a),
1176
1234
  loaderData: void 0,
@@ -1196,7 +1254,7 @@ __installPublicEnv(publicEnvValues)
1196
1254
  };
1197
1255
  }
1198
1256
  };
1199
- }, _r = (e) => {
1257
+ }, br = (e) => {
1200
1258
  let t = [];
1201
1259
  for (let n of e.split("/").filter(Boolean)) n.startsWith("[[...") && n.endsWith("]]") ? t.push({
1202
1260
  name: n.slice(5, -2),
@@ -1212,7 +1270,7 @@ __installPublicEnv(publicEnvValues)
1212
1270
  optional: !1
1213
1271
  });
1214
1272
  return t;
1215
- }, vr = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), yr = async (e) => {
1273
+ }, xr = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), Sr = async (e) => {
1216
1274
  let t = I(e);
1217
1275
  for (let e = 0; e < 4; e++) {
1218
1276
  let e = P(t, "project.json");
@@ -1230,8 +1288,8 @@ __installPublicEnv(publicEnvValues)
1230
1288
  t = n;
1231
1289
  }
1232
1290
  return null;
1233
- }, br = async (e) => {
1234
- let t = await yr(e);
1291
+ }, Cr = async (e) => {
1292
+ let t = await Sr(e);
1235
1293
  if (!t) return [];
1236
1294
  let { projectDir: n, manifest: r } = t, i = le(e), a = r.apps ?? {}, o = [];
1237
1295
  for (let [e, t] of Object.entries(a)) {
@@ -1240,23 +1298,23 @@ __installPublicEnv(publicEnvValues)
1240
1298
  if (!L(a)) continue;
1241
1299
  let s;
1242
1300
  try {
1243
- let { pages: e } = await Fo(a);
1301
+ let { pages: e } = await Uo(a);
1244
1302
  s = e.map((e) => ({
1245
1303
  pattern: e.pattern,
1246
- params: _r(e.pattern)
1304
+ params: br(e.pattern)
1247
1305
  }));
1248
1306
  } catch {
1249
1307
  continue;
1250
1308
  }
1251
1309
  o.push({
1252
- key: vr(e),
1310
+ key: xr(e),
1253
1311
  origin: `http://localhost:${t.port}`,
1254
1312
  ...typeof t.origin == "string" && t.origin.length > 0 ? { prodOrigin: t.origin } : {},
1255
1313
  routes: s
1256
1314
  });
1257
1315
  }
1258
1316
  return o;
1259
- }, xr = (e) => {
1317
+ }, wr = (e) => {
1260
1318
  if (e.params.length === 0) return `'${e.pattern}'`;
1261
1319
  let t = e.pattern;
1262
1320
  for (let n of e.params) {
@@ -1264,17 +1322,17 @@ __installPublicEnv(publicEnvValues)
1264
1322
  t = t.replace(e, r);
1265
1323
  }
1266
1324
  return "`" + t + "`";
1267
- }, Sr = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
1325
+ }, Tr = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
1268
1326
  let t = "string";
1269
1327
  return e.optional ? `readonly ${e.name}?: ${t}` : `readonly ${e.name}: ${t}`;
1270
- }).join("; ")} }`, Cr = (e, t, n) => {
1271
- let r = Sr(e), i = xr(e), a = t ? "VoltroExternalUrl" : e.search === void 0 ? "VoltroRouteUrl" : `VoltroRouteUrl<Schema.Schema.Type<typeof ${e.search.alias}>>`, o = t && n ? `${n} + ` : "";
1328
+ }).join("; ")} }`, Er = (e, t, n) => {
1329
+ let r = Tr(e), i = wr(e), a = t ? "VoltroExternalUrl" : e.search === void 0 ? "VoltroRouteUrl" : `VoltroRouteUrl<Schema.Schema.Type<typeof ${e.search.alias}>>`, o = t && n ? `${n} + ` : "";
1272
1330
  return e.params.length === 0 ? `() => (${o}${i}) as ${a}` : `({ ${e.params.map((e) => e.name).join(", ")} }: ${r}) => (${o}${i}) as ${a}`;
1273
- }, wr = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${Cr(e, !1)},`).join("\n")}\n}`, Tr = (e, t) => {
1331
+ }, Dr = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${Er(e, !1)},`).join("\n")}\n}`, Or = (e, t) => {
1274
1332
  if (e.routes.length === 0) return ` ${e.key}: {} as Record<string, never>,`;
1275
- let n = [...e.routes].sort((e, t) => e.pattern.localeCompare(t.pattern)), r = t === "prod" && e.prodOrigin ? e.prodOrigin : e.origin, i = JSON.stringify(r), a = n.map((e) => ` ${JSON.stringify(e.pattern)}: ${Cr(e, !0, i)},`);
1333
+ let n = [...e.routes].sort((e, t) => e.pattern.localeCompare(t.pattern)), r = t === "prod" && e.prodOrigin ? e.prodOrigin : e.origin, i = JSON.stringify(r), a = n.map((e) => ` ${JSON.stringify(e.pattern)}: ${Er(e, !0, i)},`);
1276
1334
  return ` ${e.key}: {\n${a.join("\n")}\n },`;
1277
- }, Er = async (e) => {
1335
+ }, kr = async (e) => {
1278
1336
  let t = await Promise.all(e.pages.map(async (t) => {
1279
1337
  let n;
1280
1338
  try {
@@ -1286,10 +1344,10 @@ __installPublicEnv(publicEnvValues)
1286
1344
  } catch {}
1287
1345
  return {
1288
1346
  pattern: t.pattern,
1289
- params: _r(t.pattern),
1347
+ params: br(t.pattern),
1290
1348
  ...n === void 0 ? {} : { search: n }
1291
1349
  };
1292
- })), n = await br(e.appRoot), r = t.filter((e) => e.search !== void 0).sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => `import type { searchParams as ${e.search.alias} } from '${e.search.specifier}'`), i = [
1350
+ })), n = await Cr(e.appRoot), r = t.filter((e) => e.search !== void 0).sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => `import type { searchParams as ${e.search.alias} } from '${e.search.specifier}'`), i = [
1293
1351
  "// THIS FILE IS GENERATED — DO NOT EDIT BY HAND.",
1294
1352
  "// Re-emitted by `voltro dev` whenever `src/pages/**` changes.",
1295
1353
  "// Type-safe route builders consumed by <Link to={...}>.",
@@ -1305,7 +1363,7 @@ __installPublicEnv(publicEnvValues)
1305
1363
  "",
1306
1364
  "type EmptyParams = Record<string, never>",
1307
1365
  ""
1308
- ].join("\n"), a = e.mode ?? "dev", o = `${i}\n${`export const routes = ${wr(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => Tr(e, a)).join("\n")}\n} as const\n`}`, s = P(e.appRoot, ".framework", "routes.generated.ts");
1366
+ ].join("\n"), a = e.mode ?? "dev", o = `${i}\n${`export const routes = ${Dr(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => Or(e, a)).join("\n")}\n} as const\n`}`, s = P(e.appRoot, ".framework", "routes.generated.ts");
1309
1367
  await z.mkdir(N(s), { recursive: !0 });
1310
1368
  let c = null;
1311
1369
  try {
@@ -1318,48 +1376,48 @@ __installPublicEnv(publicEnvValues)
1318
1376
  path: s,
1319
1377
  wrote: !0
1320
1378
  });
1321
- }, Dr = (e) => {
1379
+ }, Ar = (e) => {
1322
1380
  if (e === "" || e === "/") return "/";
1323
1381
  let t = e.startsWith("/") ? e : `/${e}`;
1324
1382
  return t.endsWith("/") ? t.slice(0, -1) : t;
1325
- }, Or = (e, t) => {
1326
- let n = e.endsWith("/") ? e.slice(0, -1) : e, r = Dr(t);
1383
+ }, jr = (e, t) => {
1384
+ let n = e.endsWith("/") ? e.slice(0, -1) : e, r = Ar(t);
1327
1385
  return r === "/" ? `${n}/` : `${n}${r}`;
1328
- }, kr = (e, t, n) => {
1329
- let r = Dr(e);
1386
+ }, Mr = (e, t, n) => {
1387
+ let r = Ar(e);
1330
1388
  return t === n ? r : r === "/" ? `/${t}` : `/${t}${r}`;
1331
- }, Ar = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), jr = (e) => {
1389
+ }, Nr = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), Pr = (e) => {
1332
1390
  let { siteUrl: t, entries: n } = e, r = e.locales && e.locales.length > 1 ? e.locales : void 0, i = e.defaultLocale ?? r?.[0] ?? "en", a = r !== void 0, o = /* @__PURE__ */ new Map(), s = (e) => {
1333
1391
  if (!r) return "";
1334
- let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${Ar(n)}" href="${Ar(Or(t, kr(e, n, i)))}" />`);
1335
- return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${Ar(Or(t, kr(e, i, i)))}" />`), `\n${n.join("\n")}`;
1392
+ let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${Nr(n)}" href="${Nr(jr(t, Mr(e, n, i)))}" />`);
1393
+ return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${Nr(jr(t, Mr(e, i, i)))}" />`), `\n${n.join("\n")}`;
1336
1394
  };
1337
1395
  for (let e of n) {
1338
1396
  let n = r ?? [i];
1339
1397
  for (let r of n) {
1340
- let n = Or(t, kr(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${Ar(e.lastmod)}</lastmod>` : "";
1341
- o.set(n, ` <url>\n <loc>${Ar(n)}</loc>${a}${s(e.path)}\n </url>`);
1398
+ let n = jr(t, Mr(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${Nr(e.lastmod)}</lastmod>` : "";
1399
+ o.set(n, ` <url>\n <loc>${Nr(n)}</loc>${a}${s(e.path)}\n </url>`);
1342
1400
  }
1343
1401
  }
1344
1402
  let c = [...o.keys()].sort().map((e) => o.get(e)).join("\n");
1345
1403
  return `<?xml version="1.0" encoding="UTF-8"?>\n<urlset${a ? " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"" : " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\""}>\n${c}\n</urlset>\n`;
1346
- }, Mr = (e) => {
1404
+ }, Fr = (e) => {
1347
1405
  if (!e.indexable) return "User-agent: *\nDisallow: /\n";
1348
1406
  let t = ["User-agent: *", "Allow: /"];
1349
- for (let n of e.disallow ?? []) t.push(`Disallow: ${Dr(n)}`);
1407
+ for (let n of e.disallow ?? []) t.push(`Disallow: ${Ar(n)}`);
1350
1408
  return e.sitemapUrl && t.push("", `Sitemap: ${e.sitemapUrl}`), `${t.join("\n")}\n`;
1351
- }, Nr = 8e3, Pr = (e, t = Nr) => {
1352
- let n = Ir(e);
1409
+ }, Ir = 8e3, Lr = (e, t = Ir) => {
1410
+ let n = zr(e);
1353
1411
  return n.length <= t ? n : `${n.slice(0, t)}\n… [voltro] truncated at ${t} chars (${n.length} total)`;
1354
- }, Fr = 4, Ir = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
1412
+ }, Rr = 4, zr = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
1355
1413
  if (e instanceof Error) {
1356
1414
  let r = e.stack ?? `${e.name}: ${e.message}`;
1357
1415
  if (n.has(e)) return `${r}\n [cycle]`;
1358
1416
  n.add(e);
1359
1417
  let i = [];
1360
- if (t < Fr) {
1361
- if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${Lr(Ir(a, t + 1, n))}`);
1362
- else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${Lr(Ir(e.cause, t + 1, n))}`);
1418
+ if (t < Rr) {
1419
+ if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${Br(zr(a, t + 1, n))}`);
1420
+ else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${Br(zr(e.cause, t + 1, n))}`);
1363
1421
  }
1364
1422
  return r + i.join("");
1365
1423
  }
@@ -1368,30 +1426,30 @@ __installPublicEnv(publicEnvValues)
1368
1426
  } catch {
1369
1427
  return "[unstringifiable thrown value]";
1370
1428
  }
1371
- }, Lr = (e) => {
1429
+ }, Br = (e) => {
1372
1430
  let t = e.split("\n");
1373
1431
  return t.length <= 3 ? e : `${t.slice(0, 3).join("\n")}\n …`;
1374
- }, Rr = {
1432
+ }, Vr = {
1375
1433
  trace: 0,
1376
1434
  debug: 1,
1377
1435
  info: 2,
1378
1436
  warn: 3,
1379
1437
  error: 4,
1380
1438
  fatal: 5
1381
- }, zr = 2e3, Br = 200, Vr = class {
1439
+ }, Hr = 2e3, Ur = 200, Wr = class {
1382
1440
  capacity;
1383
1441
  buffer = [];
1384
- constructor(e = zr) {
1442
+ constructor(e = Hr) {
1385
1443
  this.capacity = e;
1386
1444
  }
1387
1445
  append(e) {
1388
1446
  this.buffer.push(e), this.buffer.length > this.capacity && this.buffer.shift();
1389
1447
  }
1390
1448
  query(e = {}) {
1391
- let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? Br, this.capacity), i = e.minLevel === void 0 ? Rr.trace : Rr[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
1449
+ let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? Ur, this.capacity), i = e.minLevel === void 0 ? Vr.trace : Vr[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
1392
1450
  for (let e = this.buffer.length - 1; e >= 0 && l.length < r; e--) {
1393
1451
  let r = this.buffer[e];
1394
- r.ts < t || r.ts > n || Rr[r.level] < i || (o === void 0 || r.source === o) && (a !== void 0 && (r.scope === void 0 || !r.scope.toLowerCase().includes(a)) || s !== void 0 && !r.message.toLowerCase().includes(s) || (c === void 0 || r.fields.traceId === c) && l.push(r));
1452
+ r.ts < t || r.ts > n || Vr[r.level] < i || (o === void 0 || r.source === o) && (a !== void 0 && (r.scope === void 0 || !r.scope.toLowerCase().includes(a)) || s !== void 0 && !r.message.toLowerCase().includes(s) || (c === void 0 || r.fields.traceId === c) && l.push(r));
1395
1453
  }
1396
1454
  return l.reverse();
1397
1455
  }
@@ -1404,7 +1462,9 @@ __installPublicEnv(publicEnvValues)
1404
1462
  clear() {
1405
1463
  this.buffer = [];
1406
1464
  }
1407
- }, Hr = null, Ur = () => (Hr === null && (Hr = new Vr()), Hr), Wr = (e) => {
1465
+ }, Gr = null, Kr = () => (Gr === null && (Gr = new Wr()), Gr), qr = (e) => {
1466
+ Gr = e;
1467
+ }, Jr = (e) => {
1408
1468
  if (typeof e == "string") return e;
1409
1469
  if (e instanceof Error) return e.message;
1410
1470
  try {
@@ -1412,28 +1472,28 @@ __installPublicEnv(publicEnvValues)
1412
1472
  } catch {
1413
1473
  return String(e);
1414
1474
  }
1415
- }, Gr = 8e3, Kr = (e) => typeof e == "string" ? e.length <= Gr ? e : `${e.slice(0, Gr)}… [voltro: truncated]` : typeof e != "object" || !e ? e : Pr(e, Gr), qr = (e, t) => {
1475
+ }, Yr = 8e3, Xr = (e) => typeof e == "string" ? e.length <= Yr ? e : `${e.slice(0, Yr)}… [voltro: truncated]` : typeof e != "object" || !e ? e : Lr(e, Yr), Zr = (e, t) => {
1416
1476
  try {
1417
1477
  e(...t);
1418
1478
  } catch (n) {
1419
1479
  try {
1420
- e(...t.map(Kr)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${Gr} chars per argument.`);
1480
+ e(...t.map(Xr)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${Yr} chars per argument.`);
1421
1481
  } catch {
1422
1482
  e(`[voltro] a console.error argument could not be formatted at all (${t.length} arg(s)).`);
1423
1483
  }
1424
1484
  }
1425
- }, Jr = (e) => {
1485
+ }, Qr = (e) => {
1426
1486
  let t = {
1427
1487
  log: console.log.bind(console),
1428
1488
  info: console.info.bind(console),
1429
1489
  warn: console.warn.bind(console),
1430
1490
  error: console.error.bind(console),
1431
1491
  debug: console.debug.bind(console)
1432
- }, n = Ur(), r = !1, i = (i) => (...a) => {
1433
- if (qr(t[i], a), !r) {
1492
+ }, n = Kr(), r = !1, i = (i) => (...a) => {
1493
+ if (Zr(t[i], a), !r) {
1434
1494
  r = !0;
1435
1495
  try {
1436
- let t = a.length > 0 ? Wr(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = be();
1496
+ let t = a.length > 0 ? Jr(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = ve();
1437
1497
  e.emit("log", {
1438
1498
  level: i,
1439
1499
  message: r,
@@ -1460,7 +1520,7 @@ __installPublicEnv(publicEnvValues)
1460
1520
  }
1461
1521
  };
1462
1522
  console.log = i("log"), console.info = i("info"), console.warn = i("warn"), console.error = i("error"), console.debug = i("debug");
1463
- let a = ge((t) => {
1523
+ let a = me((t) => {
1464
1524
  if (!r) {
1465
1525
  r = !0;
1466
1526
  try {
@@ -1471,7 +1531,7 @@ __installPublicEnv(publicEnvValues)
1471
1531
  argsCount: 1,
1472
1532
  ...t.scope === void 0 ? {} : { scope: t.scope }
1473
1533
  });
1474
- let a = be(), o = a !== void 0 && t.fields.traceId === void 0 ? {
1534
+ let a = ve(), o = a !== void 0 && t.fields.traceId === void 0 ? {
1475
1535
  ...t.fields,
1476
1536
  traceId: a.traceId
1477
1537
  } : t.fields;
@@ -1491,24 +1551,24 @@ __installPublicEnv(publicEnvValues)
1491
1551
  return () => {
1492
1552
  console.log = t.log, console.info = t.info, console.warn = t.warn, console.error = t.error, console.debug = t.debug, a();
1493
1553
  };
1494
- }, Yr = 2e3, Xr = 8, Zr = 1e3, Qr = 200, $r = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, ei = (e) => {
1554
+ }, $r = 2e3, ei = 8, ti = 1e3, ni = 200, ri = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, ii = (e) => {
1495
1555
  switch (e) {
1496
1556
  case "error": return "error";
1497
1557
  case "warn": return "warn";
1498
1558
  case "debug": return "debug";
1499
1559
  default: return "info";
1500
1560
  }
1501
- }, ti = W({ scope: "client" }), ni = (e, t) => {
1561
+ }, ai = K({ scope: "client" }), oi = (e, t) => {
1502
1562
  let n;
1503
1563
  try {
1504
1564
  n = JSON.parse(e);
1505
1565
  } catch {
1506
- return ri(400, { error: "invalid JSON body" });
1566
+ return si(400, { error: "invalid JSON body" });
1507
1567
  }
1508
- if (typeof n != "object" || !n) return ri(400, { error: "body must be a JSON object" });
1568
+ if (typeof n != "object" || !n) return si(400, { error: "body must be a JSON object" });
1509
1569
  let r = n;
1510
- if (!Array.isArray(r.entries)) return ri(400, { error: "entries must be an array" });
1511
- let i = typeof r.app == "string" ? $r(r.app, 120) : void 0, a = typeof r.page == "string" ? $r(r.page, 200) : void 0, o = typeof r.ua == "string" ? $r(r.ua, 200) : void 0, s = r.entries.slice(0, Qr), c = 0;
1570
+ if (!Array.isArray(r.entries)) return si(400, { error: "entries must be an array" });
1571
+ let i = typeof r.app == "string" ? ri(r.app, 120) : void 0, a = typeof r.page == "string" ? ri(r.page, 200) : void 0, o = typeof r.ua == "string" ? ri(r.ua, 200) : void 0, s = r.entries.slice(0, ni), c = 0;
1512
1572
  for (let e of s) {
1513
1573
  if (typeof e != "object" || !e) continue;
1514
1574
  let n = e;
@@ -1519,7 +1579,7 @@ __installPublicEnv(publicEnvValues)
1519
1579
  "warn",
1520
1580
  "error",
1521
1581
  "debug"
1522
- ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = $r(n.message, Yr), u = Array.isArray(n.args) ? n.args.slice(0, Xr).filter((e) => typeof e == "string").map((e) => $r(e, Zr)) : void 0, d = typeof n.stack == "string" ? $r(n.stack, Yr) : void 0;
1582
+ ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = ri(n.message, $r), u = Array.isArray(n.args) ? n.args.slice(0, ei).filter((e) => typeof e == "string").map((e) => ri(e, ti)) : void 0, d = typeof n.stack == "string" ? ri(n.stack, $r) : void 0;
1523
1583
  t.emit("clientLog", {
1524
1584
  ts: s,
1525
1585
  level: r,
@@ -1534,35 +1594,35 @@ __installPublicEnv(publicEnvValues)
1534
1594
  ...i === void 0 ? {} : { app: i },
1535
1595
  ...a === void 0 ? {} : { page: a },
1536
1596
  ...u !== void 0 && u.length > 0 ? { args: u } : {}
1537
- }, p = ei(r);
1538
- (p === "error" || p === "warn") && d !== void 0 ? ti[p](l, f, { stack: d }) : ti[p](l, {
1597
+ }, p = ii(r);
1598
+ (p === "error" || p === "warn") && d !== void 0 ? ai[p](l, f, { stack: d }) : ai[p](l, {
1539
1599
  ...f,
1540
1600
  ...d === void 0 ? {} : { stack: d }
1541
1601
  }), c++;
1542
1602
  }
1543
- return ri(202, {
1603
+ return si(202, {
1544
1604
  accepted: c,
1545
1605
  dropped: r.entries.length - c
1546
1606
  });
1547
- }, ri = (e, t) => ({
1607
+ }, si = (e, t) => ({
1548
1608
  status: e,
1549
1609
  contentType: "application/json; charset=utf-8",
1550
1610
  body: JSON.stringify(t)
1551
- }), ii = "/_voltro/inspect/clientLog", ai = [
1611
+ }), ci = "/_voltro/inspect/clientLog", li = [
1552
1612
  "trace",
1553
1613
  "debug",
1554
1614
  "info",
1555
1615
  "warn",
1556
1616
  "error",
1557
1617
  "fatal"
1558
- ], oi = {
1618
+ ], ui = {
1559
1619
  trace: "TRACE",
1560
1620
  debug: "DEBUG",
1561
1621
  info: "INFO ",
1562
1622
  warn: "WARN ",
1563
1623
  error: "ERROR",
1564
1624
  fatal: "FATAL"
1565
- }, si = (e) => ai.includes(e), ci = (e, t, n = {}) => {
1625
+ }, di = (e) => li.includes(e), fi = (e, t, n = {}) => {
1566
1626
  if (s()) return {
1567
1627
  status: 503,
1568
1628
  contentType: "application/json",
@@ -1593,7 +1653,7 @@ __installPublicEnv(publicEnvValues)
1593
1653
  Number.isFinite(e) && e > 0 && (o.max = Math.floor(e));
1594
1654
  }
1595
1655
  let f = a.get("level");
1596
- f !== null && si(f) && (o.minLevel = f);
1656
+ f !== null && di(f) && (o.minLevel = f);
1597
1657
  let p = a.get("source");
1598
1658
  (p === "server" || p === "client") && (o.source = p);
1599
1659
  let m = a.get("scope");
@@ -1606,7 +1666,7 @@ __installPublicEnv(publicEnvValues)
1606
1666
  if ((a.get("format") ?? "json") === "text") return {
1607
1667
  status: 200,
1608
1668
  contentType: "text/plain; charset=utf-8",
1609
- body: _.map(li).join("\n") + (_.length > 0 ? "\n" : "")
1669
+ body: _.map(pi).join("\n") + (_.length > 0 ? "\n" : "")
1610
1670
  };
1611
1671
  let v = {
1612
1672
  capturedAt: Date.now(),
@@ -1620,40 +1680,40 @@ __installPublicEnv(publicEnvValues)
1620
1680
  contentType: "application/json; charset=utf-8",
1621
1681
  body: JSON.stringify(v)
1622
1682
  };
1623
- }, li = (e) => {
1624
- let t = new Date(e.ts), n = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), i = String(t.getSeconds()).padStart(2, "0"), a = String(t.getMilliseconds()).padStart(3, "0"), o = `[${e.scope ?? "?"}/${e.source}]`, s = di(e.fields);
1625
- return `${n}:${r}:${i}.${a} ${oi[e.level]} ${o} ${e.message}${s}`;
1626
- }, ui = 80, di = (e) => {
1683
+ }, pi = (e) => {
1684
+ let t = new Date(e.ts), n = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), i = String(t.getSeconds()).padStart(2, "0"), a = String(t.getMilliseconds()).padStart(3, "0"), o = `[${e.scope ?? "?"}/${e.source}]`, s = hi(e.fields);
1685
+ return `${n}:${r}:${i}.${a} ${ui[e.level]} ${o} ${e.message}${s}`;
1686
+ }, mi = 80, hi = (e) => {
1627
1687
  let t = Object.entries(e);
1628
1688
  if (t.length === 0) return "";
1629
1689
  let n = [];
1630
1690
  for (let [e, r] of t) {
1631
1691
  if (r === void 0) continue;
1632
- let t = fi(r);
1692
+ let t = gi(r);
1633
1693
  n.push(`${e}=${t}`);
1634
1694
  }
1635
1695
  return n.length > 0 ? " " + n.join(" ") : "";
1636
- }, fi = (e) => {
1696
+ }, gi = (e) => {
1637
1697
  if (typeof e == "string") {
1638
- let t = e.length > ui ? e.slice(0, ui) + "…" : e;
1698
+ let t = e.length > mi ? e.slice(0, mi) + "…" : e;
1639
1699
  return /[\s=]/.test(t) ? `"${t.replace(/"/g, "\\\"")}"` : t;
1640
1700
  }
1641
1701
  if (e === null) return "null";
1642
1702
  if (typeof e == "number" || typeof e == "boolean") return String(e);
1643
1703
  try {
1644
1704
  let t = JSON.stringify(e);
1645
- return t.length > ui ? t.slice(0, ui) + "…" : t;
1705
+ return t.length > mi ? t.slice(0, mi) + "…" : t;
1646
1706
  } catch {
1647
1707
  return "[unserialisable]";
1648
1708
  }
1649
- }, pi = "/_voltro/inspect/logs", mi = (e, t, n) => {
1709
+ }, _i = "/_voltro/inspect/logs", vi = (e, t, n) => {
1650
1710
  if (t.headers.authorization !== void 0) return !1;
1651
1711
  let { token: r } = n;
1652
1712
  if (r === void 0 || r === "" || !n.isLoopback(n.target)) return !1;
1653
1713
  e.setHeader("authorization", `Bearer ${r}`);
1654
1714
  let i = n.writeToken;
1655
1715
  return i !== void 0 && i !== "" && t.headers["x-voltro-inspect-write"] === void 0 && e.setHeader("x-voltro-inspect-write", i), !0;
1656
- }, hi = [{
1716
+ }, yi = [{
1657
1717
  match: (e) => typeof e == "string" && e.startsWith("[BABEL] Note: The code generator has deoptimised"),
1658
1718
  handle: (e, t) => {
1659
1719
  let n = e[0], r = n.match(/deoptimised the styling of (.+?) as it exceeds the max of (\d+\w*B)\.?/);
@@ -1665,13 +1725,13 @@ __installPublicEnv(publicEnvValues)
1665
1725
  });
1666
1726
  } else t.info(n);
1667
1727
  }
1668
- }], gi = () => {
1728
+ }], bi = () => {
1669
1729
  let e = {
1670
1730
  warn: console.warn.bind(console),
1671
1731
  error: console.error.bind(console)
1672
- }, t = W({ scope: "babel" }), n = !1, r = (r) => (...i) => {
1732
+ }, t = K({ scope: "babel" }), n = !1, r = (r) => (...i) => {
1673
1733
  if (!n) {
1674
- for (let e of hi) if (e.match(i[0])) {
1734
+ for (let e of yi) if (e.match(i[0])) {
1675
1735
  n = !0;
1676
1736
  try {
1677
1737
  e.handle(i, t);
@@ -1686,7 +1746,7 @@ __installPublicEnv(publicEnvValues)
1686
1746
  return console.warn = r("warn"), console.error = r("error"), () => {
1687
1747
  console.warn = e.warn, console.error = e.error;
1688
1748
  };
1689
- }, _i = {
1749
+ }, xi = {
1690
1750
  loader: "it runs on the server, and the router caches its result per route + params",
1691
1751
  renderMode: "it picks the server render strategy",
1692
1752
  dynamic: "it picks the server render strategy",
@@ -1699,7 +1759,7 @@ __installPublicEnv(publicEnvValues)
1699
1759
  tenantAware: "it is part of the server-side cache key",
1700
1760
  ogImage: "the server renders it into the og:image PNG",
1701
1761
  ppr: "it switches the isr path to partial prerendering (cached shell + per-request holes)"
1702
- }, vi = Object.keys(_i), yi = "virtual:voltro-route-refresh", bi = `\0${yi}`, xi = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, Si = () => `
1762
+ }, Si = Object.keys(xi), Ci = "virtual:voltro-route-refresh", wi = `\0${Ci}`, Ti = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, Ei = () => `
1703
1763
  // GENERATED by @voltro/cli — the \`voltro dev\` route Fast Refresh runtime.
1704
1764
 
1705
1765
  /** Mirrors react-refresh's own \`isLikelyComponentType\` closely enough for the
@@ -1728,11 +1788,11 @@ const stableForm = (value) => {
1728
1788
  * readers (\`build.ts\` prerender, \`webDev.ts\` dev SSR, \`start.ts\`). A change to
1729
1789
  * one of THESE cannot be hot-applied: the server already ran with the old
1730
1790
  * value. Everything else a page exports is plain client-side data. */
1731
- const serverRelevantExports = ${JSON.stringify(vi)}
1791
+ const serverRelevantExports = ${JSON.stringify(Si)}
1732
1792
 
1733
1793
  /** Name → the server step that already consumed it, so the reload message can
1734
1794
  * say WHY rather than just WHAT. Injected from the same single source. */
1735
- const serverExportEffect = ${JSON.stringify(_i)}
1795
+ const serverExportEffect = ${JSON.stringify(xi)}
1736
1796
 
1737
1797
  /** The reason \`name\` forces a reload, for the console line. */
1738
1798
  export const serverEffectOf = (name) =>
@@ -1775,7 +1835,7 @@ export const routeUpdateNeedsReload = (prevExports, nextExports) => {
1775
1835
  const previousHook = globalThis.__getReactRefreshIgnoredExports
1776
1836
  globalThis.__getReactRefreshIgnoredExports = (args) =>
1777
1837
  ignoredExports.get(args.id) ?? previousHook?.(args) ?? []
1778
- `, Ci = (e) => `
1838
+ `, Di = (e) => `
1779
1839
  if (import.meta.hot) {
1780
1840
  // Self-import to read our OWN exports, the same technique the react plugin
1781
1841
  // uses; the namespace is only complete after evaluation, hence the promise.
@@ -1802,30 +1862,30 @@ import {
1802
1862
  registerRouteModule as __voltro_registerRouteModule,
1803
1863
  routeUpdateNeedsReload as __voltro_routeUpdateNeedsReload,
1804
1864
  serverEffectOf as __voltro_serverEffect,
1805
- } from '${yi}'
1806
- `, wi = (e) => e.replace(/\\/g, "/"), Ti = (e, t) => {
1807
- let [n = "", r] = wi(e).split("?");
1808
- if (!n.endsWith(".tsx") || r !== void 0 && xi.test(r)) return !1;
1809
- let i = wi(t).replace(/\/$/, "");
1865
+ } from '${Ci}'
1866
+ `, Oi = (e) => e.replace(/\\/g, "/"), ki = (e, t) => {
1867
+ let [n = "", r] = Oi(e).split("?");
1868
+ if (!n.endsWith(".tsx") || r !== void 0 && Ti.test(r)) return !1;
1869
+ let i = Oi(t).replace(/\/$/, "");
1810
1870
  return n.startsWith(`${i}/`) ? p.test(n) || d.has(n.slice(n.lastIndexOf("/") + 1)) : !1;
1811
- }, Ei = (e, t, n) => Ti(t, n) ? `${e}${Ci(wi(t).split("?")[0] ?? t)}` : null, Di = (e) => ({
1871
+ }, Ai = (e, t, n) => ki(t, n) ? `${e}${Di(Oi(t).split("?")[0] ?? t)}` : null, ji = (e) => ({
1812
1872
  name: "voltro:route-fast-refresh",
1813
1873
  enforce: "pre",
1814
- resolveId: (e) => e === "virtual:voltro-route-refresh" ? bi : void 0,
1815
- load: (e) => e === bi ? Si() : void 0,
1874
+ resolveId: (e) => e === "virtual:voltro-route-refresh" ? wi : void 0,
1875
+ load: (e) => e === wi ? Ei() : void 0,
1816
1876
  transform: (t, n, r) => {
1817
1877
  if (r?.ssr === !0) return null;
1818
- let i = Ei(t, n, e);
1878
+ let i = Ai(t, n, e);
1819
1879
  return i === null ? null : {
1820
1880
  code: i,
1821
1881
  map: null
1822
1882
  };
1823
1883
  }
1824
- }), Oi = W({ scope: "voltro:dashboard" }), ki = we(import.meta.url), Ai = 5179, ji = (e) => {
1884
+ }), Mi = K({ scope: "voltro:dashboard" }), Ni = Ce(import.meta.url), Pi = 5179, Fi = (e) => {
1825
1885
  let t = process.env.VOLTRO_DASHBOARD_PATH;
1826
1886
  if (t && L(P(I(t), "app.config.ts"))) return I(t);
1827
1887
  try {
1828
- let e = N(ki.resolve("@voltro/dashboard/package.json"));
1888
+ let e = N(Ni.resolve("@voltro/dashboard/package.json"));
1829
1889
  if (L(P(e, "app.config.ts"))) return e;
1830
1890
  } catch {}
1831
1891
  let n = P("voltro-devtools", "apps", "dashboard"), r = I(e);
@@ -1837,53 +1897,53 @@ import {
1837
1897
  r = t;
1838
1898
  }
1839
1899
  return null;
1840
- }, Mi = "VOLTRO_IS_DASHBOARD", Ni = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1841
- let i = Y({
1900
+ }, Ii = "VOLTRO_IS_DASHBOARD", Li = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1901
+ let i = Ve({
1842
1902
  port: e,
1843
1903
  host: t
1844
1904
  }), a = !1, o = (e) => {
1845
1905
  a || (a = !0, i.destroy(), r(e));
1846
1906
  };
1847
1907
  i.once("connect", () => o(!0)), i.once("error", () => o(!1)), setTimeout(() => o(!1), n);
1848
- }), Pi = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), Fi = () => process.env[Mi] === "1", Ii = () => process.stdout.isTTY === !0, Li = P(Te(), ".voltro", "dashboard-launch.lock"), Ri = 1e4, zi = async () => {
1908
+ }), Ri = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), zi = () => process.env[Ii] === "1", Bi = () => process.stdout.isTTY === !0, Vi = P(we(), ".voltro", "dashboard-launch.lock"), Hi = 1e4, Ui = async () => {
1849
1909
  try {
1850
- await z.mkdir(N(Li), { recursive: !0 });
1851
- let e = await z.open(Li, "wx");
1910
+ await z.mkdir(N(Vi), { recursive: !0 });
1911
+ let e = await z.open(Vi, "wx");
1852
1912
  return await e.write(`${process.pid}\n${Date.now()}\n`), await e.close(), !0;
1853
1913
  } catch {
1854
1914
  try {
1855
- let e = await z.stat(Li);
1856
- if (Date.now() - e.mtimeMs > Ri) return await z.unlink(Li).catch(() => void 0), zi();
1915
+ let e = await z.stat(Vi);
1916
+ if (Date.now() - e.mtimeMs > Hi) return await z.unlink(Vi).catch(() => void 0), Ui();
1857
1917
  } catch {}
1858
1918
  return !1;
1859
1919
  }
1860
- }, Bi = async () => {
1920
+ }, Wi = async () => {
1861
1921
  try {
1862
- await z.unlink(Li);
1922
+ await z.unlink(Vi);
1863
1923
  } catch {}
1864
- }, Vi = async (e) => {
1924
+ }, Gi = async (e) => {
1865
1925
  let t = e.port ?? 5179;
1866
- if (Pi()) return {
1926
+ if (Ri()) return {
1867
1927
  status: "skipped",
1868
1928
  reason: "disabled by flag/env",
1869
1929
  port: t
1870
1930
  };
1871
- if (Fi()) return {
1931
+ if (zi()) return {
1872
1932
  status: "skipped",
1873
1933
  reason: "this process IS the dashboard",
1874
1934
  port: t
1875
1935
  };
1876
- if (!Ii()) return {
1936
+ if (!Bi()) return {
1877
1937
  status: "skipped",
1878
1938
  reason: "stdout is not a TTY (CI/smoke)",
1879
1939
  port: t
1880
1940
  };
1881
- if (!await zi()) return {
1941
+ if (!await Ui()) return {
1882
1942
  status: "skipped",
1883
1943
  reason: "another voltro process is currently launching the dashboard",
1884
1944
  port: t
1885
1945
  };
1886
- if (await Ni(t)) return await Bi(), {
1946
+ if (await Li(t)) return await Wi(), {
1887
1947
  status: "already-running",
1888
1948
  port: t
1889
1949
  };
@@ -1900,7 +1960,7 @@ import {
1900
1960
  stdio: "ignore",
1901
1961
  env: {
1902
1962
  ...process.env,
1903
- [Mi]: "1",
1963
+ [Ii]: "1",
1904
1964
  VOLTRO_DASHBOARD_PORT: String(t)
1905
1965
  }
1906
1966
  });
@@ -1908,22 +1968,22 @@ import {
1908
1968
  if (o.exitCode === null && o.signalCode === null) try {
1909
1969
  o.kill("SIGTERM");
1910
1970
  } catch {}
1911
- }), Oi.info(`auto-launching dashboard at http://localhost:${t}`, {
1971
+ }), Mi.info(`auto-launching dashboard at http://localhost:${t}`, {
1912
1972
  port: t,
1913
1973
  mode: a,
1914
1974
  prebuilt: i
1915
- }), i || Oi.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), Oi.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
1916
- Bi();
1975
+ }), i || Mi.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), Mi.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
1976
+ Wi();
1917
1977
  }, 4e3).unref(), {
1918
1978
  status: "launched",
1919
1979
  port: t
1920
1980
  };
1921
- }, Hi = class extends Error {
1981
+ }, Ki = class extends Error {
1922
1982
  _voltroDeferral = !0;
1923
1983
  constructor(e) {
1924
1984
  super(e), this.name = "DeferralNotSupportedError";
1925
1985
  }
1926
- }, Ui = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Wi = (e) => {
1986
+ }, qi = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Ji = (e) => {
1927
1987
  if (!(e instanceof Error)) return;
1928
1988
  let t = e._voltroControl;
1929
1989
  if (t === "redirect") {
@@ -1945,7 +2005,7 @@ import {
1945
2005
  },
1946
2006
  body: "not found"
1947
2007
  };
1948
- }, Gi = (e) => {
2008
+ }, Yi = (e) => {
1949
2009
  let { helpers: t } = e, n = t.prepareDeferredLoaderData(e.loaderData, "page"), r = {}, i = {}, a = {};
1950
2010
  for (let [n, o] of Object.entries(e.segmentLoaderData)) {
1951
2011
  let e = Number(n), s = t.prepareDeferredLoaderData(o, e);
@@ -1961,7 +2021,7 @@ import {
1961
2021
  ...e.ppr === !0 ? { ppr: !0 } : {}
1962
2022
  });
1963
2023
  } catch (e) {
1964
- throw new Hi(e instanceof Error ? e.message : String(e));
2024
+ throw new Ki(e instanceof Error ? e.message : String(e));
1965
2025
  }
1966
2026
  return {
1967
2027
  loaderData: n.renderData,
@@ -1977,8 +2037,8 @@ import {
1977
2037
  ...Object.keys(a).length > 0 ? { deferredSegmentIds: a } : {}
1978
2038
  }
1979
2039
  };
1980
- }, Ki = (e) => {
1981
- let { helpers: t, renderInput: n } = e, r = Gi({
2040
+ }, Xi = (e) => {
2041
+ let { helpers: t, renderInput: n } = e, r = Yi({
1982
2042
  helpers: t,
1983
2043
  page: e.page,
1984
2044
  pathname: n.pathname,
@@ -1999,19 +2059,19 @@ import {
1999
2059
  stateScript: t.renderRouterStateScript(r.stateInput),
2000
2060
  hasDeferred: r.hasDeferred
2001
2061
  };
2002
- }, qi = (e) => {
2062
+ }, Zi = (e) => {
2003
2063
  let { html: t, meta: n } = e.helpers.renderPageToHtml(e.prepared.renderInput);
2004
2064
  return {
2005
2065
  body: t,
2006
2066
  meta: n
2007
2067
  };
2008
- }, Ji = (e) => [
2068
+ }, Qi = (e) => [
2009
2069
  ...e.extra ?? [],
2010
2070
  e.helpers.renderMetaToHtml(e.meta),
2011
2071
  `<meta name="voltro-interactive" content="${e.interactive}" />`,
2012
2072
  ...e.prepared.hasDeferred ? [e.helpers.renderDeferredRegistryScript()] : [],
2013
2073
  e.prepared.stateScript
2014
- ].filter((e) => e.length > 0).join("\n "), Yi = (e) => {
2074
+ ].filter((e) => e.length > 0).join("\n "), $i = (e) => {
2015
2075
  let t = e.indexOf("?");
2016
2076
  return t === -1 ? {
2017
2077
  pathname: e || "/",
@@ -2020,9 +2080,9 @@ import {
2020
2080
  pathname: e.slice(0, t) || "/",
2021
2081
  search: e.slice(t)
2022
2082
  };
2023
- }, Xi = /Could not find required `intl` object/, Zi = "__voltro_i18n_instances__", Qi = (e = globalThis) => {
2083
+ }, ea = /Could not find required `intl` object/, ta = "__voltro_i18n_instances__", na = (e = globalThis) => {
2024
2084
  try {
2025
- let t = e[Zi]?.records;
2085
+ let t = e[ta]?.records;
2026
2086
  return t === void 0 || t.length === 0 ? void 0 : {
2027
2087
  instances: t.length,
2028
2088
  reactIntlCopies: new Set(t.map((e) => e.intlProvider)).size,
@@ -2031,7 +2091,7 @@ import {
2031
2091
  } catch {
2032
2092
  return;
2033
2093
  }
2034
- }, $i = (e, t) => [
2094
+ }, ra = (e, t) => [
2035
2095
  "",
2036
2096
  "── voltro diagnosis ───────────────────────────────────────────────────",
2037
2097
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -2049,7 +2109,7 @@ import {
2049
2109
  " versions on disk; this counts instances in the running process, and one",
2050
2110
  " file loaded down two paths is two instances.",
2051
2111
  "───────────────────────────────────────────────────────────────────────"
2052
- ].join("\n"), ea = (e, t) => [
2112
+ ].join("\n"), ia = (e, t) => [
2053
2113
  "",
2054
2114
  "── voltro diagnosis ───────────────────────────────────────────────────",
2055
2115
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -2065,7 +2125,7 @@ import {
2065
2125
  " direct import can land on a second copy that this count does not see —",
2066
2126
  " it counts what @voltro/i18n is bound to.",
2067
2127
  "───────────────────────────────────────────────────────────────────────"
2068
- ].join("\n"), ta = (e) => [
2128
+ ].join("\n"), aa = (e) => [
2069
2129
  "",
2070
2130
  "── voltro diagnosis ───────────────────────────────────────────────────",
2071
2131
  `${e} DID wrap this render in <I18nProvider> — the framework`,
@@ -2081,41 +2141,41 @@ import {
2081
2141
  " Do NOT use `pnpm ls` to rule that out: it lists versions on disk, and",
2082
2142
  " the duplication here is of module instances in one process.",
2083
2143
  "───────────────────────────────────────────────────────────────────────"
2084
- ].join("\n"), na = (e, t, n, r = Qi()) => {
2144
+ ].join("\n"), oa = (e, t, n, r = na()) => {
2085
2145
  if (!t) return;
2086
2146
  let i = String(e?.message ?? e);
2087
- if (Xi.test(i)) return r === void 0 ? ta(n) : r.reactIntlCopies > 1 || r.instances > 1 ? $i(n, r) : ea(n, r);
2088
- }, ra = "<div id=\"root\"></div>", ia = "<div id=\"root\">", aa = "</div>", oa = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, sa = /\bsrc=["']([^"']+)["']/i, ca = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, la = (e) => {
2089
- let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(oa, (e) => {
2090
- let r = sa.exec(e)?.[1];
2147
+ if (ea.test(i)) return r === void 0 ? aa(n) : r.reactIntlCopies > 1 || r.instances > 1 ? ra(n, r) : ia(n, r);
2148
+ }, sa = "<div id=\"root\"></div>", ca = "<div id=\"root\">", la = "</div>", ua = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, da = /\bsrc=["']([^"']+)["']/i, fa = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, pa = (e) => {
2149
+ let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(ua, (e) => {
2150
+ let r = da.exec(e)?.[1];
2091
2151
  return r === void 0 || t(r) ? e : (n.push(r), "");
2092
2152
  });
2093
- e.inlineModuleScriptsAsync && (r = r.replace(ca, "<script async$1>"));
2094
- let i = r.indexOf(ra);
2095
- if (i === -1) throw Error(`[voltro] the generated shell has no \`${ra}\` element, so a streamed response cannot be split around the page body. This is a framework bug unless the app overrode \`.framework/index.html\` by hand.`);
2153
+ e.inlineModuleScriptsAsync && (r = r.replace(fa, "<script async$1>"));
2154
+ let i = r.indexOf(sa);
2155
+ if (i === -1) throw Error(`[voltro] the generated shell has no \`${sa}\` element, so a streamed response cannot be split around the page body. This is a framework bug unless the app overrode \`.framework/index.html\` by hand.`);
2096
2156
  return {
2097
- head: `${r.slice(0, i)}${ia}`,
2098
- tail: `${aa}${r.slice(i + 21)}`,
2157
+ head: `${r.slice(0, i)}${ca}`,
2158
+ tail: `${la}${r.slice(i + 21)}`,
2099
2159
  bootstrapModules: n
2100
2160
  };
2101
- }, ua = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), da = (e, t) => {
2161
+ }, ma = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), ha = (e, t) => {
2102
2162
  let n = t.replace(/[^A-Za-z0-9+/=_-]/g, "");
2103
2163
  return e.replace(/<script(?![^>]*\snonce\s*=)/gi, `<script nonce="${n}"`);
2104
- }, fa = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), pa = (e, t) => {
2105
- let n = [t.timeZone === void 0 ? "" : ` data-voltro-tz="${fa(t.timeZone)}"`, t.renderedAt === void 0 ? "" : ` data-voltro-now="${t.renderedAt}"`].join("");
2106
- return e.replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${fa(t.lang)}"${n}`);
2107
- }, ma = (e) => pa(ua(e.head, e.headInjection), e.documentAttrs), ha = (e) => {
2164
+ }, ga = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), _a = (e, t) => {
2165
+ let n = [t.timeZone === void 0 ? "" : ` data-voltro-tz="${ga(t.timeZone)}"`, t.renderedAt === void 0 ? "" : ` data-voltro-now="${t.renderedAt}"`].join("");
2166
+ return e.replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${ga(t.lang)}"${n}`);
2167
+ }, va = (e) => _a(ma(e.head, e.headInjection), e.documentAttrs), ya = (e) => {
2108
2168
  let { res: t, shell: n, documentAttrs: r, headInjection: i } = e, a = null, o = !1, s = !1, c = () => {
2109
2169
  if (s || !o || a === null) return;
2110
2170
  s = !0, t.statusCode = e.statusCode ?? 200;
2111
2171
  for (let [n, r] of Object.entries(e.headers ?? {})) t.setHeader(n, r);
2112
2172
  t.flushHeaders?.();
2113
- let c = ma({
2173
+ let c = va({
2114
2174
  head: n.head,
2115
2175
  headInjection: i(a.meta),
2116
2176
  documentAttrs: r
2117
2177
  });
2118
- t.write(e.nonce === void 0 ? c : da(c, e.nonce));
2178
+ t.write(e.nonce === void 0 ? c : ha(c, e.nonce));
2119
2179
  let l = new rt();
2120
2180
  l.pipe(t, { end: !1 }), l.on("end", () => {
2121
2181
  t.end(n.tail);
@@ -2141,16 +2201,16 @@ import {
2141
2201
  return;
2142
2202
  }
2143
2203
  c();
2144
- }, ga = (e) => Array.isArray(e.preload) && e.preload.length > 0, _a = (e, t) => typeof e == "string" ? {
2204
+ }, ba = (e) => Array.isArray(e.preload) && e.preload.length > 0, xa = (e, t) => typeof e == "string" ? {
2145
2205
  tag: e,
2146
2206
  input: {}
2147
2207
  } : {
2148
2208
  tag: e.tag,
2149
2209
  input: e.input?.(t) ?? {}
2150
- }, va = async (e) => {
2210
+ }, Sa = async (e) => {
2151
2211
  let { pageMod: t, params: n, query: r, apiName: i, seed: a, seedFailure: o, onError: s } = e;
2152
- if (ga(t) && r !== void 0 && i !== void 0) for (let e of t.preload) {
2153
- let { tag: t, input: c } = _a(e, n);
2212
+ if (ba(t) && r !== void 0 && i !== void 0) for (let e of t.preload) {
2213
+ let { tag: t, input: c } = xa(e, n);
2154
2214
  try {
2155
2215
  a(i, t, c, await r(t, c));
2156
2216
  } catch (e) {
@@ -2160,12 +2220,12 @@ import {
2160
2220
  }, e);
2161
2221
  }
2162
2222
  }
2163
- }, ya = (e) => h.test(e) || e.endsWith(".workflow.server.tsx") ? !1 : m.test(e) || f.test(e) || u.test(e), ba = /* @__PURE__ */ new Set([
2223
+ }, Ca = (e) => h.test(e) || e.endsWith(".workflow.server.tsx") ? !1 : m.test(e) || f.test(e) || u.test(e), wa = /* @__PURE__ */ new Set([
2164
2224
  "node_modules",
2165
2225
  "dist",
2166
2226
  ".framework",
2167
2227
  ".git"
2168
- ]), xa = async (e) => {
2228
+ ]), Ta = async (e) => {
2169
2229
  let t = [], n = async (e) => {
2170
2230
  let r;
2171
2231
  try {
@@ -2175,15 +2235,15 @@ import {
2175
2235
  }
2176
2236
  for (let i of r) if (!(i.name.startsWith(".") && i.isDirectory())) {
2177
2237
  if (i.isDirectory()) {
2178
- if (ba.has(i.name)) continue;
2238
+ if (wa.has(i.name)) continue;
2179
2239
  await n(P(e, i.name));
2180
- } else ya(i.name) && t.push(P(e, i.name));
2240
+ } else Ca(i.name) && t.push(P(e, i.name));
2181
2241
  }
2182
2242
  };
2183
2243
  return await n(e), t.sort();
2184
- }, Sa = async (e) => {
2244
+ }, Ea = async (e) => {
2185
2245
  let t = J("sha1");
2186
- for (let n of await xa(e)) {
2246
+ for (let n of await Ta(e)) {
2187
2247
  t.update(n.slice(e.length)), t.update("\0");
2188
2248
  try {
2189
2249
  t.update(await z.readFile(n));
@@ -2194,28 +2254,28 @@ import {
2194
2254
  t.update(await z.readFile(P(e, "rpcGroup.generated.ts")));
2195
2255
  } catch {}
2196
2256
  return t.digest("hex");
2197
- }, Ca = async (e) => {
2257
+ }, Da = async (e) => {
2198
2258
  if (e.length === 0) return;
2199
2259
  let t = [];
2200
- for (let n of [...e].sort()) t.push(await Sa(n));
2260
+ for (let n of [...e].sort()) t.push(await Ea(n));
2201
2261
  return J("sha1").update(t.join("\0")).digest("hex");
2202
- }, wa = (e) => typeof e == "object" && !!e && e._tag === "VoltroMiddleware" && typeof e.run == "function", Ta = ["middleware.ts", "middleware.tsx"], Ea = (e) => {
2262
+ }, Oa = (e) => typeof e == "object" && !!e && e._tag === "VoltroMiddleware" && typeof e.run == "function", ka = ["middleware.ts", "middleware.tsx"], Aa = (e) => {
2203
2263
  let t = e.replace(/\/+$/, "");
2204
2264
  return t === "" ? "/" : t;
2205
2265
  }, Z = (e, t) => {
2206
- let n = Ea(e);
2266
+ let n = Aa(e);
2207
2267
  if (n === "/") return !0;
2208
- let r = Ea(t);
2268
+ let r = Aa(t);
2209
2269
  return r === n || r.startsWith(`${n}/`);
2210
- }, Da = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, Oa = (e, t) => {
2270
+ }, ja = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, Ma = (e, t) => {
2211
2271
  if (e === void 0) return !0;
2212
- let n = Da(e.under), r = e.routes ?? [];
2272
+ let n = ja(e.under), r = e.routes ?? [];
2213
2273
  return n.length === 0 && r.length === 0 || r.includes(t) || n.some((e) => Z(e, t)) ? !(e.except ?? []).some((e) => e === t || Z(e, t)) : !1;
2214
- }, ka = (e) => {
2274
+ }, Na = (e) => {
2215
2275
  if (e?.assets !== !0) return [];
2216
- let t = Da(e.under);
2276
+ let t = ja(e.under);
2217
2277
  return t.length > 0 ? t : (e.routes ?? []).length > 0 ? [] : ["/"];
2218
- }, Aa = (e, t) => ka(e).some((e) => Z(e, t)) ? !(e?.except ?? []).some((e) => Z(e, t)) : !1, ja = (e, t) => e.find(({ middleware: e }) => t.route === void 0 ? Aa(e.match, t.pathname) : Oa(e.match, t.route))?.middleware, Ma = (e, t) => {
2278
+ }, Pa = (e, t) => Na(e).some((e) => Z(e, t)) ? !(e?.except ?? []).some((e) => Z(e, t)) : !1, Fa = (e, t) => e.find(({ middleware: e }) => t.route === void 0 ? Pa(e.match, t.pathname) : Ma(e.match, t.route))?.middleware, Ia = (e, t) => {
2219
2279
  let n = [];
2220
2280
  for (let { exportName: r, middleware: i } of e) {
2221
2281
  let e = i.match;
@@ -2223,13 +2283,13 @@ import {
2223
2283
  kind: "dead-matcher",
2224
2284
  message: `\`${r}\` matches routes: ['${i}'], which is not a route in this app. Route patterns are spelled as the router spells them, e.g. \`/notes/[id]\`.`
2225
2285
  });
2226
- if (e?.assets !== !0) for (let [i, a] of [["under", Da(e?.under)], ["except", e?.except ?? []]]) for (let e of a) t.some((t) => Z(e, t)) || n.push({
2286
+ if (e?.assets !== !0) for (let [i, a] of [["under", ja(e?.under)], ["except", e?.except ?? []]]) for (let e of a) t.some((t) => Z(e, t)) || n.push({
2227
2287
  kind: "dead-matcher",
2228
2288
  message: `\`${r}\` matches ${i}: ['${e}'], which covers no route in this app. ` + (i === "except" ? "An `except` that excludes nothing is a rule that reads as active and is not." : "Add `assets: true` if you meant a path the router does not serve.")
2229
2289
  });
2230
2290
  }
2231
2291
  for (let r = 0; r < e.length; r += 1) for (let i = r + 1; i < e.length; i += 1) {
2232
- let a = e[r], o = e[i], s = t.find((e) => Oa(a.middleware.match, e) && Oa(o.middleware.match, e));
2292
+ let a = e[r], o = e[i], s = t.find((e) => Ma(a.middleware.match, e) && Ma(o.middleware.match, e));
2233
2293
  if (s !== void 0) {
2234
2294
  n.push({
2235
2295
  kind: "overlap",
@@ -2238,7 +2298,7 @@ import {
2238
2298
  continue;
2239
2299
  }
2240
2300
  {
2241
- let e = ka(a.middleware.match), t = ka(o.middleware.match), r = e.some((e) => t.some((t) => Z(e, t) || Z(t, e))), i = (a.middleware.match?.except ?? []).some((e) => t.length > 0 && t.every((t) => Z(e, t))) || (o.middleware.match?.except ?? []).some((t) => e.length > 0 && e.every((e) => Z(t, e)));
2301
+ let e = Na(a.middleware.match), t = Na(o.middleware.match), r = e.some((e) => t.some((t) => Z(e, t) || Z(t, e))), i = (a.middleware.match?.except ?? []).some((e) => t.length > 0 && t.every((t) => Z(e, t))) || (o.middleware.match?.except ?? []).some((t) => e.length > 0 && e.every((e) => Z(t, e)));
2242
2302
  r && !i && n.push({
2243
2303
  kind: "overlap",
2244
2304
  message: `\`${a.exportName}\` and \`${o.exportName}\` both declare \`assets: true\` over overlapping paths. A non-page request would match both, and there is no route to tell them apart.`
@@ -2246,10 +2306,10 @@ import {
2246
2306
  }
2247
2307
  }
2248
2308
  return n;
2249
- }, Na = (e, n) => {
2250
- let r = Ma(e, n);
2309
+ }, La = (e, n) => {
2310
+ let r = Ia(e, n);
2251
2311
  if (r.length !== 0) throw t(`middleware.ts: ${r.length} problem(s)\n\n` + r.map((e) => ` • ${e.message}`).join("\n\n"));
2252
- }, Pa = (e) => {
2312
+ }, Ra = (e) => {
2253
2313
  let t = {};
2254
2314
  if (!e) return t;
2255
2315
  for (let n of e.split(";")) {
@@ -2263,11 +2323,11 @@ import {
2263
2323
  }
2264
2324
  }
2265
2325
  return t;
2266
- }, Fa = (e) => Object.entries(e).map(([e, t]) => `${e}=${encodeURIComponent(t)}`).join("; "), Ia = /(^|[-_.])(auth[-_.]?token|session|access[-_.]?token)([-_.]|$)|^sb-.*-auth-token$/i, La = (e) => e.httpOnly === void 0 && Ia.test(e.name), Ra = (e) => {
2326
+ }, za = (e) => Object.entries(e).map(([e, t]) => `${e}=${encodeURIComponent(t)}`).join("; "), Ba = /(^|[-_.])(auth[-_.]?token|session|access[-_.]?token)([-_.]|$)|^sb-.*-auth-token$/i, Va = (e) => e.httpOnly === void 0 && Ba.test(e.name), Ha = (e) => {
2267
2327
  let t = [`${e.name}=${encodeURIComponent(e.value)}`];
2268
2328
  return t.push(`Path=${e.path ?? "/"}`), e.maxAge !== void 0 && t.push(`Max-Age=${Math.trunc(e.maxAge)}`), e.httpOnly !== !1 && t.push("HttpOnly"), e.secure === !0 && t.push("Secure"), t.push(`SameSite=${e.sameSite ?? "lax"}`), t.join("; ");
2269
- }, za = (e) => e.length === 0 ? {} : { "set-cookie": e.map(Ra) }, Ba = async (e, n = (e) => import(U(e).href)) => {
2270
- for (let r of Ta) {
2329
+ }, Ua = (e) => e.length === 0 ? {} : { "set-cookie": e.map(Ha) }, Wa = async (e, n = (e) => import(G(e).href)) => {
2330
+ for (let r of ka) {
2271
2331
  let i;
2272
2332
  try {
2273
2333
  i = await n(P(e, r));
@@ -2276,7 +2336,7 @@ import {
2276
2336
  if (t === "ERR_MODULE_NOT_FOUND" || t === "MODULE_NOT_FOUND") continue;
2277
2337
  throw e;
2278
2338
  }
2279
- let a = Object.entries(i ?? {}), o = a.filter((e) => wa(e[1])).map(([e, t]) => ({
2339
+ let a = Object.entries(i ?? {}), o = a.filter((e) => Oa(e[1])).map(([e, t]) => ({
2280
2340
  exportName: e,
2281
2341
  middleware: t
2282
2342
  }));
@@ -2294,7 +2354,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2294
2354
  return o;
2295
2355
  }
2296
2356
  return [];
2297
- }, Va = async (e, t, n) => {
2357
+ }, Ga = async (e, t, n) => {
2298
2358
  let r = {
2299
2359
  headers: t.headers,
2300
2360
  cookies: t.cookies,
@@ -2305,7 +2365,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2305
2365
  let i = await e.run(t);
2306
2366
  if (!i) return r;
2307
2367
  let a = i.setCookies ?? [];
2308
- if (n !== void 0) for (let e of a) La(e) && n(e);
2368
+ if (n !== void 0) for (let e of a) Va(e) && n(e);
2309
2369
  let o = i.headers ? {
2310
2370
  ...t.headers,
2311
2371
  ...i.headers
@@ -2319,25 +2379,25 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2319
2379
  };
2320
2380
  let l = { ...t.cookies };
2321
2381
  for (let e of a) e.maxAge !== void 0 && e.maxAge <= 0 ? delete l[e.name] : l[e.name] = e.value;
2322
- return i.headers?.cookie === void 0 && (o.cookie = Fa(l)), {
2382
+ return i.headers?.cookie === void 0 && (o.cookie = za(l)), {
2323
2383
  headers: o,
2324
2384
  cookies: l,
2325
2385
  setCookies: a,
2326
2386
  responseHeaders: s,
2327
2387
  ...c
2328
2388
  };
2329
- }, Ha = /* @__PURE__ */ new Set(["voltro:locale"]), Ua = /* @__PURE__ */ new Set(["authorization", "cookie"]), Wa = (e) => {
2389
+ }, Ka = /* @__PURE__ */ new Set(["voltro:locale"]), qa = /* @__PURE__ */ new Set(["authorization", "cookie"]), Ja = (e) => {
2330
2390
  let t = e.split(";").map((e) => e.trim()).filter((e) => {
2331
2391
  let t = e.indexOf("="), n = (t === -1 ? e : e.slice(0, t)).trim();
2332
- return Ha.has(n);
2392
+ return Ka.has(n);
2333
2393
  });
2334
2394
  return t.length > 0 ? t.join("; ") : void 0;
2335
- }, Ga = (e) => {
2395
+ }, Ya = (e) => {
2336
2396
  let t = {};
2337
2397
  for (let [n, r] of Object.entries(e)) if (!n.startsWith("x-voltro-")) {
2338
- if (Ua.has(n)) {
2398
+ if (qa.has(n)) {
2339
2399
  if (n === "cookie") {
2340
- let e = Wa(r);
2400
+ let e = Ja(r);
2341
2401
  e !== void 0 && (t.cookie = e);
2342
2402
  }
2343
2403
  continue;
@@ -2345,47 +2405,47 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2345
2405
  t[n] = r;
2346
2406
  }
2347
2407
  return t;
2348
- }, Ka = (e) => {
2408
+ }, Xa = (e) => {
2349
2409
  let t = {};
2350
- for (let [n, r] of Object.entries(e)) Ha.has(n) && (t[n] = r);
2410
+ for (let [n, r] of Object.entries(e)) Ka.has(n) && (t[n] = r);
2351
2411
  return t;
2352
- }, qa = Ce.exponential({
2412
+ }, Za = Se.exponential({
2353
2413
  start: .001,
2354
2414
  factor: 2,
2355
2415
  count: 16
2356
- }), Ja = G.counter("voltro_ppr_shell_serves_total", { description: "ppr responses whose cached shell was written, by page." }), Ya = G.counter("voltro_ppr_hole_passes_total", { description: "ppr per-request hole passes started, by page." }), Xa = G.counter("voltro_ppr_hole_settles_total", { description: "Deferred ppr holes settled and appended to a response, by page." }), Za = G.counter("voltro_ppr_hole_errors_total", { description: "ppr hole passes that failed as a whole (every hole stays on its fallback), by page." }), Qa = G.histogram("voltro_ppr_hole_pass_seconds", qa, "ppr hole-pass duration in seconds (loader re-run to last hole settled), by page."), $a = [], eo = /* @__PURE__ */ new Map(), to = (e) => {
2357
- let t = eo.get(e);
2416
+ }), Qa = xe.counter("voltro_ppr_shell_serves_total", { description: "ppr responses whose cached shell was written, by page." }), $a = xe.counter("voltro_ppr_hole_passes_total", { description: "ppr per-request hole passes started, by page." }), eo = xe.counter("voltro_ppr_hole_settles_total", { description: "Deferred ppr holes settled and appended to a response, by page." }), to = xe.counter("voltro_ppr_hole_errors_total", { description: "ppr hole passes that failed as a whole (every hole stays on its fallback), by page." }), no = xe.histogram("voltro_ppr_hole_pass_seconds", Za, "ppr hole-pass duration in seconds (loader re-run to last hole settled), by page."), ro = [], io = /* @__PURE__ */ new Map(), ao = (e) => {
2417
+ let t = io.get(e);
2358
2418
  if (t !== void 0) return t;
2359
- let n = (t) => G.tagged(t, "page", e), r = {
2360
- shellServes: n(Ja),
2361
- holePasses: n(Ya),
2362
- holeSettles: n(Xa),
2363
- holeErrors: n(Za),
2364
- holePassSeconds: n(Qa)
2419
+ let n = (t) => xe.tagged(t, "page", e), r = {
2420
+ shellServes: n(Qa),
2421
+ holePasses: n($a),
2422
+ holeSettles: n(eo),
2423
+ holeErrors: n(to),
2424
+ holePassSeconds: n(no)
2365
2425
  };
2366
- return eo.set(e, r), r;
2367
- }, no = (e) => {
2368
- to(e).shellServes.unsafeUpdate(1, $a);
2369
- }, ro = (e) => {
2370
- to(e).holePasses.unsafeUpdate(1, $a);
2371
- }, io = (e) => {
2372
- to(e).holeSettles.unsafeUpdate(1, $a);
2373
- }, ao = (e) => {
2374
- to(e).holeErrors.unsafeUpdate(1, $a);
2375
- }, oo = (e, t) => {
2376
- to(e).holePassSeconds.unsafeUpdate(t / 1e3, $a);
2377
- }, so = ["cookie", "authorization"], co = (e) => so.includes(e) || e.startsWith("x-voltro-"), lo = ["voltro:locale"], uo = class extends Error {
2426
+ return io.set(e, r), r;
2427
+ }, oo = (e) => {
2428
+ ao(e).shellServes.unsafeUpdate(1, ro);
2429
+ }, so = (e) => {
2430
+ ao(e).holePasses.unsafeUpdate(1, ro);
2431
+ }, co = (e) => {
2432
+ ao(e).holeSettles.unsafeUpdate(1, ro);
2433
+ }, lo = (e) => {
2434
+ ao(e).holeErrors.unsafeUpdate(1, ro);
2435
+ }, uo = (e, t) => {
2436
+ ao(e).holePassSeconds.unsafeUpdate(t / 1e3, ro);
2437
+ }, fo = ["cookie", "authorization"], po = (e) => fo.includes(e) || e.startsWith("x-voltro-"), mo = ["voltro:locale"], ho = class extends Error {
2378
2438
  constructor(e, t, n) {
2379
2439
  super(`[voltro] ppr page '${n}': the SHELL render read the ${e} '${t}'. A ppr shell is CACHED and served to every visitor, so it must be computed without credentials — there is no way to prove request-independence by inspection, so the read itself is the error. Move this read into a deferred hole (the second argument of defer(), which runs per request with the full context), or drop ppr and use renderMode 'ssr'.`), this.name = "PprShellCredentialAccessError";
2380
2440
  }
2381
- }, fo = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2382
- if (typeof n == "string" && co(n)) throw new uo("header", n, t);
2441
+ }, go = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2442
+ if (typeof n == "string" && po(n)) throw new ho("header", n, t);
2383
2443
  return Reflect.get(e, n, r);
2384
- } }), po = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2385
- if (typeof n == "string" && !lo.includes(n) && !(n in Object.prototype)) throw new uo("cookie", n, t);
2444
+ } }), _o = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2445
+ if (typeof n == "string" && !mo.includes(n) && !(n in Object.prototype)) throw new ho("cookie", n, t);
2386
2446
  return Reflect.get(e, n, r);
2387
- } }), mo = async (e) => {
2388
- ro(e.page);
2447
+ } }), vo = async (e) => {
2448
+ so(e.page);
2389
2449
  let t = Date.now(), n = () => e.res.destroyed === !0 || e.res.writableEnded === !0;
2390
2450
  try {
2391
2451
  let t = await e.loader(e.ctx), r = e.helpers.prepareDeferredLoaderData(t, "page"), i = r.deferredIds;
@@ -2396,23 +2456,60 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2396
2456
  let a = r.renderData;
2397
2457
  await Promise.all(Object.entries(i).map(async ([t, r]) => {
2398
2458
  let i = await a[t];
2399
- io(e.page), !n() && e.res.write(`<script>${e.helpers.deferredSettleScript(r, i)}<\/script>`);
2459
+ co(e.page), !n() && e.res.write(`<script>${e.helpers.deferredSettleScript(r, i)}<\/script>`);
2400
2460
  }));
2401
2461
  } catch (t) {
2402
- ao(e.page), e.log.warn("ppr hole pass failed — holes stay on their fallbacks", { page: e.page }, t);
2462
+ lo(e.page), e.log.warn("ppr hole pass failed — holes stay on their fallbacks", { page: e.page }, t);
2403
2463
  } finally {
2404
- oo(e.page, Date.now() - t), n() || e.res.end();
2464
+ uo(e.page, Date.now() - t), n() || e.res.end();
2405
2465
  }
2406
- }, ho = (e, t) => {
2466
+ }, yo = (e, t) => {
2407
2467
  if (e.deferredSegmentIds !== void 0) throw Error(`[voltro] ppr page '${t}': a LAYOUT loader in its chain uses defer(). ppr appends holes for the PAGE loader only — move the deferred field into the page loader, or return the value directly from the layout.`);
2408
- }, Q = W({ scope: "voltro:dev:web" }), go = W({ scope: "vite" }), _o = await (async () => {
2468
+ }, bo = "/internal", xo = (e, t) => ({
2469
+ path: (e?.path ?? bo).replace(/\/+$/, "") || bo,
2470
+ liveness: e?.liveness ?? (() => !0),
2471
+ readiness: e?.readiness ?? t
2472
+ }), So = (e, t) => {
2473
+ if (!t.startsWith(`${e.path}/`)) return;
2474
+ let n = t.slice(e.path.length + 1);
2475
+ return n === "liveness" || n === "readiness" || n === "startup" ? n : void 0;
2476
+ }, Co = async (e, t) => {
2477
+ if (t === "liveness") try {
2478
+ return await e.liveness() ? {
2479
+ status: 200,
2480
+ body: "ok"
2481
+ } : {
2482
+ status: 503,
2483
+ body: "not-live"
2484
+ };
2485
+ } catch {
2486
+ return {
2487
+ status: 503,
2488
+ body: "not-live"
2489
+ };
2490
+ }
2409
2491
  try {
2410
- let e = P(N(he(import.meta.url)), "..", "package.json"), t = await z.readFile(e, "utf8");
2492
+ return await e.readiness() ? {
2493
+ status: 200,
2494
+ body: "ready"
2495
+ } : {
2496
+ status: 503,
2497
+ body: "not-ready"
2498
+ };
2499
+ } catch {
2500
+ return {
2501
+ status: 503,
2502
+ body: "not-ready"
2503
+ };
2504
+ }
2505
+ }, Q = K({ scope: "voltro:dev:web" }), wo = K({ scope: "vite" }), To = await (async () => {
2506
+ try {
2507
+ let e = P(N(W(import.meta.url)), "..", "package.json"), t = await z.readFile(e, "utf8");
2411
2508
  return JSON.parse(t).version ?? "0.0.0";
2412
2509
  } catch {
2413
2510
  return "0.0.0";
2414
2511
  }
2415
- })(), vo = (e, t) => {
2512
+ })(), Eo = (e, t) => {
2416
2513
  let n;
2417
2514
  for (let r of e) {
2418
2515
  if (!r.hasNotFound) continue;
@@ -2420,16 +2517,16 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2420
2517
  i !== "/" && !(t === i || t.startsWith(i + "/")) || (n === void 0 || r.dir.length > n.dir.length) && (n = r);
2421
2518
  }
2422
2519
  return n;
2423
- }, yo = async () => {
2520
+ }, Do = async () => {
2424
2521
  try {
2425
- let e = N(he(import.meta.url)), t = I(e, "..", "..", "devtools");
2522
+ let e = N(W(import.meta.url)), t = I(e, "..", "..", "devtools");
2426
2523
  if (L(P(t, "package.json"))) return t;
2427
2524
  let n = I(e, "..", "..", "..", "devtools");
2428
2525
  return L(P(n, "package.json")) ? n : null;
2429
2526
  } catch {
2430
2527
  return null;
2431
2528
  }
2432
- }, bo = (e, t) => e.disableDevtools || !t ? [] : [
2529
+ }, Oo = (e, t) => e.disableDevtools || !t ? [] : [
2433
2530
  "",
2434
2531
  "// Dev-only in-page devtools overlay. The `import.meta.env.DEV` guard is a",
2435
2532
  "// compile-time constant, so prod builds strip this whole `if` block — the",
@@ -2439,7 +2536,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2439
2536
  " await import('@voltro/devtools/styles.css')",
2440
2537
  " Devtools = (await import('@voltro/devtools')).VoltroDevtools",
2441
2538
  "}"
2442
- ], xo = (e) => {
2539
+ ], ko = (e) => {
2443
2540
  let t = /* @__PURE__ */ new Set();
2444
2541
  for (let n of e) {
2445
2542
  let e = n.browserWsUrl;
@@ -2449,12 +2546,12 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2449
2546
  } catch {}
2450
2547
  }
2451
2548
  return [...t].map((e) => ` <link rel="preconnect" href="${e}" crossorigin />`);
2452
- }, So = (e) => e.web?.api?.connect === "lazy" ? [" connect: 'lazy',"] : [], Co = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], wo = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], To = (e) => e.sentry ? [
2549
+ }, Ao = (e) => e.web?.api?.connect === "lazy" ? [" connect: 'lazy',"] : [], jo = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], Mo = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], No = (e) => e.sentry ? [
2453
2550
  "",
2454
2551
  "// Browser-side Sentry (frontend half of the deep integration). Errors +",
2455
2552
  "// browser rpc spans flow to Sentry, sharing the server transactions' trace.",
2456
2553
  `await initSentryBrowser(${JSON.stringify(e.sentry)})`
2457
- ] : [], Eo = (e) => e.env ? ["import './env.public'"] : [], Do = (e) => {
2554
+ ] : [], Po = (e) => e.env ? ["import './env.public'"] : [], Fo = (e) => {
2458
2555
  let t = [], n = I(e);
2459
2556
  for (;;) {
2460
2557
  L(P(n, "pnpm-workspace.yaml")) && t.push(n);
@@ -2463,12 +2560,12 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2463
2560
  n = e;
2464
2561
  }
2465
2562
  return t;
2466
- }, Oo = M, ko = (e) => {
2563
+ }, Io = re, Lo = (e) => {
2467
2564
  if (/\/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(?:react|react-dom|scheduler)\//.test(e)) return "react";
2468
- }, Ao = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, jo = (e) => e.startsWith("(") && e.endsWith(")"), Mo = (e) => e.filter((e) => !jo(e)), No = (e) => {
2469
- let t = e.replace(p, "").split("/").filter(Boolean).filter((e) => !jo(e));
2565
+ }, Ro = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, zo = (e) => e.startsWith("(") && e.endsWith(")"), Bo = (e) => e.filter((e) => !zo(e)), Vo = (e) => {
2566
+ let t = e.replace(p, "").split("/").filter(Boolean).filter((e) => !zo(e));
2470
2567
  return t.length === 0 ? "/" : "/" + t.join("/");
2471
- }, Po = (e) => `${e.replace(p, "").split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Index"}Page`, $ = (e, t) => e === "" ? `Root${t}` : `${e.split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Root"}${t}`, Fo = async (e) => {
2568
+ }, Ho = (e) => `${e.replace(p, "").split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Index"}Page`, $ = (e, t) => e === "" ? `Root${t}` : `${e.split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Root"}${t}`, Uo = async (e) => {
2472
2569
  let t = [], n = [], r = async (e, i) => {
2473
2570
  let a = [];
2474
2571
  try {
@@ -2476,17 +2573,17 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2476
2573
  } catch {
2477
2574
  return;
2478
2575
  }
2479
- let o = a.filter((e) => e.isDirectory()).map((e) => e.name).sort(), s = a.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !Oo(e.name)).map((e) => e.name).sort(), c = new Set(s), l = i.join("/");
2576
+ let o = a.filter((e) => e.isDirectory()).map((e) => e.name).sort(), s = a.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !Io(e.name)).map((e) => e.name).sort(), c = new Set(s), l = i.join("/");
2480
2577
  if (s.some((e) => d.has(e))) {
2481
2578
  let t = c.has("layout.tsx"), r = !1;
2482
2579
  if (t) try {
2483
2580
  let t = await z.readFile(P(e, "layout.tsx"), "utf8");
2484
- r = Ao.test(t);
2581
+ r = Ro.test(t);
2485
2582
  } catch {}
2486
2583
  n.push({
2487
2584
  dir: l,
2488
2585
  chain: i,
2489
- contributesToUrl: i.length === 0 || !jo(i[i.length - 1]),
2586
+ contributesToUrl: i.length === 0 || !zo(i[i.length - 1]),
2490
2587
  hasLayout: t,
2491
2588
  hasLayoutLoader: r,
2492
2589
  hasError: c.has("error.tsx"),
@@ -2500,8 +2597,8 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2500
2597
  let n = l ? `${l}/${e}` : e;
2501
2598
  t.push({
2502
2599
  file: n,
2503
- pattern: No(n),
2504
- ident: Po(n),
2600
+ pattern: Vo(n),
2601
+ ident: Ho(n),
2505
2602
  dirChain: i
2506
2603
  });
2507
2604
  }
@@ -2520,14 +2617,14 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2520
2617
  dirs: a,
2521
2618
  orphanedSpecials: o
2522
2619
  };
2523
- }, Io = (e, t) => {
2620
+ }, Wo = (e, t) => {
2524
2621
  let n = [];
2525
2622
  for (let r = 0; r <= t.length; r++) {
2526
2623
  let i = t.slice(0, r).join("/"), a = e.find((e) => e.dir === i);
2527
2624
  a && n.push(a);
2528
2625
  }
2529
2626
  return n;
2530
- }, Lo = async (e) => {
2627
+ }, Go = async (e) => {
2531
2628
  let { entries: t, loadLayout: n, loadError: r, loadPending: i, ctx: a } = e, o = {};
2532
2629
  return {
2533
2630
  chain: await Promise.all(t.map(async (e, t) => {
@@ -2551,10 +2648,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2551
2648
  })),
2552
2649
  segmentLoaderData: o
2553
2650
  };
2554
- }, Ro = (e) => {
2555
- let t = Mo(e);
2651
+ }, Ko = (e) => {
2652
+ let t = Bo(e);
2556
2653
  return t.length === 0 ? "" : "/" + t.join("/");
2557
- }, zo = [
2654
+ }, qo = [
2558
2655
  "// Hot-reload bridge: keep SSR-injected <link rel=\"stylesheet\"> tags",
2559
2656
  "// in sync with Vite's CSS HMR. Without this, edits to .css files",
2560
2657
  "// only update the JS-injected <style> overlay; the underlying <link>",
@@ -2647,7 +2744,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2647
2744
  " _vdtErrorStart('Build error')",
2648
2745
  " })",
2649
2746
  "}"
2650
- ].join("\n"), Bo = (e) => {
2747
+ ].join("\n"), Jo = (e) => {
2651
2748
  let t = [], n = 0, r = e.split("/").filter(Boolean), i = [];
2652
2749
  for (let e of r) e.startsWith("[[...") && e.endsWith("]]") ? (i.push("(.*)"), t.push(e.slice(5, -2)), n += 2) : e.startsWith("[...") && e.endsWith("]") ? (i.push("(.+)"), t.push(e.slice(4, -1)), n += 3) : e.startsWith("[") && e.endsWith("]") ? (i.push("([^/]+)"), t.push(e.slice(1, -1)), n += 1) : i.push(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
2653
2750
  let a = i.join("/");
@@ -2656,8 +2753,8 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2656
2753
  paramNames: t,
2657
2754
  priority: n
2658
2755
  };
2659
- }, Vo = (e) => e.map((e) => {
2660
- let { regex: t, paramNames: n, priority: r } = Bo(e.pattern);
2756
+ }, Yo = (e) => e.map((e) => {
2757
+ let { regex: t, paramNames: n, priority: r } = Jo(e.pattern);
2661
2758
  return {
2662
2759
  pattern: e.pattern,
2663
2760
  file: e.file,
@@ -2666,7 +2763,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2666
2763
  paramNames: n,
2667
2764
  priority: r
2668
2765
  };
2669
- }).slice().sort((e, t) => e.priority - t.priority), Ho = (e, t) => {
2766
+ }).slice().sort((e, t) => e.priority - t.priority), Xo = (e, t) => {
2670
2767
  for (let n of t) {
2671
2768
  let t = n.regex.exec(e);
2672
2769
  if (!t) continue;
@@ -2678,9 +2775,9 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2678
2775
  };
2679
2776
  }
2680
2777
  return null;
2681
- }, Uo = _, Wo = async (e) => {
2778
+ }, Zo = _, Qo = async (e) => {
2682
2779
  try {
2683
- let t = await import(U(P(e, "app.config.ts")).href), n = t.default?.port, r = l({
2780
+ let t = await import(G(P(e, "app.config.ts")).href), n = t.default?.port, r = l({
2684
2781
  kind: "api",
2685
2782
  configPort: typeof n == "number" ? n : void 0,
2686
2783
  env: {}
@@ -2694,7 +2791,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2694
2791
  kind: "api",
2695
2792
  env: {}
2696
2793
  }).port };
2697
- }, Go = (e, t) => ({
2794
+ }, $o = (e, t) => ({
2698
2795
  name: e,
2699
2796
  pkg: t.package,
2700
2797
  browserWsUrl: t.url,
@@ -2702,7 +2799,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2702
2799
  ...t.serverUrl ? { serverOrigin: t.serverUrl } : {},
2703
2800
  ...t.headers ? { headers: t.headers } : {},
2704
2801
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
2705
- }), Ko = (e, t, n) => {
2802
+ }), es = (e, t, n) => {
2706
2803
  let r = t.transport?.wsPath ?? n.wsPath;
2707
2804
  return {
2708
2805
  name: e,
@@ -2714,7 +2811,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2714
2811
  ...t.headers ? { headers: t.headers } : {},
2715
2812
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
2716
2813
  };
2717
- }, qo = (e) => {
2814
+ }, ts = (e) => {
2718
2815
  let t = /* @__PURE__ */ new Map();
2719
2816
  for (let n of e) {
2720
2817
  if (n.proxyTarget === void 0) continue;
@@ -2722,43 +2819,43 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2722
2819
  if (e) throw Error(`[voltro] api ${JSON.stringify(n.name)} and ${JSON.stringify(e)} both resolve the same-origin WS path ${JSON.stringify(n.browserWsUrl)}. A custom transport.wsPath must be unique per origin (one api per origin may use a fixed path). Give each a distinct wsPath, or drop the override to use the default /ws/<name>.`);
2723
2820
  t.set(n.browserWsUrl, n.name);
2724
2821
  }
2725
- }, Jo = async (e, t) => {
2822
+ }, ns = async (e, t) => {
2726
2823
  let n = Object.entries(t.apis ?? {}), r = [];
2727
2824
  for (let [t, i] of n) {
2728
2825
  if (i.url) {
2729
- r.push(Go(t, i));
2826
+ r.push($o(t, i));
2730
2827
  continue;
2731
2828
  }
2732
- let n = await Uo(e, i.package);
2829
+ let n = await Zo(e, i.package);
2733
2830
  if (!n) throw Error(`[voltro dev] api ${JSON.stringify(t)} (package ${JSON.stringify(i.package)}) is not a workspace dep and has no \`url\` set in app.config.ts. External apis need an explicit \`url\` because the framework can't discover their dev port.`);
2734
- r.push(Ko(t, i, await Wo(n)));
2831
+ r.push(es(t, i, await Qo(n)));
2735
2832
  }
2736
- return qo(r), r;
2737
- }, Yo = (e) => {
2833
+ return ts(r), r;
2834
+ }, rs = (e) => {
2738
2835
  if (!(!/^wss?:\/\//.test(e) && !/^https?:\/\//.test(e))) try {
2739
2836
  let t = new URL(e);
2740
2837
  return t.protocol = t.protocol === "wss:" || t.protocol === "https:" ? "https:" : "http:", `${t.protocol}//${t.host}`;
2741
2838
  } catch {
2742
2839
  return;
2743
2840
  }
2744
- }, Xo = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, Zo = (e) => process.env[Xo(e)] ?? process.env.VOLTRO_API_ORIGIN, Qo = (e, t) => {
2841
+ }, is = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, as = (e) => process.env[is(e)] ?? process.env.VOLTRO_API_ORIGIN, os = (e, t) => {
2745
2842
  if (!e) return;
2746
- let n = Zo(e.name) ?? e.serverOrigin;
2843
+ let n = as(e.name) ?? e.serverOrigin;
2747
2844
  if (n) {
2748
- let e = Yo(n);
2845
+ let e = rs(n);
2749
2846
  if (e) return e;
2750
2847
  }
2751
2848
  if (t?.allowDevProxy && e.proxyTarget) {
2752
- let t = Yo(e.proxyTarget);
2849
+ let t = rs(e.proxyTarget);
2753
2850
  if (t) return t;
2754
2851
  }
2755
- if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return Yo(e.browserWsUrl);
2756
- }, $o = (e, t, n) => {
2852
+ if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return rs(e.browserWsUrl);
2853
+ }, ss = (e, t, n) => {
2757
2854
  if (!e) {
2758
2855
  if (n?.apiName === void 0) return;
2759
2856
  let e = n.apiName;
2760
2857
  return async () => {
2761
- throw Error(`[loader.query] api '${e}' has no server-side origin for SSR. In a split web/api deployment the web pod reaches the api by internal DNS, not the browser's relative wsPath — set ${Xo(e)} (or VOLTRO_API_ORIGIN, or apis.${e}.serverUrl in app.config.ts) to the api's internal origin, e.g. http://api.<namespace>.svc.cluster.local. The browser transport is unaffected.`);
2858
+ throw Error(`[loader.query] api '${e}' has no server-side origin for SSR. In a split web/api deployment the web pod reaches the api by internal DNS, not the browser's relative wsPath — set ${is(e)} (or VOLTRO_API_ORIGIN, or apis.${e}.serverUrl in app.config.ts) to the api's internal origin, e.g. http://api.<namespace>.svc.cluster.local. The browser transport is unaffected.`);
2762
2859
  };
2763
2860
  }
2764
2861
  return async (r, i) => {
@@ -2781,7 +2878,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2781
2878
  });
2782
2879
  } catch (t) {
2783
2880
  let i = t?.cause?.code ?? String(t?.message ?? t);
2784
- throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${Xo(n.apiName)} / VOLTRO_API_ORIGIN` : "Set the api server origin"} to the api's SSR-reachable origin (internal cluster DNS in a split deployment).`, { cause: t });
2881
+ throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${is(n.apiName)} / VOLTRO_API_ORIGIN` : "Set the api server origin"} to the api's SSR-reachable origin (internal cluster DNS in a split deployment).`, { cause: t });
2785
2882
  }
2786
2883
  if (!o.ok) throw Error(`[loader.query] ${r}: HTTP ${o.status} ${await o.text()}`);
2787
2884
  let s = await o.json();
@@ -2811,7 +2908,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2811
2908
  }
2812
2909
  if (u) return l;
2813
2910
  };
2814
- }, es = (e, t) => {
2911
+ }, cs = (e, t) => {
2815
2912
  let n = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppGroup`, r = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppDescriptors`, i = e.map((e) => `import { appGroup as ${n(e.name)}, appDescriptors as ${r(e.name)} } from '${e.pkg}/rpcGroup'`);
2816
2913
  e.some((e) => e.hasAuthHeaders) && (i.push(`import __voltroAppConfig from '${t}'`), i.push("const __voltroAuthHeaders = (__voltroAppConfig as { readonly apis?: Record<string, { readonly authHeaders?: () => Record<string, string> | Promise<Record<string, string>> }> }).apis"));
2817
2914
  let a = (e) => {
@@ -2823,10 +2920,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2823
2920
  entryLines: e.map((e) => ` ${JSON.stringify(e.name)}: { ${a(e).join(", ")} },`),
2824
2921
  providerEntryLines: e.map((e) => ` { name: ${JSON.stringify(e.name)}, ${a(e).join(", ")} },`)
2825
2922
  };
2826
- }, ts = async (e, t, n, r = {}) => {
2923
+ }, ls = async (e, t, n, r = {}) => {
2827
2924
  let i = t.title ?? t.name ?? "app";
2828
- Hn(e);
2829
- let a = await Rn(e, t.fonts), o = a === null ? [] : [...a.preloads.map((e) => ` <link rel="preload" as="font" type="font/${e.endsWith(".woff2") ? "woff2" : e.endsWith(".woff") ? "woff" : e.endsWith(".otf") ? "otf" : "ttf"}" href="${e}" crossorigin />`), ` <style data-voltro-fonts>${a.css}</style>`], s = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", c = L(P(e, "node_modules", "@voltro", "devtools", "package.json")) || await yo() !== null, l = t.theme === "system" ? [
2925
+ Gn(e);
2926
+ let a = await Vn(e, t.fonts), o = a === null ? [] : [...a.preloads.map((e) => ` <link rel="preload" as="font" type="font/${e.endsWith(".woff2") ? "woff2" : e.endsWith(".woff") ? "woff" : e.endsWith(".otf") ? "otf" : "ttf"}" href="${e}" crossorigin />`), ` <style data-voltro-fonts>${a.css}</style>`], s = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", c = L(P(e, "node_modules", "@voltro", "devtools", "package.json")) || await Do() !== null, l = t.theme === "system" ? [
2830
2927
  " <script>",
2831
2928
  " (function () {",
2832
2929
  " var root = document.documentElement",
@@ -2868,7 +2965,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2868
2965
  " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />",
2869
2966
  ` <title>${i}</title>`,
2870
2967
  " <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />",
2871
- ...xo(n),
2968
+ ...ko(n),
2872
2969
  ...o,
2873
2970
  ...l ? [l] : [],
2874
2971
  ...u ? [u] : [],
@@ -2879,10 +2976,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2879
2976
  " </body>",
2880
2977
  "</html>",
2881
2978
  ""
2882
- ].join("\n"), f = P(e, "src", "pages"), { pages: p, dirs: m, orphanedSpecials: h } = await Fo(f);
2979
+ ].join("\n"), f = P(e, "src", "pages"), { pages: p, dirs: m, orphanedSpecials: h } = await Uo(f);
2883
2980
  await x(f, p);
2884
2981
  for (let e of h) Q.warn(`src/pages/${e.dir || "."}/ contains ${e.files.join(", ")} but no page.tsx at or below it — ${e.files.length > 1 ? "those files are" : "that file is"} inert. A layout/error/loading/not-found file only applies to routes in its own directory tree; if this is an ordinary component, rename it so it does not read as a route boundary.`);
2885
- let { imports: g, entryLines: _ } = es(n, "../app.config"), v, y, ee;
2982
+ let { imports: g, entryLines: _ } = cs(n, "../app.config"), v, y, ee;
2886
2983
  if (p.length > 0) {
2887
2984
  let n = p.map((e) => ` ${JSON.stringify(e.pattern)}: () => import('../src/pages/${e.file}'),`), r = [];
2888
2985
  for (let e of m) {
@@ -2890,13 +2987,13 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2890
2987
  e.hasLayout && e.hasLayoutLoader ? r.push(`import * as ${$(e.dir, "Layout")}Mod from '${t}/layout.tsx'`) : e.hasLayout && r.push(`import ${$(e.dir, "Layout")} from '${t}/layout.tsx'`), e.hasError && r.push(`import ${$(e.dir, "Error")} from '${t}/error.tsx'`), e.hasPending && r.push(`import ${$(e.dir, "Pending")} from '${t}/loading.tsx'`), e.hasNotFound && r.push(`import ${$(e.dir, "NotFound")} from '${t}/not-found.tsx'`);
2891
2988
  }
2892
2989
  let i = p.map((e) => {
2893
- let t = Io(m, e.dirChain).map((e) => {
2990
+ let t = Wo(m, e.dirChain).map((e) => {
2894
2991
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
2895
2992
  return e.hasLayout && t.push(`Layout: refs.layouts[${n}]`), e.hasLayoutLoader && t.push(`loader: refs.layoutLoaders[${n}]`), e.hasError && t.push(`Error: refs.errors[${n}]`), e.hasPending && t.push(`Pending: refs.pendings[${n}]`), ` { ${t.join(", ")} }`;
2896
2993
  }).join(",\n");
2897
2994
  return ` makePageRoute(${JSON.stringify(e.pattern)}, ${t.length > 0 ? `[\n${t},\n ]` : "undefined"}),`;
2898
2995
  }), a = m.filter((e) => e.hasNotFound).map((e) => {
2899
- let t = Ro(e.chain), n = Io(m, e.chain).map((e) => {
2996
+ let t = Ko(e.chain), n = Wo(m, e.chain).map((e) => {
2900
2997
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
2901
2998
  return e.hasLayout && t.push(`Layout: refs.layouts[${n}]`), e.hasError && t.push(`Error: refs.errors[${n}]`), ` { ${t.join(", ")} }`;
2902
2999
  }).join(",\n"), r = n.length > 0 ? `\n chain: [\n${n},\n ],` : "";
@@ -3184,14 +3281,14 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3184
3281
  "// resolved apis map. Side-effect only — no local component definitions —",
3185
3282
  "// so downstream invalidations (user page edits) terminate at app.tsx.",
3186
3283
  "",
3187
- ...Eo(t),
3284
+ ...Po(t),
3188
3285
  "import { mount } from '@voltro/web'",
3189
3286
  ...g,
3190
3287
  "import { App } from './app'",
3191
3288
  "import { preloadCurrentRoute } from './routeTable'",
3192
- ...wo(t),
3193
- ...bo(t, c),
3194
- ...To(t),
3289
+ ...Mo(t),
3290
+ ...Oo(t, c),
3291
+ ...No(t),
3195
3292
  "",
3196
3293
  "// Preload the current route's page chunk BEFORE hydration so the first",
3197
3294
  "// client render matches the SSG/SSR-prerendered HTML. Without it, a lazy",
@@ -3208,11 +3305,11 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3208
3305
  " apis: {",
3209
3306
  ..._,
3210
3307
  " },",
3211
- ...Co(t, c),
3212
- ...So(t),
3308
+ ...jo(t, c),
3309
+ ...Ao(t),
3213
3310
  "})",
3214
3311
  "",
3215
- zo
3312
+ qo
3216
3313
  ].join("\n");
3217
3314
  } else v = "", y = "", ee = [
3218
3315
  "// GENERATED BY `voltro dev` — do not edit; will be overwritten on next boot.",
@@ -3220,23 +3317,23 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3220
3317
  "// and calls mount(). Side-effect only, no component definitions, so the",
3221
3318
  "// user's component file remains the Fast Refresh boundary.",
3222
3319
  "",
3223
- ...Eo(t),
3320
+ ...Po(t),
3224
3321
  "import { mount } from '@voltro/web'",
3225
3322
  ...g,
3226
3323
  "import App from '../src/App'",
3227
- ...wo(t),
3228
- ...bo(t, c),
3229
- ...To(t),
3324
+ ...Mo(t),
3325
+ ...Oo(t, c),
3326
+ ...No(t),
3230
3327
  "",
3231
3328
  "mount(App, {",
3232
3329
  " apis: {",
3233
3330
  ..._,
3234
3331
  " },",
3235
- ...Co(t, c),
3236
- ...So(t),
3332
+ ...jo(t, c),
3333
+ ...Ao(t),
3237
3334
  "})",
3238
3335
  "",
3239
- zo
3336
+ qo
3240
3337
  ].join("\n");
3241
3338
  let b = P(e, ".framework");
3242
3339
  await z.mkdir(b, { recursive: !0 }), t.env ? await ht(b, r) : await z.rm(P(b, "env.public.ts"), { force: !0 }), await z.writeFile(P(b, "index.html"), d, "utf8"), await z.writeFile(P(b, "main.tsx"), ee, "utf8"), v ? (await z.writeFile(P(b, "app.tsx"), v, "utf8"), await z.writeFile(P(b, "routeTable.ts"), y, "utf8")) : (await z.rm(P(b, "app.tsx"), { force: !0 }), await z.rm(P(b, "routeTable.ts"), { force: !0 }));
@@ -3253,7 +3350,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3253
3350
  Q.warn(`could not add ${E.join(", ")} to ${S} — add it by hand so the generated directory stays out of git. The build is unaffected.`, { reason: e?.message ?? String(e) });
3254
3351
  }
3255
3352
  }
3256
- }, ns = async (e, t) => {
3353
+ }, us = async (e, t) => {
3257
3354
  try {
3258
3355
  let n = N(e), r = P(n, "project.json");
3259
3356
  if (!L(r)) return;
@@ -3266,35 +3363,36 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3266
3363
  projectJson: r
3267
3364
  });
3268
3365
  } catch {}
3269
- }, rs = (e) => P(e, ".framework", "dist", "server", "appConfig.js"), is = async (e, t = {}) => {
3270
- let n = rs(e), r = t.preferSource !== !0 && L(n) ? n : P(e, "app.config.ts");
3366
+ }, ds = (e) => P(e, ".framework", "dist", "server", "appConfig.js"), fs = async (e, t = {}) => {
3367
+ let n = ds(e), r = t.preferSource !== !0 && L(n) ? n : P(e, "app.config.ts");
3271
3368
  try {
3272
- let e = (await import(U(r).href)).default;
3369
+ let e = (await import(G(r).href)).default;
3273
3370
  return typeof e == "object" && e && "type" in e && e.type === "web" ? e : null;
3274
3371
  } catch {
3275
3372
  return null;
3276
3373
  }
3277
- }, as = (e) => {
3374
+ }, ps = (e) => {
3278
3375
  let t = e.restRoutes;
3279
3376
  if (t !== void 0 && t.length !== 0) return `app.config.ts declares ${t.length} restRoute(s) on a type:'web' app — REST routes mount on the API process and were silently ignored here, so a health probe hitting one gets the SPA shell (200) and a POST gets 404.\n Move them to the API app's app.config.ts (they mount under the api origin), and call them there;\n for same-origin paths in front of the web app, terminate them at your ingress/proxy instead.`;
3280
- }, os = async (t) => {
3281
- let u = await is(t, { preferSource: !0 });
3377
+ }, ms = async (t) => {
3378
+ let u = await fs(t, { preferSource: !0 });
3282
3379
  if (!u) return {
3283
3380
  ran: !1,
3284
3381
  exitCode: 0
3285
3382
  };
3383
+ let d = xo(u.health, () => !0);
3286
3384
  {
3287
- let e = as(u);
3385
+ let e = ps(u);
3288
3386
  if (e !== void 0) return Q.error(`voltro dev (web): refusing to boot — ${e}`), {
3289
3387
  ran: !0,
3290
3388
  exitCode: 1
3291
3389
  };
3292
3390
  }
3293
- gi();
3294
- let d = at();
3295
- Jr(d), Q.info("booting voltro dev (web)", { app: u.name ?? "(unnamed)" }), Rt(t, Q);
3296
- let f = await Jo(t, u);
3297
- for (let e of f) Q.info("api wired", {
3391
+ bi();
3392
+ let f = at();
3393
+ Qr(f), Q.info("booting voltro dev (web)", { app: u.name ?? "(unnamed)" }), Vt(t, Q);
3394
+ let p = await ns(t, u);
3395
+ for (let e of p) Q.info("api wired", {
3298
3396
  name: e.name,
3299
3397
  pkg: e.pkg,
3300
3398
  ...e.proxyTarget ? { proxyTo: e.proxyTarget } : { directWs: e.browserWsUrl }
@@ -3305,62 +3403,62 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3305
3403
  Q.info(`${e} seeded`, { path: t.path });
3306
3404
  }
3307
3405
  }).catch(() => {});
3308
- let { resolved: p } = await gt({
3406
+ let { resolved: m } = await yt({
3309
3407
  rawEnv: u.env,
3310
3408
  appType: "web",
3311
3409
  root: t,
3312
3410
  log: Q,
3313
3411
  generateTypes: !0
3314
- }), m = p.publicValues;
3315
- await ts(t, u, f, m), Q.debug("generated framework entry files", { files: [
3412
+ }), h = m.publicValues;
3413
+ await ls(t, u, p, h), Q.debug("generated framework entry files", { files: [
3316
3414
  "index.html",
3317
3415
  ".framework/main.tsx",
3318
3416
  ...u.env ? [".framework/env.public.ts"] : []
3319
3417
  ] });
3320
- let h = l({
3418
+ let _ = l({
3321
3419
  kind: "web",
3322
3420
  configPort: u.port,
3323
3421
  env: process.env,
3324
- dashboardPin: process.env[Mi] === "1"
3422
+ dashboardPin: process.env[Ii] === "1"
3325
3423
  });
3326
- for (let e of h.warnings) Q.warn(e);
3327
- let _ = h.port, x = u.name ?? "unnamed", S = se("web", x, _), C = ce(x);
3424
+ for (let e of _.warnings) Q.warn(e);
3425
+ let x = _.port, S = u.name ?? "unnamed", C = se("web", S, x), w = ce(S);
3328
3426
  await ie({
3329
- id: S,
3330
- name: x,
3427
+ id: C,
3428
+ name: S,
3331
3429
  kind: "web",
3332
- url: `http://localhost:${_}`,
3430
+ url: `http://localhost:${x}`,
3333
3431
  pid: process.pid,
3334
3432
  status: "booting",
3335
- logFile: C.path
3336
- }).catch(() => {}), await ns(t, _);
3337
- let { pages: w, dirs: T } = await Fo(P(t, "src", "pages")), E = null, te = u.fonts !== void 0 && u.fonts.length > 0 ? gr({
3433
+ logFile: w.path
3434
+ }).catch(() => {}), await us(t, x);
3435
+ let { pages: T, dirs: E } = await Uo(P(t, "src", "pages")), D = null, te = u.fonts !== void 0 && u.fonts.length > 0 ? yr({
3338
3436
  root: t,
3339
3437
  fonts: u.fonts,
3340
3438
  cache: ee(),
3341
- secret: mr().secret,
3342
- isOgSsrRoute: (e) => D.ssrRoutes.some((t) => t.pattern === e),
3439
+ secret: _r().secret,
3440
+ isOgSsrRoute: (e) => k.ssrRoutes.some((t) => t.pattern === e),
3343
3441
  getPageModule: async (e) => {
3344
- let t = D.ssrRoutes.find((t) => t.pattern === e);
3345
- if (t === void 0 || E === null) return null;
3346
- let n = await E(t.file), r = y(n, t.file);
3442
+ let t = k.ssrRoutes.find((t) => t.pattern === e);
3443
+ if (t === void 0 || D === null) return null;
3444
+ let n = await D(t.file), r = y(n, t.file);
3347
3445
  return r === "ssr" || r === "isr" ? n : null;
3348
3446
  }
3349
- }) : null, D = {
3350
- dirs: T,
3351
- ssrRoutes: Vo(w)
3352
- }, O = T.map((e) => ({
3447
+ }) : null, k = {
3448
+ dirs: E,
3449
+ ssrRoutes: Yo(T)
3450
+ }, ne = E.map((e) => ({
3353
3451
  dir: e.dir,
3354
3452
  hasLayout: e.hasLayout,
3355
3453
  hasError: e.hasError,
3356
3454
  hasPending: e.hasPending,
3357
3455
  hasNotFound: e.hasNotFound
3358
- })), re = await Er({
3456
+ })), A = await kr({
3359
3457
  appRoot: t,
3360
- pages: w
3458
+ pages: T
3361
3459
  });
3362
- re.wrote && Q.debug("routes codegen wrote", { path: F(t, re.path) });
3363
- let k = await lt("vite", () => import("vite")), A = (await import("@vitejs/plugin-react")).default, j = (await import("@tailwindcss/vite")).default, M = P(t, ".framework"), N = P(t, "src"), ue = /* @__PURE__ */ new Set([
3460
+ A.wrote && Q.debug("routes codegen wrote", { path: F(t, A.path) });
3461
+ let j = await lt("vite", () => import("vite")), M = (await import("@vitejs/plugin-react")).default, re = (await import("@tailwindcss/vite")).default, N = P(t, ".framework"), ue = P(t, "src"), de = /* @__PURE__ */ new Set([
3364
3462
  ".framework",
3365
3463
  "node_modules",
3366
3464
  "dist",
@@ -3368,32 +3466,32 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3368
3466
  ".vite",
3369
3467
  ".turbo",
3370
3468
  ".cache"
3371
- ]), de = {
3469
+ ]), R = {
3372
3470
  name: "framework:watch-app-sources",
3373
3471
  async configureServer(e) {
3374
3472
  try {
3375
- let n = (await z.readdir(t, { withFileTypes: !0 })).filter((e) => e.isDirectory() && !ue.has(e.name));
3473
+ let n = (await z.readdir(t, { withFileTypes: !0 })).filter((e) => e.isDirectory() && !de.has(e.name));
3376
3474
  for (let r of n) e.watcher.add(P(t, r.name));
3377
- n.length === 0 && e.watcher.add(N);
3475
+ n.length === 0 && e.watcher.add(ue);
3378
3476
  } catch {
3379
- e.watcher.add(N);
3477
+ e.watcher.add(ue);
3380
3478
  }
3381
3479
  for (let n of await g(t)) e.watcher.add(n.dir);
3382
3480
  }
3383
- }, R = P(t, "src", "pages"), B = (e) => e.endsWith(".tsx") && (e === R || e.startsWith(R + "/")), V = (e) => e === R || e.startsWith(R + "/"), fe = async (e) => {
3481
+ }, B = P(t, "src", "pages"), V = (e) => e.endsWith(".tsx") && (e === B || e.startsWith(B + "/")), H = (e) => e === B || e.startsWith(B + "/"), fe = async (e) => {
3384
3482
  try {
3385
3483
  let n = Date.now();
3386
- await ts(t, u, f, m);
3387
- let { pages: r, dirs: i } = await Fo(R);
3388
- await Er({
3484
+ await ls(t, u, p, h);
3485
+ let { pages: r, dirs: i } = await Uo(B);
3486
+ await kr({
3389
3487
  appRoot: t,
3390
3488
  pages: r
3391
- }), D.dirs = i, D.ssrRoutes = Vo(r), Q.info("page tree regenerated", {
3489
+ }), k.dirs = i, k.ssrRoutes = Yo(r), Q.info("page tree regenerated", {
3392
3490
  reason: e,
3393
3491
  ms: Date.now() - n,
3394
- routes: D.ssrRoutes.length
3492
+ routes: k.ssrRoutes.length
3395
3493
  });
3396
- for (let e of Ma(Y, D.ssrRoutes.map((e) => e.pattern))) Q.error(`middleware.ts: ${e.message}`);
3494
+ for (let e of Ia(Y, k.ssrRoutes.map((e) => e.pattern))) Q.error(`middleware.ts: ${e.message}`);
3397
3495
  } catch (t) {
3398
3496
  Q.error("page tree regen failed", { reason: e }, t);
3399
3497
  }
@@ -3408,23 +3506,23 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3408
3506
  }, 50);
3409
3507
  };
3410
3508
  e.watcher.on("add", (e) => {
3411
- B(e) && i(`add ${F(t, e)}`);
3509
+ V(e) && i(`add ${F(t, e)}`);
3412
3510
  }), e.watcher.on("unlink", (e) => {
3413
- B(e) && i(`unlink ${F(t, e)}`);
3511
+ V(e) && i(`unlink ${F(t, e)}`);
3414
3512
  }), e.watcher.on("addDir", (e) => {
3415
- V(e) && i(`addDir ${F(t, e)}`);
3513
+ H(e) && i(`addDir ${F(t, e)}`);
3416
3514
  }), e.watcher.on("unlinkDir", (e) => {
3417
- V(e) && i(`unlinkDir ${F(t, e)}`);
3515
+ H(e) && i(`unlinkDir ${F(t, e)}`);
3418
3516
  });
3419
3517
  }
3420
- }, H = P(t, "app.config.ts"), me = (e) => {
3421
- if (!je(e.env)) return "";
3518
+ }, U = P(t, "app.config.ts"), W = (e) => {
3519
+ if (!Ae(e.env)) return "";
3422
3520
  let t = Object.entries(e.env.vars).map(([e, t]) => `${e}:${t.access}`).sort();
3423
3521
  return `${String(e.env.publicPrefix)}|${t.join(",")}`;
3424
- }, he = (e, t) => {
3522
+ }, G = (e, t) => {
3425
3523
  let n = [];
3426
- return e.port !== t.port && n.push(`port ${e.port ?? "(default)"} → ${t.port ?? "(default)"}`), JSON.stringify(e.proxies) !== JSON.stringify(t.proxies) && n.push("proxies"), JSON.stringify(e.allowedHosts) !== JSON.stringify(t.allowedHosts) && n.push("allowedHosts"), JSON.stringify(e.apis) !== JSON.stringify(t.apis) && n.push("apis"), me(e) !== me(t) && n.push("env"), n;
3427
- }, U = u, ge = I(H), W = () => {
3524
+ return e.port !== t.port && n.push(`port ${e.port ?? "(default)"} → ${t.port ?? "(default)"}`), JSON.stringify(e.proxies) !== JSON.stringify(t.proxies) && n.push("proxies"), JSON.stringify(e.allowedHosts) !== JSON.stringify(t.allowedHosts) && n.push("allowedHosts"), JSON.stringify(e.apis) !== JSON.stringify(t.apis) && n.push("apis"), W(e) !== W(t) && n.push("env"), n;
3525
+ }, me = u, K = I(U), ge = () => {
3428
3526
  let e = Be(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
3429
3527
  stdio: "inherit",
3430
3528
  env: process.env,
@@ -3437,24 +3535,24 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3437
3535
  }), e.on("error", (e) => {
3438
3536
  Q.error("restart spawn failed", {}, e), process.exit(1);
3439
3537
  });
3440
- }, ve = {
3538
+ }, _e = {
3441
3539
  name: "framework:watch-app-config",
3442
3540
  async configureServer(n) {
3443
- n.watcher.add(H), Q.info("watching app.config.ts for changes", { path: F(t, H) });
3444
- let r = Ta.map((e) => P(t, e)), i = new Set(r.map((e) => I(e)));
3541
+ n.watcher.add(U), Q.info("watching app.config.ts for changes", { path: F(t, U) });
3542
+ let r = ka.map((e) => P(t, e)), i = new Set(r.map((e) => I(e)));
3445
3543
  for (let e of r) n.watcher.add(e);
3446
3544
  n.watcher.on("all", (e, r) => {
3447
3545
  i.has(I(r)) && (Q.warn("middleware.ts changed — restarting (it is loaded once per boot)", { path: F(t, r) }), n.close().catch(() => void 0).then(() => {
3448
- W();
3546
+ ge();
3449
3547
  }));
3450
3548
  });
3451
3549
  let a = async () => {
3452
3550
  try {
3453
3551
  try {
3454
- let e = n.moduleGraph.getModuleById(H);
3552
+ let e = n.moduleGraph.getModuleById(U);
3455
3553
  e && n.moduleGraph.invalidateModule(e);
3456
3554
  } catch {}
3457
- let e = (await n.ssrLoadModule(H, { fixStacktrace: !0 })).default;
3555
+ let e = (await n.ssrLoadModule(U, { fixStacktrace: !0 })).default;
3458
3556
  return typeof e == "object" && e && "type" in e && e.type === "web" ? e : (Q.warn("app.config.ts re-load returned wrong shape", { hasDefault: e !== void 0 }), null);
3459
3557
  } catch (e) {
3460
3558
  return Q.warn("app.config.ts re-load failed — ignoring this change", {}, e), null;
@@ -3473,22 +3571,22 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3473
3571
  theme: e.theme,
3474
3572
  port: e.port,
3475
3573
  name: e.name
3476
- }), JSON.stringify(e) === JSON.stringify(U)) {
3574
+ }), JSON.stringify(e) === JSON.stringify(me)) {
3477
3575
  Q.info("app.config.ts onConfigChange: parsed config unchanged — skipping (no-op edit?)");
3478
3576
  return;
3479
3577
  }
3480
- let r = he(U, e);
3578
+ let r = G(me, e);
3481
3579
  if (r.length > 0) {
3482
3580
  Q.warn("app.config.ts changed — hard restart required", { fields: r });
3483
3581
  try {
3484
3582
  await n.close();
3485
3583
  } catch {}
3486
- W();
3584
+ ge();
3487
3585
  return;
3488
3586
  }
3489
3587
  try {
3490
3588
  let r = Date.now();
3491
- await ts(t, e, await Jo(t, e)), U = e, n.ws && n.ws.send({
3589
+ await ls(t, e, await ns(t, e)), me = e, n.ws && n.ws.send({
3492
3590
  type: "full-reload",
3493
3591
  path: "*"
3494
3592
  }), Q.info("app.config.ts soft-regen", {
@@ -3498,7 +3596,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3498
3596
  } catch (e) {
3499
3597
  Q.error("app.config.ts soft-regen failed", {}, e);
3500
3598
  }
3501
- }, l = (e) => le(e) === "app.config.ts" ? e === H || I(e) === ge : !1;
3599
+ }, l = (e) => le(e) === "app.config.ts" ? e === U || I(e) === K : !1;
3502
3600
  n.watcher.on("change", (e) => {
3503
3601
  l(e) && (Q.info("app.config.ts change event (chokidar)", { file: e }), s());
3504
3602
  }), n.watcher.on("add", (e) => {
@@ -3506,46 +3604,46 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3506
3604
  });
3507
3605
  try {
3508
3606
  let { watchFile: e } = await import("node:fs");
3509
- e(H, { interval: 500 }, (e, t) => {
3607
+ e(U, { interval: 500 }, (e, t) => {
3510
3608
  e.mtimeMs !== t.mtimeMs && (Q.info("app.config.ts change event (poll)", { mtime: e.mtimeMs }), s());
3511
3609
  }), Q.info("app.config.ts polling watcher attached", { intervalMs: 500 });
3512
3610
  } catch (e) {
3513
3611
  Q.warn("app.config.ts polling watcher could not attach", {}, e);
3514
3612
  }
3515
- xt(e, Q, {
3613
+ wt(e, Q, {
3516
3614
  root: t,
3517
3615
  onBeforeRestart: () => n.close()
3518
3616
  });
3519
3617
  }
3520
- }, ye = /\/apps\/[^/]+\/.*\.(route|mutation|workflow|schema)\.tsx?$/, be = 0, xe = {
3618
+ }, ve = /\/apps\/[^/]+\/.*\.(route|mutation|workflow|schema)\.tsx?$/, ye = 0, be = {
3521
3619
  name: "framework:suppress-api-hmr",
3522
3620
  handleHotUpdate(e) {
3523
- if (be += 1, ye.test(e.file)) return [];
3621
+ if (ye += 1, ve.test(e.file)) return [];
3524
3622
  }
3525
- }, Se = {
3623
+ }, xe = {
3526
3624
  name: "framework:reoptimize-on-rpcgroup-change",
3527
3625
  async configureServer(e) {
3528
3626
  let n = [];
3529
- for (let r of f) {
3530
- let i = await Uo(t, r.pkg);
3627
+ for (let r of p) {
3628
+ let i = await Zo(t, r.pkg);
3531
3629
  if (i) {
3532
3630
  n.push(i);
3533
3631
  try {
3534
3632
  e.watcher.add(P(i, "rpcGroup.generated.ts"));
3535
3633
  } catch {}
3536
- for (let t of await xa(i)) try {
3634
+ for (let t of await Ta(i)) try {
3537
3635
  e.watcher.add(t);
3538
3636
  } catch {}
3539
3637
  }
3540
3638
  }
3541
3639
  if (n.length === 0) return;
3542
- let r = await Ca(n), i = null, a = !1, o = async () => {
3640
+ let r = await Da(n), i = null, a = !1, o = async () => {
3543
3641
  if (a) return;
3544
- let t = await Ca(n);
3642
+ let t = await Da(n);
3545
3643
  if (t !== void 0 && t !== r) {
3546
3644
  r = t, a = !0, Q.info("the api surface changed — re-bundling the api client + reloading (descriptor edits propagate automatically; no manual restart needed)");
3547
3645
  try {
3548
- await z.rm(P(M, ".vite", "deps"), {
3646
+ await z.rm(P(N, ".vite", "deps"), {
3549
3647
  recursive: !0,
3550
3648
  force: !0
3551
3649
  }), await e.restart(!0);
@@ -3555,15 +3653,15 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3555
3653
  }
3556
3654
  }, s = (e) => {
3557
3655
  let t = I(e);
3558
- !ya(t) && !t.endsWith("rpcGroup.generated.ts") || (i && clearTimeout(i), i = setTimeout(() => {
3656
+ !Ca(t) && !t.endsWith("rpcGroup.generated.ts") || (i && clearTimeout(i), i = setTimeout(() => {
3559
3657
  o();
3560
3658
  }, 120));
3561
3659
  };
3562
3660
  e.watcher.on("change", s), e.watcher.on("add", s);
3563
3661
  }
3564
- }, G = {}, Ce = (e) => (t) => {
3662
+ }, Se = {}, Ce = (e) => (t) => {
3565
3663
  t.on("proxyReq", (t, n) => {
3566
- mi(t, n, {
3664
+ vi(t, n, {
3567
3665
  target: e,
3568
3666
  token: process.env.VOLTRO_INSPECT_TOKEN,
3569
3667
  writeToken: process.env.VOLTRO_INSPECT_WRITE_TOKEN,
@@ -3571,16 +3669,16 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3571
3669
  });
3572
3670
  });
3573
3671
  };
3574
- for (let e of f) {
3672
+ for (let e of p) {
3575
3673
  if (!e.proxyTarget) continue;
3576
- G[e.browserWsUrl] = {
3674
+ Se[e.browserWsUrl] = {
3577
3675
  target: e.proxyTarget,
3578
3676
  ws: !0,
3579
3677
  changeOrigin: !0,
3580
3678
  ...e.wsPath ? {} : { rewrite: () => "/ws" }
3581
3679
  };
3582
3680
  let t = e.proxyTarget.replace(/^ws/, "http");
3583
- G[`/_voltro/api/${e.name}`] = {
3681
+ Se[`/_voltro/api/${e.name}`] = {
3584
3682
  target: t,
3585
3683
  changeOrigin: !0,
3586
3684
  rewrite: (t) => t.replace(RegExp(`^/_voltro/api/${e.name}`), ""),
@@ -3588,11 +3686,11 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3588
3686
  };
3589
3687
  }
3590
3688
  for (let [e, t] of Object.entries(u.proxies ?? {})) {
3591
- if (G[e]) {
3689
+ if (Se[e]) {
3592
3690
  Q.warn("user proxy ignored — prefix already claimed by an api ws proxy", { prefix: e });
3593
3691
  continue;
3594
3692
  }
3595
- G[e] = {
3693
+ Se[e] = {
3596
3694
  target: t.target,
3597
3695
  changeOrigin: t.changeOrigin ?? !0,
3598
3696
  ...t.rewrite === void 0 ? {} : { rewrite: (n) => n.replace(RegExp(`^${e}`), t.rewrite) }
@@ -3605,10 +3703,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3605
3703
  let we = {
3606
3704
  name: "framework:inspect",
3607
3705
  configureServer(e) {
3608
- let l = null, f = async () => {
3706
+ let l = null, p = async () => {
3609
3707
  if (l !== null) return l;
3610
3708
  let n = [];
3611
- for (let r of w) try {
3709
+ for (let r of T) try {
3612
3710
  let i = await e.ssrLoadModule(P(t, "src", "pages", r.file));
3613
3711
  n.push({
3614
3712
  pattern: r.pattern,
@@ -3630,12 +3728,21 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3630
3728
  return l = n, n;
3631
3729
  };
3632
3730
  e.middlewares.use((e, t, n) => {
3731
+ let r = So(d, (e.url ?? "/").split("?")[0] ?? "/");
3732
+ if (r === void 0) return n();
3733
+ Co(d, r).then((e) => {
3734
+ t.writeHead(e.status, {
3735
+ "content-type": "text/plain",
3736
+ "cache-control": "no-store"
3737
+ }), t.end(e.body);
3738
+ });
3739
+ }), e.middlewares.use((e, t, n) => {
3633
3740
  let r = e.url ?? "/";
3634
3741
  if (r.startsWith("/_voltro/inspect") || r.startsWith("/api/dashboard/proxy")) return n();
3635
3742
  let i = Date.now(), a = t.end.bind(t);
3636
3743
  t.end = ((...e) => {
3637
3744
  try {
3638
- d.emit("request", {
3745
+ f.emit("request", {
3639
3746
  url: r.split("?")[0],
3640
3747
  status: t.statusCode ?? 0,
3641
3748
  durationMs: Date.now() - i
@@ -3645,9 +3752,9 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3645
3752
  }), n();
3646
3753
  }), e.middlewares.use((e, n, r) => {
3647
3754
  if (e.method !== "GET" && e.method !== "HEAD") return r();
3648
- let { pathname: i } = Yi(e.url ?? "/");
3755
+ let { pathname: i } = $i(e.url ?? "/");
3649
3756
  if (i !== "/robots.txt" || L(P(t, "public", "robots.txt"))) return r();
3650
- n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(Mr({ indexable: !1 }));
3757
+ n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(Fr({ indexable: !1 }));
3651
3758
  }), u.name === "voltroDashboard" && e.middlewares.use(async (e, t, a) => {
3652
3759
  let o = e.url ?? "", s = o.split("?")[0];
3653
3760
  if (s === "/api/dashboard/proxy") {
@@ -3741,7 +3848,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3741
3848
  for (let [t, n] of Object.entries(e.headers ?? {})) n !== void 0 && (i[String(t).toLowerCase()] = Array.isArray(n) ? n.join(", ") : String(n));
3742
3849
  let l = r.split("?")[0];
3743
3850
  if (e.method === "GET" && (l === "/_voltro/inspect/logs" || r.startsWith("/_voltro/inspect/logs?"))) {
3744
- let e = a(i.origin), n = ci(r, Ur(), i);
3851
+ let e = a(i.origin), n = fi(r, Kr(), i);
3745
3852
  t.statusCode = n.status, t.setHeader("content-type", n.contentType);
3746
3853
  for (let [n, r] of Object.entries(e)) t.setHeader(n, r);
3747
3854
  t.end(n.body);
@@ -3759,7 +3866,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3759
3866
  e.setEncoding("utf-8"), e.on("data", (e) => {
3760
3867
  r += e;
3761
3868
  }), e.on("end", () => {
3762
- let e = ni(r, d);
3869
+ let e = oi(r, f);
3763
3870
  t.statusCode = e.status, t.setHeader("content-type", e.contentType);
3764
3871
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
3765
3872
  t.end(e.body);
@@ -3790,17 +3897,17 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3790
3897
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
3791
3898
  t.flushHeaders?.(), t.write("retry: 5000\n\n");
3792
3899
  let l = r.indexOf("?");
3793
- if (l === -1 || new URLSearchParams(r.slice(l + 1)).get("live") !== "1") for (let e of d.buffered()) t.write(ot(e));
3794
- let u = d.subscribe((e) => {
3900
+ if (l === -1 || new URLSearchParams(r.slice(l + 1)).get("live") !== "1") for (let e of f.buffered()) t.write(ot(e));
3901
+ let u = f.subscribe((e) => {
3795
3902
  try {
3796
3903
  t.write(ot(e));
3797
3904
  } catch {}
3798
- }), f = setInterval(() => {
3905
+ }), d = setInterval(() => {
3799
3906
  try {
3800
3907
  t.write(st());
3801
3908
  } catch {}
3802
3909
  }, 15e3), p = () => {
3803
- clearInterval(f), u();
3910
+ clearInterval(d), u();
3804
3911
  };
3805
3912
  e.on("close", p), t.on("close", p);
3806
3913
  return;
@@ -3810,8 +3917,8 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3810
3917
  kind: "web",
3811
3918
  meta: {
3812
3919
  name: u.name ?? "(unnamed)",
3813
- voltroVersion: _o,
3814
- port: _,
3920
+ voltroVersion: To,
3921
+ port: x,
3815
3922
  mode: "dev",
3816
3923
  apis: Object.entries(u.apis ?? {}).map(([e, t]) => {
3817
3924
  let n = {
@@ -3821,14 +3928,14 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3821
3928
  return t.url !== void 0 && (n.url = t.url), n;
3822
3929
  })
3823
3930
  },
3824
- routes: await f(),
3825
- dirs: O,
3931
+ routes: await p(),
3932
+ dirs: ne,
3826
3933
  cache: () => ({
3827
3934
  backend: "memory",
3828
3935
  size: 0,
3829
3936
  entries: []
3830
3937
  }),
3831
- env: () => vt(u.name ?? "app", { contract: je(u.env) ? u.env : void 0 })
3938
+ env: () => xt(u.name ?? "app", { contract: Ae(u.env) ? u.env : void 0 })
3832
3939
  }, s = o(r, a, i, { method: e.method ?? "GET" });
3833
3940
  if (s === null) return n();
3834
3941
  t.statusCode = s.status, t.setHeader("content-type", s.contentType);
@@ -3853,11 +3960,11 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3853
3960
  });
3854
3961
  }
3855
3962
  } : null, Ee = /* @__PURE__ */ new Set(), De = (e, t, n, r, i, a = !1) => {
3856
- let o = na(i, a, t) ?? "";
3963
+ let o = oa(i, a, t) ?? "";
3857
3964
  if (Q.error(`${t} render failed`, {
3858
3965
  pathname: n,
3859
3966
  pattern: r,
3860
- cause: Pr(i) + o
3967
+ cause: Lr(i) + o
3861
3968
  }), e.headersSent) {
3862
3969
  e.end();
3863
3970
  return;
@@ -3865,11 +3972,11 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3865
3972
  e.writeHead(500, {
3866
3973
  "content-type": "text/plain; charset=utf-8",
3867
3974
  "x-voltro-rendered-by": `${t}-failed`,
3868
- "x-voltro-ssr-generation": String(be)
3975
+ "x-voltro-ssr-generation": String(ye)
3869
3976
  });
3870
- let s = be === 0 ? "" : `\n[voltro] this process has absorbed ${be} hot update(s) since boot, so its SSR\nmodule graph may not match the files on disk. Before reporting this — to us or to\nyourself — restart \`voltro dev\` and measure once from a fresh boot.\n`;
3871
- e.end(`${t} render failed for ${n}\n\n${Pr(i)}\n${o}\n${s}`);
3872
- }, Oe = Xt(), ke = Qt({
3977
+ let s = ye === 0 ? "" : `\n[voltro] this process has absorbed ${ye} hot update(s) since boot, so its SSR\nmodule graph may not match the files on disk. Before reporting this — to us or to\nyourself — restart \`voltro dev\` and measure once from a fresh boot.\n`;
3978
+ e.end(`${t} render failed for ${n}\n\n${Lr(i)}\n${o}\n${s}`);
3979
+ }, Oe = $t(), ke = tn({
3873
3980
  limit: Oe,
3874
3981
  onColdStart: (e) => Q.debug("ssr cold-compile start", { id: e }),
3875
3982
  onColdEnd: (e, { durationMs: t, failed: n }) => Q.debug(`ssr cold-compile ${n ? "FAILED" : "end"} ${t}ms`, {
@@ -3879,7 +3986,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3879
3986
  })
3880
3987
  });
3881
3988
  Q.debug(`ssr cold-compile concurrency ${Oe}`, { concurrency: Oe });
3882
- let Ae = null, Me = async () => (Ae === null && (Ae = await z.readFile(P(t, ".framework", "index.html"), "utf8")), Ae), Ne = {
3989
+ let je = null, Me = async () => (je === null && (je = await z.readFile(P(t, ".framework", "index.html"), "utf8")), je), Ne = {
3883
3990
  name: "framework:ssr",
3884
3991
  configureServer(e) {
3885
3992
  let n = (t) => ke.load(t, async () => await e.ssrLoadModule(t)), r, i = !1, a = () => {
@@ -3920,25 +4027,25 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3920
4027
  })(), r);
3921
4028
  }, o, s = () => (o ??= (async () => {
3922
4029
  try {
3923
- let e = f[0];
4030
+ let e = p[0];
3924
4031
  if (e === void 0) return;
3925
4032
  let t = (await n(`${e.pkg}/rpcGroup`)).appDescriptors;
3926
4033
  if (t === void 0) return;
3927
4034
  (await n("@voltro/web/ssr")).registerSsrApiDescriptors?.(e.name, t);
3928
4035
  } catch {}
3929
- })(), o), c = dn({
3930
- apiName: f[0]?.name,
3931
- apiOrigin: Qo(f[0], { allowDevProxy: !0 }),
4036
+ })(), o), c = mn({
4037
+ apiName: p[0]?.name,
4038
+ apiOrigin: os(p[0], { allowDevProxy: !0 }),
3932
4039
  loadDescriptors: async () => {
3933
- let e = f[0];
4040
+ let e = p[0];
3934
4041
  if (e !== void 0) return (await n(`${e.pkg}/rpcGroup`)).appDescriptors;
3935
4042
  },
3936
- rpcQuery: (e, t) => $o(Qo(f[0], { allowDevProxy: !0 }), e, {
3937
- apiName: f[0]?.name,
4043
+ rpcQuery: (e, t) => ss(os(p[0], { allowDevProxy: !0 }), e, {
4044
+ apiName: p[0]?.name,
3938
4045
  headers: t
3939
4046
  }),
3940
4047
  resolveLocale: async (e, t) => {
3941
- let n = sn(t, u.locales);
4048
+ let n = un(t, u.locales);
3942
4049
  return n === void 0 ? (await a())(e.cookie, e["accept-language"])?.locale ?? "en" : n;
3943
4050
  },
3944
4051
  renderErrorPage: async () => void 0
@@ -3950,7 +4057,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3950
4057
  }).then((e) => {
3951
4058
  e || n();
3952
4059
  });
3953
- }), E = async (n) => await e.ssrLoadModule(P(t, "src", "pages", n)), e.middlewares.use(async (e, t, n) => {
4060
+ }), D = async (n) => await e.ssrLoadModule(P(t, "src", "pages", n)), e.middlewares.use(async (e, t, n) => {
3954
4061
  let r = e.url ?? "/";
3955
4062
  if (!r.startsWith("/_voltro/og") || te === null) return n();
3956
4063
  try {
@@ -3966,30 +4073,30 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3966
4073
  if (r.method !== "GET" && r.method !== "HEAD") return c();
3967
4074
  let l = r.url ?? "/";
3968
4075
  l.indexOf("?");
3969
- let { pathname: d, search: p } = Yi(l), m = r.__voltroFormFlash;
4076
+ let { pathname: d, search: f } = $i(l), m = r.__voltroFormFlash;
3970
4077
  if (d.startsWith("/@") || d.startsWith("/node_modules/") || d.startsWith("/.framework/") || d.startsWith("/_voltro/") || d === "/main.tsx" || d === "/index.html" || d === "/sw.js" || d === "/favicon.ico" || d === "/robots.txt") return c();
3971
4078
  let h = async () => {
3972
4079
  if (Y.length === 0) return;
3973
- let e = ja(Y, {
4080
+ let e = Fa(Y, {
3974
4081
  route: void 0,
3975
4082
  pathname: d
3976
4083
  });
3977
4084
  if (e === void 0) return;
3978
4085
  let t = {};
3979
4086
  for (let [e, n] of Object.entries(r.headers ?? {})) typeof n == "string" ? t[e] = n : Array.isArray(n) && (t[e] = n.join(", "));
3980
- let n = await Va(e, {
4087
+ let n = await Ga(e, {
3981
4088
  pathname: d,
3982
- search: p,
4089
+ search: f,
3983
4090
  headers: t,
3984
- cookies: Pa(t.cookie),
4091
+ cookies: Ra(t.cookie),
3985
4092
  route: void 0
3986
4093
  });
3987
- for (let e of n.setCookies) o.appendHeader("set-cookie", Ra(e));
4094
+ for (let e of n.setCookies) o.appendHeader("set-cookie", Ha(e));
3988
4095
  };
3989
4096
  if (/\.[a-z0-9]+$/i.test(d)) return await h(), c();
3990
- let g = Ho(d, D.ssrRoutes), _ = !1;
4097
+ let g = Xo(d, k.ssrRoutes), _ = !1;
3991
4098
  if (!g) {
3992
- let e = vo(D.dirs, d);
4099
+ let e = Eo(k.dirs, d);
3993
4100
  if (e === void 0) return await h(), c();
3994
4101
  _ = !0, g = {
3995
4102
  route: {
@@ -4023,31 +4130,31 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4023
4130
  }
4024
4131
  }, C = !1;
4025
4132
  try {
4026
- let w = await x("loadPage", async () => await n(P(t, "src", "pages", g.route.file))), T = _ ? "ssr" : y(w, P("src", "pages", g.route.file)), E = Io(D.dirs, g.route.dirChain), ne = T === "spa" && E.some((e) => e.hasLayout), O = w.interactive ?? "full";
4027
- if (T !== "ssr" && T !== "isr" && !ne && O !== "islands") return await h(), c();
4028
- let re = {};
4029
- for (let [e, t] of Object.entries(r.headers ?? {})) typeof t == "string" ? re[e] = t : Array.isArray(t) && (re[e] = t.join(", "));
4030
- let k = await Va(ja(Y, {
4133
+ let w = await x("loadPage", async () => await n(P(t, "src", "pages", g.route.file))), T = _ ? "ssr" : y(w, P("src", "pages", g.route.file)), E = Wo(k.dirs, g.route.dirChain), D = T === "spa" && E.some((e) => e.hasLayout), O = w.interactive ?? "full";
4134
+ if (T !== "ssr" && T !== "isr" && !D && O !== "islands") return await h(), c();
4135
+ let ne = {};
4136
+ for (let [e, t] of Object.entries(r.headers ?? {})) typeof t == "string" ? ne[e] = t : Array.isArray(t) && (ne[e] = t.join(", "));
4137
+ let A = await Ga(Fa(Y, {
4031
4138
  route: g.route.pattern,
4032
4139
  pathname: d
4033
4140
  }), {
4034
4141
  pathname: d,
4035
- search: p,
4036
- headers: re,
4037
- cookies: Pa(re.cookie),
4142
+ search: f,
4143
+ headers: ne,
4144
+ cookies: Ra(ne.cookie),
4038
4145
  route: g.route.pattern
4039
- }, ze);
4040
- for (let e of k.setCookies) o.appendHeader("set-cookie", Ra(e));
4041
- for (let [e, t] of Object.entries(k.responseHeaders)) o.setHeader(e, t);
4042
- if (T === "isr" && k.cspNonce !== void 0) throw Error(`page '${g.route.pattern}' is renderMode 'isr' while middleware.ts mints a cspNonce — an isr render is CACHED and a cached nonce is a lie the browser enforces. Use renderMode 'ssr' for nonce'd pages, or a hash-based CSP for isr.`);
4043
- let A = T === "isr" ? Ga(k.headers) : k.headers, j = T === "isr" && w.ppr === !0, M = j ? fo(A, g.route.pattern) : A, ie = $o(Qo(f[0], { allowDevProxy: !0 }), A.cookie, {
4044
- apiName: f[0]?.name,
4045
- headers: A
4146
+ }, Ve);
4147
+ for (let e of A.setCookies) o.appendHeader("set-cookie", Ha(e));
4148
+ for (let [e, t] of Object.entries(A.responseHeaders)) o.setHeader(e, t);
4149
+ if (T === "isr" && A.cspNonce !== void 0) throw Error(`page '${g.route.pattern}' is renderMode 'isr' while middleware.ts mints a cspNonce — an isr render is CACHED and a cached nonce is a lie the browser enforces. Use renderMode 'ssr' for nonce'd pages, or a hash-based CSP for isr.`);
4150
+ let j = T === "isr" ? Ya(A.headers) : A.headers, M = T === "isr" && w.ppr === !0, re = M ? go(j, g.route.pattern) : j, ie = ss(os(p[0], { allowDevProxy: !0 }), j.cookie, {
4151
+ apiName: p[0]?.name,
4152
+ headers: j
4046
4153
  }), ae = new AbortController(), oe = () => ae.abort();
4047
4154
  o.once("close", oe);
4048
4155
  let se = null, ce = [], le = {};
4049
4156
  try {
4050
- (await n("@voltro/web/ssr")).beginStoreSeeds(), await s(), {chain: ce, segmentLoaderData: le} = await x("loadChain", () => Lo({
4157
+ (await n("@voltro/web/ssr")).beginStoreSeeds(), await s(), {chain: ce, segmentLoaderData: le} = await x("loadChain", () => Go({
4051
4158
  entries: E,
4052
4159
  loadLayout: (e) => n(P(t, "src", "pages", e.dir, "layout.tsx")),
4053
4160
  loadError: (e) => n(P(t, "src", "pages", e.dir, "error.tsx")),
@@ -4055,20 +4162,20 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4055
4162
  ctx: {
4056
4163
  params: g.params,
4057
4164
  pathname: d,
4058
- search: p,
4165
+ search: f,
4059
4166
  signal: ae.signal,
4060
- headers: M,
4167
+ headers: re,
4061
4168
  query: ie,
4062
4169
  isServer: !0
4063
4170
  }
4064
4171
  }));
4065
4172
  let e = w.loader;
4066
- typeof e == "function" && !ne && (se = await x("loader", () => e({
4173
+ typeof e == "function" && !D && (se = await x("loader", () => e({
4067
4174
  params: g.params,
4068
4175
  pathname: d,
4069
- search: p,
4176
+ search: f,
4070
4177
  signal: ae.signal,
4071
- headers: M,
4178
+ headers: re,
4072
4179
  query: ie,
4073
4180
  isServer: !0
4074
4181
  })));
@@ -4076,11 +4183,11 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4076
4183
  o.off("close", oe);
4077
4184
  }
4078
4185
  let N = await x("loadSsrHelpers", async () => await n("@voltro/web/ssr"));
4079
- ne || await va({
4186
+ D || await Sa({
4080
4187
  pageMod: w,
4081
4188
  params: g.params,
4082
4189
  query: ie,
4083
- apiName: f[0]?.name,
4190
+ apiName: p[0]?.name,
4084
4191
  seed: N.seedPreloadedSubscription,
4085
4192
  seedFailure: N.seedPreloadedSubscriptionFailure,
4086
4193
  onError: ({ tag: e, apiName: t }, n) => Q.warn("preload seed failed", {
@@ -4099,16 +4206,16 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4099
4206
  renderMode: T,
4100
4207
  chain: ce
4101
4208
  }, F = {
4102
- cookies: j ? po(Ka(k.cookies), g.route.pattern) : T === "isr" ? Ka(k.cookies) : k.cookies,
4103
- headers: M,
4209
+ cookies: M ? _o(Xa(A.cookies), g.route.pattern) : T === "isr" ? Xa(A.cookies) : A.cookies,
4210
+ headers: re,
4104
4211
  url: l,
4105
4212
  ...m === void 0 ? {} : { formFlash: m }
4106
- }, I = (await a())(A.cookie, A["accept-language"]);
4213
+ }, I = (await a())(j.cookie, j["accept-language"]);
4107
4214
  C = I !== void 0 && i;
4108
4215
  let de = I ? {
4109
4216
  outerWrap: I.outerWrap,
4110
4217
  locale: I.locale
4111
- } : {}, L = ne ? Ki({
4218
+ } : {}, L = D ? Xi({
4112
4219
  helpers: N,
4113
4220
  page: `src/pages/${g.route.file}`,
4114
4221
  interactive: O,
@@ -4117,12 +4224,12 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4117
4224
  descriptor: ue,
4118
4225
  params: g.params,
4119
4226
  pathname: d,
4120
- search: p,
4227
+ search: f,
4121
4228
  segmentLoaderData: le,
4122
4229
  requestContext: F,
4123
4230
  ...de
4124
4231
  }
4125
- }) : null, R = ne ? null : Gi({
4232
+ }) : null, R = D ? null : Yi({
4126
4233
  helpers: N,
4127
4234
  page: `src/pages/${g.route.file}`,
4128
4235
  pathname: d,
@@ -4131,9 +4238,9 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4131
4238
  loaderData: se,
4132
4239
  segmentLoaderData: le,
4133
4240
  pageLoaderRan: typeof w.loader == "function",
4134
- ...j ? { ppr: !0 } : {}
4241
+ ...M ? { ppr: !0 } : {}
4135
4242
  });
4136
- j && R !== null && ho(R.stateInput, g.route.pattern);
4243
+ M && R !== null && yo(R.stateInput, g.route.pattern);
4137
4244
  let B = [];
4138
4245
  await x("collectCss", async () => {
4139
4246
  let e = /* @__PURE__ */ new Set(), n = [
@@ -4148,58 +4255,58 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4148
4255
  for (let t of n) await S(t, e, B);
4149
4256
  });
4150
4257
  let V = (O === "islands" ? await x("islandsEntry", async () => {
4151
- let e = es(f, "../../app.config"), n = (await On({
4258
+ let e = cs(p, "../../app.config"), n = (await jn({
4152
4259
  webRoot: t,
4153
4260
  pages: [{
4154
4261
  pattern: g.route.pattern,
4155
4262
  file: g.route.file
4156
4263
  }],
4157
- headSnippets: Cn(await Me()),
4264
+ headSnippets: En(await Me()),
4158
4265
  apiImports: e.imports,
4159
4266
  apiEntriesLiteral: `[\n${e.providerEntryLines.join("\n")}\n ]`
4160
4267
  }))[0];
4161
4268
  return n === void 0 ? void 0 : await z.readFile(P(t, ".framework", n.htmlFile), "utf8");
4162
- }) : void 0) ?? await x("readShell", Me), fe = await x("transformShell", () => e.transformIndexHtml(l, V)), pe = B.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), H = I?.locale ?? F.cookies["voltro:locale"] ?? u.defaultLocale ?? (u.locales ?? [])[0] ?? "en", me = Date.now(), he = {
4163
- lang: H,
4269
+ }) : void 0) ?? await x("readShell", Me), H = await x("transformShell", () => e.transformIndexHtml(l, V)), fe = B.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), pe = I?.locale ?? F.cookies["voltro:locale"] ?? u.defaultLocale ?? (u.locales ?? [])[0] ?? "en", U = Date.now(), W = {
4270
+ lang: pe,
4164
4271
  ...I?.timeZone === void 0 ? {} : { timeZone: I.timeZone },
4165
- renderedAt: me
4272
+ renderedAt: U
4166
4273
  };
4167
4274
  if (L) {
4168
- let e = (e) => Ji({
4275
+ let e = (e) => Qi({
4169
4276
  helpers: N,
4170
4277
  prepared: L,
4171
4278
  meta: e,
4172
4279
  interactive: O,
4173
- extra: [pe]
4280
+ extra: [fe]
4174
4281
  });
4175
- if (L.hasDeferred) ha({
4282
+ if (L.hasDeferred) ya({
4176
4283
  res: o,
4177
- shell: la({
4178
- shell: fe,
4284
+ shell: pa({
4285
+ shell: H,
4179
4286
  inlineModuleScriptsAsync: !0
4180
4287
  }),
4181
- documentAttrs: he,
4288
+ documentAttrs: W,
4182
4289
  headers: {
4183
4290
  "content-type": "text/html; charset=utf-8",
4184
4291
  "x-voltro-rendered-by": "spa-shell-dev"
4185
4292
  },
4186
4293
  headInjection: e,
4187
- ...k.cspNonce === void 0 ? {} : { nonce: k.cspNonce },
4294
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce },
4188
4295
  render: (e) => N.renderPageToStream({
4189
4296
  ...L.renderInput,
4190
4297
  ...e,
4191
- ...k.cspNonce === void 0 ? {} : { nonce: k.cspNonce }
4298
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce }
4192
4299
  }),
4193
4300
  onShellError: (e) => {
4194
4301
  De(o, "spa-shell-dev", d, g.route.pattern, e, C);
4195
4302
  }
4196
4303
  });
4197
4304
  else {
4198
- let t = qi({
4305
+ let t = Zi({
4199
4306
  helpers: N,
4200
4307
  prepared: L
4201
- }), n = pa(fe.replace("<div id=\"root\"></div>", `<div id="root">${t.body}</div>`).replace("</head>", ` ${e(t.meta)}\n </head>`), he);
4202
- o.statusCode = 200, o.setHeader("content-type", "text/html; charset=utf-8"), o.setHeader("x-voltro-rendered-by", "spa-shell-dev"), o.end(k.cspNonce === void 0 ? n : da(n, k.cspNonce));
4308
+ }), n = _a(H.replace("<div id=\"root\"></div>", `<div id="root">${t.body}</div>`).replace("</head>", ` ${e(t.meta)}\n </head>`), W);
4309
+ o.statusCode = 200, o.setHeader("content-type", "text/html; charset=utf-8"), o.setHeader("x-voltro-rendered-by", "spa-shell-dev"), o.end(A.cspNonce === void 0 ? n : ha(n, A.cspNonce));
4203
4310
  }
4204
4311
  } else if (R) {
4205
4312
  let e = (e) => {
@@ -4211,7 +4318,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4211
4318
  });
4212
4319
  return `<meta property="og:image" content="${n}" /><meta name="twitter:image" content="${n}" /><meta name="twitter:card" content="summary_large_image" />`;
4213
4320
  }, t = (t) => [
4214
- pe,
4321
+ fe,
4215
4322
  N.renderMetaToHtml(t) + e(N.renderMetaToHtml(t)),
4216
4323
  `<meta name="voltro-interactive" content="${O}" />`,
4217
4324
  ...R.hasDeferred ? [N.renderDeferredRegistryScript()] : [],
@@ -4220,52 +4327,52 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4220
4327
  descriptor: ue,
4221
4328
  params: g.params,
4222
4329
  pathname: d,
4223
- search: p,
4330
+ search: f,
4224
4331
  loaderData: R.loaderData,
4225
4332
  segmentLoaderData: R.segmentLoaderData,
4226
4333
  requestContext: F,
4227
4334
  ...de
4228
4335
  };
4229
- if (T === "ssr" && O === "full" && m === void 0) ha({
4336
+ if (T === "ssr" && O === "full" && m === void 0) ya({
4230
4337
  res: o,
4231
- shell: la({
4232
- shell: fe,
4338
+ shell: pa({
4339
+ shell: H,
4233
4340
  inlineModuleScriptsAsync: !0
4234
4341
  }),
4235
- documentAttrs: he,
4342
+ documentAttrs: W,
4236
4343
  headers: {
4237
4344
  "content-type": "text/html; charset=utf-8",
4238
4345
  "x-voltro-rendered-by": "ssr-dev"
4239
4346
  },
4240
4347
  headInjection: t,
4241
- ...k.cspNonce === void 0 ? {} : { nonce: k.cspNonce },
4348
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce },
4242
4349
  render: (e) => N.renderPageToStream({
4243
4350
  ...n,
4244
4351
  ...e,
4245
- ...k.cspNonce === void 0 ? {} : { nonce: k.cspNonce }
4352
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce }
4246
4353
  }),
4247
4354
  onShellError: (e) => {
4248
4355
  De(o, "ssr-dev", d, g.route.pattern, e, C);
4249
4356
  }
4250
4357
  });
4251
4358
  else {
4252
- let { html: e, meta: r } = N.renderPageToHtml(n), i = pa(fe.replace("<div id=\"root\"></div>", `<div id="root">${e}</div>`).replace("</head>", ` ${t(r)}\n </head>`), he);
4359
+ let { html: e, meta: r } = N.renderPageToHtml(n), i = _a(H.replace("<div id=\"root\"></div>", `<div id="root">${e}</div>`).replace("</head>", ` ${t(r)}\n </head>`), W);
4253
4360
  o.statusCode = m === void 0 ? _ ? 404 : 200 : 422, o.setHeader("content-type", "text/html; charset=utf-8"), o.setHeader("x-voltro-rendered-by", _ ? "ssr-not-found" : "ssr-dev"), m !== void 0 && o.setHeader("cache-control", "no-store");
4254
- let a = m === void 0 ? i : nn(i, m);
4255
- if (j && m === void 0 && typeof w.loader == "function") {
4256
- o.setHeader("x-voltro-ppr", "shell+holes"), no(g.route.pattern), o.write(a);
4257
- let e = $o(Qo(f[0], { allowDevProxy: !0 }), k.headers.cookie, {
4258
- apiName: f[0]?.name,
4259
- headers: k.headers
4361
+ let a = m === void 0 ? i : on(i, m);
4362
+ if (M && m === void 0 && typeof w.loader == "function") {
4363
+ o.setHeader("x-voltro-ppr", "shell+holes"), oo(g.route.pattern), o.write(a);
4364
+ let e = ss(os(p[0], { allowDevProxy: !0 }), A.headers.cookie, {
4365
+ apiName: p[0]?.name,
4366
+ headers: A.headers
4260
4367
  }), t = new AbortController();
4261
- await mo({
4368
+ await vo({
4262
4369
  loader: w.loader,
4263
4370
  ctx: {
4264
4371
  params: g.params,
4265
4372
  pathname: d,
4266
- search: p,
4373
+ search: f,
4267
4374
  signal: t.signal,
4268
- headers: k.headers,
4375
+ headers: A.headers,
4269
4376
  query: e,
4270
4377
  isServer: !0
4271
4378
  },
@@ -4274,33 +4381,33 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4274
4381
  page: g.route.pattern,
4275
4382
  log: Q
4276
4383
  });
4277
- } else o.end(k.cspNonce === void 0 ? a : da(a, k.cspNonce));
4384
+ } else o.end(A.cspNonce === void 0 ? a : ha(a, A.cspNonce));
4278
4385
  }
4279
4386
  }
4280
- b.render = Date.now() - me;
4281
- let U = Date.now() - ee;
4282
- v ? (Ee.add(g.route.pattern), Q.info(`ssr compiled ${g.route.pattern} in ${U}ms`, {
4387
+ b.render = Date.now() - U;
4388
+ let G = Date.now() - ee;
4389
+ v ? (Ee.add(g.route.pattern), Q.info(`ssr compiled ${g.route.pattern} in ${G}ms`, {
4283
4390
  pattern: g.route.pattern,
4284
4391
  pathname: d,
4285
- elapsedMs: U,
4392
+ elapsedMs: G,
4286
4393
  cold: !0,
4287
4394
  phases: b
4288
- })) : U > 200 && Q.info(`ssr rendered ${d} in ${U}ms`, {
4395
+ })) : G > 200 && Q.info(`ssr rendered ${d} in ${G}ms`, {
4289
4396
  pattern: g.route.pattern,
4290
4397
  pathname: d,
4291
- elapsedMs: U,
4398
+ elapsedMs: G,
4292
4399
  cold: !1,
4293
4400
  phases: b
4294
4401
  });
4295
4402
  } catch (e) {
4296
- if (Ui(e)) {
4403
+ if (qi(e)) {
4297
4404
  Q.error("ssr-dev render refused", {
4298
4405
  pathname: d,
4299
4406
  pattern: g.route.pattern
4300
4407
  }, e), o.statusCode = 500, o.setHeader("content-type", "text/plain; charset=utf-8"), o.end(e.message);
4301
4408
  return;
4302
4409
  }
4303
- let t = Wi(e);
4410
+ let t = Ji(e);
4304
4411
  if (t) {
4305
4412
  o.statusCode = t.status;
4306
4413
  for (let [e, n] of Object.entries(t.headers)) o.setHeader(e, String(n));
@@ -4311,15 +4418,15 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4311
4418
  }
4312
4419
  });
4313
4420
  }
4314
- }, Pe = Date.now(), Fe = k.version ?? "?", K = await yo(), Ie = P(t, "node_modules", "@voltro", "ui-shadcn"), q = L(P(Ie, "package.json")) ? Ie : null, J = [], Le = await (async () => {
4421
+ }, Pe = Date.now(), Fe = j.version ?? "?", Ie = await Do(), q = P(t, "node_modules", "@voltro", "ui-shadcn"), J = L(P(q, "package.json")) ? q : null, Le = [], Re = await (async () => {
4315
4422
  let e = [];
4316
- for (let n of f) {
4317
- let r = await Uo(t, n.pkg);
4423
+ for (let n of p) {
4424
+ let r = await Zo(t, n.pkg);
4318
4425
  r && e.push(r);
4319
4426
  }
4320
- let n = await Ca(e);
4427
+ let n = await Da(e);
4321
4428
  if (n === void 0) return !1;
4322
- let r = P(M, ".voltro-rpcgroup-optimize"), i = "";
4429
+ let r = P(N, ".voltro-rpcgroup-optimize"), i = "";
4323
4430
  try {
4324
4431
  i = (await z.readFile(r, "utf8")).trim();
4325
4432
  } catch {}
@@ -4328,20 +4435,20 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4328
4435
  await z.writeFile(r, n);
4329
4436
  } catch {}
4330
4437
  return !0;
4331
- })(), Re = /* @__PURE__ */ new Set(), ze = (e) => {
4332
- Re.has(e.name) || (Re.add(e.name), Q.warn(`middleware.ts wrote the cookie "${e.name}" with the HttpOnly default — a browser SDK cannot read it`, {
4438
+ })(), ze = /* @__PURE__ */ new Set(), Ve = (e) => {
4439
+ ze.has(e.name) || (ze.add(e.name), Q.warn(`middleware.ts wrote the cookie "${e.name}" with the HttpOnly default — a browser SDK cannot read it`, {
4333
4440
  cookie: e.name,
4334
4441
  hint: "If your IdP client reads this from `document.cookie` (Supabase's `createBrowserClient` does), pass `httpOnly: false`. Otherwise the SSR render succeeds and the user is signed out at the first client-side call. Set `httpOnly: true` explicitly to silence this."
4335
4442
  }));
4336
- }, Y = await Ba(t);
4337
- Y.length > 0 && Q.info(`middleware.ts loaded — ${Y.length} middleware(s): ` + Y.map((e) => e.exportName).join(", ")), Na(Y, D.ssrRoutes.map((e) => e.pattern)), Le && Q.info("rpcGroup changed since last boot — forcing a dep re-optimize so the browser loads the current api client");
4443
+ }, Y = await Wa(t);
4444
+ Y.length > 0 && Q.info(`middleware.ts loaded — ${Y.length} middleware(s): ` + Y.map((e) => e.exportName).join(", ")), La(Y, k.ssrRoutes.map((e) => e.pattern)), Re && Q.info("rpcGroup changed since last boot — forcing a dep re-optimize so the browser loads the current api client");
4338
4445
  try {
4339
- await Et(_, "voltro dev (web)");
4446
+ await kt(x, "voltro dev (web)");
4340
4447
  } catch (e) {
4341
4448
  Q.error(String(e.message ?? e)), process.exit(1);
4342
4449
  }
4343
- await (await k.createServer({
4344
- root: M,
4450
+ await (await j.createServer({
4451
+ root: N,
4345
4452
  envPrefix: "__VOLTRO_VITE_ENV_DISABLED__",
4346
4453
  ssr: { noExternal: ["react-intl", "@voltro/i18n"] },
4347
4454
  resolve: {
@@ -4352,121 +4459,121 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4352
4459
  "@voltro/i18n"
4353
4460
  ],
4354
4461
  alias: [
4355
- ...K ? [{
4462
+ ...Ie ? [{
4356
4463
  find: "@voltro/devtools/styles.css",
4357
- replacement: P(K, "src/styles.css")
4464
+ replacement: P(Ie, "src/styles.css")
4358
4465
  }, {
4359
4466
  find: "@voltro/devtools",
4360
- replacement: P(K, "src/index.ts")
4467
+ replacement: P(Ie, "src/index.ts")
4361
4468
  }] : [],
4362
- ...q ? [
4469
+ ...J ? [
4363
4470
  {
4364
4471
  find: "@voltro/ui-shadcn/tokens.css",
4365
- replacement: P(q, "src/tokens.css")
4472
+ replacement: P(J, "src/tokens.css")
4366
4473
  },
4367
4474
  {
4368
4475
  find: "@voltro/ui-shadcn/cn",
4369
- replacement: P(q, "src/cn.ts")
4476
+ replacement: P(J, "src/cn.ts")
4370
4477
  },
4371
4478
  {
4372
4479
  find: "@voltro/ui-shadcn/brand",
4373
- replacement: P(q, "src/brand/voltroLogo.tsx")
4480
+ replacement: P(J, "src/brand/voltroLogo.tsx")
4374
4481
  },
4375
4482
  {
4376
4483
  find: "@voltro/ui-shadcn",
4377
- replacement: P(q, "src/index.ts")
4484
+ replacement: P(J, "src/index.ts")
4378
4485
  }
4379
4486
  ] : [],
4380
- ...Yt(t)
4487
+ ...Qt(t)
4381
4488
  ]
4382
4489
  },
4383
4490
  optimizeDeps: {
4384
- include: [...f.map((e) => `${e.pkg}/rpcGroup`), ...J],
4385
- force: Le
4491
+ include: [...p.map((e) => `${e.pkg}/rpcGroup`), ...Le],
4492
+ force: Re
4386
4493
  },
4387
- customLogger: qt(),
4494
+ customLogger: Xt(),
4388
4495
  plugins: [
4389
- Di(P(t, "src", "pages")),
4390
- Fn({
4496
+ ji(P(t, "src", "pages")),
4497
+ Rn({
4391
4498
  root: t,
4392
- config: ne(u.images)
4499
+ config: O(u.images)
4393
4500
  }),
4394
- Bn(t, u.fonts),
4395
- ar(t, u.feeds ?? [], u.seo?.siteUrl),
4396
- A(),
4397
- j(),
4398
- de,
4501
+ Un(t, u.fonts),
4502
+ cr(t, u.feeds ?? [], u.seo?.siteUrl),
4503
+ M(),
4504
+ re(),
4505
+ R,
4399
4506
  pe,
4400
- ve,
4507
+ _e,
4508
+ be,
4401
4509
  xe,
4402
- Se,
4403
4510
  we,
4404
4511
  Ne,
4405
4512
  ...Te ? [Te] : []
4406
4513
  ],
4407
4514
  server: {
4408
- port: _,
4515
+ port: x,
4409
4516
  strictPort: !0,
4410
4517
  host: !0,
4411
4518
  allowedHosts: u.allowedHosts === !0 || [...u.allowedHosts ?? []],
4412
- proxy: G,
4413
- fs: { allow: [t, ...Do(t)] }
4519
+ proxy: Se,
4520
+ fs: { allow: [t, ...Fo(t)] }
4414
4521
  },
4415
4522
  appType: "spa",
4416
- cacheDir: P(M, ".vite"),
4523
+ cacheDir: P(N, ".vite"),
4417
4524
  publicDir: P(t, "public")
4418
- })).listen(), go.info(`v${Fe} ready in ${Date.now() - Pe}ms`, {
4525
+ })).listen(), wo.info(`v${Fe} ready in ${Date.now() - Pe}ms`, {
4419
4526
  version: Fe,
4420
4527
  bootMs: Date.now() - Pe
4421
- }), Q.info(`listening on http://localhost:${_}`, {
4422
- port: _,
4528
+ }), Q.info(`listening on http://localhost:${x}`, {
4529
+ port: x,
4423
4530
  app: u.name ?? "(unnamed)"
4424
4531
  });
4425
- for (let e of f) e.proxyTarget && (Q.info(`proxy /ws/${e.name} → ${e.proxyTarget}`, {
4532
+ for (let e of p) e.proxyTarget && (Q.info(`proxy /ws/${e.name} → ${e.proxyTarget}`, {
4426
4533
  api: e.name,
4427
4534
  target: e.proxyTarget
4428
4535
  }), Q.info(`proxy /_voltro/api/${e.name} → ${e.proxyTarget.replace(/^ws/, "http")}/_voltro/inspect`, { api: e.name }));
4429
4536
  try {
4430
4537
  await ie({
4431
- id: S,
4432
- name: x,
4538
+ id: C,
4539
+ name: S,
4433
4540
  kind: "web",
4434
- url: `http://localhost:${_}`,
4541
+ url: `http://localhost:${x}`,
4435
4542
  pid: process.pid,
4436
4543
  status: "live",
4437
- logFile: C.path
4544
+ logFile: w.path
4438
4545
  });
4439
- let e = ji(t);
4546
+ let e = Fi(t);
4440
4547
  if (e) {
4441
- let t = await Vi({ dashboardAppPath: e });
4548
+ let t = await Gi({ dashboardAppPath: e });
4442
4549
  t.status === "launched" ? Q.info(`dashboard launched at http://localhost:${t.port}`, { port: t.port }) : t.status === "already-running" && Q.debug(`dashboard already running on :${t.port}`, { port: t.port });
4443
4550
  }
4444
4551
  setInterval(() => {
4445
4552
  ie({
4446
- id: S,
4447
- name: x,
4553
+ id: C,
4554
+ name: S,
4448
4555
  kind: "web",
4449
- url: `http://localhost:${_}`,
4556
+ url: `http://localhost:${x}`,
4450
4557
  pid: process.pid,
4451
4558
  status: "live",
4452
- logFile: C.path
4559
+ logFile: w.path
4453
4560
  }).catch(() => {});
4454
4561
  }, 1e4).unref();
4455
4562
  let n = () => {
4456
- oe(S), C.dispose();
4563
+ oe(C), w.dispose();
4457
4564
  };
4458
4565
  process.on("SIGINT", n), process.on("SIGTERM", n);
4459
4566
  } catch (e) {
4460
4567
  Q.warn("runtime-registry write failed", {}, e);
4461
4568
  }
4462
- return _e({
4569
+ return he({
4463
4570
  app: u.name ?? "unnamed",
4464
4571
  kind: "web",
4465
- url: `http://localhost:${_}`,
4572
+ url: `http://localhost:${x}`,
4466
4573
  bootMs: Date.now() - Pe
4467
4574
  }), new Promise(() => {});
4468
- }, ss = async (e) => {
4469
- let t = await is(e);
4575
+ }, hs = async (e) => {
4576
+ let t = await fs(e);
4470
4577
  return t ? (Q.child("serve").error("`voltro serve` is the production server for an API app — this is a WEB app.\n\n production voltro start .\n development voltro dev .\n\nBoth read the artefacts `voltro build` produces. `serve` cannot: it has no\nSSR bundle to render from, and building a second time here would overwrite\nthe one `voltro build` wrote.", {
4471
4578
  app: t.name ?? "(unnamed)",
4472
4579
  root: e
@@ -4479,4 +4586,4 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4479
4586
  };
4480
4587
  };
4481
4588
  //#endregion
4482
- export { Ai as $, Ka as A, Xt as At, va as B, yt as Bt, as as C, En as Ct, po as D, sn as Dt, ho as E, We as Et, Ma as F, Lt as Ft, ha as G, ot as Gt, ua as H, mt as Ht, Pa as I, Rt as It, Ki as J, Ui as K, at as Kt, Va as L, Et as Lt, Na as M, Pt as Mt, za as N, It as Nt, fo as O, dn as Ot, Ba as P, Ft as Pt, Mi as Q, ja as R, xt as Rt, Fo as S, Cn as St, mo as T, Tn as Tt, la as U, pt as Ut, pa as V, gt as Vt, da as W, lt as Wt, Ji as X, qi as Y, Yi as Z, Ko as _, $n as _t, vo as a, ni as at, ss as b, Fn as bt, Lo as c, Mr as ct, No as d, hr as dt, Vi as et, $ as f, gr as ft, Go as g, nr as gt, Jo as h, dr as ht, qo as i, ii as it, Ga as j, Yt as jt, no as k, Qt as kt, rs as l, jr as lt, is as m, ur as mt, Qo as n, pi as nt, es as o, Jr as ot, Po as p, mr as pt, Gi as q, st as qt, xo as r, ci as rt, $o as s, Ur as st, Ao as t, ji as tt, Io as u, Er as ut, Xo as v, Hn as vt, ts as w, Sn as wt, ko as x, On as xt, os as y, Rn as yt, Ra as z, vt as zt };
4589
+ export { Qi as $, _o as A, On as At, Ga as B, Bt, ps as C, Gn as Ct, xo as D, En as Dt, So as E, jn as Et, La as F, $t as Ft, ma as G, St as Gt, Ha as H, kt as Ht, Ua as I, Qt as It, ya as J, pt as Jt, pa as K, yt as Kt, Wa as L, Lt, oo as M, un as Mt, Xa as N, mn as Nt, vo as O, kn as Ot, Ya as P, tn as Pt, Zi as Q, st as Qt, Ia as R, zt as Rt, Uo as S, nr as St, Co as T, Rn as Tt, Sa as U, wt as Ut, Fa as V, Vt, _a as W, xt as Wt, Yi as X, ot as Xt, qi as Y, lt as Yt, Xi as Z, at as Zt, es as _, yr as _t, Eo as a, _i as at, hs as b, mr as bt, Go as c, oi as ct, Vo as d, Kr as dt, $i as et, $ as f, qr as ft, $o as g, vr as gt, ns as h, kr as ht, ts as i, Fi as it, go as j, We as jt, yo as k, Tn as kt, ds as l, Qr as lt, fs as m, Pr as mt, os as n, Pi as nt, cs as o, fi as ot, Ho as p, Fr as pt, ha as q, mt as qt, ko as r, Gi as rt, ss as s, ci as st, Ro as t, Ii as tt, Wo as u, Wr as ut, is as v, _r as vt, ls as w, Vn as wt, Lo as x, ar as xt, ms as y, pr as yt, Ra as z, Rt as zt };