@voltro/cli 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/dist/apiBuild-DOnvi2zm.js +2 -0
- package/dist/{apiBuild-BKdd0I1Z.js → apiBuild-Dz8TJSxp.js} +1 -1
- package/dist/bin.js +1 -1
- package/dist/{build-co6yadYz.js → build-DLme2ppa.js} +7 -7
- package/dist/{checkCommand-CXAXTjZL.js → checkCommand-BUBqPBlI.js} +1 -1
- package/dist/{checkCommand-B-eiW-G_.js → checkCommand-Dals7g-I.js} +4 -4
- package/dist/{codegen-sbN1Y8PB.js → codegen-CrMXs4hb.js} +176 -162
- package/dist/codegen-DiMn2KkZ.js +2 -0
- package/dist/{codegenCommand-CB6_3sX0.js → codegenCommand-L6vacVRW.js} +4 -3
- package/dist/{commands-C-hxgAGr.js → commands-CAxFLqG4.js} +18 -18
- package/dist/{dashboardCommand-CEVO0GWF.js → dashboardCommand-CJC8Kg-s.js} +1 -1
- package/dist/{dataCommand-k0ezbQWa.js → dataCommand-hIaq2iKY.js} +266 -189
- package/dist/dbCommand-D1Q33ktl.js +2 -0
- package/dist/{dbCommand-BwkyNxn-.js → dbCommand-ZGNItjoJ.js} +4 -4
- package/dist/declaredSchemaGates-BlcwObhb.js +25 -0
- package/dist/{dev-DyoYst4j.js → dev-cGGsLNn6.js} +1 -1
- package/dist/{dev-8hTEnN6s.js → dev-lvnVq5RD.js} +32 -31
- package/dist/{doctorCommand-B6D7HH1-.js → doctorCommand-BK0qu7eD.js} +34 -16
- package/dist/doctorCommand-CWgUPye-.js +2 -0
- package/dist/doctorDecidedSchema-BlbWgCD_.js +23 -0
- package/dist/{doctorSourceRelations-CPjSwYuZ.js → doctorSourceRelations-Dd48LPvO.js} +15 -10
- package/dist/{dormancyCommand-CrPAwOgo.js → dormancyCommand-CyIk-zq4.js} +1 -1
- package/dist/{embeddingsCommand-DsSxsn_b.js → embeddingsCommand-D7TLklps.js} +1 -1
- package/dist/{envCommand-B_NPVGUf.js → envCommand-BHxKkGXq.js} +1 -1
- package/dist/{evolveCommand-DUuaCIyn.js → evolveCommand-CQh6dw21.js} +1 -1
- package/dist/{frameworkTableAssembly-BPlPfU07.js → frameworkTableAssembly-BNod_DKN.js} +124 -143
- package/dist/frameworkTableAssembly-Rft-DPUg.js +2 -0
- package/dist/index.js +1 -1
- package/dist/{migrate-CM1qwalu.js → migrate-CL5Ed01M.js} +4 -4
- package/dist/{runtimeTrace-BRNM06vK.js → runtimeTrace-C0SlIoQY.js} +1 -1
- package/dist/{sdkgen-CRCw_XcR.js → sdkgen-BXm7zx7F.js} +1 -1
- package/dist/{serveCommand-CHOr74WM.js → serveCommand-CV3YO9L3.js} +676 -569
- package/dist/serveCommand-ZP_Cb-yz.js +2 -0
- package/dist/serveEntry.js +1 -1
- package/dist/{test-CHb7UwvE.js → test-rXFq4S76.js} +1 -1
- package/dist/{webhooksCommand-BRrG_sGf.js → webhooksCommand-QlAk_tED.js} +1 -1
- package/package.json +17 -17
- package/templates/AGENTS.md +1 -1
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/cli.md +86 -3
- package/templates/agent-docs/database/migrations.md +19 -5
- package/templates/agent-docs/whats-new.md +39 -135
- 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-P2gewrfQ.js +0 -2
- package/dist/codegen-DcE2li1i.js +0 -2
- package/dist/dbCommand-C2XK63Dd.js +0 -2
- package/dist/doctorCommand-Btl2Jz1a.js +0 -2
- package/dist/frameworkTableAssembly-Bob3vj9R.js +0 -2
- package/dist/serveCommand-BNHMVXyp.js +0 -2
|
@@ -1,45 +1,46 @@
|
|
|
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, _voltroIdempotencyTable as ie, _voltroImportRunsTable as ae, _voltroKvTable as oe, _voltroMigrationPlansTable as se, _voltroMigrationsTable as ce, _voltroMssqlCdcOffsetsTable as le, _voltroReplaceInProgressTable as ue, _voltroSeedsTable as de } from "@voltro/database";
|
|
8
9
|
import { Effect as p } from "effect";
|
|
9
10
|
import { SqlClient as m } from "@effect/sql";
|
|
10
|
-
import { _voltroApprovalsTable as
|
|
11
|
-
import { _voltroBudgetHoldsTable as
|
|
12
|
-
import { agentMessagesTable as
|
|
13
|
-
import { _voltroWebhookDeliveriesTable as
|
|
14
|
-
import { _voltroStorageBlobsTable 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";
|
|
14
|
+
import { _voltroWebhookDeliveriesTable as ve, _voltroWebhookTargetsTable as ye } from "@voltro/plugin-webhooks/mixin";
|
|
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
|
-
var
|
|
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
|
{
|
|
34
|
-
table:
|
|
35
|
-
when: "
|
|
35
|
+
table: ae,
|
|
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
|
{
|
|
@@ -47,166 +48,170 @@ var Ce = [
|
|
|
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,
|
|
76
|
+
when: "workflows"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
table: h,
|
|
75
80
|
when: "schedules"
|
|
76
81
|
},
|
|
77
82
|
{
|
|
78
|
-
table:
|
|
83
|
+
table: he,
|
|
79
84
|
when: "schedules"
|
|
80
85
|
},
|
|
81
86
|
{
|
|
82
|
-
table:
|
|
87
|
+
table: ye,
|
|
83
88
|
when: "webhooks"
|
|
84
89
|
},
|
|
85
90
|
{
|
|
86
|
-
table:
|
|
91
|
+
table: ve,
|
|
87
92
|
when: "webhooks"
|
|
88
93
|
},
|
|
89
94
|
{
|
|
90
|
-
table:
|
|
95
|
+
table: g,
|
|
91
96
|
when: "traces"
|
|
92
97
|
},
|
|
93
98
|
{
|
|
94
|
-
table:
|
|
99
|
+
table: _,
|
|
95
100
|
when: "undo"
|
|
96
101
|
},
|
|
97
102
|
{
|
|
98
|
-
table:
|
|
103
|
+
table: fe,
|
|
99
104
|
when: "always"
|
|
100
105
|
},
|
|
101
106
|
{
|
|
102
|
-
table:
|
|
107
|
+
table: C,
|
|
103
108
|
when: "workflows"
|
|
104
109
|
},
|
|
105
110
|
{
|
|
106
|
-
table:
|
|
111
|
+
table: S,
|
|
107
112
|
when: "always"
|
|
108
113
|
},
|
|
109
114
|
{
|
|
110
|
-
table:
|
|
115
|
+
table: x,
|
|
111
116
|
when: "always"
|
|
112
117
|
},
|
|
113
118
|
{
|
|
114
|
-
table:
|
|
119
|
+
table: me,
|
|
115
120
|
when: "connections"
|
|
116
121
|
},
|
|
117
122
|
{
|
|
118
|
-
table:
|
|
123
|
+
table: pe,
|
|
119
124
|
when: "connections"
|
|
120
125
|
},
|
|
121
126
|
{
|
|
122
|
-
table:
|
|
127
|
+
table: v,
|
|
123
128
|
when: "always"
|
|
124
129
|
},
|
|
125
130
|
{
|
|
126
|
-
table:
|
|
131
|
+
table: Se,
|
|
127
132
|
when: "always"
|
|
128
133
|
},
|
|
129
134
|
{
|
|
130
|
-
table:
|
|
135
|
+
table: xe,
|
|
131
136
|
when: "always"
|
|
132
137
|
},
|
|
133
138
|
{
|
|
134
|
-
table:
|
|
139
|
+
table: be,
|
|
135
140
|
when: "always"
|
|
136
141
|
},
|
|
137
142
|
{
|
|
138
|
-
table:
|
|
143
|
+
table: Ce,
|
|
139
144
|
when: "always"
|
|
140
145
|
},
|
|
141
146
|
{
|
|
142
|
-
table:
|
|
147
|
+
table: ie,
|
|
143
148
|
when: "always"
|
|
144
149
|
},
|
|
145
150
|
{
|
|
146
|
-
table:
|
|
151
|
+
table: ne,
|
|
147
152
|
when: "always"
|
|
148
153
|
},
|
|
149
154
|
{
|
|
150
|
-
table:
|
|
155
|
+
table: oe,
|
|
151
156
|
when: "always"
|
|
152
157
|
}
|
|
153
|
-
],
|
|
154
|
-
let t =
|
|
155
|
-
return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ?
|
|
156
|
-
},
|
|
158
|
+
], Te = (e) => {
|
|
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);
|
|
160
|
+
return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? le : re), t;
|
|
161
|
+
}, z = (e) => {
|
|
157
162
|
let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
|
|
158
163
|
return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
|
|
159
|
-
},
|
|
164
|
+
}, Ee = (e) => {
|
|
160
165
|
let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
|
|
161
166
|
return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/#/g, "--").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
162
|
-
},
|
|
163
|
-
let n =
|
|
167
|
+
}, De = (e, t) => B(e, t.name), B = (e, t) => {
|
|
168
|
+
let n = z(e.name);
|
|
164
169
|
if (!t.includes(".")) return `${n}.${t}`;
|
|
165
170
|
if (e.baseName === void 0) return t;
|
|
166
|
-
let r = `${
|
|
171
|
+
let r = `${z(e.baseName)}.`;
|
|
167
172
|
return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
|
|
168
|
-
},
|
|
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) => {
|
|
169
174
|
switch (e) {
|
|
170
|
-
case "query": return
|
|
175
|
+
case "query": return te({
|
|
171
176
|
name: t,
|
|
172
177
|
input: n.input,
|
|
173
178
|
output: n.output,
|
|
174
179
|
...n.error === void 0 ? {} : { error: n.error },
|
|
175
|
-
...
|
|
180
|
+
...V(n),
|
|
176
181
|
...n.source === void 0 ? {} : { source: n.source }
|
|
177
182
|
});
|
|
178
|
-
case "mutation": return
|
|
183
|
+
case "mutation": return ee({
|
|
179
184
|
name: t,
|
|
180
185
|
input: n.input,
|
|
181
186
|
output: n.output,
|
|
182
187
|
...n.error === void 0 ? {} : { error: n.error },
|
|
183
|
-
...
|
|
188
|
+
...V(n)
|
|
184
189
|
});
|
|
185
|
-
case "action": return
|
|
190
|
+
case "action": return f({
|
|
186
191
|
name: t,
|
|
187
192
|
input: n.input,
|
|
188
193
|
output: n.output,
|
|
189
194
|
...n.error === void 0 ? {} : { error: n.error },
|
|
190
|
-
...
|
|
195
|
+
...V(n)
|
|
191
196
|
});
|
|
192
197
|
}
|
|
193
|
-
},
|
|
198
|
+
}, ke = (e) => (t, n) => p.suspend(() => {
|
|
194
199
|
let r = { request: {
|
|
195
200
|
subject: n.request.subject,
|
|
196
201
|
traceId: n.request.traceId
|
|
197
202
|
} };
|
|
198
203
|
return e.execute(t, r);
|
|
199
|
-
}),
|
|
204
|
+
}), Ae = (e) => {
|
|
200
205
|
let t = [];
|
|
201
206
|
for (let n of e) {
|
|
202
207
|
let e = n.routes ?? [];
|
|
203
208
|
for (let r of e) {
|
|
204
|
-
let e =
|
|
209
|
+
let e = De(n, r), i = Oe(r.kind, e, r);
|
|
205
210
|
t.push({
|
|
206
211
|
kind: r.kind,
|
|
207
212
|
file: `plugin:${n.name}`,
|
|
208
213
|
descriptor: i,
|
|
209
|
-
executor:
|
|
214
|
+
executor: ke(r),
|
|
210
215
|
plugin: {
|
|
211
216
|
name: n.name,
|
|
212
217
|
version: n.version
|
|
@@ -215,7 +220,7 @@ var Ce = [
|
|
|
215
220
|
}
|
|
216
221
|
}
|
|
217
222
|
return t;
|
|
218
|
-
},
|
|
223
|
+
}, je = (e, t, n = /* @__PURE__ */ new Set()) => {
|
|
219
224
|
let r = /* @__PURE__ */ new Map();
|
|
220
225
|
for (let e of t) r.set(e, "user-route");
|
|
221
226
|
let i = [];
|
|
@@ -227,9 +232,9 @@ var Ce = [
|
|
|
227
232
|
}
|
|
228
233
|
}
|
|
229
234
|
return i;
|
|
230
|
-
},
|
|
235
|
+
}, H = "_voltro_plugin_migrations", Me = () => p.gen(function* () {
|
|
231
236
|
yield* (yield* m.SqlClient).unsafe(`
|
|
232
|
-
CREATE TABLE IF NOT EXISTS ${
|
|
237
|
+
CREATE TABLE IF NOT EXISTS ${H} (
|
|
233
238
|
id TEXT PRIMARY KEY,
|
|
234
239
|
plugin_name TEXT NOT NULL,
|
|
235
240
|
migration_id TEXT NOT NULL,
|
|
@@ -237,25 +242,25 @@ var Ce = [
|
|
|
237
242
|
applied_at TEXT NOT NULL
|
|
238
243
|
);
|
|
239
244
|
`).pipe(p.orDie);
|
|
240
|
-
}),
|
|
241
|
-
let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(
|
|
245
|
+
}), Ne = (e, t) => `${z(e)}__${t}`, Pe = () => p.gen(function* () {
|
|
246
|
+
let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(H)}`.pipe(p.orDie);
|
|
242
247
|
return new Set(t.map((e) => e.id));
|
|
243
|
-
}),
|
|
248
|
+
}), Fe = (e) => p.gen(function* () {
|
|
244
249
|
let t = yield* m.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
|
|
245
250
|
yield* t`
|
|
246
|
-
INSERT INTO ${t(
|
|
251
|
+
INSERT INTO ${t(H)} (id, plugin_name, migration_id, description, applied_at)
|
|
247
252
|
VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
|
|
248
253
|
`.pipe(p.orDie);
|
|
249
|
-
}),
|
|
254
|
+
}), U = (e) => p.gen(function* () {
|
|
250
255
|
let t = e.flatMap((e) => (e.extendSchema?.migrations ?? []).map((t) => ({
|
|
251
256
|
plugin: e,
|
|
252
257
|
migration: t
|
|
253
258
|
})));
|
|
254
259
|
if (t.length === 0) return [];
|
|
255
|
-
yield*
|
|
256
|
-
let n = yield*
|
|
260
|
+
yield* Me();
|
|
261
|
+
let n = yield* Pe(), r = [];
|
|
257
262
|
for (let { plugin: e, migration: i } of t) {
|
|
258
|
-
let t =
|
|
263
|
+
let t = Ne(e.name, i.id), a = Date.now();
|
|
259
264
|
if (n.has(t)) {
|
|
260
265
|
r.push({
|
|
261
266
|
pluginName: e.name,
|
|
@@ -267,7 +272,7 @@ var Ce = [
|
|
|
267
272
|
}
|
|
268
273
|
let o = yield* m.SqlClient;
|
|
269
274
|
try {
|
|
270
|
-
yield* i.up(o).pipe(p.mapError((e) => e)), yield*
|
|
275
|
+
yield* i.up(o).pipe(p.mapError((e) => e)), yield* Fe({
|
|
271
276
|
key: t,
|
|
272
277
|
pluginName: e.name,
|
|
273
278
|
migration: i
|
|
@@ -288,29 +293,29 @@ var Ce = [
|
|
|
288
293
|
}
|
|
289
294
|
}
|
|
290
295
|
return r;
|
|
291
|
-
}),
|
|
292
|
-
let n = yield*
|
|
296
|
+
}), Ie = (e, t) => p.gen(function* () {
|
|
297
|
+
let n = yield* U(e);
|
|
293
298
|
if (n.length === 0) return n;
|
|
294
299
|
let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
|
|
295
300
|
return t(`plugin migrations: ${r.length} applied, ${i.length} already applied`, { applied: r.map((e) => `${e.pluginName}:${e.migrationId}`) }), n;
|
|
296
|
-
}),
|
|
301
|
+
}), Le = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
|
|
297
302
|
pluginName: e.name,
|
|
298
|
-
pluginAlias:
|
|
303
|
+
pluginAlias: z(e.name),
|
|
299
304
|
tables: e.extendSchema.tables?.length ?? 0,
|
|
300
305
|
migrations: e.extendSchema.migrations?.length ?? 0
|
|
301
|
-
})),
|
|
306
|
+
})), Re = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, ze = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, Be = async (t, n) => {
|
|
302
307
|
let r = 0;
|
|
303
|
-
for (let i of t) if (
|
|
308
|
+
for (let i of t) if (G.test(i)) try {
|
|
304
309
|
let t = await e(i);
|
|
305
|
-
r +=
|
|
310
|
+
r += _e(t);
|
|
306
311
|
} catch (e) {
|
|
307
312
|
n.warn("tool: failed to import — handler not wired", { file: i }, e);
|
|
308
313
|
}
|
|
309
314
|
return r;
|
|
310
|
-
},
|
|
315
|
+
}, Ve = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), K = async (t, n) => {
|
|
311
316
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
312
317
|
for (let a of t) {
|
|
313
|
-
if (!
|
|
318
|
+
if (!W.test(a)) continue;
|
|
314
319
|
let t;
|
|
315
320
|
try {
|
|
316
321
|
t = await e(a);
|
|
@@ -318,7 +323,7 @@ var Ce = [
|
|
|
318
323
|
n.warn("agent: failed to import descriptor", { file: a }, e);
|
|
319
324
|
continue;
|
|
320
325
|
}
|
|
321
|
-
let o = Object.values(t).find(
|
|
326
|
+
let o = Object.values(t).find(L);
|
|
322
327
|
if (o === void 0) {
|
|
323
328
|
n.warn("agent: no defineAgent() descriptor export found", { file: a });
|
|
324
329
|
continue;
|
|
@@ -330,7 +335,7 @@ var Ce = [
|
|
|
330
335
|
});
|
|
331
336
|
continue;
|
|
332
337
|
}
|
|
333
|
-
let s =
|
|
338
|
+
let s = Ve(a), c;
|
|
334
339
|
try {
|
|
335
340
|
c = await e(s);
|
|
336
341
|
} catch (e) {
|
|
@@ -342,7 +347,7 @@ var Ce = [
|
|
|
342
347
|
continue;
|
|
343
348
|
}
|
|
344
349
|
let l = c.default;
|
|
345
|
-
if (!
|
|
350
|
+
if (!R(l)) {
|
|
346
351
|
n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
|
|
347
352
|
file: s,
|
|
348
353
|
name: o.name
|
|
@@ -357,7 +362,7 @@ var Ce = [
|
|
|
357
362
|
});
|
|
358
363
|
}
|
|
359
364
|
return { agents: r };
|
|
360
|
-
},
|
|
365
|
+
}, q = /\.connection\.tsx?$/, He = (e) => e.replace(q, ""), Ue = async (t, n) => {
|
|
361
366
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
362
367
|
for (let a of t) {
|
|
363
368
|
let t;
|
|
@@ -400,55 +405,31 @@ var Ce = [
|
|
|
400
405
|
}
|
|
401
406
|
return r.length > 0 && n.info("discovered connections", {
|
|
402
407
|
connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
|
|
403
|
-
files: r.map((e) =>
|
|
408
|
+
files: r.map((e) => He(s(e.file)))
|
|
404
409
|
}), r;
|
|
405
|
-
},
|
|
406
|
-
let t = e
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
};
|
|
412
|
-
}, Ue = (e) => {
|
|
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}`;
|
|
414
|
-
return `The three tables whose presence is DECIDED rather than implied by your source tree —
|
|
415
|
-
compare these against the other process's environment before anything else:
|
|
416
|
-
|
|
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.`;
|
|
418
|
-
}, We = (e) => {
|
|
419
|
-
let t = [{
|
|
420
|
-
key: "traces",
|
|
421
|
-
table: "_voltro_traces",
|
|
422
|
-
envVar: "VOLTRO_TRACING_PERSIST"
|
|
423
|
-
}, {
|
|
424
|
-
key: "undo",
|
|
425
|
-
table: "_voltro_undo_log",
|
|
426
|
-
envVar: "VOLTRO_UNDO"
|
|
427
|
-
}].filter((t) => e.runtime[t.key] && !e.gates[t.key]);
|
|
428
|
-
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.`;
|
|
429
|
-
}, J = (e) => n.test(e) || a.test(e), Y = async (e) => {
|
|
430
|
-
let n = !1, a = !1, o = !1, c = !1, u = !1, d = async (e) => {
|
|
431
|
-
let f = await l.readdir(e, { withFileTypes: !0 }).catch(() => []);
|
|
432
|
-
for (let l of f) if (l.isDirectory()) {
|
|
433
|
-
if (l.name === "node_modules" || l.name === "dist" || l.name === ".framework" || l.name.startsWith(".")) continue;
|
|
434
|
-
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));
|
|
435
416
|
} else {
|
|
436
|
-
let e =
|
|
437
|
-
(
|
|
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);
|
|
438
419
|
}
|
|
439
420
|
};
|
|
440
421
|
return await d(e), {
|
|
441
|
-
workflows:
|
|
442
|
-
schedules:
|
|
422
|
+
workflows: t,
|
|
423
|
+
schedules: r,
|
|
443
424
|
webhooks: o,
|
|
444
|
-
agents:
|
|
445
|
-
connections:
|
|
425
|
+
agents: s,
|
|
426
|
+
connections: l
|
|
446
427
|
};
|
|
447
|
-
},
|
|
448
|
-
let t =
|
|
449
|
-
if (!
|
|
428
|
+
}, We = async (e) => {
|
|
429
|
+
let t = c(e, "app.config.ts");
|
|
430
|
+
if (!l(t)) return { plugins: [] };
|
|
450
431
|
try {
|
|
451
|
-
let e = await import(
|
|
432
|
+
let e = await import(d(t).href);
|
|
452
433
|
return {
|
|
453
434
|
plugins: e.default?.plugins ?? [],
|
|
454
435
|
...e.default?.schema ? { schema: e.default.schema } : {}
|
|
@@ -459,8 +440,8 @@ ${r(e.gates.traces, "_voltro_traces", n("traces"))}\n${r(e.gates.undo, "_voltro_
|
|
|
459
440
|
error: e
|
|
460
441
|
};
|
|
461
442
|
}
|
|
462
|
-
},
|
|
463
|
-
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);
|
|
464
445
|
if (r !== void 0) throw new Z(e, r);
|
|
465
446
|
return {
|
|
466
447
|
plugins: t,
|
|
@@ -482,7 +463,7 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
482
463
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
483
464
|
e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
|
|
484
465
|
};
|
|
485
|
-
for (let t of
|
|
466
|
+
for (let t of Te({
|
|
486
467
|
workflows: e.mix.workflows,
|
|
487
468
|
schedules: e.mix.schedules,
|
|
488
469
|
webhooks: e.mix.webhooks,
|
|
@@ -492,18 +473,18 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
492
473
|
undo: e.gates.undo,
|
|
493
474
|
connections: e.mix.connections
|
|
494
475
|
})) n(t);
|
|
495
|
-
e.mix.agents && (n(
|
|
496
|
-
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);
|
|
497
478
|
return [...t.values()];
|
|
498
|
-
},
|
|
499
|
-
let
|
|
479
|
+
}, Ke = async (e) => {
|
|
480
|
+
let n = await Y(e.root), { plugins: r, schema: i } = await X(e.root);
|
|
500
481
|
return Q({
|
|
501
|
-
mix:
|
|
502
|
-
plugins:
|
|
503
|
-
gates:
|
|
482
|
+
mix: n,
|
|
483
|
+
plugins: r,
|
|
484
|
+
gates: t({
|
|
504
485
|
nodeEnv: process.env.NODE_ENV,
|
|
505
486
|
cdcDialect: $(),
|
|
506
|
-
declared:
|
|
487
|
+
declared: i
|
|
507
488
|
}),
|
|
508
489
|
...$() ? { cdcDialect: $() } : {}
|
|
509
490
|
});
|
|
@@ -512,4 +493,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
512
493
|
return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
|
|
513
494
|
};
|
|
514
495
|
//#endregion
|
|
515
|
-
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,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-BNod_DKN.js";
|
|
5
5
|
import { t as s } from "./cliRuntime-Dh7UDinH.js";
|
|
6
6
|
import { join as c, relative as l, resolve as u } from "node:path";
|
|
7
7
|
import { pathToFileURL as d } from "node:url";
|
|
@@ -43,7 +43,7 @@ var _ = /* @__PURE__ */ new Set([
|
|
|
43
43
|
root: e
|
|
44
44
|
}), 1;
|
|
45
45
|
yield* m.logInfo(`discovered ${t.length} schema file(s)`, { files: t.map((t) => l(e, t)) });
|
|
46
|
-
let n = yield* x(t), r = yield* m.promise(() =>
|
|
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-D1Q33ktl.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-Dz8TJSxp.js";
|
|
2
2
|
import { join as t, resolve as n, sep as r } from "node:path";
|
|
3
3
|
import { existsSync as i, promises as a } from "node:fs";
|
|
4
4
|
import { createLogger as o } from "@voltro/logger";
|
|
@@ -422,7 +422,7 @@ let package = Package(
|
|
|
422
422
|
await l.mkdir(o(e), { recursive: !0 }), await l.writeFile(e, n.content, "utf8");
|
|
423
423
|
}
|
|
424
424
|
}, X = async (e) => {
|
|
425
|
-
let { offlineManifest: t } = await import("./checkCommand-
|
|
425
|
+
let { offlineManifest: t } = await import("./checkCommand-BUBqPBlI.js"), { manifest: n } = await t(e);
|
|
426
426
|
return n;
|
|
427
427
|
}, Z = async (e) => {
|
|
428
428
|
let t = J(await (e.manifestProvider ?? X)(e.root), {
|