@voltro/cli 0.47.0 → 0.48.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 (91) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/apiBuild-DOnvi2zm.js +2 -0
  3. package/dist/{apiBuild-FpHCWiv6.js → apiBuild-Dz8TJSxp.js} +1 -1
  4. package/dist/bin.js +1 -1
  5. package/dist/{build-zVygXxGB.js → build-DLme2ppa.js} +6 -6
  6. package/dist/{checkCommand-B2Fw73lu.js → checkCommand-BUBqPBlI.js} +1 -1
  7. package/dist/{checkCommand-D0dAKciE.js → checkCommand-Dals7g-I.js} +3 -3
  8. package/dist/{codegenCommand-BTtsnRus.js → codegenCommand-L6vacVRW.js} +3 -2
  9. package/dist/{commands-BrFKxnYW.js → commands-CAxFLqG4.js} +17 -17
  10. package/dist/{dashboardCommand-D9SjDc8E.js → dashboardCommand-CJC8Kg-s.js} +1 -1
  11. package/dist/{dataCommand-Dl11q14e.js → dataCommand-hIaq2iKY.js} +266 -189
  12. package/dist/dbCommand-D1Q33ktl.js +2 -0
  13. package/dist/{dbCommand-jbrmzwW_.js → dbCommand-ZGNItjoJ.js} +4 -4
  14. package/dist/declaredSchemaGates-BlcwObhb.js +25 -0
  15. package/dist/{dev-CaIfZnw5.js → dev-cGGsLNn6.js} +1 -1
  16. package/dist/{dev-RjB7eE_B.js → dev-lvnVq5RD.js} +31 -30
  17. package/dist/{doctorCommand-D7X29cw6.js → doctorCommand-BK0qu7eD.js} +32 -14
  18. package/dist/doctorCommand-CWgUPye-.js +2 -0
  19. package/dist/doctorDecidedSchema-BlbWgCD_.js +23 -0
  20. package/dist/{dormancyCommand-BGOP27fz.js → dormancyCommand-CyIk-zq4.js} +1 -1
  21. package/dist/{embeddingsCommand-D72E22bw.js → embeddingsCommand-D7TLklps.js} +1 -1
  22. package/dist/{envCommand-BHSxz6wC.js → envCommand-BHxKkGXq.js} +1 -1
  23. package/dist/{evolveCommand-C2ofGGlz.js → evolveCommand-CQh6dw21.js} +1 -1
  24. package/dist/{frameworkTableAssembly-BvZ0Lil_.js → frameworkTableAssembly-BNod_DKN.js} +97 -120
  25. package/dist/frameworkTableAssembly-Rft-DPUg.js +2 -0
  26. package/dist/index.js +1 -1
  27. package/dist/{migrate-odCPGHPq.js → migrate-CL5Ed01M.js} +4 -4
  28. package/dist/{runtimeTrace-C_OKr0jY.js → runtimeTrace-C0SlIoQY.js} +1 -1
  29. package/dist/{sdkgen-D9trW7sl.js → sdkgen-BXm7zx7F.js} +1 -1
  30. package/dist/{serveCommand-BU0wfV6V.js → serveCommand-CV3YO9L3.js} +469 -365
  31. package/dist/serveCommand-ZP_Cb-yz.js +2 -0
  32. package/dist/serveEntry.js +1 -1
  33. package/dist/{webhooksCommand-BqcWcbuW.js → webhooksCommand-QlAk_tED.js} +1 -1
  34. package/package.json +17 -17
  35. package/templates/AGENTS.md +1 -1
  36. package/templates/agent-docs/_index.md +1 -1
  37. package/templates/agent-docs/cli.md +58 -3
  38. package/templates/agent-docs/database/migrations.md +19 -5
  39. package/templates/agent-docs/whats-new.md +63 -13
  40. package/templates/apps/api-ai/package.json +7 -7
  41. package/templates/apps/api-auth/package.json +8 -8
  42. package/templates/apps/api-backend/package.json +7 -7
  43. package/templates/apps/api-backend-deactivation/package.json +7 -7
  44. package/templates/apps/api-backend-mail/package.json +8 -8
  45. package/templates/apps/api-backend-mariadb/package.json +9 -9
  46. package/templates/apps/api-backend-sqlite/package.json +8 -8
  47. package/templates/apps/api-backend-storage/package.json +8 -8
  48. package/templates/apps/api-cms/package.json +10 -10
  49. package/templates/apps/api-collab/package.json +8 -8
  50. package/templates/apps/api-data-advanced/package.json +8 -8
  51. package/templates/apps/api-durable/package.json +8 -8
  52. package/templates/apps/api-feature-flags/package.json +9 -9
  53. package/templates/apps/api-governance/package.json +8 -8
  54. package/templates/apps/api-kv/package.json +8 -8
  55. package/templates/apps/api-moderation/package.json +8 -8
  56. package/templates/apps/api-observability/package.json +8 -8
  57. package/templates/apps/api-ratelimit/package.json +8 -8
  58. package/templates/apps/api-rbac/package.json +8 -8
  59. package/templates/apps/api-rest/package.json +7 -7
  60. package/templates/apps/api-saas/package.json +11 -11
  61. package/templates/apps/api-saas-starter/package.json +10 -10
  62. package/templates/apps/api-search/package.json +8 -8
  63. package/templates/apps/api-status/package.json +8 -8
  64. package/templates/apps/api-versioning/package.json +8 -8
  65. package/templates/apps/api-webhooks/package.json +9 -9
  66. package/templates/apps/changelog/package.json +6 -6
  67. package/templates/apps/edge-functions/package.json +2 -2
  68. package/templates/apps/frontend-admin/package.json +8 -8
  69. package/templates/apps/frontend-app/package.json +9 -9
  70. package/templates/apps/frontend-auth/package.json +8 -8
  71. package/templates/apps/frontend-blank/package.json +7 -7
  72. package/templates/apps/frontend-cms/package.json +9 -9
  73. package/templates/apps/frontend-collab/package.json +10 -10
  74. package/templates/apps/frontend-contact/package.json +7 -7
  75. package/templates/apps/frontend-dashboard/package.json +7 -7
  76. package/templates/apps/frontend-docs/package.json +7 -7
  77. package/templates/apps/frontend-i18n/package.json +6 -6
  78. package/templates/apps/frontend-landing/package.json +7 -7
  79. package/templates/apps/frontend-portal/package.json +8 -8
  80. package/templates/apps/frontend-saas/package.json +8 -8
  81. package/templates/apps/frontend-spa/package.json +7 -7
  82. package/templates/apps/frontend-ssr/package.json +7 -7
  83. package/templates/apps/frontend-ssr-api/package.json +8 -8
  84. package/templates/apps/frontend-static-blog/package.json +6 -6
  85. package/templates/apps/frontend-status/package.json +8 -8
  86. package/templates/apps/mobile-app/package.json +4 -4
  87. package/dist/apiBuild-BsooZpw2.js +0 -2
  88. package/dist/dbCommand-BUD4Fd8v.js +0 -2
  89. package/dist/doctorCommand-5zv6PN-G.js +0 -2
  90. package/dist/frameworkTableAssembly-DDKtwsy2.js +0 -2
  91. package/dist/serveCommand-Bwrn_9Fn.js +0 -2
@@ -1,85 +1,86 @@
1
1
  import { n as e } from "./appModuleLoader-C9r9mxZt.js";
2
- import { D as t, a as n, j as r, k as i, x as a } from "./fileConventions-Cof68_BL.js";
3
- import { basename as o, join as s } from "node:path";
4
- import { existsSync as c, promises as l } from "node:fs";
5
- import { pathToFileURL as u } from "node:url";
6
- import { defineAction as d, defineMutation as f, defineQuery as ee } from "@voltro/protocol";
7
- import { _voltroApiKeysTable as te, _voltroCdcOffsetsTable as ne, _voltroIdempotencyTable as re, _voltroImportRunsTable as ie, _voltroKvTable as ae, _voltroMigrationPlansTable as oe, _voltroMigrationsTable as se, _voltroMssqlCdcOffsetsTable as ce, _voltroReplaceInProgressTable as le, _voltroSeedsTable as ue } from "@voltro/database";
2
+ import { n as t } from "./declaredSchemaGates-BlcwObhb.js";
3
+ import { D as n, a as r, j as i, k as a, x as o } from "./fileConventions-Cof68_BL.js";
4
+ import { basename as s, join as c } from "node:path";
5
+ import { existsSync as l, promises as u } from "node:fs";
6
+ import { pathToFileURL as d } from "node:url";
7
+ import { defineAction as f, defineMutation as ee, defineQuery as te } from "@voltro/protocol";
8
+ import { _voltroApiKeysTable as ne, _voltroCdcOffsetsTable as re, _voltroIdempotencyTable as ie, _voltroImportRunsTable as ae, _voltroKvTable as oe, _voltroMigrationPlansTable as se, _voltroMigrationsTable as ce, _voltroMssqlCdcOffsetsTable as le, _voltroReplaceInProgressTable as ue, _voltroSeedsTable as de } from "@voltro/database";
8
9
  import { Effect as p } from "effect";
9
10
  import { SqlClient as m } from "@effect/sql";
10
- import { _voltroApprovalsTable as de, _voltroConnectionGrantsTable as fe, _voltroConnectionsTable as pe, _voltroScheduleClaimsTable as me, _voltroScheduleRunsTable as he, _voltroTracesTable as ge, _voltroUndoLogTable as h, _voltroWakeupsTable as g, _voltroWorkflowEventDeliveriesTable as _, _voltroWorkflowEventsTable as v, outboxAttemptsTable as y, outboxTable as b } from "@voltro/runtime";
11
- import { _voltroBudgetHoldsTable as x, _voltroWorkflowAdmissionsTable as S, _voltroWorkflowPausesTable as C, _voltroWorkflowPendingTable as w, _voltroWorkflowRunEventsTable as T, _voltroWorkflowRunStepsTable as E, _voltroWorkflowRunsTable as D, _voltroWorkflowStartContextsTable as O, _voltroWorkflowWatermarksTable as k } from "@voltro/workflow";
12
- import { agentMessagesTable as A, agentThreadsTable as j, aiBudgetTable as M, aiInferencesTable as N, aiUsageTable as P, isAgentDescriptor as F, isAgentExecutor as I, promptsTable as L, resolveToolModuleHandlers as _e } from "@voltro/ai";
11
+ import { _voltroApprovalsTable as fe, _voltroConnectionGrantsTable as pe, _voltroConnectionsTable as me, _voltroScheduleClaimsTable as he, _voltroScheduleRunsTable as h, _voltroTracesTable as g, _voltroUndoLogTable as _, _voltroWakeupsTable as v, _voltroWorkflowEventDeliveriesTable as y, _voltroWorkflowEventsTable as b, outboxAttemptsTable as x, outboxTable as S } from "@voltro/runtime";
12
+ import { _voltroBudgetHoldsTable as C, _voltroWorkflowAdmissionsTable as w, _voltroWorkflowPausesTable as T, _voltroWorkflowPendingTable as E, _voltroWorkflowRunEventsTable as D, _voltroWorkflowRunStepsTable as O, _voltroWorkflowRunsTable as k, _voltroWorkflowStartContextsTable as A, _voltroWorkflowWatermarksTable as j } from "@voltro/workflow";
13
+ import { agentMessagesTable as M, agentThreadsTable as N, aiBudgetTable as P, aiInferencesTable as F, aiUsageTable as I, isAgentDescriptor as L, isAgentExecutor as R, promptsTable as ge, resolveToolModuleHandlers as _e } from "@voltro/ai";
13
14
  import { _voltroWebhookDeliveriesTable as ve, _voltroWebhookTargetsTable as ye } from "@voltro/plugin-webhooks/mixin";
14
15
  import { _voltroStorageBlobsTable as be, _voltroStorageGrantsTable as xe, _voltroStorageRefsTable as Se, _voltroStorageUsageTable as Ce } from "@voltro/plugin-storage";
15
16
  //#region src/frameworkTables.ts
16
17
  var we = [
17
18
  {
18
- table: se,
19
+ table: ce,
19
20
  when: "always"
20
21
  },
21
22
  {
22
- table: ue,
23
+ table: de,
23
24
  when: "always"
24
25
  },
25
26
  {
26
- table: oe,
27
+ table: se,
27
28
  when: "always"
28
29
  },
29
30
  {
30
- table: le,
31
+ table: ue,
31
32
  when: "always"
32
33
  },
33
34
  {
34
- table: ie,
35
+ table: ae,
35
36
  when: "always"
36
37
  },
37
38
  {
38
- table: D,
39
+ table: k,
39
40
  when: "workflows"
40
41
  },
41
42
  {
42
- table: E,
43
+ table: O,
43
44
  when: "workflows"
44
45
  },
45
46
  {
46
- table: T,
47
+ table: D,
47
48
  when: "workflows"
48
49
  },
49
50
  {
50
- table: O,
51
+ table: A,
51
52
  when: "workflows"
52
53
  },
53
54
  {
54
- table: w,
55
+ table: E,
55
56
  when: "workflows"
56
57
  },
57
58
  {
58
- table: S,
59
+ table: w,
59
60
  when: "workflows"
60
61
  },
61
62
  {
62
- table: C,
63
+ table: T,
63
64
  when: "workflows"
64
65
  },
65
66
  {
66
- table: k,
67
+ table: j,
67
68
  when: "workflows"
68
69
  },
69
70
  {
70
- table: v,
71
+ table: b,
71
72
  when: "workflows"
72
73
  },
73
74
  {
74
- table: _,
75
+ table: y,
75
76
  when: "workflows"
76
77
  },
77
78
  {
78
- table: he,
79
+ table: h,
79
80
  when: "schedules"
80
81
  },
81
82
  {
82
- table: me,
83
+ table: he,
83
84
  when: "schedules"
84
85
  },
85
86
  {
@@ -91,39 +92,39 @@ var we = [
91
92
  when: "webhooks"
92
93
  },
93
94
  {
94
- table: ge,
95
+ table: g,
95
96
  when: "traces"
96
97
  },
97
98
  {
98
- table: h,
99
+ table: _,
99
100
  when: "undo"
100
101
  },
101
102
  {
102
- table: de,
103
+ table: fe,
103
104
  when: "always"
104
105
  },
105
106
  {
106
- table: x,
107
+ table: C,
107
108
  when: "workflows"
108
109
  },
109
110
  {
110
- table: b,
111
+ table: S,
111
112
  when: "always"
112
113
  },
113
114
  {
114
- table: y,
115
+ table: x,
115
116
  when: "always"
116
117
  },
117
118
  {
118
- table: pe,
119
+ table: me,
119
120
  when: "connections"
120
121
  },
121
122
  {
122
- table: fe,
123
+ table: pe,
123
124
  when: "connections"
124
125
  },
125
126
  {
126
- table: g,
127
+ table: v,
127
128
  when: "always"
128
129
  },
129
130
  {
@@ -143,35 +144,35 @@ var we = [
143
144
  when: "always"
144
145
  },
145
146
  {
146
- table: re,
147
+ table: ie,
147
148
  when: "always"
148
149
  },
149
150
  {
150
- table: te,
151
+ table: ne,
151
152
  when: "always"
152
153
  },
153
154
  {
154
- table: ae,
155
+ table: oe,
155
156
  when: "always"
156
157
  }
157
158
  ], Te = (e) => {
158
159
  let t = we.filter((t) => t.when === "always" || t.when === "workflows" && e.workflows || t.when === "schedules" && e.schedules || t.when === "webhooks" && e.webhooks || t.when === "traces" && e.traces || t.when === "undo" && e.undo === !0 || t.when === "connections" && e.connections === !0).map((e) => e.table);
159
- return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? ce : ne), t;
160
- }, R = (e) => {
160
+ return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? le : re), t;
161
+ }, z = (e) => {
161
162
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
162
163
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
163
164
  }, Ee = (e) => {
164
165
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
165
166
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/#/g, "--").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
166
- }, z = (e, t) => B(e, t.name), B = (e, t) => {
167
- let n = R(e.name);
167
+ }, De = (e, t) => B(e, t.name), B = (e, t) => {
168
+ let n = z(e.name);
168
169
  if (!t.includes(".")) return `${n}.${t}`;
169
170
  if (e.baseName === void 0) return t;
170
- let r = `${R(e.baseName)}.`;
171
+ let r = `${z(e.baseName)}.`;
171
172
  return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
172
- }, V = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, De = (e, t, n) => {
173
+ }, V = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, Oe = (e, t, n) => {
173
174
  switch (e) {
174
- case "query": return ee({
175
+ case "query": return te({
175
176
  name: t,
176
177
  input: n.input,
177
178
  output: n.output,
@@ -179,14 +180,14 @@ var we = [
179
180
  ...V(n),
180
181
  ...n.source === void 0 ? {} : { source: n.source }
181
182
  });
182
- case "mutation": return f({
183
+ case "mutation": return ee({
183
184
  name: t,
184
185
  input: n.input,
185
186
  output: n.output,
186
187
  ...n.error === void 0 ? {} : { error: n.error },
187
188
  ...V(n)
188
189
  });
189
- case "action": return d({
190
+ case "action": return f({
190
191
  name: t,
191
192
  input: n.input,
192
193
  output: n.output,
@@ -194,23 +195,23 @@ var we = [
194
195
  ...V(n)
195
196
  });
196
197
  }
197
- }, Oe = (e) => (t, n) => p.suspend(() => {
198
+ }, ke = (e) => (t, n) => p.suspend(() => {
198
199
  let r = { request: {
199
200
  subject: n.request.subject,
200
201
  traceId: n.request.traceId
201
202
  } };
202
203
  return e.execute(t, r);
203
- }), ke = (e) => {
204
+ }), Ae = (e) => {
204
205
  let t = [];
205
206
  for (let n of e) {
206
207
  let e = n.routes ?? [];
207
208
  for (let r of e) {
208
- let e = z(n, r), i = De(r.kind, e, r);
209
+ let e = De(n, r), i = Oe(r.kind, e, r);
209
210
  t.push({
210
211
  kind: r.kind,
211
212
  file: `plugin:${n.name}`,
212
213
  descriptor: i,
213
- executor: Oe(r),
214
+ executor: ke(r),
214
215
  plugin: {
215
216
  name: n.name,
216
217
  version: n.version
@@ -219,7 +220,7 @@ var we = [
219
220
  }
220
221
  }
221
222
  return t;
222
- }, Ae = (e, t, n = /* @__PURE__ */ new Set()) => {
223
+ }, je = (e, t, n = /* @__PURE__ */ new Set()) => {
223
224
  let r = /* @__PURE__ */ new Map();
224
225
  for (let e of t) r.set(e, "user-route");
225
226
  let i = [];
@@ -231,7 +232,7 @@ var we = [
231
232
  }
232
233
  }
233
234
  return i;
234
- }, H = "_voltro_plugin_migrations", je = () => p.gen(function* () {
235
+ }, H = "_voltro_plugin_migrations", Me = () => p.gen(function* () {
235
236
  yield* (yield* m.SqlClient).unsafe(`
236
237
  CREATE TABLE IF NOT EXISTS ${H} (
237
238
  id TEXT PRIMARY KEY,
@@ -241,10 +242,10 @@ var we = [
241
242
  applied_at TEXT NOT NULL
242
243
  );
243
244
  `).pipe(p.orDie);
244
- }), Me = (e, t) => `${R(e)}__${t}`, Ne = () => p.gen(function* () {
245
+ }), Ne = (e, t) => `${z(e)}__${t}`, Pe = () => p.gen(function* () {
245
246
  let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(H)}`.pipe(p.orDie);
246
247
  return new Set(t.map((e) => e.id));
247
- }), Pe = (e) => p.gen(function* () {
248
+ }), Fe = (e) => p.gen(function* () {
248
249
  let t = yield* m.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
249
250
  yield* t`
250
251
  INSERT INTO ${t(H)} (id, plugin_name, migration_id, description, applied_at)
@@ -256,10 +257,10 @@ var we = [
256
257
  migration: t
257
258
  })));
258
259
  if (t.length === 0) return [];
259
- yield* je();
260
- let n = yield* Ne(), r = [];
260
+ yield* Me();
261
+ let n = yield* Pe(), r = [];
261
262
  for (let { plugin: e, migration: i } of t) {
262
- let t = Me(e.name, i.id), a = Date.now();
263
+ let t = Ne(e.name, i.id), a = Date.now();
263
264
  if (n.has(t)) {
264
265
  r.push({
265
266
  pluginName: e.name,
@@ -271,7 +272,7 @@ var we = [
271
272
  }
272
273
  let o = yield* m.SqlClient;
273
274
  try {
274
- yield* i.up(o).pipe(p.mapError((e) => e)), yield* Pe({
275
+ yield* i.up(o).pipe(p.mapError((e) => e)), yield* Fe({
275
276
  key: t,
276
277
  pluginName: e.name,
277
278
  migration: i
@@ -292,17 +293,17 @@ var we = [
292
293
  }
293
294
  }
294
295
  return r;
295
- }), Fe = (e, t) => p.gen(function* () {
296
+ }), Ie = (e, t) => p.gen(function* () {
296
297
  let n = yield* U(e);
297
298
  if (n.length === 0) return n;
298
299
  let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
299
300
  return t(`plugin migrations: ${r.length} applied, ${i.length} already applied`, { applied: r.map((e) => `${e.pluginName}:${e.migrationId}`) }), n;
300
- }), Ie = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
301
+ }), Le = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
301
302
  pluginName: e.name,
302
- pluginAlias: R(e.name),
303
+ pluginAlias: z(e.name),
303
304
  tables: e.extendSchema.tables?.length ?? 0,
304
305
  migrations: e.extendSchema.migrations?.length ?? 0
305
- })), Le = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, Re = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, ze = async (t, n) => {
306
+ })), Re = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, ze = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, Be = async (t, n) => {
306
307
  let r = 0;
307
308
  for (let i of t) if (G.test(i)) try {
308
309
  let t = await e(i);
@@ -311,7 +312,7 @@ var we = [
311
312
  n.warn("tool: failed to import — handler not wired", { file: i }, e);
312
313
  }
313
314
  return r;
314
- }, Be = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ve = async (t, n) => {
315
+ }, Ve = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), K = async (t, n) => {
315
316
  let r = [], i = /* @__PURE__ */ new Set();
316
317
  for (let a of t) {
317
318
  if (!W.test(a)) continue;
@@ -322,7 +323,7 @@ var we = [
322
323
  n.warn("agent: failed to import descriptor", { file: a }, e);
323
324
  continue;
324
325
  }
325
- let o = Object.values(t).find(F);
326
+ let o = Object.values(t).find(L);
326
327
  if (o === void 0) {
327
328
  n.warn("agent: no defineAgent() descriptor export found", { file: a });
328
329
  continue;
@@ -334,7 +335,7 @@ var we = [
334
335
  });
335
336
  continue;
336
337
  }
337
- let s = Be(a), c;
338
+ let s = Ve(a), c;
338
339
  try {
339
340
  c = await e(s);
340
341
  } catch (e) {
@@ -346,7 +347,7 @@ var we = [
346
347
  continue;
347
348
  }
348
349
  let l = c.default;
349
- if (!I(l)) {
350
+ if (!R(l)) {
350
351
  n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
351
352
  file: s,
352
353
  name: o.name
@@ -361,7 +362,7 @@ var we = [
361
362
  });
362
363
  }
363
364
  return { agents: r };
364
- }, K = /\.connection\.tsx?$/, He = (e) => e.replace(K, ""), Ue = async (t, n) => {
365
+ }, q = /\.connection\.tsx?$/, He = (e) => e.replace(q, ""), Ue = async (t, n) => {
365
366
  let r = [], i = /* @__PURE__ */ new Map();
366
367
  for (let a of t) {
367
368
  let t;
@@ -404,55 +405,31 @@ var we = [
404
405
  }
405
406
  return r.length > 0 && n.info("discovered connections", {
406
407
  connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
407
- files: r.map((e) => He(o(e.file)))
408
+ files: r.map((e) => He(s(e.file)))
408
409
  }), r;
409
- }, q = (e) => {
410
- let t = e.nodeEnv !== "production";
411
- return {
412
- traces: e.declared?.traces ?? t,
413
- undo: e.declared?.undo ?? t,
414
- cdc: e.cdcDialect !== void 0
415
- };
416
- }, We = (e) => {
417
- let t = e.nodeEnv ?? "<unset>", n = (n) => e.declared?.[n] === void 0 ? `the default for NODE_ENV=${t}` : `app.config.ts \`schema: { ${n}: ${String(e.declared[n])} }\``, r = (e, t, n) => ` ${e ? "+" : "-"} ${t.padEnd(22)} ${n}`;
418
- return `The three tables whose presence is DECIDED rather than implied by your source tree —
419
- compare these against the other process's environment before anything else:
420
-
421
- ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_undo_log", n("undo"))}\n${r(e.gates.cdc, "_voltro_cdc_offsets", `DB_DIALECT=${e.cdcDialect ?? "<no out-of-band CDC>"}`)}\n\nNone of them reads a runtime flag any more. If you are upgrading FROM a version where\nthey did, a migrate job without \`CDC\` / \`VOLTRO_UNDO\` / \`VOLTRO_TRACING_PERSIST\` recorded\na different set than your pods computed — re-run \`voltro db apply\` once on this version.`;
422
- }, Ge = (e) => {
423
- let t = [{
424
- key: "traces",
425
- table: "_voltro_traces",
426
- envVar: "VOLTRO_TRACING_PERSIST"
427
- }, {
428
- key: "undo",
429
- table: "_voltro_undo_log",
430
- envVar: "VOLTRO_UNDO"
431
- }].filter((t) => e.runtime[t.key] && !e.gates[t.key]);
432
- if (t.length !== 0) return `refusing to boot — a runtime flag asks for a table the deployment does not declare:\n\n${t.map(({ key: e, table: t, envVar: n }) => ` \`${n}\` turns ${e} capture ON, but \`${t}\` is not in this app's declared schema.\n Declare it: \`schema: { ${e}: true }\` in app.config.ts.`).join("\n\n")}\n\nThe declaration has to live in app.config.ts rather than in the environment because the\npre-deploy migrate job runs with its OWN env block. A flag set on the pods and not on the\njob produces a green apply and a schema fingerprint no container can reproduce.`;
433
- }, J = (e) => n.test(e) || a.test(e), Y = async (e) => {
434
- let n = !1, a = !1, o = !1, c = !1, u = !1, d = async (e) => {
435
- let f = await l.readdir(e, { withFileTypes: !0 }).catch(() => []);
436
- for (let l of f) if (l.isDirectory()) {
437
- if (l.name === "node_modules" || l.name === "dist" || l.name === ".framework" || l.name.startsWith(".")) continue;
438
- await d(s(e, l.name));
410
+ }, J = (e) => r.test(e) || o.test(e), Y = async (e) => {
411
+ let t = !1, r = !1, o = !1, s = !1, l = !1, d = async (e) => {
412
+ let f = await u.readdir(e, { withFileTypes: !0 }).catch(() => []);
413
+ for (let u of f) if (u.isDirectory()) {
414
+ if (u.name === "node_modules" || u.name === "dist" || u.name === ".framework" || u.name.startsWith(".")) continue;
415
+ await d(c(e, u.name));
439
416
  } else {
440
- let e = l.name;
441
- (r.test(e) || t.test(e)) && (n = !0), J(e) && (a = !0), i.test(e) && (o = !0), W.test(e) && (c = !0), K.test(e) && (u = !0);
417
+ let e = u.name;
418
+ (i.test(e) || n.test(e)) && (t = !0), J(e) && (r = !0), a.test(e) && (o = !0), W.test(e) && (s = !0), q.test(e) && (l = !0);
442
419
  }
443
420
  };
444
421
  return await d(e), {
445
- workflows: n,
446
- schedules: a,
422
+ workflows: t,
423
+ schedules: r,
447
424
  webhooks: o,
448
- agents: c,
449
- connections: u
425
+ agents: s,
426
+ connections: l
450
427
  };
451
- }, Ke = async (e) => {
452
- let t = s(e, "app.config.ts");
453
- if (!c(t)) return { plugins: [] };
428
+ }, We = async (e) => {
429
+ let t = c(e, "app.config.ts");
430
+ if (!l(t)) return { plugins: [] };
454
431
  try {
455
- let e = await import(u(t).href);
432
+ let e = await import(d(t).href);
456
433
  return {
457
434
  plugins: e.default?.plugins ?? [],
458
435
  ...e.default?.schema ? { schema: e.default.schema } : {}
@@ -463,8 +440,8 @@ ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_
463
440
  error: e
464
441
  };
465
442
  }
466
- }, qe = async (e) => (await X(e)).plugins, X = async (e) => {
467
- let { plugins: t, schema: n, error: r } = await Ke(e);
443
+ }, Ge = async (e) => (await X(e)).plugins, X = async (e) => {
444
+ let { plugins: t, schema: n, error: r } = await We(e);
468
445
  if (r !== void 0) throw new Z(e, r);
469
446
  return {
470
447
  plugins: t,
@@ -496,18 +473,18 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
496
473
  undo: e.gates.undo,
497
474
  connections: e.mix.connections
498
475
  })) n(t);
499
- e.mix.agents && (n(j), n(A), n(P), n(M)), e.mix.workflows && n(N), (e.mix.workflows || e.mix.agents) && n(L);
500
- for (let t of Le(e.plugins)) n(t);
476
+ e.mix.agents && (n(N), n(M), n(I), n(P)), e.mix.workflows && n(F), (e.mix.workflows || e.mix.agents) && n(ge);
477
+ for (let t of Re(e.plugins)) n(t);
501
478
  return [...t.values()];
502
- }, Je = async (e) => {
503
- let t = await Y(e.root), { plugins: n, schema: r } = await X(e.root);
479
+ }, Ke = async (e) => {
480
+ let n = await Y(e.root), { plugins: r, schema: i } = await X(e.root);
504
481
  return Q({
505
- mix: t,
506
- plugins: n,
507
- gates: q({
482
+ mix: n,
483
+ plugins: r,
484
+ gates: t({
508
485
  nodeEnv: process.env.NODE_ENV,
509
486
  cdcDialect: $(),
510
- declared: r
487
+ declared: i
511
488
  }),
512
489
  ...$() ? { cdcDialect: $() } : {}
513
490
  });
@@ -516,4 +493,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
516
493
  return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
517
494
  };
518
495
  //#endregion
519
- export { ke as C, Ee as E, Ae as S, R as T, Ve as _, Y as a, U as b, X as c, Ge as d, K as f, G as g, Re as h, $ as i, We as l, W as m, Je as n, J as o, Ue as p, Q as r, qe as s, Z as t, q as u, ze as v, B as w, Ie as x, Fe as y };
496
+ export { Ee as C, z as S, U as _, Y as a, Ae as b, X as c, W as d, ze as f, Ie as g, Be as h, $ as i, q as l, K as m, Ke as n, J as o, G as p, Q as r, Ge as s, Z as t, Ue as u, Le as v, B as x, je as y };
@@ -0,0 +1,2 @@
1
+ import { c as e, n as t } from "./frameworkTableAssembly-BNod_DKN.js";
2
+ export { t as assembleFrameworkTables, e as loadAppSchemaInputs };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-BrFKxnYW.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-CAxFLqG4.js";
2
2
  import { r as o } from "./templates-BR-fb4SP.js";
3
3
  //#region src/index.ts
4
4
  var s = "framework";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./cliError-BmdYnghb.js";
2
2
  import { r as t } from "./dialectDriver-czCHYpeH.js";
3
3
  import { a as n, r } from "./connectionConfig-Bk9IC7D0.js";
4
- import { n as i, s as a, y as o } from "./frameworkTableAssembly-BvZ0Lil_.js";
4
+ import { g as i, n as a, s as o } from "./frameworkTableAssembly-BNod_DKN.js";
5
5
  import { t as s } from "./cliRuntime-Dh7UDinH.js";
6
6
  import { join as c, relative as l, resolve as u } from "node:path";
7
7
  import { pathToFileURL as d } from "node:url";
@@ -43,7 +43,7 @@ var _ = /* @__PURE__ */ new Set([
43
43
  root: e
44
44
  }), 1;
45
45
  yield* m.logInfo(`discovered ${t.length} schema file(s)`, { files: t.map((t) => l(e, t)) });
46
- let n = yield* x(t), r = yield* m.promise(() => i({ root: e })), s = [...n, ...r];
46
+ let n = yield* x(t), r = yield* m.promise(() => a({ root: e })), s = [...n, ...r];
47
47
  if (yield* m.logInfo(`tables to apply: ${s.length}`, {
48
48
  user: n.map((e) => e.tableName),
49
49
  framework: r.map((e) => e.tableName)
@@ -56,7 +56,7 @@ var _ = /* @__PURE__ */ new Set([
56
56
  });
57
57
  let g = yield* m.promise(() => w()), _ = g.makeSqlLayer(C());
58
58
  yield* m.promise(() => h(s, _, g.id, { retryFilter: g.retryFilter }));
59
- let v = yield* m.promise(() => a(e)), b = [], S = yield* o(v, (e, t) => {
59
+ let v = yield* m.promise(() => o(e)), b = [], S = yield* i(v, (e, t) => {
60
60
  b.push({
61
61
  message: e,
62
62
  fields: t ?? {}
@@ -79,7 +79,7 @@ var _ = /* @__PURE__ */ new Set([
79
79
  let t = u(e.find((e) => !e.startsWith("-")) ?? process.cwd());
80
80
  return s(S(t), { scope: "voltro:migrate" });
81
81
  }
82
- let { runDbCommand: t } = await import("./dbCommand-BUD4Fd8v.js");
82
+ let { runDbCommand: t } = await import("./dbCommand-D1Q33ktl.js");
83
83
  return t(["apply", ...e]);
84
84
  };
85
85
  //#endregion
@@ -1,4 +1,4 @@
1
- import { n as e } from "./apiBuild-FpHCWiv6.js";
1
+ import { n as e } from "./apiBuild-Dz8TJSxp.js";
2
2
  import { join as t, resolve as n, sep as r } from "node:path";
3
3
  import { existsSync as i, promises as a } from "node:fs";
4
4
  import { createLogger as o } from "@voltro/logger";
@@ -422,7 +422,7 @@ let package = Package(
422
422
  await l.mkdir(o(e), { recursive: !0 }), await l.writeFile(e, n.content, "utf8");
423
423
  }
424
424
  }, X = async (e) => {
425
- let { offlineManifest: t } = await import("./checkCommand-B2Fw73lu.js"), { manifest: n } = await t(e);
425
+ let { offlineManifest: t } = await import("./checkCommand-BUBqPBlI.js"), { manifest: n } = await t(e);
426
426
  return n;
427
427
  }, Z = async (e) => {
428
428
  let t = J(await (e.manifestProvider ?? X)(e.root), {