@voltro/cli 0.44.1 → 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.
- package/CHANGELOG.md +280 -1
- package/dist/{apiBuild-DvWreIQP.js → apiBuild-BKdd0I1Z.js} +2 -2
- package/dist/apiBuild-P2gewrfQ.js +2 -0
- package/dist/bin.d.ts +24 -0
- package/dist/bin.js +46 -11
- package/dist/{build-Ckc-FA7d.js → build-co6yadYz.js} +8 -8
- package/dist/{checkCommand-BNfEs4KG.js → checkCommand-B-eiW-G_.js} +12 -12
- package/dist/{checkCommand-AlbawIal.js → checkCommand-CXAXTjZL.js} +1 -1
- package/dist/codegen-DcE2li1i.js +2 -0
- package/dist/{codegen-CbpGCWLG.js → codegen-sbN1Y8PB.js} +37 -37
- package/dist/codegenCommand-CB6_3sX0.js +144 -0
- package/dist/{codemodRunner-BKTnaGOz.js → codemodRunner-DSZjgyCL.js} +49 -0
- package/dist/{commands-CYkHTox2.js → commands-C-hxgAGr.js} +24 -24
- package/dist/{dashboardCommand-DHDmlo9A.js → dashboardCommand-CEVO0GWF.js} +3 -3
- package/dist/{dataCommand-WFn8CM11.js → dataCommand-k0ezbQWa.js} +355 -250
- package/dist/{dbCommand-B237qI-j.js → dbCommand-BwkyNxn-.js} +110 -110
- package/dist/dbCommand-C2XK63Dd.js +2 -0
- package/dist/{dev-D-JZ6CGQ.js → dev-8hTEnN6s.js} +2154 -2076
- package/dist/{dev-BZO5aLdr.js → dev-DyoYst4j.js} +1 -1
- package/dist/devActivity.d.ts +24 -0
- package/dist/{doctorCommand-BlUyESpD.js → doctorCommand-B6D7HH1-.js} +249 -228
- package/dist/doctorCommand-Btl2Jz1a.js +2 -0
- package/dist/doctorSourceRelations-CPjSwYuZ.js +83 -0
- package/dist/{dormancyCommand-lQxdrU8C.js → dormancyCommand-CrPAwOgo.js} +1 -1
- package/dist/{embeddingsCommand-ByBTju6X.js → embeddingsCommand-DsSxsn_b.js} +1 -1
- package/dist/{envCommand-CpCbYAgR.js → envCommand-B_NPVGUf.js} +2 -2
- package/dist/{evalCommand-6RUfPen4.js → evalCommand-Db01Kbng.js} +24 -24
- package/dist/{evolveCommand-CBV3-TtK.js → evolveCommand-DUuaCIyn.js} +2 -2
- package/dist/{frameworkTableAssembly-oMPBKqlE.js → frameworkTableAssembly-BPlPfU07.js} +82 -78
- package/dist/frameworkTableAssembly-Bob3vj9R.js +2 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +1 -1
- package/dist/{infoCommand-DJoA9cKD.js → infoCommand-CuNl9cbh.js} +1 -1
- package/dist/inspectState.d.ts +24 -0
- package/dist/interruptedReplace-C1ZI84xi.js +27 -0
- package/dist/interruptedReplace-DNJ7MKph.js +2 -0
- package/dist/{migrate-DN47p2PG.js → migrate-CM1qwalu.js} +27 -27
- package/dist/{runtimeTrace-DJ9tPhrc.js → runtimeTrace-BRNM06vK.js} +1 -1
- package/dist/{sdkgen-7dr8-Onw.js → sdkgen-CRCw_XcR.js} +1 -1
- package/dist/{seedRunner-IdHEprqf.js → seedRunner-Dgsiwk_e.js} +59 -59
- package/dist/serveCommand-BNHMVXyp.js +2 -0
- package/dist/serveCommand-CHOr74WM.js +1928 -0
- package/dist/serveEntry.d.ts +24 -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 +24 -0
- package/dist/startEntry.js +1 -1
- package/dist/startup.d.ts +24 -0
- package/dist/{test-CLYXrZ2F.js → test-CHb7UwvE.js} +1 -1
- package/dist/{updateCommand-BvRidHp6.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-BfO_JF2b.js → webhooksCommand-BRrG_sGf.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 +179 -3
- package/templates/agent-docs/data.md +103 -7
- package/templates/agent-docs/plugins/versioning.md +2 -0
- package/templates/agent-docs/whats-new.md +166 -6
- 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-XaW40W8x.js +0 -2
- package/dist/codegen-i8QGcHsi.js +0 -2
- package/dist/codegenCommand-iClXoRCW.js +0 -129
- package/dist/dbCommand-BvQeKQOb.js +0 -2
- package/dist/doctorCommand-BeLOwq7S.js +0 -2
- package/dist/frameworkTableAssembly-DgylYh9_.js +0 -2
- package/dist/serveCommand-BlnAlNQg.js +0 -1891
- package/dist/serveCommand-Dg_E1ev4.js +0 -2
- package/dist/updateCommand-DcKVmLVN.js +0 -2
- package/dist/webDev-BLKBO34K.js +0 -2
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { getRelations as e } from "@voltro/database";
|
|
2
|
+
//#region src/doctorSourceRelations.ts
|
|
3
|
+
var t = (e) => {
|
|
4
|
+
let t = /* @__PURE__ */ new Set();
|
|
5
|
+
for (let r = e.indexOf(".with("); r !== -1; r = e.indexOf(".with(", r + 1)) {
|
|
6
|
+
let i = n(e, r);
|
|
7
|
+
i !== void 0 && a(i, t);
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
}, n = (e, t) => {
|
|
11
|
+
let n = e.indexOf("{", t);
|
|
12
|
+
if (n === -1) return;
|
|
13
|
+
let r = 0;
|
|
14
|
+
for (let t = n; t < e.length; t++) {
|
|
15
|
+
let i = e[t];
|
|
16
|
+
if (i === "{") r++;
|
|
17
|
+
else if (i === "}" && --r === 0) return e.slice(n + 1, t);
|
|
18
|
+
}
|
|
19
|
+
}, r = (e) => {
|
|
20
|
+
let t = [], n = 0, r = 0;
|
|
21
|
+
for (let i = 0; i < e.length; i++) {
|
|
22
|
+
let a = e[i];
|
|
23
|
+
"{([".includes(a) ? n++ : "})]".includes(a) ? n-- : a === "," && n === 0 && (t.push(e.slice(r, i)), r = i + 1);
|
|
24
|
+
}
|
|
25
|
+
return t.push(e.slice(r)), t.filter((e) => e.trim() !== "");
|
|
26
|
+
}, i = /^(?:'([A-Za-z_$][\w$]*)'|"([A-Za-z_$][\w$]*)"|([A-Za-z_$][\w$]*))$/, a = (e, t) => {
|
|
27
|
+
for (let s of r(e)) {
|
|
28
|
+
let e = o(s), r = (e === -1 ? s : s.slice(0, e)).trim(), c = i.exec(r), l = c?.[1] ?? c?.[2] ?? c?.[3];
|
|
29
|
+
if (l === void 0 || (l !== "with" && t.add(l), e === -1)) continue;
|
|
30
|
+
let u = s.slice(e + 1), d = u.indexOf("with");
|
|
31
|
+
if (d === -1) continue;
|
|
32
|
+
let f = n(u, d);
|
|
33
|
+
f !== void 0 && a(f, t);
|
|
34
|
+
}
|
|
35
|
+
}, o = (e) => {
|
|
36
|
+
let t = 0;
|
|
37
|
+
for (let n = 0; n < e.length; n++) {
|
|
38
|
+
let r = e[n];
|
|
39
|
+
if ("{([".includes(r)) t++;
|
|
40
|
+
else if ("})]".includes(r)) t--;
|
|
41
|
+
else if (r === ":" && t === 0) return n;
|
|
42
|
+
}
|
|
43
|
+
return -1;
|
|
44
|
+
}, s = (n, r, i) => {
|
|
45
|
+
let a = t(i);
|
|
46
|
+
if (a.size === 0) return [];
|
|
47
|
+
let o = new Set(r), s = [], l = /* @__PURE__ */ new Set();
|
|
48
|
+
for (let t of r) {
|
|
49
|
+
let r = e(t);
|
|
50
|
+
if (r !== void 0) for (let e of a) {
|
|
51
|
+
let i = r[e];
|
|
52
|
+
if (i === void 0) continue;
|
|
53
|
+
let a = [{
|
|
54
|
+
table: c(i.target),
|
|
55
|
+
kind: "target"
|
|
56
|
+
}, {
|
|
57
|
+
table: c(i.through),
|
|
58
|
+
kind: "junction"
|
|
59
|
+
}];
|
|
60
|
+
for (let r of a) {
|
|
61
|
+
if (r.table === void 0 || o.has(r.table)) continue;
|
|
62
|
+
let i = `${e}:${r.table}`;
|
|
63
|
+
l.has(i) || (l.add(i), s.push({
|
|
64
|
+
procedure: n,
|
|
65
|
+
from: t,
|
|
66
|
+
relation: e,
|
|
67
|
+
missing: r.table,
|
|
68
|
+
kind: r.kind
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return s;
|
|
74
|
+
}, c = (e) => {
|
|
75
|
+
try {
|
|
76
|
+
let t = (typeof e == "function" ? e() : e)?.tableName;
|
|
77
|
+
return typeof t == "string" && t.length > 0 ? t : void 0;
|
|
78
|
+
} catch {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}, l = (e) => `${e.procedure}: eager-loads \`${e.relation}\` from '${e.from}' but does not declare '${e.missing}' in \`source:\`` + (e.kind === "junction" ? " (the junction table — a link added or removed does not move the target row)" : "") + ` — the view will not update when '${e.missing}' changes.`;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { l as describeMissingRelationSource, s as missingRelationSources };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as e } from "./dev-
|
|
2
|
-
import { _t as t, gt as n, mt as r, pt as i } from "./webDev-
|
|
1
|
+
import { c as e } from "./dev-8hTEnN6s.js";
|
|
2
|
+
import { _t as t, gt as n, mt as r, pt as i } from "./webDev-B4IEMB0n.js";
|
|
3
3
|
import { join as a } from "node:path";
|
|
4
4
|
import { promises as o } from "node:fs";
|
|
5
5
|
import { createLogger as s } from "@voltro/logger";
|
|
@@ -2,9 +2,9 @@ import { n as e } from "./appModuleLoader-C9r9mxZt.js";
|
|
|
2
2
|
import { n as t } from "./cliOutput-D1tSBoRM.js";
|
|
3
3
|
import { basename as n, join as r, resolve as i } from "node:path";
|
|
4
4
|
import { readdirSync as a, statSync as o } from "node:fs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { branchNamespaceName as s } from "@voltro/database";
|
|
6
|
+
import { Effect as c } from "effect";
|
|
7
|
+
import { generateText as l, isEvalDefinition as u, llmJudge as d, runEval as f } from "@voltro/ai";
|
|
8
8
|
//#region src/evalCommand.ts
|
|
9
9
|
var p = /* @__PURE__ */ new Set([
|
|
10
10
|
"node_modules",
|
|
@@ -43,11 +43,11 @@ var p = /* @__PURE__ */ new Set([
|
|
|
43
43
|
r(`eval: failed to import ${e}: ${t.message}`), a.push(e);
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
|
-
if (!
|
|
46
|
+
if (!u(o)) {
|
|
47
47
|
a.push(e);
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
|
-
let s = await
|
|
50
|
+
let s = await f(o, {
|
|
51
51
|
replay: t.replay,
|
|
52
52
|
...t.judge === void 0 ? {} : { judge: t.judge },
|
|
53
53
|
...t.branchId === void 0 ? {} : { branchId: t.branchId }
|
|
@@ -61,16 +61,16 @@ var p = /* @__PURE__ */ new Set([
|
|
|
61
61
|
};
|
|
62
62
|
}, _ = async ({ case: e }) => {
|
|
63
63
|
let t = Date.now();
|
|
64
|
-
return await
|
|
64
|
+
return await c.runPromise(l({
|
|
65
65
|
prompt: e.input.prompt,
|
|
66
66
|
...e.input.system === void 0 ? {} : { system: e.input.system }
|
|
67
|
-
}).pipe(
|
|
67
|
+
}).pipe(c.map((e) => ({
|
|
68
68
|
text: e.text,
|
|
69
69
|
latencyMs: Date.now() - t
|
|
70
|
-
})),
|
|
70
|
+
})), c.catchAll((n) => c.succeed({
|
|
71
71
|
text: "",
|
|
72
72
|
latencyMs: Date.now() - t
|
|
73
|
-
}).pipe(
|
|
73
|
+
}).pipe(c.tap(() => c.sync(() => console.error(` replay error (${e.id}): ${n.message}`)))))));
|
|
74
74
|
}, v = (e) => [`${e.ok ? "✓" : "✗"} ${e.name}: ${e.passed}/${e.cases.length} passed${e.branch ? ` (branch ${e.branch.id})` : ""}`, ...e.cases.filter((e) => !e.pass).map((e) => {
|
|
75
75
|
let t = e.assertionFailures.map((e) => ` - ${e.detail}`), n = e.judge !== void 0 && e.judge.score < .7 ? [` - judge: ${e.judge.score.toFixed(2)} — ${e.judge.reason}`] : [];
|
|
76
76
|
return [
|
|
@@ -91,28 +91,28 @@ var p = /* @__PURE__ */ new Set([
|
|
|
91
91
|
}, x = async (e) => {
|
|
92
92
|
let r = e.includes("--json"), a = e.includes("--branch"), o = y(e);
|
|
93
93
|
if (o !== void 0 && (o < 0 || o > 1)) return console.error("voltro eval: --threshold must be within 0..1"), 1;
|
|
94
|
-
let
|
|
95
|
-
if (
|
|
96
|
-
let
|
|
97
|
-
|
|
98
|
-
let
|
|
99
|
-
root:
|
|
100
|
-
files:
|
|
94
|
+
let c = i(e.find((e) => !e.startsWith("-") && Number.isNaN(Number(e))) ?? process.cwd()), l = h(c);
|
|
95
|
+
if (l.length === 0) return console.error(`voltro eval: no *.eval.ts found under ${c}`), console.error(" Author an eval with `export default defineEval({ name, cases, judge? })`."), 1;
|
|
96
|
+
let u = a ? s(n(c), b(e)) : void 0;
|
|
97
|
+
u !== void 0 && !r && console.log(`replays target data branch: ${u} (provision via voltro's BranchExecutor)`);
|
|
98
|
+
let f = await g({
|
|
99
|
+
root: c,
|
|
100
|
+
files: l,
|
|
101
101
|
replay: _,
|
|
102
|
-
judge:
|
|
103
|
-
...
|
|
102
|
+
judge: d,
|
|
103
|
+
...u === void 0 ? {} : { branchId: u },
|
|
104
104
|
log: (e) => console.error(e)
|
|
105
105
|
});
|
|
106
106
|
if (r) t({
|
|
107
|
-
ok:
|
|
108
|
-
reports:
|
|
109
|
-
skipped:
|
|
107
|
+
ok: f.ok,
|
|
108
|
+
reports: f.reports,
|
|
109
|
+
skipped: f.skipped
|
|
110
110
|
});
|
|
111
111
|
else {
|
|
112
|
-
for (let e of
|
|
113
|
-
|
|
112
|
+
for (let e of f.reports) console.log(v(e));
|
|
113
|
+
f.reports.length === 0 && console.log("voltro eval: no runnable eval suites (files found but none exported a defineEval)"), console.log(f.ok ? "\nvoltro eval: OK" : "\nvoltro eval: FAILED (regressions above)");
|
|
114
114
|
}
|
|
115
|
-
return +!
|
|
115
|
+
return +!f.ok;
|
|
116
116
|
};
|
|
117
117
|
//#endregion
|
|
118
118
|
export { x as runEvalCommand };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e } from "./cliOutput-D1tSBoRM.js";
|
|
2
|
-
import { t } from "./checkCommand-
|
|
3
|
-
import { i as n, n as r } from "./codemodRunner-
|
|
2
|
+
import { t } from "./checkCommand-B-eiW-G_.js";
|
|
3
|
+
import { i as n, n as r } from "./codemodRunner-DSZjgyCL.js";
|
|
4
4
|
import { basename as i, join as a, resolve as o } from "node:path";
|
|
5
5
|
import { branchNamespaceName as s, planBranchProvision as c } from "@voltro/database";
|
|
6
6
|
import { readFile as l } from "node:fs/promises";
|
|
@@ -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 {
|
|
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 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
|
|
16
|
+
var Ce = [
|
|
17
17
|
{
|
|
18
|
-
table:
|
|
18
|
+
table: oe,
|
|
19
19
|
when: "always"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
table:
|
|
22
|
+
table: le,
|
|
23
23
|
when: "always"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
table:
|
|
26
|
+
table: ae,
|
|
27
27
|
when: "always"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
table:
|
|
30
|
+
table: ce,
|
|
31
|
+
when: "always"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
table: E,
|
|
31
35
|
when: "workflows"
|
|
32
36
|
},
|
|
33
37
|
{
|
|
34
|
-
table:
|
|
38
|
+
table: T,
|
|
35
39
|
when: "workflows"
|
|
36
40
|
},
|
|
37
41
|
{
|
|
38
|
-
table:
|
|
42
|
+
table: w,
|
|
39
43
|
when: "workflows"
|
|
40
44
|
},
|
|
41
45
|
{
|
|
42
|
-
table:
|
|
46
|
+
table: D,
|
|
43
47
|
when: "workflows"
|
|
44
48
|
},
|
|
45
49
|
{
|
|
46
|
-
table:
|
|
50
|
+
table: C,
|
|
47
51
|
when: "workflows"
|
|
48
52
|
},
|
|
49
53
|
{
|
|
50
|
-
table:
|
|
54
|
+
table: x,
|
|
51
55
|
when: "workflows"
|
|
52
56
|
},
|
|
53
57
|
{
|
|
54
|
-
table:
|
|
58
|
+
table: S,
|
|
55
59
|
when: "workflows"
|
|
56
60
|
},
|
|
57
61
|
{
|
|
58
|
-
table:
|
|
62
|
+
table: O,
|
|
59
63
|
when: "workflows"
|
|
60
64
|
},
|
|
61
65
|
{
|
|
62
|
-
table:
|
|
66
|
+
table: _,
|
|
63
67
|
when: "workflows"
|
|
64
68
|
},
|
|
65
69
|
{
|
|
66
|
-
table:
|
|
70
|
+
table: g,
|
|
67
71
|
when: "workflows"
|
|
68
72
|
},
|
|
69
73
|
{
|
|
70
|
-
table:
|
|
74
|
+
table: me,
|
|
71
75
|
when: "schedules"
|
|
72
76
|
},
|
|
73
77
|
{
|
|
74
|
-
table:
|
|
78
|
+
table: pe,
|
|
75
79
|
when: "schedules"
|
|
76
80
|
},
|
|
77
81
|
{
|
|
78
|
-
table:
|
|
82
|
+
table: ve,
|
|
79
83
|
when: "webhooks"
|
|
80
84
|
},
|
|
81
85
|
{
|
|
82
|
-
table:
|
|
86
|
+
table: _e,
|
|
83
87
|
when: "webhooks"
|
|
84
88
|
},
|
|
85
89
|
{
|
|
86
|
-
table:
|
|
90
|
+
table: he,
|
|
87
91
|
when: "traces"
|
|
88
92
|
},
|
|
89
93
|
{
|
|
90
|
-
table:
|
|
94
|
+
table: ge,
|
|
91
95
|
when: "undo"
|
|
92
96
|
},
|
|
93
97
|
{
|
|
94
|
-
table:
|
|
98
|
+
table: ue,
|
|
95
99
|
when: "always"
|
|
96
100
|
},
|
|
97
101
|
{
|
|
98
|
-
table:
|
|
102
|
+
table: b,
|
|
99
103
|
when: "workflows"
|
|
100
104
|
},
|
|
101
105
|
{
|
|
102
|
-
table:
|
|
106
|
+
table: y,
|
|
103
107
|
when: "always"
|
|
104
108
|
},
|
|
105
109
|
{
|
|
106
|
-
table:
|
|
110
|
+
table: v,
|
|
107
111
|
when: "always"
|
|
108
112
|
},
|
|
109
113
|
{
|
|
110
|
-
table:
|
|
114
|
+
table: fe,
|
|
111
115
|
when: "connections"
|
|
112
116
|
},
|
|
113
117
|
{
|
|
114
|
-
table:
|
|
118
|
+
table: de,
|
|
115
119
|
when: "connections"
|
|
116
120
|
},
|
|
117
121
|
{
|
|
118
|
-
table:
|
|
122
|
+
table: h,
|
|
119
123
|
when: "always"
|
|
120
124
|
},
|
|
121
125
|
{
|
|
122
|
-
table:
|
|
126
|
+
table: xe,
|
|
123
127
|
when: "always"
|
|
124
128
|
},
|
|
125
129
|
{
|
|
126
|
-
table:
|
|
130
|
+
table: be,
|
|
127
131
|
when: "always"
|
|
128
132
|
},
|
|
129
133
|
{
|
|
130
|
-
table:
|
|
134
|
+
table: ye,
|
|
131
135
|
when: "always"
|
|
132
136
|
},
|
|
133
137
|
{
|
|
134
|
-
table:
|
|
138
|
+
table: Se,
|
|
135
139
|
when: "always"
|
|
136
140
|
},
|
|
137
141
|
{
|
|
138
|
-
table:
|
|
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:
|
|
150
|
+
table: ie,
|
|
147
151
|
when: "always"
|
|
148
152
|
}
|
|
149
|
-
],
|
|
150
|
-
let t =
|
|
151
|
-
return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ?
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 },
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
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 =
|
|
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:
|
|
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
|
-
},
|
|
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",
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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*
|
|
252
|
-
let n = yield*
|
|
255
|
+
yield* je();
|
|
256
|
+
let n = yield* Ne(), r = [];
|
|
253
257
|
for (let { plugin: e, migration: i } of t) {
|
|
254
|
-
let t =
|
|
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*
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
})),
|
|
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 +=
|
|
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
|
-
},
|
|
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(
|
|
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 =
|
|
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 (!
|
|
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?$/,
|
|
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) =>
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
459
|
-
let { plugins: t, schema: n, error: r } = await
|
|
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
|
|
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(
|
|
492
|
-
for (let t of
|
|
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
|
-
},
|
|
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 {
|
|
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 };
|