@voltro/cli 0.54.0 → 0.56.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 (173) hide show
  1. package/CHANGELOG.md +639 -2
  2. package/bin/voltro.mjs +24 -0
  3. package/dist/{apiBuild-DTWp0S_q.js → apiBuild-Bdaetr37.js} +119 -88
  4. package/dist/apiBuild-Vw1figjO.js +2 -0
  5. package/dist/bin.js +1 -1
  6. package/dist/{build-D4ygSbnV.js → build-CI36wL4R.js} +339 -314
  7. package/dist/buildReport-52gHKgfO.js +64 -0
  8. package/dist/{checkCommand-Dg1G7Gwd.js → checkCommand-CAwFXrxA.js} +6 -6
  9. package/dist/{checkCommand-L7DTlpIF.js → checkCommand-D0QV_zM_.js} +1 -1
  10. package/dist/{clusterCmd-DrVFCzSj.js → clusterCmd-CdLB1GkT.js} +1 -1
  11. package/dist/{codegen-DSLM8Su9.js → codegen-Bth5lUTU.js} +76 -64
  12. package/dist/codegen-DbH7NbCR.js +2 -0
  13. package/dist/{codegenCommand-CG_Vx4lc.js → codegenCommand-CidbQzbv.js} +15 -14
  14. package/dist/{codemodRunner-Cd4xkC6u.js → codemodRunner-BlQPfjzA.js} +277 -0
  15. package/dist/{commands-6Kzi92Np.js → commands-CWjfThXv.js} +35 -35
  16. package/dist/{dashboardCommand-Cq1PWvI1.js → dashboardCommand-BekcY5Ls.js} +3 -3
  17. package/dist/{dataCommand-DYzW8vkv.js → dataCommand-2pccgbIy.js} +267 -195
  18. package/dist/{dbCommand-B4NWZtGL.js → dbCommand-DpK_vQET.js} +457 -441
  19. package/dist/dbCommand-DrycGWWt.js +2 -0
  20. package/dist/{dev-cKUiZZsB.js → dev-B9Gz0k85.js} +1 -1
  21. package/dist/{dev-CmuvUKRq.js → dev-Dw263KPu.js} +2598 -2452
  22. package/dist/doctorCommand-BMWs6aVm.js +2 -0
  23. package/dist/{doctorCommand-DCiFVMtZ.js → doctorCommand-aR_bFmIi.js} +353 -251
  24. package/dist/{dormancyCommand-w1TrmgYP.js → dormancyCommand-eXTQMbHU.js} +1 -1
  25. package/dist/{embeddingsCommand-CMgPyRTr.js → embeddingsCommand-CTmiQvwa.js} +1 -1
  26. package/dist/{envCommand-Cyynmcfa.js → envCommand-BDUgV7EM.js} +12 -12
  27. package/dist/{evolveCommand-BwvQ8dVH.js → evolveCommand-YV8qW1LU.js} +2 -2
  28. package/dist/frameworkTableAssembly-CGNC0qr7.js +2 -0
  29. package/dist/{frameworkTableAssembly-D7LJuALW.js → frameworkTableAssembly-DNOFXfEQ.js} +102 -100
  30. package/dist/index.js +1 -1
  31. package/dist/{infoCommand-DlYlUPqs.js → infoCommand-BjVXpMlP.js} +1 -1
  32. package/dist/inspect-CNYvNXPU.js +1484 -0
  33. package/dist/inspect-S2rWy1Ys.js +2 -0
  34. package/dist/{inspectCmd-niF97fAq.js → inspectCmd-CP-G0sVK.js} +1 -1
  35. package/dist/{inspectFetch-EMuhTG_9.js → inspectFetch-BU1NyzxV.js} +36 -24
  36. package/dist/{inspectMetrics-CGF94puw.js → inspectMetrics-BY0Sjb2F.js} +19 -19
  37. package/dist/interruptedReplace-CwnkBb2X.js +41 -0
  38. package/dist/interruptedReplace-qzmFI020.js +2 -0
  39. package/dist/{logsCmd-B6oNsfaZ.js → logsCmd-BU8uCdys.js} +1 -1
  40. package/dist/{manifestBuild-Cqgsx2bM.js → manifestBuild-CEkjfpwc.js} +1 -1
  41. package/dist/manifestBuild-DIa_s6u0.js +2 -0
  42. package/dist/{migrate-BK_Bbx-_.js → migrate-SICulyz1.js} +2 -2
  43. package/dist/precompressAssets-YhTi1aWp.js +40 -0
  44. package/dist/{probeCommand-_C0YU207.js → probeCommand-6HxEkNDG.js} +2 -2
  45. package/dist/{runtimeTrace-CGWx1Q6l.js → runtimeTrace-DgYMc09E.js} +1 -1
  46. package/dist/{scheduleCmd-DQRu6BZC.js → scheduleCmd-DYBUfo_T.js} +1 -1
  47. package/dist/{sdkgen-CDGHQUFj.js → sdkgen-PY-umd6O.js} +1 -1
  48. package/dist/{seedRunner-Dgsiwk_e.js → seedRunner-DISBKow-.js} +16 -16
  49. package/dist/serveCommand-BITS8Hpj.js +2 -0
  50. package/dist/{serveCommand-Bje09q1v.js → serveCommand-DIJ3ma76.js} +951 -909
  51. package/dist/serveEntry.js +1 -1
  52. package/dist/{start-Clz-1BHB.js → start-B9NGB8gn.js} +627 -588
  53. package/dist/{start-B0bnJgxI.js → start-BFQQkL1i.js} +1 -1
  54. package/dist/startEntry.js +1 -1
  55. package/dist/staticCachePolicy-CIyj6DbS.js +15 -0
  56. package/dist/{test-D_kW4KMj.js → test-jipIQ5Mx.js} +1 -1
  57. package/dist/{tracesCmd-DgtgOUdi.js → tracesCmd-BWYDqMy6.js} +1 -1
  58. package/dist/{updateCommand-CRJlAOaM.js → updateCommand-C9n_Z_oG.js} +8 -2
  59. package/dist/updateCommand-DsXEAHbd.js +2 -0
  60. package/dist/webDev-C2dRz9s5.js +2 -0
  61. package/dist/{webDev-DSI9SOhs.js → webDev-C53hJdcL.js} +1265 -1288
  62. package/dist/{webhooksCommand-BvzXNHji.js → webhooksCommand-uuPu8qQX.js} +1 -1
  63. package/dist/{workflowsCmd-BGF-mRZ5.js → workflowsCmd-g-DNpaUc.js} +1 -1
  64. package/package.json +67 -19
  65. package/templates/AGENTS.core.md +20 -1
  66. package/templates/AGENTS.md +21 -2
  67. package/templates/agent-docs/_index.md +1 -1
  68. package/templates/agent-docs/_manifest.json +1 -1
  69. package/templates/agent-docs/authentication.md +49 -6
  70. package/templates/agent-docs/cli.md +216 -11
  71. package/templates/agent-docs/data.md +209 -18
  72. package/templates/agent-docs/database/scaling.md +40 -1
  73. package/templates/agent-docs/deployment.md +53 -1
  74. package/templates/agent-docs/internationalization.md +32 -0
  75. package/templates/agent-docs/local-first-mobile.md +9 -2
  76. package/templates/agent-docs/observability.md +227 -0
  77. package/templates/agent-docs/plugins/billing.md +15 -0
  78. package/templates/agent-docs/plugins/broadcast.md +2 -1
  79. package/templates/agent-docs/plugins/ratelimit.md +6 -1
  80. package/templates/agent-docs/plugins/row-history.md +11 -0
  81. package/templates/agent-docs/plugins.md +65 -8
  82. package/templates/agent-docs/reference.md +5 -3
  83. package/templates/agent-docs/routing.md +18 -0
  84. package/templates/agent-docs/schema-driven-ui.md +125 -0
  85. package/templates/agent-docs/templates/appshells.md +3 -3
  86. package/templates/agent-docs/whats-new.md +408 -106
  87. package/templates/apps/api-ai/package.json +6 -6
  88. package/templates/apps/api-auth/package.json +8 -8
  89. package/templates/apps/api-backend/package.json +7 -7
  90. package/templates/apps/api-backend-deactivation/package.json +7 -7
  91. package/templates/apps/api-backend-mail/package.json +8 -8
  92. package/templates/apps/api-backend-mariadb/package.json +9 -9
  93. package/templates/apps/api-backend-sqlite/package.json +8 -8
  94. package/templates/apps/api-backend-storage/package.json +8 -8
  95. package/templates/apps/api-cms/package.json +9 -9
  96. package/templates/apps/api-collab/package.json +8 -8
  97. package/templates/apps/api-data-advanced/package.json +8 -8
  98. package/templates/apps/api-durable/package.json +8 -8
  99. package/templates/apps/api-feature-flags/package.json +9 -9
  100. package/templates/apps/api-governance/package.json +8 -8
  101. package/templates/apps/api-kv/package.json +8 -8
  102. package/templates/apps/api-moderation/package.json +8 -8
  103. package/templates/apps/api-observability/package.json +8 -8
  104. package/templates/apps/api-ratelimit/package.json +8 -8
  105. package/templates/apps/api-rbac/package.json +8 -8
  106. package/templates/apps/api-rest/package.json +7 -7
  107. package/templates/apps/api-row-history/package.json +8 -8
  108. package/templates/apps/api-saas/package.json +11 -11
  109. package/templates/apps/api-saas-starter/package.json +10 -10
  110. package/templates/apps/api-search/package.json +8 -8
  111. package/templates/apps/api-status/package.json +8 -8
  112. package/templates/apps/api-webhooks/package.json +9 -9
  113. package/templates/apps/changelog/package.json +7 -7
  114. package/templates/apps/changelog/src/pages/[locale]/page.tsx +7 -1
  115. package/templates/apps/edge-functions/package.json +2 -2
  116. package/templates/apps/frontend-admin/package.json +7 -8
  117. package/templates/apps/frontend-admin/src/pages/(marketing)/layout.tsx +1 -2
  118. package/templates/apps/frontend-admin/src/pages/admin/layout.tsx +1 -2
  119. package/templates/apps/frontend-app/package.json +8 -9
  120. package/templates/apps/frontend-app/src/pages/layout.tsx +1 -2
  121. package/templates/apps/frontend-auth/package.json +7 -8
  122. package/templates/apps/frontend-auth/src/components/AuthShell.tsx +1 -2
  123. package/templates/apps/frontend-blank/package.json +6 -7
  124. package/templates/apps/frontend-blank/src/pages/layout.tsx +1 -2
  125. package/templates/apps/frontend-cms/package.json +8 -9
  126. package/templates/apps/frontend-cms/src/pages/(app)/layout.tsx +1 -2
  127. package/templates/apps/frontend-collab/README.md +7 -2
  128. package/templates/apps/frontend-collab/package.json +9 -10
  129. package/templates/apps/frontend-collab/src/pages/layout.tsx +1 -2
  130. package/templates/apps/frontend-collab/src/pages/page.test.tsx +8 -4
  131. package/templates/apps/frontend-collab/src/pages/page.tsx +10 -5
  132. package/templates/apps/frontend-contact/package.json +7 -7
  133. package/templates/apps/frontend-contact/src/components/ContactForm.island.tsx +1 -1
  134. package/templates/apps/frontend-dashboard/package.json +6 -7
  135. package/templates/apps/frontend-dashboard/src/pages/(marketing)/layout.tsx +1 -2
  136. package/templates/apps/frontend-dashboard/src/pages/dashboard/layout.tsx +1 -2
  137. package/templates/apps/frontend-docs/package.json +8 -8
  138. package/templates/apps/frontend-i18n/package.json +6 -6
  139. package/templates/apps/frontend-landing/package.json +7 -7
  140. package/templates/apps/frontend-portal/package.json +7 -8
  141. package/templates/apps/frontend-portal/src/pages/(portal)/layout.tsx +1 -2
  142. package/templates/apps/frontend-saas/package.json +7 -8
  143. package/templates/apps/frontend-saas/src/pages/(marketing)/layout.tsx +1 -2
  144. package/templates/apps/frontend-saas/src/pages/dashboard/layout.tsx +1 -2
  145. package/templates/apps/frontend-spa/package.json +6 -7
  146. package/templates/apps/frontend-spa/src/pages/layout.tsx +1 -2
  147. package/templates/apps/frontend-ssr/package.json +6 -7
  148. package/templates/apps/frontend-ssr/src/pages/layout.tsx +1 -2
  149. package/templates/apps/frontend-ssr-api/package.json +7 -8
  150. package/templates/apps/frontend-ssr-api/src/pages/layout.tsx +1 -2
  151. package/templates/apps/frontend-static-blog/package.json +8 -8
  152. package/templates/apps/frontend-static-blog/src/components/ReadingProgress.island.tsx +1 -1
  153. package/templates/apps/frontend-static-blog/src/pages/[locale]/page.tsx +7 -1
  154. package/templates/apps/frontend-status/package.json +7 -8
  155. package/templates/apps/frontend-status/src/pages/layout.tsx +1 -2
  156. package/templates/apps/mobile-app/package.json +4 -4
  157. package/templates/baselines/compose/docker/api.Dockerfile +61 -5
  158. package/templates/baselines/compose/docker/web.Dockerfile +55 -10
  159. package/templates/baselines/compose-mariadb/docker/api.Dockerfile +61 -5
  160. package/templates/baselines/compose-mariadb/docker/web.Dockerfile +55 -10
  161. package/dist/apiBuild-CeUN55uk.js +0 -2
  162. package/dist/codegen-DjgxEOnD.js +0 -2
  163. package/dist/dbCommand-CSFWs9ev.js +0 -2
  164. package/dist/doctorCommand-J3qu4E0Y.js +0 -2
  165. package/dist/frameworkTableAssembly-IPD1pUnZ.js +0 -2
  166. package/dist/inspect-Bd8-9wsi.js +0 -1193
  167. package/dist/inspect-CuoDInfZ.js +0 -2
  168. package/dist/interruptedReplace-C3O3M1MM.js +0 -28
  169. package/dist/interruptedReplace-CvmiAM9K.js +0 -2
  170. package/dist/manifestBuild-C4-J1-m_.js +0 -2
  171. package/dist/serveCommand-BiPe8BJm.js +0 -2
  172. package/dist/updateCommand-CIoVDKnj.js +0 -2
  173. package/dist/webDev-DlvZO30c.js +0 -2
@@ -0,0 +1,64 @@
1
+ import { join as e } from "node:path";
2
+ import { existsSync as t, readFileSync as n, readdirSync as r, statSync as i } from "node:fs";
3
+ import { gzipSync as a } from "node:zlib";
4
+ //#region src/buildReport.ts
5
+ var o = 9, s = (e) => a(e, { level: o }).length, c = (n) => {
6
+ let a = 0, o = 0, s = (t) => {
7
+ for (let n of r(t, { withFileTypes: !0 })) {
8
+ let r = e(t, n.name);
9
+ n.isDirectory() ? s(r) : (a += i(r).size, o += 1);
10
+ }
11
+ };
12
+ return t(n) && s(n), {
13
+ bytes: a,
14
+ files: o
15
+ };
16
+ }, l = (a) => {
17
+ let o = e(a, ".framework", "dist"), l = e(o, "index.html");
18
+ if (!t(l)) return null;
19
+ let u = n(l, "utf8"), d = (r) => {
20
+ let i = e(o, r.replace(/^\//, ""));
21
+ if (!t(i)) return null;
22
+ let a = n(i);
23
+ return {
24
+ file: r,
25
+ gzip: s(a),
26
+ raw: a.length
27
+ };
28
+ }, f = [...u.matchAll(/(?:src|href)="(\/assets\/[^"]+\.js)"/g)].map((e) => e[1]), p = [...u.matchAll(/href="(\/assets\/[^"]+\.css)"/g)].map((e) => e[1]), m = f.map(d).filter((e) => e !== null), h = p.map(d).filter((e) => e !== null), g = e(o, "assets"), _ = 0, v = 0;
29
+ if (t(g)) for (let t of r(g)) t.endsWith(".js") && (_ += s(n(e(g, t))), v += 1);
30
+ let y = e(o, "server", "ssrEntry.js"), b = c(e(a, ".framework", "dist-web", "startBundle")), x = c(e(a, ".framework", "dist-api", "serveBundle"));
31
+ return {
32
+ firstLoad: m,
33
+ firstLoadGzip: m.reduce((e, t) => e + t.gzip, 0),
34
+ css: h,
35
+ cssGzip: h.reduce((e, t) => e + t.gzip, 0),
36
+ totalGzip: _,
37
+ chunkCount: v,
38
+ ssrEntryBytes: t(y) ? i(y).size : 0,
39
+ startBundleBytes: b.bytes,
40
+ startBundleFiles: b.files,
41
+ serveBundleBytes: x.bytes,
42
+ serveBundleFiles: x.files
43
+ };
44
+ }, u = (e) => `${(e / 1024).toFixed(1)} KB`, d = (e) => `${(e / 1e6).toFixed(2)} MB`, f = (e) => {
45
+ if (e === null) return [];
46
+ let t = [
47
+ "",
48
+ "build report — what a visitor downloads",
49
+ ""
50
+ ];
51
+ t.push(` first load ${u(e.firstLoadGzip).padStart(10)} gz ${e.firstLoad.length} file(s), entry + modulepreload`), e.css.length > 0 && t.push(` css ${u(e.cssGzip).padStart(10)} gz ${e.css.length} stylesheet(s)`), t.push(` all chunks ${u(e.totalGzip).padStart(10)} gz ${e.chunkCount} chunk(s), eager + lazy`);
52
+ let n = [...e.firstLoad].sort((e, t) => t.gzip - e.gzip).slice(0, 5);
53
+ if (n.length > 0) {
54
+ t.push("");
55
+ for (let r of n) {
56
+ let n = e.firstLoadGzip === 0 ? 0 : Math.round(r.gzip / e.firstLoadGzip * 100);
57
+ t.push(` ${u(r.gzip).padStart(10)} gz ${String(n).padStart(3)}% ${r.file}`);
58
+ }
59
+ }
60
+ let r = n[0];
61
+ return r !== void 0 && e.firstLoadGzip > 0 && r.gzip > e.firstLoadGzip / 2 && (t.push(""), t.push(` ⚠ one chunk is ${Math.round(r.gzip / e.firstLoadGzip * 100)}% of the first load: ${r.file}`), t.push(" Every visitor downloads it before the page is interactive. If that is"), t.push(" data rather than code (a content glob, a locale catalog, a dataset),"), t.push(" it usually belongs behind a dynamic import or a build-time index.")), (e.ssrEntryBytes > 0 || e.startBundleFiles > 0 || e.serveBundleFiles > 0) && (t.push(""), t.push(" server artefacts (what the image ships and a cold boot loads)"), e.ssrEntryBytes > 0 && t.push(` ssr bundle ${d(e.ssrEntryBytes).padStart(10)}`), e.startBundleFiles > 0 && t.push(` start bundle ${d(e.startBundleBytes).padStart(10)} ${e.startBundleFiles} file(s)`), e.serveBundleFiles > 0 && t.push(` serve bundle ${d(e.serveBundleBytes).padStart(10)} ${e.serveBundleFiles} file(s)`)), t.push(""), t;
62
+ };
63
+ //#endregion
64
+ export { l as collectBuildReport, f as formatBuildReport };
@@ -1,10 +1,10 @@
1
1
  import { t as e } from "./cliArgs-D4p8n7EE.js";
2
- import { a as t, l as n } from "./codegen-DSLM8Su9.js";
2
+ import { a as t, l as n } from "./codegen-Bth5lUTU.js";
3
3
  import { r } from "./appGraph-yRuKjOba.js";
4
4
  import { n as i } from "./cliOutput-D1tSBoRM.js";
5
- import { n as a, o, r as s, t as c } from "./inspectFetch-EMuhTG_9.js";
5
+ import { n as a, o, r as s, t as c } from "./inspectFetch-BU1NyzxV.js";
6
6
  import { r as l } from "./fileTaxonomy-CbyMQYx_.js";
7
- import { S as u } from "./doctorCommand-DCiFVMtZ.js";
7
+ import { S as u } from "./doctorCommand-aR_bFmIi.js";
8
8
  import { resolve as d } from "node:path";
9
9
  import { readdirSync as f, statSync as p } from "node:fs";
10
10
  import { isReactivityChannelKey as m } from "@voltro/protocol";
@@ -170,9 +170,9 @@ var h = (e) => (e === void 0 ? [] : typeof e == "string" ? [e] : e).filter((e) =
170
170
  let t = e.severity === "error" ? "✗ error" : "⚠ warn", n = e.file ? ` (${e.file})` : "";
171
171
  return `${t} ${e.rule} ${e.node}${n}\n ${e.breaks.join("; ")}\n fix: ${e.fix}`;
172
172
  }).join("\n"), O = async (e) => {
173
- let { walk: t, loadDiscovered: n, loadApiConfig: r } = await import("./dev-cKUiZZsB.js"), { buildRpcEntry: i } = await import("./manifestBuild-C4-J1-m_.js"), { buildCapabilityManifest: a } = await import("./inspect-CuoDInfZ.js"), { relative: o } = await import("node:path"), s = await n(await t(e)), c = await r(e).then((e) => e?.plugins ?? []).catch(() => []);
173
+ let { walk: t, loadDiscovered: n, loadApiConfig: r } = await import("./dev-B9Gz0k85.js"), { buildRpcEntry: i } = await import("./manifestBuild-DIa_s6u0.js"), { buildCapabilityManifest: a } = await import("./inspect-S2rWy1Ys.js"), { relative: o } = await import("node:path"), s = await n(await t(e)), c = await r(e).then((e) => e?.plugins ?? []).catch(() => []);
174
174
  try {
175
- let { mergePluginRoutesInto: e } = await import("./dev-cKUiZZsB.js");
175
+ let { mergePluginRoutesInto: e } = await import("./dev-B9Gz0k85.js");
176
176
  e({
177
177
  plugins: c,
178
178
  queries: s.queries,
@@ -189,7 +189,7 @@ var h = (e) => (e === void 0 ? [] : typeof e == "string" ? [e] : e).filter((e) =
189
189
  ...s.mutations.map((e) => l(e.descriptor, "mutation", e.file)),
190
190
  ...s.actions.map((e) => l(e.descriptor, "action", e.file)),
191
191
  ...s.streams.map((e) => l(e.descriptor, "stream", e.file))
192
- ], { assembleFrameworkTables: d } = await import("./frameworkTableAssembly-IPD1pUnZ.js"), f = await d({ root: e }).catch((e) => (console.warn(`\n⚠ plugin tables could not be collected — this report is INCOMPLETE.\n ${e instanceof Error ? e.message.split("\n")[0] : String(e)}\n`), [])), p = new Set(s.tables.map((e) => e.tableName)), m = [...[...p].map((e) => ({ name: e })), ...f.map((e) => e.tableName).filter((e) => !p.has(e)).map((e) => ({
192
+ ], { assembleFrameworkTables: d } = await import("./frameworkTableAssembly-CGNC0qr7.js"), f = await d({ root: e }).catch((e) => (console.warn(`\n⚠ plugin tables could not be collected — this report is INCOMPLETE.\n ${e instanceof Error ? e.message.split("\n")[0] : String(e)}\n`), [])), p = new Set(s.tables.map((e) => e.tableName)), m = [...[...p].map((e) => ({ name: e })), ...f.map((e) => e.tableName).filter((e) => !p.has(e)).map((e) => ({
193
193
  name: e,
194
194
  framework: !0
195
195
  }))], h = c;
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, o as n } from "./checkCommand-Dg1G7Gwd.js";
1
+ import { a as e, i as t, o as n } from "./checkCommand-CAwFXrxA.js";
2
2
  export { t as offlineManifest, e as runCheckCommand, n as toInput };
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./cliOutput-D1tSBoRM.js";
2
- import { n as t, o as n, r, t as i } from "./inspectFetch-EMuhTG_9.js";
2
+ import { n as t, o as n, r, t as i } from "./inspectFetch-BU1NyzxV.js";
3
3
  import { ansi as a } from "@voltro/logger";
4
4
  //#region src/clusterCmd.ts
5
5
  var o = () => {
@@ -10,7 +10,8 @@ import { isAgentDescriptor as m } from "@voltro/ai/agent";
10
10
  var h = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.https.http2.tls.dns.dgram.stream.zlib.child_process.worker_threads.cluster.readline.vm.module.perf_hooks.async_hooks.inspector.v8.process.tty.repl.constants.sys.string_decoder".split(".")), g = (e) => e.startsWith("node:") || h.has(e) || e === "@voltro/workflow" ? !0 : e === "@voltro/database/wire" ? !1 : e === "@voltro/database" || e.startsWith("@voltro/database/") || e === "@voltro/runtime" || e.startsWith("@voltro/runtime/") ? !0 : e === "@voltro/ai/agent" || e === "@voltro/ai/events" ? !1 : !!(e === "@voltro/ai" || e.startsWith("@voltro/ai/") || [
11
11
  "@voltro/protocol/session",
12
12
  "@voltro/protocol/jwt",
13
- "@voltro/protocol/apikey"
13
+ "@voltro/protocol/apikey",
14
+ "@voltro/protocol/identity"
14
15
  ].includes(e) || e === "@voltro/env/server" || e.startsWith("@effect/cluster") || e.startsWith("@effect/sql") || e === "@effect/platform-node" || [
15
16
  "pg",
16
17
  "postgres",
@@ -304,8 +305,8 @@ ${o.join("\n\n")}\n`);
304
305
  file: t,
305
306
  reason: "a descriptor changed since the group was generated"
306
307
  };
307
- }, Q = (e, t, n, i = [], o = [], s = !1, l = !1, u = [], d = "") => {
308
- let f = o.length > 0, m = o.flatMap((e) => [{
308
+ }, Q = (e, t, n, i = [], o = [], s = !1, l = !1, u = [], d = {}, f = "") => {
309
+ let m = o.length > 0, h = o.flatMap((e) => [{
309
310
  file: e.file,
310
311
  exportName: e.exportName,
311
312
  rpcTag: `${e.name}.send`,
@@ -315,7 +316,7 @@ ${o.join("\n\n")}\n`);
315
316
  exportName: e.exportName,
316
317
  rpcTag: `${e.name}.messages`,
317
318
  kind: "query"
318
- }]), h = [...new Map(u.map((e) => [e.tag, e])).values()].sort((e, t) => e.tag < t.tag ? -1 : 1), g = h.map((e) => ({
319
+ }]), g = [...new Map(u.map((e) => [e.tag, e])).values()].sort((e, t) => e.tag < t.tag ? -1 : 1), _ = g.map((e) => ({
319
320
  file: `plugin:${e.module}`,
320
321
  exportName: e.name,
321
322
  rpcTag: e.tag,
@@ -323,26 +324,26 @@ ${o.join("\n\n")}\n`);
323
324
  }));
324
325
  ee([
325
326
  ...n,
326
- ...m,
327
- ...g
327
+ ...h,
328
+ ..._
328
329
  ], e), q([
329
330
  ...n,
330
- ...m,
331
- ...g
331
+ ...h,
332
+ ..._
332
333
  ], e);
333
- let _ = (e) => e.replace(/[^a-zA-Z0-9_$]/g, "_"), v = (e) => `__src_agent_${_(e.name)}`, y = (e) => `__agentRoutes_${_(e.name)}`, b = i.length > 0, x = i.map((e, t) => `import { ${e.name} as __pe${t} } from '${e.module}'`), S = b ? ", __voltroPluginErrors" : "", C = h.length > 0, w = h.map((e, t) => `import { ${e.name} as __prpc${t} } from '${e.module}'`), T = (e) => e === "query" ? "queryToRpc" : e === "mutation" ? "mutationToRpc" : "actionToRpc", E = h.map((e, t) => `export const ${G(e.tag)} = ${T(e.kind)}(__prpc${t}${S})`), D = h.map((e) => ` ${G(e.tag)},`), O = [...n].sort((e, t) => e.kind === t.kind ? e.rpcTag < t.rpcTag ? -1 : 1 : J(e.kind) - J(t.kind)), k = r(t), A = (e) => `__src_${G(e.rpcTag)}`, j = (e) => {
334
- let t = `./${a(k, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}`;
335
- return `import { ${e.exportName} as ${A(e)} } from '${t}'`;
336
- }, M = (e) => {
337
- let t = G(e.rpcTag), n = A(e);
338
- return e.kind === "query" ? `export const ${t} = queryToRpc(${n}${S})` : e.kind === "mutation" ? `export const ${t} = mutationToRpc(${n}${S})` : e.kind === "action" ? `export const ${t} = actionToRpc(${n}${S})` : e.kind === "stream" ? `export const ${t} = streamToRpc(${n}${S})` : e.kind === "event" ? `export const ${t} = eventToRpc(${n}${S})` : [
334
+ let v = (e) => e.replace(/[^a-zA-Z0-9_$]/g, "_"), y = (e) => `__src_agent_${v(e.name)}`, b = (e) => `__agentRoutes_${v(e.name)}`, x = i.length > 0, S = i.map((e, t) => `import { ${e.name} as __pe${t} } from '${e.module}'`), C = x ? ", __voltroPluginErrors" : "", w = g.length > 0, T = g.map((e, t) => `import { ${e.name} as __prpc${t} } from '${e.module}'`), E = (e) => e === "query" ? "queryToRpc" : e === "mutation" ? "mutationToRpc" : "actionToRpc", D = g.map((e, t) => `export const ${G(e.tag)} = ${E(e.kind)}(withRpcTag(__prpc${t}, ${JSON.stringify(e.tag)})${C})`), O = g.map((e) => ` ${G(e.tag)},`), k = [...n].sort((e, t) => e.kind === t.kind ? e.rpcTag < t.rpcTag ? -1 : 1 : J(e.kind) - J(t.kind)), A = r(t), j = (e) => `__src_${G(e.rpcTag)}`, M = (e) => {
335
+ let t = `./${a(A, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}`;
336
+ return `import { ${e.exportName} as ${j(e)} } from '${t}'`;
337
+ }, N = (e) => {
338
+ let t = G(e.rpcTag), n = j(e);
339
+ return e.kind === "query" ? `export const ${t} = queryToRpc(${n}${C})` : e.kind === "mutation" ? `export const ${t} = mutationToRpc(${n}${C})` : e.kind === "action" ? `export const ${t} = actionToRpc(${n}${C})` : e.kind === "stream" ? `export const ${t} = streamToRpc(${n}${C})` : e.kind === "event" ? `export const ${t} = eventToRpc(${n}${C})` : [
339
340
  `export const ${t} = Rpc.make('${e.rpcTag}', {`,
340
341
  ` payload: strictInput(${n}.payloadSchema),`,
341
342
  " success: WorkflowRunHandleSchema,",
342
343
  ` error: ${n}.errorSchema,`,
343
344
  "})"
344
345
  ].join("\n");
345
- }, N = [...O.filter((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream").map((e) => ` | __AppErrorOf<typeof ${A(e)}>`), ...b ? [" | Schema.Schema.Type<(typeof __voltroPluginErrors)[number]>"] : []], P = N.length > 0, F = O.some((e) => e.kind === "workflow"), I = F ? [
346
+ }, P = [...k.filter((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream").map((e) => ` | __AppErrorOf<typeof ${j(e)}>`), ...x ? [" | Schema.Schema.Type<(typeof __voltroPluginErrors)[number]>"] : []], F = P.length > 0, I = k.some((e) => e.kind === "workflow"), L = I ? [
346
347
  "__voltroWorkflowRun",
347
348
  "__voltroWorkflowRuns",
348
349
  "__voltroWorkflowRunSteps",
@@ -353,27 +354,29 @@ ${o.join("\n\n")}\n`);
353
354
  "__voltroWorkflowResume",
354
355
  "__voltroWorkflowSignal",
355
356
  "__voltroWorkflowUpdate"
356
- ] : [], L = s ? [
357
+ ] : [], R = s ? [
357
358
  "__voltroUndoLog",
358
359
  "__voltroUndoApply",
359
360
  "__voltroUndoRedo"
360
- ] : [], R = O.some((e) => e.requiresApproval === !0), z = R ? ["__voltroApprovalsPending", "__voltroApprovalsDecide"] : [], B = l ? [
361
+ ] : [], z = k.some((e) => e.requiresApproval === !0), B = z ? ["__voltroApprovalsPending", "__voltroApprovalsDecide"] : [], V = l ? [
361
362
  "__voltroConnectionsList",
362
363
  "__voltroConnectionStart",
363
364
  "__voltroConnectionSubmitToken",
364
365
  "__voltroConnectionDisconnect"
365
- ] : [], V = [
366
- ...O.map((e) => ` ${G(e.rpcTag)},`),
366
+ ] : [], H = [
367
+ ...k.map((e) => ` ${G(e.rpcTag)},`),
367
368
  ...o.flatMap((e) => [` ${G(`${e.name}.send`)},`, ` ${G(`${e.name}.messages`)},`]),
368
- ...I.map((e) => ` ${e},`),
369
369
  ...L.map((e) => ` ${e},`),
370
- ...z.map((e) => ` ${e},`),
370
+ ...R.map((e) => ` ${e},`),
371
371
  ...B.map((e) => ` ${e},`),
372
- ...D
373
- ].join("\n"), H = ["queryToRpc"];
374
- (O.some((e) => e.kind === "mutation") || h.some((e) => e.kind === "mutation")) && H.push("mutationToRpc"), (O.some((e) => e.kind === "action") || F || f || h.some((e) => e.kind === "action")) && H.push("actionToRpc"), O.some((e) => e.kind === "stream") && H.push("streamToRpc"), O.some((e) => e.kind === "event") && H.push("eventToRpc"), F && H.push("strictInput", "WorkflowRunHandleSchema", "workflowCancelDescriptor", "workflowDomainEventsQueryDescriptor", "workflowEventDeliveriesQueryDescriptor", "workflowResumeDescriptor", "workflowRunEventsQueryDescriptor", "workflowRunQueryDescriptor", "workflowRunsQueryDescriptor", "workflowRunStepsQueryDescriptor", "workflowSignalDescriptor", "workflowUpdateDescriptor"), s && H.push("mutationToRpc", "undoLogQueryDescriptor", "undoApplyDescriptor", "undoRedoDescriptor"), R && H.push("mutationToRpc", "approvalsPendingQueryDescriptor", "approvalsDecideDescriptor"), l && H.push("mutationToRpc", "actionToRpc", "connectionsListQueryDescriptor", "connectionStartDescriptor", "connectionSubmitTokenDescriptor", "connectionDisconnectDescriptor"), (O.some((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream") || f || F || s || R || l || C) && H.push("normalizeDescriptor");
375
- let U = [...new Set(H)].sort(), W = [...O.filter((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream").map((e) => [e.rpcTag, A(e)]), ...o.flatMap((e) => [[`${e.name}.send`, `${y(e)}.send`], [`${e.name}.messages`, `${y(e)}.messages`]])], K = [
376
- ...F ? [
372
+ ...V.map((e) => ` ${e},`),
373
+ ...O
374
+ ].join("\n"), U = ["queryToRpc"];
375
+ w && U.push("withRpcTag");
376
+ let W = Object.entries(d).sort(([e], [t]) => e < t ? -1 : 1), K = W.length > 0;
377
+ K && U.push("registerPluginAliases"), (k.some((e) => e.kind === "mutation") || g.some((e) => e.kind === "mutation")) && U.push("mutationToRpc"), (k.some((e) => e.kind === "action") || I || m || g.some((e) => e.kind === "action")) && U.push("actionToRpc"), k.some((e) => e.kind === "stream") && U.push("streamToRpc"), k.some((e) => e.kind === "event") && U.push("eventToRpc"), I && U.push("strictInput", "WorkflowRunHandleSchema", "workflowCancelDescriptor", "workflowDomainEventsQueryDescriptor", "workflowEventDeliveriesQueryDescriptor", "workflowResumeDescriptor", "workflowRunEventsQueryDescriptor", "workflowRunQueryDescriptor", "workflowRunsQueryDescriptor", "workflowRunStepsQueryDescriptor", "workflowSignalDescriptor", "workflowUpdateDescriptor"), s && U.push("mutationToRpc", "undoLogQueryDescriptor", "undoApplyDescriptor", "undoRedoDescriptor"), z && U.push("mutationToRpc", "approvalsPendingQueryDescriptor", "approvalsDecideDescriptor"), l && U.push("mutationToRpc", "actionToRpc", "connectionsListQueryDescriptor", "connectionStartDescriptor", "connectionSubmitTokenDescriptor", "connectionDisconnectDescriptor"), (k.some((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream") || m || I || s || z || l || w) && U.push("normalizeDescriptor");
378
+ let Y = [...new Set(U)].sort(), X = [...k.filter((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream").map((e) => [e.rpcTag, j(e)]), ...o.flatMap((e) => [[`${e.name}.send`, `${b(e)}.send`], [`${e.name}.messages`, `${b(e)}.messages`]])], Z = [
379
+ ...I ? [
377
380
  ["__voltro.workflow.run", "workflowRunQueryDescriptor"],
378
381
  ["__voltro.workflow.runs", "workflowRunsQueryDescriptor"],
379
382
  ["__voltro.workflow.run.steps", "workflowRunStepsQueryDescriptor"],
@@ -390,20 +393,20 @@ ${o.join("\n\n")}\n`);
390
393
  ["__voltro.undo.apply", "undoApplyDescriptor"],
391
394
  ["__voltro.undo.redo", "undoRedoDescriptor"]
392
395
  ] : [],
393
- ...R ? [["__voltro.approvals.pending", "approvalsPendingQueryDescriptor"], ["__voltro.approvals.decide", "approvalsDecideDescriptor"]] : [],
396
+ ...z ? [["__voltro.approvals.pending", "approvalsPendingQueryDescriptor"], ["__voltro.approvals.decide", "approvalsDecideDescriptor"]] : [],
394
397
  ...l ? [
395
398
  ["__voltro.connections.list", "connectionsListQueryDescriptor"],
396
399
  ["__voltro.connections.start", "connectionStartDescriptor"],
397
400
  ["__voltro.connections.submitToken", "connectionSubmitTokenDescriptor"],
398
401
  ["__voltro.connections.disconnect", "connectionDisconnectDescriptor"]
399
402
  ] : [],
400
- ...h.map((e, t) => [e.tag, `__prpc${t}`])
401
- ], Y = ([e, t]) => ` ${JSON.stringify(e)}: normalizeDescriptor(${t}),`, X = ([e, t]) => ` readonly ${JSON.stringify(e)}: typeof ${t}`, Z = W.map(Y), Q = K.map(Y), $ = O.filter((e) => e.kind === "workflow").map((e) => ` ${JSON.stringify(e.rpcTag)}: { kind: 'workflow' },`), ne = O.filter((e) => e.kind === "workflow").map((e) => ` readonly ${JSON.stringify(e.rpcTag)}: { readonly kind: 'workflow' }`), re = [
402
- ...W.map(X),
403
- ...ne,
404
- ...K.map(X)
405
- ], ie = O.filter((e) => e.kind === "workflow").map((e) => {
406
- let t = A(e);
403
+ ...g.map((e, t) => [e.tag, `__prpc${t}`])
404
+ ], Q = ([e, t]) => ` ${JSON.stringify(e)}: normalizeDescriptor(${t}),`, $ = ([e, t]) => ` readonly ${JSON.stringify(e)}: typeof ${t}`, ne = X.map(Q), re = Z.map(Q), ie = k.filter((e) => e.kind === "workflow").map((e) => ` ${JSON.stringify(e.rpcTag)}: { kind: 'workflow' },`), ae = k.filter((e) => e.kind === "workflow").map((e) => ` readonly ${JSON.stringify(e.rpcTag)}: { readonly kind: 'workflow' }`), oe = [
405
+ ...X.map($),
406
+ ...ae,
407
+ ...Z.map($)
408
+ ], se = k.filter((e) => e.kind === "workflow").map((e) => {
409
+ let t = j(e);
407
410
  return [
408
411
  ` ${JSON.stringify(e.rpcTag)}: {`,
409
412
  " kind: 'workflow',",
@@ -414,44 +417,53 @@ ${o.join("\n\n")}\n`);
414
417
  ` updates: __voltroWorkflowMessages(${t}).updates,`,
415
418
  " },"
416
419
  ].join("\n");
417
- }), ae = [...O, ...o.map((e) => ({
420
+ }), ce = [...k, ...o.map((e) => ({
418
421
  rpcTag: `agent:${e.name}`,
419
422
  file: e.file
420
423
  }))];
421
424
  return [
422
425
  "// THIS FILE IS GENERATED — DO NOT EDIT BY HAND.",
423
426
  "// Re-emitted by `voltro dev` whenever query/mutation/action/stream/workflow files change.",
424
- `// descriptor-fingerprint: ${p("sha1").update(ae.map((e) => {
427
+ `// descriptor-fingerprint: ${p("sha1").update(ce.map((e) => {
425
428
  let t = "";
426
429
  try {
427
430
  t = c(e.file, "utf8");
428
431
  } catch {}
429
432
  return `${e.rpcTag}\u0000${t}`;
430
433
  }).join("")).digest("hex").slice(0, 16)}`,
431
- `${te}${d}`,
434
+ `${te}${f}`,
432
435
  "// Source files:",
433
- ...O.map((t) => `// - ${a(e, t.file).replace(/\\/g, "/")}`),
436
+ ...k.map((t) => `// - ${a(e, t.file).replace(/\\/g, "/")}`),
434
437
  ...o.map((t) => `// - ${a(e, t.file).replace(/\\/g, "/")} (agent)`),
435
438
  "",
436
- F ? "import { Rpc, RpcGroup } from '@effect/rpc'" : "import { RpcGroup } from '@effect/rpc'",
437
- ...F || P ? ["import { Schema } from 'effect'"] : [],
438
- `import { ${U.join(", ")} } from '@voltro/protocol'`,
439
- ...f ? ["import { agentRouteDescriptors as __voltroAgentRoutes } from '@voltro/ai/agent'"] : [],
439
+ I ? "import { Rpc, RpcGroup } from '@effect/rpc'" : "import { RpcGroup } from '@effect/rpc'",
440
+ ...I || F ? ["import { Schema } from 'effect'"] : [],
441
+ `import { ${Y.join(", ")} } from '@voltro/protocol'`,
442
+ ...m ? ["import { agentRouteDescriptors as __voltroAgentRoutes } from '@voltro/ai/agent'"] : [],
440
443
  "",
441
- ...O.map(j),
442
- ...o.map((e) => `import { ${e.exportName} as ${v(e)} } from './${a(k, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}'`),
443
- ...b ? ["", ...x] : [],
444
- ...C ? ["", ...w] : [],
444
+ ...k.map(M),
445
+ ...o.map((e) => `import { ${e.exportName} as ${y(e)} } from './${a(A, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}'`),
446
+ ...x ? ["", ...S] : [],
447
+ ...w ? ["", ...T] : [],
448
+ ...K ? [
449
+ "",
450
+ "/** Which namespace each installed plugin answers to in THIS app. Read by",
451
+ " * the plugins' own client hooks via `pluginTag()` so an `alias` in",
452
+ " * app.config.ts moves them too, not just the server's routes. */",
453
+ "registerPluginAliases({",
454
+ ...W.map(([e, t]) => ` ${JSON.stringify(e)}: ${JSON.stringify(t)},`),
455
+ "})"
456
+ ] : [],
445
457
  "",
446
- ...o.map((e) => `const ${y(e)} = __voltroAgentRoutes(${v(e)})`),
447
- ...f ? [""] : [],
448
- ...b ? [
458
+ ...o.map((e) => `const ${b(e)} = __voltroAgentRoutes(${y(e)})`),
459
+ ...m ? [""] : [],
460
+ ...x ? [
449
461
  "/** Cross-cutting plugin error schemas, unioned into every rpc's",
450
462
  " * wire error so interceptor failures decode typed on the client. */",
451
463
  `const __voltroPluginErrors = [${i.map((e, t) => `__pe${t}`).join(", ")}] as const`,
452
464
  ""
453
465
  ] : [],
454
- ...F ? [
466
+ ...I ? [
455
467
  "const __voltroEmptyWorkflowMessages = { signals: {}, updates: {} } as const",
456
468
  "const __voltroWorkflowMessages = <const M extends {",
457
469
  " readonly signals: Readonly<Record<string, Schema.Schema.Any>>",
@@ -460,7 +472,7 @@ ${o.join("\n\n")}\n`);
460
472
  " definition.__voltroWorkflowMessages ?? __voltroEmptyWorkflowMessages",
461
473
  "",
462
474
  "export const workflowDescriptors = {",
463
- ...ie,
475
+ ...se,
464
476
  "} as const",
465
477
  "",
466
478
  "export type WorkflowDescriptors = typeof workflowDescriptors",
@@ -479,9 +491,9 @@ ${o.join("\n\n")}\n`);
479
491
  "} }",
480
492
  ""
481
493
  ] : [],
482
- ...O.map(M),
483
- ...o.flatMap((e) => [`export const ${G(`${e.name}.send`)} = actionToRpc(${y(e)}.send${S})`, `export const ${G(`${e.name}.messages`)} = queryToRpc(${y(e)}.messages${S})`]),
484
- ...F ? [
494
+ ...k.map(N),
495
+ ...o.flatMap((e) => [`export const ${G(`${e.name}.send`)} = actionToRpc(${b(e)}.send${C})`, `export const ${G(`${e.name}.messages`)} = queryToRpc(${b(e)}.messages${C})`]),
496
+ ...I ? [
485
497
  "export const __voltroWorkflowRun = queryToRpc(workflowRunQueryDescriptor)",
486
498
  "export const __voltroWorkflowRuns = queryToRpc(workflowRunsQueryDescriptor)",
487
499
  "export const __voltroWorkflowRunSteps = queryToRpc(workflowRunStepsQueryDescriptor)",
@@ -498,26 +510,26 @@ ${o.join("\n\n")}\n`);
498
510
  "export const __voltroUndoApply = mutationToRpc(undoApplyDescriptor)",
499
511
  "export const __voltroUndoRedo = mutationToRpc(undoRedoDescriptor)"
500
512
  ] : [],
501
- ...R ? ["export const __voltroApprovalsPending = queryToRpc(approvalsPendingQueryDescriptor)", "export const __voltroApprovalsDecide = mutationToRpc(approvalsDecideDescriptor)"] : [],
513
+ ...z ? ["export const __voltroApprovalsPending = queryToRpc(approvalsPendingQueryDescriptor)", "export const __voltroApprovalsDecide = mutationToRpc(approvalsDecideDescriptor)"] : [],
502
514
  ...l ? [
503
515
  "export const __voltroConnectionsList = queryToRpc(connectionsListQueryDescriptor)",
504
516
  "export const __voltroConnectionStart = actionToRpc(connectionStartDescriptor)",
505
517
  "export const __voltroConnectionSubmitToken = mutationToRpc(connectionSubmitTokenDescriptor)",
506
518
  "export const __voltroConnectionDisconnect = mutationToRpc(connectionDisconnectDescriptor)"
507
519
  ] : [],
508
- ...E,
520
+ ...D,
509
521
  "",
510
522
  "export const appGroup = RpcGroup.make(",
511
- V,
523
+ H,
512
524
  ")",
513
525
  "",
514
526
  "/** Per-rpc-tag metadata for the client. Drives auto-optimistic etc.",
515
527
  " * Function fields (target.shape, target.identify) survive because",
516
528
  " * the descriptors themselves are imported by reference. */",
517
529
  "export const appDescriptors = {",
518
- ...Z,
519
- ...$,
520
- ...Q,
530
+ ...ne,
531
+ ...ie,
532
+ ...re,
521
533
  "} as const",
522
534
  "",
523
535
  "export type AppDescriptors = typeof appDescriptors",
@@ -541,16 +553,16 @@ ${o.join("\n\n")}\n`);
541
553
  " * Types only — erased at build time, so importing it costs the bundle",
542
554
  " * nothing. */",
543
555
  "export type AppProcedures = {",
544
- ...re,
556
+ ...oe,
545
557
  "}",
546
558
  "",
547
- ...P ? [
559
+ ...F ? [
548
560
  "type __AppErrorOf<D> = D extends { readonly error: infer E extends Schema.Schema.Any } ? Schema.Schema.Type<E> : never",
549
561
  "/** Union of every typed error the app's rpcs can fail with — the declared",
550
562
  " * `error:` schemas + cross-cutting plugin errors. Generated by reference,",
551
563
  " * so it can never drift out of date. (Workflows: see `WorkflowErrors`.) */",
552
564
  "export type AppError =",
553
- ...N,
565
+ ...P,
554
566
  "/** The `_tag` literal of every AppError — the exhaustive key set for `matchError`. */",
555
567
  "export type AppErrorTag = AppError extends { readonly _tag: infer T extends string } ? T : never",
556
568
  "",
@@ -594,7 +606,7 @@ ${o.join("\n\n")}\n`);
594
606
  "workflows"
595
607
  ]), p = (e) => e.slice(e.lastIndexOf("/") + 1), m = u;
596
608
  for (; m !== t && d.has(p(m));) m = m.slice(0, m.lastIndexOf("/")) || "/";
597
- let h = o(e.outputFile ?? i(m, "rpcGroup.generated.ts")), g = [...new Map((e.pluginErrorImports ?? []).map((e) => [`${e.module}#${e.name}`, e])).values()], _ = [...new Map((e.pluginRpcImports ?? []).map((e) => [e.tag, e])).values()], v = await Y(r(h)), y = Q(t, h, a, g, c, f(), l, _, v), b = [];
609
+ let h = o(e.outputFile ?? i(m, "rpcGroup.generated.ts")), g = [...new Map((e.pluginErrorImports ?? []).map((e) => [`${e.module}#${e.name}`, e])).values()], _ = [...new Map((e.pluginRpcImports ?? []).map((e) => [e.tag, e])).values()], v = await Y(r(h)), y = Q(t, h, a, g, c, f(), l, _, e.pluginAliases ?? {}, v), b = [];
598
610
  for (let t of e.pluginContributions ?? []) {
599
611
  let e = null;
600
612
  try {
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./codegen-Bth5lUTU.js";
2
+ export { e as checkRpcGroupFreshness };
@@ -1,36 +1,37 @@
1
- import { Dn as e, En as t, V as n, l as r, u as i } from "./dev-CmuvUKRq.js";
2
- import { n as a } from "./frameworkTableAssembly-D7LJuALW.js";
3
- import { i as o, r as s } from "./codegen-DSLM8Su9.js";
1
+ import { An as e, V as t, kn as n, l as r, u as i } from "./dev-Dw263KPu.js";
2
+ import { n as a } from "./frameworkTableAssembly-DNOFXfEQ.js";
3
+ import { i as o, r as s } from "./codegen-Bth5lUTU.js";
4
4
  import { n as c, r as l } from "./mobileCommand-D9O6iq3D.js";
5
5
  import { basename as u, relative as d, resolve as f } from "node:path";
6
6
  //#region src/codegenCommand.ts
7
- var p = async (t) => {
8
- let { config: i, present: a, error: o } = await r(t);
7
+ var p = async (n) => {
8
+ let { config: i, present: a, error: o } = await r(n);
9
9
  if (a && i === null) return {
10
10
  kind: "refused",
11
11
  reason: "app.config.ts exists but could not be loaded" + (o === void 0 ? "" : ` — ${o instanceof Error ? o.message : String(o)}`)
12
12
  };
13
- let c = i?.plugins ?? [], { pluginContributions: l, pluginErrorImports: d, pluginRpcImports: f } = await n(c, i?.name ?? u(t), t), p = await s({
14
- root: t,
13
+ let c = i?.plugins ?? [], { pluginContributions: l, pluginErrorImports: d, pluginRpcImports: f, pluginAliases: p } = await t(c, i?.name ?? u(n), n), h = await s({
14
+ root: n,
15
15
  ...l.length > 0 ? { pluginContributions: l } : {},
16
16
  ...d.length > 0 ? { pluginErrorImports: d } : {},
17
17
  ...f.length > 0 ? { pluginRpcImports: f } : {},
18
+ ...Object.keys(p).length > 0 ? { pluginAliases: p } : {},
18
19
  ...i?.name === void 0 ? {} : { apiName: i.name }
19
20
  });
20
- if (!p) return { kind: "nothing-to-write" };
21
- let h = await m(t, i), g = await e(p, h);
21
+ if (!h) return { kind: "nothing-to-write" };
22
+ let g = await m(n, i), _ = await e(h, g);
22
23
  return {
23
24
  kind: "wrote",
24
- file: p,
25
+ file: h,
25
26
  plugins: c.length,
26
27
  errorSchemas: d.length,
27
28
  routes: f.length,
28
- tables: h.size,
29
- dts: g
29
+ tables: g.size,
30
+ dts: _
30
31
  };
31
- }, m = async (e, n) => {
32
+ }, m = async (e, t) => {
32
33
  let r = await o(e), { tables: s } = await i(r), c = await a({ root: e });
33
- return t(s, c, n?.analytics?.tables ?? []);
34
+ return n(s, c, t?.analytics?.tables ?? []);
34
35
  }, h = async (e) => {
35
36
  let t = f(e.find((e) => !e.startsWith("-")) ?? process.cwd()), n = await l(t);
36
37
  if (n.apis.kind !== "not-a-mobile-app") return c(t, n);