@voltro/cli 0.47.0 → 0.49.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.
- package/CHANGELOG.md +147 -0
- package/dist/{apiBuild-FpHCWiv6.js → apiBuild-QmYHaCF4.js} +1 -1
- package/dist/apiBuild-dZbHdqMg.js +2 -0
- package/dist/bin.js +1 -1
- package/dist/{build-zVygXxGB.js → build-Bi4O_g7T.js} +6 -6
- package/dist/{checkCommand-D0dAKciE.js → checkCommand-D8vjQXQt.js} +3 -3
- package/dist/{checkCommand-B2Fw73lu.js → checkCommand-udbQpphy.js} +1 -1
- package/dist/{codegenCommand-BTtsnRus.js → codegenCommand-DApSH7hK.js} +39 -46
- package/dist/{codemodRunner-DSZjgyCL.js → codemodRunner-De1_316I.js} +562 -492
- package/dist/{commands-BrFKxnYW.js → commands-a5PxCaIg.js} +68 -60
- package/dist/{dashboardCommand-D9SjDc8E.js → dashboardCommand-DaoUUqJS.js} +1 -1
- package/dist/dataCommand-CJv_OMoS.js +1156 -0
- package/dist/dataProfile-Du3ztYxv.js +51 -0
- package/dist/{dbCommand-jbrmzwW_.js → dbCommand-Bf7Cy0mn.js} +5 -5
- package/dist/dbCommand-Bnl7MSGC.js +2 -0
- package/dist/declaredSchemaGates-BlcwObhb.js +25 -0
- package/dist/{dev-RjB7eE_B.js → dev-C31Nvlbv.js} +31 -30
- package/dist/{dev-CaIfZnw5.js → dev-DFVuzOj7.js} +1 -1
- package/dist/{doctorCommand-D7X29cw6.js → doctorCommand-B3uraeAe.js} +32 -14
- package/dist/doctorCommand-CPL6EhrW.js +2 -0
- package/dist/doctorDecidedSchema-BlbWgCD_.js +23 -0
- package/dist/{dormancyCommand-BGOP27fz.js → dormancyCommand-QUXQ9yoz.js} +1 -1
- package/dist/{embeddingsCommand-D72E22bw.js → embeddingsCommand-Zw1-rYSF.js} +1 -1
- package/dist/{envCommand-BHSxz6wC.js → envCommand-DtaJ4xEf.js} +1 -1
- package/dist/{evolveCommand-C2ofGGlz.js → evolveCommand-JDD3hE1i.js} +2 -2
- package/dist/{frameworkTableAssembly-BvZ0Lil_.js → frameworkTableAssembly-BwJVEKLr.js} +96 -119
- package/dist/frameworkTableAssembly-CVDB2hCq.js +2 -0
- package/dist/index.js +1 -1
- package/dist/{infoCommand-CuNl9cbh.js → infoCommand-COsUC1DB.js} +1 -1
- package/dist/{migrate-odCPGHPq.js → migrate-D3MK9BpK.js} +4 -4
- package/dist/{runtimeTrace-C_OKr0jY.js → runtimeTrace-Di6fcndp.js} +1 -1
- package/dist/{sdkgen-D9trW7sl.js → sdkgen-CIi5gM17.js} +1 -1
- package/dist/serveCommand-CzSDngKm.js +2 -0
- package/dist/serveCommand-N3udT49p.js +2362 -0
- package/dist/serveEntry.js +5 -5
- package/dist/{subcommandNames-CKG5Dz3a.js → subcommandNames-DpYs3DXr.js} +12 -2
- package/dist/{updateCommand-BlyXavoG.js → updateCommand-2BfbeMvp.js} +1 -1
- package/dist/updateCommand-CtYm7aKH.js +2 -0
- package/dist/{webhooksCommand-BqcWcbuW.js → webhooksCommand-CwX9IzvJ.js} +1 -1
- package/package.json +29 -17
- package/templates/AGENTS.md +1 -1
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/cli.md +117 -4
- package/templates/agent-docs/database/migrations.md +19 -5
- package/templates/agent-docs/whats-new.md +51 -14
- package/templates/apps/api-ai/package.json +7 -7
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +10 -10
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-versioning/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +6 -6
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +8 -8
- package/templates/apps/frontend-app/package.json +9 -9
- package/templates/apps/frontend-auth/package.json +8 -8
- package/templates/apps/frontend-blank/package.json +7 -7
- package/templates/apps/frontend-cms/package.json +9 -9
- package/templates/apps/frontend-collab/package.json +10 -10
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +7 -7
- package/templates/apps/frontend-docs/package.json +7 -7
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-portal/package.json +8 -8
- package/templates/apps/frontend-saas/package.json +8 -8
- package/templates/apps/frontend-spa/package.json +7 -7
- package/templates/apps/frontend-ssr/package.json +7 -7
- package/templates/apps/frontend-ssr-api/package.json +8 -8
- package/templates/apps/frontend-static-blog/package.json +6 -6
- package/templates/apps/frontend-status/package.json +8 -8
- package/templates/apps/mobile-app/package.json +4 -4
- package/dist/apiBuild-BsooZpw2.js +0 -2
- package/dist/dataCommand-Dl11q14e.js +0 -975
- package/dist/dataProfile-Cm0YVKSy.js +0 -18
- package/dist/dbCommand-BUD4Fd8v.js +0 -2
- package/dist/doctorCommand-5zv6PN-G.js +0 -2
- package/dist/frameworkTableAssembly-DDKtwsy2.js +0 -2
- package/dist/serveCommand-BU0wfV6V.js +0 -1931
- package/dist/serveCommand-Bwrn_9Fn.js +0 -2
- package/dist/updateCommand-CT5AvVg7.js +0 -2
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { n as e } from "./appModuleLoader-C9r9mxZt.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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, _voltroDataTransfersTable as ie, _voltroIdempotencyTable 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
|
|
11
|
-
import { _voltroBudgetHoldsTable as
|
|
12
|
-
import { agentMessagesTable as
|
|
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:
|
|
19
|
+
table: ce,
|
|
19
20
|
when: "always"
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
|
-
table:
|
|
23
|
+
table: de,
|
|
23
24
|
when: "always"
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
|
-
table:
|
|
27
|
+
table: se,
|
|
27
28
|
when: "always"
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
|
-
table:
|
|
31
|
+
table: ue,
|
|
31
32
|
when: "always"
|
|
32
33
|
},
|
|
33
34
|
{
|
|
@@ -35,51 +36,51 @@ var we = [
|
|
|
35
36
|
when: "always"
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
|
-
table:
|
|
39
|
+
table: k,
|
|
39
40
|
when: "workflows"
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
|
-
table:
|
|
43
|
+
table: O,
|
|
43
44
|
when: "workflows"
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
|
-
table:
|
|
47
|
+
table: D,
|
|
47
48
|
when: "workflows"
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
|
-
table:
|
|
51
|
+
table: A,
|
|
51
52
|
when: "workflows"
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
|
-
table:
|
|
55
|
+
table: E,
|
|
55
56
|
when: "workflows"
|
|
56
57
|
},
|
|
57
58
|
{
|
|
58
|
-
table:
|
|
59
|
+
table: w,
|
|
59
60
|
when: "workflows"
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
|
-
table:
|
|
63
|
+
table: T,
|
|
63
64
|
when: "workflows"
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
|
-
table:
|
|
67
|
+
table: j,
|
|
67
68
|
when: "workflows"
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
|
-
table:
|
|
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:
|
|
79
|
+
table: h,
|
|
79
80
|
when: "schedules"
|
|
80
81
|
},
|
|
81
82
|
{
|
|
82
|
-
table:
|
|
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:
|
|
95
|
+
table: g,
|
|
95
96
|
when: "traces"
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
|
-
table:
|
|
99
|
+
table: _,
|
|
99
100
|
when: "undo"
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
|
-
table:
|
|
103
|
+
table: fe,
|
|
103
104
|
when: "always"
|
|
104
105
|
},
|
|
105
106
|
{
|
|
106
|
-
table:
|
|
107
|
+
table: C,
|
|
107
108
|
when: "workflows"
|
|
108
109
|
},
|
|
109
110
|
{
|
|
110
|
-
table:
|
|
111
|
+
table: S,
|
|
111
112
|
when: "always"
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
|
-
table:
|
|
115
|
+
table: x,
|
|
115
116
|
when: "always"
|
|
116
117
|
},
|
|
117
118
|
{
|
|
118
|
-
table:
|
|
119
|
+
table: me,
|
|
119
120
|
when: "connections"
|
|
120
121
|
},
|
|
121
122
|
{
|
|
122
|
-
table:
|
|
123
|
+
table: pe,
|
|
123
124
|
when: "connections"
|
|
124
125
|
},
|
|
125
126
|
{
|
|
126
|
-
table:
|
|
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:
|
|
147
|
+
table: ae,
|
|
147
148
|
when: "always"
|
|
148
149
|
},
|
|
149
150
|
{
|
|
150
|
-
table:
|
|
151
|
+
table: ne,
|
|
151
152
|
when: "always"
|
|
152
153
|
},
|
|
153
154
|
{
|
|
154
|
-
table:
|
|
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" ?
|
|
160
|
-
},
|
|
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
|
-
},
|
|
167
|
-
let n =
|
|
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 = `${
|
|
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 },
|
|
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
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
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 =
|
|
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:
|
|
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
|
-
},
|
|
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",
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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*
|
|
260
|
-
let n = yield*
|
|
260
|
+
yield* Me();
|
|
261
|
+
let n = yield* Pe(), r = [];
|
|
261
262
|
for (let { plugin: e, migration: i } of t) {
|
|
262
|
-
let t =
|
|
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*
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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:
|
|
303
|
+
pluginAlias: z(e.name),
|
|
303
304
|
tables: e.extendSchema.tables?.length ?? 0,
|
|
304
305
|
migrations: e.extendSchema.migrations?.length ?? 0
|
|
305
|
-
})),
|
|
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
|
-
},
|
|
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(
|
|
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 =
|
|
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 (!
|
|
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
|
-
},
|
|
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(
|
|
408
|
+
files: r.map((e) => He(s(e.file)))
|
|
408
409
|
}), r;
|
|
409
|
-
},
|
|
410
|
-
let t = e
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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 =
|
|
441
|
-
(
|
|
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:
|
|
446
|
-
schedules:
|
|
422
|
+
workflows: t,
|
|
423
|
+
schedules: r,
|
|
447
424
|
webhooks: o,
|
|
448
|
-
agents:
|
|
449
|
-
connections:
|
|
425
|
+
agents: s,
|
|
426
|
+
connections: l
|
|
450
427
|
};
|
|
451
|
-
},
|
|
452
|
-
let t =
|
|
453
|
-
if (!
|
|
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(
|
|
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
|
-
},
|
|
467
|
-
let { plugins: t, schema: n, error: r } = await
|
|
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(
|
|
500
|
-
for (let t of
|
|
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
|
-
},
|
|
503
|
-
let
|
|
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:
|
|
506
|
-
plugins:
|
|
507
|
-
gates:
|
|
482
|
+
mix: n,
|
|
483
|
+
plugins: r,
|
|
484
|
+
gates: t({
|
|
508
485
|
nodeEnv: process.env.NODE_ENV,
|
|
509
486
|
cdcDialect: $(),
|
|
510
|
-
declared:
|
|
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 {
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -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-
|
|
2
|
+
import { o as r } from "./updateCommand-2BfbeMvp.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
|
|
@@ -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 {
|
|
4
|
+
import { g as i, n as a, s as o } from "./frameworkTableAssembly-BwJVEKLr.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(() =>
|
|
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(() =>
|
|
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-
|
|
82
|
+
let { runDbCommand: t } = await import("./dbCommand-Bnl7MSGC.js");
|
|
83
83
|
return t(["apply", ...e]);
|
|
84
84
|
};
|
|
85
85
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "./apiBuild-
|
|
1
|
+
import { n as e } from "./apiBuild-QmYHaCF4.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-
|
|
425
|
+
let { offlineManifest: t } = await import("./checkCommand-udbQpphy.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), {
|