@voltro/cli 0.32.0 → 0.33.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 (80) hide show
  1. package/CHANGELOG.md +205 -0
  2. package/THIRD-PARTY-NOTICES.md +1 -29
  3. package/dist/apiBuild-C-x9YacA.js +2 -0
  4. package/dist/{apiBuild-C4uEbs3s.js → apiBuild-h9VHtnlw.js} +2 -2
  5. package/dist/bin.js +3 -3
  6. package/dist/checkCommand-DRovTKza.js +2 -0
  7. package/dist/{checkCommand-dm7OHtPt.js → checkCommand-xGhRFFg2.js} +15 -15
  8. package/dist/{commands-C0nEePif.js → commands-CJfepbm4.js} +97 -13
  9. package/dist/{dbCommand-ifOMafuG.js → dbCommand-DTLKAfbA.js} +401 -241
  10. package/dist/dbCommand-b1gum4td.js +2 -0
  11. package/dist/{dev-5ficNnvF.js → dev-C_P8FLSx.js} +1539 -1487
  12. package/dist/{dev-rc3fwPSZ.js → dev-iiMtlkfs.js} +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/{inspectMetrics-BqO4E9G0.js → inspectMetrics-1xzTKAFx.js} +573 -550
  15. package/dist/{sdkgen-B_5mHQS2.js → sdkgen-C81QIkiL.js} +1 -1
  16. package/dist/serveCommand-DdaM4Hup.js +1608 -0
  17. package/dist/serveEntry.js +2 -2
  18. package/dist/{start-D1-8eKrO.js → start-C0koT0UO.js} +1 -1
  19. package/dist/startEntry.js +2 -2
  20. package/package.json +31 -18
  21. package/templates/AGENTS.md +1 -1
  22. package/templates/agent-docs/_index.md +1 -1
  23. package/templates/agent-docs/database/misc.md +37 -0
  24. package/templates/agent-docs/database/schema.md +4 -2
  25. package/templates/agent-docs/deployment.md +87 -1
  26. package/templates/agent-docs/plugins.md +50 -0
  27. package/templates/agent-docs/scheduling.md +4 -1
  28. package/templates/agent-docs/security.md +23 -2
  29. package/templates/agent-docs/whats-new.md +128 -86
  30. package/templates/apps/api-ai/package.json +7 -7
  31. package/templates/apps/api-auth/package.json +8 -8
  32. package/templates/apps/api-backend/package.json +7 -7
  33. package/templates/apps/api-backend-deactivation/package.json +7 -7
  34. package/templates/apps/api-backend-mail/package.json +8 -8
  35. package/templates/apps/api-backend-mariadb/package.json +9 -9
  36. package/templates/apps/api-backend-sqlite/package.json +8 -8
  37. package/templates/apps/api-backend-storage/package.json +8 -8
  38. package/templates/apps/api-cms/package.json +10 -10
  39. package/templates/apps/api-collab/package.json +8 -8
  40. package/templates/apps/api-data-advanced/package.json +8 -8
  41. package/templates/apps/api-durable/package.json +8 -8
  42. package/templates/apps/api-feature-flags/package.json +9 -9
  43. package/templates/apps/api-governance/package.json +8 -8
  44. package/templates/apps/api-kv/package.json +8 -8
  45. package/templates/apps/api-moderation/package.json +8 -8
  46. package/templates/apps/api-observability/package.json +8 -8
  47. package/templates/apps/api-ratelimit/package.json +8 -8
  48. package/templates/apps/api-rbac/package.json +8 -8
  49. package/templates/apps/api-rest/package.json +7 -7
  50. package/templates/apps/api-saas/package.json +11 -11
  51. package/templates/apps/api-saas-starter/package.json +10 -10
  52. package/templates/apps/api-search/package.json +8 -8
  53. package/templates/apps/api-status/package.json +8 -8
  54. package/templates/apps/api-versioning/package.json +8 -8
  55. package/templates/apps/api-webhooks/package.json +9 -9
  56. package/templates/apps/changelog/package.json +6 -6
  57. package/templates/apps/edge-functions/package.json +2 -2
  58. package/templates/apps/frontend-admin/package.json +8 -8
  59. package/templates/apps/frontend-app/package.json +8 -8
  60. package/templates/apps/frontend-auth/package.json +8 -8
  61. package/templates/apps/frontend-blank/package.json +7 -7
  62. package/templates/apps/frontend-cms/package.json +9 -9
  63. package/templates/apps/frontend-collab/package.json +9 -9
  64. package/templates/apps/frontend-contact/package.json +7 -7
  65. package/templates/apps/frontend-dashboard/package.json +7 -7
  66. package/templates/apps/frontend-docs/package.json +7 -7
  67. package/templates/apps/frontend-i18n/package.json +6 -6
  68. package/templates/apps/frontend-landing/package.json +7 -7
  69. package/templates/apps/frontend-portal/package.json +8 -8
  70. package/templates/apps/frontend-saas/package.json +8 -8
  71. package/templates/apps/frontend-spa/package.json +7 -7
  72. package/templates/apps/frontend-ssr/package.json +7 -7
  73. package/templates/apps/frontend-ssr-api/package.json +8 -8
  74. package/templates/apps/frontend-static-blog/package.json +6 -6
  75. package/templates/apps/frontend-status/package.json +8 -8
  76. package/templates/apps/mobile-app/package.json +2 -2
  77. package/dist/apiBuild-OJEjtwcn.js +0 -2
  78. package/dist/checkCommand-CwMrzAgV.js +0 -2
  79. package/dist/dbCommand-By__Ev0R.js +0 -2
  80. package/dist/serveCommand-PxMmn96o.js +0 -1578
@@ -19,38 +19,38 @@ import { spawn as fe } from "node:child_process";
19
19
  import { createConnection as pe } from "node:net";
20
20
  import { PassThrough as me } from "node:stream";
21
21
  //#region src/agentsMd.ts
22
- var he = d(g(import.meta.url)), U = [h(he, "..", "templates"), h(he, "..", "..", "templates")], ge = (e) => ({
22
+ var U = d(g(import.meta.url)), W = [h(U, "..", "templates"), h(U, "..", "..", "templates")], he = (e) => ({
23
23
  _tag: "TemplateNotFoundError",
24
24
  searched: e
25
- }), W = ["AGENTS.md", "CLAUDE.md"], _e = "voltro:agents-md:keep", ve = 2048, ye = "<!-- VOLTRO:INDEX -->", G = (e, t) => e.exists(t).pipe(b.orElseSucceed(() => !1)), K = (e, t) => e.readFileString(t).pipe(b.orElseSucceed(() => "")), be = (e, t) => e.readFileString(t).pipe(b.map((e) => {
25
+ }), G = ["AGENTS.md", "CLAUDE.md"], ge = "voltro:agents-md:keep", _e = 2048, ve = "<!-- VOLTRO:INDEX -->", ye = (e) => /^#\s*What's new in\s+(\d+\.\d+\.\d+[^\s]*)\s*$/m.exec(e)?.[1] ?? null, be = (e) => e.templatesVersion !== null && e.installedVersion !== null && e.templatesVersion !== e.installedVersion, K = (e, t) => e.exists(t).pipe(b.orElseSucceed(() => !1)), q = (e, t) => e.readFileString(t).pipe(b.orElseSucceed(() => "")), xe = (e, t) => e.readFileString(t).pipe(b.map((e) => {
26
26
  try {
27
27
  return JSON.parse(e).workspaces !== void 0;
28
28
  } catch {
29
29
  return !1;
30
30
  }
31
- }), b.orElseSucceed(() => !1)), q = (e) => b.gen(function* () {
31
+ }), b.orElseSucceed(() => !1)), Se = (e) => b.gen(function* () {
32
32
  let t = yield* v.FileSystem, n = h(e);
33
33
  for (;;) {
34
- if ((yield* G(t, p(n, ".git"))) || (yield* G(t, p(n, "pnpm-workspace.yaml"))) || (yield* be(t, p(n, "package.json")))) return n;
34
+ if ((yield* K(t, p(n, ".git"))) || (yield* K(t, p(n, "pnpm-workspace.yaml"))) || (yield* xe(t, p(n, "package.json")))) return n;
35
35
  let r = d(n);
36
36
  if (r === n) return h(e);
37
37
  n = r;
38
38
  }
39
- }), xe = (e, t, n) => b.gen(function* () {
39
+ }), Ce = (e, t, n) => b.gen(function* () {
40
40
  yield* e.makeDirectory(n, { recursive: !0 }).pipe(b.orElseSucceed(() => void 0));
41
41
  let r = yield* e.readDirectory(t).pipe(b.orElseSucceed(() => []));
42
42
  for (let i of r) {
43
43
  let r = p(t, i), a = p(n, i);
44
- (yield* e.stat(r).pipe(b.orElseSucceed(() => null)))?.type === "Directory" ? yield* xe(e, r, a) : yield* e.copyFile(r, a).pipe(b.orElseSucceed(() => void 0));
44
+ (yield* e.stat(r).pipe(b.orElseSucceed(() => null)))?.type === "Directory" ? yield* Ce(e, r, a) : yield* e.copyFile(r, a).pipe(b.orElseSucceed(() => void 0));
45
45
  }
46
- }), Se = (e) => typeof e?.name == "string" && e.name.length > 0 ? e.name.split("#")[0] : null, Ce = (e, t) => b.gen(function* () {
46
+ }), we = (e) => typeof e?.name == "string" && e.name.length > 0 ? e.name.split("#")[0] : null, Te = (e, t) => b.gen(function* () {
47
47
  let n = p(t, "app.config.ts");
48
- if (!(yield* G(e, n))) return null;
48
+ if (!(yield* K(e, n))) return null;
49
49
  let r = (yield* b.tryPromise(() => import(_(n).href)).pipe(b.orElseSucceed(() => null)))?.default;
50
- return !r || r.type && r.type !== "api" ? r?.type === "web" ? [] : null : (r.plugins ?? []).map(Se).filter((e) => e !== null);
51
- }), we = (e, t) => b.gen(function* () {
50
+ return !r || r.type && r.type !== "api" ? r?.type === "web" ? [] : null : (r.plugins ?? []).map(we).filter((e) => e !== null);
51
+ }), Ee = (e, t) => b.gen(function* () {
52
52
  let n = [], r = [], i = p(t, "apps");
53
- if (!(yield* G(e, i))) return {
53
+ if (!(yield* K(e, i))) return {
54
54
  apis: n,
55
55
  webs: r
56
56
  };
@@ -58,8 +58,8 @@ var he = d(g(import.meta.url)), U = [h(he, "..", "templates"), h(he, "..", "..",
58
58
  let a = p(i, t);
59
59
  if ((yield* e.stat(a).pipe(b.orElseSucceed(() => null)))?.type === "Directory") for (let t of yield* e.readDirectory(a).pipe(b.orElseSucceed(() => []))) {
60
60
  let i = p(a, t), o = p(i, "app.config.ts");
61
- if (!(yield* G(e, o))) continue;
62
- let s = yield* K(e, o);
61
+ if (!(yield* K(e, o))) continue;
62
+ let s = yield* q(e, o);
63
63
  /type:\s*['"]web['"]/.test(s) ? r.push(i) : n.push(i);
64
64
  }
65
65
  }
@@ -67,7 +67,7 @@ var he = d(g(import.meta.url)), U = [h(he, "..", "templates"), h(he, "..", "..",
67
67
  apis: n,
68
68
  webs: r
69
69
  };
70
- }), Te = (e) => e.replace(/\|/g, "\\|").replace(/\n/g, " ").trim(), Ee = (e, t, n) => {
70
+ }), De = (e) => e.replace(/\|/g, "\\|").replace(/\n/g, " ").trim(), Oe = (e, t, n) => {
71
71
  let r = [
72
72
  "<!-- voltro agent-docs index — regenerated at seed time -->",
73
73
  "## Deep reference (read on demand)",
@@ -79,17 +79,17 @@ var he = d(g(import.meta.url)), U = [h(he, "..", "templates"), h(he, "..", "..",
79
79
  "",
80
80
  "| Topic | Open | Summary |",
81
81
  "|---|---|---|",
82
- ...e.modules.map((e) => `| ${e.title} | \`${n}${e.path}\` | ${Te(e.description)} |`),
82
+ ...e.modules.map((e) => `| ${e.title} | \`${n}${e.path}\` | ${De(e.description)} |`),
83
83
  ""
84
- ], i = new Map(e.plugins.map((e) => [e.pkg, e])), a = (e, t) => e.module === void 0 ? `\`node_modules/${t}/README.md\`` : `\`${n}${e.module}\` (or \`node_modules/${t}/README.md\`)`, o = t === null ? e.plugins.map((e) => `| ${e.slug} | ${a(e, e.pkg)} | ${Te(e.description)} |`) : t.map((e) => {
84
+ ], i = new Map(e.plugins.map((e) => [e.pkg, e])), a = (e, t) => e.module === void 0 ? `\`node_modules/${t}/README.md\`` : `\`${n}${e.module}\` (or \`node_modules/${t}/README.md\`)`, o = t === null ? e.plugins.map((e) => `| ${e.slug} | ${a(e, e.pkg)} | ${De(e.description)} |`) : t.map((e) => {
85
85
  let t = i.get(e);
86
- return t ? `| ${t.slug} | ${a(t, e)} | ${Te(t.description)} |` : `| ${e.replace(/^@[^/]+\//, "")} | \`node_modules/${e}/README.md\` | (see plugin README) |`;
86
+ return t ? `| ${t.slug} | ${a(t, e)} | ${De(t.description)} |` : `| ${e.replace(/^@[^/]+\//, "")} | \`node_modules/${e}/README.md\` | (see plugin README) |`;
87
87
  });
88
88
  return r.push(`### Plugins${t === null ? "" : " (installed)"}`, "", "| Plugin | Open | Summary |", "|---|---|---|"), r.push(o.length ? o.join("\n") : "| _(none installed)_ | | |", ""), r.join("\n");
89
- }, De = (e, t, n) => {
89
+ }, ke = (e, t, n) => {
90
90
  let r = t.templates?.[e] ?? t.templates?.[e.replace(/^frontend-/, "")];
91
91
  return `\nScaffolded from the \`${e}\` template — see \`${r ? `${n}${r}` : `${n}agent-docs/templates/overview.md`}\`.\n`;
92
- }, Oe = {
92
+ }, Ae = {
93
93
  api: (e, t, n = "") => `# api — agent notes
94
94
 
95
95
  You are in a Voltro **api** app. Server primitives live here: \`queries/\`,
@@ -129,7 +129,7 @@ You are in a Voltro **web** app. File-based routing under \`src/pages/**\`.
129
129
  Deep reference (paths from the repo root): \`${e}agent-docs/routing.md\`,
130
130
  \`${e}agent-docs/schema-driven-ui.md\`, \`${e}agent-docs/internationalization.md\`.
131
131
  ${t}`
132
- }, ke = [
132
+ }, je = [
133
133
  {
134
134
  name: "voltro-schema",
135
135
  description: "Define or change a Voltro database table/schema (columns, mixins, indexes, relations).",
@@ -160,7 +160,7 @@ ${t}`
160
160
  description: "Export/import + backup/restore Voltro data & assets, and copy prod→dev/stage SAFELY with fail-closed masking/anonymization (.sensitive()/.safe()) + referential subsetting. Use for data takeout, seeding lower envs, backups, or cross-dialect moves.",
161
161
  module: "cli.md"
162
162
  }
163
- ], Ae = (e, t) => `---
163
+ ], Me = (e, t) => `---
164
164
  name: ${e.name}
165
165
  description: ${e.description}
166
166
  ---
@@ -171,10 +171,10 @@ Open the full reference and follow the patterns there:
171
171
 
172
172
  Also read the repo-root \`AGENTS.md\` for the always-true rules (browser/server
173
173
  boundary, naming, anti-patterns) before editing.
174
- `, je = (e, t, n, r) => b.gen(function* () {
175
- let i = yield* G(e, t);
174
+ `, Ne = (e, t, n, r) => b.gen(function* () {
175
+ let i = yield* K(e, t);
176
176
  if (i) {
177
- if ((yield* K(e, t)).slice(0, ve).includes("voltro:agents-md:keep")) return {
177
+ if ((yield* q(e, t)).slice(0, _e).includes("voltro:agents-md:keep")) return {
178
178
  path: t,
179
179
  action: "protected"
180
180
  };
@@ -187,67 +187,90 @@ boundary, naming, anti-patterns) before editing.
187
187
  path: t,
188
188
  action: i ? "overwritten" : "created"
189
189
  };
190
- }), Me = (e, t = {}) => b.gen(function* () {
191
- let n = yield* v.FileSystem, r = yield* q(e), i = null;
192
- for (let e of U) if (yield* G(n, p(e, "AGENTS.core.md"))) {
190
+ }), Pe = (e, t = {}) => b.gen(function* () {
191
+ let n = yield* v.FileSystem, r = yield* Se(e), i = null;
192
+ for (let e of W) if (yield* K(n, p(e, "AGENTS.core.md"))) {
193
193
  i = e;
194
194
  break;
195
195
  }
196
196
  if (i === null) {
197
- for (let e of U) if (yield* G(n, p(e, "AGENTS.md"))) {
198
- let i = yield* K(n, p(e, "AGENTS.md")), a = [];
199
- for (let e of W) a.push(yield* je(n, p(r, e), i, t.force ?? !1));
197
+ for (let e of W) if (yield* K(n, p(e, "AGENTS.md"))) {
198
+ let i = yield* q(n, p(e, "AGENTS.md")), a = [];
199
+ for (let e of G) a.push(yield* Ne(n, p(r, e), i, t.force ?? !1));
200
200
  return { files: a };
201
201
  }
202
- return yield* b.fail(ge(U.map((e) => p(e, "AGENTS.core.md"))));
202
+ return yield* b.fail(he(W.map((e) => p(e, "AGENTS.core.md"))));
203
203
  }
204
- let a = yield* K(n, p(i, "AGENTS.core.md")), o = yield* K(n, p(i, "agent-docs", "_manifest.json")), s = o ? JSON.parse(o) : {
204
+ let a = yield* q(n, p(i, "AGENTS.core.md")), o = yield* q(n, p(i, "agent-docs", "_manifest.json")), s = o ? JSON.parse(o) : {
205
205
  modules: [],
206
206
  plugins: []
207
- }, c = (t.preferPointer ?? !1) || (yield* G(n, p(r, "node_modules/@voltro/cli/templates/agent-docs", "_manifest.json"))), l = c ? "node_modules/@voltro/cli/templates/" : "", u = t.force ?? !1, d = W.map((e) => p(r, e));
208
- if ((yield* b.forEach(d, (e) => K(n, e).pipe(b.map((e) => e.slice(0, ve))))).every((e) => e.includes("voltro:agents-md:keep"))) return { files: d.map((e) => ({
209
- path: e,
210
- action: "protected"
211
- })) };
212
- let { apis: f, webs: m } = yield* we(n, r), g = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Set(), y = !1;
213
- for (let e of f) {
214
- let t = yield* Ce(n, e);
215
- if (g.set(e, t), t !== null) {
216
- y = !0;
217
- for (let e of t) _.add(e);
207
+ }, c = (t.preferPointer ?? !1) || (yield* K(n, p(r, "node_modules/@voltro/cli/templates/agent-docs", "_manifest.json"))), l = c ? "node_modules/@voltro/cli/templates/" : "", u = t.force ?? !1, d = (e) => q(n, e).pipe(b.map((e) => {
208
+ if (!e) return null;
209
+ try {
210
+ return JSON.parse(e).version ?? null;
211
+ } catch {
212
+ return null;
213
+ }
214
+ })), f = {
215
+ templatesVersion: yield* d(p(i, "..", "package.json")),
216
+ installedVersion: yield* d(p(r, "node_modules", "@voltro", "cli", "package.json")),
217
+ whatsNewVersion: ye(yield* q(n, p(i, "agent-docs", "whats-new.md"))),
218
+ copiedIn: !c
219
+ }, m = G.map((e) => p(r, e));
220
+ if ((yield* b.forEach(m, (e) => q(n, e).pipe(b.map((e) => e.slice(0, _e))))).every((e) => e.includes("voltro:agents-md:keep"))) return {
221
+ files: m.map((e) => ({
222
+ path: e,
223
+ action: "protected"
224
+ })),
225
+ provenance: f
226
+ };
227
+ let { apis: g, webs: _ } = yield* Ee(n, r), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Set(), S = !1;
228
+ for (let e of g) {
229
+ let t = yield* Te(n, e);
230
+ if (y.set(e, t), t !== null) {
231
+ S = !0;
232
+ for (let e of t) x.add(e);
218
233
  }
219
234
  }
220
- let x = t.plugins ? t.plugins.map(Se).filter((e) => e !== null) : y ? [..._] : null, S = a.includes(ye) ? a.replace(ye, Ee(s, x, l)) : a, C = [];
221
- for (let e of d) C.push(yield* je(n, e, S, u));
222
- c || (yield* xe(n, p(i, "agent-docs"), p(r, "agent-docs")));
223
- let w = new Map((t.appTemplates ?? []).map((e) => [h(e.dir), e.template])), T = (e) => {
224
- let t = w.get(h(e));
225
- return t ? De(t, s, l) : "";
226
- }, E = (e, t) => b.forEach(W, (r) => je(n, p(e, r), t, u));
227
- for (let e of f) C.push(...yield* E(e, Oe.api(l, g.get(e) ?? null, T(e)))), (yield* G(n, p(e, "database"))) && C.push(...yield* E(p(e, "database"), Oe.database(l)));
228
- for (let e of m) C.push(...yield* E(e, Oe.web(l, T(e))));
229
- for (let e of ke) C.push(yield* je(n, p(r, ".claude", "skills", e.name, "SKILL.md"), Ae(e, l), u));
230
- return { files: C };
231
- }), Ne = (e, t = {}) => b.runPromise(Me(e, t).pipe(b.provide(y.layer))), Pe = async (t) => {
235
+ let C = t.plugins ? t.plugins.map(we).filter((e) => e !== null) : S ? [...x] : null, w = a.includes(ve) ? a.replace(ve, Oe(s, C, l)) : a, T = [];
236
+ for (let e of m) T.push(yield* Ne(n, e, w, u));
237
+ c || (yield* Ce(n, p(i, "agent-docs"), p(r, "agent-docs")));
238
+ let E = new Map((t.appTemplates ?? []).map((e) => [h(e.dir), e.template])), D = (e) => {
239
+ let t = E.get(h(e));
240
+ return t ? ke(t, s, l) : "";
241
+ }, O = (e, t) => b.forEach(G, (r) => Ne(n, p(e, r), t, u));
242
+ for (let e of g) T.push(...yield* O(e, Ae.api(l, y.get(e) ?? null, D(e)))), (yield* K(n, p(e, "database"))) && T.push(...yield* O(p(e, "database"), Ae.database(l)));
243
+ for (let e of _) T.push(...yield* O(e, Ae.web(l, D(e))));
244
+ for (let e of je) T.push(yield* Ne(n, p(r, ".claude", "skills", e.name, "SKILL.md"), Me(e, l), u));
245
+ return {
246
+ files: T,
247
+ provenance: f
248
+ };
249
+ }), Fe = (e, t = {}) => b.runPromise(Pe(e, t).pipe(b.provide(y.layer))), Ie = async (t) => {
232
250
  let n = t.includes("--force"), r = t.find((e) => !e.startsWith("-")) ?? process.cwd();
233
251
  return e(b.gen(function* () {
234
- let e = yield* Me(r, { force: n });
252
+ let e = yield* Pe(r, { force: n });
235
253
  for (let t of e.files) {
236
- let e = t.action === "created" ? "wrote" : t.action === "overwritten" ? "overwrote" : t.action === "protected" ? `protected (hand-maintained — has "${_e}")` : "present (use --force to overwrite)";
254
+ let e = t.action === "created" ? "wrote" : t.action === "overwritten" ? "overwrote" : t.action === "protected" ? `protected (hand-maintained — has "${ge}")` : "present (use --force to overwrite)";
237
255
  yield* b.logInfo(`${t.path.split("/").slice(-2).join("/")} ${e}`, { action: t.action });
238
256
  }
239
- return 0;
257
+ let t = e.provenance;
258
+ return t !== void 0 && (yield* b.logInfo(`seeded from @voltro/cli ${t.templatesVersion ?? "unknown"} (project has ${t.installedVersion ?? "no resolvable @voltro/cli"}; whats-new describes ${t.whatsNewVersion ?? "unknown"}; modules ${t.copiedIn ? "COPIED into ./agent-docs" : "pointed at node_modules"})`, {
259
+ templates: t.templatesVersion,
260
+ installed: t.installedVersion,
261
+ whatsNew: t.whatsNewVersion
262
+ }), be(t) && (yield* b.logWarning(`the \`voltro\` binary that ran is ${t.templatesVersion}, but this project installs ${t.installedVersion} — everything just written describes the OLDER version. Run it through the project's own cli (\`pnpm exec voltro agents-md --force\`) so the guide matches what the app boots.`))), 0;
240
263
  }).pipe(b.catchTag("TemplateNotFoundError", (e) => b.gen(function* () {
241
264
  return yield* b.logError("AGENTS.md template not found", { searched: e.searched }), 1;
242
265
  }))), { scope: "voltro:agents-md" });
243
- }, Fe = p(L(), ".voltro"), Ie = p(Fe, "runtime-registry.json"), Le = 3e4, Re = () => {
266
+ }, Le = p(L(), ".voltro"), Re = p(Le, "runtime-registry.json"), ze = 3e4, Be = () => {
244
267
  let e = Math.random().toString(36).slice(2, 10);
245
- return `${Ie}.${process.pid}.${Date.now()}.${e}.tmp`;
246
- }, ze = async () => {
247
- await O.mkdir(Fe, { recursive: !0 });
248
- }, Be = async () => {
268
+ return `${Re}.${process.pid}.${Date.now()}.${e}.tmp`;
269
+ }, Ve = async () => {
270
+ await O.mkdir(Le, { recursive: !0 });
271
+ }, He = async () => {
249
272
  try {
250
- let e = await O.readFile(Ie, "utf8"), t = JSON.parse(e);
273
+ let e = await O.readFile(Re, "utf8"), t = JSON.parse(e);
251
274
  return t.version !== 1 || !Array.isArray(t.apps) ? {
252
275
  version: 1,
253
276
  apps: []
@@ -258,34 +281,34 @@ boundary, naming, anti-patterns) before editing.
258
281
  apps: []
259
282
  };
260
283
  }
261
- }, Ve = async (e) => {
262
- await ze();
263
- let t = Re();
284
+ }, Ue = async (e) => {
285
+ await Ve();
286
+ let t = Be();
264
287
  try {
265
288
  await O.writeFile(t, JSON.stringify(e, null, 2), {
266
289
  encoding: "utf8",
267
290
  mode: 384
268
- }), await O.rename(t, Ie), await O.chmod(Ie, 384).catch(() => {});
291
+ }), await O.rename(t, Re), await O.chmod(Re, 384).catch(() => {});
269
292
  } catch (e) {
270
293
  try {
271
294
  await O.unlink(t);
272
295
  } catch {}
273
296
  throw e;
274
297
  }
275
- }, He = (e) => {
298
+ }, We = (e) => {
276
299
  try {
277
300
  return process.kill(e, 0), !0;
278
301
  } catch {
279
302
  return !1;
280
303
  }
281
- }, Ue = (e) => {
304
+ }, Ge = (e) => {
282
305
  let t = Date.now();
283
- return e.filter((e) => He(e.pid) ? t - new Date(e.heartbeatAt).getTime() < Le : !1);
284
- }, We = async () => {
285
- let e = await Be(), t = Ue(e.apps);
306
+ return e.filter((e) => We(e.pid) ? t - new Date(e.heartbeatAt).getTime() < ze : !1);
307
+ }, Ke = async () => {
308
+ let e = await He(), t = Ge(e.apps);
286
309
  if (t.length === e.apps.length) return e;
287
310
  try {
288
- await Ve({
311
+ await Ue({
289
312
  version: 1,
290
313
  apps: t
291
314
  });
@@ -294,31 +317,31 @@ boundary, naming, anti-patterns) before editing.
294
317
  version: 1,
295
318
  apps: t
296
319
  };
297
- }, Ge = async (e) => {
298
- let t = await Be(), n = (/* @__PURE__ */ new Date()).toISOString(), r = t.apps.findIndex((t) => t.id === e.id), i = e.inspectToken ?? process.env.VOLTRO_INSPECT_TOKEN, a = {
320
+ }, qe = async (e) => {
321
+ let t = await He(), n = (/* @__PURE__ */ new Date()).toISOString(), r = t.apps.findIndex((t) => t.id === e.id), i = e.inspectToken ?? process.env.VOLTRO_INSPECT_TOKEN, a = {
299
322
  ...e,
300
323
  ...i !== void 0 && i !== "" ? { inspectToken: i } : {},
301
324
  registeredAt: r >= 0 ? t.apps[r].registeredAt : n,
302
325
  heartbeatAt: n
303
326
  };
304
- await Ve({
327
+ await Ue({
305
328
  version: 1,
306
329
  apps: r >= 0 ? t.apps.map((e, t) => t === r ? a : e) : [...t.apps, a]
307
330
  });
308
- }, Ke = async (e) => {
331
+ }, Je = async (e) => {
309
332
  try {
310
- let t = await Be(), n = t.apps.filter((t) => t.id !== e);
333
+ let t = await He(), n = t.apps.filter((t) => t.id !== e);
311
334
  if (n.length === t.apps.length) return;
312
- await Ve({
335
+ await Ue({
313
336
  version: 1,
314
337
  apps: n
315
338
  });
316
339
  } catch {}
317
- }, qe = (e, t, n) => `${e}:${t}:${n}`, Je = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), Ye = (e) => {
340
+ }, Ye = (e, t, n) => `${e}:${t}:${n}`, Xe = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), Ze = (e) => {
318
341
  try {
319
342
  let t = p(e, "tsconfig.json");
320
343
  if (!T(t)) return [];
321
- let n = JSON.parse(Je(k(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = h(e, n.baseUrl ?? "."), a = [];
344
+ let n = JSON.parse(Xe(k(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = h(e, n.baseUrl ?? "."), a = [];
322
345
  for (let [e, t] of Object.entries(r)) {
323
346
  let n = t[0];
324
347
  if (!n) continue;
@@ -338,17 +361,17 @@ boundary, naming, anti-patterns) before editing.
338
361
  } catch {
339
362
  return [];
340
363
  }
341
- }, Xe = (e) => {
364
+ }, Qe = (e) => {
342
365
  let t = e;
343
366
  return t?.code === "ERR_MODULE_NOT_FOUND" || /Cannot find (package|module)/.test(String(t?.message ?? ""));
344
- }, Ze = async (e, t) => {
367
+ }, $e = async (e, t) => {
345
368
  try {
346
369
  return await t();
347
370
  } catch (t) {
348
- throw Xe(t) ? Error(`voltro: the build tool '${e}' is not installed.\n\nIt's an OPTIONAL dependency of @voltro/cli — needed by 'voltro dev' and 'voltro build', but excluded from a serve-only production install (that's how prod images stay lean). If you are building, reinstall WITHOUT '--no-optional' (e.g. 'pnpm install'). A production SERVE container does not need '${e}' — it boots from the precompiled bundle.`) : t;
371
+ throw Qe(t) ? Error(`voltro: the build tool '${e}' is not installed.\n\nIt's an OPTIONAL dependency of @voltro/cli — needed by 'voltro dev' and 'voltro build', but excluded from a serve-only production install (that's how prod images stay lean). If you are building, reinstall WITHOUT '--no-optional' (e.g. 'pnpm install'). A production SERVE container does not need '${e}' — it boots from the precompiled bundle.`) : t;
349
372
  }
350
- }, Qe = "// AUTO-GENERATED by Voltro — DO NOT EDIT.\n// Source: app.config.ts `env` (defineEnv). Regenerated on every `voltro dev` boot.\n", $e = (e, t) => t ? `${e} | undefined` : e, et = (e, t) => Object.entries(e.vars).filter(([, e]) => t(e.access)).map(([e, t]) => `${t.description ? ` /** ${t.description} */\n` : ""} readonly ${e}: ${$e(t.tsType, t.optional)}`).join("\n"), tt = async (e, t) => {
351
- let n = et(t, () => !0), r = `${Qe}
373
+ }, et = "// AUTO-GENERATED by Voltro — DO NOT EDIT.\n// Source: app.config.ts `env` (defineEnv). Regenerated on every `voltro dev` boot.\n", tt = (e, t) => t ? `${e} | undefined` : e, nt = (e, t) => Object.entries(e.vars).filter(([, e]) => t(e.access)).map(([e, t]) => `${t.description ? ` /** ${t.description} */\n` : ""} readonly ${e}: ${tt(t.tsType, t.optional)}`).join("\n"), rt = async (e, t) => {
374
+ let n = nt(t, () => !0), r = `${et}
352
375
  import '@voltro/env/server'
353
376
 
354
377
  declare module '@voltro/env/server' {
@@ -358,8 +381,8 @@ ${n.length > 0 ? n : " // (no variables declared)"}
358
381
  }
359
382
  `;
360
383
  await ue(p(e, "env.generated.d.ts"), r, "utf8");
361
- }, nt = async (e, t) => {
362
- let n = et(t, (e) => e === "public"), r = `${Qe}
384
+ }, it = async (e, t) => {
385
+ let n = nt(t, (e) => e === "public"), r = `${et}
363
386
  import '@voltro/env/public'
364
387
 
365
388
  declare module '@voltro/env/public' {
@@ -369,8 +392,8 @@ ${n.length > 0 ? n : " // (no public variables declared)"}
369
392
  }
370
393
  `, i = p(e, "src");
371
394
  await H(i, { recursive: !0 }), await ue(p(i, "voltro-env.d.ts"), r, "utf8");
372
- }, rt = async (e, t) => {
373
- let n = `${Qe}
395
+ }, at = async (e, t) => {
396
+ let n = `${et}
374
397
  import { __installPublicEnv } from '@voltro/env/public'
375
398
 
376
399
  export const publicEnvValues = ${JSON.stringify(t, null, 2)} as const
@@ -379,7 +402,7 @@ export const publicEnvValues = ${JSON.stringify(t, null, 2)} as const
379
402
  __installPublicEnv(publicEnvValues)
380
403
  `;
381
404
  await H(e, { recursive: !0 }), await ue(p(e, "env.public.ts"), n, "utf8");
382
- }, it = async (e) => {
405
+ }, ot = async (e) => {
383
406
  let t = ae(e.rawEnv) ? e.rawEnv : void 0, n = await se({
384
407
  contract: t,
385
408
  resolveSecret: te
@@ -397,11 +420,11 @@ __installPublicEnv(publicEnvValues)
397
420
  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 });
398
421
  }
399
422
  }
400
- return e.generateTypes && t && (e.appType === "api" ? await tt(e.root, t) : await nt(e.root, t)), {
423
+ return e.generateTypes && t && (e.appType === "api" ? await rt(e.root, t) : await it(e.root, t)), {
401
424
  resolved: n,
402
425
  contract: t
403
426
  };
404
- }, at = (e) => {
427
+ }, st = (e) => {
405
428
  let t = re(e.contract), n = (e.plugins ?? []).flatMap((e) => V(e.name, e.declaredEnv)), r = e.includeFramework === !1 ? [] : ne, i = /* @__PURE__ */ new Set(), a = [];
406
429
  for (let e of [
407
430
  ...t,
@@ -409,8 +432,8 @@ __installPublicEnv(publicEnvValues)
409
432
  ...r
410
433
  ]) i.has(e.key) || (i.add(e.key), a.push(e));
411
434
  return a;
412
- }, ot = (e, t, n = (e) => process.env[e]) => {
413
- let r = at(t).map((e) => {
435
+ }, ct = (e, t, n = (e) => process.env[e]) => {
436
+ let r = st(t).map((e) => {
414
437
  let t = n(e.key) !== void 0;
415
438
  return {
416
439
  ...e,
@@ -427,13 +450,13 @@ __installPublicEnv(publicEnvValues)
427
450
  missingRequired: r.filter((e) => e.required && !e.isSet && e.default === void 0).length
428
451
  }
429
452
  };
430
- }, st = (e, t) => oe(at({
453
+ }, lt = (e, t) => oe(st({
431
454
  ...e,
432
455
  includeFramework: !1
433
456
  }), {
434
457
  includeFramework: e.includeFramework !== !1,
435
458
  ...t ? { header: t } : {}
436
- }), ct = () => {
459
+ }), ut = () => {
437
460
  let e = /* @__PURE__ */ new Map();
438
461
  return {
439
462
  get(t) {
@@ -460,7 +483,7 @@ __installPublicEnv(publicEnvValues)
460
483
  return Array.from(e.entries());
461
484
  }
462
485
  };
463
- }, lt = (e) => {
486
+ }, J = (e) => {
464
487
  if (typeof e == "number" && Number.isFinite(e) && e > 0) return e * 1e3;
465
488
  if (typeof e != "string") return null;
466
489
  let t = /^\s*(\d+)\s*(s|seconds?|m|minutes?|h|hours?|d|days?)\s*$/i.exec(e);
@@ -469,10 +492,10 @@ __installPublicEnv(publicEnvValues)
469
492
  if (!Number.isFinite(n) || n <= 0) return null;
470
493
  let r = t[2].toLowerCase();
471
494
  return r === "s" || r.startsWith("second") ? n * 1e3 : r === "m" || r.startsWith("minute") ? n * 6e4 : r === "h" || r.startsWith("hour") ? n * 36e5 : r === "d" || r.startsWith("day") ? n * 864e5 : null;
472
- }, ut = (e, t = {}) => {
495
+ }, dt = (e, t = {}) => {
473
496
  let n = [e];
474
497
  return t.tenant !== void 0 && t.tenant !== "" && n.push(`tenant=${t.tenant}`), t.locale !== void 0 && t.locale !== "" && n.push(`lang=${t.locale}`), n.join("|");
475
- }, dt = (e, t) => e.expiresAt > t, ft = (e, t) => e.expiresAt <= t && e.servableUntil > t, pt = S({ scope: "voltro:cli" }), mt = (e, t) => {
498
+ }, ft = (e, t) => e.expiresAt > t, pt = (e, t) => e.expiresAt <= t && e.servableUntil > t, mt = S({ scope: "voltro:cli" }), ht = (e, t) => {
476
499
  if (t?.code !== "EACCES") return "";
477
500
  if (typeof process.getuid != "function") return " — permission denied";
478
501
  try {
@@ -481,8 +504,8 @@ __installPublicEnv(publicEnvValues)
481
504
  } catch {
482
505
  return " — permission denied (and the file could not be stat-ed either)";
483
506
  }
484
- }, ht = [], gt = (e) => {
485
- ht.length = 0;
507
+ }, gt = [], _t = (e) => {
508
+ gt.length = 0;
486
509
  let t = e[1] && !e[1].startsWith("-") ? e[1] : void 0, n = t ? f(t) ? t : h(process.cwd(), t) : process.cwd(), r = [], i = n;
487
510
  for (;;) {
488
511
  r.push(i);
@@ -493,7 +516,7 @@ __installPublicEnv(publicEnvValues)
493
516
  for (let e of r) for (let t of [".env.local", ".env"]) {
494
517
  let n = h(e, t);
495
518
  if (T(n)) {
496
- ht.push(n);
519
+ gt.push(n);
497
520
  try {
498
521
  let e = k(n, "utf8");
499
522
  for (let t of e.split(/\r?\n/)) {
@@ -505,11 +528,11 @@ __installPublicEnv(publicEnvValues)
505
528
  (i.startsWith("\"") && i.endsWith("\"") || i.startsWith("'") && i.endsWith("'")) && (i = i.slice(1, -1)), process.env[r] === void 0 && (process.env[r] = i);
506
529
  }
507
530
  } catch (e) {
508
- pt.warn(`failed to load env file (continuing)${mt(n, e)}`, { path: n }, e);
531
+ mt.warn(`failed to load env file (continuing)${ht(n, e)}`, { path: n }, e);
509
532
  }
510
533
  }
511
534
  }
512
- }, _t = 500, vt = (e, t, n = {}) => {
535
+ }, vt = 500, yt = (e, t, n = {}) => {
513
536
  if (e.length === 0) return () => {};
514
537
  let r = (e) => n.root ? m(n.root, e) : e, i = !1, a = (e) => {
515
538
  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(() => {
@@ -527,25 +550,25 @@ __installPublicEnv(publicEnvValues)
527
550
  });
528
551
  }));
529
552
  };
530
- for (let t of e) ee(t, { interval: _t }, (e, n) => {
553
+ for (let t of e) ee(t, { interval: vt }, (e, n) => {
531
554
  e.mtimeMs !== n.mtimeMs && a(t);
532
555
  });
533
556
  return t.info("watching .env files for changes", {
534
557
  files: e.map(r),
535
- intervalMs: _t
558
+ intervalMs: vt
536
559
  }), () => {
537
560
  for (let t of e) N(t);
538
561
  };
539
- }, yt = "VoltroBootRefusal", bt = (e) => {
562
+ }, bt = "VoltroBootRefusal", xt = (e) => {
540
563
  let t = Error(e);
541
- return t.name = yt, t;
542
- }, xt = [{
564
+ return t.name = bt, t;
565
+ }, St = [{
543
566
  host: "127.0.0.1",
544
567
  family: "IPv4"
545
568
  }, {
546
569
  host: "::1",
547
570
  family: "IPv6"
548
- }], St = (e, t, n) => new Promise((r) => {
571
+ }], Ct = (e, t, n) => new Promise((r) => {
549
572
  let i = !1, a = (e) => {
550
573
  if (!i) {
551
574
  i = !0;
@@ -559,10 +582,10 @@ __installPublicEnv(publicEnvValues)
559
582
  port: t
560
583
  });
561
584
  o.once("connect", () => a(!0)), o.once("error", () => a(!1)), o.setTimeout(n, () => a(!1));
562
- }), Ct = async (e, t = 400) => ({ families: (await Promise.all(xt.map(async (n) => ({
585
+ }), wt = async (e, t = 400) => ({ families: (await Promise.all(St.map(async (n) => ({
563
586
  family: n.family,
564
- taken: await St(n.host, e, t)
565
- })))).filter((e) => e.taken).map((e) => e.family) }), wt = (e, t, n) => [
587
+ taken: await Ct(n.host, e, t)
588
+ })))).filter((e) => e.taken).map((e) => e.family) }), Tt = (e, t, n) => [
566
589
  `${t}: port ${e} is already being served (${n.join(" + ")}).`,
567
590
  "",
568
591
  " Refusing to start. This is NOT a spurious check — a second listener can",
@@ -577,10 +600,10 @@ __installPublicEnv(publicEnvValues)
577
600
  "",
578
601
  " Then re-run. To use a different port instead, change `port` in",
579
602
  " app.config.ts."
580
- ].join("\n"), Tt = async (e, t) => {
581
- let { families: n } = await Ct(e);
582
- if (n.length !== 0) throw bt(wt(e, t, n));
583
- }, Et = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", Dt = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, Ot = (e) => {
603
+ ].join("\n"), Et = async (e, t) => {
604
+ let { families: n } = await wt(e);
605
+ if (n.length !== 0) throw xt(Tt(e, t, n));
606
+ }, Dt = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", Ot = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, kt = (e) => {
584
607
  let t = [], n = e;
585
608
  for (let e = 0; e < 12; e++) {
586
609
  let e = p(n, "node_modules");
@@ -590,7 +613,7 @@ __installPublicEnv(publicEnvValues)
590
613
  n = r;
591
614
  }
592
615
  return t;
593
- }, kt = (e) => {
616
+ }, At = (e) => {
594
617
  let t = /* @__PURE__ */ new Set([e]), n = e;
595
618
  for (let e = 0; e < 12; e++) {
596
619
  for (let e of ["pnpm-workspace.yaml", "pnpm-workspace.yml"]) {
@@ -628,9 +651,9 @@ __installPublicEnv(publicEnvValues)
628
651
  n = e;
629
652
  }
630
653
  return [...t];
631
- }, At = (e) => {
654
+ }, jt = (e) => {
632
655
  let t = [];
633
- for (let n of kt(e)) {
656
+ for (let n of At(e)) {
634
657
  let e = p(n, "node_modules", "@voltro"), r;
635
658
  try {
636
659
  r = A(e);
@@ -638,7 +661,7 @@ __installPublicEnv(publicEnvValues)
638
661
  continue;
639
662
  }
640
663
  for (let n of r) {
641
- let r = p(e, n), i = jt(r);
664
+ let r = p(e, n), i = Mt(r);
642
665
  i !== void 0 && t.push({
643
666
  pkg: `@voltro/${n}`,
644
667
  version: i,
@@ -647,14 +670,14 @@ __installPublicEnv(publicEnvValues)
647
670
  }
648
671
  }
649
672
  return t;
650
- }, jt = (e) => {
673
+ }, Mt = (e) => {
651
674
  try {
652
675
  let t = JSON.parse(k(p(e, "package.json"), "utf8"));
653
676
  return typeof t.version == "string" ? t.version : void 0;
654
677
  } catch {
655
678
  return;
656
679
  }
657
- }, Mt = (e) => {
680
+ }, Nt = (e) => {
658
681
  let t = [], n;
659
682
  try {
660
683
  n = A(e);
@@ -662,7 +685,7 @@ __installPublicEnv(publicEnvValues)
662
685
  return t;
663
686
  }
664
687
  for (let r of n) {
665
- if (r.startsWith(".") || Dt.test(r)) continue;
688
+ if (r.startsWith(".") || Ot.test(r)) continue;
666
689
  let n = p(e, r);
667
690
  if (r.startsWith("@")) {
668
691
  let e;
@@ -688,17 +711,17 @@ __installPublicEnv(publicEnvValues)
688
711
  });
689
712
  }
690
713
  return t;
691
- }, Nt = (e) => {
714
+ }, Pt = (e) => {
692
715
  let t = /* @__PURE__ */ new Map(), n = (e, n, r) => {
693
- if (!Et(e)) return;
716
+ if (!Dt(e)) return;
694
717
  let i = t.get(e) ?? /* @__PURE__ */ new Map();
695
718
  i.has(n) || i.set(n, r), t.set(e, i);
696
719
  };
697
- for (let t of Ot(e)) for (let { pkg: e, dir: r } of Mt(t)) {
698
- let t = jt(r);
720
+ for (let t of kt(e)) for (let { pkg: e, dir: r } of Nt(t)) {
721
+ let t = Mt(r);
699
722
  t !== void 0 && n(e, t, r);
700
723
  }
701
- for (let { pkg: t, version: r, dir: i } of At(e)) n(t, r, i);
724
+ for (let { pkg: t, version: r, dir: i } of jt(e)) n(t, r, i);
702
725
  let r = [];
703
726
  for (let [n, i] of t) i.size < 2 || r.push({
704
727
  pkg: n,
@@ -706,7 +729,7 @@ __installPublicEnv(publicEnvValues)
706
729
  paths: [...i.values()].map((t) => m(e, t)).sort()
707
730
  });
708
731
  return r.sort((e, t) => e.pkg.localeCompare(t.pkg));
709
- }, Pt = (e) => {
732
+ }, Ft = (e) => {
710
733
  if (e.length !== 0) return [
711
734
  `• ${e.length} package(s) resolved at more than one version:`,
712
735
  ...e.flatMap((e) => [` ${e.pkg} — ${e.versions.join(", ")}`, ...e.paths.map((e) => ` ${e}`)]),
@@ -724,11 +747,11 @@ __installPublicEnv(publicEnvValues)
724
747
  " instrument), then reinstall. Do not silence the generated file — it is where",
725
748
  " a genuine mistake in your own descriptors surfaces."
726
749
  ].join("\n");
727
- }, Ft = (e) => {
750
+ }, It = (e) => {
728
751
  let t = /* @__PURE__ */ new Map();
729
- for (let n of Ot(e)) for (let { pkg: e, dir: r } of Mt(n)) {
752
+ for (let n of kt(e)) for (let { pkg: e, dir: r } of Nt(n)) {
730
753
  if (!e.startsWith("@voltro/")) continue;
731
- let n = jt(r);
754
+ let n = Mt(r);
732
755
  n !== void 0 && !t.has(e) && t.set(e, n);
733
756
  }
734
757
  if (t.size < 2) return;
@@ -743,7 +766,7 @@ __installPublicEnv(publicEnvValues)
743
766
  version: t
744
767
  })).sort((e, t) => e.pkg.localeCompare(t.pkg))
745
768
  };
746
- }, It = (e) => {
769
+ }, Lt = (e) => {
747
770
  if (e !== void 0) return [
748
771
  `• ${e.behind.length} @voltro/* package(s) are not on ${e.majority}:`,
749
772
  ...e.behind.map((e) => ` ${e.pkg} ${e.version}`),
@@ -761,60 +784,60 @@ __installPublicEnv(publicEnvValues)
761
784
  " its pattern: the one that produced this report was `@voltro/[a-z-]+`,",
762
785
  " which silently skips `@voltro/i18n` because the name contains digits."
763
786
  ].join("\n");
764
- }, Lt = (e, t) => {
765
- let n = Ft(e);
787
+ }, Rt = (e, t) => {
788
+ let n = It(e);
766
789
  n !== void 0 && t.warn?.(`@voltro/* version skew: ${n.behind.length} package(s) are not on ${n.majority}`, {
767
790
  majority: n.majority,
768
791
  behind: n.behind.map((e) => `${e.pkg}@${e.version}`),
769
792
  fix: "the framework ships in lockstep; bump the listed packages and reinstall"
770
793
  });
771
- }, Rt = S({ scope: "vite" }), zt = /\x1b\[[0-9;]*m/g, Bt = /^\s*\[?vite\]?\s*(\([a-z-]+\)\s*)?/, Vt = (e) => e.replace(zt, "").replace(Bt, "").trim(), Ht = /proxy error/i, Ut = [
794
+ }, zt = S({ 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 = [
772
795
  "ECONNREFUSED",
773
796
  "ECONNRESET",
774
797
  "ECONNABORTED",
775
798
  "EPIPE",
776
799
  "ETIMEDOUT"
777
- ], Wt = (e, t = 0) => {
800
+ ], Gt = (e, t = 0) => {
778
801
  if (e == null || t > 5) return !1;
779
802
  let n = e;
780
- return typeof n.code == "string" && Ut.includes(n.code) || typeof n.message == "string" && Ut.some((e) => n.message.includes(e)) || Array.isArray(n.errors) && n.errors.some((e) => Wt(e, t + 1)) ? !0 : Wt(n.cause, t + 1);
781
- }, Gt = 4e3, Kt = () => {
803
+ 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);
804
+ }, Kt = 4e3, qt = () => {
782
805
  let e = /* @__PURE__ */ new Set(), t = 0, n = {
783
806
  hasWarned: !1,
784
807
  info: (e) => {
785
- let t = Vt(e);
786
- t.length !== 0 && Rt.info(t);
808
+ let t = Ht(e);
809
+ t.length !== 0 && zt.info(t);
787
810
  },
788
811
  warn: (e) => {
789
812
  n.hasWarned = !0;
790
- let t = Vt(e);
791
- t.length !== 0 && Rt.warn(t);
813
+ let t = Ht(e);
814
+ t.length !== 0 && zt.warn(t);
792
815
  },
793
816
  warnOnce: (t) => {
794
- let r = Vt(t);
795
- e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && Rt.warn(r));
817
+ let r = Ht(t);
818
+ e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && zt.warn(r));
796
819
  },
797
820
  error: (e, n) => {
798
- let r = Vt(e), i = n?.error;
821
+ let r = Ht(e), i = n?.error;
799
822
  if (r.length !== 0) {
800
- if (Ht.test(r) && Wt(i)) {
823
+ if (Ut.test(r) && Gt(i)) {
801
824
  let e = Date.now();
802
- e - t > Gt && (t = e, Rt.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
825
+ e - t > Kt && (t = e, zt.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
803
826
  return;
804
827
  }
805
- Rt.error(r, {}, i);
828
+ zt.error(r, {}, i);
806
829
  }
807
830
  },
808
831
  clearScreen: () => {},
809
832
  hasErrorLogged: (e) => !1
810
833
  };
811
834
  return n;
812
- }, qt = (e = process.env) => {
835
+ }, Jt = (e = process.env) => {
813
836
  let t = e.VOLTRO_DEV_SSR_COMPILE_CONCURRENCY;
814
837
  if (t === void 0 || t.trim() === "") return 4;
815
838
  let n = Number(t);
816
839
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 4;
817
- }, Jt = (e) => {
840
+ }, Yt = (e) => {
818
841
  let t = Math.max(1, Math.floor(e)), n = 0, r = [], i = () => n < t ? (n++, Promise.resolve()) : new Promise((e) => r.push(e)), a = () => {
819
842
  let e = r.shift();
820
843
  e ? e() : n--;
@@ -832,8 +855,8 @@ __installPublicEnv(publicEnvValues)
832
855
  return n;
833
856
  }
834
857
  };
835
- }, Yt = (e) => {
836
- let t = Jt(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
858
+ }, Xt = (e) => {
859
+ let t = Yt(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
837
860
  return {
838
861
  load: (i, a) => {
839
862
  if (r.has(i)) return a();
@@ -863,7 +886,7 @@ __installPublicEnv(publicEnvValues)
863
886
  return r.size;
864
887
  }
865
888
  };
866
- }, Xt = (e) => {
889
+ }, Zt = (e) => {
867
890
  let t = [];
868
891
  for (let n of e.split("/").filter(Boolean)) n.startsWith("[[...") && n.endsWith("]]") ? t.push({
869
892
  name: n.slice(5, -2),
@@ -879,7 +902,7 @@ __installPublicEnv(publicEnvValues)
879
902
  optional: !1
880
903
  });
881
904
  return t;
882
- }, Zt = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), Qt = async (e) => {
905
+ }, Qt = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), $t = async (e) => {
883
906
  let t = h(e);
884
907
  for (let e = 0; e < 4; e++) {
885
908
  let e = p(t, "project.json");
@@ -897,8 +920,8 @@ __installPublicEnv(publicEnvValues)
897
920
  t = n;
898
921
  }
899
922
  return null;
900
- }, $t = async (e) => {
901
- let t = await Qt(e);
923
+ }, en = async (e) => {
924
+ let t = await $t(e);
902
925
  if (!t) return [];
903
926
  let { projectDir: n, manifest: r } = t, i = u(e), a = r.apps ?? {}, o = [];
904
927
  for (let [e, t] of Object.entries(a)) {
@@ -907,23 +930,23 @@ __installPublicEnv(publicEnvValues)
907
930
  if (!T(r)) continue;
908
931
  let a;
909
932
  try {
910
- let { pages: e } = await Q(r);
933
+ let { pages: e } = await $(r);
911
934
  a = e.map((e) => ({
912
935
  pattern: e.pattern,
913
- params: Xt(e.pattern)
936
+ params: Zt(e.pattern)
914
937
  }));
915
938
  } catch {
916
939
  continue;
917
940
  }
918
941
  o.push({
919
- key: Zt(e),
942
+ key: Qt(e),
920
943
  origin: `http://localhost:${t.port}`,
921
944
  ...typeof t.origin == "string" && t.origin.length > 0 ? { prodOrigin: t.origin } : {},
922
945
  routes: a
923
946
  });
924
947
  }
925
948
  return o;
926
- }, en = (e) => {
949
+ }, tn = (e) => {
927
950
  if (e.params.length === 0) return `'${e.pattern}'`;
928
951
  let t = e.pattern;
929
952
  for (let n of e.params) {
@@ -931,21 +954,21 @@ __installPublicEnv(publicEnvValues)
931
954
  t = t.replace(e, r);
932
955
  }
933
956
  return "`" + t + "`";
934
- }, tn = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
957
+ }, nn = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
935
958
  let t = "string";
936
959
  return e.optional ? `readonly ${e.name}?: ${t}` : `readonly ${e.name}: ${t}`;
937
- }).join("; ")} }`, nn = (e, t, n) => {
938
- let r = tn(e), i = en(e), a = t ? "VoltroExternalUrl" : "VoltroRouteUrl", o = t && n ? `${n} + ` : "";
960
+ }).join("; ")} }`, rn = (e, t, n) => {
961
+ let r = nn(e), i = tn(e), a = t ? "VoltroExternalUrl" : "VoltroRouteUrl", o = t && n ? `${n} + ` : "";
939
962
  return e.params.length === 0 ? `() => (${o}${i}) as ${a}` : `({ ${e.params.map((e) => e.name).join(", ")} }: ${r}) => (${o}${i}) as ${a}`;
940
- }, rn = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${nn(e, !1)},`).join("\n")}\n}`, an = (e, t) => {
963
+ }, an = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${rn(e, !1)},`).join("\n")}\n}`, on = (e, t) => {
941
964
  if (e.routes.length === 0) return ` ${e.key}: {} as Record<string, never>,`;
942
- 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)}: ${nn(e, !0, i)},`);
965
+ 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)}: ${rn(e, !0, i)},`);
943
966
  return ` ${e.key}: {\n${a.join("\n")}\n },`;
944
- }, on = async (e) => {
967
+ }, sn = async (e) => {
945
968
  let t = e.pages.map((e) => ({
946
969
  pattern: e.pattern,
947
- params: Xt(e.pattern)
948
- })), n = await $t(e.appRoot), r = [
970
+ params: Zt(e.pattern)
971
+ })), n = await en(e.appRoot), r = [
949
972
  "// THIS FILE IS GENERATED — DO NOT EDIT BY HAND.",
950
973
  "// Re-emitted by `voltro dev` whenever `src/pages/**` changes.",
951
974
  "// Type-safe route builders consumed by <Link to={...}>.",
@@ -954,7 +977,7 @@ __installPublicEnv(publicEnvValues)
954
977
  "",
955
978
  "type EmptyParams = Record<string, never>",
956
979
  ""
957
- ].join("\n"), i = e.mode ?? "dev", a = `${r}\n${`export const routes = ${rn(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => an(e, i)).join("\n")}\n} as const\n`}`, o = p(e.appRoot, ".framework", "routes.generated.ts");
980
+ ].join("\n"), i = e.mode ?? "dev", a = `${r}\n${`export const routes = ${an(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => on(e, i)).join("\n")}\n} as const\n`}`, o = p(e.appRoot, ".framework", "routes.generated.ts");
958
981
  await O.mkdir(d(o), { recursive: !0 });
959
982
  let s = null;
960
983
  try {
@@ -967,37 +990,37 @@ __installPublicEnv(publicEnvValues)
967
990
  path: o,
968
991
  wrote: !0
969
992
  });
970
- }, sn = (e) => {
993
+ }, cn = (e) => {
971
994
  if (e === "" || e === "/") return "/";
972
995
  let t = e.startsWith("/") ? e : `/${e}`;
973
996
  return t.endsWith("/") ? t.slice(0, -1) : t;
974
- }, cn = (e, t) => {
975
- let n = e.endsWith("/") ? e.slice(0, -1) : e, r = sn(t);
997
+ }, ln = (e, t) => {
998
+ let n = e.endsWith("/") ? e.slice(0, -1) : e, r = cn(t);
976
999
  return r === "/" ? `${n}/` : `${n}${r}`;
977
- }, ln = (e, t, n) => {
978
- let r = sn(e);
1000
+ }, un = (e, t, n) => {
1001
+ let r = cn(e);
979
1002
  return t === n ? r : r === "/" ? `/${t}` : `/${t}${r}`;
980
- }, un = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), dn = (e) => {
1003
+ }, dn = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), fn = (e) => {
981
1004
  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) => {
982
1005
  if (!r) return "";
983
- let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${un(n)}" href="${un(cn(t, ln(e, n, i)))}" />`);
984
- return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${un(cn(t, ln(e, i, i)))}" />`), `\n${n.join("\n")}`;
1006
+ let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${dn(n)}" href="${dn(ln(t, un(e, n, i)))}" />`);
1007
+ return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${dn(ln(t, un(e, i, i)))}" />`), `\n${n.join("\n")}`;
985
1008
  };
986
1009
  for (let e of n) {
987
1010
  let n = r ?? [i];
988
1011
  for (let r of n) {
989
- let n = cn(t, ln(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${un(e.lastmod)}</lastmod>` : "";
990
- o.set(n, ` <url>\n <loc>${un(n)}</loc>${a}${s(e.path)}\n </url>`);
1012
+ let n = ln(t, un(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${dn(e.lastmod)}</lastmod>` : "";
1013
+ o.set(n, ` <url>\n <loc>${dn(n)}</loc>${a}${s(e.path)}\n </url>`);
991
1014
  }
992
1015
  }
993
1016
  let c = [...o.keys()].sort().map((e) => o.get(e)).join("\n");
994
1017
  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`;
995
- }, fn = (e) => {
1018
+ }, pn = (e) => {
996
1019
  if (!e.indexable) return "User-agent: *\nDisallow: /\n";
997
1020
  let t = ["User-agent: *", "Allow: /"];
998
- for (let n of e.disallow ?? []) t.push(`Disallow: ${sn(n)}`);
1021
+ for (let n of e.disallow ?? []) t.push(`Disallow: ${cn(n)}`);
999
1022
  return e.sitemapUrl && t.push("", `Sitemap: ${e.sitemapUrl}`), `${t.join("\n")}\n`;
1000
- }, pn = 256, mn = (e = pn) => {
1023
+ }, mn = 256, hn = (e = mn) => {
1001
1024
  let t = [], n = /* @__PURE__ */ new Set();
1002
1025
  return {
1003
1026
  emit(r, i) {
@@ -1020,17 +1043,17 @@ __installPublicEnv(publicEnvValues)
1020
1043
  return t.slice();
1021
1044
  }
1022
1045
  };
1023
- }, hn = (e) => `event: ${e.channel}\ndata: ${JSON.stringify(e)}\n\n`, gn = () => `: keep-alive ${Date.now()}\n\n`, _n = 8e3, vn = (e, t = _n) => {
1024
- let n = bn(e);
1046
+ }, gn = (e) => `event: ${e.channel}\ndata: ${JSON.stringify(e)}\n\n`, _n = () => `: keep-alive ${Date.now()}\n\n`, vn = 8e3, yn = (e, t = vn) => {
1047
+ let n = xn(e);
1025
1048
  return n.length <= t ? n : `${n.slice(0, t)}\n… [voltro] truncated at ${t} chars (${n.length} total)`;
1026
- }, yn = 4, bn = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
1049
+ }, bn = 4, xn = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
1027
1050
  if (e instanceof Error) {
1028
1051
  let r = e.stack ?? `${e.name}: ${e.message}`;
1029
1052
  if (n.has(e)) return `${r}\n [cycle]`;
1030
1053
  n.add(e);
1031
1054
  let i = [];
1032
- if (t < yn) if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${xn(bn(a, t + 1, n))}`);
1033
- else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${xn(bn(e.cause, t + 1, n))}`);
1055
+ if (t < bn) if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${Sn(xn(a, t + 1, n))}`);
1056
+ else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${Sn(xn(e.cause, t + 1, n))}`);
1034
1057
  return r + i.join("");
1035
1058
  }
1036
1059
  try {
@@ -1038,30 +1061,30 @@ __installPublicEnv(publicEnvValues)
1038
1061
  } catch {
1039
1062
  return "[unstringifiable thrown value]";
1040
1063
  }
1041
- }, xn = (e) => {
1064
+ }, Sn = (e) => {
1042
1065
  let t = e.split("\n");
1043
1066
  return t.length <= 3 ? e : `${t.slice(0, 3).join("\n")}\n …`;
1044
- }, Sn = {
1067
+ }, Cn = {
1045
1068
  trace: 0,
1046
1069
  debug: 1,
1047
1070
  info: 2,
1048
1071
  warn: 3,
1049
1072
  error: 4,
1050
1073
  fatal: 5
1051
- }, Cn = 2e3, wn = 200, Tn = class {
1074
+ }, wn = 2e3, Tn = 200, En = class {
1052
1075
  capacity;
1053
1076
  buffer = [];
1054
- constructor(e = Cn) {
1077
+ constructor(e = wn) {
1055
1078
  this.capacity = e;
1056
1079
  }
1057
1080
  append(e) {
1058
1081
  this.buffer.push(e), this.buffer.length > this.capacity && this.buffer.shift();
1059
1082
  }
1060
1083
  query(e = {}) {
1061
- let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? wn, this.capacity), i = e.minLevel === void 0 ? Sn.trace : Sn[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
1084
+ let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? Tn, this.capacity), i = e.minLevel === void 0 ? Cn.trace : Cn[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
1062
1085
  for (let e = this.buffer.length - 1; e >= 0 && l.length < r; e--) {
1063
1086
  let r = this.buffer[e];
1064
- r.ts < t || r.ts > n || Sn[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);
1087
+ r.ts < t || r.ts > n || Cn[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);
1065
1088
  }
1066
1089
  return l.reverse();
1067
1090
  }
@@ -1074,7 +1097,7 @@ __installPublicEnv(publicEnvValues)
1074
1097
  clear() {
1075
1098
  this.buffer = [];
1076
1099
  }
1077
- }, En = null, Dn = () => (En === null && (En = new Tn()), En), On = (e) => {
1100
+ }, Dn = null, On = () => (Dn === null && (Dn = new En()), Dn), kn = (e) => {
1078
1101
  if (typeof e == "string") return e;
1079
1102
  if (e instanceof Error) return e.message;
1080
1103
  try {
@@ -1082,28 +1105,28 @@ __installPublicEnv(publicEnvValues)
1082
1105
  } catch {
1083
1106
  return String(e);
1084
1107
  }
1085
- }, kn = 8e3, An = (e) => typeof e == "string" ? e.length <= kn ? e : `${e.slice(0, kn)}… [voltro: truncated]` : typeof e != "object" || !e ? e : vn(e, kn), jn = (e, t) => {
1108
+ }, An = 8e3, jn = (e) => typeof e == "string" ? e.length <= An ? e : `${e.slice(0, An)}… [voltro: truncated]` : typeof e != "object" || !e ? e : yn(e, An), Mn = (e, t) => {
1086
1109
  try {
1087
1110
  e(...t);
1088
1111
  } catch (n) {
1089
1112
  try {
1090
- e(...t.map(An)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${kn} chars per argument.`);
1113
+ e(...t.map(jn)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${An} chars per argument.`);
1091
1114
  } catch {
1092
1115
  e(`[voltro] a console.error argument could not be formatted at all (${t.length} arg(s)).`);
1093
1116
  }
1094
1117
  }
1095
- }, Mn = (e) => {
1118
+ }, Nn = (e) => {
1096
1119
  let t = {
1097
1120
  log: console.log.bind(console),
1098
1121
  info: console.info.bind(console),
1099
1122
  warn: console.warn.bind(console),
1100
1123
  error: console.error.bind(console),
1101
1124
  debug: console.debug.bind(console)
1102
- }, n = Dn(), r = !1, i = (i) => (...a) => {
1103
- if (jn(t[i], a), !r) {
1125
+ }, n = On(), r = !1, i = (i) => (...a) => {
1126
+ if (Mn(t[i], a), !r) {
1104
1127
  r = !0;
1105
1128
  try {
1106
- let t = a.length > 0 ? On(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = F();
1129
+ let t = a.length > 0 ? kn(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = F();
1107
1130
  e.emit("log", {
1108
1131
  level: i,
1109
1132
  message: r,
@@ -1161,24 +1184,24 @@ __installPublicEnv(publicEnvValues)
1161
1184
  return () => {
1162
1185
  console.log = t.log, console.info = t.info, console.warn = t.warn, console.error = t.error, console.debug = t.debug, a();
1163
1186
  };
1164
- }, Nn = 2e3, Pn = 8, Fn = 1e3, In = 200, J = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, Ln = (e) => {
1187
+ }, Pn = 2e3, Fn = 8, In = 1e3, Ln = 200, Y = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, Rn = (e) => {
1165
1188
  switch (e) {
1166
1189
  case "error": return "error";
1167
1190
  case "warn": return "warn";
1168
1191
  case "debug": return "debug";
1169
1192
  default: return "info";
1170
1193
  }
1171
- }, Rn = S({ scope: "client" }), zn = (e, t) => {
1194
+ }, zn = S({ scope: "client" }), Bn = (e, t) => {
1172
1195
  let n;
1173
1196
  try {
1174
1197
  n = JSON.parse(e);
1175
1198
  } catch {
1176
- return Bn(400, { error: "invalid JSON body" });
1199
+ return Vn(400, { error: "invalid JSON body" });
1177
1200
  }
1178
- if (typeof n != "object" || !n) return Bn(400, { error: "body must be a JSON object" });
1201
+ if (typeof n != "object" || !n) return Vn(400, { error: "body must be a JSON object" });
1179
1202
  let r = n;
1180
- if (!Array.isArray(r.entries)) return Bn(400, { error: "entries must be an array" });
1181
- let i = typeof r.app == "string" ? J(r.app, 120) : void 0, a = typeof r.page == "string" ? J(r.page, 200) : void 0, o = typeof r.ua == "string" ? J(r.ua, 200) : void 0, s = r.entries.slice(0, In), c = 0;
1203
+ if (!Array.isArray(r.entries)) return Vn(400, { error: "entries must be an array" });
1204
+ let i = typeof r.app == "string" ? Y(r.app, 120) : void 0, a = typeof r.page == "string" ? Y(r.page, 200) : void 0, o = typeof r.ua == "string" ? Y(r.ua, 200) : void 0, s = r.entries.slice(0, Ln), c = 0;
1182
1205
  for (let e of s) {
1183
1206
  if (typeof e != "object" || !e) continue;
1184
1207
  let n = e;
@@ -1189,7 +1212,7 @@ __installPublicEnv(publicEnvValues)
1189
1212
  "warn",
1190
1213
  "error",
1191
1214
  "debug"
1192
- ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = J(n.message, Nn), u = Array.isArray(n.args) ? n.args.slice(0, Pn).filter((e) => typeof e == "string").map((e) => J(e, Fn)) : void 0, d = typeof n.stack == "string" ? J(n.stack, Nn) : void 0;
1215
+ ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = Y(n.message, Pn), u = Array.isArray(n.args) ? n.args.slice(0, Fn).filter((e) => typeof e == "string").map((e) => Y(e, In)) : void 0, d = typeof n.stack == "string" ? Y(n.stack, Pn) : void 0;
1193
1216
  t.emit("clientLog", {
1194
1217
  ts: s,
1195
1218
  level: r,
@@ -1204,35 +1227,35 @@ __installPublicEnv(publicEnvValues)
1204
1227
  ...i === void 0 ? {} : { app: i },
1205
1228
  ...a === void 0 ? {} : { page: a },
1206
1229
  ...u !== void 0 && u.length > 0 ? { args: u } : {}
1207
- }, p = Ln(r);
1208
- (p === "error" || p === "warn") && d !== void 0 ? Rn[p](l, f, { stack: d }) : Rn[p](l, {
1230
+ }, p = Rn(r);
1231
+ (p === "error" || p === "warn") && d !== void 0 ? zn[p](l, f, { stack: d }) : zn[p](l, {
1209
1232
  ...f,
1210
1233
  ...d === void 0 ? {} : { stack: d }
1211
1234
  }), c++;
1212
1235
  }
1213
- return Bn(202, {
1236
+ return Vn(202, {
1214
1237
  accepted: c,
1215
1238
  dropped: r.entries.length - c
1216
1239
  });
1217
- }, Bn = (e, t) => ({
1240
+ }, Vn = (e, t) => ({
1218
1241
  status: e,
1219
1242
  contentType: "application/json; charset=utf-8",
1220
1243
  body: JSON.stringify(t)
1221
- }), Vn = "/_voltro/inspect/clientLog", Hn = [
1244
+ }), Hn = "/_voltro/inspect/clientLog", Un = [
1222
1245
  "trace",
1223
1246
  "debug",
1224
1247
  "info",
1225
1248
  "warn",
1226
1249
  "error",
1227
1250
  "fatal"
1228
- ], Un = {
1251
+ ], Wn = {
1229
1252
  trace: "TRACE",
1230
1253
  debug: "DEBUG",
1231
1254
  info: "INFO ",
1232
1255
  warn: "WARN ",
1233
1256
  error: "ERROR",
1234
1257
  fatal: "FATAL"
1235
- }, Wn = (e) => Hn.includes(e), Gn = (e, t, n = {}) => {
1258
+ }, Gn = (e) => Un.includes(e), Kn = (e, t, n = {}) => {
1236
1259
  if (c()) return {
1237
1260
  status: 503,
1238
1261
  contentType: "application/json",
@@ -1263,7 +1286,7 @@ __installPublicEnv(publicEnvValues)
1263
1286
  Number.isFinite(e) && e > 0 && (o.max = Math.floor(e));
1264
1287
  }
1265
1288
  let f = a.get("level");
1266
- f !== null && Wn(f) && (o.minLevel = f);
1289
+ f !== null && Gn(f) && (o.minLevel = f);
1267
1290
  let p = a.get("source");
1268
1291
  (p === "server" || p === "client") && (o.source = p);
1269
1292
  let m = a.get("scope");
@@ -1276,7 +1299,7 @@ __installPublicEnv(publicEnvValues)
1276
1299
  if ((a.get("format") ?? "json") === "text") return {
1277
1300
  status: 200,
1278
1301
  contentType: "text/plain; charset=utf-8",
1279
- body: _.map(Kn).join("\n") + (_.length > 0 ? "\n" : "")
1302
+ body: _.map(qn).join("\n") + (_.length > 0 ? "\n" : "")
1280
1303
  };
1281
1304
  let v = {
1282
1305
  capturedAt: Date.now(),
@@ -1290,40 +1313,40 @@ __installPublicEnv(publicEnvValues)
1290
1313
  contentType: "application/json; charset=utf-8",
1291
1314
  body: JSON.stringify(v)
1292
1315
  };
1293
- }, Kn = (e) => {
1294
- 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 = Jn(e.fields);
1295
- return `${n}:${r}:${i}.${a} ${Un[e.level]} ${o} ${e.message}${s}`;
1296
- }, qn = 80, Jn = (e) => {
1316
+ }, qn = (e) => {
1317
+ 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 = Yn(e.fields);
1318
+ return `${n}:${r}:${i}.${a} ${Wn[e.level]} ${o} ${e.message}${s}`;
1319
+ }, Jn = 80, Yn = (e) => {
1297
1320
  let t = Object.entries(e);
1298
1321
  if (t.length === 0) return "";
1299
1322
  let n = [];
1300
1323
  for (let [e, r] of t) {
1301
1324
  if (r === void 0) continue;
1302
- let t = Yn(r);
1325
+ let t = Xn(r);
1303
1326
  n.push(`${e}=${t}`);
1304
1327
  }
1305
1328
  return n.length > 0 ? " " + n.join(" ") : "";
1306
- }, Yn = (e) => {
1329
+ }, Xn = (e) => {
1307
1330
  if (typeof e == "string") {
1308
- let t = e.length > qn ? e.slice(0, qn) + "…" : e;
1331
+ let t = e.length > Jn ? e.slice(0, Jn) + "…" : e;
1309
1332
  return /[\s=]/.test(t) ? `"${t.replace(/"/g, "\\\"")}"` : t;
1310
1333
  }
1311
1334
  if (e === null) return "null";
1312
1335
  if (typeof e == "number" || typeof e == "boolean") return String(e);
1313
1336
  try {
1314
1337
  let t = JSON.stringify(e);
1315
- return t.length > qn ? t.slice(0, qn) + "…" : t;
1338
+ return t.length > Jn ? t.slice(0, Jn) + "…" : t;
1316
1339
  } catch {
1317
1340
  return "[unserialisable]";
1318
1341
  }
1319
- }, Xn = "/_voltro/inspect/logs", Zn = (e, t, n) => {
1342
+ }, Zn = "/_voltro/inspect/logs", Qn = (e, t, n) => {
1320
1343
  if (t.headers.authorization !== void 0) return !1;
1321
1344
  let { token: r } = n;
1322
1345
  if (r === void 0 || r === "" || !n.isLoopback(n.target)) return !1;
1323
1346
  e.setHeader("authorization", `Bearer ${r}`);
1324
1347
  let i = n.writeToken;
1325
1348
  return i !== void 0 && i !== "" && t.headers["x-voltro-inspect-write"] === void 0 && e.setHeader("x-voltro-inspect-write", i), !0;
1326
- }, Qn = [{
1349
+ }, $n = [{
1327
1350
  match: (e) => typeof e == "string" && e.startsWith("[BABEL] Note: The code generator has deoptimised"),
1328
1351
  handle: (e, t) => {
1329
1352
  let n = e[0], r = n.match(/deoptimised the styling of (.+?) as it exceeds the max of (\d+\w*B)\.?/);
@@ -1335,13 +1358,13 @@ __installPublicEnv(publicEnvValues)
1335
1358
  });
1336
1359
  } else t.info(n);
1337
1360
  }
1338
- }], $n = () => {
1361
+ }], er = () => {
1339
1362
  let e = {
1340
1363
  warn: console.warn.bind(console),
1341
1364
  error: console.error.bind(console)
1342
1365
  }, t = S({ scope: "babel" }), n = !1, r = (r) => (...i) => {
1343
1366
  if (!n) {
1344
- for (let e of Qn) if (e.match(i[0])) {
1367
+ for (let e of $n) if (e.match(i[0])) {
1345
1368
  n = !0;
1346
1369
  try {
1347
1370
  e.handle(i, t);
@@ -1356,7 +1379,7 @@ __installPublicEnv(publicEnvValues)
1356
1379
  return console.warn = r("warn"), console.error = r("error"), () => {
1357
1380
  console.warn = e.warn, console.error = e.error;
1358
1381
  };
1359
- }, er = {
1382
+ }, tr = {
1360
1383
  loader: "it runs on the server, and the router caches its result per route + params",
1361
1384
  renderMode: "it picks the server render strategy",
1362
1385
  dynamic: "it picks the server render strategy",
@@ -1367,7 +1390,7 @@ __installPublicEnv(publicEnvValues)
1367
1390
  cacheInvalidatesOn: "it wires this page into the ISR cache invalidator",
1368
1391
  interactive: "it decides how much client JS the server ships",
1369
1392
  tenantAware: "it is part of the server-side cache key"
1370
- }, tr = Object.keys(er), nr = (e) => t.test(e), rr = (e) => e.replace(/page\.tsx$/, "page.test.tsx"), ir = "virtual:voltro-route-refresh", ar = `\0${ir}`, or = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, sr = () => `
1393
+ }, nr = Object.keys(tr), rr = (e) => t.test(e), ir = (e) => e.replace(/page\.tsx$/, "page.test.tsx"), ar = "virtual:voltro-route-refresh", or = `\0${ar}`, sr = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, cr = () => `
1371
1394
  // GENERATED by @voltro/cli — the \`voltro dev\` route Fast Refresh runtime.
1372
1395
 
1373
1396
  /** Mirrors react-refresh's own \`isLikelyComponentType\` closely enough for the
@@ -1396,11 +1419,11 @@ const stableForm = (value) => {
1396
1419
  * readers (\`build.ts\` prerender, \`webDev.ts\` dev SSR, \`start.ts\`). A change to
1397
1420
  * one of THESE cannot be hot-applied: the server already ran with the old
1398
1421
  * value. Everything else a page exports is plain client-side data. */
1399
- const serverRelevantExports = ${JSON.stringify(tr)}
1422
+ const serverRelevantExports = ${JSON.stringify(nr)}
1400
1423
 
1401
1424
  /** Name → the server step that already consumed it, so the reload message can
1402
1425
  * say WHY rather than just WHAT. Injected from the same single source. */
1403
- const serverExportEffect = ${JSON.stringify(er)}
1426
+ const serverExportEffect = ${JSON.stringify(tr)}
1404
1427
 
1405
1428
  /** The reason \`name\` forces a reload, for the console line. */
1406
1429
  export const serverEffectOf = (name) =>
@@ -1443,7 +1466,7 @@ export const routeUpdateNeedsReload = (prevExports, nextExports) => {
1443
1466
  const previousHook = globalThis.__getReactRefreshIgnoredExports
1444
1467
  globalThis.__getReactRefreshIgnoredExports = (args) =>
1445
1468
  ignoredExports.get(args.id) ?? previousHook?.(args) ?? []
1446
- `, cr = (e) => `
1469
+ `, lr = (e) => `
1447
1470
  if (import.meta.hot) {
1448
1471
  // Self-import to read our OWN exports, the same technique the react plugin
1449
1472
  // uses; the namespace is only complete after evaluation, hence the promise.
@@ -1470,57 +1493,57 @@ import {
1470
1493
  registerRouteModule as __voltro_registerRouteModule,
1471
1494
  routeUpdateNeedsReload as __voltro_routeUpdateNeedsReload,
1472
1495
  serverEffectOf as __voltro_serverEffect,
1473
- } from '${ir}'
1474
- `, lr = (e) => e.replace(/\\/g, "/"), ur = (e, t) => {
1475
- let [i = "", a] = lr(e).split("?");
1476
- if (!i.endsWith(".tsx") || a !== void 0 && or.test(a)) return !1;
1477
- let o = lr(t).replace(/\/$/, "");
1496
+ } from '${ar}'
1497
+ `, ur = (e) => e.replace(/\\/g, "/"), dr = (e, t) => {
1498
+ let [i = "", a] = ur(e).split("?");
1499
+ if (!i.endsWith(".tsx") || a !== void 0 && sr.test(a)) return !1;
1500
+ let o = ur(t).replace(/\/$/, "");
1478
1501
  return i.startsWith(`${o}/`) ? r.test(i) || n.has(i.slice(i.lastIndexOf("/") + 1)) : !1;
1479
- }, dr = (e, t, n) => ur(t, n) ? `${e}${cr(lr(t).split("?")[0] ?? t)}` : null, fr = (e) => ({
1502
+ }, fr = (e, t, n) => dr(t, n) ? `${e}${lr(ur(t).split("?")[0] ?? t)}` : null, pr = (e) => ({
1480
1503
  name: "voltro:route-fast-refresh",
1481
1504
  enforce: "pre",
1482
- resolveId: (e) => e === "virtual:voltro-route-refresh" ? ar : void 0,
1483
- load: (e) => e === ar ? sr() : void 0,
1505
+ resolveId: (e) => e === "virtual:voltro-route-refresh" ? or : void 0,
1506
+ load: (e) => e === or ? cr() : void 0,
1484
1507
  transform: (t, n, r) => {
1485
1508
  if (r?.ssr === !0) return null;
1486
- let i = dr(t, n, e);
1509
+ let i = fr(t, n, e);
1487
1510
  return i === null ? null : {
1488
1511
  code: i,
1489
1512
  map: null
1490
1513
  };
1491
1514
  }
1492
- }), pr = [
1515
+ }), mr = [
1493
1516
  "static",
1494
1517
  "spa",
1495
1518
  "ssr",
1496
1519
  "isr"
1497
- ], mr = (e) => typeof e == "string" && pr.includes(e), hr = pr.map((e) => `'${e}'`).join(" | "), gr = (e, t) => `[voltro] ${e}: unknown renderMode '${t}'.\n Valid values: ${hr}.${t === "client" || t === "csr" || t === "browser" ? "\n A page that renders only in the browser is 'spa': it is skipped by the prerender and mounts on the client. If its route has a layout, that layout still renders server-side as an SSR shell." : t === "server" || t === "dynamic" ? "\n A page rendered per request is 'ssr'." : t === "ssg" || t === "prerender" ? "\n A page rendered once at build time is 'static' (the default)." : ""}`, _r = class extends Error {
1520
+ ], hr = (e) => typeof e == "string" && mr.includes(e), gr = mr.map((e) => `'${e}'`).join(" | "), _r = (e, t) => `[voltro] ${e}: unknown renderMode '${t}'.\n Valid values: ${gr}.${t === "client" || t === "csr" || t === "browser" ? "\n A page that renders only in the browser is 'spa': it is skipped by the prerender and mounts on the client. If its route has a layout, that layout still renders server-side as an SSR shell." : t === "server" || t === "dynamic" ? "\n A page rendered per request is 'ssr'." : t === "ssg" || t === "prerender" ? "\n A page rendered once at build time is 'static' (the default)." : ""}`, vr = class extends Error {
1498
1521
  page;
1499
1522
  value;
1500
1523
  name = "InvalidRenderModeError";
1501
1524
  constructor(e, t) {
1502
- super(gr(e, t)), this.page = e, this.value = t;
1525
+ super(_r(e, t)), this.page = e, this.value = t;
1503
1526
  }
1504
- }, vr = (e, t = "<page>") => {
1527
+ }, yr = (e, t = "<page>") => {
1505
1528
  if (e.renderMode !== void 0 && e.renderMode !== null) {
1506
- if (!mr(e.renderMode)) throw new _r(t, String(e.renderMode));
1529
+ if (!hr(e.renderMode)) throw new vr(t, String(e.renderMode));
1507
1530
  return e.renderMode;
1508
1531
  }
1509
1532
  return e.dynamic === "force-dynamic" ? "ssr" : (e.dynamic, "static");
1510
- }, yr = (e, t = "<page>") => ({
1511
- renderMode: vr(e, t),
1533
+ }, br = (e, t = "<page>") => ({
1534
+ renderMode: yr(e, t),
1512
1535
  tenantAware: e.tenantAware === !0,
1513
- revalidateMs: lt(e.revalidate),
1514
- staleWhileRevalidateMs: lt(e.staleWhileRevalidate) ?? 0,
1536
+ revalidateMs: J(e.revalidate),
1537
+ staleWhileRevalidateMs: J(e.staleWhileRevalidate) ?? 0,
1515
1538
  cacheInvalidatesOn: Array.isArray(e.cacheInvalidatesOn) ? e.cacheInvalidatesOn : [],
1516
1539
  interactive: e.interactive ?? "full",
1517
1540
  hasLoader: typeof e.loader == "function",
1518
1541
  hasMeta: e.meta != null,
1519
1542
  hasGetStaticPaths: typeof e.getStaticPaths == "function"
1520
- }), br = /export\s+const\s+renderMode\s*(?::[^=]+)?=\s*['"]([^'"]*)['"]/, xr = (e) => br.exec(e)?.[1] ?? null, Sr = /export\s*\{([^}]*)\}\s*from\s*['"]([^'"]+)['"]/g, Cr = (e) => {
1521
- Sr.lastIndex = 0;
1543
+ }), xr = /export\s+const\s+renderMode\s*(?::[^=]+)?=\s*['"]([^'"]*)['"]/, Sr = (e) => xr.exec(e)?.[1] ?? null, Cr = /export\s*\{([^}]*)\}\s*from\s*['"]([^'"]+)['"]/g, wr = (e) => {
1544
+ Cr.lastIndex = 0;
1522
1545
  let t;
1523
- for (; (t = Sr.exec(e)) !== null;) {
1546
+ for (; (t = Cr.exec(e)) !== null;) {
1524
1547
  let e = t[2];
1525
1548
  if (e.startsWith(".")) for (let n of t[1].split(",")) {
1526
1549
  let t = n.lastIndexOf(" as ");
@@ -1528,16 +1551,16 @@ import {
1528
1551
  }
1529
1552
  }
1530
1553
  return null;
1531
- }, wr = /export\s*\{([^}]*)\}/g, Tr = (e) => {
1554
+ }, Tr = /export\s*\{([^}]*)\}/g, Er = (e) => {
1532
1555
  if (/export\s+default\b/.test(e)) return !0;
1533
- wr.lastIndex = 0;
1556
+ Tr.lastIndex = 0;
1534
1557
  let t;
1535
- for (; (t = wr.exec(e)) !== null;) for (let e of t[1].split(",")) {
1558
+ for (; (t = Tr.exec(e)) !== null;) for (let e of t[1].split(",")) {
1536
1559
  let t = e.lastIndexOf(" as ");
1537
1560
  if ((t === -1 ? e : e.slice(t + 4)).trim() === "default") return !0;
1538
1561
  }
1539
1562
  return !1;
1540
- }, Er = async (e, t) => {
1563
+ }, Dr = async (e, t) => {
1541
1564
  let n = (await Promise.all(t.map(async (t) => {
1542
1565
  let n;
1543
1566
  try {
@@ -1545,33 +1568,33 @@ import {
1545
1568
  } catch {
1546
1569
  return null;
1547
1570
  }
1548
- let r = xr(n);
1549
- return r !== null && !mr(r) ? gr(p("src", "pages", t.file), r) : Tr(n) ? null : `${p("src", "pages", t.file)} is a route (a \`page.tsx\` under src/pages/) but exports no default.\n\n A page's default export IS its component — the router has nothing to render without it,\n and the failure would otherwise surface only in \`voltro build\`'s prerender as\n "SSR received a descriptor with no Component", long after the file was written.\n\n Fix: \`export default function Page() { … }\`, or re-export another page's component\n (\`export { default } from '../page'\`). If this file is NOT a route, rename it —\n only the reserved names route, and anything else under src/pages/ is ordinary code\n that may live beside the page that uses it.`;
1571
+ let r = Sr(n);
1572
+ return r !== null && !hr(r) ? _r(p("src", "pages", t.file), r) : Er(n) ? null : `${p("src", "pages", t.file)} is a route (a \`page.tsx\` under src/pages/) but exports no default.\n\n A page's default export IS its component — the router has nothing to render without it,\n and the failure would otherwise surface only in \`voltro build\`'s prerender as\n "SSR received a descriptor with no Component", long after the file was written.\n\n Fix: \`export default function Page() { … }\`, or re-export another page's component\n (\`export { default } from '../page'\`). If this file is NOT a route, rename it —\n only the reserved names route, and anything else under src/pages/ is ordinary code\n that may live beside the page that uses it.`;
1550
1573
  }))).filter((e) => e !== null);
1551
1574
  if (n.length !== 0) throw Error(n.join("\n\n"));
1552
- }, Y = p(L(), ".voltro", "logs"), Dr = () => {
1575
+ }, X = p(L(), ".voltro", "logs"), Or = () => {
1553
1576
  let e = Number(process.env.VOLTRO_LOG_FILE_TTL_MS);
1554
1577
  return Number.isFinite(e) && e > 0 ? e : 3600 * 1e3;
1555
- }, Or = !1, kr = () => {
1556
- if (Or) return;
1557
- Or = !0;
1558
- let e = Date.now() - Dr(), t = [];
1578
+ }, kr = !1, Ar = () => {
1579
+ if (kr) return;
1580
+ kr = !0;
1581
+ let e = Date.now() - Or(), t = [];
1559
1582
  try {
1560
- t = A(Y);
1583
+ t = A(X);
1561
1584
  } catch {
1562
1585
  return;
1563
1586
  }
1564
1587
  for (let n of t) {
1565
1588
  if (!n.endsWith(".log")) continue;
1566
- let t = p(Y, n);
1589
+ let t = p(X, n);
1567
1590
  try {
1568
1591
  j(t).mtimeMs < e && M(t);
1569
1592
  } catch {}
1570
1593
  }
1571
- }, Ar = (e) => e.replace(/[^a-zA-Z0-9._-]/g, "_").slice(0, 80), jr = (e, t) => p(Y, `${Ar(e)}-${t}.log`), Mr = (e) => {
1572
- let t = Ar(e), n = [];
1594
+ }, jr = (e) => e.replace(/[^a-zA-Z0-9._-]/g, "_").slice(0, 80), Mr = (e, t) => p(X, `${jr(e)}-${t}.log`), Nr = (e) => {
1595
+ let t = jr(e), n = [];
1573
1596
  try {
1574
- n = A(Y);
1597
+ n = A(X);
1575
1598
  } catch {
1576
1599
  return;
1577
1600
  }
@@ -1579,19 +1602,19 @@ import {
1579
1602
  if (r.length === 0) return;
1580
1603
  let i, a = -1;
1581
1604
  for (let e of r) {
1582
- let t = p(Y, e);
1605
+ let t = p(X, e);
1583
1606
  try {
1584
1607
  let e = j(t);
1585
1608
  e.mtimeMs > a && (a = e.mtimeMs, i = t);
1586
1609
  } catch {}
1587
1610
  }
1588
1611
  return i;
1589
- }, Nr = (e) => {
1612
+ }, Pr = (e) => {
1590
1613
  try {
1591
- E(Y, { recursive: !0 });
1614
+ E(X, { recursive: !0 });
1592
1615
  } catch {}
1593
- kr();
1594
- let t = jr(e, process.pid), n = D(t, "w"), r = (e) => {
1616
+ Ar();
1617
+ let t = Mr(e, process.pid), n = D(t, "w"), r = (e) => {
1595
1618
  let t = {
1596
1619
  ts: e.ts.getTime(),
1597
1620
  level: e.level,
@@ -1632,7 +1655,7 @@ import {
1632
1655
  a(), o(), process.off("exit", o), process.off("uncaughtException", s), process.off("unhandledRejection", s);
1633
1656
  }
1634
1657
  };
1635
- }, Pr = async (e, t) => {
1658
+ }, Fr = async (e, t) => {
1636
1659
  let n;
1637
1660
  try {
1638
1661
  n = await O.readFile(e, "utf8");
@@ -1646,11 +1669,11 @@ import {
1646
1669
  i.push(t);
1647
1670
  } catch {}
1648
1671
  return t?.max !== void 0 && i.length > t.max ? i.slice(i.length - t.max) : i;
1649
- }, Fr = S({ scope: "voltro:dashboard" }), Ir = R(import.meta.url), Lr = 5179, Rr = (e) => {
1672
+ }, Ir = S({ scope: "voltro:dashboard" }), Lr = R(import.meta.url), Rr = 5179, zr = (e) => {
1650
1673
  let t = process.env.VOLTRO_DASHBOARD_PATH;
1651
1674
  if (t && T(p(h(t), "app.config.ts"))) return h(t);
1652
1675
  try {
1653
- let e = d(Ir.resolve("@voltro/dashboard/package.json"));
1676
+ let e = d(Lr.resolve("@voltro/dashboard/package.json"));
1654
1677
  if (T(p(e, "app.config.ts"))) return e;
1655
1678
  } catch {}
1656
1679
  let n = p("voltro-devtools", "apps", "dashboard"), r = h(e);
@@ -1662,7 +1685,7 @@ import {
1662
1685
  r = t;
1663
1686
  }
1664
1687
  return null;
1665
- }, zr = "VOLTRO_IS_DASHBOARD", Br = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1688
+ }, Br = "VOLTRO_IS_DASHBOARD", Vr = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1666
1689
  let i = pe({
1667
1690
  port: e,
1668
1691
  host: t
@@ -1670,45 +1693,45 @@ import {
1670
1693
  a || (a = !0, i.destroy(), r(e));
1671
1694
  };
1672
1695
  i.once("connect", () => o(!0)), i.once("error", () => o(!1)), setTimeout(() => o(!1), n);
1673
- }), Vr = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), Hr = () => process.env[zr] === "1", Ur = () => process.stdout.isTTY === !0, Wr = p(L(), ".voltro", "dashboard-launch.lock"), Gr = 1e4, Kr = async () => {
1696
+ }), Hr = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), Ur = () => process.env[Br] === "1", Wr = () => process.stdout.isTTY === !0, Gr = p(L(), ".voltro", "dashboard-launch.lock"), Kr = 1e4, qr = async () => {
1674
1697
  try {
1675
- await O.mkdir(d(Wr), { recursive: !0 });
1676
- let e = await O.open(Wr, "wx");
1698
+ await O.mkdir(d(Gr), { recursive: !0 });
1699
+ let e = await O.open(Gr, "wx");
1677
1700
  return await e.write(`${process.pid}\n${Date.now()}\n`), await e.close(), !0;
1678
1701
  } catch {
1679
1702
  try {
1680
- let e = await O.stat(Wr);
1681
- if (Date.now() - e.mtimeMs > Gr) return await O.unlink(Wr).catch(() => void 0), Kr();
1703
+ let e = await O.stat(Gr);
1704
+ if (Date.now() - e.mtimeMs > Kr) return await O.unlink(Gr).catch(() => void 0), qr();
1682
1705
  } catch {}
1683
1706
  return !1;
1684
1707
  }
1685
- }, qr = async () => {
1708
+ }, Jr = async () => {
1686
1709
  try {
1687
- await O.unlink(Wr);
1710
+ await O.unlink(Gr);
1688
1711
  } catch {}
1689
- }, Jr = async (e) => {
1712
+ }, Yr = async (e) => {
1690
1713
  let t = e.port ?? 5179;
1691
- if (Vr()) return {
1714
+ if (Hr()) return {
1692
1715
  status: "skipped",
1693
1716
  reason: "disabled by flag/env",
1694
1717
  port: t
1695
1718
  };
1696
- if (Hr()) return {
1719
+ if (Ur()) return {
1697
1720
  status: "skipped",
1698
1721
  reason: "this process IS the dashboard",
1699
1722
  port: t
1700
1723
  };
1701
- if (!Ur()) return {
1724
+ if (!Wr()) return {
1702
1725
  status: "skipped",
1703
1726
  reason: "stdout is not a TTY (CI/smoke)",
1704
1727
  port: t
1705
1728
  };
1706
- if (!await Kr()) return {
1729
+ if (!await qr()) return {
1707
1730
  status: "skipped",
1708
1731
  reason: "another voltro process is currently launching the dashboard",
1709
1732
  port: t
1710
1733
  };
1711
- if (await Br(t)) return await qr(), {
1734
+ if (await Vr(t)) return await Jr(), {
1712
1735
  status: "already-running",
1713
1736
  port: t
1714
1737
  };
@@ -1725,7 +1748,7 @@ import {
1725
1748
  stdio: "ignore",
1726
1749
  env: {
1727
1750
  ...process.env,
1728
- [zr]: "1",
1751
+ [Br]: "1",
1729
1752
  VOLTRO_DASHBOARD_PORT: String(t)
1730
1753
  }
1731
1754
  });
@@ -1733,22 +1756,22 @@ import {
1733
1756
  if (a.exitCode === null && a.signalCode === null) try {
1734
1757
  a.kill("SIGTERM");
1735
1758
  } catch {}
1736
- }), Fr.info(`auto-launching dashboard at http://localhost:${t}`, {
1759
+ }), Ir.info(`auto-launching dashboard at http://localhost:${t}`, {
1737
1760
  port: t,
1738
1761
  mode: i,
1739
1762
  prebuilt: r
1740
- }), r || Fr.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), Fr.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
1741
- qr();
1763
+ }), r || Ir.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), Ir.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
1764
+ Jr();
1742
1765
  }, 4e3).unref(), {
1743
1766
  status: "launched",
1744
1767
  port: t
1745
1768
  };
1746
- }, Yr = class extends Error {
1769
+ }, Xr = class extends Error {
1747
1770
  _voltroDeferral = !0;
1748
1771
  constructor(e) {
1749
1772
  super(e), this.name = "DeferralNotSupportedError";
1750
1773
  }
1751
- }, Xr = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Zr = (e) => {
1774
+ }, Zr = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Qr = (e) => {
1752
1775
  if (!(e instanceof Error)) return;
1753
1776
  let t = e._voltroControl;
1754
1777
  if (t === "redirect") {
@@ -1770,7 +1793,7 @@ import {
1770
1793
  },
1771
1794
  body: "not found"
1772
1795
  };
1773
- }, Qr = (e) => {
1796
+ }, $r = (e) => {
1774
1797
  let { helpers: t } = e, n = t.prepareDeferredLoaderData(e.loaderData, "page"), r = {}, i = {}, a = {};
1775
1798
  for (let [n, o] of Object.entries(e.segmentLoaderData)) {
1776
1799
  let e = Number(n), s = t.prepareDeferredLoaderData(o, e);
@@ -1785,7 +1808,7 @@ import {
1785
1808
  ...e.layoutShell ? { layoutShell: e.layoutShell } : {}
1786
1809
  });
1787
1810
  } catch (e) {
1788
- throw new Yr(e instanceof Error ? e.message : String(e));
1811
+ throw new Xr(e instanceof Error ? e.message : String(e));
1789
1812
  }
1790
1813
  return {
1791
1814
  loaderData: n.renderData,
@@ -1801,8 +1824,8 @@ import {
1801
1824
  ...Object.keys(a).length > 0 ? { deferredSegmentIds: a } : {}
1802
1825
  }
1803
1826
  };
1804
- }, $r = (e) => {
1805
- let { helpers: t, renderInput: n } = e, r = Qr({
1827
+ }, ei = (e) => {
1828
+ let { helpers: t, renderInput: n } = e, r = $r({
1806
1829
  helpers: t,
1807
1830
  page: e.page,
1808
1831
  pathname: n.pathname,
@@ -1823,19 +1846,19 @@ import {
1823
1846
  stateScript: t.renderRouterStateScript(r.stateInput),
1824
1847
  hasDeferred: r.hasDeferred
1825
1848
  };
1826
- }, ei = (e) => {
1849
+ }, ti = (e) => {
1827
1850
  let { html: t, meta: n } = e.helpers.renderPageToHtml(e.prepared.renderInput);
1828
1851
  return {
1829
1852
  body: t,
1830
1853
  meta: n
1831
1854
  };
1832
- }, ti = (e) => [
1855
+ }, ni = (e) => [
1833
1856
  ...e.extra ?? [],
1834
1857
  e.helpers.renderMetaToHtml(e.meta),
1835
1858
  `<meta name="voltro-interactive" content="${e.interactive}" />`,
1836
1859
  ...e.prepared.hasDeferred ? [e.helpers.renderDeferredRegistryScript()] : [],
1837
1860
  e.prepared.stateScript
1838
- ].filter((e) => e.length > 0).join("\n "), ni = (e) => {
1861
+ ].filter((e) => e.length > 0).join("\n "), ri = (e) => {
1839
1862
  let t = e.indexOf("?");
1840
1863
  return t === -1 ? {
1841
1864
  pathname: e || "/",
@@ -1844,9 +1867,9 @@ import {
1844
1867
  pathname: e.slice(0, t) || "/",
1845
1868
  search: e.slice(t)
1846
1869
  };
1847
- }, ri = /Could not find required `intl` object/, ii = "__voltro_i18n_instances__", ai = (e = globalThis) => {
1870
+ }, ii = /Could not find required `intl` object/, ai = "__voltro_i18n_instances__", oi = (e = globalThis) => {
1848
1871
  try {
1849
- let t = e[ii]?.records;
1872
+ let t = e[ai]?.records;
1850
1873
  return t === void 0 || t.length === 0 ? void 0 : {
1851
1874
  instances: t.length,
1852
1875
  reactIntlCopies: new Set(t.map((e) => e.intlProvider)).size,
@@ -1855,7 +1878,7 @@ import {
1855
1878
  } catch {
1856
1879
  return;
1857
1880
  }
1858
- }, oi = (e, t) => [
1881
+ }, si = (e, t) => [
1859
1882
  "",
1860
1883
  "── voltro diagnosis ───────────────────────────────────────────────────",
1861
1884
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -1873,7 +1896,7 @@ import {
1873
1896
  " versions on disk; this counts instances in the running process, and one",
1874
1897
  " file loaded down two paths is two instances.",
1875
1898
  "───────────────────────────────────────────────────────────────────────"
1876
- ].join("\n"), si = (e, t) => [
1899
+ ].join("\n"), ci = (e, t) => [
1877
1900
  "",
1878
1901
  "── voltro diagnosis ───────────────────────────────────────────────────",
1879
1902
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -1889,7 +1912,7 @@ import {
1889
1912
  " direct import can land on a second copy that this count does not see —",
1890
1913
  " it counts what @voltro/i18n is bound to.",
1891
1914
  "───────────────────────────────────────────────────────────────────────"
1892
- ].join("\n"), ci = (e) => [
1915
+ ].join("\n"), li = (e) => [
1893
1916
  "",
1894
1917
  "── voltro diagnosis ───────────────────────────────────────────────────",
1895
1918
  `${e} DID wrap this render in <I18nProvider> — the framework`,
@@ -1905,29 +1928,29 @@ import {
1905
1928
  " Do NOT use `pnpm ls` to rule that out: it lists versions on disk, and",
1906
1929
  " the duplication here is of module instances in one process.",
1907
1930
  "───────────────────────────────────────────────────────────────────────"
1908
- ].join("\n"), li = (e, t, n, r = ai()) => {
1931
+ ].join("\n"), ui = (e, t, n, r = oi()) => {
1909
1932
  if (!t) return;
1910
1933
  let i = String(e?.message ?? e);
1911
- if (ri.test(i)) return r === void 0 ? ci(n) : r.reactIntlCopies > 1 || r.instances > 1 ? oi(n, r) : si(n, r);
1912
- }, ui = "<div id=\"root\"></div>", di = "<div id=\"root\">", fi = "</div>", pi = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, mi = /\bsrc=["']([^"']+)["']/i, hi = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, gi = (e) => {
1913
- let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(pi, (e) => {
1914
- let r = mi.exec(e)?.[1];
1934
+ if (ii.test(i)) return r === void 0 ? li(n) : r.reactIntlCopies > 1 || r.instances > 1 ? si(n, r) : ci(n, r);
1935
+ }, di = "<div id=\"root\"></div>", fi = "<div id=\"root\">", pi = "</div>", mi = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, hi = /\bsrc=["']([^"']+)["']/i, gi = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, _i = (e) => {
1936
+ let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(mi, (e) => {
1937
+ let r = hi.exec(e)?.[1];
1915
1938
  return r === void 0 || t(r) ? e : (n.push(r), "");
1916
1939
  });
1917
- e.inlineModuleScriptsAsync && (r = r.replace(hi, "<script async$1>"));
1918
- let i = r.indexOf(ui);
1919
- if (i === -1) throw Error(`[voltro] the generated shell has no \`${ui}\` 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.`);
1940
+ e.inlineModuleScriptsAsync && (r = r.replace(gi, "<script async$1>"));
1941
+ let i = r.indexOf(di);
1942
+ if (i === -1) throw Error(`[voltro] the generated shell has no \`${di}\` 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.`);
1920
1943
  return {
1921
- head: `${r.slice(0, i)}${di}`,
1922
- tail: `${fi}${r.slice(i + 21)}`,
1944
+ head: `${r.slice(0, i)}${fi}`,
1945
+ tail: `${pi}${r.slice(i + 21)}`,
1923
1946
  bootstrapModules: n
1924
1947
  };
1925
- }, _i = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), vi = (e) => _i(e.head, e.headInjection).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${e.htmlLang}"`), yi = (e) => {
1948
+ }, vi = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), yi = (e) => vi(e.head, e.headInjection).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${e.htmlLang}"`), bi = (e) => {
1926
1949
  let { res: t, shell: n, htmlLang: r, headInjection: i } = e, a = null, o = !1, s = !1, c = () => {
1927
1950
  if (s || !o || a === null) return;
1928
1951
  s = !0, t.statusCode = e.statusCode ?? 200;
1929
1952
  for (let [n, r] of Object.entries(e.headers ?? {})) t.setHeader(n, r);
1930
- t.flushHeaders?.(), t.write(vi({
1953
+ t.flushHeaders?.(), t.write(yi({
1931
1954
  head: n.head,
1932
1955
  headInjection: i(a.meta),
1933
1956
  htmlLang: r
@@ -1957,16 +1980,16 @@ import {
1957
1980
  return;
1958
1981
  }
1959
1982
  c();
1960
- }, bi = (e) => Array.isArray(e.preload) && e.preload.length > 0, xi = (e, t) => typeof e == "string" ? {
1983
+ }, xi = (e) => Array.isArray(e.preload) && e.preload.length > 0, Si = (e, t) => typeof e == "string" ? {
1961
1984
  tag: e,
1962
1985
  input: {}
1963
1986
  } : {
1964
1987
  tag: e.tag,
1965
1988
  input: e.input?.(t) ?? {}
1966
- }, Si = async (e) => {
1989
+ }, Ci = async (e) => {
1967
1990
  let { pageMod: t, params: n, query: r, apiName: i, seed: a, onError: o } = e;
1968
- if (bi(t) && !(r === void 0 || i === void 0)) for (let e of t.preload) {
1969
- let { tag: t, input: s } = xi(e, n);
1991
+ if (xi(t) && !(r === void 0 || i === void 0)) for (let e of t.preload) {
1992
+ let { tag: t, input: s } = Si(e, n);
1970
1993
  try {
1971
1994
  a(i, t, s, await r(t, s));
1972
1995
  } catch (e) {
@@ -1976,14 +1999,14 @@ import {
1976
1999
  }, e);
1977
2000
  }
1978
2001
  }
1979
- }, X = S({ scope: "voltro:dev:web" }), Ci = S({ scope: "vite" }), wi = await (async () => {
2002
+ }, Z = S({ scope: "voltro:dev:web" }), wi = S({ scope: "vite" }), Ti = await (async () => {
1980
2003
  try {
1981
2004
  let e = p(d(g(import.meta.url)), "..", "package.json"), t = await O.readFile(e, "utf8");
1982
2005
  return JSON.parse(t).version ?? "0.0.0";
1983
2006
  } catch {
1984
2007
  return "0.0.0";
1985
2008
  }
1986
- })(), Ti = async () => {
2009
+ })(), Ei = async () => {
1987
2010
  try {
1988
2011
  let e = d(g(import.meta.url)), t = h(e, "..", "..", "devtools");
1989
2012
  if (T(p(t, "package.json"))) return t;
@@ -1992,7 +2015,7 @@ import {
1992
2015
  } catch {
1993
2016
  return null;
1994
2017
  }
1995
- }, Ei = (e, t) => e.disableDevtools || !t ? [] : [
2018
+ }, Di = (e, t) => e.disableDevtools || !t ? [] : [
1996
2019
  "",
1997
2020
  "// Dev-only in-page devtools overlay. The `import.meta.env.DEV` guard is a",
1998
2021
  "// compile-time constant, so prod builds strip this whole `if` block — the",
@@ -2002,12 +2025,12 @@ import {
2002
2025
  " await import('@voltro/devtools/styles.css')",
2003
2026
  " Devtools = (await import('@voltro/devtools')).VoltroDevtools",
2004
2027
  "}"
2005
- ], Di = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], Oi = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], ki = (e) => e.sentry ? [
2028
+ ], Oi = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], ki = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], Ai = (e) => e.sentry ? [
2006
2029
  "",
2007
2030
  "// Browser-side Sentry (frontend half of the deep integration). Errors +",
2008
2031
  "// browser rpc spans flow to Sentry, sharing the server transactions' trace.",
2009
2032
  `await initSentryBrowser(${JSON.stringify(e.sentry)})`
2010
- ] : [], Ai = (e) => e.env ? ["import './env.public'"] : [], ji = (e) => {
2033
+ ] : [], ji = (e) => e.env ? ["import './env.public'"] : [], Mi = (e) => {
2011
2034
  let t = [], n = h(e);
2012
2035
  for (;;) {
2013
2036
  T(p(n, "pnpm-workspace.yaml")) && t.push(n);
@@ -2016,14 +2039,14 @@ import {
2016
2039
  n = e;
2017
2040
  }
2018
2041
  return t;
2019
- }, Mi = nr, Ni = (e) => {
2042
+ }, Ni = rr, Pi = (e) => {
2020
2043
  if (/\/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(?:react|react-dom|scheduler)\//.test(e)) return "react";
2021
2044
  let t = /\/([^/]+)\.island\.tsx?$/.exec(e);
2022
2045
  if (t) return `island-${t[1]}`;
2023
- }, Pi = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, Fi = (e) => e.startsWith("(") && e.endsWith(")"), Ii = (e) => e.filter((e) => !Fi(e)), Li = (e) => {
2024
- let t = e.replace(r, "").split("/").filter(Boolean).filter((e) => !Fi(e));
2046
+ }, Fi = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, Ii = (e) => e.startsWith("(") && e.endsWith(")"), Li = (e) => e.filter((e) => !Ii(e)), Ri = (e) => {
2047
+ let t = e.replace(r, "").split("/").filter(Boolean).filter((e) => !Ii(e));
2025
2048
  return t.length === 0 ? "/" : "/" + t.join("/");
2026
- }, Ri = (e) => `${e.replace(r, "").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`, Z = (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}`, Q = async (e) => {
2049
+ }, zi = (e) => `${e.replace(r, "").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`, Q = (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}`, $ = async (e) => {
2027
2050
  let t = [], i = [], a = async (e, o) => {
2028
2051
  let s = [];
2029
2052
  try {
@@ -2031,17 +2054,17 @@ import {
2031
2054
  } catch {
2032
2055
  return;
2033
2056
  }
2034
- let c = s.filter((e) => e.isDirectory()).map((e) => e.name).sort(), l = s.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !Mi(e.name)).map((e) => e.name).sort(), u = new Set(l), d = o.join("/");
2057
+ let c = s.filter((e) => e.isDirectory()).map((e) => e.name).sort(), l = s.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !Ni(e.name)).map((e) => e.name).sort(), u = new Set(l), d = o.join("/");
2035
2058
  if (l.some((e) => n.has(e))) {
2036
2059
  let t = u.has("layout.tsx"), r = !1;
2037
2060
  if (t) try {
2038
2061
  let t = await O.readFile(p(e, "layout.tsx"), "utf8");
2039
- r = Pi.test(t);
2062
+ r = Fi.test(t);
2040
2063
  } catch {}
2041
2064
  i.push({
2042
2065
  dir: d,
2043
2066
  chain: o,
2044
- contributesToUrl: o.length === 0 || !Fi(o[o.length - 1]),
2067
+ contributesToUrl: o.length === 0 || !Ii(o[o.length - 1]),
2045
2068
  hasLayout: t,
2046
2069
  hasLayoutLoader: r,
2047
2070
  hasError: u.has("error.tsx"),
@@ -2055,8 +2078,8 @@ import {
2055
2078
  let n = d ? `${d}/${e}` : e;
2056
2079
  t.push({
2057
2080
  file: n,
2058
- pattern: Li(n),
2059
- ident: Ri(n),
2081
+ pattern: Ri(n),
2082
+ ident: zi(n),
2060
2083
  dirChain: o
2061
2084
  });
2062
2085
  }
@@ -2075,14 +2098,14 @@ import {
2075
2098
  dirs: s,
2076
2099
  orphanedSpecials: c
2077
2100
  };
2078
- }, zi = (e, t) => {
2101
+ }, Bi = (e, t) => {
2079
2102
  let n = [];
2080
2103
  for (let r = 0; r <= t.length; r++) {
2081
2104
  let i = t.slice(0, r).join("/"), a = e.find((e) => e.dir === i);
2082
2105
  a && n.push(a);
2083
2106
  }
2084
2107
  return n;
2085
- }, Bi = async (e) => {
2108
+ }, Vi = async (e) => {
2086
2109
  let { entries: t, loadLayout: n, loadError: r, loadPending: i, ctx: a } = e, o = {};
2087
2110
  return {
2088
2111
  chain: await Promise.all(t.map(async (e, t) => {
@@ -2105,10 +2128,10 @@ import {
2105
2128
  })),
2106
2129
  segmentLoaderData: o
2107
2130
  };
2108
- }, Vi = (e) => {
2109
- let t = Ii(e);
2131
+ }, Hi = (e) => {
2132
+ let t = Li(e);
2110
2133
  return t.length === 0 ? "" : "/" + t.join("/");
2111
- }, Hi = [
2134
+ }, Ui = [
2112
2135
  "// Hot-reload bridge: keep SSR-injected <link rel=\"stylesheet\"> tags",
2113
2136
  "// in sync with Vite's CSS HMR. Without this, edits to .css files",
2114
2137
  "// only update the JS-injected <style> overlay; the underlying <link>",
@@ -2201,7 +2224,7 @@ import {
2201
2224
  " _vdtErrorStart('Build error')",
2202
2225
  " })",
2203
2226
  "}"
2204
- ].join("\n"), Ui = (e) => {
2227
+ ].join("\n"), Wi = (e) => {
2205
2228
  let t = [], n = 0, r = e.split("/").filter(Boolean), i = [];
2206
2229
  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, "\\$&"));
2207
2230
  let a = i.join("/");
@@ -2210,8 +2233,8 @@ import {
2210
2233
  paramNames: t,
2211
2234
  priority: n
2212
2235
  };
2213
- }, Wi = (e) => e.map((e) => {
2214
- let { regex: t, paramNames: n, priority: r } = Ui(e.pattern);
2236
+ }, Gi = (e) => e.map((e) => {
2237
+ let { regex: t, paramNames: n, priority: r } = Wi(e.pattern);
2215
2238
  return {
2216
2239
  pattern: e.pattern,
2217
2240
  file: e.file,
@@ -2220,7 +2243,7 @@ import {
2220
2243
  paramNames: n,
2221
2244
  priority: r
2222
2245
  };
2223
- }).slice().sort((e, t) => e.priority - t.priority), Gi = (e, t) => {
2246
+ }).slice().sort((e, t) => e.priority - t.priority), Ki = (e, t) => {
2224
2247
  for (let n of t) {
2225
2248
  let t = n.regex.exec(e);
2226
2249
  if (!t) continue;
@@ -2232,7 +2255,7 @@ import {
2232
2255
  };
2233
2256
  }
2234
2257
  return null;
2235
- }, Ki = async (e, t) => {
2258
+ }, qi = async (e, t) => {
2236
2259
  let n = e;
2237
2260
  for (;;) {
2238
2261
  let e = p(n, "node_modules", t);
@@ -2246,7 +2269,7 @@ import {
2246
2269
  if (r === n) return null;
2247
2270
  n = r;
2248
2271
  }
2249
- }, qi = async (e) => {
2272
+ }, Ji = async (e) => {
2250
2273
  try {
2251
2274
  let t = await import(_(p(e, "app.config.ts")).href), n = t.default?.port, r = typeof n == "number" ? n : 4e3, i = t.default?.transport?.wsPath, a = typeof i == "string" && i.startsWith("/") ? i : void 0;
2252
2275
  return a ? {
@@ -2255,7 +2278,7 @@ import {
2255
2278
  } : { port: r };
2256
2279
  } catch {}
2257
2280
  return { port: 4e3 };
2258
- }, Ji = (e, t) => ({
2281
+ }, Yi = (e, t) => ({
2259
2282
  name: e,
2260
2283
  pkg: t.package,
2261
2284
  browserWsUrl: t.url,
@@ -2263,7 +2286,7 @@ import {
2263
2286
  ...t.serverUrl ? { serverOrigin: t.serverUrl } : {},
2264
2287
  ...t.headers ? { headers: t.headers } : {},
2265
2288
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
2266
- }), Yi = (e, t, n) => {
2289
+ }), Xi = (e, t, n) => {
2267
2290
  let r = t.transport?.wsPath ?? n.wsPath;
2268
2291
  return {
2269
2292
  name: e,
@@ -2275,7 +2298,7 @@ import {
2275
2298
  ...t.headers ? { headers: t.headers } : {},
2276
2299
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
2277
2300
  };
2278
- }, Xi = (e) => {
2301
+ }, Zi = (e) => {
2279
2302
  let t = /* @__PURE__ */ new Map();
2280
2303
  for (let n of e) {
2281
2304
  if (n.proxyTarget === void 0) continue;
@@ -2283,43 +2306,43 @@ import {
2283
2306
  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>.`);
2284
2307
  t.set(n.browserWsUrl, n.name);
2285
2308
  }
2286
- }, Zi = async (e, t) => {
2309
+ }, Qi = async (e, t) => {
2287
2310
  let n = Object.entries(t.apis ?? {}), r = [];
2288
2311
  for (let [t, i] of n) {
2289
2312
  if (i.url) {
2290
- r.push(Ji(t, i));
2313
+ r.push(Yi(t, i));
2291
2314
  continue;
2292
2315
  }
2293
- let n = await Ki(e, i.package);
2316
+ let n = await qi(e, i.package);
2294
2317
  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.`);
2295
- r.push(Yi(t, i, await qi(n)));
2318
+ r.push(Xi(t, i, await Ji(n)));
2296
2319
  }
2297
- return Xi(r), r;
2298
- }, Qi = (e) => {
2320
+ return Zi(r), r;
2321
+ }, $i = (e) => {
2299
2322
  if (!(!/^wss?:\/\//.test(e) && !/^https?:\/\//.test(e))) try {
2300
2323
  let t = new URL(e);
2301
2324
  return t.protocol = t.protocol === "wss:" || t.protocol === "https:" ? "https:" : "http:", `${t.protocol}//${t.host}`;
2302
2325
  } catch {
2303
2326
  return;
2304
2327
  }
2305
- }, $i = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, ea = (e) => process.env[$i(e)] ?? process.env.VOLTRO_API_ORIGIN, ta = (e, t) => {
2328
+ }, ea = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, ta = (e) => process.env[ea(e)] ?? process.env.VOLTRO_API_ORIGIN, na = (e, t) => {
2306
2329
  if (!e) return;
2307
- let n = ea(e.name) ?? e.serverOrigin;
2330
+ let n = ta(e.name) ?? e.serverOrigin;
2308
2331
  if (n) {
2309
- let e = Qi(n);
2332
+ let e = $i(n);
2310
2333
  if (e) return e;
2311
2334
  }
2312
2335
  if (t?.allowDevProxy && e.proxyTarget) {
2313
- let t = Qi(e.proxyTarget);
2336
+ let t = $i(e.proxyTarget);
2314
2337
  if (t) return t;
2315
2338
  }
2316
- if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return Qi(e.browserWsUrl);
2317
- }, na = (e, t, n) => {
2339
+ if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return $i(e.browserWsUrl);
2340
+ }, ra = (e, t, n) => {
2318
2341
  if (!e) {
2319
2342
  if (n?.apiName === void 0) return;
2320
2343
  let e = n.apiName;
2321
2344
  return async () => {
2322
- 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 ${$i(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.`);
2345
+ 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 ${ea(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.`);
2323
2346
  };
2324
2347
  }
2325
2348
  return async (r, i) => {
@@ -2341,7 +2364,7 @@ import {
2341
2364
  });
2342
2365
  } catch (t) {
2343
2366
  let i = t?.cause?.code ?? String(t?.message ?? t);
2344
- throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${$i(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 });
2367
+ throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${ea(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 });
2345
2368
  }
2346
2369
  if (!o.ok) throw Error(`[loader.query] ${r}: HTTP ${o.status} ${await o.text()}`);
2347
2370
  let s = await o.json();
@@ -2359,8 +2382,8 @@ import {
2359
2382
  }
2360
2383
  if (u) return l;
2361
2384
  };
2362
- }, $ = async (e, t, n, r = {}) => {
2363
- let i = t.title ?? t.name ?? "app", a = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", o = T(p(e, "node_modules", "@voltro", "devtools", "package.json")) || await Ti() !== null, s = t.theme === "system" ? [
2385
+ }, ia = async (e, t, n, r = {}) => {
2386
+ let i = t.title ?? t.name ?? "app", a = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", o = T(p(e, "node_modules", "@voltro", "devtools", "package.json")) || await Ei() !== null, s = t.theme === "system" ? [
2364
2387
  " <script>",
2365
2388
  " (function () {",
2366
2389
  " var root = document.documentElement",
@@ -2398,9 +2421,9 @@ import {
2398
2421
  " </body>",
2399
2422
  "</html>",
2400
2423
  ""
2401
- ].join("\n"), l = p(e, "src", "pages"), { pages: u, dirs: d, orphanedSpecials: f } = await Q(l);
2402
- await Er(l, u);
2403
- for (let e of f) X.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.`);
2424
+ ].join("\n"), l = p(e, "src", "pages"), { pages: u, dirs: d, orphanedSpecials: f } = await $(l);
2425
+ await Dr(l, u);
2426
+ for (let e of f) Z.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.`);
2404
2427
  let m = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppGroup`, h = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppDescriptors`, g = n.map((e) => `import { appGroup as ${m(e.name)}, appDescriptors as ${h(e.name)} } from '${e.pkg}/rpcGroup'`);
2405
2428
  n.some((e) => e.hasAuthHeaders) && (g.push("import __voltroAppConfig from '../app.config'"), g.push("const __voltroAuthHeaders = (__voltroAppConfig as { readonly apis?: Record<string, { readonly authHeaders?: () => Record<string, string> | Promise<Record<string, string>> }> }).apis"));
2406
2429
  let _ = n.map((e) => {
@@ -2411,16 +2434,16 @@ import {
2411
2434
  let n = u.map((e) => ` ${JSON.stringify(e.pattern)}: () => import('../src/pages/${e.file}'),`), r = [];
2412
2435
  for (let e of d) {
2413
2436
  let t = e.dir === "" ? "../src/pages" : `../src/pages/${e.dir}`;
2414
- e.hasLayout && e.hasLayoutLoader ? r.push(`import * as ${Z(e.dir, "Layout")}Mod from '${t}/layout.tsx'`) : e.hasLayout && r.push(`import ${Z(e.dir, "Layout")} from '${t}/layout.tsx'`), e.hasError && r.push(`import ${Z(e.dir, "Error")} from '${t}/error.tsx'`), e.hasPending && r.push(`import ${Z(e.dir, "Pending")} from '${t}/loading.tsx'`), e.hasNotFound && r.push(`import ${Z(e.dir, "NotFound")} from '${t}/not-found.tsx'`);
2437
+ e.hasLayout && e.hasLayoutLoader ? r.push(`import * as ${Q(e.dir, "Layout")}Mod from '${t}/layout.tsx'`) : e.hasLayout && r.push(`import ${Q(e.dir, "Layout")} from '${t}/layout.tsx'`), e.hasError && r.push(`import ${Q(e.dir, "Error")} from '${t}/error.tsx'`), e.hasPending && r.push(`import ${Q(e.dir, "Pending")} from '${t}/loading.tsx'`), e.hasNotFound && r.push(`import ${Q(e.dir, "NotFound")} from '${t}/not-found.tsx'`);
2415
2438
  }
2416
2439
  let i = u.map((e) => {
2417
- let t = zi(d, e.dirChain).map((e) => {
2440
+ let t = Bi(d, e.dirChain).map((e) => {
2418
2441
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
2419
2442
  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(", ")} }`;
2420
2443
  }).join(",\n");
2421
2444
  return ` makePageRoute(${JSON.stringify(e.pattern)}, ${t.length > 0 ? `[\n${t},\n ]` : "undefined"}),`;
2422
2445
  }), a = d.filter((e) => e.hasNotFound).map((e) => {
2423
- let t = Vi(e.chain), n = zi(d, e.chain).map((e) => {
2446
+ let t = Hi(e.chain), n = Bi(d, e.chain).map((e) => {
2424
2447
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
2425
2448
  return e.hasLayout && t.push(`Layout: refs.layouts[${n}]`), e.hasError && t.push(`Error: refs.errors[${n}]`), ` { ${t.join(", ")} }`;
2426
2449
  }).join(",\n"), r = n.length > 0 ? `\n chain: [\n${n},\n ],` : "";
@@ -2428,23 +2451,23 @@ import {
2428
2451
  }), s = [], c = [], l = [], f = [], m = [], h = [];
2429
2452
  for (let e of d) {
2430
2453
  let t = e.dir === "" ? "../src/pages/layout.tsx" : `../src/pages/${e.dir}/layout.tsx`, n = e.dir === "" ? "../src/pages/error.tsx" : `../src/pages/${e.dir}/error.tsx`, r = e.dir === "" ? "../src/pages/loading.tsx" : `../src/pages/${e.dir}/loading.tsx`, i = e.dir === "" ? "../src/pages/not-found.tsx" : `../src/pages/${e.dir}/not-found.tsx`, a = JSON.stringify(e.dir);
2431
- e.hasLayout && e.hasLayoutLoader ? (c.push(` ${a}: ${Z(e.dir, "Layout")}Mod.default,`), l.push(` ${a}: ${Z(e.dir, "Layout")}Mod.loader,`), s.push({
2454
+ e.hasLayout && e.hasLayoutLoader ? (c.push(` ${a}: ${Q(e.dir, "Layout")}Mod.default,`), l.push(` ${a}: ${Q(e.dir, "Layout")}Mod.loader,`), s.push({
2432
2455
  relPath: t,
2433
2456
  kind: "layout",
2434
2457
  slotKey: e.dir
2435
- })) : e.hasLayout && (c.push(` ${a}: ${Z(e.dir, "Layout")},`), s.push({
2458
+ })) : e.hasLayout && (c.push(` ${a}: ${Q(e.dir, "Layout")},`), s.push({
2436
2459
  relPath: t,
2437
2460
  kind: "layout",
2438
2461
  slotKey: e.dir
2439
- })), e.hasError && (f.push(` ${a}: ${Z(e.dir, "Error")},`), s.push({
2462
+ })), e.hasError && (f.push(` ${a}: ${Q(e.dir, "Error")},`), s.push({
2440
2463
  relPath: n,
2441
2464
  kind: "error",
2442
2465
  slotKey: e.dir
2443
- })), e.hasPending && (m.push(` ${a}: ${Z(e.dir, "Pending")},`), s.push({
2466
+ })), e.hasPending && (m.push(` ${a}: ${Q(e.dir, "Pending")},`), s.push({
2444
2467
  relPath: r,
2445
2468
  kind: "pending",
2446
2469
  slotKey: e.dir
2447
- })), e.hasNotFound && (h.push(` ${a}: ${Z(e.dir, "NotFound")},`), s.push({
2470
+ })), e.hasNotFound && (h.push(` ${a}: ${Q(e.dir, "NotFound")},`), s.push({
2448
2471
  relPath: i,
2449
2472
  kind: "notFound",
2450
2473
  slotKey: e.dir
@@ -2459,7 +2482,7 @@ import {
2459
2482
  let n = JSON.stringify(e.slotKey);
2460
2483
  return e.kind === "page" ? ` if (newMods[${t}] && refs.pages[${n}] !== undefined) { refs.pages[${n}] = newMods[${t}]; changed = true }` : ` if (newMods[${t}]?.default) { refs.${e.kind === "layout" ? "layouts" : e.kind === "error" ? "errors" : e.kind === "pending" ? "pendings" : "notFounds"}[${n}] = newMods[${t}].default;${e.kind === "layout" ? ` refs.layoutLoaders[${n}] = newMods[${t}].loader;` : ""} changed = true }`;
2461
2484
  }), C = t.locales ?? [], w = C.length > 0 && C.every((t) => T(p(e, "src", "locales", `${t}.ts`)) || T(p(e, "src", "locales", `${t}.tsx`))), E = w, D = t.defaultLocale ?? C[0] ?? "en";
2462
- if (C.length > 0 && !w && X.info(`i18n: locales [${C.join(", ")}] declared with no src/locales/<code>.ts — using them for <html lang> and the resolved locale only. Add the catalogs to get <I18nProvider> wired, or keep your own i18n stack.`), C.length > 0 && !C.includes(D)) throw Error(`[voltro dev] app.config.ts: defaultLocale '${D}' must be one of locales [${C.join(", ")}]`);
2485
+ if (C.length > 0 && !w && Z.info(`i18n: locales [${C.join(", ")}] declared with no src/locales/<code>.ts — using them for <html lang> and the resolved locale only. Add the catalogs to get <I18nProvider> wired, or keep your own i18n stack.`), C.length > 0 && !C.includes(D)) throw Error(`[voltro dev] app.config.ts: defaultLocale '${D}' must be one of locales [${C.join(", ")}]`);
2463
2486
  let O = E ? [
2464
2487
  "import { I18nProvider } from '@voltro/i18n'",
2465
2488
  "import { resolveLocale } from '@voltro/i18n/server'",
@@ -2676,14 +2699,14 @@ import {
2676
2699
  "// resolved apis map. Side-effect only — no local component definitions —",
2677
2700
  "// so downstream invalidations (user page edits) terminate at app.tsx.",
2678
2701
  "",
2679
- ...Ai(t),
2702
+ ...ji(t),
2680
2703
  "import { mount } from '@voltro/web'",
2681
2704
  ...g,
2682
2705
  "import { App } from './app'",
2683
2706
  "import { preloadCurrentRoute } from './routeTable'",
2684
- ...Oi(t),
2685
- ...Ei(t, o),
2686
2707
  ...ki(t),
2708
+ ...Di(t, o),
2709
+ ...Ai(t),
2687
2710
  "",
2688
2711
  "// Preload the current route's page chunk BEFORE hydration so the first",
2689
2712
  "// client render matches the SSG/SSR-prerendered HTML. Without it, a lazy",
@@ -2700,10 +2723,10 @@ import {
2700
2723
  " apis: {",
2701
2724
  ..._,
2702
2725
  " },",
2703
- ...Di(t, o),
2726
+ ...Oi(t, o),
2704
2727
  "})",
2705
2728
  "",
2706
- Hi
2729
+ Ui
2707
2730
  ].join("\n");
2708
2731
  } else v = "", y = "", b = [
2709
2732
  "// GENERATED BY `voltro dev` — do not edit; will be overwritten on next boot.",
@@ -2711,25 +2734,25 @@ import {
2711
2734
  "// and calls mount(). Side-effect only, no component definitions, so the",
2712
2735
  "// user's component file remains the Fast Refresh boundary.",
2713
2736
  "",
2714
- ...Ai(t),
2737
+ ...ji(t),
2715
2738
  "import { mount } from '@voltro/web'",
2716
2739
  ...g,
2717
2740
  "import App from '../src/App'",
2718
- ...Oi(t),
2719
- ...Ei(t, o),
2720
2741
  ...ki(t),
2742
+ ...Di(t, o),
2743
+ ...Ai(t),
2721
2744
  "",
2722
2745
  "mount(App, {",
2723
2746
  " apis: {",
2724
2747
  ..._,
2725
2748
  " },",
2726
- ...Di(t, o),
2749
+ ...Oi(t, o),
2727
2750
  "})",
2728
2751
  "",
2729
- Hi
2752
+ Ui
2730
2753
  ].join("\n");
2731
2754
  let x = p(e, ".framework");
2732
- await O.mkdir(x, { recursive: !0 }), t.env ? await rt(x, r) : await O.rm(p(x, "env.public.ts"), { force: !0 }), await O.writeFile(p(x, "index.html"), c, "utf8"), await O.writeFile(p(x, "main.tsx"), b, "utf8"), v ? (await O.writeFile(p(x, "app.tsx"), v, "utf8"), await O.writeFile(p(x, "routeTable.ts"), y, "utf8")) : (await O.rm(p(x, "app.tsx"), { force: !0 }), await O.rm(p(x, "routeTable.ts"), { force: !0 }));
2755
+ await O.mkdir(x, { recursive: !0 }), t.env ? await at(x, r) : await O.rm(p(x, "env.public.ts"), { force: !0 }), await O.writeFile(p(x, "index.html"), c, "utf8"), await O.writeFile(p(x, "main.tsx"), b, "utf8"), v ? (await O.writeFile(p(x, "app.tsx"), v, "utf8"), await O.writeFile(p(x, "routeTable.ts"), y, "utf8")) : (await O.rm(p(x, "app.tsx"), { force: !0 }), await O.rm(p(x, "routeTable.ts"), { force: !0 }));
2733
2756
  let S = p(e, ".gitignore"), C = "";
2734
2757
  try {
2735
2758
  C = await O.readFile(S, "utf8");
@@ -2740,65 +2763,65 @@ import {
2740
2763
  try {
2741
2764
  await O.appendFile(S, `${e}${D.join("\n")}\n`, "utf8");
2742
2765
  } catch (e) {
2743
- X.warn(`could not add ${D.join(", ")} to ${S} — add it by hand so the generated directory stays out of git. The build is unaffected.`, { reason: e?.message ?? String(e) });
2766
+ Z.warn(`could not add ${D.join(", ")} to ${S} — add it by hand so the generated directory stays out of git. The build is unaffected.`, { reason: e?.message ?? String(e) });
2744
2767
  }
2745
2768
  }
2746
- }, ra = async (e, t) => {
2769
+ }, aa = async (e, t) => {
2747
2770
  try {
2748
2771
  let n = p(d(e), "project.json");
2749
2772
  if (!T(n)) return;
2750
2773
  let r = await O.readFile(n, "utf8"), i = JSON.parse(r).apps ?? {}, a = e.split("/").filter(Boolean).pop() ?? "", o = [];
2751
2774
  for (let [e, n] of Object.entries(i)) e !== a && n.port === t && o.push(e);
2752
2775
  if (o.length === 0) return;
2753
- X.warn("sibling app(s) claim the same port — only one boots", {
2776
+ Z.warn("sibling app(s) claim the same port — only one boots", {
2754
2777
  port: t,
2755
2778
  conflicts: o,
2756
2779
  projectJson: n
2757
2780
  });
2758
2781
  } catch {}
2759
- }, ia = (e) => p(e, ".framework", "dist", "server", "appConfig.js"), aa = async (e, t = {}) => {
2760
- let n = ia(e), r = t.preferSource !== !0 && T(n) ? n : p(e, "app.config.ts");
2782
+ }, oa = (e) => p(e, ".framework", "dist", "server", "appConfig.js"), sa = async (e, t = {}) => {
2783
+ let n = oa(e), r = t.preferSource !== !0 && T(n) ? n : p(e, "app.config.ts");
2761
2784
  try {
2762
2785
  let e = (await import(_(r).href)).default;
2763
2786
  return typeof e == "object" && e && "type" in e && e.type === "web" ? e : null;
2764
2787
  } catch {
2765
2788
  return null;
2766
2789
  }
2767
- }, oa = async (e) => {
2768
- let t = await aa(e, { preferSource: !0 });
2790
+ }, ca = async (e) => {
2791
+ let t = await sa(e, { preferSource: !0 });
2769
2792
  if (!t) return {
2770
2793
  ran: !1,
2771
2794
  exitCode: 0
2772
2795
  };
2773
- $n();
2774
- let n = mn();
2775
- Mn(n), X.info("booting voltro dev (web)", { app: t.name ?? "(unnamed)" }), Lt(e, X);
2776
- let r = await Zi(e, t);
2777
- for (let e of r) X.info("api wired", {
2796
+ er();
2797
+ let n = hn();
2798
+ Nn(n), Z.info("booting voltro dev (web)", { app: t.name ?? "(unnamed)" }), Rt(e, Z);
2799
+ let r = await Qi(e, t);
2800
+ for (let e of r) Z.info("api wired", {
2778
2801
  name: e.name,
2779
2802
  pkg: e.pkg,
2780
2803
  ...e.proxyTarget ? { proxyTo: e.proxyTarget } : { directWs: e.browserWsUrl }
2781
2804
  });
2782
- Ne(e).then((e) => {
2805
+ Fe(e).then((e) => {
2783
2806
  for (let t of e.files) if (t.action === "created") {
2784
2807
  let e = t.path.split("/").pop() ?? t.path;
2785
- X.info(`${e} seeded`, { path: t.path });
2808
+ Z.info(`${e} seeded`, { path: t.path });
2786
2809
  }
2787
2810
  }).catch(() => {});
2788
- let { resolved: d } = await it({
2811
+ let { resolved: d } = await ot({
2789
2812
  rawEnv: t.env,
2790
2813
  appType: "web",
2791
2814
  root: e,
2792
- log: X,
2815
+ log: Z,
2793
2816
  generateTypes: !0
2794
2817
  }), f = d.publicValues;
2795
- await $(e, t, r, f), X.debug("generated framework entry files", { files: [
2818
+ await ia(e, t, r, f), Z.debug("generated framework entry files", { files: [
2796
2819
  "index.html",
2797
2820
  ".framework/main.tsx",
2798
2821
  ...t.env ? [".framework/env.public.ts"] : []
2799
2822
  ] });
2800
- let g = process.env.VOLTRO_IS_DASHBOARD === "1" && process.env.VOLTRO_DASHBOARD_PORT ? Number(process.env.VOLTRO_DASHBOARD_PORT) : t.port ?? 5173, _ = t.name ?? "unnamed", v = qe("web", _, g), y = Nr(_);
2801
- await Ge({
2823
+ let g = process.env.VOLTRO_IS_DASHBOARD === "1" && process.env.VOLTRO_DASHBOARD_PORT ? Number(process.env.VOLTRO_DASHBOARD_PORT) : t.port ?? 5173, _ = t.name ?? "unnamed", v = Ye("web", _, g), y = Pr(_);
2824
+ await qe({
2802
2825
  id: v,
2803
2826
  name: _,
2804
2827
  kind: "web",
@@ -2806,22 +2829,22 @@ import {
2806
2829
  pid: process.pid,
2807
2830
  status: "booting",
2808
2831
  logFile: y.path
2809
- }).catch(() => {}), await ra(e, g);
2810
- let { pages: b, dirs: x } = await Q(p(e, "src", "pages")), S = {
2832
+ }).catch(() => {}), await aa(e, g);
2833
+ let { pages: b, dirs: x } = await $(p(e, "src", "pages")), S = {
2811
2834
  dirs: x,
2812
- ssrRoutes: Wi(b)
2835
+ ssrRoutes: Gi(b)
2813
2836
  }, w = x.map((e) => ({
2814
2837
  dir: e.dir,
2815
2838
  hasLayout: e.hasLayout,
2816
2839
  hasError: e.hasError,
2817
2840
  hasPending: e.hasPending,
2818
2841
  hasNotFound: e.hasNotFound
2819
- })), E = await on({
2842
+ })), E = await sn({
2820
2843
  appRoot: e,
2821
2844
  pages: b
2822
2845
  });
2823
- E.wrote && X.debug("routes codegen wrote", { path: m(e, E.path) });
2824
- let D = await Ze("vite", () => import("vite")), k = (await import("@vitejs/plugin-react")).default, A = (await import("@tailwindcss/vite")).default, j = p(e, ".framework"), M = p(e, "src"), N = /* @__PURE__ */ new Set([
2846
+ E.wrote && Z.debug("routes codegen wrote", { path: m(e, E.path) });
2847
+ let D = await $e("vite", () => import("vite")), k = (await import("@vitejs/plugin-react")).default, A = (await import("@tailwindcss/vite")).default, j = p(e, ".framework"), M = p(e, "src"), N = /* @__PURE__ */ new Set([
2825
2848
  ".framework",
2826
2849
  "node_modules",
2827
2850
  "dist",
@@ -2845,7 +2868,7 @@ import {
2845
2868
  ...r.devDependencies
2846
2869
  });
2847
2870
  await Promise.all(i.map(async (n) => {
2848
- let r = await Ki(e, n);
2871
+ let r = await qi(e, n);
2849
2872
  if (!r) return;
2850
2873
  let i = p(r, "src");
2851
2874
  try {
@@ -2857,18 +2880,18 @@ import {
2857
2880
  }, P = p(e, "src", "pages"), F = (e) => e.endsWith(".tsx") && (e === P || e.startsWith(P + "/")), I = (e) => e === P || e.startsWith(P + "/"), te = async (n) => {
2858
2881
  try {
2859
2882
  let i = Date.now();
2860
- await $(e, t, r, f);
2861
- let { pages: a, dirs: o } = await Q(P);
2862
- await on({
2883
+ await ia(e, t, r, f);
2884
+ let { pages: a, dirs: o } = await $(P);
2885
+ await sn({
2863
2886
  appRoot: e,
2864
2887
  pages: a
2865
- }), S.dirs = o, S.ssrRoutes = Wi(a), X.info("page tree regenerated", {
2888
+ }), S.dirs = o, S.ssrRoutes = Gi(a), Z.info("page tree regenerated", {
2866
2889
  reason: n,
2867
2890
  ms: Date.now() - i,
2868
2891
  routes: S.ssrRoutes.length
2869
2892
  });
2870
2893
  } catch (e) {
2871
- X.error("page tree regen failed", { reason: n }, e);
2894
+ Z.error("page tree regen failed", { reason: n }, e);
2872
2895
  }
2873
2896
  }, L = {
2874
2897
  name: "framework:regenerate-on-page-tree-change",
@@ -2900,7 +2923,7 @@ import {
2900
2923
  }, z = t, ie = h(R), B = {
2901
2924
  name: "framework:watch-app-config",
2902
2925
  async configureServer(t) {
2903
- t.watcher.add(R), X.info("watching app.config.ts for changes", { path: m(e, R) });
2926
+ t.watcher.add(R), Z.info("watching app.config.ts for changes", { path: m(e, R) });
2904
2927
  let n = async () => {
2905
2928
  try {
2906
2929
  try {
@@ -2908,9 +2931,9 @@ import {
2908
2931
  e && t.moduleGraph.invalidateModule(e);
2909
2932
  } catch {}
2910
2933
  let e = (await t.ssrLoadModule(R, { fixStacktrace: !0 })).default;
2911
- return typeof e == "object" && e && "type" in e && e.type === "web" ? e : (X.warn("app.config.ts re-load returned wrong shape", { hasDefault: e !== void 0 }), null);
2934
+ return typeof e == "object" && e && "type" in e && e.type === "web" ? e : (Z.warn("app.config.ts re-load returned wrong shape", { hasDefault: e !== void 0 }), null);
2912
2935
  } catch (e) {
2913
- return X.warn("app.config.ts re-load failed — ignoring this change", {}, e), null;
2936
+ return Z.warn("app.config.ts re-load failed — ignoring this change", {}, e), null;
2914
2937
  }
2915
2938
  }, r = null, i = () => {
2916
2939
  r && clearTimeout(r), r = setTimeout(() => {
@@ -2919,20 +2942,20 @@ import {
2919
2942
  }, a = async () => {
2920
2943
  let r = await n();
2921
2944
  if (!r) {
2922
- X.info("app.config.ts onConfigChange: load returned null — skipping");
2945
+ Z.info("app.config.ts onConfigChange: load returned null — skipping");
2923
2946
  return;
2924
2947
  }
2925
- if (X.info("app.config.ts onConfigChange: loaded", {
2948
+ if (Z.info("app.config.ts onConfigChange: loaded", {
2926
2949
  theme: r.theme,
2927
2950
  port: r.port,
2928
2951
  name: r.name
2929
2952
  }), JSON.stringify(r) === JSON.stringify(z)) {
2930
- X.info("app.config.ts onConfigChange: parsed config unchanged — skipping (no-op edit?)");
2953
+ Z.info("app.config.ts onConfigChange: parsed config unchanged — skipping (no-op edit?)");
2931
2954
  return;
2932
2955
  }
2933
2956
  let i = re(z, r);
2934
2957
  if (i.length > 0) {
2935
- X.warn("app.config.ts changed — hard restart required", { fields: i });
2958
+ Z.warn("app.config.ts changed — hard restart required", { fields: i });
2936
2959
  try {
2937
2960
  await t.close();
2938
2961
  } catch {}
@@ -2946,37 +2969,37 @@ import {
2946
2969
  process.on("SIGINT", r), process.on("SIGTERM", a), e.on("exit", (e, t) => {
2947
2970
  process.off("SIGINT", r), process.off("SIGTERM", a), t ? process.kill(process.pid, t) : process.exit(e ?? 0);
2948
2971
  }), e.on("error", (e) => {
2949
- X.error("restart spawn failed", {}, e), process.exit(1);
2972
+ Z.error("restart spawn failed", {}, e), process.exit(1);
2950
2973
  });
2951
2974
  return;
2952
2975
  }
2953
2976
  try {
2954
2977
  let n = Date.now();
2955
- await $(e, r, await Zi(e, r)), z = r, t.ws && t.ws.send({
2978
+ await ia(e, r, await Qi(e, r)), z = r, t.ws && t.ws.send({
2956
2979
  type: "full-reload",
2957
2980
  path: "*"
2958
- }), X.info("app.config.ts soft-regen", {
2981
+ }), Z.info("app.config.ts soft-regen", {
2959
2982
  ms: Date.now() - n,
2960
2983
  reload: "full"
2961
2984
  });
2962
2985
  } catch (e) {
2963
- X.error("app.config.ts soft-regen failed", {}, e);
2986
+ Z.error("app.config.ts soft-regen failed", {}, e);
2964
2987
  }
2965
2988
  }, o = (e) => u(e) === "app.config.ts" ? e === R || h(e) === ie : !1;
2966
2989
  t.watcher.on("change", (e) => {
2967
- o(e) && (X.info("app.config.ts change event (chokidar)", { file: e }), i());
2990
+ o(e) && (Z.info("app.config.ts change event (chokidar)", { file: e }), i());
2968
2991
  }), t.watcher.on("add", (e) => {
2969
- o(e) && (X.info("app.config.ts add event (chokidar)", { file: e }), i());
2992
+ o(e) && (Z.info("app.config.ts add event (chokidar)", { file: e }), i());
2970
2993
  });
2971
2994
  try {
2972
2995
  let { watchFile: e } = await import("node:fs");
2973
2996
  e(R, { interval: 500 }, (e, t) => {
2974
- e.mtimeMs !== t.mtimeMs && (X.info("app.config.ts change event (poll)", { mtime: e.mtimeMs }), i());
2975
- }), X.info("app.config.ts polling watcher attached", { intervalMs: 500 });
2997
+ e.mtimeMs !== t.mtimeMs && (Z.info("app.config.ts change event (poll)", { mtime: e.mtimeMs }), i());
2998
+ }), Z.info("app.config.ts polling watcher attached", { intervalMs: 500 });
2976
2999
  } catch (e) {
2977
- X.warn("app.config.ts polling watcher could not attach", {}, e);
3000
+ Z.warn("app.config.ts polling watcher could not attach", {}, e);
2978
3001
  }
2979
- vt(ht, X, {
3002
+ yt(gt, Z, {
2980
3003
  root: e,
2981
3004
  onBeforeRestart: () => t.close()
2982
3005
  });
@@ -2992,7 +3015,7 @@ import {
2992
3015
  let n = /* @__PURE__ */ new Map();
2993
3016
  for (let i of r) {
2994
3017
  if (!i.proxyTarget) continue;
2995
- let r = await Ki(e, i.pkg);
3018
+ let r = await qi(e, i.pkg);
2996
3019
  if (!r) continue;
2997
3020
  let a = p(r, "rpcGroup.generated.ts");
2998
3021
  try {
@@ -3018,14 +3041,14 @@ import {
3018
3041
  i !== t && (n.set(e, i), r = e);
3019
3042
  }
3020
3043
  if (r !== null) {
3021
- a = !0, X.info(`rpcGroup changed (${m(e, r)}) — re-bundling the api client + reloading (descriptor edits propagate automatically; no manual restart needed)`);
3044
+ a = !0, Z.info(`rpcGroup changed (${m(e, r)}) — re-bundling the api client + reloading (descriptor edits propagate automatically; no manual restart needed)`);
3022
3045
  try {
3023
3046
  await O.rm(p(j, ".vite", "deps"), {
3024
3047
  recursive: !0,
3025
3048
  force: !0
3026
3049
  }), await t.restart(!0);
3027
3050
  } catch (e) {
3028
- a = !1, X.error("rpcGroup re-optimize failed", {}, e);
3051
+ a = !1, Z.error("rpcGroup re-optimize failed", {}, e);
3029
3052
  }
3030
3053
  }
3031
3054
  }, s = (e) => {
@@ -3037,7 +3060,7 @@ import {
3037
3060
  }
3038
3061
  }, H = {}, le = (e) => (t) => {
3039
3062
  t.on("proxyReq", (t, n) => {
3040
- Zn(t, n, {
3063
+ Qn(t, n, {
3041
3064
  target: e,
3042
3065
  token: process.env.VOLTRO_INSPECT_TOKEN,
3043
3066
  writeToken: process.env.VOLTRO_INSPECT_WRITE_TOKEN,
@@ -3063,14 +3086,14 @@ import {
3063
3086
  }
3064
3087
  for (let [e, n] of Object.entries(t.proxies ?? {})) {
3065
3088
  if (H[e]) {
3066
- X.warn("user proxy ignored — prefix already claimed by an api ws proxy", { prefix: e });
3089
+ Z.warn("user proxy ignored — prefix already claimed by an api ws proxy", { prefix: e });
3067
3090
  continue;
3068
3091
  }
3069
3092
  H[e] = {
3070
3093
  target: n.target,
3071
3094
  changeOrigin: n.changeOrigin ?? !0,
3072
3095
  ...n.rewrite === void 0 ? {} : { rewrite: (t) => t.replace(RegExp(`^${e}`), n.rewrite) }
3073
- }, X.info(`proxy ${e} → ${n.target}`, {
3096
+ }, Z.info(`proxy ${e} → ${n.target}`, {
3074
3097
  prefix: e,
3075
3098
  target: n.target,
3076
3099
  ...n.rewrite === void 0 ? {} : { rewrite: n.rewrite }
@@ -3088,18 +3111,18 @@ import {
3088
3111
  pattern: n.pattern,
3089
3112
  file: n.file,
3090
3113
  dirChain: n.dirChain,
3091
- renderMode: vr(i, p("src", "pages", n.file)),
3114
+ renderMode: yr(i, p("src", "pages", n.file)),
3092
3115
  interactive: i.interactive ?? "full",
3093
3116
  tenantAware: i.tenantAware === !0,
3094
- revalidateMs: lt(i.revalidate),
3095
- staleWhileRevalidateMs: lt(i.staleWhileRevalidate) ?? 0,
3117
+ revalidateMs: J(i.revalidate),
3118
+ staleWhileRevalidateMs: J(i.staleWhileRevalidate) ?? 0,
3096
3119
  cacheInvalidatesOn: Array.isArray(i.cacheInvalidatesOn) ? i.cacheInvalidatesOn : [],
3097
3120
  hasLoader: typeof i.loader == "function",
3098
3121
  hasMeta: i.meta != null,
3099
3122
  hasGetStaticPaths: typeof i.getStaticPaths == "function"
3100
3123
  });
3101
3124
  } catch (e) {
3102
- X.warn("inspect: failed to load page metadata", { pattern: n.pattern }, e);
3125
+ Z.warn("inspect: failed to load page metadata", { pattern: n.pattern }, e);
3103
3126
  }
3104
3127
  return u = t, t;
3105
3128
  };
@@ -3119,9 +3142,9 @@ import {
3119
3142
  }), r();
3120
3143
  }), r.middlewares.use((t, n, r) => {
3121
3144
  if (t.method !== "GET" && t.method !== "HEAD") return r();
3122
- let { pathname: i } = ni(t.url ?? "/");
3145
+ let { pathname: i } = ri(t.url ?? "/");
3123
3146
  if (i !== "/robots.txt" || T(p(e, "public", "robots.txt"))) return r();
3124
- n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(fn({ indexable: !1 }));
3147
+ n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(pn({ indexable: !1 }));
3125
3148
  }), t.name === "voltroDashboard" && r.middlewares.use(async (e, t, n) => {
3126
3149
  let r = e.url ?? "", a = r.split("?")[0];
3127
3150
  if (a === "/api/dashboard/proxy") {
@@ -3212,7 +3235,7 @@ import {
3212
3235
  for (let [t, n] of Object.entries(e.headers ?? {})) n !== void 0 && (u[String(t).toLowerCase()] = Array.isArray(n) ? n.join(", ") : String(n));
3213
3236
  let f = o.split("?")[0];
3214
3237
  if (e.method === "GET" && (f === "/_voltro/inspect/logs" || o.startsWith("/_voltro/inspect/logs?"))) {
3215
- let e = a(u.origin), t = Gn(o, Dn(), u);
3238
+ let e = a(u.origin), t = Kn(o, On(), u);
3216
3239
  r.statusCode = t.status, r.setHeader("content-type", t.contentType);
3217
3240
  for (let [t, n] of Object.entries(e)) r.setHeader(t, n);
3218
3241
  r.end(t.body);
@@ -3230,7 +3253,7 @@ import {
3230
3253
  e.setEncoding("utf-8"), e.on("data", (e) => {
3231
3254
  i += e;
3232
3255
  }), e.on("end", () => {
3233
- let e = zn(i, n);
3256
+ let e = Bn(i, n);
3234
3257
  r.statusCode = e.status, r.setHeader("content-type", e.contentType);
3235
3258
  for (let [e, n] of Object.entries(t)) r.setHeader(e, n);
3236
3259
  r.end(e.body);
@@ -3261,14 +3284,14 @@ import {
3261
3284
  for (let [e, n] of Object.entries(t)) r.setHeader(e, n);
3262
3285
  r.flushHeaders?.(), r.write("retry: 5000\n\n");
3263
3286
  let l = o.indexOf("?");
3264
- if (!(l !== -1 && new URLSearchParams(o.slice(l + 1)).get("live") === "1")) for (let e of n.buffered()) r.write(hn(e));
3287
+ if (!(l !== -1 && new URLSearchParams(o.slice(l + 1)).get("live") === "1")) for (let e of n.buffered()) r.write(gn(e));
3265
3288
  let d = n.subscribe((e) => {
3266
3289
  try {
3267
- r.write(hn(e));
3290
+ r.write(gn(e));
3268
3291
  } catch {}
3269
3292
  }), f = setInterval(() => {
3270
3293
  try {
3271
- r.write(gn());
3294
+ r.write(_n());
3272
3295
  } catch {}
3273
3296
  }, 15e3), p = () => {
3274
3297
  clearInterval(f), d();
@@ -3281,7 +3304,7 @@ import {
3281
3304
  kind: "web",
3282
3305
  meta: {
3283
3306
  name: t.name ?? "(unnamed)",
3284
- voltroVersion: wi,
3307
+ voltroVersion: Ti,
3285
3308
  port: g,
3286
3309
  mode: "dev",
3287
3310
  apis: Object.entries(t.apis ?? {}).map(([e, t]) => {
@@ -3299,7 +3322,7 @@ import {
3299
3322
  size: 0,
3300
3323
  entries: []
3301
3324
  }),
3302
- env: () => ot(t.name ?? "app", { contract: ae(t.env) ? t.env : void 0 })
3325
+ env: () => ct(t.name ?? "app", { contract: ae(t.env) ? t.env : void 0 })
3303
3326
  }, u, { method: e.method ?? "GET" });
3304
3327
  if (n === null) return i();
3305
3328
  r.statusCode = n.status, r.setHeader("content-type", n.contentType);
@@ -3316,19 +3339,19 @@ import {
3316
3339
  e.middlewares.use(async (e, t, n) => {
3317
3340
  if (!(e.url ?? "").startsWith("/api/dashboard/registry")) return n();
3318
3341
  try {
3319
- let e = await We();
3342
+ let e = await Ke();
3320
3343
  t.statusCode = 200, t.setHeader("content-type", "application/json; charset=utf-8"), t.end(JSON.stringify(e));
3321
3344
  } catch (e) {
3322
3345
  t.statusCode = 500, t.setHeader("content-type", "text/plain"), t.end(`registry read error: ${e.message}`);
3323
3346
  }
3324
3347
  });
3325
3348
  }
3326
- } : null, me = /* @__PURE__ */ new Set(), he = (e, t, n, r, i, a = !1) => {
3327
- let o = li(i, a, t) ?? "";
3328
- if (X.error(`${t} render failed`, {
3349
+ } : null, me = /* @__PURE__ */ new Set(), U = (e, t, n, r, i, a = !1) => {
3350
+ let o = ui(i, a, t) ?? "";
3351
+ if (Z.error(`${t} render failed`, {
3329
3352
  pathname: n,
3330
3353
  pattern: r,
3331
- cause: vn(i) + o
3354
+ cause: yn(i) + o
3332
3355
  }), e.headersSent) {
3333
3356
  e.end();
3334
3357
  return;
@@ -3339,21 +3362,21 @@ import {
3339
3362
  "x-voltro-ssr-generation": String(oe)
3340
3363
  });
3341
3364
  let s = oe === 0 ? "" : `\n[voltro] this process has absorbed ${oe} 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`;
3342
- e.end(`${t} render failed for ${n}\n\n${vn(i)}\n${o}\n${s}`);
3343
- }, U = qt(), ge = Yt({
3344
- limit: U,
3345
- onColdStart: (e) => X.debug("ssr cold-compile start", { id: e }),
3346
- onColdEnd: (e, { durationMs: t, failed: n }) => X.debug(`ssr cold-compile ${n ? "FAILED" : "end"} ${t}ms`, {
3365
+ e.end(`${t} render failed for ${n}\n\n${yn(i)}\n${o}\n${s}`);
3366
+ }, W = Jt(), he = Xt({
3367
+ limit: W,
3368
+ onColdStart: (e) => Z.debug("ssr cold-compile start", { id: e }),
3369
+ onColdEnd: (e, { durationMs: t, failed: n }) => Z.debug(`ssr cold-compile ${n ? "FAILED" : "end"} ${t}ms`, {
3347
3370
  id: e,
3348
3371
  ms: t,
3349
3372
  ...n ? { failed: !0 } : {}
3350
3373
  })
3351
3374
  });
3352
- X.debug(`ssr cold-compile concurrency ${U}`, { concurrency: U });
3353
- let W = null, _e = async () => (W === null && (W = await O.readFile(p(e, ".framework", "index.html"), "utf8")), W), ve = {
3375
+ Z.debug(`ssr cold-compile concurrency ${W}`, { concurrency: W });
3376
+ let G = null, ge = async () => (G === null && (G = await O.readFile(p(e, ".framework", "index.html"), "utf8")), G), _e = {
3354
3377
  name: "framework:ssr",
3355
3378
  configureServer(n) {
3356
- let i = (e) => ge.load(e, async () => await n.ssrLoadModule(e)), a, o = !1, s = () => {
3379
+ let i = (e) => he.load(e, async () => await n.ssrLoadModule(e)), a, o = !1, s = () => {
3357
3380
  if (a !== void 0) return a;
3358
3381
  let n = t.locales ?? [], r = t.defaultLocale ?? n[0] ?? "en";
3359
3382
  return n.length === 0 ? (a = Promise.resolve(() => void 0), a) : (a = (async () => {
@@ -3362,7 +3385,7 @@ import {
3362
3385
  let n = (await i(p(e, "src", "locales", `${a}.ts`))).default;
3363
3386
  n !== void 0 && (s[a] = t(a, n, r));
3364
3387
  } catch (e) {
3365
- X.warn("locale catalog failed to load for SSR", { locale: a }, e);
3388
+ Z.warn("locale catalog failed to load for SSR", { locale: a }, e);
3366
3389
  }
3367
3390
  if (o = Object.keys(s).length > 0, Object.keys(s).length === 0) {
3368
3391
  let { resolveLocale: e } = await i("@voltro/i18n/server");
@@ -3387,12 +3410,12 @@ import {
3387
3410
  if (a.method !== "GET" && a.method !== "HEAD") return l();
3388
3411
  let u = a.url ?? "/";
3389
3412
  u.indexOf("?");
3390
- let { pathname: d, search: f } = ni(u);
3413
+ let { pathname: d, search: f } = ri(u);
3391
3414
  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" || /\.[a-z0-9]+$/i.test(d)) return l();
3392
- let m = Gi(d, S.ssrRoutes);
3415
+ let m = Ki(d, S.ssrRoutes);
3393
3416
  if (!m) return l();
3394
3417
  let h = !me.has(m.route.pattern), g = Date.now();
3395
- h && X.info(`ssr compiling ${m.route.pattern}`, {
3418
+ h && Z.info(`ssr compiling ${m.route.pattern}`, {
3396
3419
  pattern: m.route.pattern,
3397
3420
  pathname: d
3398
3421
  });
@@ -3411,15 +3434,15 @@ import {
3411
3434
  }
3412
3435
  }, b = !1;
3413
3436
  try {
3414
- let x = await v("loadPage", async () => await i(p(e, "src", "pages", m.route.file))), C = vr(x, p("src", "pages", m.route.file)), w = zi(S.dirs, m.route.dirChain), T = C === "spa" && w.some((e) => e.hasLayout);
3437
+ let x = await v("loadPage", async () => await i(p(e, "src", "pages", m.route.file))), C = yr(x, p("src", "pages", m.route.file)), w = Bi(S.dirs, m.route.dirChain), T = C === "spa" && w.some((e) => e.hasLayout);
3415
3438
  if (C !== "ssr" && C !== "isr" && !T) return l();
3416
3439
  let E = {};
3417
3440
  for (let [e, t] of Object.entries(a.headers ?? {})) typeof t == "string" ? E[e] = t : Array.isArray(t) && (E[e] = t.join(", "));
3418
- let D = na(ta(r[0], { allowDevProxy: !0 }), E.cookie, { apiName: r[0]?.name }), O = new AbortController(), k = () => O.abort();
3441
+ let D = ra(na(r[0], { allowDevProxy: !0 }), E.cookie, { apiName: r[0]?.name }), O = new AbortController(), k = () => O.abort();
3419
3442
  c.once("close", k);
3420
3443
  let A = null, j = [], M = {};
3421
3444
  try {
3422
- (await i("@voltro/web/ssr")).beginStoreSeeds(), {chain: j, segmentLoaderData: M} = await v("loadChain", () => Bi({
3445
+ (await i("@voltro/web/ssr")).beginStoreSeeds(), {chain: j, segmentLoaderData: M} = await v("loadChain", () => Vi({
3423
3446
  entries: w,
3424
3447
  loadLayout: (t) => i(p(e, "src", "pages", t.dir, "layout.tsx")),
3425
3448
  loadError: (t) => i(p(e, "src", "pages", t.dir, "error.tsx")),
@@ -3446,13 +3469,13 @@ import {
3446
3469
  c.off("close", k);
3447
3470
  }
3448
3471
  let N = await v("loadSsrHelpers", async () => await i("@voltro/web/ssr"));
3449
- T || await Si({
3472
+ T || await Ci({
3450
3473
  pageMod: x,
3451
3474
  params: m.params,
3452
3475
  query: D,
3453
3476
  apiName: r[0]?.name,
3454
3477
  seed: N.seedPreloadedSubscription,
3455
- onError: ({ tag: e, apiName: t }, n) => X.warn("preload seed failed", {
3478
+ onError: ({ tag: e, apiName: t }, n) => Z.warn("preload seed failed", {
3456
3479
  tag: e,
3457
3480
  apiName: t,
3458
3481
  pathname: d
@@ -3476,7 +3499,7 @@ import {
3476
3499
  let te = I ? {
3477
3500
  outerWrap: I.outerWrap,
3478
3501
  locale: I.locale
3479
- } : {}, L = T ? $r({
3502
+ } : {}, L = T ? ei({
3480
3503
  helpers: N,
3481
3504
  page: `src/pages/${m.route.file}`,
3482
3505
  interactive: F,
@@ -3490,7 +3513,7 @@ import {
3490
3513
  requestContext: P,
3491
3514
  ...te
3492
3515
  }
3493
- }) : null, R = T ? null : Qr({
3516
+ }) : null, R = T ? null : $r({
3494
3517
  helpers: N,
3495
3518
  page: `src/pages/${m.route.file}`,
3496
3519
  pathname: d,
@@ -3512,18 +3535,18 @@ import {
3512
3535
  ];
3513
3536
  for (let e of n) await y(e, t, ne);
3514
3537
  });
3515
- let re = await v("readShell", _e), z = await v("transformShell", () => n.transformIndexHtml(u, re)), ie = ne.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), B = I?.locale ?? P.cookies["voltro:locale"] ?? t.defaultLocale ?? (t.locales ?? [])[0] ?? "en", ae = Date.now();
3538
+ let re = await v("readShell", ge), z = await v("transformShell", () => n.transformIndexHtml(u, re)), ie = ne.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), B = I?.locale ?? P.cookies["voltro:locale"] ?? t.defaultLocale ?? (t.locales ?? [])[0] ?? "en", ae = Date.now();
3516
3539
  if (L) {
3517
- let e = (e) => ti({
3540
+ let e = (e) => ni({
3518
3541
  helpers: N,
3519
3542
  prepared: L,
3520
3543
  meta: e,
3521
3544
  interactive: F,
3522
3545
  extra: [ie]
3523
3546
  });
3524
- if (L.hasDeferred) yi({
3547
+ if (L.hasDeferred) bi({
3525
3548
  res: c,
3526
- shell: gi({
3549
+ shell: _i({
3527
3550
  shell: z,
3528
3551
  inlineModuleScriptsAsync: !0
3529
3552
  }),
@@ -3538,11 +3561,11 @@ import {
3538
3561
  ...e
3539
3562
  }),
3540
3563
  onShellError: (e) => {
3541
- he(c, "spa-shell-dev", d, m.route.pattern, e, b);
3564
+ U(c, "spa-shell-dev", d, m.route.pattern, e, b);
3542
3565
  }
3543
3566
  });
3544
3567
  else {
3545
- let t = ei({
3568
+ let t = ti({
3546
3569
  helpers: N,
3547
3570
  prepared: L
3548
3571
  }), n = z.replace("<div id=\"root\"></div>", `<div id="root">${t.body}</div>`).replace("</head>", ` ${e(t.meta)}\n </head>`).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${B}"`);
@@ -3565,9 +3588,9 @@ import {
3565
3588
  requestContext: P,
3566
3589
  ...te
3567
3590
  };
3568
- if (C === "ssr" && F === "full") yi({
3591
+ if (C === "ssr" && F === "full") bi({
3569
3592
  res: c,
3570
- shell: gi({
3593
+ shell: _i({
3571
3594
  shell: z,
3572
3595
  inlineModuleScriptsAsync: !0
3573
3596
  }),
@@ -3582,7 +3605,7 @@ import {
3582
3605
  ...e
3583
3606
  }),
3584
3607
  onShellError: (e) => {
3585
- he(c, "ssr-dev", d, m.route.pattern, e, b);
3608
+ U(c, "ssr-dev", d, m.route.pattern, e, b);
3586
3609
  }
3587
3610
  });
3588
3611
  else {
@@ -3592,13 +3615,13 @@ import {
3592
3615
  }
3593
3616
  _.render = Date.now() - ae;
3594
3617
  let V = Date.now() - g;
3595
- h ? (me.add(m.route.pattern), X.info(`ssr compiled ${m.route.pattern} in ${V}ms`, {
3618
+ h ? (me.add(m.route.pattern), Z.info(`ssr compiled ${m.route.pattern} in ${V}ms`, {
3596
3619
  pattern: m.route.pattern,
3597
3620
  pathname: d,
3598
3621
  elapsedMs: V,
3599
3622
  cold: !0,
3600
3623
  phases: _
3601
- })) : V > 200 && X.info(`ssr rendered ${d} in ${V}ms`, {
3624
+ })) : V > 200 && Z.info(`ssr rendered ${d} in ${V}ms`, {
3602
3625
  pattern: m.route.pattern,
3603
3626
  pathname: d,
3604
3627
  elapsedMs: V,
@@ -3606,29 +3629,29 @@ import {
3606
3629
  phases: _
3607
3630
  });
3608
3631
  } catch (e) {
3609
- if (Xr(e)) {
3610
- X.error("ssr-dev render refused", {
3632
+ if (Zr(e)) {
3633
+ Z.error("ssr-dev render refused", {
3611
3634
  pathname: d,
3612
3635
  pattern: m.route.pattern
3613
3636
  }, e), c.statusCode = 500, c.setHeader("content-type", "text/plain; charset=utf-8"), c.end(e.message);
3614
3637
  return;
3615
3638
  }
3616
- let t = Zr(e);
3639
+ let t = Qr(e);
3617
3640
  if (t) {
3618
3641
  c.statusCode = t.status;
3619
3642
  for (let [e, n] of Object.entries(t.headers)) c.setHeader(e, String(n));
3620
3643
  c.end(t.body);
3621
3644
  return;
3622
3645
  }
3623
- he(c, "ssr-dev", d, m.route.pattern, e, b);
3646
+ U(c, "ssr-dev", d, m.route.pattern, e, b);
3624
3647
  }
3625
3648
  });
3626
3649
  }
3627
- }, ye = Date.now(), G = D.version ?? "?", K = await Ti(), be = p(e, "node_modules", "@voltro", "ui-shadcn"), q = T(p(be, "package.json")) ? be : null, xe = [], Se = await (async () => {
3650
+ }, ve = Date.now(), ye = D.version ?? "?", be = await Ei(), K = p(e, "node_modules", "@voltro", "ui-shadcn"), q = T(p(K, "package.json")) ? K : null, xe = [], Se = await (async () => {
3628
3651
  let t = [];
3629
3652
  for (let n of r) {
3630
3653
  if (!n.proxyTarget) continue;
3631
- let r = await Ki(e, n.pkg);
3654
+ let r = await qi(e, n.pkg);
3632
3655
  if (r) try {
3633
3656
  t.push(await O.readFile(p(r, "rpcGroup.generated.ts"), "utf8"));
3634
3657
  } catch {}
@@ -3644,11 +3667,11 @@ import {
3644
3667
  } catch {}
3645
3668
  return !0;
3646
3669
  })();
3647
- Se && X.info("rpcGroup changed since last boot — forcing a dep re-optimize so the browser loads the current api client");
3670
+ Se && Z.info("rpcGroup changed since last boot — forcing a dep re-optimize so the browser loads the current api client");
3648
3671
  try {
3649
- await Tt(g, "voltro dev (web)");
3672
+ await Et(g, "voltro dev (web)");
3650
3673
  } catch (e) {
3651
- X.error(String(e.message ?? e)), process.exit(1);
3674
+ Z.error(String(e.message ?? e)), process.exit(1);
3652
3675
  }
3653
3676
  await (await D.createServer({
3654
3677
  root: j,
@@ -3662,12 +3685,12 @@ import {
3662
3685
  "@voltro/i18n"
3663
3686
  ],
3664
3687
  alias: [
3665
- ...K ? [{
3688
+ ...be ? [{
3666
3689
  find: "@voltro/devtools/styles.css",
3667
- replacement: p(K, "src/styles.css")
3690
+ replacement: p(be, "src/styles.css")
3668
3691
  }, {
3669
3692
  find: "@voltro/devtools",
3670
- replacement: p(K, "src/index.ts")
3693
+ replacement: p(be, "src/index.ts")
3671
3694
  }] : [],
3672
3695
  ...q ? [
3673
3696
  {
@@ -3687,16 +3710,16 @@ import {
3687
3710
  replacement: p(q, "src/index.ts")
3688
3711
  }
3689
3712
  ] : [],
3690
- ...Ye(e)
3713
+ ...Ze(e)
3691
3714
  ]
3692
3715
  },
3693
3716
  optimizeDeps: {
3694
3717
  include: [...r.map((e) => `${e.pkg}/rpcGroup`), ...xe],
3695
3718
  force: Se
3696
3719
  },
3697
- customLogger: Kt(),
3720
+ customLogger: qt(),
3698
3721
  plugins: [
3699
- fr(p(e, "src", "pages")),
3722
+ pr(p(e, "src", "pages")),
3700
3723
  k(),
3701
3724
  A(),
3702
3725
  ee,
@@ -3705,7 +3728,7 @@ import {
3705
3728
  se,
3706
3729
  ce,
3707
3730
  ue,
3708
- ve,
3731
+ _e,
3709
3732
  ...pe ? [pe] : []
3710
3733
  ],
3711
3734
  server: {
@@ -3714,24 +3737,24 @@ import {
3714
3737
  host: !0,
3715
3738
  allowedHosts: t.allowedHosts === !0 || [...t.allowedHosts ?? []],
3716
3739
  proxy: H,
3717
- fs: { allow: [e, ...ji(e)] }
3740
+ fs: { allow: [e, ...Mi(e)] }
3718
3741
  },
3719
3742
  appType: "spa",
3720
3743
  cacheDir: p(j, ".vite"),
3721
3744
  publicDir: p(e, "public")
3722
- })).listen(), Ci.info(`v${G} ready in ${Date.now() - ye}ms`, {
3723
- version: G,
3724
- bootMs: Date.now() - ye
3725
- }), X.info(`listening on http://localhost:${g}`, {
3745
+ })).listen(), wi.info(`v${ye} ready in ${Date.now() - ve}ms`, {
3746
+ version: ye,
3747
+ bootMs: Date.now() - ve
3748
+ }), Z.info(`listening on http://localhost:${g}`, {
3726
3749
  port: g,
3727
3750
  app: t.name ?? "(unnamed)"
3728
3751
  });
3729
- for (let e of r) e.proxyTarget && (X.info(`proxy /ws/${e.name} → ${e.proxyTarget}`, {
3752
+ for (let e of r) e.proxyTarget && (Z.info(`proxy /ws/${e.name} → ${e.proxyTarget}`, {
3730
3753
  api: e.name,
3731
3754
  target: e.proxyTarget
3732
- }), X.info(`proxy /_voltro/api/${e.name} → ${e.proxyTarget.replace(/^ws/, "http")}/_voltro/inspect`, { api: e.name }));
3755
+ }), Z.info(`proxy /_voltro/api/${e.name} → ${e.proxyTarget.replace(/^ws/, "http")}/_voltro/inspect`, { api: e.name }));
3733
3756
  try {
3734
- await Ge({
3757
+ await qe({
3735
3758
  id: v,
3736
3759
  name: _,
3737
3760
  kind: "web",
@@ -3740,13 +3763,13 @@ import {
3740
3763
  status: "live",
3741
3764
  logFile: y.path
3742
3765
  });
3743
- let t = Rr(e);
3766
+ let t = zr(e);
3744
3767
  if (t) {
3745
- let e = await Jr({ dashboardAppPath: t });
3746
- e.status === "launched" ? X.info(`dashboard launched at http://localhost:${e.port}`, { port: e.port }) : e.status === "already-running" && X.debug(`dashboard already running on :${e.port}`, { port: e.port });
3768
+ let e = await Yr({ dashboardAppPath: t });
3769
+ e.status === "launched" ? Z.info(`dashboard launched at http://localhost:${e.port}`, { port: e.port }) : e.status === "already-running" && Z.debug(`dashboard already running on :${e.port}`, { port: e.port });
3747
3770
  }
3748
3771
  setInterval(() => {
3749
- Ge({
3772
+ qe({
3750
3773
  id: v,
3751
3774
  name: _,
3752
3775
  kind: "web",
@@ -3757,46 +3780,46 @@ import {
3757
3780
  }).catch(() => {});
3758
3781
  }, 1e4).unref();
3759
3782
  let n = () => {
3760
- Ke(v), y.dispose();
3783
+ Je(v), y.dispose();
3761
3784
  };
3762
3785
  process.on("SIGINT", n), process.on("SIGTERM", n);
3763
3786
  } catch (e) {
3764
- X.warn("runtime-registry write failed", {}, e);
3787
+ Z.warn("runtime-registry write failed", {}, e);
3765
3788
  }
3766
3789
  return C({
3767
3790
  app: t.name ?? "unnamed",
3768
3791
  kind: "web",
3769
3792
  url: `http://localhost:${g}`,
3770
- bootMs: Date.now() - ye
3793
+ bootMs: Date.now() - ve
3771
3794
  }), new Promise(() => {});
3772
- }, sa = async (e) => {
3795
+ }, la = async (e) => {
3773
3796
  process.env.NODE_ENV || (process.env.NODE_ENV = "production");
3774
- let t = await aa(e);
3797
+ let t = await sa(e);
3775
3798
  if (!t) return {
3776
3799
  ran: !1,
3777
3800
  exitCode: 0
3778
3801
  };
3779
- let n = Date.now(), r = X.child("serve");
3802
+ let n = Date.now(), r = Z.child("serve");
3780
3803
  r.info("booting voltro serve (preview)", { app: t.name ?? "(unnamed)" });
3781
- let i = await Zi(e, t);
3804
+ let i = await Qi(e, t);
3782
3805
  for (let e of i) r.info("api wired", {
3783
3806
  name: e.name,
3784
3807
  pkg: e.pkg
3785
3808
  });
3786
- await $(e, t, i);
3809
+ await ia(e, t, i);
3787
3810
  {
3788
- let { pages: t } = await Q(p(e, "src", "pages"));
3789
- await on({
3811
+ let { pages: t } = await $(p(e, "src", "pages"));
3812
+ await sn({
3790
3813
  appRoot: e,
3791
3814
  pages: t
3792
3815
  });
3793
3816
  }
3794
- let a = t.port ?? 5173, o = await Ze("vite", () => import("vite")), s = (await import("@vitejs/plugin-react")).default, c = p(e, ".framework");
3795
- X.info("running production build"), await o.build({
3817
+ let a = t.port ?? 5173, o = await $e("vite", () => import("vite")), s = (await import("@vitejs/plugin-react")).default, c = p(e, ".framework");
3818
+ Z.info("running production build"), await o.build({
3796
3819
  root: c,
3797
3820
  envPrefix: "__VOLTRO_VITE_ENV_DISABLED__",
3798
3821
  plugins: [s()],
3799
- customLogger: Kt(),
3822
+ customLogger: qt(),
3800
3823
  resolve: { dedupe: [
3801
3824
  "react",
3802
3825
  "react-dom",
@@ -3805,7 +3828,7 @@ import {
3805
3828
  ] },
3806
3829
  build: {
3807
3830
  outDir: "dist",
3808
- rollupOptions: { output: { manualChunks: Ni } }
3831
+ rollupOptions: { output: { manualChunks: Pi } }
3809
3832
  },
3810
3833
  publicDir: p(e, "public")
3811
3834
  });
@@ -3825,14 +3848,14 @@ import {
3825
3848
  extras: d,
3826
3849
  bootMs: Date.now() - n
3827
3850
  }), new Promise(() => {});
3828
- }, ca = 5e3, la = 6e4, ua = (e, t) => {
3851
+ }, ua = 5e3, da = 6e4, fa = (e, t) => {
3829
3852
  if (e.length === 0) return 0;
3830
3853
  if (e.length === 1) return e[0];
3831
3854
  let n = t * (e.length - 1), r = Math.floor(n), i = Math.ceil(n);
3832
3855
  if (r === i) return e[r];
3833
3856
  let a = n - r;
3834
3857
  return e[r] * (1 - a) + e[i] * a;
3835
- }, da = (e) => {
3858
+ }, pa = (e) => {
3836
3859
  if (e.length === 0) return {
3837
3860
  p50: 0,
3838
3861
  p95: 0,
@@ -3844,15 +3867,15 @@ import {
3844
3867
  let t = e.slice().sort((e, t) => e - t), n = 0;
3845
3868
  for (let e of t) n += e;
3846
3869
  return {
3847
- p50: ua(t, .5),
3848
- p95: ua(t, .95),
3849
- p99: ua(t, .99),
3870
+ p50: fa(t, .5),
3871
+ p95: fa(t, .95),
3872
+ p99: fa(t, .99),
3850
3873
  mean: n / t.length,
3851
3874
  min: t[0],
3852
3875
  max: t[t.length - 1]
3853
3876
  };
3854
- }, fa = (e = {}) => {
3855
- let t = e.maxSamples ?? ca, n = e.defaultWindowMs ?? la, r = [];
3877
+ }, ma = (e = {}) => {
3878
+ let t = e.maxSamples ?? ua, n = e.defaultWindowMs ?? da, r = [];
3856
3879
  return {
3857
3880
  record(e) {
3858
3881
  I(e), r.push({
@@ -3881,7 +3904,7 @@ import {
3881
3904
  tag: e.tag,
3882
3905
  count: e.samples.length,
3883
3906
  errorCount: n,
3884
- latencyMs: da(t)
3907
+ latencyMs: pa(t)
3885
3908
  });
3886
3909
  }
3887
3910
  return c.sort((e, t) => t.count - e.count), {
@@ -3894,4 +3917,4 @@ import {
3894
3917
  };
3895
3918
  };
3896
3919
  //#endregion
3897
- export { qt as $, Pr as A, Xn as B, ni as C, We as Ct, Rr as D, Pe as Dt, Jr as E, Ne as Et, mr as F, Dn as G, Vn as H, gr as I, gn as J, hn as K, vr as L, Cr as M, pr as N, Mr as O, yr as P, Yt as Q, nr as R, ti as S, qe as St, Lr as T, Ge as Tt, zn as U, Gn as V, Mn as W, dn as X, fn as Y, on as Z, yi as _, it as _t, Bi as a, Tt as at, $r as b, Ze as bt, Zi as c, gt as ct, Ni as d, dt, Nt as et, Q as f, ft, gi as g, st as gt, _i as h, ot as ht, na as i, Lt as it, xr as j, Nr as k, oa as l, ht as lt, Si as m, lt as mt, Pi as n, Pt as nt, zi as o, bt as ot, $ as p, ct as pt, mn as q, ta as r, It as rt, aa as s, vt as st, fa as t, Ft as tt, sa as u, ut, Xr as v, nt as vt, zr as w, Ke as wt, ei as x, Ye as xt, Qr as y, tt as yt, rr as z };
3920
+ export { Jt as $, Fr as A, Zn as B, ri as C, Ke as Ct, zr as D, Ie as Dt, Yr as E, Fe as Et, hr as F, On as G, Hn as H, _r as I, _n as J, gn as K, yr as L, wr as M, mr as N, Nr as O, br as P, Xt as Q, rr as R, ni as S, Ye as St, Rr as T, qe as Tt, Bn as U, Kn as V, Nn as W, fn as X, pn as Y, sn as Z, bi as _, ot as _t, Vi as a, Et as at, ei as b, $e as bt, Qi as c, _t as ct, Pi as d, ft as dt, Pt as et, $ as f, pt as ft, _i as g, lt as gt, vi as h, ct as ht, ra as i, Rt as it, Sr as j, Pr as k, ca as l, gt as lt, Ci as m, J as mt, Fi as n, Ft as nt, Bi as o, xt as ot, ia as p, ut as pt, hn as q, na as r, Lt as rt, sa as s, yt as st, ma as t, It as tt, la as u, dt as ut, Zr as v, it as vt, Br as w, Je as wt, ti as x, Ze as xt, $r as y, rt as yt, ir as z };