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