@voltro/cli 0.46.0 → 0.47.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 (93) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/apiBuild-BsooZpw2.js +2 -0
  3. package/dist/{apiBuild-BKdd0I1Z.js → apiBuild-FpHCWiv6.js} +1 -1
  4. package/dist/bin.js +1 -1
  5. package/dist/{build-co6yadYz.js → build-zVygXxGB.js} +7 -7
  6. package/dist/{checkCommand-CXAXTjZL.js → checkCommand-B2Fw73lu.js} +1 -1
  7. package/dist/{checkCommand-B-eiW-G_.js → checkCommand-D0dAKciE.js} +4 -4
  8. package/dist/{codegen-sbN1Y8PB.js → codegen-CrMXs4hb.js} +176 -162
  9. package/dist/codegen-DiMn2KkZ.js +2 -0
  10. package/dist/{codegenCommand-CB6_3sX0.js → codegenCommand-BTtsnRus.js} +3 -3
  11. package/dist/{commands-C-hxgAGr.js → commands-BrFKxnYW.js} +18 -18
  12. package/dist/{dashboardCommand-CEVO0GWF.js → dashboardCommand-D9SjDc8E.js} +1 -1
  13. package/dist/{dataCommand-k0ezbQWa.js → dataCommand-Dl11q14e.js} +2 -2
  14. package/dist/dbCommand-BUD4Fd8v.js +2 -0
  15. package/dist/{dbCommand-BwkyNxn-.js → dbCommand-jbrmzwW_.js} +1 -1
  16. package/dist/{dev-DyoYst4j.js → dev-CaIfZnw5.js} +1 -1
  17. package/dist/{dev-8hTEnN6s.js → dev-RjB7eE_B.js} +2 -2
  18. package/dist/doctorCommand-5zv6PN-G.js +2 -0
  19. package/dist/{doctorCommand-B6D7HH1-.js → doctorCommand-D7X29cw6.js} +13 -13
  20. package/dist/{doctorSourceRelations-CPjSwYuZ.js → doctorSourceRelations-Dd48LPvO.js} +15 -10
  21. package/dist/{dormancyCommand-CrPAwOgo.js → dormancyCommand-BGOP27fz.js} +1 -1
  22. package/dist/{embeddingsCommand-DsSxsn_b.js → embeddingsCommand-D72E22bw.js} +1 -1
  23. package/dist/{envCommand-B_NPVGUf.js → envCommand-BHSxz6wC.js} +1 -1
  24. package/dist/{evolveCommand-DUuaCIyn.js → evolveCommand-C2ofGGlz.js} +1 -1
  25. package/dist/{frameworkTableAssembly-BPlPfU07.js → frameworkTableAssembly-BvZ0Lil_.js} +76 -72
  26. package/dist/frameworkTableAssembly-DDKtwsy2.js +2 -0
  27. package/dist/index.js +1 -1
  28. package/dist/{migrate-CM1qwalu.js → migrate-odCPGHPq.js} +2 -2
  29. package/dist/{runtimeTrace-BRNM06vK.js → runtimeTrace-C_OKr0jY.js} +1 -1
  30. package/dist/{sdkgen-CRCw_XcR.js → sdkgen-D9trW7sl.js} +1 -1
  31. package/dist/{serveCommand-CHOr74WM.js → serveCommand-BU0wfV6V.js} +388 -385
  32. package/dist/serveCommand-Bwrn_9Fn.js +2 -0
  33. package/dist/serveEntry.js +1 -1
  34. package/dist/{test-CHb7UwvE.js → test-rXFq4S76.js} +1 -1
  35. package/dist/{webhooksCommand-BRrG_sGf.js → webhooksCommand-BqcWcbuW.js} +1 -1
  36. package/package.json +17 -17
  37. package/templates/AGENTS.md +1 -1
  38. package/templates/agent-docs/_index.md +1 -1
  39. package/templates/agent-docs/cli.md +28 -0
  40. package/templates/agent-docs/whats-new.md +14 -160
  41. package/templates/apps/api-ai/package.json +7 -7
  42. package/templates/apps/api-auth/package.json +8 -8
  43. package/templates/apps/api-backend/package.json +7 -7
  44. package/templates/apps/api-backend-deactivation/package.json +7 -7
  45. package/templates/apps/api-backend-mail/package.json +8 -8
  46. package/templates/apps/api-backend-mariadb/package.json +9 -9
  47. package/templates/apps/api-backend-sqlite/package.json +8 -8
  48. package/templates/apps/api-backend-storage/package.json +8 -8
  49. package/templates/apps/api-cms/package.json +10 -10
  50. package/templates/apps/api-collab/package.json +8 -8
  51. package/templates/apps/api-data-advanced/package.json +8 -8
  52. package/templates/apps/api-durable/package.json +8 -8
  53. package/templates/apps/api-feature-flags/package.json +9 -9
  54. package/templates/apps/api-governance/package.json +8 -8
  55. package/templates/apps/api-kv/package.json +8 -8
  56. package/templates/apps/api-moderation/package.json +8 -8
  57. package/templates/apps/api-observability/package.json +8 -8
  58. package/templates/apps/api-ratelimit/package.json +8 -8
  59. package/templates/apps/api-rbac/package.json +8 -8
  60. package/templates/apps/api-rest/package.json +7 -7
  61. package/templates/apps/api-saas/package.json +11 -11
  62. package/templates/apps/api-saas-starter/package.json +10 -10
  63. package/templates/apps/api-search/package.json +8 -8
  64. package/templates/apps/api-status/package.json +8 -8
  65. package/templates/apps/api-versioning/package.json +8 -8
  66. package/templates/apps/api-webhooks/package.json +9 -9
  67. package/templates/apps/changelog/package.json +6 -6
  68. package/templates/apps/edge-functions/package.json +2 -2
  69. package/templates/apps/frontend-admin/package.json +8 -8
  70. package/templates/apps/frontend-app/package.json +9 -9
  71. package/templates/apps/frontend-auth/package.json +8 -8
  72. package/templates/apps/frontend-blank/package.json +7 -7
  73. package/templates/apps/frontend-cms/package.json +9 -9
  74. package/templates/apps/frontend-collab/package.json +10 -10
  75. package/templates/apps/frontend-contact/package.json +7 -7
  76. package/templates/apps/frontend-dashboard/package.json +7 -7
  77. package/templates/apps/frontend-docs/package.json +7 -7
  78. package/templates/apps/frontend-i18n/package.json +6 -6
  79. package/templates/apps/frontend-landing/package.json +7 -7
  80. package/templates/apps/frontend-portal/package.json +8 -8
  81. package/templates/apps/frontend-saas/package.json +8 -8
  82. package/templates/apps/frontend-spa/package.json +7 -7
  83. package/templates/apps/frontend-ssr/package.json +7 -7
  84. package/templates/apps/frontend-ssr-api/package.json +8 -8
  85. package/templates/apps/frontend-static-blog/package.json +6 -6
  86. package/templates/apps/frontend-status/package.json +8 -8
  87. package/templates/apps/mobile-app/package.json +4 -4
  88. package/dist/apiBuild-P2gewrfQ.js +0 -2
  89. package/dist/codegen-DcE2li1i.js +0 -2
  90. package/dist/dbCommand-C2XK63Dd.js +0 -2
  91. package/dist/doctorCommand-Btl2Jz1a.js +0 -2
  92. package/dist/frameworkTableAssembly-Bob3vj9R.js +0 -2
  93. package/dist/serveCommand-BNHMVXyp.js +0 -2
@@ -1,13 +1,13 @@
1
- import { o as e } from "./fileConventions-Cof68_BL.js";
2
- import { dirname as t, join as n, relative as r, resolve as i } from "node:path";
3
- import { promises as a, readFileSync as o } from "node:fs";
4
- import { pathToFileURL as s } from "node:url";
5
- import { isEventDescriptor as c, isWireReachable as l } from "@voltro/protocol";
6
- import { undoSurfaceEnabled as u } from "@voltro/runtime";
7
- import { createHash as d } from "node:crypto";
8
- import { isAgentDescriptor as f } from "@voltro/ai/agent";
1
+ import { b as e, o as t, y as n } from "./fileConventions-Cof68_BL.js";
2
+ import { dirname as r, join as i, relative as a, resolve as o } from "node:path";
3
+ import { promises as s, readFileSync as c } from "node:fs";
4
+ import { pathToFileURL as l } from "node:url";
5
+ import { isEventDescriptor as u, isWireReachable as d } from "@voltro/protocol";
6
+ import { undoSurfaceEnabled as f } from "@voltro/runtime";
7
+ import { createHash as p } from "node:crypto";
8
+ import { isAgentDescriptor as m } from "@voltro/ai/agent";
9
9
  //#region src/browserSafetyGuard.ts
10
- var p = /* @__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(".")), m = (e) => e.startsWith("node:") || p.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/") || [
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
13
  "@voltro/protocol/apikey"
@@ -26,8 +26,8 @@ var p = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.http
26
26
  "@prisma/client",
27
27
  "nodemailer",
28
28
  "jose"
29
- ].includes(e)), h = (e) => e.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/[^\n]*/g, "$1"), g = (e) => {
30
- let t = h(e), n = [], r = /(?:^|[\n;}])\s*(?:import|export)\s+([^;'"]*?)\s+from\s+['"]([^'"]+)['"]/g, i;
29
+ ].includes(e)), _ = (e) => e.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/[^\n]*/g, "$1"), v = (e) => {
30
+ let t = _(e), n = [], r = /(?:^|[\n;}])\s*(?:import|export)\s+([^;'"]*?)\s+from\s+['"]([^'"]+)['"]/g, i;
31
31
  for (; (i = r.exec(t)) !== null;) {
32
32
  let e = i[1].trim();
33
33
  if (e === "type" || e.startsWith("type ")) continue;
@@ -43,29 +43,29 @@ var p = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.http
43
43
  let o = /\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;
44
44
  for (; (i = o.exec(t)) !== null;) n.push(i[1]);
45
45
  return n;
46
- }, _ = (e) => e.endsWith(".ts") || e.endsWith(".tsx"), v = async (e) => {
47
- let t = _(e) ? [e] : [
46
+ }, y = (e) => e.endsWith(".ts") || e.endsWith(".tsx"), b = async (e) => {
47
+ let t = y(e) ? [e] : [
48
48
  `${e}.ts`,
49
49
  `${e}.tsx`,
50
- n(e, "index.ts"),
51
- n(e, "index.tsx")
50
+ i(e, "index.ts"),
51
+ i(e, "index.tsx")
52
52
  ];
53
53
  for (let e of t) try {
54
- if ((await a.stat(e)).isFile()) return e;
54
+ if ((await s.stat(e)).isFile()) return e;
55
55
  } catch {}
56
56
  return null;
57
- }, y = async (e, r) => {
58
- let i = r;
57
+ }, x = async (e, t) => {
58
+ let n = t;
59
59
  for (;;) {
60
- let r = n(i, "node_modules", e);
60
+ let t = i(n, "node_modules", e);
61
61
  try {
62
- if ((await a.stat(r)).isDirectory()) return r;
62
+ if ((await s.stat(t)).isDirectory()) return t;
63
63
  } catch {}
64
- let o = t(i);
65
- if (o === i) return null;
66
- i = o;
64
+ let a = r(n);
65
+ if (a === n) return null;
66
+ n = a;
67
67
  }
68
- }, b = (e) => {
68
+ }, S = (e) => {
69
69
  if (typeof e == "string") return e;
70
70
  if (typeof e == "object" && e) {
71
71
  let t = e;
@@ -75,65 +75,65 @@ var p = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.http
75
75
  "node",
76
76
  "default"
77
77
  ]) if (e in t) {
78
- let n = b(t[e]);
78
+ let n = S(t[e]);
79
79
  if (n !== void 0) return n;
80
80
  }
81
81
  }
82
- }, x = async (e, r) => {
83
- if (e.startsWith(".")) return v(i(t(r), e));
84
- let o = e.split("/"), s = e.startsWith("@"), c = s ? `${o[0]}/${o[1]}` : o[0], l = s ? o.slice(2) : o.slice(1), u = l.length > 0 ? `./${l.join("/")}` : ".", d = await y(c, t(r));
82
+ }, C = async (e, t) => {
83
+ if (e.startsWith(".")) return b(o(r(t), e));
84
+ let n = e.split("/"), a = e.startsWith("@"), c = a ? `${n[0]}/${n[1]}` : n[0], l = a ? n.slice(2) : n.slice(1), u = l.length > 0 ? `./${l.join("/")}` : ".", d = await x(c, r(t));
85
85
  if (!d) return null;
86
86
  try {
87
- let e = JSON.parse(await a.readFile(n(d, "package.json"), "utf8")), t = b(e.exports?.[u]) ?? (u === "." ? e.module ?? e.main : void 0);
88
- if (typeof t == "string") return v(i(d, t));
87
+ let e = JSON.parse(await s.readFile(i(d, "package.json"), "utf8")), t = S(e.exports?.[u]) ?? (u === "." ? e.module ?? e.main : void 0);
88
+ if (typeof t == "string") return b(o(d, t));
89
89
  } catch {}
90
90
  return null;
91
- }, S = (e, t) => e.startsWith(t) ? e.slice(t.length).replace(/^[/\\]/, "") : e, C = async (e, t) => {
91
+ }, w = (e, t) => e.startsWith(t) ? e.slice(t.length).replace(/^[/\\]/, "") : e, T = async (e, t) => {
92
92
  let n = /* @__PURE__ */ new Set(), r = [{
93
93
  file: e,
94
- chain: [S(e, t)]
94
+ chain: [w(e, t)]
95
95
  }];
96
96
  for (; r.length > 0;) {
97
97
  let { file: e, chain: i } = r.shift();
98
98
  if (n.has(e)) continue;
99
99
  n.add(e);
100
- let o;
100
+ let a;
101
101
  try {
102
- o = await a.readFile(e, "utf8");
102
+ a = await s.readFile(e, "utf8");
103
103
  } catch {
104
104
  continue;
105
105
  }
106
- for (let a of g(o)) {
107
- if (m(a)) return {
108
- specifier: a,
109
- chain: [...i, a]
106
+ for (let o of v(a)) {
107
+ if (g(o)) return {
108
+ specifier: o,
109
+ chain: [...i, o]
110
110
  };
111
- let o = await x(a, e);
112
- o && !n.has(o) && r.push({
113
- file: o,
114
- chain: [...i, `${a} (${S(o, t)})`]
111
+ let a = await C(o, e);
112
+ a && !n.has(a) && r.push({
113
+ file: a,
114
+ chain: [...i, `${o} (${w(a, t)})`]
115
115
  });
116
116
  }
117
117
  }
118
118
  return null;
119
- }, w = /\.client\.tsx?$/, T = async (e, t) => {
119
+ }, E = /\.client\.tsx?$/, D = async (e, t) => {
120
120
  let n = [];
121
121
  for (let r of t) {
122
- if (!w.test(r)) continue;
123
- let t = await C(r, e);
122
+ if (!E.test(r)) continue;
123
+ let t = await T(r, e);
124
124
  t !== null && n.push({
125
- file: S(r, e),
125
+ file: w(r, e),
126
126
  violation: t
127
127
  });
128
128
  }
129
129
  return n;
130
- }, E = (e) => `browser-safety violation — ${e.file} declares itself browser-safe (.client.ts) and is not.\n\n '${e.violation.specifier}' is server-only (node:* / database / ai / cluster / protocol session / db driver).\n\n import chain:\n → ${e.violation.chain.join("\n → ")}\n\n The .client suffix is a claim the framework checks, not a hint. Either move the server-only\n code behind a *.server.ts and keep this file pure, or drop the suffix — an unmarked file\n makes no claim, and only the rpcGroup guard will judge it (later, and with a longer chain).`, D = async (e) => {
130
+ }, O = (e) => `browser-safety violation — ${e.file} declares itself browser-safe (.client.ts) and is not.\n\n '${e.violation.specifier}' is server-only (node:* / database / ai / cluster / protocol session / db driver).\n\n import chain:\n → ${e.violation.chain.join("\n → ")}\n\n The .client suffix is a claim the framework checks, not a hint. Either move the server-only\n code behind a *.server.ts and keep this file pure, or drop the suffix — an unmarked file\n makes no claim, and only the rpcGroup guard will judge it (later, and with a longer chain).`, k = async (e) => {
131
131
  if (process.env.VOLTRO_BROWSER_SAFETY === "off") return;
132
- let n = await C(e, t(e));
133
- if (!n) return;
134
- let r = n.chain.join("\n → ");
135
- throw Error(`browser-safety violation — the generated rpcGroup pulls a SERVER-ONLY module into the client bundle.\n\n '${n.specifier}' is server-only (node:* / database / ai / cluster / protocol session / db driver),\n and the web client loads rpcGroup VALUE-LEVEL — this crashes the browser with\n "Module …node:crypto… has been externalized for browser compatibility", or bloats the\n bundle with the whole server graph.\n\n import chain:\n → ${r}\n\n Fix: keep the descriptor (*.query/.mutation/.action.ts), the workflow descriptor\n (*.workflow.tsx, import from @voltro/workflow/define), AND any plugin error schema\n browser-safe. Move DB-backed / node: code behind a *.server.ts file or a browser-safe\n subpath (e.g. a plugin's '/errors' export). Escape hatch (not recommended):\n VOLTRO_BROWSER_SAFETY=off.`);
136
- }, O = /\.(query|mutation|action|stream)\.ts$/, k = /\.(query|mutation|action|stream)\.server\.ts$/, A = /\.workflow\.tsx$/, j = /(?<!\.server)\.agent\.tsx?$/, M = /\.connection\.tsx?$/, N = /* @__PURE__ */ new Set([
132
+ let t = await T(e, r(e));
133
+ if (!t) return;
134
+ let n = t.chain.join("\n → ");
135
+ throw Error(`browser-safety violation — the generated rpcGroup pulls a SERVER-ONLY module into the client bundle.\n\n '${t.specifier}' is server-only (node:* / database / ai / cluster / protocol session / db driver),\n and the web client loads rpcGroup VALUE-LEVEL — this crashes the browser with\n "Module …node:crypto… has been externalized for browser compatibility", or bloats the\n bundle with the whole server graph.\n\n import chain:\n → ${n}\n\n Fix: keep the descriptor (*.query/.mutation/.action.ts), the workflow descriptor\n (*.workflow.tsx, import from @voltro/workflow/define), AND any plugin error schema\n browser-safe. Move DB-backed / node: code behind a *.server.ts file or a browser-safe\n subpath (e.g. a plugin's '/errors' export). Escape hatch (not recommended):\n VOLTRO_BROWSER_SAFETY=off.`);
136
+ }, A = /\.(query|mutation|action|stream)\.ts$/, j = /\.(query|mutation|action|stream)\.server\.ts$/, M = /\.workflow\.tsx$/, N = /(?<!\.server)\.agent\.tsx?$/, P = /\.connection\.tsx?$/, F = /* @__PURE__ */ new Set([
137
137
  "node_modules",
138
138
  "dist",
139
139
  "build",
@@ -141,29 +141,43 @@ var p = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.http
141
141
  ".vite",
142
142
  ".next",
143
143
  ".git"
144
- ]), P = async (e) => {
144
+ ]), I = async (e) => {
145
145
  let t = async (e) => {
146
- let r = await a.readdir(e, { withFileTypes: !0 }).catch(() => []);
147
- for (let i of r) if (!N.has(i.name)) {
148
- if (i.isDirectory()) {
149
- if (await t(n(e, i.name))) return !0;
150
- } else if (i.isFile() && M.test(i.name)) return !0;
146
+ let n = await s.readdir(e, { withFileTypes: !0 }).catch(() => []);
147
+ for (let r of n) if (!F.has(r.name)) {
148
+ if (r.isDirectory()) {
149
+ if (await t(i(e, r.name))) return !0;
150
+ } else if (r.isFile() && P.test(r.name)) return !0;
151
151
  }
152
152
  return !1;
153
153
  };
154
154
  return t(e);
155
- }, F = async (e) => I(e), I = async (t) => {
156
- let r = [], i = async (t) => {
157
- let o = await a.readdir(t, { withFileTypes: !0 });
158
- for (let a of o) {
159
- if (N.has(a.name)) continue;
160
- let o = n(t, a.name);
161
- a.isDirectory() ? await i(o) : a.isFile() && (O.test(a.name) && !k.test(a.name) || A.test(a.name) || j.test(a.name) || e.test(a.name)) && r.push(o);
155
+ }, L = async (t) => {
156
+ let r = [], a = async (t) => {
157
+ let o = await s.readdir(t, { withFileTypes: !0 });
158
+ for (let s of o) {
159
+ if (F.has(s.name)) continue;
160
+ let o = i(t, s.name);
161
+ if (s.isDirectory()) {
162
+ await a(o);
163
+ continue;
164
+ }
165
+ s.isFile() && (e.test(s.name) || n.test(s.name)) && r.push(o);
166
+ }
167
+ };
168
+ return await a(t), r;
169
+ }, R = async (e) => {
170
+ let n = [], r = async (e) => {
171
+ let a = await s.readdir(e, { withFileTypes: !0 });
172
+ for (let o of a) {
173
+ if (F.has(o.name)) continue;
174
+ let a = i(e, o.name);
175
+ o.isDirectory() ? await r(a) : o.isFile() && (A.test(o.name) && !j.test(o.name) || M.test(o.name) || N.test(o.name) || t.test(o.name)) && n.push(a);
162
176
  }
163
177
  };
164
- return await i(t), r;
165
- }, L = (e) => typeof e == "object" && !!e && "kind" in e && "name" in e && (e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream"), R = Symbol.for("@effect/workflow/Workflow"), z = (e) => typeof e == "object" && !!e && R in e && "name" in e && typeof e.name == "string", B = async (e) => Promise.all(e.map((e) => import(s(e).href))), V = async (e) => {
166
- let t = [], n = await B(e);
178
+ return await r(e), n;
179
+ }, z = (e) => typeof e == "object" && !!e && "kind" in e && "name" in e && (e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream"), B = Symbol.for("@effect/workflow/Workflow"), V = (e) => typeof e == "object" && !!e && B in e && "name" in e && typeof e.name == "string", H = async (e) => Promise.all(e.map((e) => import(l(e).href))), U = async (e) => {
180
+ let t = [], n = await H(e);
167
181
  for (let [r, i] of e.entries()) {
168
182
  let e = n[r], a = /* @__PURE__ */ new Set();
169
183
  for (let [n, r] of Object.entries(e)) {
@@ -171,8 +185,8 @@ var p = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.http
171
185
  if (a.has(r)) continue;
172
186
  a.add(r);
173
187
  }
174
- if (L(r)) {
175
- if (!l(r)) continue;
188
+ if (z(r)) {
189
+ if (!d(r)) continue;
176
190
  t.push({
177
191
  file: i,
178
192
  exportName: n,
@@ -180,12 +194,12 @@ var p = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.http
180
194
  kind: r.kind,
181
195
  ...r.requiresApproval == null ? {} : { requiresApproval: !0 }
182
196
  });
183
- } else c(r) ? t.push({
197
+ } else u(r) ? t.push({
184
198
  file: i,
185
199
  exportName: n,
186
200
  rpcTag: r.name,
187
201
  kind: "event"
188
- }) : z(r) && t.push({
202
+ }) : V(r) && t.push({
189
203
  file: i,
190
204
  exportName: n,
191
205
  rpcTag: r.name,
@@ -194,36 +208,36 @@ var p = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.http
194
208
  }
195
209
  }
196
210
  return t;
197
- }, H = async (e) => {
198
- let t = [], n = e.filter((e) => j.test(e)), r = await B(n);
199
- for (let [e, i] of n.entries()) for (let [n, a] of Object.entries(r[e])) f(a) && t.push({
211
+ }, W = async (e) => {
212
+ let t = [], n = e.filter((e) => N.test(e)), r = await H(n);
213
+ for (let [e, i] of n.entries()) for (let [n, a] of Object.entries(r[e])) m(a) && t.push({
200
214
  file: i,
201
215
  exportName: n,
202
216
  name: a.name
203
217
  });
204
218
  return t;
205
- }, U = (e) => {
219
+ }, G = (e) => {
206
220
  let t = (e, t) => e.split(/[^a-zA-Z0-9]+/).filter(Boolean).map((e, n) => (n === 0 && !t ? e.charAt(0).toLowerCase() : e.charAt(0).toUpperCase()) + e.slice(1)).join(""), n = e.split(".");
207
221
  return `${t(n[0] ?? "rpc", !1)}${n.slice(1).map((e) => t(e, !0)).join("")}Rpc`;
208
- }, W = /^[A-Za-z][A-Za-z0-9]*([._-][A-Za-z0-9]+)*$/, G = (e, t) => {
209
- let n = (e) => r(t, e.file).replace(/\\/g, "/"), i = e.filter((e) => !W.test(e.rpcTag));
210
- if (i.length > 0) throw Error(`invalid rpc tag — a procedure/workflow \`name\` must start with a letter and
222
+ }, K = /^[A-Za-z][A-Za-z0-9]*([._-][A-Za-z0-9]+)*$/, q = (e, t) => {
223
+ let n = (e) => a(t, e.file).replace(/\\/g, "/"), r = e.filter((e) => !K.test(e.rpcTag));
224
+ if (r.length > 0) throw Error(`invalid rpc tag — a procedure/workflow \`name\` must start with a letter and
211
225
  use only letters, digits, and \`.\` \`-\` \`_\` separators (the tag becomes a JS
212
226
  identifier in the generated rpcGroup):
213
227
 
214
- ${i.map((e) => ` • "${e.rpcTag}" (${n(e)})`).join("\n")}\n`);
215
- let a = /* @__PURE__ */ new Map();
228
+ ${r.map((e) => ` • "${e.rpcTag}" (${n(e)})`).join("\n")}\n`);
229
+ let i = /* @__PURE__ */ new Map();
216
230
  for (let t of e) {
217
- let e = U(t.rpcTag), n = a.get(e);
218
- n ? n.push(t) : a.set(e, [t]);
231
+ let e = G(t.rpcTag), n = i.get(e);
232
+ n ? n.push(t) : i.set(e, [t]);
219
233
  }
220
- let o = [...a.values()].filter((e) => new Set(e.map((e) => e.rpcTag)).size > 1);
234
+ let o = [...i.values()].filter((e) => new Set(e.map((e) => e.rpcTag)).size > 1);
221
235
  if (o.length > 0) throw Error(`rpc tag identifier collision — these distinct tags collapse to the same
222
236
  generated identifier (separators are normalized away). Rename one so they
223
237
  differ by more than a \`.\`/\`-\`/\`_\`:
224
238
 
225
- ${o.map((e) => ` ${U(e[0].rpcTag)}:\n` + e.map((e) => ` - "${e.rpcTag}" (${n(e)})`).join("\n")).join("\n\n")}\n`);
226
- }, K = (e) => {
239
+ ${o.map((e) => ` ${G(e[0].rpcTag)}:\n` + e.map((e) => ` - "${e.rpcTag}" (${n(e)})`).join("\n")).join("\n\n")}\n`);
240
+ }, J = (e) => {
227
241
  switch (e) {
228
242
  case "query": return 0;
229
243
  case "mutation": return 1;
@@ -232,66 +246,66 @@ ${o.map((e) => ` ${U(e[0].rpcTag)}:\n` + e.map((e) => ` - "${e.rpcTag}" (${
232
246
  case "event": return 4;
233
247
  case "workflow": return 5;
234
248
  }
235
- }, q = (e, t) => {
249
+ }, ee = (e, t) => {
236
250
  let n = /* @__PURE__ */ new Map();
237
251
  for (let t of e) n.has(t.rpcTag) || n.set(t.rpcTag, t);
238
- let i = [...n.keys()], a = (e) => r(t, n.get(e).file).replace(/\\/g, "/"), o = [];
239
- for (let e of i) {
240
- let t = i.filter((t) => t.startsWith(`${e}.`)).sort();
252
+ let r = [...n.keys()], i = (e) => a(t, n.get(e).file).replace(/\\/g, "/"), o = [];
253
+ for (let e of r) {
254
+ let t = r.filter((t) => t.startsWith(`${e}.`)).sort();
241
255
  if (t.length === 0) continue;
242
- let n = t.map((e) => ` - ${e} (${a(e)})`).join("\n");
243
- o.push(` • "${e}" (${a(e)})\n is a procedure AND the namespace prefix of:\n${n}`);
256
+ let n = t.map((e) => ` - ${e} (${i(e)})`).join("\n");
257
+ o.push(` • "${e}" (${i(e)})\n is a procedure AND the namespace prefix of:\n${n}`);
244
258
  }
245
259
  if (o.length !== 0) throw Error(`rpc tag namespace collision — the web client nests tags by ".", so a tag
246
260
  can't be both a leaf and a namespace. Rename one side (e.g. give the
247
261
  workflow/procedure a nested name like "<prefix>.run"):
248
262
 
249
263
  ${o.join("\n\n")}\n`);
250
- }, J = "// source-fingerprint: ", Y = async (e) => {
251
- let t = [...await I(e)].sort(), n = d("sha1");
252
- for (let i of t) {
264
+ }, te = "// source-fingerprint: ", Y = async (e) => {
265
+ let t = [...await R(e)].sort(), n = p("sha1");
266
+ for (let r of t) {
253
267
  let t = "";
254
268
  try {
255
- t = o(i, "utf8");
269
+ t = c(r, "utf8");
256
270
  } catch {}
257
- n.update(`${r(e, i).replace(/\\/g, "/")}\u0000${t}\u0000`);
271
+ n.update(`${a(e, r).replace(/\\/g, "/")}\u0000${t}\u0000`);
258
272
  }
259
273
  return n.digest("hex").slice(0, 16);
260
274
  }, X = async (e) => {
261
275
  let t = async (e) => {
262
- let r = await a.readdir(e, { withFileTypes: !0 }).catch(() => []);
263
- for (let t of r) if (!N.has(t.name) && t.isFile() && t.name === "rpcGroup.generated.ts") return n(e, t.name);
264
- for (let i of r) {
265
- if (N.has(i.name) || !i.isDirectory()) continue;
266
- let r = await t(n(e, i.name));
267
- if (r !== void 0) return r;
276
+ let n = await s.readdir(e, { withFileTypes: !0 }).catch(() => []);
277
+ for (let t of n) if (!F.has(t.name) && t.isFile() && t.name === "rpcGroup.generated.ts") return i(e, t.name);
278
+ for (let r of n) {
279
+ if (F.has(r.name) || !r.isDirectory()) continue;
280
+ let n = await t(i(e, r.name));
281
+ if (n !== void 0) return n;
268
282
  }
269
283
  };
270
- return t(i(e));
284
+ return t(o(e));
271
285
  }, Z = async (e) => {
272
- let n = await X(e);
273
- if (n === void 0) return { kind: "absent" };
274
- let r = "";
286
+ let t = await X(e);
287
+ if (t === void 0) return { kind: "absent" };
288
+ let n = "";
275
289
  try {
276
- r = await a.readFile(n, "utf8");
290
+ n = await s.readFile(t, "utf8");
277
291
  } catch {
278
292
  return { kind: "absent" };
279
293
  }
280
- let i = /^\/\/ source-fingerprint: ([0-9a-f]+)$/m.exec(r)?.[1];
294
+ let i = /^\/\/ source-fingerprint: ([0-9a-f]+)$/m.exec(n)?.[1];
281
295
  return i === void 0 ? {
282
296
  kind: "stale",
283
- file: n,
297
+ file: t,
284
298
  reason: "the generated group carries no freshness stamp"
285
- } : await Y(t(n)) === i ? {
299
+ } : await Y(r(t)) === i ? {
286
300
  kind: "fresh",
287
- file: n
301
+ file: t
288
302
  } : {
289
303
  kind: "stale",
290
- file: n,
304
+ file: t,
291
305
  reason: "a descriptor changed since the group was generated"
292
306
  };
293
- }, Q = (e, n, i, a = [], s = [], c = !1, l = !1, u = [], f = "") => {
294
- let p = s.length > 0, m = s.flatMap((e) => [{
307
+ }, Q = (e, t, n, i = [], o = [], s = !1, l = !1, u = [], d = "") => {
308
+ let f = o.length > 0, m = o.flatMap((e) => [{
295
309
  file: e.file,
296
310
  exportName: e.exportName,
297
311
  rpcTag: `${e.name}.send`,
@@ -307,20 +321,20 @@ ${o.join("\n\n")}\n`);
307
321
  rpcTag: e.tag,
308
322
  kind: e.kind
309
323
  }));
310
- q([
311
- ...i,
324
+ ee([
325
+ ...n,
312
326
  ...m,
313
327
  ...g
314
- ], e), G([
315
- ...i,
328
+ ], e), q([
329
+ ...n,
316
330
  ...m,
317
331
  ...g
318
332
  ], e);
319
- let _ = (e) => e.replace(/[^a-zA-Z0-9_$]/g, "_"), v = (e) => `__src_agent_${_(e.name)}`, y = (e) => `__agentRoutes_${_(e.name)}`, b = a.length > 0, x = a.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 ${U(e.tag)} = ${T(e.kind)}(__prpc${t}${S})`), D = h.map((e) => ` ${U(e.tag)},`), O = [...i].sort((e, t) => e.kind === t.kind ? e.rpcTag < t.rpcTag ? -1 : 1 : K(e.kind) - K(t.kind)), k = t(n), A = (e) => `__src_${U(e.rpcTag)}`, j = (e) => {
320
- let t = `./${r(k, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}`;
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?$/, "")}`;
321
335
  return `import { ${e.exportName} as ${A(e)} } from '${t}'`;
322
336
  }, M = (e) => {
323
- let t = U(e.rpcTag), n = A(e);
337
+ let t = G(e.rpcTag), n = A(e);
324
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})` : [
325
339
  `export const ${t} = Rpc.make('${e.rpcTag}', {`,
326
340
  ` payload: strictInput(${n}.payloadSchema),`,
@@ -339,7 +353,7 @@ ${o.join("\n\n")}\n`);
339
353
  "__voltroWorkflowResume",
340
354
  "__voltroWorkflowSignal",
341
355
  "__voltroWorkflowUpdate"
342
- ] : [], L = c ? [
356
+ ] : [], L = s ? [
343
357
  "__voltroUndoLog",
344
358
  "__voltroUndoApply",
345
359
  "__voltroUndoRedo"
@@ -349,16 +363,16 @@ ${o.join("\n\n")}\n`);
349
363
  "__voltroConnectionSubmitToken",
350
364
  "__voltroConnectionDisconnect"
351
365
  ] : [], V = [
352
- ...O.map((e) => ` ${U(e.rpcTag)},`),
353
- ...s.flatMap((e) => [` ${U(`${e.name}.send`)},`, ` ${U(`${e.name}.messages`)},`]),
366
+ ...O.map((e) => ` ${G(e.rpcTag)},`),
367
+ ...o.flatMap((e) => [` ${G(`${e.name}.send`)},`, ` ${G(`${e.name}.messages`)},`]),
354
368
  ...I.map((e) => ` ${e},`),
355
369
  ...L.map((e) => ` ${e},`),
356
370
  ...z.map((e) => ` ${e},`),
357
371
  ...B.map((e) => ` ${e},`),
358
372
  ...D
359
373
  ].join("\n"), H = ["queryToRpc"];
360
- (O.some((e) => e.kind === "mutation") || h.some((e) => e.kind === "mutation")) && H.push("mutationToRpc"), (O.some((e) => e.kind === "action") || F || p || 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"), c && 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") || p || F || c || R || l || C) && H.push("normalizeDescriptor");
361
- let W = [...new Set(H)].sort(), Y = [...O.filter((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream").map((e) => [e.rpcTag, A(e)]), ...s.flatMap((e) => [[`${e.name}.send`, `${y(e)}.send`], [`${e.name}.messages`, `${y(e)}.messages`]])], X = [
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 = [
362
376
  ...F ? [
363
377
  ["__voltro.workflow.run", "workflowRunQueryDescriptor"],
364
378
  ["__voltro.workflow.runs", "workflowRunsQueryDescriptor"],
@@ -371,7 +385,7 @@ ${o.join("\n\n")}\n`);
371
385
  ["__voltro.workflow.signal", "workflowSignalDescriptor"],
372
386
  ["__voltro.workflow.update", "workflowUpdateDescriptor"]
373
387
  ] : [],
374
- ...c ? [
388
+ ...s ? [
375
389
  ["__voltro.undo.log", "undoLogQueryDescriptor"],
376
390
  ["__voltro.undo.apply", "undoApplyDescriptor"],
377
391
  ["__voltro.undo.redo", "undoRedoDescriptor"]
@@ -384,10 +398,10 @@ ${o.join("\n\n")}\n`);
384
398
  ["__voltro.connections.disconnect", "connectionDisconnectDescriptor"]
385
399
  ] : [],
386
400
  ...h.map((e, t) => [e.tag, `__prpc${t}`])
387
- ], Z = ([e, t]) => ` ${JSON.stringify(e)}: normalizeDescriptor(${t}),`, Q = ([e, t]) => ` readonly ${JSON.stringify(e)}: typeof ${t}`, $ = Y.map(Z), ee = X.map(Z), te = 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 = [
388
- ...Y.map(Q),
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),
389
403
  ...ne,
390
- ...X.map(Q)
404
+ ...K.map(X)
391
405
  ], ie = O.filter((e) => e.kind === "workflow").map((e) => {
392
406
  let t = A(e);
393
407
  return [
@@ -400,41 +414,41 @@ ${o.join("\n\n")}\n`);
400
414
  ` updates: __voltroWorkflowMessages(${t}).updates,`,
401
415
  " },"
402
416
  ].join("\n");
403
- }), ae = [...O, ...s.map((e) => ({
417
+ }), ae = [...O, ...o.map((e) => ({
404
418
  rpcTag: `agent:${e.name}`,
405
419
  file: e.file
406
420
  }))];
407
421
  return [
408
422
  "// THIS FILE IS GENERATED — DO NOT EDIT BY HAND.",
409
423
  "// Re-emitted by `voltro dev` whenever query/mutation/action/stream/workflow files change.",
410
- `// descriptor-fingerprint: ${d("sha1").update(ae.map((e) => {
424
+ `// descriptor-fingerprint: ${p("sha1").update(ae.map((e) => {
411
425
  let t = "";
412
426
  try {
413
- t = o(e.file, "utf8");
427
+ t = c(e.file, "utf8");
414
428
  } catch {}
415
429
  return `${e.rpcTag}\u0000${t}`;
416
430
  }).join("")).digest("hex").slice(0, 16)}`,
417
- `${J}${f}`,
431
+ `${te}${d}`,
418
432
  "// Source files:",
419
- ...O.map((t) => `// - ${r(e, t.file).replace(/\\/g, "/")}`),
420
- ...s.map((t) => `// - ${r(e, t.file).replace(/\\/g, "/")} (agent)`),
433
+ ...O.map((t) => `// - ${a(e, t.file).replace(/\\/g, "/")}`),
434
+ ...o.map((t) => `// - ${a(e, t.file).replace(/\\/g, "/")} (agent)`),
421
435
  "",
422
436
  F ? "import { Rpc, RpcGroup } from '@effect/rpc'" : "import { RpcGroup } from '@effect/rpc'",
423
437
  ...F || P ? ["import { Schema } from 'effect'"] : [],
424
- `import { ${W.join(", ")} } from '@voltro/protocol'`,
425
- ...p ? ["import { agentRouteDescriptors as __voltroAgentRoutes } from '@voltro/ai/agent'"] : [],
438
+ `import { ${U.join(", ")} } from '@voltro/protocol'`,
439
+ ...f ? ["import { agentRouteDescriptors as __voltroAgentRoutes } from '@voltro/ai/agent'"] : [],
426
440
  "",
427
441
  ...O.map(j),
428
- ...s.map((e) => `import { ${e.exportName} as ${v(e)} } from './${r(k, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}'`),
442
+ ...o.map((e) => `import { ${e.exportName} as ${v(e)} } from './${a(k, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}'`),
429
443
  ...b ? ["", ...x] : [],
430
444
  ...C ? ["", ...w] : [],
431
445
  "",
432
- ...s.map((e) => `const ${y(e)} = __voltroAgentRoutes(${v(e)})`),
433
- ...p ? [""] : [],
446
+ ...o.map((e) => `const ${y(e)} = __voltroAgentRoutes(${v(e)})`),
447
+ ...f ? [""] : [],
434
448
  ...b ? [
435
449
  "/** Cross-cutting plugin error schemas, unioned into every rpc's",
436
450
  " * wire error so interceptor failures decode typed on the client. */",
437
- `const __voltroPluginErrors = [${a.map((e, t) => `__pe${t}`).join(", ")}] as const`,
451
+ `const __voltroPluginErrors = [${i.map((e, t) => `__pe${t}`).join(", ")}] as const`,
438
452
  ""
439
453
  ] : [],
440
454
  ...F ? [
@@ -466,7 +480,7 @@ ${o.join("\n\n")}\n`);
466
480
  ""
467
481
  ] : [],
468
482
  ...O.map(M),
469
- ...s.flatMap((e) => [`export const ${U(`${e.name}.send`)} = actionToRpc(${y(e)}.send${S})`, `export const ${U(`${e.name}.messages`)} = queryToRpc(${y(e)}.messages${S})`]),
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})`]),
470
484
  ...F ? [
471
485
  "export const __voltroWorkflowRun = queryToRpc(workflowRunQueryDescriptor)",
472
486
  "export const __voltroWorkflowRuns = queryToRpc(workflowRunsQueryDescriptor)",
@@ -479,7 +493,7 @@ ${o.join("\n\n")}\n`);
479
493
  "export const __voltroWorkflowSignal = actionToRpc(workflowSignalDescriptor)",
480
494
  "export const __voltroWorkflowUpdate = actionToRpc(workflowUpdateDescriptor)"
481
495
  ] : [],
482
- ...c ? [
496
+ ...s ? [
483
497
  "export const __voltroUndoLog = queryToRpc(undoLogQueryDescriptor)",
484
498
  "export const __voltroUndoApply = mutationToRpc(undoApplyDescriptor)",
485
499
  "export const __voltroUndoRedo = mutationToRpc(undoRedoDescriptor)"
@@ -501,9 +515,9 @@ ${o.join("\n\n")}\n`);
501
515
  " * Function fields (target.shape, target.identify) survive because",
502
516
  " * the descriptors themselves are imported by reference. */",
503
517
  "export const appDescriptors = {",
518
+ ...Z,
504
519
  ...$,
505
- ...te,
506
- ...ee,
520
+ ...Q,
507
521
  "} as const",
508
522
  "",
509
523
  "export type AppDescriptors = typeof appDescriptors",
@@ -561,26 +575,26 @@ ${o.join("\n\n")}\n`);
561
575
  ] : []
562
576
  ].join("\n");
563
577
  }, $ = async (e) => {
564
- let r = i(e.root), o = await I(r), s = await V(o), c = await H(o), l = await P(r);
565
- if (s.length === 0 && c.length === 0 && !l && (e.pluginRpcImports?.length ?? 0) === 0) return;
566
- let d = ((e) => {
567
- if (e.length === 0) return r;
568
- let t = e.map((e) => e.split("/")), n = Math.min(...t.map((e) => e.length)), i = [];
569
- for (let e = 0; e < n; e++) {
570
- let n = t[0][e];
571
- if (t.every((t) => t[e] === n)) i.push(n);
578
+ let t = o(e.root), n = await R(t), a = await U(n), c = await W(n), l = await I(t);
579
+ if (a.length === 0 && c.length === 0 && !l && (e.pluginRpcImports?.length ?? 0) === 0) return;
580
+ let u = ((e) => {
581
+ if (e.length === 0) return t;
582
+ let n = e.map((e) => e.split("/")), r = Math.min(...n.map((e) => e.length)), i = [];
583
+ for (let e = 0; e < r; e++) {
584
+ let t = n[0][e];
585
+ if (n.every((n) => n[e] === t)) i.push(t);
572
586
  else break;
573
587
  }
574
588
  return i.join("/") || "/";
575
- })([...new Set([...s.map((e) => e.file), ...c.map((e) => e.file)].map((e) => e.replace(/\/[^/]+$/, "")))]), f = /* @__PURE__ */ new Set([
589
+ })([...new Set([...a.map((e) => e.file), ...c.map((e) => e.file)].map((e) => e.replace(/\/[^/]+$/, "")))]), d = /* @__PURE__ */ new Set([
576
590
  "queries",
577
591
  "mutations",
578
592
  "actions",
579
593
  "streams",
580
594
  "workflows"
581
- ]), p = (e) => e.slice(e.lastIndexOf("/") + 1), m = d;
582
- for (; m !== r && f.has(p(m));) m = m.slice(0, m.lastIndexOf("/")) || "/";
583
- let h = i(e.outputFile ?? n(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(t(h)), y = Q(r, h, s, g, c, u(), l, _, v), b = [];
595
+ ]), p = (e) => e.slice(e.lastIndexOf("/") + 1), m = u;
596
+ 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 = [];
584
598
  for (let t of e.pluginContributions ?? []) {
585
599
  let e = null;
586
600
  try {
@@ -597,9 +611,9 @@ ${o.join("\n\n")}\n`);
597
611
  }
598
612
  let x = b.length === 0 ? y : `${y}\n\n// ---- plugin codegen ----\n\n${b.join("\n")}`, S = null;
599
613
  try {
600
- S = await a.readFile(h, "utf8");
614
+ S = await s.readFile(h, "utf8");
601
615
  } catch {}
602
- return S !== x && await a.writeFile(h, x, "utf8"), await D(h), h;
616
+ return S !== x && await s.writeFile(h, x, "utf8"), await k(h), h;
603
617
  };
604
618
  //#endregion
605
- export { w as a, C as c, F as i, T as l, Y as n, D as o, $ as r, E as s, Z as t };
619
+ export { E as a, T as c, L as i, D as l, Y as n, k as o, $ as r, O as s, Z as t };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./codegen-CrMXs4hb.js";
2
+ export { e as checkRpcGroupFreshness };