@voltro/cli 0.45.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 (117) hide show
  1. package/CHANGELOG.md +206 -0
  2. package/dist/apiBuild-BsooZpw2.js +2 -0
  3. package/dist/{apiBuild-CDQBNRDx.js → apiBuild-FpHCWiv6.js} +2 -2
  4. package/dist/bin.d.ts +8 -0
  5. package/dist/bin.js +1 -1
  6. package/dist/{build-yvsLG77U.js → build-zVygXxGB.js} +8 -8
  7. package/dist/{checkCommand-lrzwOzV1.js → checkCommand-B2Fw73lu.js} +1 -1
  8. package/dist/{checkCommand-Boxov8lr.js → checkCommand-D0dAKciE.js} +4 -4
  9. package/dist/{codegen-sbN1Y8PB.js → codegen-CrMXs4hb.js} +176 -162
  10. package/dist/codegen-DiMn2KkZ.js +2 -0
  11. package/dist/{codegenCommand-CQOLytL-.js → codegenCommand-BTtsnRus.js} +16 -16
  12. package/dist/{codemodRunner-5ZhDH3rB.js → codemodRunner-DSZjgyCL.js} +8 -0
  13. package/dist/{commands-CEkVoFM5.js → commands-BrFKxnYW.js} +24 -24
  14. package/dist/{dashboardCommand-0ahyp-zA.js → dashboardCommand-D9SjDc8E.js} +3 -3
  15. package/dist/{dataCommand-D4IlZcih.js → dataCommand-Dl11q14e.js} +271 -230
  16. package/dist/dbCommand-BUD4Fd8v.js +2 -0
  17. package/dist/{dbCommand-B237qI-j.js → dbCommand-jbrmzwW_.js} +110 -110
  18. package/dist/{dev-P4HyeY9W.js → dev-CaIfZnw5.js} +1 -1
  19. package/dist/{dev-DAM5CnAa.js → dev-RjB7eE_B.js} +2081 -2058
  20. package/dist/devActivity.d.ts +8 -0
  21. package/dist/doctorCommand-5zv6PN-G.js +2 -0
  22. package/dist/{doctorCommand-DW2cwAvC.js → doctorCommand-D7X29cw6.js} +16 -16
  23. package/dist/{doctorSourceRelations-CPjSwYuZ.js → doctorSourceRelations-Dd48LPvO.js} +15 -10
  24. package/dist/{dormancyCommand-BqQz7lbM.js → dormancyCommand-BGOP27fz.js} +1 -1
  25. package/dist/{embeddingsCommand-DJyArpU4.js → embeddingsCommand-D72E22bw.js} +1 -1
  26. package/dist/{envCommand-CviRZx1L.js → envCommand-BHSxz6wC.js} +2 -2
  27. package/dist/{evalCommand-6RUfPen4.js → evalCommand-Db01Kbng.js} +24 -24
  28. package/dist/{evolveCommand-qdlP-R9G.js → evolveCommand-C2ofGGlz.js} +2 -2
  29. package/dist/{frameworkTableAssembly-oMPBKqlE.js → frameworkTableAssembly-BvZ0Lil_.js} +97 -89
  30. package/dist/frameworkTableAssembly-DDKtwsy2.js +2 -0
  31. package/dist/index.d.ts +8 -0
  32. package/dist/index.js +1 -1
  33. package/dist/{infoCommand-CNWPSUcW.js → infoCommand-CuNl9cbh.js} +1 -1
  34. package/dist/inspectState.d.ts +8 -0
  35. package/dist/interruptedReplace-C1ZI84xi.js +27 -0
  36. package/dist/interruptedReplace-DNJ7MKph.js +2 -0
  37. package/dist/{migrate-DN47p2PG.js → migrate-odCPGHPq.js} +27 -27
  38. package/dist/{runtimeTrace-BDZSt9W_.js → runtimeTrace-C_OKr0jY.js} +1 -1
  39. package/dist/{sdkgen-sNaD3oZB.js → sdkgen-D9trW7sl.js} +1 -1
  40. package/dist/{seedRunner-IdHEprqf.js → seedRunner-Dgsiwk_e.js} +59 -59
  41. package/dist/serveCommand-BU0wfV6V.js +1931 -0
  42. package/dist/serveCommand-Bwrn_9Fn.js +2 -0
  43. package/dist/serveEntry.d.ts +8 -0
  44. package/dist/serveEntry.js +1 -1
  45. package/dist/{start-Ds3xyn8R.js → start-7HcSIKEp.js} +1 -1
  46. package/dist/{start-BAlGcjF5.js → start-DvlYDyAr.js} +1 -1
  47. package/dist/startEntry.d.ts +8 -0
  48. package/dist/startEntry.js +1 -1
  49. package/dist/startup.d.ts +8 -0
  50. package/dist/{test-CHb7UwvE.js → test-rXFq4S76.js} +1 -1
  51. package/dist/{updateCommand-rCnhaj84.js → updateCommand-BlyXavoG.js} +1 -1
  52. package/dist/updateCommand-CT5AvVg7.js +2 -0
  53. package/dist/{webDev-101csg6Q.js → webDev-B4IEMB0n.js} +6 -6
  54. package/dist/webDev-B79ji8M5.js +2 -0
  55. package/dist/{webhooksCommand-C0iZZfaI.js → webhooksCommand-BqcWcbuW.js} +1 -1
  56. package/package.json +23 -17
  57. package/templates/AGENTS.md +1 -1
  58. package/templates/agent-docs/_index.md +1 -1
  59. package/templates/agent-docs/cli.md +166 -2
  60. package/templates/agent-docs/data.md +70 -4
  61. package/templates/agent-docs/whats-new.md +14 -87
  62. package/templates/apps/api-ai/package.json +7 -7
  63. package/templates/apps/api-auth/package.json +8 -8
  64. package/templates/apps/api-backend/package.json +7 -7
  65. package/templates/apps/api-backend-deactivation/package.json +7 -7
  66. package/templates/apps/api-backend-mail/package.json +8 -8
  67. package/templates/apps/api-backend-mariadb/package.json +9 -9
  68. package/templates/apps/api-backend-sqlite/package.json +8 -8
  69. package/templates/apps/api-backend-storage/package.json +8 -8
  70. package/templates/apps/api-cms/package.json +10 -10
  71. package/templates/apps/api-collab/package.json +8 -8
  72. package/templates/apps/api-data-advanced/package.json +8 -8
  73. package/templates/apps/api-durable/package.json +8 -8
  74. package/templates/apps/api-feature-flags/package.json +9 -9
  75. package/templates/apps/api-governance/package.json +8 -8
  76. package/templates/apps/api-kv/package.json +8 -8
  77. package/templates/apps/api-moderation/package.json +8 -8
  78. package/templates/apps/api-observability/package.json +8 -8
  79. package/templates/apps/api-ratelimit/package.json +8 -8
  80. package/templates/apps/api-rbac/package.json +8 -8
  81. package/templates/apps/api-rest/package.json +7 -7
  82. package/templates/apps/api-saas/package.json +11 -11
  83. package/templates/apps/api-saas-starter/package.json +10 -10
  84. package/templates/apps/api-search/package.json +8 -8
  85. package/templates/apps/api-status/package.json +8 -8
  86. package/templates/apps/api-versioning/package.json +8 -8
  87. package/templates/apps/api-webhooks/package.json +9 -9
  88. package/templates/apps/changelog/package.json +6 -6
  89. package/templates/apps/edge-functions/package.json +2 -2
  90. package/templates/apps/frontend-admin/package.json +8 -8
  91. package/templates/apps/frontend-app/package.json +9 -9
  92. package/templates/apps/frontend-auth/package.json +8 -8
  93. package/templates/apps/frontend-blank/package.json +7 -7
  94. package/templates/apps/frontend-cms/package.json +9 -9
  95. package/templates/apps/frontend-collab/package.json +10 -10
  96. package/templates/apps/frontend-contact/package.json +7 -7
  97. package/templates/apps/frontend-dashboard/package.json +7 -7
  98. package/templates/apps/frontend-docs/package.json +7 -7
  99. package/templates/apps/frontend-i18n/package.json +6 -6
  100. package/templates/apps/frontend-landing/package.json +7 -7
  101. package/templates/apps/frontend-portal/package.json +8 -8
  102. package/templates/apps/frontend-saas/package.json +8 -8
  103. package/templates/apps/frontend-spa/package.json +7 -7
  104. package/templates/apps/frontend-ssr/package.json +7 -7
  105. package/templates/apps/frontend-ssr-api/package.json +8 -8
  106. package/templates/apps/frontend-static-blog/package.json +6 -6
  107. package/templates/apps/frontend-status/package.json +8 -8
  108. package/templates/apps/mobile-app/package.json +4 -4
  109. package/dist/apiBuild-yJCqJYQ8.js +0 -2
  110. package/dist/codegen-DcE2li1i.js +0 -2
  111. package/dist/dbCommand-BvQeKQOb.js +0 -2
  112. package/dist/doctorCommand-2K1dIzYk.js +0 -2
  113. package/dist/frameworkTableAssembly-DgylYh9_.js +0 -2
  114. package/dist/serveCommand-BBhT2U94.js +0 -1885
  115. package/dist/serveCommand-DY2jLy0o.js +0 -2
  116. package/dist/updateCommand-BH6EGuCc.js +0 -2
  117. package/dist/webDev-BLKBO34K.js +0 -2
@@ -4,171 +4,179 @@ import { basename as o, join as s } from "node:path";
4
4
  import { existsSync as c, promises as l } from "node:fs";
5
5
  import { pathToFileURL as u } from "node:url";
6
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";
7
8
  import { Effect as p } from "effect";
8
9
  import { SqlClient as m } from "@effect/sql";
9
- import { _voltroBudgetHoldsTable as te, _voltroWorkflowAdmissionsTable as ne, _voltroWorkflowPausesTable as re, _voltroWorkflowPendingTable as ie, _voltroWorkflowRunEventsTable as ae, _voltroWorkflowRunStepsTable as oe, _voltroWorkflowRunsTable as se, _voltroWorkflowStartContextsTable as ce, _voltroWorkflowWatermarksTable as le } from "@voltro/workflow";
10
- import { agentMessagesTable as ue, agentThreadsTable as de, aiBudgetTable as fe, aiInferencesTable as pe, aiUsageTable as me, isAgentDescriptor as he, isAgentExecutor as ge, promptsTable as h, resolveToolModuleHandlers as g } from "@voltro/ai";
11
- import { _voltroApiKeysTable as _, _voltroCdcOffsetsTable as v, _voltroIdempotencyTable as y, _voltroKvTable as b, _voltroMigrationPlansTable as x, _voltroMigrationsTable as S, _voltroMssqlCdcOffsetsTable as C, _voltroSeedsTable as w } from "@voltro/database";
12
- import { _voltroApprovalsTable as T, _voltroConnectionGrantsTable as E, _voltroConnectionsTable as D, _voltroScheduleClaimsTable as O, _voltroScheduleRunsTable as k, _voltroTracesTable as A, _voltroUndoLogTable as j, _voltroWakeupsTable as M, _voltroWorkflowEventDeliveriesTable as N, _voltroWorkflowEventsTable as P, outboxAttemptsTable as F, outboxTable as I } from "@voltro/runtime";
13
- import { _voltroWebhookDeliveriesTable as L, _voltroWebhookTargetsTable as _e } from "@voltro/plugin-webhooks/mixin";
14
- import { _voltroStorageBlobsTable as ve, _voltroStorageGrantsTable as ye, _voltroStorageRefsTable as be, _voltroStorageUsageTable as xe } from "@voltro/plugin-storage";
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";
13
+ import { _voltroWebhookDeliveriesTable as ve, _voltroWebhookTargetsTable as ye } from "@voltro/plugin-webhooks/mixin";
14
+ import { _voltroStorageBlobsTable as be, _voltroStorageGrantsTable as xe, _voltroStorageRefsTable as Se, _voltroStorageUsageTable as Ce } from "@voltro/plugin-storage";
15
15
  //#region src/frameworkTables.ts
16
- var Se = [
16
+ var we = [
17
17
  {
18
- table: S,
18
+ table: se,
19
19
  when: "always"
20
20
  },
21
21
  {
22
- table: w,
22
+ table: ue,
23
23
  when: "always"
24
24
  },
25
25
  {
26
- table: x,
26
+ table: oe,
27
27
  when: "always"
28
28
  },
29
29
  {
30
- table: se,
30
+ table: le,
31
+ when: "always"
32
+ },
33
+ {
34
+ table: ie,
35
+ when: "always"
36
+ },
37
+ {
38
+ table: D,
31
39
  when: "workflows"
32
40
  },
33
41
  {
34
- table: oe,
42
+ table: E,
35
43
  when: "workflows"
36
44
  },
37
45
  {
38
- table: ae,
46
+ table: T,
39
47
  when: "workflows"
40
48
  },
41
49
  {
42
- table: ce,
50
+ table: O,
43
51
  when: "workflows"
44
52
  },
45
53
  {
46
- table: ie,
54
+ table: w,
47
55
  when: "workflows"
48
56
  },
49
57
  {
50
- table: ne,
58
+ table: S,
51
59
  when: "workflows"
52
60
  },
53
61
  {
54
- table: re,
62
+ table: C,
55
63
  when: "workflows"
56
64
  },
57
65
  {
58
- table: le,
66
+ table: k,
59
67
  when: "workflows"
60
68
  },
61
69
  {
62
- table: P,
70
+ table: v,
63
71
  when: "workflows"
64
72
  },
65
73
  {
66
- table: N,
74
+ table: _,
67
75
  when: "workflows"
68
76
  },
69
77
  {
70
- table: k,
78
+ table: he,
71
79
  when: "schedules"
72
80
  },
73
81
  {
74
- table: O,
82
+ table: me,
75
83
  when: "schedules"
76
84
  },
77
85
  {
78
- table: _e,
86
+ table: ye,
79
87
  when: "webhooks"
80
88
  },
81
89
  {
82
- table: L,
90
+ table: ve,
83
91
  when: "webhooks"
84
92
  },
85
93
  {
86
- table: A,
94
+ table: ge,
87
95
  when: "traces"
88
96
  },
89
97
  {
90
- table: j,
98
+ table: h,
91
99
  when: "undo"
92
100
  },
93
101
  {
94
- table: T,
102
+ table: de,
95
103
  when: "always"
96
104
  },
97
105
  {
98
- table: te,
106
+ table: x,
99
107
  when: "workflows"
100
108
  },
101
109
  {
102
- table: I,
110
+ table: b,
103
111
  when: "always"
104
112
  },
105
113
  {
106
- table: F,
114
+ table: y,
107
115
  when: "always"
108
116
  },
109
117
  {
110
- table: D,
118
+ table: pe,
111
119
  when: "connections"
112
120
  },
113
121
  {
114
- table: E,
122
+ table: fe,
115
123
  when: "connections"
116
124
  },
117
125
  {
118
- table: M,
126
+ table: g,
119
127
  when: "always"
120
128
  },
121
129
  {
122
- table: be,
130
+ table: Se,
123
131
  when: "always"
124
132
  },
125
133
  {
126
- table: ye,
134
+ table: xe,
127
135
  when: "always"
128
136
  },
129
137
  {
130
- table: ve,
138
+ table: be,
131
139
  when: "always"
132
140
  },
133
141
  {
134
- table: xe,
142
+ table: Ce,
135
143
  when: "always"
136
144
  },
137
145
  {
138
- table: y,
146
+ table: re,
139
147
  when: "always"
140
148
  },
141
149
  {
142
- table: _,
150
+ table: te,
143
151
  when: "always"
144
152
  },
145
153
  {
146
- table: b,
154
+ table: ae,
147
155
  when: "always"
148
156
  }
149
- ], Ce = (e) => {
150
- let t = Se.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);
151
- return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? C : v), t;
157
+ ], Te = (e) => {
158
+ 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;
152
160
  }, R = (e) => {
153
161
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
154
162
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
155
- }, we = (e) => {
163
+ }, Ee = (e) => {
156
164
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
157
165
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/#/g, "--").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
158
- }, Te = (e, t) => z(e, t.name), z = (e, t) => {
166
+ }, z = (e, t) => B(e, t.name), B = (e, t) => {
159
167
  let n = R(e.name);
160
168
  if (!t.includes(".")) return `${n}.${t}`;
161
169
  if (e.baseName === void 0) return t;
162
170
  let r = `${R(e.baseName)}.`;
163
171
  return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
164
- }, B = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, Ee = (e, t, n) => {
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) => {
165
173
  switch (e) {
166
174
  case "query": return ee({
167
175
  name: t,
168
176
  input: n.input,
169
177
  output: n.output,
170
178
  ...n.error === void 0 ? {} : { error: n.error },
171
- ...B(n),
179
+ ...V(n),
172
180
  ...n.source === void 0 ? {} : { source: n.source }
173
181
  });
174
182
  case "mutation": return f({
@@ -176,33 +184,33 @@ var Se = [
176
184
  input: n.input,
177
185
  output: n.output,
178
186
  ...n.error === void 0 ? {} : { error: n.error },
179
- ...B(n)
187
+ ...V(n)
180
188
  });
181
189
  case "action": return d({
182
190
  name: t,
183
191
  input: n.input,
184
192
  output: n.output,
185
193
  ...n.error === void 0 ? {} : { error: n.error },
186
- ...B(n)
194
+ ...V(n)
187
195
  });
188
196
  }
189
- }, De = (e) => (t, n) => p.suspend(() => {
197
+ }, Oe = (e) => (t, n) => p.suspend(() => {
190
198
  let r = { request: {
191
199
  subject: n.request.subject,
192
200
  traceId: n.request.traceId
193
201
  } };
194
202
  return e.execute(t, r);
195
- }), Oe = (e) => {
203
+ }), ke = (e) => {
196
204
  let t = [];
197
205
  for (let n of e) {
198
206
  let e = n.routes ?? [];
199
207
  for (let r of e) {
200
- let e = Te(n, r), i = Ee(r.kind, e, r);
208
+ let e = z(n, r), i = De(r.kind, e, r);
201
209
  t.push({
202
210
  kind: r.kind,
203
211
  file: `plugin:${n.name}`,
204
212
  descriptor: i,
205
- executor: De(r),
213
+ executor: Oe(r),
206
214
  plugin: {
207
215
  name: n.name,
208
216
  version: n.version
@@ -211,7 +219,7 @@ var Se = [
211
219
  }
212
220
  }
213
221
  return t;
214
- }, ke = (e, t, n = /* @__PURE__ */ new Set()) => {
222
+ }, Ae = (e, t, n = /* @__PURE__ */ new Set()) => {
215
223
  let r = /* @__PURE__ */ new Map();
216
224
  for (let e of t) r.set(e, "user-route");
217
225
  let i = [];
@@ -223,9 +231,9 @@ var Se = [
223
231
  }
224
232
  }
225
233
  return i;
226
- }, V = "_voltro_plugin_migrations", Ae = () => p.gen(function* () {
234
+ }, H = "_voltro_plugin_migrations", je = () => p.gen(function* () {
227
235
  yield* (yield* m.SqlClient).unsafe(`
228
- CREATE TABLE IF NOT EXISTS ${V} (
236
+ CREATE TABLE IF NOT EXISTS ${H} (
229
237
  id TEXT PRIMARY KEY,
230
238
  plugin_name TEXT NOT NULL,
231
239
  migration_id TEXT NOT NULL,
@@ -233,25 +241,25 @@ var Se = [
233
241
  applied_at TEXT NOT NULL
234
242
  );
235
243
  `).pipe(p.orDie);
236
- }), je = (e, t) => `${R(e)}__${t}`, Me = () => p.gen(function* () {
237
- let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(V)}`.pipe(p.orDie);
244
+ }), Me = (e, t) => `${R(e)}__${t}`, Ne = () => p.gen(function* () {
245
+ let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(H)}`.pipe(p.orDie);
238
246
  return new Set(t.map((e) => e.id));
239
- }), Ne = (e) => p.gen(function* () {
247
+ }), Pe = (e) => p.gen(function* () {
240
248
  let t = yield* m.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
241
249
  yield* t`
242
- INSERT INTO ${t(V)} (id, plugin_name, migration_id, description, applied_at)
250
+ INSERT INTO ${t(H)} (id, plugin_name, migration_id, description, applied_at)
243
251
  VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
244
252
  `.pipe(p.orDie);
245
- }), H = (e) => p.gen(function* () {
253
+ }), U = (e) => p.gen(function* () {
246
254
  let t = e.flatMap((e) => (e.extendSchema?.migrations ?? []).map((t) => ({
247
255
  plugin: e,
248
256
  migration: t
249
257
  })));
250
258
  if (t.length === 0) return [];
251
- yield* Ae();
252
- let n = yield* Me(), r = [];
259
+ yield* je();
260
+ let n = yield* Ne(), r = [];
253
261
  for (let { plugin: e, migration: i } of t) {
254
- let t = je(e.name, i.id), a = Date.now();
262
+ let t = Me(e.name, i.id), a = Date.now();
255
263
  if (n.has(t)) {
256
264
  r.push({
257
265
  pluginName: e.name,
@@ -263,7 +271,7 @@ var Se = [
263
271
  }
264
272
  let o = yield* m.SqlClient;
265
273
  try {
266
- yield* i.up(o).pipe(p.mapError((e) => e)), yield* Ne({
274
+ yield* i.up(o).pipe(p.mapError((e) => e)), yield* Pe({
267
275
  key: t,
268
276
  pluginName: e.name,
269
277
  migration: i
@@ -284,29 +292,29 @@ var Se = [
284
292
  }
285
293
  }
286
294
  return r;
287
- }), Pe = (e, t) => p.gen(function* () {
288
- let n = yield* H(e);
295
+ }), Fe = (e, t) => p.gen(function* () {
296
+ let n = yield* U(e);
289
297
  if (n.length === 0) return n;
290
298
  let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
291
299
  return t(`plugin migrations: ${r.length} applied, ${i.length} already applied`, { applied: r.map((e) => `${e.pluginName}:${e.migrationId}`) }), n;
292
- }), Fe = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
300
+ }), Ie = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
293
301
  pluginName: e.name,
294
302
  pluginAlias: R(e.name),
295
303
  tables: e.extendSchema.tables?.length ?? 0,
296
304
  migrations: e.extendSchema.migrations?.length ?? 0
297
- })), Ie = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), U = /(?<!\.server)\.agent\.tsx?$/, Le = /\.agent\.server\.tsx?$/, W = /\.tool\.tsx?$/, Re = async (t, n) => {
305
+ })), Le = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, Re = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, ze = async (t, n) => {
298
306
  let r = 0;
299
- for (let i of t) if (W.test(i)) try {
307
+ for (let i of t) if (G.test(i)) try {
300
308
  let t = await e(i);
301
- r += g(t);
309
+ r += _e(t);
302
310
  } catch (e) {
303
311
  n.warn("tool: failed to import — handler not wired", { file: i }, e);
304
312
  }
305
313
  return r;
306
- }, ze = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Be = async (t, n) => {
314
+ }, Be = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ve = async (t, n) => {
307
315
  let r = [], i = /* @__PURE__ */ new Set();
308
316
  for (let a of t) {
309
- if (!U.test(a)) continue;
317
+ if (!W.test(a)) continue;
310
318
  let t;
311
319
  try {
312
320
  t = await e(a);
@@ -314,7 +322,7 @@ var Se = [
314
322
  n.warn("agent: failed to import descriptor", { file: a }, e);
315
323
  continue;
316
324
  }
317
- let o = Object.values(t).find(he);
325
+ let o = Object.values(t).find(F);
318
326
  if (o === void 0) {
319
327
  n.warn("agent: no defineAgent() descriptor export found", { file: a });
320
328
  continue;
@@ -326,7 +334,7 @@ var Se = [
326
334
  });
327
335
  continue;
328
336
  }
329
- let s = ze(a), c;
337
+ let s = Be(a), c;
330
338
  try {
331
339
  c = await e(s);
332
340
  } catch (e) {
@@ -338,7 +346,7 @@ var Se = [
338
346
  continue;
339
347
  }
340
348
  let l = c.default;
341
- if (!ge(l)) {
349
+ if (!I(l)) {
342
350
  n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
343
351
  file: s,
344
352
  name: o.name
@@ -353,7 +361,7 @@ var Se = [
353
361
  });
354
362
  }
355
363
  return { agents: r };
356
- }, G = /\.connection\.tsx?$/, Ve = (e) => e.replace(G, ""), K = async (t, n) => {
364
+ }, K = /\.connection\.tsx?$/, He = (e) => e.replace(K, ""), Ue = async (t, n) => {
357
365
  let r = [], i = /* @__PURE__ */ new Map();
358
366
  for (let a of t) {
359
367
  let t;
@@ -396,7 +404,7 @@ var Se = [
396
404
  }
397
405
  return r.length > 0 && n.info("discovered connections", {
398
406
  connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
399
- files: r.map((e) => Ve(o(e.file)))
407
+ files: r.map((e) => He(o(e.file)))
400
408
  }), r;
401
409
  }, q = (e) => {
402
410
  let t = e.nodeEnv !== "production";
@@ -405,13 +413,13 @@ var Se = [
405
413
  undo: e.declared?.undo ?? t,
406
414
  cdc: e.cdcDialect !== void 0
407
415
  };
408
- }, He = (e) => {
416
+ }, We = (e) => {
409
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}`;
410
418
  return `The three tables whose presence is DECIDED rather than implied by your source tree —
411
419
  compare these against the other process's environment before anything else:
412
420
 
413
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.`;
414
- }, Ue = (e) => {
422
+ }, Ge = (e) => {
415
423
  let t = [{
416
424
  key: "traces",
417
425
  table: "_voltro_traces",
@@ -430,7 +438,7 @@ ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_
430
438
  await d(s(e, l.name));
431
439
  } else {
432
440
  let e = l.name;
433
- (r.test(e) || t.test(e)) && (n = !0), J(e) && (a = !0), i.test(e) && (o = !0), U.test(e) && (c = !0), G.test(e) && (u = !0);
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);
434
442
  }
435
443
  };
436
444
  return await d(e), {
@@ -440,7 +448,7 @@ ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_
440
448
  agents: c,
441
449
  connections: u
442
450
  };
443
- }, We = async (e) => {
451
+ }, Ke = async (e) => {
444
452
  let t = s(e, "app.config.ts");
445
453
  if (!c(t)) return { plugins: [] };
446
454
  try {
@@ -455,8 +463,8 @@ ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_
455
463
  error: e
456
464
  };
457
465
  }
458
- }, Ge = async (e) => (await X(e)).plugins, X = async (e) => {
459
- let { plugins: t, schema: n, error: r } = await We(e);
466
+ }, qe = async (e) => (await X(e)).plugins, X = async (e) => {
467
+ let { plugins: t, schema: n, error: r } = await Ke(e);
460
468
  if (r !== void 0) throw new Z(e, r);
461
469
  return {
462
470
  plugins: t,
@@ -478,7 +486,7 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
478
486
  let t = /* @__PURE__ */ new Map(), n = (e) => {
479
487
  e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
480
488
  };
481
- for (let t of Ce({
489
+ for (let t of Te({
482
490
  workflows: e.mix.workflows,
483
491
  schedules: e.mix.schedules,
484
492
  webhooks: e.mix.webhooks,
@@ -488,10 +496,10 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
488
496
  undo: e.gates.undo,
489
497
  connections: e.mix.connections
490
498
  })) n(t);
491
- e.mix.agents && (n(de), n(ue), n(me), n(fe)), e.mix.workflows && n(pe), (e.mix.workflows || e.mix.agents) && n(h);
492
- for (let t of Ie(e.plugins)) 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);
493
501
  return [...t.values()];
494
- }, Ke = async (e) => {
502
+ }, Je = async (e) => {
495
503
  let t = await Y(e.root), { plugins: n, schema: r } = await X(e.root);
496
504
  return Q({
497
505
  mix: t,
@@ -508,4 +516,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
508
516
  return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
509
517
  };
510
518
  //#endregion
511
- export { Oe as C, we as E, ke as S, R as T, Be as _, Y as a, H as b, X as c, Ue as d, G as f, W as g, Le as h, $ as i, He as l, U as m, Ke as n, J as o, K as p, Q as r, Ge as s, Z as t, q as u, Re as v, z as w, Fe as x, Pe as y };
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 };
@@ -0,0 +1,2 @@
1
+ import { c as e, n as t } from "./frameworkTableAssembly-BvZ0Lil_.js";
2
+ export { t as assembleFrameworkTables, e as loadAppSchemaInputs };
package/dist/index.d.ts CHANGED
@@ -136,3 +136,11 @@ declare module '@voltro/protocol' {
136
136
  '_voltro_undo_log': true;
137
137
  }
138
138
  }
139
+
140
+
141
+ declare module '@voltro/protocol' {
142
+ interface VoltroTableNames {
143
+ 'invoices': true;
144
+ 'invoice_lines': true;
145
+ }
146
+ }
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-CEkVoFM5.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-BrFKxnYW.js";
2
2
  import { r as o } from "./templates-BR-fb4SP.js";
3
3
  //#region src/index.ts
4
4
  var s = "framework";
@@ -1,5 +1,5 @@
1
1
  import { n as e, r as t, t as n } from "./cliOutput-D1tSBoRM.js";
2
- import { o as r } from "./updateCommand-rCnhaj84.js";
2
+ import { o as r } from "./updateCommand-BlyXavoG.js";
3
3
  import { join as i, resolve as a } from "node:path";
4
4
  import { readFileSync as o, readdirSync as s, statSync as c } from "node:fs";
5
5
  //#region src/infoCommand.ts
@@ -134,3 +134,11 @@ declare module '@voltro/protocol' {
134
134
  '_voltro_undo_log': true;
135
135
  }
136
136
  }
137
+
138
+
139
+ declare module '@voltro/protocol' {
140
+ interface VoltroTableNames {
141
+ 'invoices': true;
142
+ 'invoice_lines': true;
143
+ }
144
+ }
@@ -0,0 +1,27 @@
1
+ import { REPLACE_IN_PROGRESS_TABLE as e, interruptedReplaceRefusal as t } from "@voltro/database";
2
+ //#region src/interruptedReplace.ts
3
+ var n = async (n) => {
4
+ try {
5
+ let r = await n.query({
6
+ table: e,
7
+ predicate: void 0,
8
+ order: [],
9
+ take: void 0,
10
+ skip: void 0,
11
+ projection: void 0
12
+ });
13
+ if (r.length === 0) return;
14
+ let i = r.map((e) => ({
15
+ id: String(e.id ?? ""),
16
+ startedAt: e.startedAt instanceof Date ? e.startedAt : new Date(String(e.startedAt ?? "")),
17
+ tables: Number(e.tables ?? 0),
18
+ capture: e.capture === null || e.capture === void 0 ? null : String(e.capture),
19
+ via: String(e.via ?? "unknown")
20
+ }));
21
+ return t(i);
22
+ } catch {
23
+ return;
24
+ }
25
+ };
26
+ //#endregion
27
+ export { n as t };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./interruptedReplace-C1ZI84xi.js";
2
+ export { e as interruptedReplaceAtBoot };