@voltro/cli 0.45.0 → 0.46.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 (112) hide show
  1. package/CHANGELOG.md +176 -0
  2. package/dist/{apiBuild-CDQBNRDx.js → apiBuild-BKdd0I1Z.js} +2 -2
  3. package/dist/apiBuild-P2gewrfQ.js +2 -0
  4. package/dist/bin.d.ts +8 -0
  5. package/dist/bin.js +1 -1
  6. package/dist/{build-yvsLG77U.js → build-co6yadYz.js} +7 -7
  7. package/dist/{checkCommand-Boxov8lr.js → checkCommand-B-eiW-G_.js} +3 -3
  8. package/dist/{checkCommand-lrzwOzV1.js → checkCommand-CXAXTjZL.js} +1 -1
  9. package/dist/{codegenCommand-CQOLytL-.js → codegenCommand-CB6_3sX0.js} +15 -15
  10. package/dist/{codemodRunner-5ZhDH3rB.js → codemodRunner-DSZjgyCL.js} +8 -0
  11. package/dist/{commands-CEkVoFM5.js → commands-C-hxgAGr.js} +23 -23
  12. package/dist/{dashboardCommand-0ahyp-zA.js → dashboardCommand-CEVO0GWF.js} +3 -3
  13. package/dist/{dataCommand-D4IlZcih.js → dataCommand-k0ezbQWa.js} +271 -230
  14. package/dist/{dbCommand-B237qI-j.js → dbCommand-BwkyNxn-.js} +110 -110
  15. package/dist/dbCommand-C2XK63Dd.js +2 -0
  16. package/dist/{dev-DAM5CnAa.js → dev-8hTEnN6s.js} +2080 -2057
  17. package/dist/{dev-P4HyeY9W.js → dev-DyoYst4j.js} +1 -1
  18. package/dist/devActivity.d.ts +8 -0
  19. package/dist/{doctorCommand-DW2cwAvC.js → doctorCommand-B6D7HH1-.js} +14 -14
  20. package/dist/doctorCommand-Btl2Jz1a.js +2 -0
  21. package/dist/{dormancyCommand-BqQz7lbM.js → dormancyCommand-CrPAwOgo.js} +1 -1
  22. package/dist/{embeddingsCommand-DJyArpU4.js → embeddingsCommand-DsSxsn_b.js} +1 -1
  23. package/dist/{envCommand-CviRZx1L.js → envCommand-B_NPVGUf.js} +2 -2
  24. package/dist/{evalCommand-6RUfPen4.js → evalCommand-Db01Kbng.js} +24 -24
  25. package/dist/{evolveCommand-qdlP-R9G.js → evolveCommand-DUuaCIyn.js} +2 -2
  26. package/dist/{frameworkTableAssembly-oMPBKqlE.js → frameworkTableAssembly-BPlPfU07.js} +82 -78
  27. package/dist/frameworkTableAssembly-Bob3vj9R.js +2 -0
  28. package/dist/index.d.ts +8 -0
  29. package/dist/index.js +1 -1
  30. package/dist/{infoCommand-CNWPSUcW.js → infoCommand-CuNl9cbh.js} +1 -1
  31. package/dist/inspectState.d.ts +8 -0
  32. package/dist/interruptedReplace-C1ZI84xi.js +27 -0
  33. package/dist/interruptedReplace-DNJ7MKph.js +2 -0
  34. package/dist/{migrate-DN47p2PG.js → migrate-CM1qwalu.js} +27 -27
  35. package/dist/{runtimeTrace-BDZSt9W_.js → runtimeTrace-BRNM06vK.js} +1 -1
  36. package/dist/{sdkgen-sNaD3oZB.js → sdkgen-CRCw_XcR.js} +1 -1
  37. package/dist/{seedRunner-IdHEprqf.js → seedRunner-Dgsiwk_e.js} +59 -59
  38. package/dist/serveCommand-BNHMVXyp.js +2 -0
  39. package/dist/serveCommand-CHOr74WM.js +1928 -0
  40. package/dist/serveEntry.d.ts +8 -0
  41. package/dist/serveEntry.js +1 -1
  42. package/dist/{start-Ds3xyn8R.js → start-7HcSIKEp.js} +1 -1
  43. package/dist/{start-BAlGcjF5.js → start-DvlYDyAr.js} +1 -1
  44. package/dist/startEntry.d.ts +8 -0
  45. package/dist/startEntry.js +1 -1
  46. package/dist/startup.d.ts +8 -0
  47. package/dist/{updateCommand-rCnhaj84.js → updateCommand-BlyXavoG.js} +1 -1
  48. package/dist/updateCommand-CT5AvVg7.js +2 -0
  49. package/dist/{webDev-101csg6Q.js → webDev-B4IEMB0n.js} +6 -6
  50. package/dist/webDev-B79ji8M5.js +2 -0
  51. package/dist/{webhooksCommand-C0iZZfaI.js → webhooksCommand-BRrG_sGf.js} +1 -1
  52. package/package.json +23 -17
  53. package/templates/AGENTS.md +1 -1
  54. package/templates/agent-docs/_index.md +1 -1
  55. package/templates/agent-docs/cli.md +138 -2
  56. package/templates/agent-docs/data.md +70 -4
  57. package/templates/agent-docs/whats-new.md +127 -54
  58. package/templates/apps/api-ai/package.json +7 -7
  59. package/templates/apps/api-auth/package.json +8 -8
  60. package/templates/apps/api-backend/package.json +7 -7
  61. package/templates/apps/api-backend-deactivation/package.json +7 -7
  62. package/templates/apps/api-backend-mail/package.json +8 -8
  63. package/templates/apps/api-backend-mariadb/package.json +9 -9
  64. package/templates/apps/api-backend-sqlite/package.json +8 -8
  65. package/templates/apps/api-backend-storage/package.json +8 -8
  66. package/templates/apps/api-cms/package.json +10 -10
  67. package/templates/apps/api-collab/package.json +8 -8
  68. package/templates/apps/api-data-advanced/package.json +8 -8
  69. package/templates/apps/api-durable/package.json +8 -8
  70. package/templates/apps/api-feature-flags/package.json +9 -9
  71. package/templates/apps/api-governance/package.json +8 -8
  72. package/templates/apps/api-kv/package.json +8 -8
  73. package/templates/apps/api-moderation/package.json +8 -8
  74. package/templates/apps/api-observability/package.json +8 -8
  75. package/templates/apps/api-ratelimit/package.json +8 -8
  76. package/templates/apps/api-rbac/package.json +8 -8
  77. package/templates/apps/api-rest/package.json +7 -7
  78. package/templates/apps/api-saas/package.json +11 -11
  79. package/templates/apps/api-saas-starter/package.json +10 -10
  80. package/templates/apps/api-search/package.json +8 -8
  81. package/templates/apps/api-status/package.json +8 -8
  82. package/templates/apps/api-versioning/package.json +8 -8
  83. package/templates/apps/api-webhooks/package.json +9 -9
  84. package/templates/apps/changelog/package.json +6 -6
  85. package/templates/apps/edge-functions/package.json +2 -2
  86. package/templates/apps/frontend-admin/package.json +8 -8
  87. package/templates/apps/frontend-app/package.json +9 -9
  88. package/templates/apps/frontend-auth/package.json +8 -8
  89. package/templates/apps/frontend-blank/package.json +7 -7
  90. package/templates/apps/frontend-cms/package.json +9 -9
  91. package/templates/apps/frontend-collab/package.json +10 -10
  92. package/templates/apps/frontend-contact/package.json +7 -7
  93. package/templates/apps/frontend-dashboard/package.json +7 -7
  94. package/templates/apps/frontend-docs/package.json +7 -7
  95. package/templates/apps/frontend-i18n/package.json +6 -6
  96. package/templates/apps/frontend-landing/package.json +7 -7
  97. package/templates/apps/frontend-portal/package.json +8 -8
  98. package/templates/apps/frontend-saas/package.json +8 -8
  99. package/templates/apps/frontend-spa/package.json +7 -7
  100. package/templates/apps/frontend-ssr/package.json +7 -7
  101. package/templates/apps/frontend-ssr-api/package.json +8 -8
  102. package/templates/apps/frontend-static-blog/package.json +6 -6
  103. package/templates/apps/frontend-status/package.json +8 -8
  104. package/templates/apps/mobile-app/package.json +4 -4
  105. package/dist/apiBuild-yJCqJYQ8.js +0 -2
  106. package/dist/dbCommand-BvQeKQOb.js +0 -2
  107. package/dist/doctorCommand-2K1dIzYk.js +0 -2
  108. package/dist/frameworkTableAssembly-DgylYh9_.js +0 -2
  109. package/dist/serveCommand-BBhT2U94.js +0 -1885
  110. package/dist/serveCommand-DY2jLy0o.js +0 -2
  111. package/dist/updateCommand-BH6EGuCc.js +0 -2
  112. package/dist/webDev-BLKBO34K.js +0 -2
@@ -4,164 +4,168 @@ 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, _voltroKvTable as ie, _voltroMigrationPlansTable as ae, _voltroMigrationsTable as oe, _voltroMssqlCdcOffsetsTable as se, _voltroReplaceInProgressTable as ce, _voltroSeedsTable as le } 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 ue, _voltroConnectionGrantsTable as de, _voltroConnectionsTable as fe, _voltroScheduleClaimsTable as pe, _voltroScheduleRunsTable as me, _voltroTracesTable as he, _voltroUndoLogTable as ge, _voltroWakeupsTable as h, _voltroWorkflowEventDeliveriesTable as g, _voltroWorkflowEventsTable as _, outboxAttemptsTable as v, outboxTable as y } from "@voltro/runtime";
11
+ import { _voltroBudgetHoldsTable as b, _voltroWorkflowAdmissionsTable as x, _voltroWorkflowPausesTable as S, _voltroWorkflowPendingTable as C, _voltroWorkflowRunEventsTable as w, _voltroWorkflowRunStepsTable as T, _voltroWorkflowRunsTable as E, _voltroWorkflowStartContextsTable as D, _voltroWorkflowWatermarksTable as O } from "@voltro/workflow";
12
+ import { agentMessagesTable as k, agentThreadsTable as A, aiBudgetTable as j, aiInferencesTable as M, aiUsageTable as N, isAgentDescriptor as P, isAgentExecutor as F, promptsTable as I, resolveToolModuleHandlers as L } from "@voltro/ai";
13
+ import { _voltroWebhookDeliveriesTable as _e, _voltroWebhookTargetsTable as ve } from "@voltro/plugin-webhooks/mixin";
14
+ import { _voltroStorageBlobsTable as ye, _voltroStorageGrantsTable as be, _voltroStorageRefsTable as xe, _voltroStorageUsageTable as Se } from "@voltro/plugin-storage";
15
15
  //#region src/frameworkTables.ts
16
- var Se = [
16
+ var Ce = [
17
17
  {
18
- table: S,
18
+ table: oe,
19
19
  when: "always"
20
20
  },
21
21
  {
22
- table: w,
22
+ table: le,
23
23
  when: "always"
24
24
  },
25
25
  {
26
- table: x,
26
+ table: ae,
27
27
  when: "always"
28
28
  },
29
29
  {
30
- table: se,
30
+ table: ce,
31
+ when: "always"
32
+ },
33
+ {
34
+ table: E,
31
35
  when: "workflows"
32
36
  },
33
37
  {
34
- table: oe,
38
+ table: T,
35
39
  when: "workflows"
36
40
  },
37
41
  {
38
- table: ae,
42
+ table: w,
39
43
  when: "workflows"
40
44
  },
41
45
  {
42
- table: ce,
46
+ table: D,
43
47
  when: "workflows"
44
48
  },
45
49
  {
46
- table: ie,
50
+ table: C,
47
51
  when: "workflows"
48
52
  },
49
53
  {
50
- table: ne,
54
+ table: x,
51
55
  when: "workflows"
52
56
  },
53
57
  {
54
- table: re,
58
+ table: S,
55
59
  when: "workflows"
56
60
  },
57
61
  {
58
- table: le,
62
+ table: O,
59
63
  when: "workflows"
60
64
  },
61
65
  {
62
- table: P,
66
+ table: _,
63
67
  when: "workflows"
64
68
  },
65
69
  {
66
- table: N,
70
+ table: g,
67
71
  when: "workflows"
68
72
  },
69
73
  {
70
- table: k,
74
+ table: me,
71
75
  when: "schedules"
72
76
  },
73
77
  {
74
- table: O,
78
+ table: pe,
75
79
  when: "schedules"
76
80
  },
77
81
  {
78
- table: _e,
82
+ table: ve,
79
83
  when: "webhooks"
80
84
  },
81
85
  {
82
- table: L,
86
+ table: _e,
83
87
  when: "webhooks"
84
88
  },
85
89
  {
86
- table: A,
90
+ table: he,
87
91
  when: "traces"
88
92
  },
89
93
  {
90
- table: j,
94
+ table: ge,
91
95
  when: "undo"
92
96
  },
93
97
  {
94
- table: T,
98
+ table: ue,
95
99
  when: "always"
96
100
  },
97
101
  {
98
- table: te,
102
+ table: b,
99
103
  when: "workflows"
100
104
  },
101
105
  {
102
- table: I,
106
+ table: y,
103
107
  when: "always"
104
108
  },
105
109
  {
106
- table: F,
110
+ table: v,
107
111
  when: "always"
108
112
  },
109
113
  {
110
- table: D,
114
+ table: fe,
111
115
  when: "connections"
112
116
  },
113
117
  {
114
- table: E,
118
+ table: de,
115
119
  when: "connections"
116
120
  },
117
121
  {
118
- table: M,
122
+ table: h,
119
123
  when: "always"
120
124
  },
121
125
  {
122
- table: be,
126
+ table: xe,
123
127
  when: "always"
124
128
  },
125
129
  {
126
- table: ye,
130
+ table: be,
127
131
  when: "always"
128
132
  },
129
133
  {
130
- table: ve,
134
+ table: ye,
131
135
  when: "always"
132
136
  },
133
137
  {
134
- table: xe,
138
+ table: Se,
135
139
  when: "always"
136
140
  },
137
141
  {
138
- table: y,
142
+ table: re,
139
143
  when: "always"
140
144
  },
141
145
  {
142
- table: _,
146
+ table: te,
143
147
  when: "always"
144
148
  },
145
149
  {
146
- table: b,
150
+ table: ie,
147
151
  when: "always"
148
152
  }
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;
153
+ ], we = (e) => {
154
+ let t = Ce.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);
155
+ return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? se : ne), t;
152
156
  }, R = (e) => {
153
157
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
154
158
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
155
- }, we = (e) => {
159
+ }, Te = (e) => {
156
160
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
157
161
  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) => {
162
+ }, Ee = (e, t) => z(e, t.name), z = (e, t) => {
159
163
  let n = R(e.name);
160
164
  if (!t.includes(".")) return `${n}.${t}`;
161
165
  if (e.baseName === void 0) return t;
162
166
  let r = `${R(e.baseName)}.`;
163
167
  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) => {
168
+ }, B = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, De = (e, t, n) => {
165
169
  switch (e) {
166
170
  case "query": return ee({
167
171
  name: t,
@@ -186,23 +190,23 @@ var Se = [
186
190
  ...B(n)
187
191
  });
188
192
  }
189
- }, De = (e) => (t, n) => p.suspend(() => {
193
+ }, Oe = (e) => (t, n) => p.suspend(() => {
190
194
  let r = { request: {
191
195
  subject: n.request.subject,
192
196
  traceId: n.request.traceId
193
197
  } };
194
198
  return e.execute(t, r);
195
- }), Oe = (e) => {
199
+ }), ke = (e) => {
196
200
  let t = [];
197
201
  for (let n of e) {
198
202
  let e = n.routes ?? [];
199
203
  for (let r of e) {
200
- let e = Te(n, r), i = Ee(r.kind, e, r);
204
+ let e = Ee(n, r), i = De(r.kind, e, r);
201
205
  t.push({
202
206
  kind: r.kind,
203
207
  file: `plugin:${n.name}`,
204
208
  descriptor: i,
205
- executor: De(r),
209
+ executor: Oe(r),
206
210
  plugin: {
207
211
  name: n.name,
208
212
  version: n.version
@@ -211,7 +215,7 @@ var Se = [
211
215
  }
212
216
  }
213
217
  return t;
214
- }, ke = (e, t, n = /* @__PURE__ */ new Set()) => {
218
+ }, Ae = (e, t, n = /* @__PURE__ */ new Set()) => {
215
219
  let r = /* @__PURE__ */ new Map();
216
220
  for (let e of t) r.set(e, "user-route");
217
221
  let i = [];
@@ -223,7 +227,7 @@ var Se = [
223
227
  }
224
228
  }
225
229
  return i;
226
- }, V = "_voltro_plugin_migrations", Ae = () => p.gen(function* () {
230
+ }, V = "_voltro_plugin_migrations", je = () => p.gen(function* () {
227
231
  yield* (yield* m.SqlClient).unsafe(`
228
232
  CREATE TABLE IF NOT EXISTS ${V} (
229
233
  id TEXT PRIMARY KEY,
@@ -233,10 +237,10 @@ var Se = [
233
237
  applied_at TEXT NOT NULL
234
238
  );
235
239
  `).pipe(p.orDie);
236
- }), je = (e, t) => `${R(e)}__${t}`, Me = () => p.gen(function* () {
240
+ }), Me = (e, t) => `${R(e)}__${t}`, Ne = () => p.gen(function* () {
237
241
  let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(V)}`.pipe(p.orDie);
238
242
  return new Set(t.map((e) => e.id));
239
- }), Ne = (e) => p.gen(function* () {
243
+ }), Pe = (e) => p.gen(function* () {
240
244
  let t = yield* m.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
241
245
  yield* t`
242
246
  INSERT INTO ${t(V)} (id, plugin_name, migration_id, description, applied_at)
@@ -248,10 +252,10 @@ var Se = [
248
252
  migration: t
249
253
  })));
250
254
  if (t.length === 0) return [];
251
- yield* Ae();
252
- let n = yield* Me(), r = [];
255
+ yield* je();
256
+ let n = yield* Ne(), r = [];
253
257
  for (let { plugin: e, migration: i } of t) {
254
- let t = je(e.name, i.id), a = Date.now();
258
+ let t = Me(e.name, i.id), a = Date.now();
255
259
  if (n.has(t)) {
256
260
  r.push({
257
261
  pluginName: e.name,
@@ -263,7 +267,7 @@ var Se = [
263
267
  }
264
268
  let o = yield* m.SqlClient;
265
269
  try {
266
- yield* i.up(o).pipe(p.mapError((e) => e)), yield* Ne({
270
+ yield* i.up(o).pipe(p.mapError((e) => e)), yield* Pe({
267
271
  key: t,
268
272
  pluginName: e.name,
269
273
  migration: i
@@ -284,26 +288,26 @@ var Se = [
284
288
  }
285
289
  }
286
290
  return r;
287
- }), Pe = (e, t) => p.gen(function* () {
291
+ }), Fe = (e, t) => p.gen(function* () {
288
292
  let n = yield* H(e);
289
293
  if (n.length === 0) return n;
290
294
  let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
291
295
  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) => ({
296
+ }), Ie = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
293
297
  pluginName: e.name,
294
298
  pluginAlias: R(e.name),
295
299
  tables: e.extendSchema.tables?.length ?? 0,
296
300
  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) => {
301
+ })), Le = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), U = /(?<!\.server)\.agent\.tsx?$/, Re = /\.agent\.server\.tsx?$/, W = /\.tool\.tsx?$/, ze = async (t, n) => {
298
302
  let r = 0;
299
303
  for (let i of t) if (W.test(i)) try {
300
304
  let t = await e(i);
301
- r += g(t);
305
+ r += L(t);
302
306
  } catch (e) {
303
307
  n.warn("tool: failed to import — handler not wired", { file: i }, e);
304
308
  }
305
309
  return r;
306
- }, ze = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Be = async (t, n) => {
310
+ }, Be = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ve = async (t, n) => {
307
311
  let r = [], i = /* @__PURE__ */ new Set();
308
312
  for (let a of t) {
309
313
  if (!U.test(a)) continue;
@@ -314,7 +318,7 @@ var Se = [
314
318
  n.warn("agent: failed to import descriptor", { file: a }, e);
315
319
  continue;
316
320
  }
317
- let o = Object.values(t).find(he);
321
+ let o = Object.values(t).find(P);
318
322
  if (o === void 0) {
319
323
  n.warn("agent: no defineAgent() descriptor export found", { file: a });
320
324
  continue;
@@ -326,7 +330,7 @@ var Se = [
326
330
  });
327
331
  continue;
328
332
  }
329
- let s = ze(a), c;
333
+ let s = Be(a), c;
330
334
  try {
331
335
  c = await e(s);
332
336
  } catch (e) {
@@ -338,7 +342,7 @@ var Se = [
338
342
  continue;
339
343
  }
340
344
  let l = c.default;
341
- if (!ge(l)) {
345
+ if (!F(l)) {
342
346
  n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
343
347
  file: s,
344
348
  name: o.name
@@ -353,7 +357,7 @@ var Se = [
353
357
  });
354
358
  }
355
359
  return { agents: r };
356
- }, G = /\.connection\.tsx?$/, Ve = (e) => e.replace(G, ""), K = async (t, n) => {
360
+ }, G = /\.connection\.tsx?$/, K = (e) => e.replace(G, ""), He = async (t, n) => {
357
361
  let r = [], i = /* @__PURE__ */ new Map();
358
362
  for (let a of t) {
359
363
  let t;
@@ -396,7 +400,7 @@ var Se = [
396
400
  }
397
401
  return r.length > 0 && n.info("discovered connections", {
398
402
  connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
399
- files: r.map((e) => Ve(o(e.file)))
403
+ files: r.map((e) => K(o(e.file)))
400
404
  }), r;
401
405
  }, q = (e) => {
402
406
  let t = e.nodeEnv !== "production";
@@ -405,13 +409,13 @@ var Se = [
405
409
  undo: e.declared?.undo ?? t,
406
410
  cdc: e.cdcDialect !== void 0
407
411
  };
408
- }, He = (e) => {
412
+ }, Ue = (e) => {
409
413
  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
414
  return `The three tables whose presence is DECIDED rather than implied by your source tree —
411
415
  compare these against the other process's environment before anything else:
412
416
 
413
417
  ${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) => {
418
+ }, We = (e) => {
415
419
  let t = [{
416
420
  key: "traces",
417
421
  table: "_voltro_traces",
@@ -440,7 +444,7 @@ ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_
440
444
  agents: c,
441
445
  connections: u
442
446
  };
443
- }, We = async (e) => {
447
+ }, Ge = async (e) => {
444
448
  let t = s(e, "app.config.ts");
445
449
  if (!c(t)) return { plugins: [] };
446
450
  try {
@@ -455,8 +459,8 @@ ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_
455
459
  error: e
456
460
  };
457
461
  }
458
- }, Ge = async (e) => (await X(e)).plugins, X = async (e) => {
459
- let { plugins: t, schema: n, error: r } = await We(e);
462
+ }, Ke = async (e) => (await X(e)).plugins, X = async (e) => {
463
+ let { plugins: t, schema: n, error: r } = await Ge(e);
460
464
  if (r !== void 0) throw new Z(e, r);
461
465
  return {
462
466
  plugins: t,
@@ -478,7 +482,7 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
478
482
  let t = /* @__PURE__ */ new Map(), n = (e) => {
479
483
  e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
480
484
  };
481
- for (let t of Ce({
485
+ for (let t of we({
482
486
  workflows: e.mix.workflows,
483
487
  schedules: e.mix.schedules,
484
488
  webhooks: e.mix.webhooks,
@@ -488,10 +492,10 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
488
492
  undo: e.gates.undo,
489
493
  connections: e.mix.connections
490
494
  })) 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);
495
+ e.mix.agents && (n(A), n(k), n(N), n(j)), e.mix.workflows && n(M), (e.mix.workflows || e.mix.agents) && n(I);
496
+ for (let t of Le(e.plugins)) n(t);
493
497
  return [...t.values()];
494
- }, Ke = async (e) => {
498
+ }, qe = async (e) => {
495
499
  let t = await Y(e.root), { plugins: n, schema: r } = await X(e.root);
496
500
  return Q({
497
501
  mix: t,
@@ -508,4 +512,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
508
512
  return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
509
513
  };
510
514
  //#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 };
515
+ export { ke as C, Te as E, Ae as S, R as T, Ve as _, Y as a, H as b, X as c, We as d, G as f, W as g, Re as h, $ as i, Ue as l, U as m, qe as n, J as o, He as p, Q as r, Ke as s, Z as t, q as u, ze as v, z as w, Ie as x, Fe as y };
@@ -0,0 +1,2 @@
1
+ import { c as e, n as t } from "./frameworkTableAssembly-BPlPfU07.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-C-hxgAGr.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 };
@@ -1,13 +1,13 @@
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-oMPBKqlE.js";
4
+ import { n as i, s as a, y as o } from "./frameworkTableAssembly-BPlPfU07.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";
8
- import { Effect as f } from "effect";
9
- import { runMigrate as p } from "@voltro/database/sql";
10
- import { actorsTable as m, registerCoreTables as h } from "@voltro/database";
8
+ import { actorsTable as f, registerCoreTables as p } from "@voltro/database";
9
+ import { Effect as m } from "effect";
10
+ import { runMigrate as h } from "@voltro/database/sql";
11
11
  import { FileSystem as g } from "@effect/platform";
12
12
  //#region src/migrate.ts
13
13
  var _ = /* @__PURE__ */ new Set([
@@ -18,58 +18,58 @@ var _ = /* @__PURE__ */ new Set([
18
18
  ".vite",
19
19
  ".next",
20
20
  ".git"
21
- ]), v = /\.entity\.ts$|\.schema\.ts$|^schema\.ts$/, y = (e) => f.gen(function* () {
22
- let t = yield* g.FileSystem, n = [], r = (e) => f.gen(function* () {
23
- let i = yield* t.readDirectory(e).pipe(f.orElseSucceed(() => []));
21
+ ]), v = /\.entity\.ts$|\.schema\.ts$|^schema\.ts$/, y = (e) => m.gen(function* () {
22
+ let t = yield* g.FileSystem, n = [], r = (e) => m.gen(function* () {
23
+ let i = yield* t.readDirectory(e).pipe(m.orElseSucceed(() => []));
24
24
  for (let a of i) {
25
25
  if (_.has(a)) continue;
26
- let i = c(e, a), o = yield* t.stat(i).pipe(f.orElseSucceed(() => null));
26
+ let i = c(e, a), o = yield* t.stat(i).pipe(m.orElseSucceed(() => null));
27
27
  o && (o.type === "Directory" ? yield* r(i) : o.type === "File" && v.test(a) && n.push(i));
28
28
  }
29
29
  });
30
30
  return yield* r(e), n;
31
- }), b = (e) => typeof e == "object" && !!e && "tableName" in e && "fields" in e && "isReactive" in e && typeof e.tableName == "string", x = (e) => f.gen(function* () {
31
+ }), b = (e) => typeof e == "object" && !!e && "tableName" in e && "fields" in e && "isReactive" in e && typeof e.tableName == "string", x = (e) => m.gen(function* () {
32
32
  let t = [];
33
33
  for (let n of e) {
34
- let e = yield* f.promise(() => import(d(n).href));
34
+ let e = yield* m.promise(() => import(d(n).href));
35
35
  for (let n of Object.values(e)) b(n) && t.push(n);
36
36
  }
37
37
  return t;
38
- }), S = (e) => f.gen(function* () {
39
- yield* f.logInfo("starting migration", { root: e });
38
+ }), S = (e) => m.gen(function* () {
39
+ yield* m.logInfo("starting migration", { root: e });
40
40
  let t = yield* y(e);
41
- if (t.length === 0) return yield* f.logError("no schema files found", {
41
+ if (t.length === 0) return yield* m.logError("no schema files found", {
42
42
  hint: "looked for *.entity.ts / *.schema.ts / schema.ts under the project root",
43
43
  root: e
44
44
  }), 1;
45
- yield* f.logInfo(`discovered ${t.length} schema file(s)`, { files: t.map((t) => l(e, t)) });
46
- let n = yield* x(t), r = yield* f.promise(() => i({ root: e })), s = [...n, ...r];
47
- if (yield* f.logInfo(`tables to apply: ${s.length}`, {
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];
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)
50
- }), s.length === 0) return yield* f.logWarning("no table descriptors discovered, nothing to apply"), 0;
51
- s.some((e) => e.tableName === "actors") || (s = [m, ...s]);
50
+ }), s.length === 0) return yield* m.logWarning("no table descriptors discovered, nothing to apply"), 0;
51
+ s.some((e) => e.tableName === "actors") || (s = [f, ...s]);
52
52
  let c = new Map(s.map((e) => [e.tableName, e])), u = c.get("actors"), d = c.get("tenants");
53
- (u !== void 0 || d !== void 0) && h({
53
+ (u !== void 0 || d !== void 0) && p({
54
54
  ...u === void 0 ? {} : { actors: () => u },
55
55
  ...d === void 0 ? {} : { tenants: () => d }
56
56
  });
57
- let g = yield* f.promise(() => w()), _ = g.makeSqlLayer(C());
58
- yield* f.promise(() => p(s, _, g.id, { retryFilter: g.retryFilter }));
59
- let v = yield* f.promise(() => a(e)), b = [], S = yield* o(v, (e, t) => {
57
+ let g = yield* m.promise(() => w()), _ = g.makeSqlLayer(C());
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) => {
60
60
  b.push({
61
61
  message: e,
62
62
  fields: t ?? {}
63
63
  });
64
- }).pipe(f.provide(_), f.match({
64
+ }).pipe(m.provide(_), m.match({
65
65
  onFailure: (e) => e,
66
66
  onSuccess: () => void 0
67
67
  }));
68
- for (let e of b) yield* f.logInfo(e.message, e.fields);
69
- return S === void 0 ? (yield* f.logInfo(`applied ${s.length} table(s) to ${g.id}`, {
68
+ for (let e of b) yield* m.logInfo(e.message, e.fields);
69
+ return S === void 0 ? (yield* m.logInfo(`applied ${s.length} table(s) to ${g.id}`, {
70
70
  count: s.length,
71
71
  dialect: g.id
72
- }), 0) : (yield* f.logError("a plugin migration FAILED — the tables were created, the plugin steps were not", { error: S instanceof Error ? S.message : String(S) }), 1);
72
+ }), 0) : (yield* m.logError("a plugin migration FAILED — the tables were created, the plugin steps were not", { error: S instanceof Error ? S.message : String(S) }), 1);
73
73
  }), C = () => (r() && console.warn("voltro migrate: no DB_URL/DB_HOST set — defaulting to postgres://app@localhost:5432/app"), n("migration")), w = async () => {
74
74
  let n = (process.env.DB_DIALECT ?? "postgres").toLowerCase();
75
75
  if (n === "memory") throw new e("voltro migrate: cannot migrate against an in-memory store. Set DB_DIALECT to one of: postgres, sqlite, mysql, mariadb, mssql, turso.");
@@ -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-BvQeKQOb.js");
82
+ let { runDbCommand: t } = await import("./dbCommand-C2XK63Dd.js");
83
83
  return t(["apply", ...e]);
84
84
  };
85
85
  //#endregion
@@ -1,4 +1,4 @@
1
- import { n as e } from "./apiBuild-CDQBNRDx.js";
1
+ import { n as e } from "./apiBuild-BKdd0I1Z.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-lrzwOzV1.js"), { manifest: n } = await t(e);
425
+ let { offlineManifest: t } = await import("./checkCommand-CXAXTjZL.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), {