@voltro/cli 0.37.0 → 0.38.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 +92 -0
- package/dist/{apiBuild-DGsShRuF.js → apiBuild-CvacV4zA.js} +2 -2
- package/dist/apiBuild-ttSDDOGp.js +2 -0
- package/dist/bin.js +1 -1
- package/dist/bootRefusal-pgvDxlrU.js +7 -0
- package/dist/{build-CiFA-E19.js → build-_LoTC1s0.js} +30 -30
- package/dist/{checkCommand-CLPTzYqM.js → checkCommand-Pjk5sBl2.js} +2 -2
- package/dist/{checkCommand-CIPYyNyc.js → checkCommand-wibtQx-N.js} +1 -1
- package/dist/{codegenCommand-BxS3sCeJ.js → codegenCommand-C60m_LCp.js} +1 -1
- package/dist/{codemodRunner-cyqu5oxr.js → codemodRunner-CXgQ-ecJ.js} +314 -201
- package/dist/{commands-BwG9A9Vv.js → commands-DaZVi9wi.js} +20 -20
- package/dist/{dashboardCommand-C7U146xQ.js → dashboardCommand-Dxy_kmoW.js} +3 -3
- package/dist/{dataCommand-BOwd8_aJ.js → dataCommand-D6-Ha2lf.js} +1 -1
- package/dist/{dev-BV6XNYKf.js → dev-CAOoXOkc.js} +1 -1
- package/dist/{dev-bwDgSObH.js → dev-E7Eo5GHc.js} +261 -260
- package/dist/doctorCommand-Cjl8Yii8.js +2 -0
- package/dist/{doctorCommand-BXyrtN2l.js → doctorCommand-gmDyALFL.js} +10 -10
- package/dist/{dormancyCommand-BDdRRLsa.js → dormancyCommand-CE6wG8lj.js} +1 -1
- package/dist/{embeddingsCommand-CjWGcAE6.js → embeddingsCommand-C3uAuf6N.js} +1 -1
- package/dist/{envCommand-B_TeG297.js → envCommand-DzuWh8ya.js} +19 -19
- package/dist/{evolveCommand-D6N-WfA4.js → evolveCommand-DPLqcYb2.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{infoCommand-BHKTprrx.js → infoCommand-CmczGj_l.js} +1 -1
- package/dist/{runtimeTrace-WYV7qYvz.js → runtimeTrace-6jfznSzr.js} +1 -1
- package/dist/{sdkgen-TM5sSdf7.js → sdkgen-CEJZZQUA.js} +1 -1
- package/dist/serveCommand-DNRF2nDI.js +2 -0
- package/dist/{serveCommand-CyZsXL1l.js → serveCommand-DnY4VS3D.js} +541 -540
- package/dist/serveEntry.js +1 -1
- package/dist/{start-BgN62boB.js → start-CidwCcjl.js} +1 -1
- package/dist/{start-T4VesWiM.js → start-RCh6qKFe.js} +24 -24
- package/dist/startEntry.js +1 -1
- package/dist/startup.d.ts +40 -1
- package/dist/startup.js +2 -2
- package/dist/startupRunner-CEqQq7ax.js +108 -0
- package/dist/updateCommand-B0J_T9Vs.js +2 -0
- package/dist/{updateCommand-9GHHsmDf.js → updateCommand-CmksX7m_.js} +1 -1
- package/dist/{webDev-Dybxew86.js → webDev-BKdD7c_a.js} +689 -691
- package/dist/webDev-CcJfdSjl2.js +2 -0
- package/dist/{webhooksCommand-CHWSPk5z.js → webhooksCommand-BHeaF1ZJ.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/plugins/audit.md +4 -0
- package/templates/agent-docs/plugins/auth.md +4 -6
- package/templates/agent-docs/reference.md +3 -2
- package/templates/agent-docs/whats-new.md +49 -47
- 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-cms/tests/content.write.test.ts +16 -2
- package/templates/apps/api-collab/mutations/documents.setBody.mutation.server.ts +11 -5
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-collab/tests/documents.setBody.test.ts +8 -2
- 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/mutations/documents.update.mutation.server.ts +7 -5
- 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 +3 -3
- package/templates/patches/@effect__cluster@0.60.0.patch +51 -3
- package/dist/apiBuild-D0f6hYbH.js +0 -2
- package/dist/doctorCommand-C4L61G_L.js +0 -2
- package/dist/serveCommand-qumm7jdF.js +0 -2
- package/dist/startupRunner-DPGFchOa.js +0 -71
- package/dist/updateCommand-BN0tkl9-.js +0 -2
- package/dist/webDev-BcykISYQ2.js +0 -2
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { n as e } from "./loadEnv-D9nEOClM.js";
|
|
2
2
|
import { t } from "./frameworkInspectState-CX2250XB.js";
|
|
3
3
|
import { n } from "./appModuleLoader-C9r9mxZt.js";
|
|
4
|
-
import {
|
|
5
|
-
import { r as a } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
10
|
-
import { r as ue } from "./
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
import { t as r } from "./bootRefusal-pgvDxlrU.js";
|
|
5
|
+
import { n as i, r as a } from "./startupRunner-CEqQq7ax.js";
|
|
6
|
+
import { r as o } from "./appPort-B_HpJ_ck.js";
|
|
7
|
+
import { B as s, H as c, I as l, N as u, P as d, R as f, U as p, V as m, et as h, g, it as _, nt as v, ot as ee, rt as y, tt as te, z as b } from "./webDev-BKdD7c_a.js";
|
|
8
|
+
import { n as x, r as S } from "./dialectDriver-CgXnDfec.js";
|
|
9
|
+
import { a as C, i as ne, t as re } from "./connectionConfig-UFlIEiys.js";
|
|
10
|
+
import { a as ie, c as ae, i as oe, n as se, o as ce, r as le, t as ue } from "./seedRunner-ZmLSqNe2.js";
|
|
11
|
+
import { r as de } from "./devActivity-Dx_3nnGv.js";
|
|
12
|
+
import { C as fe, E as w, S as pe, T as me, _ as he, b as ge, d as _e, f as ve, g as ye, h as be, m as xe, o as Se, p as T, r as Ce, u as we, v as Te, w as Ee, x as De } from "./frameworkTableAssembly-oMPBKqlE.js";
|
|
13
|
+
import { A as Oe, D as ke, M as Ae, P as je, S as Me, _ as Ne, a as E, b as D, c as Pe, g as O, k as Fe, n as Ie, o as Le, p as Re, s as ze, t as Be, v as Ve, w as He, x as Ue, y as k } from "./fileConventions-Cof68_BL.js";
|
|
13
14
|
import { A as We, C as Ge, D as A, E as j, N as Ke, O as qe, S as Je, T as Ye, _ as Xe, a as Ze, b as Qe, c as $e, d as et, f as tt, g as nt, h as rt, i as it, l as at, m as ot, o as st, p as ct, r as lt, s as ut, t as dt, u as ft, v as pt, w as M, x as mt, y as ht } from "./inspect-CjTYzAs_.js";
|
|
14
15
|
import { t as gt } from "./manifestBuild-hpPLaGxV.js";
|
|
15
16
|
import { n as _t } from "./cliRuntime-Dh7UDinH.js";
|
|
@@ -681,13 +682,13 @@ var Xs = (e) => {
|
|
|
681
682
|
return e.ensureTenantProvisioned === void 0 ? i : Nc(i, r, e.ensureTenantProvisioned);
|
|
682
683
|
}, m = (n, r) => e.resolveResidentStore === void 0 || n !== t ? n : e.resolveResidentStore(r);
|
|
683
684
|
return (e, c = t, h, g = "app-context", _) => {
|
|
684
|
-
let v = p(m(c, e.subject), e.subject),
|
|
685
|
+
let v = p(m(c, e.subject), e.subject), ee = o === void 0 ? void 0 : Oo(o, {
|
|
685
686
|
subject: e.subject,
|
|
686
687
|
traceId: e.traceId,
|
|
687
688
|
source: g,
|
|
688
689
|
..._?.parentExecutionId === void 0 ? {} : { parentExecutionId: _.parentExecutionId },
|
|
689
690
|
..._?.parentClosePolicy === void 0 ? {} : { parentClosePolicy: _.parentClosePolicy }
|
|
690
|
-
}),
|
|
691
|
+
}), y = s.length === 0 || o === void 0 ? void 0 : uo({
|
|
691
692
|
triggers: s,
|
|
692
693
|
store: p(t, e.subject),
|
|
693
694
|
source: g,
|
|
@@ -696,7 +697,7 @@ var Xs = (e) => {
|
|
|
696
697
|
...l === void 0 ? {} : { emit: l },
|
|
697
698
|
..._?.parentExecutionId === void 0 ? {} : { parentExecutionId: _.parentExecutionId },
|
|
698
699
|
startWorkflow: (e, t, n) => Oo(o, n).start(e, t)
|
|
699
|
-
}),
|
|
700
|
+
}), te = f === void 0 ? void 0 : lo({
|
|
700
701
|
bus: f,
|
|
701
702
|
tenantId: e.subject.tenantId ?? null,
|
|
702
703
|
...h === void 0 ? {} : { deferToCommit: (e) => {
|
|
@@ -705,28 +706,28 @@ var Xs = (e) => {
|
|
|
705
706
|
});
|
|
706
707
|
} },
|
|
707
708
|
onPublished: (e, t, n) => {
|
|
708
|
-
|
|
709
|
+
y !== void 0 && y.emit(e, t).catch(() => {}), n.webhook !== void 0 && a !== void 0 && a.emit(n, t).catch(() => {});
|
|
709
710
|
}
|
|
710
|
-
}),
|
|
711
|
+
}), b = u === void 0 ? void 0 : _o({
|
|
711
712
|
store: v,
|
|
712
713
|
subject: e.subject,
|
|
713
714
|
traceId: e.traceId,
|
|
714
715
|
nudge: u.nudge,
|
|
715
716
|
...h === void 0 ? {} : { afterCommit: h.afterCommit }
|
|
716
|
-
}),
|
|
717
|
+
}), x = d === void 0 ? void 0 : io({
|
|
717
718
|
store: v,
|
|
718
719
|
registry: d.registry,
|
|
719
720
|
subject: e.subject
|
|
720
|
-
}),
|
|
721
|
-
H(
|
|
722
|
-
let
|
|
721
|
+
}), S = oo({ store: v });
|
|
722
|
+
H(S);
|
|
723
|
+
let C = e.rowFilter === void 0 ? {} : { rowFilter: e.rowFilter };
|
|
723
724
|
return {
|
|
724
725
|
storeForTenant: (t) => {
|
|
725
726
|
let r = jn(e.subject, t);
|
|
726
727
|
return fs(p(m(c, r), r), {
|
|
727
728
|
subject: r,
|
|
728
729
|
schemaRegistry: n,
|
|
729
|
-
...
|
|
730
|
+
...C
|
|
730
731
|
});
|
|
731
732
|
},
|
|
732
733
|
store: fs(v, {
|
|
@@ -734,8 +735,8 @@ var Xs = (e) => {
|
|
|
734
735
|
schemaRegistry: n,
|
|
735
736
|
...e.rowFilter === void 0 ? {} : { rowFilter: e.rowFilter }
|
|
736
737
|
}),
|
|
737
|
-
load:
|
|
738
|
-
loadMany:
|
|
738
|
+
load: S.load,
|
|
739
|
+
loadMany: S.loadMany,
|
|
739
740
|
request: e,
|
|
740
741
|
access: Za(e.subject),
|
|
741
742
|
cache: r,
|
|
@@ -743,12 +744,12 @@ var Xs = (e) => {
|
|
|
743
744
|
...a === void 0 ? {} : { webhooks: Ac(a, {
|
|
744
745
|
tenantId: e.subject.tenantId ?? null,
|
|
745
746
|
...h === void 0 ? {} : { afterCommit: h.afterCommit },
|
|
746
|
-
...
|
|
747
|
+
...b === void 0 ? {} : { enqueue: (e, t) => b.enqueue(e, t) }
|
|
747
748
|
}) },
|
|
748
|
-
...
|
|
749
|
-
...
|
|
750
|
-
...
|
|
751
|
-
...
|
|
749
|
+
...te === void 0 ? {} : { events: te },
|
|
750
|
+
...b === void 0 ? {} : { outbox: b },
|
|
751
|
+
...x === void 0 ? {} : { connections: x },
|
|
752
|
+
...ee === void 0 ? {} : { workflows: h ? vo(ee, h.afterCommit) : ee }
|
|
752
753
|
};
|
|
753
754
|
};
|
|
754
755
|
}, Ic = async (e, t, n) => {
|
|
@@ -914,7 +915,7 @@ var Xs = (e) => {
|
|
|
914
915
|
hint: "it still holds the port; the next boot will fail to bind. kill -9 it by hand"
|
|
915
916
|
});
|
|
916
917
|
})), I.asVoid)), nl = (e) => e.exitCode === 0 ? "stop" : e.keepAlive === "1" ? "wait-for-fix" : e.keepAlive === "0" ? "stop" : e.interactive ? "wait-for-fix" : "stop", rl = (e) => I.gen(function* () {
|
|
917
|
-
let t = yield* I.promise(() =>
|
|
918
|
+
let t = yield* I.promise(() => y(e.root));
|
|
918
919
|
X.info("supervisor active — watching project root", {
|
|
919
920
|
root: e.root,
|
|
920
921
|
patterns: ["**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,json} (excl. *.generated.*)"],
|
|
@@ -1165,25 +1166,25 @@ var Xs = (e) => {
|
|
|
1165
1166
|
} finally {
|
|
1166
1167
|
a = !1, o && !s ? (o = !1, h()) : g(t);
|
|
1167
1168
|
}
|
|
1168
|
-
},
|
|
1169
|
+
}, ee = e.onChange?.((e) => {
|
|
1169
1170
|
e.table === Yi && e.op !== "delete" && (s || h());
|
|
1170
1171
|
});
|
|
1171
1172
|
g(0), t.length > 0 && r.info("outbox: delivery worker started", {
|
|
1172
1173
|
effects: t.map((e) => e.definition.effect),
|
|
1173
1174
|
pollMs: u
|
|
1174
1175
|
});
|
|
1175
|
-
let
|
|
1176
|
+
let y = async () => {
|
|
1176
1177
|
if (s) {
|
|
1177
1178
|
await m.catch(() => {});
|
|
1178
1179
|
return;
|
|
1179
1180
|
}
|
|
1180
|
-
s = !0,
|
|
1181
|
+
s = !0, ee?.(), d !== void 0 && clearTimeout(d), d = void 0, await m.catch(() => {});
|
|
1181
1182
|
};
|
|
1182
|
-
return e.onShutdown(
|
|
1183
|
+
return e.onShutdown(y), {
|
|
1183
1184
|
nudge: () => {
|
|
1184
1185
|
s || h();
|
|
1185
1186
|
},
|
|
1186
|
-
stop:
|
|
1187
|
+
stop: y,
|
|
1187
1188
|
drainOnce: v,
|
|
1188
1189
|
isArmed: () => !s && !f
|
|
1189
1190
|
};
|
|
@@ -1469,7 +1470,7 @@ var Xs = (e) => {
|
|
|
1469
1470
|
};
|
|
1470
1471
|
}, Fl = (e, t) => {
|
|
1471
1472
|
let n = Pl(e, t);
|
|
1472
|
-
if (n.action === "fail") throw
|
|
1473
|
+
if (n.action === "fail") throw r(n.message ?? "");
|
|
1473
1474
|
}, Il = "x-voltro-agent-authorization", Ll = () => {
|
|
1474
1475
|
let e = globalThis.crypto?.randomUUID?.();
|
|
1475
1476
|
return e === void 0 ? `${Date.now().toString(16)}${Math.random().toString(16).slice(2)}`.padEnd(32, "0").slice(0, 32) : e.replace(/-/g, "");
|
|
@@ -1591,26 +1592,26 @@ var Xs = (e) => {
|
|
|
1591
1592
|
tool: _.tool,
|
|
1592
1593
|
reason: "no tool with that tag is exposed by this app; call GET /_voltro/inspect/agent/tools for the set"
|
|
1593
1594
|
});
|
|
1594
|
-
let
|
|
1595
|
-
if (!
|
|
1595
|
+
let ee = Rl(v.descriptor, p.policy);
|
|
1596
|
+
if (!ee.admitted) return u(403, {
|
|
1596
1597
|
error: "refused by this app's agent-tool policy",
|
|
1597
1598
|
tool: _.tool,
|
|
1598
|
-
reason:
|
|
1599
|
+
reason: ee.reason
|
|
1599
1600
|
});
|
|
1600
|
-
let
|
|
1601
|
-
if (
|
|
1601
|
+
let y = Hl(n);
|
|
1602
|
+
if (y === null) return u(401, {
|
|
1602
1603
|
error: "no app credential",
|
|
1603
1604
|
reason: `an agent tool call must carry the app credential it acts as, in the \`${Il}\` header (e.g. \`Bearer <api key>\`). The inspect token authorises the TRANSPORT; it is not an app identity, and running as the anonymous subject instead would execute under a principal nobody chose.`
|
|
1604
1605
|
});
|
|
1605
|
-
let
|
|
1606
|
+
let te = await p.resolveSubject(y), b = Ll();
|
|
1606
1607
|
try {
|
|
1607
1608
|
return u(200, {
|
|
1608
1609
|
ok: !0,
|
|
1609
1610
|
result: await v.run(_.input, {
|
|
1610
|
-
subject:
|
|
1611
|
-
traceId:
|
|
1611
|
+
subject: te,
|
|
1612
|
+
traceId: b
|
|
1612
1613
|
}),
|
|
1613
|
-
traceId:
|
|
1614
|
+
traceId: b
|
|
1614
1615
|
});
|
|
1615
1616
|
} catch (e) {
|
|
1616
1617
|
return u(200, {
|
|
@@ -1619,7 +1620,7 @@ var Xs = (e) => {
|
|
|
1619
1620
|
message: e.message,
|
|
1620
1621
|
name: e.name
|
|
1621
1622
|
} : String(e),
|
|
1622
|
-
traceId:
|
|
1623
|
+
traceId: b
|
|
1623
1624
|
});
|
|
1624
1625
|
}
|
|
1625
1626
|
}, Wl = (e) => {
|
|
@@ -3201,7 +3202,7 @@ var Xs = (e) => {
|
|
|
3201
3202
|
}), Pd = (e, t) => {
|
|
3202
3203
|
if (!t) return;
|
|
3203
3204
|
let n = ja();
|
|
3204
|
-
if (n === void 0) throw
|
|
3205
|
+
if (n === void 0) throw r(`workflow '${e}' declares encryptSteps: true, but no field-encryption cipher is configured.\n\nAdd it to your governance plugin:\n\n governancePlugin({ fieldEncryption: { secret: 'VOLTRO_FIELD_ENCRYPTION_KEY' } })\n\nThis refuses to boot rather than falling back to plaintext, deliberately: a fallback would leave the declaration reading as protection while every step input sat readable in _voltro_workflow_run_steps, and nobody would look again.`);
|
|
3205
3206
|
return (e) => {
|
|
3206
3207
|
if (e == null) return e;
|
|
3207
3208
|
let t = JSON.stringify(e);
|
|
@@ -3292,7 +3293,7 @@ var Xs = (e) => {
|
|
|
3292
3293
|
let t = r.child("seeds"), s = await e.loadSeedFiles(i, t);
|
|
3293
3294
|
if (a = s.length, o = s, s.length > 0) {
|
|
3294
3295
|
for (let t of s) e.onSeedDiscovered?.(t);
|
|
3295
|
-
if (
|
|
3296
|
+
if (ue(s, n, t), e.seedPolicy === "run" && e.runBootSeeds !== void 0) {
|
|
3296
3297
|
t.info("discovered seeds", { ids: s.map((e) => e.definition.id) });
|
|
3297
3298
|
let r = await e.runBootSeeds(s, n, t);
|
|
3298
3299
|
for (let t of r) e.onSeedResult?.(t);
|
|
@@ -3329,7 +3330,7 @@ var Xs = (e) => {
|
|
|
3329
3330
|
seeds: o
|
|
3330
3331
|
});
|
|
3331
3332
|
}, Hd = (e) => {
|
|
3332
|
-
let t =
|
|
3333
|
+
let t = ie(e.seeds, e.store, e.log);
|
|
3333
3334
|
return t.length === 0 ? e.schedules : (e.log.info(`${t.length} cron-lifecycle seed(s) scheduled on the coordinated cron scheduler`, { schedules: t.map((e) => e.name) }), [...e.schedules, ...t]);
|
|
3334
3335
|
}, Ud = (e) => `workflow:${e}`, Wd = {
|
|
3335
3336
|
skip: "skip",
|
|
@@ -3805,7 +3806,7 @@ var Xs = (e) => {
|
|
|
3805
3806
|
}, Ef = (e) => {
|
|
3806
3807
|
let t = /* @__PURE__ */ new Map(), n = [];
|
|
3807
3808
|
for (let r of e) {
|
|
3808
|
-
let e = r.inspectEndpoints ?? [], i =
|
|
3809
|
+
let e = r.inspectEndpoints ?? [], i = w(r.name);
|
|
3809
3810
|
for (let a of e) {
|
|
3810
3811
|
let e = `${Sf}${i}${Cf(a.path)}`, o = `${a.method} ${e}`, s = t.get(o);
|
|
3811
3812
|
if (s !== void 0) throw Error(`plugin inspect endpoint collision: "${a.method} ${e}" declared by plugin "${r.name}" but already claimed by ${s}`);
|
|
@@ -4190,7 +4191,7 @@ var Xs = (e) => {
|
|
|
4190
4191
|
for (let n of e) {
|
|
4191
4192
|
let e = n.dashboard ?? [];
|
|
4192
4193
|
if (e.length === 0) continue;
|
|
4193
|
-
let r =
|
|
4194
|
+
let r = me(n.name), i = /* @__PURE__ */ new Set();
|
|
4194
4195
|
for (let a of e) {
|
|
4195
4196
|
if (i.has(a.id)) throw Error(`plugin "${n.name}" declares duplicate dashboard mount id "${a.id}"`);
|
|
4196
4197
|
i.add(a.id), t.push({
|
|
@@ -4228,7 +4229,7 @@ var Xs = (e) => {
|
|
|
4228
4229
|
for (let i of r) {
|
|
4229
4230
|
if (Kf.has(i.name)) continue;
|
|
4230
4231
|
let r = P(e, i.name);
|
|
4231
|
-
i.isDirectory() ? await n(r) : i.isFile() && (Wf.test(i.name) && !Gf.test(i.name) ||
|
|
4232
|
+
i.isDirectory() ? await n(r) : i.isFile() && (Wf.test(i.name) && !Gf.test(i.name) || Oe.test(i.name)) && t.push(r);
|
|
4232
4233
|
}
|
|
4233
4234
|
};
|
|
4234
4235
|
return await n(e), t;
|
|
@@ -4244,7 +4245,7 @@ var Xs = (e) => {
|
|
|
4244
4245
|
tag: e.name
|
|
4245
4246
|
});
|
|
4246
4247
|
}
|
|
4247
|
-
if (r && typeof r == "object" &&
|
|
4248
|
+
if (r && typeof r == "object" && Oe.test(e) && "name" in r) {
|
|
4248
4249
|
let e = r;
|
|
4249
4250
|
typeof e.name == "string" && n.push({
|
|
4250
4251
|
kind: "workflow",
|
|
@@ -4263,7 +4264,7 @@ var Xs = (e) => {
|
|
|
4263
4264
|
if (r.length === 0) return [];
|
|
4264
4265
|
let i = await Jf(n);
|
|
4265
4266
|
return r.map((e) => {
|
|
4266
|
-
let n =
|
|
4267
|
+
let n = me(e.name), r = {
|
|
4267
4268
|
pluginName: e.name,
|
|
4268
4269
|
pluginAlias: n,
|
|
4269
4270
|
apiName: t,
|
|
@@ -4279,7 +4280,7 @@ var Xs = (e) => {
|
|
|
4279
4280
|
pluginContributions: await Yf(e, t, n),
|
|
4280
4281
|
pluginErrorImports: e.flatMap((e) => (e.errorSchemas ?? []).map((e) => e.import)),
|
|
4281
4282
|
pluginRpcImports: e.flatMap((e) => (e.rpcClientDescriptors ?? []).map((t) => ({
|
|
4282
|
-
tag:
|
|
4283
|
+
tag: Ee(e, t.tag),
|
|
4283
4284
|
kind: t.kind,
|
|
4284
4285
|
module: t.import.module,
|
|
4285
4286
|
name: t.import.name
|
|
@@ -6359,7 +6360,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6359
6360
|
for (let i of r) {
|
|
6360
6361
|
if (bh.has(i.name)) continue;
|
|
6361
6362
|
let r = P(e, i.name);
|
|
6362
|
-
i.isDirectory() ? await n(r) : i.isFile() && (
|
|
6363
|
+
i.isDirectory() ? await n(r) : i.isFile() && (O.test(i.name) && !Ne.test(i.name) || Ne.test(i.name) || Oe.test(i.name) || Ae.test(i.name) || ke.test(i.name) || D.test(i.name) || k.test(i.name) || Ue.test(i.name) || Me.test(i.name) || E.test(i.name) || Fe.test(i.name) || zd.test(i.name) || xe.test(i.name) || be.test(i.name) || He.test(i.name) || Re.test(i.name) || Ve.test(i.name) || Be.test(i.name) || ze.test(i.name) || Ie.test(i.name) || Pe.test(i.name) || Le.test(i.name)) && t.push(r);
|
|
6363
6364
|
}
|
|
6364
6365
|
};
|
|
6365
6366
|
return await n(e), t;
|
|
@@ -6428,13 +6429,13 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6428
6429
|
let r = [], i = [], a = [], o = [], s = [], c = [], l = [], u = [], d = [], f = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Map(), h = [], g = [], _ = /* @__PURE__ */ new Map();
|
|
6429
6430
|
for (let t of e) {
|
|
6430
6431
|
let e = N(t);
|
|
6431
|
-
if (
|
|
6432
|
-
let e = await n(t);
|
|
6433
|
-
for (let
|
|
6434
|
-
Ti(
|
|
6432
|
+
if (D.test(e)) {
|
|
6433
|
+
let e = new Set(ri().map((e) => e.tableName)), r = await n(t), i = [...Object.values(r).filter((e) => Oh(e)), ...ri().filter((t) => !e.has(t.tableName))];
|
|
6434
|
+
for (let e of i) m.set(e.tableName, e), jh(e) && f.add(e.tableName), Nh(e) && p.add(e.tableName);
|
|
6435
|
+
Ti(r);
|
|
6435
6436
|
continue;
|
|
6436
6437
|
}
|
|
6437
|
-
if (
|
|
6438
|
+
if (k.test(e)) {
|
|
6438
6439
|
let e = await n(t);
|
|
6439
6440
|
if (Ti(e) === 0) {
|
|
6440
6441
|
let n = Object.entries(e).filter(([, e]) => hi(e)).map(([e]) => e);
|
|
@@ -6445,14 +6446,14 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6445
6446
|
}
|
|
6446
6447
|
continue;
|
|
6447
6448
|
}
|
|
6448
|
-
if (
|
|
6449
|
+
if (je(e)) {
|
|
6449
6450
|
Z.warn("skipping workflow — a workflow module must be `.workflow.tsx` (JSX steps); rename it", {
|
|
6450
6451
|
file: t,
|
|
6451
6452
|
expected: e.replace(/\.workflow\.ts$/, ".workflow.tsx")
|
|
6452
6453
|
});
|
|
6453
6454
|
continue;
|
|
6454
6455
|
}
|
|
6455
|
-
if (
|
|
6456
|
+
if (Oe.test(e)) {
|
|
6456
6457
|
let e = await n(t), r = Object.values(e).find(Dh);
|
|
6457
6458
|
if (!r) {
|
|
6458
6459
|
Z.warn("skipping workflow — no workflow(...) export", { file: t });
|
|
@@ -6481,7 +6482,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6481
6482
|
for (let t of [...Object.values(e), ...Object.values(a)]) Ar(t) && l.push(t);
|
|
6482
6483
|
continue;
|
|
6483
6484
|
}
|
|
6484
|
-
if (
|
|
6485
|
+
if (ke.test(e)) {
|
|
6485
6486
|
let r = await n(t), i = r.default ?? Object.values(r).find(Ha);
|
|
6486
6487
|
if (!Ha(i)) {
|
|
6487
6488
|
Z.warn("skipping trigger — default export is not triggerWorkflow(...)", { file: t });
|
|
@@ -6498,7 +6499,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6498
6499
|
});
|
|
6499
6500
|
continue;
|
|
6500
6501
|
}
|
|
6501
|
-
if (
|
|
6502
|
+
if (E.test(e)) {
|
|
6502
6503
|
let e = (await n(t)).default;
|
|
6503
6504
|
if (!Va(e)) {
|
|
6504
6505
|
Z.warn("skipping cron — default export is not defineSchedule(...)", { file: t });
|
|
@@ -6514,16 +6515,16 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6514
6515
|
d.push(e);
|
|
6515
6516
|
continue;
|
|
6516
6517
|
}
|
|
6517
|
-
if (
|
|
6518
|
+
if (Ne.test(e)) {
|
|
6518
6519
|
let n = t.slice(0, -e.length), r = e.replace(/\.server\.ts$/, ".ts");
|
|
6519
6520
|
_.set(n + r, t);
|
|
6520
6521
|
continue;
|
|
6521
6522
|
}
|
|
6522
|
-
if (
|
|
6523
|
+
if (O.test(e)) {
|
|
6523
6524
|
h.push(t);
|
|
6524
6525
|
continue;
|
|
6525
6526
|
}
|
|
6526
|
-
if (
|
|
6527
|
+
if (Le.test(e)) {
|
|
6527
6528
|
g.push(t);
|
|
6528
6529
|
continue;
|
|
6529
6530
|
}
|
|
@@ -6578,28 +6579,28 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6578
6579
|
let n = Oi(t);
|
|
6579
6580
|
n.length > 0 && v.set(e, n);
|
|
6580
6581
|
}
|
|
6581
|
-
let
|
|
6582
|
+
let ee = v.size === 0 ? [] : r.flatMap((e) => Jo({
|
|
6582
6583
|
name: e.descriptor.name,
|
|
6583
6584
|
output: e.descriptor.output,
|
|
6584
6585
|
source: e.descriptor.source
|
|
6585
|
-
}, v)),
|
|
6586
|
+
}, v)), y = f.size === 0 ? [] : r.flatMap((e) => ma({
|
|
6586
6587
|
name: e.descriptor.name,
|
|
6587
6588
|
output: e.descriptor.output,
|
|
6588
6589
|
source: e.descriptor.source,
|
|
6589
6590
|
...e.descriptor.cache === void 0 ? {} : { cache: e.descriptor.cache }
|
|
6590
6591
|
}, f));
|
|
6591
6592
|
m.has("actors") || m.set("actors", ni);
|
|
6592
|
-
let
|
|
6593
|
-
(
|
|
6594
|
-
...
|
|
6595
|
-
...
|
|
6593
|
+
let te = m.get("actors"), b = m.get("tenants");
|
|
6594
|
+
(te !== void 0 || b !== void 0) && wi({
|
|
6595
|
+
...te === void 0 ? {} : { actors: () => te },
|
|
6596
|
+
...b === void 0 ? {} : { tenants: () => b }
|
|
6596
6597
|
});
|
|
6597
|
-
let
|
|
6598
|
+
let x = e.filter((e) => ve.test(N(e))), S = x.length > 0 ? await T(x, Z.child("connections")) : [], C = {
|
|
6598
6599
|
workflows: c.length > 0 || u.length > 0,
|
|
6599
|
-
schedules: d.length > 0 || e.some((e) =>
|
|
6600
|
-
webhooks: e.some((e) =>
|
|
6601
|
-
agents: e.some((e) =>
|
|
6602
|
-
connections:
|
|
6600
|
+
schedules: d.length > 0 || e.some((e) => Se(N(e))),
|
|
6601
|
+
webhooks: e.some((e) => Fe.test(N(e))),
|
|
6602
|
+
agents: e.some((e) => xe.test(N(e))),
|
|
6603
|
+
connections: x.length > 0
|
|
6603
6604
|
};
|
|
6604
6605
|
return ji(), {
|
|
6605
6606
|
queries: r,
|
|
@@ -6611,13 +6612,13 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6611
6612
|
workflowWorkers: l,
|
|
6612
6613
|
eventTriggers: u,
|
|
6613
6614
|
schedules: d,
|
|
6614
|
-
connections:
|
|
6615
|
+
connections: S,
|
|
6615
6616
|
tables: [...m.values()],
|
|
6616
|
-
featureMix:
|
|
6617
|
+
featureMix: C,
|
|
6617
6618
|
tenantScopedTables: f,
|
|
6618
6619
|
softDeleteScopedTables: p,
|
|
6619
|
-
serverOnlyLeaks:
|
|
6620
|
-
cacheScopeLeaks:
|
|
6620
|
+
serverOnlyLeaks: ee,
|
|
6621
|
+
cacheScopeLeaks: y
|
|
6621
6622
|
};
|
|
6622
6623
|
}, Lh = async (e) => {
|
|
6623
6624
|
let t = P(e, "app.config.ts"), r = Vt(t);
|
|
@@ -6637,8 +6638,8 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6637
6638
|
...r ? { error: e } : {}
|
|
6638
6639
|
};
|
|
6639
6640
|
}
|
|
6640
|
-
}, Rh = async (e) => (await Lh(e)).config, Q = () =>
|
|
6641
|
-
let t =
|
|
6641
|
+
}, Rh = async (e) => (await Lh(e)).config, Q = () => C("runtime"), zh = (e) => {
|
|
6642
|
+
let t = re();
|
|
6642
6643
|
if ("url" in e && e.url) try {
|
|
6643
6644
|
let n = new URL(e.url), r = n.username ? `${n.username}@` : "", i = n.port ? `:${n.port}` : "";
|
|
6644
6645
|
return {
|
|
@@ -6666,13 +6667,13 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6666
6667
|
}, $ = (e) => (process.env.DB_DIALECT ?? e?.store ?? "memory").toLowerCase(), Hh = async (e, n, r) => {
|
|
6667
6668
|
let i = $(e);
|
|
6668
6669
|
if (i === "memory") return Z.info("sql dialect resolved: memory — in-process store, no persistence"), new Ki({});
|
|
6669
|
-
let a = (process.env.CDC ?? "1") !== "0", o = await
|
|
6670
|
+
let a = (process.env.CDC ?? "1") !== "0", o = await S(i), s = o.id === "postgres" ? "LISTEN/NOTIFY" : yi(o.id) ? "in-process bus" : o.id === "mariadb" ? "binlog CDC (ROW)" : o.id === "mssql" ? "Change Tracking (polled)" : o.id === "mysql" ? "binlog CDC (ROW)" : "inline only", c = o.id === "postgres" ? "native" : o.id === "mysql" ? "INSERT/UPDATE/DELETE then SELECT (no RETURNING)" : o.id === "mariadb" ? "native (INSERT/DELETE); UPDATE then SELECT" : o.id === "mssql" ? "OUTPUT INSERTED/DELETED" : yi(o.id) ? "native" : "unknown";
|
|
6670
6671
|
Z.info(`sql dialect resolved: ${o.id} — CDC: ${a ? s : "inline emit (CDC=0)"}, RETURNING: ${c}`);
|
|
6671
6672
|
let l = r ?? Q(), { summary: u, fromEnv: d } = zh(l);
|
|
6672
6673
|
Z.info(`db connection: ${u}${d ? "" : " (DEFAULT FALLBACK — no DB_URL / PG_HOST set)"}`), d || Z.warn("db connection: falling back to localhost:5432/app — no DB_URL or PG_HOST env var set.\n If this app should run against its OWN postgres (e.g. its docker-compose), set DB_URL.\n Copy `.env.example` to `.env` in the app dir, or set DB_URL in the shell.\n Otherwise this app is silently using whatever DB is at localhost:5432/app — which is\n voltro-starter's docker default + may carry foreign tables that confuse the planner.");
|
|
6673
6674
|
let f;
|
|
6674
6675
|
if (a && (o.id === "mysql" || o.id === "mariadb")) {
|
|
6675
|
-
let { connectionFromConfig: e } = await
|
|
6676
|
+
let { connectionFromConfig: e } = await x("@voltro/sql-mysql"), t = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, n = ri().filter((e) => e.isReactive !== !1).map((e) => e.tableName).filter((e) => !e.startsWith("_voltro_"));
|
|
6676
6677
|
f = {
|
|
6677
6678
|
serverId: Vh(t),
|
|
6678
6679
|
replicaId: t,
|
|
@@ -6684,7 +6685,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6684
6685
|
tables: n.length
|
|
6685
6686
|
});
|
|
6686
6687
|
} else if (a && o.id === "mssql") {
|
|
6687
|
-
let { connectionFromConfig: e } = await
|
|
6688
|
+
let { connectionFromConfig: e } = await x("@voltro/sql-mssql"), t = e(l), n = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, r = ri().filter((e) => e.isReactive !== !1).map((e) => e.tableName).filter((e) => !e.startsWith("_voltro_"));
|
|
6688
6689
|
f = {
|
|
6689
6690
|
serverId: 0,
|
|
6690
6691
|
replicaId: n,
|
|
@@ -6732,45 +6733,45 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6732
6733
|
let g = [];
|
|
6733
6734
|
for (let e of m) {
|
|
6734
6735
|
let t = await o.makeStore({
|
|
6735
|
-
sqlLayer: o.makeSqlLayer(
|
|
6736
|
+
sqlLayer: o.makeSqlLayer(ne(l, e)),
|
|
6736
6737
|
...n ? { tracerLayer: n } : {},
|
|
6737
6738
|
changeStrategy: "inline"
|
|
6738
6739
|
});
|
|
6739
6740
|
g.push(t);
|
|
6740
6741
|
}
|
|
6741
|
-
let _ = process.env.RYW_POLICY ?? "fallback", v = (process.env.RYW_STORE ?? "memory").toLowerCase(),
|
|
6742
|
+
let _ = process.env.RYW_POLICY ?? "fallback", v = (process.env.RYW_STORE ?? "memory").toLowerCase(), ee, y = "memory";
|
|
6742
6743
|
if (v === "redis") {
|
|
6743
6744
|
let e = process.env.REDIS_URL;
|
|
6744
6745
|
if (!e) Z.warn("RYW_STORE=redis set but REDIS_URL is empty — falling back to memory store");
|
|
6745
6746
|
else try {
|
|
6746
6747
|
let { default: t } = await import("ioredis"), n = new t(e);
|
|
6747
|
-
|
|
6748
|
+
ee = Bo({
|
|
6748
6749
|
client: n,
|
|
6749
6750
|
subscriber: n.duplicate()
|
|
6750
|
-
}),
|
|
6751
|
+
}), y = "redis", Z.info(`read replicas: ryw store = redis @ ${Wh(e)}`);
|
|
6751
6752
|
} catch (e) {
|
|
6752
6753
|
Z.warn("RYW_STORE=redis but ioredis import / connect failed — falling back to memory store", { err: e });
|
|
6753
6754
|
}
|
|
6754
6755
|
}
|
|
6755
|
-
|
|
6756
|
-
let
|
|
6757
|
-
currentRegion:
|
|
6758
|
-
replicaRegions: Kh(g,
|
|
6756
|
+
ee ||= Ao();
|
|
6757
|
+
let te = Gh(m.length), b = Uo(), C = b && te.length > 0 ? Ga({
|
|
6758
|
+
currentRegion: b,
|
|
6759
|
+
replicaRegions: Kh(g, te),
|
|
6759
6760
|
inner: Io()
|
|
6760
6761
|
}) : Io();
|
|
6761
|
-
return Z.info(`read replicas: ${g.length} configured, ryw policy '${_}', dialect=${o.id}, region=${
|
|
6762
|
+
return Z.info(`read replicas: ${g.length} configured, ryw policy '${_}', dialect=${o.id}, region=${b ?? "unknown"}` + (te.length > 0 ? ", replica-locality=on" : "")), t.recordReplication({
|
|
6762
6763
|
replicaCount: g.length,
|
|
6763
6764
|
rywPolicy: _,
|
|
6764
|
-
rywStore:
|
|
6765
|
-
region:
|
|
6766
|
-
localityEnabled:
|
|
6765
|
+
rywStore: y,
|
|
6766
|
+
region: b ?? null,
|
|
6767
|
+
localityEnabled: te.length > 0 && b !== void 0
|
|
6767
6768
|
}), new Zi({
|
|
6768
6769
|
primary: p,
|
|
6769
6770
|
replicas: g,
|
|
6770
6771
|
replicationAdapter: h,
|
|
6771
6772
|
rywPolicy: _,
|
|
6772
|
-
rywStore:
|
|
6773
|
-
replicaSelector:
|
|
6773
|
+
rywStore: ee,
|
|
6774
|
+
replicaSelector: C
|
|
6774
6775
|
});
|
|
6775
6776
|
}, Uh = async (e, t, n, r, i, a) => {
|
|
6776
6777
|
let o = Ks(t?.plugins ?? []), s = n === "postgres" || n === "mysql" || n === "mariadb", c = n === "postgres" ? "LISTEN/NOTIFY" : "binlog CDC";
|
|
@@ -6802,48 +6803,48 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6802
6803
|
return n;
|
|
6803
6804
|
}, qh = async (e) => {
|
|
6804
6805
|
switch (e) {
|
|
6805
|
-
case "postgres": return (await
|
|
6806
|
+
case "postgres": return (await x("@voltro/sql-postgres")).postgresReplicationAdapter();
|
|
6806
6807
|
case "mysql":
|
|
6807
|
-
case "mariadb": return (await
|
|
6808
|
-
case "mssql": return (await
|
|
6808
|
+
case "mariadb": return (await x("@voltro/sql-mysql")).mysqlReplicationAdapter();
|
|
6809
|
+
case "mssql": return (await x("@voltro/sql-mssql")).mssqlReplicationAdapter();
|
|
6809
6810
|
default: return null;
|
|
6810
6811
|
}
|
|
6811
6812
|
}, Jh = async (e) => {
|
|
6812
6813
|
let t = Rt(e.find((e) => !e.startsWith("-")) ?? process.cwd()), n = await g(t);
|
|
6813
6814
|
return n.ran ? n.exitCode : process.env.FRAMEWORK_DEV_INNER !== "1" && process.env.WATCH !== "0" ? (_t(rl({ root: t }), { scope: "voltro:dev" }), new Promise(() => {})) : Yh(t);
|
|
6814
6815
|
}, Yh = async (n) => {
|
|
6815
|
-
let g = Date.now(),
|
|
6816
|
+
let g = Date.now(), y = await Rh(n), x = o({
|
|
6816
6817
|
kind: "api",
|
|
6817
|
-
configPort:
|
|
6818
|
+
configPort: y?.port,
|
|
6818
6819
|
env: process.env
|
|
6819
6820
|
});
|
|
6820
|
-
for (let e of
|
|
6821
|
-
let
|
|
6821
|
+
for (let e of x.warnings) Z.warn(e);
|
|
6822
|
+
let C = x.port, re = y?.name ?? N(n), ie = Nt("api", re, C), ue = Pt(re);
|
|
6822
6823
|
await jt({
|
|
6823
|
-
id:
|
|
6824
|
-
name:
|
|
6824
|
+
id: ie,
|
|
6825
|
+
name: re,
|
|
6825
6826
|
kind: "api",
|
|
6826
|
-
url: `http://localhost:${
|
|
6827
|
+
url: `http://localhost:${C}`,
|
|
6827
6828
|
pid: process.pid,
|
|
6828
6829
|
status: "booting",
|
|
6829
|
-
logFile:
|
|
6830
|
+
logFile: ue.path
|
|
6830
6831
|
}).catch(() => {});
|
|
6831
|
-
let
|
|
6832
|
-
|
|
6832
|
+
let w = c();
|
|
6833
|
+
b(w), Z.info("booting voltro dev", {
|
|
6833
6834
|
root: n,
|
|
6834
6835
|
version: fh,
|
|
6835
|
-
logFile:
|
|
6836
|
+
logFile: ue.path
|
|
6836
6837
|
}), h(n, Z);
|
|
6837
|
-
let
|
|
6838
|
+
let me = await de({
|
|
6838
6839
|
project: N(n),
|
|
6839
6840
|
cliVersion: fh
|
|
6840
6841
|
});
|
|
6841
|
-
if (
|
|
6842
|
-
${
|
|
6843
|
-
|
|
6844
|
-
let
|
|
6845
|
-
|
|
6846
|
-
port:
|
|
6842
|
+
if (me.kind === "not-personal") return Z.error(`voltro dev needs a personal login — the stored credential belongs to no user.
|
|
6843
|
+
${me.message}`), 1;
|
|
6844
|
+
me.kind === "reported" && me.seat === "claimed" && Z.info("cloud: this machine now counts toward your organisation's seats (voltro cloud whoami)");
|
|
6845
|
+
let ve = process.env.VOLTRO_DEV_HEALTH_PORT, be = ve === void 0 ? C + 1 : Number(ve), Se;
|
|
6846
|
+
be > 0 && Number.isFinite(be) && (Se = await Xp({
|
|
6847
|
+
port: be,
|
|
6847
6848
|
log: {
|
|
6848
6849
|
info: (e, t) => Z.debug(e, t),
|
|
6849
6850
|
warn: (e, t) => Z.warn(e, t)
|
|
@@ -6856,24 +6857,24 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6856
6857
|
}).catch((e) => {
|
|
6857
6858
|
Z.warn("agent-instructions seed failed (non-fatal)", {}, e);
|
|
6858
6859
|
});
|
|
6859
|
-
let
|
|
6860
|
-
Z.info(`discovered ${
|
|
6861
|
-
let { pluginContributions:
|
|
6860
|
+
let T = await xh(n);
|
|
6861
|
+
Z.info(`discovered ${T.length} files`, { count: T.length });
|
|
6862
|
+
let { pluginContributions: Ee, pluginErrorImports: Oe, pluginRpcImports: ke } = await Xf(y?.plugins ?? [], y?.name ?? N(n), n), Ae = await wt({
|
|
6862
6863
|
root: n,
|
|
6863
|
-
...
|
|
6864
|
-
...
|
|
6865
|
-
...
|
|
6866
|
-
...
|
|
6864
|
+
...Ee.length > 0 ? { pluginContributions: Ee } : {},
|
|
6865
|
+
...Oe.length > 0 ? { pluginErrorImports: Oe } : {},
|
|
6866
|
+
...ke.length > 0 ? { pluginRpcImports: ke } : {},
|
|
6867
|
+
...y?.name === void 0 ? {} : { apiName: y.name }
|
|
6867
6868
|
});
|
|
6868
|
-
if (
|
|
6869
|
-
let e = await St(n,
|
|
6869
|
+
if (Ae ? (Z.info("codegen wrote rpcGroup", { path: Lt(n, Ae) }), await xt(Ae)) : Z.debug("codegen skipped — no descriptors discovered"), process.env.VOLTRO_BROWSER_SAFETY !== "off") {
|
|
6870
|
+
let e = await St(n, T);
|
|
6870
6871
|
if (e.length > 0) throw Error(e.map(Ct).join("\n\n"));
|
|
6871
6872
|
}
|
|
6872
|
-
let
|
|
6873
|
-
queries:
|
|
6874
|
-
mutations:
|
|
6875
|
-
actions:
|
|
6876
|
-
streams:
|
|
6873
|
+
let je = $(y ?? null), Ne = je === "mariadb" ? "mariadb" : je === "mssql" ? "mssql" : void 0, { queries: E, mutations: D, actions: O, streams: k, events: Ge, workflows: j, workflowWorkers: Je, eventTriggers: Ye, schedules: Xe, connections: Qe, tables: et, featureMix: nt, tenantScopedTables: it, softDeleteScopedTables: at, serverOnlyLeaks: ot, cacheScopeLeaks: ut } = await Ih(T, { cdc: Ne !== void 0 && (process.env.CDC ?? "1") !== "0" }), dt = Nl({
|
|
6874
|
+
queries: E,
|
|
6875
|
+
mutations: D,
|
|
6876
|
+
actions: O,
|
|
6877
|
+
streams: k,
|
|
6877
6878
|
events: Ge
|
|
6878
6879
|
});
|
|
6879
6880
|
{
|
|
@@ -6887,7 +6888,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6887
6888
|
e.action === "warn" && Z.warn(e.message ?? "");
|
|
6888
6889
|
}
|
|
6889
6890
|
Fl(dt, {
|
|
6890
|
-
defaultDeny: jl(
|
|
6891
|
+
defaultDeny: jl(y),
|
|
6891
6892
|
commandHint: "`voltro dev`"
|
|
6892
6893
|
});
|
|
6893
6894
|
let pt = j.length > 0 || Ye.length > 0, M = await Rh(n), mt = Lc(M?.http ?? {});
|
|
@@ -6912,23 +6913,23 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6912
6913
|
"apikeys:issue:other"
|
|
6913
6914
|
].some((t) => e.has(t)) && !e.has("admin:full") && Z.warn("apiKeys is enabled but no role declares any of apikeys:issue:self / :org / :other. The management routes are mounted and every issue request will fail its guard — the capability is on and reachable by nobody. Grant the right one in your role map (`:self` lets a user mint their own key, `:org` a shared one, `:other` on behalf of a colleague).");
|
|
6914
6915
|
}
|
|
6915
|
-
let vt = (typeof _t == "object" ? _t.prefix : void 0) ?? "voltro_", yt, Tt = _t ? [Aa({ resolveByHash: (e, t) => yt ? yt.resolveByHash(e, t) : Promise.resolve(null) }, { prefix: vt })] : [], It = hh([...M?.auth?.strategies ?? [], ...Tt], Ns(M?.plugins ?? []), M?.auth?.anonymousTenantRequired ?? !1, M?.auth, () => gt.current), Rt = eo({ resolveSubject: It }), zt =
|
|
6916
|
+
let vt = (typeof _t == "object" ? _t.prefix : void 0) ?? "voltro_", yt, Tt = _t ? [Aa({ resolveByHash: (e, t) => yt ? yt.resolveByHash(e, t) : Promise.resolve(null) }, { prefix: vt })] : [], It = hh([...M?.auth?.strategies ?? [], ...Tt], Ns(M?.plugins ?? []), M?.auth?.anonymousTenantRequired ?? !1, M?.auth, () => gt.current), Rt = eo({ resolveSubject: It }), zt = we({
|
|
6916
6917
|
nodeEnv: process.env.NODE_ENV,
|
|
6917
|
-
cdcDialect:
|
|
6918
|
+
cdcDialect: Ne,
|
|
6918
6919
|
declared: M?.schema
|
|
6919
|
-
}), Bt =
|
|
6920
|
+
}), Bt = _e({
|
|
6920
6921
|
gates: zt,
|
|
6921
6922
|
runtime: {
|
|
6922
6923
|
traces: Wp(),
|
|
6923
6924
|
undo: os()
|
|
6924
6925
|
}
|
|
6925
6926
|
});
|
|
6926
|
-
if (Bt !== void 0) throw
|
|
6927
|
-
let Vt =
|
|
6927
|
+
if (Bt !== void 0) throw r(`dev: ${Bt}`);
|
|
6928
|
+
let Vt = Ce({
|
|
6928
6929
|
mix: nt,
|
|
6929
6930
|
plugins: M?.plugins ?? [],
|
|
6930
6931
|
gates: zt,
|
|
6931
|
-
...
|
|
6932
|
+
...Ne ? { cdcDialect: Ne } : {}
|
|
6932
6933
|
}), Ut = M?.analytics?.tables ?? [], F = (() => {
|
|
6933
6934
|
let e = new Set(et.map((e) => e.tableName)), t = [...et];
|
|
6934
6935
|
for (let n of [...Vt, ...Ut]) {
|
|
@@ -6939,7 +6940,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6939
6940
|
})();
|
|
6940
6941
|
for (let e of F) di(e);
|
|
6941
6942
|
{
|
|
6942
|
-
let e = ka(ls(
|
|
6943
|
+
let e = ka(ls(E.map((e) => ({
|
|
6943
6944
|
name: e.descriptor.name,
|
|
6944
6945
|
source: e.descriptor.source
|
|
6945
6946
|
})), new Set(F.flatMap((e) => {
|
|
@@ -6966,30 +6967,30 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6966
6967
|
count: qt.length,
|
|
6967
6968
|
mounts: qt.map((e) => `${e.fullId} (${e.slot})`)
|
|
6968
6969
|
});
|
|
6969
|
-
let Jt =
|
|
6970
|
+
let Jt = De(M?.plugins ?? []);
|
|
6970
6971
|
Jt.length > 0 && Z.info("plugin schema contributions", { plugins: Jt.map((e) => `${e.pluginName}: ${e.tables}t/${e.migrations}m`) });
|
|
6971
|
-
let $t =
|
|
6972
|
+
let $t = fe(M?.plugins ?? []);
|
|
6972
6973
|
if ($t.length > 0) {
|
|
6973
6974
|
let e = [
|
|
6975
|
+
...E.map((e) => e.descriptor.name),
|
|
6974
6976
|
...D.map((e) => e.descriptor.name),
|
|
6975
6977
|
...O.map((e) => e.descriptor.name),
|
|
6976
|
-
...k.map((e) => e.descriptor.name)
|
|
6977
|
-
...Ue.map((e) => e.descriptor.name)
|
|
6978
|
+
...k.map((e) => e.descriptor.name)
|
|
6978
6979
|
], t = /* @__PURE__ */ new Set([
|
|
6980
|
+
...E.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name),
|
|
6979
6981
|
...D.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name),
|
|
6980
|
-
...O.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name)
|
|
6981
|
-
|
|
6982
|
-
]), n = fe($t, e, t);
|
|
6982
|
+
...O.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name)
|
|
6983
|
+
]), n = pe($t, e, t);
|
|
6983
6984
|
$t.length - n.length > 0 && Z.info(`plugin routes overridden by app procedures: ${[...t].join(", ")}`);
|
|
6984
|
-
for (let e of n) e.kind === "query" ?
|
|
6985
|
+
for (let e of n) e.kind === "query" ? E.push({
|
|
6985
6986
|
file: e.file,
|
|
6986
6987
|
descriptor: e.descriptor,
|
|
6987
6988
|
executor: e.executor
|
|
6988
|
-
}) : e.kind === "mutation" ?
|
|
6989
|
+
}) : e.kind === "mutation" ? D.push({
|
|
6989
6990
|
file: e.file,
|
|
6990
6991
|
descriptor: e.descriptor,
|
|
6991
6992
|
executor: e.executor
|
|
6992
|
-
}) :
|
|
6993
|
+
}) : O.push({
|
|
6993
6994
|
file: e.file,
|
|
6994
6995
|
descriptor: e.descriptor,
|
|
6995
6996
|
executor: e.executor
|
|
@@ -6999,20 +7000,20 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
6999
7000
|
routes: $t.map((e) => `${e.plugin.name}:${e.descriptor.name} (${e.kind})`)
|
|
7000
7001
|
});
|
|
7001
7002
|
}
|
|
7002
|
-
let en = Z.child("agent"), rn =
|
|
7003
|
+
let en = Z.child("agent"), rn = T.filter((e) => ye.test(N(e)));
|
|
7003
7004
|
if (rn.length > 0) {
|
|
7004
|
-
let e = await
|
|
7005
|
+
let e = await Te(rn, en);
|
|
7005
7006
|
e > 0 && en.info("wired tool handlers", { tools: e });
|
|
7006
7007
|
}
|
|
7007
|
-
let on =
|
|
7008
|
+
let on = T.filter((e) => xe.test(N(e))), sn = [];
|
|
7008
7009
|
if (on.length > 0) {
|
|
7009
|
-
let e = await
|
|
7010
|
+
let e = await he(on, en);
|
|
7010
7011
|
sn = e.agents.map((e) => e.descriptor.name);
|
|
7011
|
-
for (let t of e.agents) for (let e of Yd(t)) e.kind === "action" ?
|
|
7012
|
+
for (let t of e.agents) for (let e of Yd(t)) e.kind === "action" ? O.push({
|
|
7012
7013
|
file: e.file,
|
|
7013
7014
|
descriptor: e.descriptor,
|
|
7014
7015
|
executor: e.executor
|
|
7015
|
-
}) :
|
|
7016
|
+
}) : E.push({
|
|
7016
7017
|
file: e.file,
|
|
7017
7018
|
descriptor: e.descriptor,
|
|
7018
7019
|
executor: e.executor
|
|
@@ -7027,26 +7028,26 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7027
7028
|
let e = Qd();
|
|
7028
7029
|
e !== void 0 && Z.info(e);
|
|
7029
7030
|
}
|
|
7030
|
-
(cn.queries.length > 0 || cn.mutations.length > 0) && (
|
|
7031
|
+
(cn.queries.length > 0 || cn.mutations.length > 0) && (E.push(...cn.queries), D.push(...cn.mutations), Z.info("undo built-ins registered", { routes: [
|
|
7031
7032
|
"__voltro.undo.log",
|
|
7032
7033
|
"__voltro.undo.apply",
|
|
7033
7034
|
"__voltro.undo.redo"
|
|
7034
7035
|
] }));
|
|
7035
|
-
let ln = Z.child("aggregate"), un =
|
|
7036
|
+
let ln = Z.child("aggregate"), un = T.filter((e) => Be.test(e)), dn = un.length > 0 ? await au(un, ln) : [], fn = dn.map((e) => e.definition.name), pn = Z.child("expectation"), mn = T.filter((e) => ze.test(e)), hn = mn.length > 0 ? await Tu(mn, pn) : [], gn = Z.child("finops"), _n = T.filter((e) => Ie.test(e)), vn = _n.length > 0 ? await Eu(_n, gn) : [], yn = Z.child("experiment"), bn = T.filter((e) => Pe.test(e)), xn = bn.length > 0 ? await Du(bn, yn) : [];
|
|
7036
7037
|
for (let e of li()) Z.warn(`identifier length · ${e}`);
|
|
7037
|
-
let Sn = M?.restRoutes ?? [], Cn =
|
|
7038
|
+
let Sn = M?.restRoutes ?? [], Cn = T.filter((e) => He.test(e)).length, En = T.filter((e) => Me.test(e)).length, On = T.filter((e) => /\.seed\.ts$/.test(e)).length, An = T.filter((e) => Fe.test(e)).length, jn = T.filter((e) => zd.test(e)).length;
|
|
7038
7039
|
Zs(Xs([
|
|
7040
|
+
E,
|
|
7039
7041
|
D,
|
|
7040
7042
|
O,
|
|
7041
|
-
k
|
|
7042
|
-
Ue
|
|
7043
|
+
k
|
|
7043
7044
|
]), (e) => {
|
|
7044
7045
|
Z.warn(e);
|
|
7045
7046
|
}), Z.info("app surface", {
|
|
7046
|
-
queryCount:
|
|
7047
|
-
mutationCount:
|
|
7048
|
-
actionCount:
|
|
7049
|
-
streamCount:
|
|
7047
|
+
queryCount: E.length,
|
|
7048
|
+
mutationCount: D.length,
|
|
7049
|
+
actionCount: O.length,
|
|
7050
|
+
streamCount: k.length,
|
|
7050
7051
|
restRouteCount: Sn.length,
|
|
7051
7052
|
workflowCount: j.length,
|
|
7052
7053
|
workflowWorkerCount: Je.length,
|
|
@@ -7065,10 +7066,10 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7065
7066
|
tenantTables: [...it]
|
|
7066
7067
|
}), Yt({
|
|
7067
7068
|
appName: M?.name ?? N(n),
|
|
7068
|
-
queries:
|
|
7069
|
-
mutations:
|
|
7070
|
-
actions:
|
|
7071
|
-
streams:
|
|
7069
|
+
queries: E.map((e) => e.descriptor.name),
|
|
7070
|
+
mutations: D.map((e) => e.descriptor.name),
|
|
7071
|
+
actions: O.map((e) => e.descriptor.name),
|
|
7072
|
+
streams: k.map((e) => e.descriptor.name),
|
|
7072
7073
|
restRoutes: Sn.map((e) => `${e.method} ${e.path}`),
|
|
7073
7074
|
workflows: j.map((e) => e.definition.name),
|
|
7074
7075
|
triggers: Ye.map((e) => `${e.event}→${e.workflow}`),
|
|
@@ -7089,7 +7090,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7089
7090
|
let t = e.attributes, n = String(t["url.path"] ?? t["http.route"] ?? t["http.target"] ?? "");
|
|
7090
7091
|
return n.startsWith("/_voltro/") || n === "/ws" || n.startsWith("/ws/") || n.startsWith("/ws?");
|
|
7091
7092
|
}, Jn = (e) => {
|
|
7092
|
-
qn(e) || kp(e) || e.name.startsWith("RpcServer.") || (Mn.append(e), (Pn || e.status === "error") &&
|
|
7093
|
+
qn(e) || kp(e) || e.name.startsWith("RpcServer.") || (Mn.append(e), (Pn || e.status === "error") && w.emit("trace", e), Kn(e));
|
|
7093
7094
|
}, Yn = Nn ? void 0 : to(Jn), R = await pa({
|
|
7094
7095
|
serviceName: process.env.OTEL_SERVICE_NAME ?? M?.name ?? "voltro-api",
|
|
7095
7096
|
...Yn ? { traceSink: Yn } : {},
|
|
@@ -7105,8 +7106,8 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7105
7106
|
store: z,
|
|
7106
7107
|
defaultExpiryMs: tf(M)
|
|
7107
7108
|
});
|
|
7108
|
-
|
|
7109
|
-
let nr = [...
|
|
7109
|
+
E.push(...er.queries), D.push(...er.mutations);
|
|
7110
|
+
let nr = [...D.map((e) => e.descriptor), ...O.map((e) => e.descriptor)];
|
|
7110
7111
|
nf(nr) && Z.info("approvals: `requiresApproval` declared — the second-human gate is active", { procedures: nr.filter((e) => e.requiresApproval != null).map((e) => e.name ?? "?") });
|
|
7111
7112
|
for (let e of gc({
|
|
7112
7113
|
dialect: $(M ?? null),
|
|
@@ -7117,7 +7118,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7117
7118
|
tableName: e.tableName,
|
|
7118
7119
|
isReactive: e.isReactive === !0
|
|
7119
7120
|
})),
|
|
7120
|
-
querySources:
|
|
7121
|
+
querySources: E.flatMap((e) => {
|
|
7121
7122
|
let t = e.descriptor.source;
|
|
7122
7123
|
return t === void 0 ? [] : typeof t == "string" ? [t] : [...t];
|
|
7123
7124
|
})
|
|
@@ -7125,7 +7126,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7125
7126
|
{
|
|
7126
7127
|
let e = bc(yc({
|
|
7127
7128
|
tables: ri().map((e) => ({ tableName: e.tableName })),
|
|
7128
|
-
queries:
|
|
7129
|
+
queries: E.map((e) => ({
|
|
7129
7130
|
name: e.descriptor.name,
|
|
7130
7131
|
source: e.descriptor.source
|
|
7131
7132
|
}))
|
|
@@ -7142,13 +7143,13 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7142
7143
|
let rr = gl({
|
|
7143
7144
|
definitions: Qe.map((e) => e.definition),
|
|
7144
7145
|
store: z,
|
|
7145
|
-
publicUrl: vl(
|
|
7146
|
+
publicUrl: vl(C),
|
|
7146
7147
|
log: Z.child("connections")
|
|
7147
7148
|
});
|
|
7148
|
-
|
|
7149
|
+
E.push(...rr.queries), D.push(...rr.mutations), O.push(...rr.actions);
|
|
7149
7150
|
let ar = $(M), or = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, pr, mr;
|
|
7150
7151
|
if (ar !== "memory") {
|
|
7151
|
-
let e = await
|
|
7152
|
+
let e = await S(ar);
|
|
7152
7153
|
pr = Xn.make(e.makeSqlLayer(Q())), mr = await pr.runPromise($n.SqlClient);
|
|
7153
7154
|
}
|
|
7154
7155
|
let hr = [
|
|
@@ -7197,7 +7198,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7197
7198
|
Lr !== void 0 && Z.info("semantic cache enabled — reactive eviction on live writes"), Z.info(`cache backend resolved: ${Hr}` + (Hr === "redis" ? ` (driver ${process.env.CACHE_REDIS_DRIVER ?? "resp"})` : " — in-process, not cross-instance")), M?.kv && !process.env.KV_BACKEND && (process.env.KV_BACKEND = M.kv), M?.kvRedisUrl && !process.env.KV_REDIS_URL && (process.env.KV_REDIS_URL = M.kvRedisUrl), M?.kvKeyPrefix && !process.env.KV_KEY_PREFIX && (process.env.KV_KEY_PREFIX = M.kvKeyPrefix);
|
|
7198
7199
|
let { kv: Yr, service: $r, backend: ei } = await $a({ store: z });
|
|
7199
7200
|
Z.info(`kv backend resolved: ${ei}` + (ei === "database" ? " (durable, _voltro_kv)" : ei === "memory" ? " — in-process, non-durable" : ` (driver ${process.env.KV_REDIS_DRIVER ?? "resp"}, non-durable)`));
|
|
7200
|
-
let ti = $(M), ni = M?.analytics !== void 0 && M.analytics.kind !== "noop" && ti !== "memory" ? (await
|
|
7201
|
+
let ti = $(M), ni = M?.analytics !== void 0 && M.analytics.kind !== "noop" && ti !== "memory" ? (await S(ti)).makeSqlLayer(Q()) : void 0, oi = await il({
|
|
7201
7202
|
spec: M?.analytics,
|
|
7202
7203
|
sqlLayer: ni,
|
|
7203
7204
|
log: Z
|
|
@@ -7226,12 +7227,12 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7226
7227
|
dialect: hi,
|
|
7227
7228
|
env: t,
|
|
7228
7229
|
tables: F.length
|
|
7229
|
-
}),
|
|
7230
|
+
}), Se?.set({
|
|
7230
7231
|
phase: "migrating",
|
|
7231
7232
|
tablesTotal: F.length
|
|
7232
7233
|
});
|
|
7233
7234
|
try {
|
|
7234
|
-
let r = await
|
|
7235
|
+
let r = await S(hi), i = r.makeSqlLayer(Q());
|
|
7235
7236
|
gi = i, await cr(kh(F.filter((e) => e.tableName.startsWith("_voltro_") || e.tableName === "voltro_isr_cache"), F), i, r.id, { retryFilter: r.retryFilter });
|
|
7236
7237
|
let a = Tc({
|
|
7237
7238
|
conn: Q(),
|
|
@@ -7253,18 +7254,18 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7253
7254
|
if (s.kind === "refused-blocked" || s.kind === "prod-mismatch") throw Z.error(tr(s, r.id)), Error("auto-migrate refused — see error above");
|
|
7254
7255
|
Z.info(tr(s, r.id), { durationMs: Date.now() - e });
|
|
7255
7256
|
} catch (e) {
|
|
7256
|
-
throw Z.error("auto-migrate failed — aborting boot", { err: e }),
|
|
7257
|
+
throw Z.error("auto-migrate failed — aborting boot", { err: e }), Se?.set({
|
|
7257
7258
|
phase: "error",
|
|
7258
7259
|
error: e instanceof Error ? e.message : String(e)
|
|
7259
7260
|
}), e;
|
|
7260
7261
|
}
|
|
7261
7262
|
} else hi !== "memory" && Z.info("auto-migrate: skipped (VOLTRO_AUTO_MIGRATE=0)");
|
|
7262
|
-
await
|
|
7263
|
+
await ce({
|
|
7263
7264
|
dialectId: hi,
|
|
7264
7265
|
tables: F,
|
|
7265
|
-
mode:
|
|
7266
|
+
mode: ae(M?.reactiveTriggers),
|
|
7266
7267
|
lockSchema: Q().schema,
|
|
7267
|
-
makeLayer: async () => (await
|
|
7268
|
+
makeLayer: async () => (await S(hi)).makeSqlLayer(Q()),
|
|
7268
7269
|
log: {
|
|
7269
7270
|
info: (e, t) => Z.info(e, t ?? {}),
|
|
7270
7271
|
warn: (e, t) => Z.warn(e, t ?? {})
|
|
@@ -7272,9 +7273,9 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7272
7273
|
});
|
|
7273
7274
|
let _i = $(M);
|
|
7274
7275
|
if ((M?.plugins ?? []).some((e) => (e.extendSchema?.migrations?.length ?? 0) > 0) && _i !== "memory") {
|
|
7275
|
-
let e = (await
|
|
7276
|
+
let e = (await S(_i)).makeSqlLayer(Q());
|
|
7276
7277
|
try {
|
|
7277
|
-
let t = await I.runPromise(
|
|
7278
|
+
let t = await I.runPromise(ge(M.plugins).pipe(I.provide(e))), n = t.filter((e) => e.status === "applied"), r = t.filter((e) => e.status === "skipped");
|
|
7278
7279
|
Z.info("plugin migrations complete", {
|
|
7279
7280
|
applied: n.map((e) => `${e.pluginName}:${e.migrationId} (${e.durationMs}ms)`),
|
|
7280
7281
|
skippedCount: r.length
|
|
@@ -7283,7 +7284,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7283
7284
|
throw Z.error("plugin migrations failed — aborting boot", { err: e }), e;
|
|
7284
7285
|
}
|
|
7285
7286
|
}
|
|
7286
|
-
let vi = wp(z,
|
|
7287
|
+
let vi = wp(z, w);
|
|
7287
7288
|
W(() => {
|
|
7288
7289
|
vi();
|
|
7289
7290
|
});
|
|
@@ -7293,22 +7294,22 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7293
7294
|
schemaRegistry: bi
|
|
7294
7295
|
});
|
|
7295
7296
|
let xi = Z.child("seeds"), Si = await Vd({
|
|
7296
|
-
files:
|
|
7297
|
+
files: T,
|
|
7297
7298
|
store: z,
|
|
7298
7299
|
log: Z,
|
|
7299
7300
|
seedPolicy: "run",
|
|
7300
|
-
seedPattern:
|
|
7301
|
-
loadSeedFiles:
|
|
7302
|
-
runBootSeeds:
|
|
7301
|
+
seedPattern: Ue,
|
|
7302
|
+
loadSeedFiles: se,
|
|
7303
|
+
runBootSeeds: le,
|
|
7303
7304
|
onSeedDiscovered: (e) => {
|
|
7304
7305
|
t.registerSeed(e);
|
|
7305
7306
|
},
|
|
7306
7307
|
onSeedResult: (e) => {
|
|
7307
7308
|
t.recordSeedResult(e);
|
|
7308
7309
|
},
|
|
7309
|
-
startupPattern:
|
|
7310
|
+
startupPattern: Me,
|
|
7310
7311
|
loadStartupFiles: i,
|
|
7311
|
-
runStartups:
|
|
7312
|
+
runStartups: a,
|
|
7312
7313
|
emailPattern: zd,
|
|
7313
7314
|
loadEmailFiles: Bd,
|
|
7314
7315
|
registerEmailTemplates: Vs
|
|
@@ -7323,14 +7324,14 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7323
7324
|
log: Z
|
|
7324
7325
|
}), Ti = Si.startups;
|
|
7325
7326
|
Ti && W(() => Ti.shutdown());
|
|
7326
|
-
let Ei = Z.child("subscribe"), Oi =
|
|
7327
|
+
let Ei = Z.child("subscribe"), Oi = T.filter((e) => He.test(e)), ki = Oi.length > 0 ? await cl(Oi, Ei) : [], Ai;
|
|
7327
7328
|
$p({
|
|
7328
7329
|
events: Ge,
|
|
7329
7330
|
rpcTags: [
|
|
7331
|
+
...E.map((e) => e.descriptor.name),
|
|
7330
7332
|
...D.map((e) => e.descriptor.name),
|
|
7331
7333
|
...O.map((e) => e.descriptor.name),
|
|
7332
|
-
...k.map((e) => e.descriptor.name)
|
|
7333
|
-
...Ue.map((e) => e.descriptor.name)
|
|
7334
|
+
...k.map((e) => e.descriptor.name)
|
|
7334
7335
|
]
|
|
7335
7336
|
});
|
|
7336
7337
|
let ji = em({
|
|
@@ -7340,7 +7341,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7340
7341
|
});
|
|
7341
7342
|
if (Ge.length > 0 && await Cr.attach(ji.bus), Ge.length > 0) {
|
|
7342
7343
|
let e = Fm(Ge);
|
|
7343
|
-
for (let [, t] of Ym(
|
|
7344
|
+
for (let [, t] of Ym(T.filter((e) => !Le.test(e)))) if (e.offer(t), e.settled) break;
|
|
7344
7345
|
e.settled || Zm(n, {
|
|
7345
7346
|
onFile: (t, n) => (e.offer(n), e.settled ? "stop" : "continue"),
|
|
7346
7347
|
onTruncated: (e, t) => Z.warn(`event audit: stopped after ${t} sibling files (saw ${e}) — a \`no-consumer\` line below may mean "we stopped looking", not "nothing consumes it"`)
|
|
@@ -7353,7 +7354,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7353
7354
|
ki.length > 0 && (Ei.info("discovered subscribers", { subscribers: ki.map((e) => `${e.id}@${e.definition.table}`) }), Ai = ll(ki, z, Ei, bi, ji.bus)), Ai && W(() => {
|
|
7354
7355
|
Ai();
|
|
7355
7356
|
}), Pa(), Zo((e) => Wa(z, e.subjectId, e.resourceType, e.resourceId));
|
|
7356
|
-
let Ni, Pi = Z.child("outbox"), Fi =
|
|
7357
|
+
let Ni, Pi = Z.child("outbox"), Fi = T.filter((e) => Re.test(e)), Li = Fi.length > 0 ? await dl(Fi, Pi) : [], Ri = kt(T.filter((e) => Fe.test(e)).length, Ge) ? [...Li, {
|
|
7357
7358
|
file: "<framework>/webhooks",
|
|
7358
7359
|
id: "voltro-webhook-emit",
|
|
7359
7360
|
definition: ks(() => Ni)
|
|
@@ -7368,7 +7369,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7368
7369
|
onShutdown: W
|
|
7369
7370
|
}) : void 0, Ui = Ql(), Ki = $(M);
|
|
7370
7371
|
if (dn.length > 0 && Ki !== "memory") try {
|
|
7371
|
-
Ui = ru((await
|
|
7372
|
+
Ui = ru((await S(Ki)).makeSqlLayer(Q()));
|
|
7372
7373
|
} catch (e) {
|
|
7373
7374
|
ln.warn("aggregate: SQL storage init failed — falling back to in-process", { err: e });
|
|
7374
7375
|
}
|
|
@@ -7432,7 +7433,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7432
7433
|
}
|
|
7433
7434
|
})) : [], ga = "in-memory", va = await (async () => {
|
|
7434
7435
|
if (V === "memory") return fr.layerMemory;
|
|
7435
|
-
let e = await
|
|
7436
|
+
let e = await S(V), t = e.makeSqlLayer(Q()), n = Xr({ sqliteFamily: yi(e.id) });
|
|
7436
7437
|
if (ga = `cluster-${n}`, Z.info(`workflow engine: cluster-${n}, dialect=${e.id}` + (n === "memory" ? " — single-process durable replay, no horizontal scaling" + (yi(e.id) ? "" : " (VOLTRO_WORKFLOW_RUNNER_STORAGE=memory: SqlRunnerStorage/cluster_runners + GET_LOCK skipped)") : "")), e.id === "mssql") {
|
|
7437
7438
|
let e = await Et(process.cwd());
|
|
7438
7439
|
e && Z.warn(e);
|
|
@@ -7452,7 +7453,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7452
7453
|
}), Sa = xa.remember, Ca = xa.resolve, wa = bl({
|
|
7453
7454
|
authority: M?.auth,
|
|
7454
7455
|
getStore: () => gt.current
|
|
7455
|
-
}), H = j.length > 0 ? fo(() => ya) : void 0, Ea = Z.child("webhooks"), ja =
|
|
7456
|
+
}), H = j.length > 0 ? fo(() => ya) : void 0, Ea = Z.child("webhooks"), ja = T.filter((e) => Fe.test(e)), Na = ja.length > 0 ? await At(ja, Ea) : {
|
|
7456
7457
|
outgoing: [],
|
|
7457
7458
|
incoming: [],
|
|
7458
7459
|
providers: []
|
|
@@ -7490,7 +7491,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7490
7491
|
secretEnvKey: n
|
|
7491
7492
|
});
|
|
7492
7493
|
}
|
|
7493
|
-
let Ra = Z.child("reaction"), za =
|
|
7494
|
+
let Ra = Z.child("reaction"), za = T.filter((e) => Ve.test(e)), Va = za.length > 0 ? await ql(za, Ra) : [], Ha;
|
|
7494
7495
|
if (Va.length > 0) {
|
|
7495
7496
|
Ra.info("discovered reactions", { reactions: Va.map((e) => `${e.definition.name}@${e.definition.watch.table}`) });
|
|
7496
7497
|
let e = Nd(z, { onError: (e) => Ra.warn("reaction: rate-slot claim failed; refusing the act", { cause: String(e) }) });
|
|
@@ -7509,7 +7510,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7509
7510
|
return;
|
|
7510
7511
|
}
|
|
7511
7512
|
await Jl(e.agent, t, {
|
|
7512
|
-
findAgentSend: (e) =>
|
|
7513
|
+
findAgentSend: (e) => O.find((t) => t.descriptor.name === `${e}.send`),
|
|
7513
7514
|
runAction: (e, t, n) => Promise.resolve(Cs(e, t, n)),
|
|
7514
7515
|
makeSubject: (e) => an(e),
|
|
7515
7516
|
now: () => Date.now(),
|
|
@@ -7563,7 +7564,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7563
7564
|
});
|
|
7564
7565
|
kr = U;
|
|
7565
7566
|
let Ga = () => {
|
|
7566
|
-
|
|
7567
|
+
w.emit("subscriptions", Am(() => U));
|
|
7567
7568
|
};
|
|
7568
7569
|
U.onSubscriptionsChange(Ga), Ga();
|
|
7569
7570
|
let Za = Z.child("store"), Qa = (M?.plugins ?? []).filter((e) => typeof e.onChangeEvent == "function"), no = z.changeScope ?? "local";
|
|
@@ -7614,7 +7615,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7614
7615
|
nn(Rn),
|
|
7615
7616
|
nn(Un),
|
|
7616
7617
|
nn(Wn)
|
|
7617
|
-
] : [], oo = (M?.plugins ?? []).flatMap((e) => (e.errorSchemas ?? []).map((e) => e.schema)), so = oo.length > 0 ? oo : void 0, lo = (e) => e.filter((e) => wn(e.descriptor)), uo = lo(
|
|
7618
|
+
] : [], oo = (M?.plugins ?? []).flatMap((e) => (e.errorSchemas ?? []).map((e) => e.schema)), so = oo.length > 0 ? oo : void 0, lo = (e) => e.filter((e) => wn(e.descriptor)), uo = lo(E), po = lo(D), _o = lo(O), vo = lo(k), wo = [
|
|
7618
7619
|
...uo.map((e) => Dn(e.descriptor, so)),
|
|
7619
7620
|
...po.map((e) => Tn(e.descriptor, so)),
|
|
7620
7621
|
..._o.map((e) => nn(e.descriptor, so)),
|
|
@@ -7662,7 +7663,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7662
7663
|
let G = (process.env.VOLTRO_TENANT_ISOLATION ?? M?.tenancy?.isolation) === "namespace";
|
|
7663
7664
|
G && Z.info("multi-tenancy: PHYSICAL namespace isolation ON — each request runs against its tenant's own namespace (schema/database/attached file). Requests without a resolvable tenant fail closed.");
|
|
7664
7665
|
let Uo = $(M), K = G && Uo !== "memory" ? await (async () => {
|
|
7665
|
-
let e = await
|
|
7666
|
+
let e = await S(Uo);
|
|
7666
7667
|
return jc({
|
|
7667
7668
|
tables: ri(),
|
|
7668
7669
|
sqlLayer: e.makeSqlLayer(Q()),
|
|
@@ -7676,7 +7677,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7676
7677
|
})() : void 0, Ko = await uh({
|
|
7677
7678
|
input: M?.tenancy?.residency,
|
|
7678
7679
|
namespaceIsolationOn: G,
|
|
7679
|
-
makeStoreForUrl: (e, t) => Hh(M, Zn,
|
|
7680
|
+
makeStoreForUrl: (e, t) => Hh(M, Zn, ne(Q(), t)),
|
|
7680
7681
|
log: {
|
|
7681
7682
|
info: (e, t) => Z.info(e, t),
|
|
7682
7683
|
warn: (e, t) => Z.warn(e, t)
|
|
@@ -7696,7 +7697,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7696
7697
|
eventTriggers: Ye,
|
|
7697
7698
|
namespaceIsolationOn: G,
|
|
7698
7699
|
...K === void 0 ? {} : { ensureTenantProvisioned: K.ensure },
|
|
7699
|
-
onEventEmit: (e, t) =>
|
|
7700
|
+
onEventEmit: (e, t) => w.emit(e, t),
|
|
7700
7701
|
...Bi === void 0 ? {} : { outbox: { nudge: Bi.nudge } },
|
|
7701
7702
|
...rr.active ? { connections: { registry: rr.registry } } : {},
|
|
7702
7703
|
eventBus: ji.bus
|
|
@@ -7725,7 +7726,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7725
7726
|
error: (e, t) => Z.error(e, t ?? {}),
|
|
7726
7727
|
debug: (e, t) => Z.debug(e, t ?? {})
|
|
7727
7728
|
},
|
|
7728
|
-
onRunEvent: (e, t) =>
|
|
7729
|
+
onRunEvent: (e, t) => w.emit("scheduleRuns", {
|
|
7729
7730
|
op: e,
|
|
7730
7731
|
row: t
|
|
7731
7732
|
}),
|
|
@@ -7778,7 +7779,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7778
7779
|
scope: n.scope,
|
|
7779
7780
|
baseKey: `q:${e.name}:${ms(t)}`
|
|
7780
7781
|
};
|
|
7781
|
-
}, gs = Ft(), _s = xf(M?.plugins ?? [], gs), vs = _s.mutation, ys = _s.action, bs = _s.query, xs = jl(
|
|
7782
|
+
}, gs = Ft(), _s = xf(M?.plugins ?? [], gs), vs = _s.mutation, ys = _s.action, bs = _s.query, xs = jl(y), Ss = ho({
|
|
7782
7783
|
store: z,
|
|
7783
7784
|
defaultDeny: xs,
|
|
7784
7785
|
buildContext: (e, t, n) => qo(e, t, n),
|
|
@@ -7953,7 +7954,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
7953
7954
|
let Ls = (e, t) => qo({
|
|
7954
7955
|
subject: e.subject,
|
|
7955
7956
|
traceId: e.traceId
|
|
7956
|
-
}, z, void 0, `workflow:${t.workflowName}`, { parentExecutionId: t.executionId }), Rs = Af(M?.plugins ?? [], gs), zs = Br, Bs = (e, t) =>
|
|
7957
|
+
}, z, void 0, `workflow:${t.workflowName}`, { parentExecutionId: t.executionId }), Rs = Af(M?.plugins ?? [], gs), zs = Br, Bs = (e, t) => w.emit(e, t), Hs = M?.dormancy === "sleep" ? {
|
|
7957
7958
|
register: (e, t, n) => Ho(z, {
|
|
7958
7959
|
tenantId: n ?? Vi,
|
|
7959
7960
|
kind: "workflow",
|
|
@@ -8005,7 +8006,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8005
8006
|
cancelled: !0,
|
|
8006
8007
|
completedAt: /* @__PURE__ */ new Date()
|
|
8007
8008
|
});
|
|
8008
|
-
i &&
|
|
8009
|
+
i && w.emit("workflowRuns", {
|
|
8009
8010
|
op: "update",
|
|
8010
8011
|
row: zs(i)
|
|
8011
8012
|
});
|
|
@@ -8080,7 +8081,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8080
8081
|
workflowRuntime: J,
|
|
8081
8082
|
workflowRunRecorder: Ws,
|
|
8082
8083
|
closeChildrenForParent: Gs,
|
|
8083
|
-
onRunUpdated: (e) =>
|
|
8084
|
+
onRunUpdated: (e) => w.emit("workflowRuns", {
|
|
8084
8085
|
op: "update",
|
|
8085
8086
|
row: zs(e)
|
|
8086
8087
|
})
|
|
@@ -8179,7 +8180,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8179
8180
|
runRedrive: (e) => J.runPromise(Jr(e))
|
|
8180
8181
|
}, e).then((e) => e.outcome)
|
|
8181
8182
|
}) : void 0;
|
|
8182
|
-
let lc = L.mergeAll(To.toLayer(q), Rt), uc = Bc(q,
|
|
8183
|
+
let lc = L.mergeAll(To.toLayer(q), Rt), uc = Bc(q, E.map((e) => e.descriptor.name), pt), dc = L.mergeAll(To.toLayer(uc), Rt), Y = V, pc = (Y === "postgres" || Y === "mysql" || Y === "mariadb" || Y === "mssql") && (process.env.CDC ?? "1") !== "0";
|
|
8183
8184
|
if (Y === "postgres" && Wp()) {
|
|
8184
8185
|
let e = Yp({
|
|
8185
8186
|
store: z,
|
|
@@ -8196,16 +8197,16 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8196
8197
|
mc.stop();
|
|
8197
8198
|
});
|
|
8198
8199
|
let hc = tc({
|
|
8199
|
-
queries:
|
|
8200
|
-
mutations:
|
|
8201
|
-
actions:
|
|
8202
|
-
streams:
|
|
8200
|
+
queries: E,
|
|
8201
|
+
mutations: D,
|
|
8202
|
+
actions: O,
|
|
8203
|
+
streams: k,
|
|
8203
8204
|
workflows: j
|
|
8204
8205
|
}, n), _c = nc({
|
|
8205
|
-
queries:
|
|
8206
|
-
mutations:
|
|
8207
|
-
actions:
|
|
8208
|
-
streams:
|
|
8206
|
+
queries: E,
|
|
8207
|
+
mutations: D,
|
|
8208
|
+
actions: O,
|
|
8209
|
+
streams: k,
|
|
8209
8210
|
workflows: j
|
|
8210
8211
|
}, n);
|
|
8211
8212
|
Ht.writeFile(P(n, "app.manifest.generated.json"), `${JSON.stringify(lt(hc, _c, [], M?.plugins ?? []), null, 2)}\n`, "utf8").catch(() => {}), (async () => {
|
|
@@ -8353,7 +8354,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8353
8354
|
skip: void 0,
|
|
8354
8355
|
take: 1
|
|
8355
8356
|
});
|
|
8356
|
-
t[0] &&
|
|
8357
|
+
t[0] && w.emit("workflowRuns", {
|
|
8357
8358
|
op: "update",
|
|
8358
8359
|
row: zs(t[0])
|
|
8359
8360
|
});
|
|
@@ -8388,7 +8389,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8388
8389
|
meta: {
|
|
8389
8390
|
name: M?.name ?? N(n),
|
|
8390
8391
|
voltroVersion: fh,
|
|
8391
|
-
port:
|
|
8392
|
+
port: C,
|
|
8392
8393
|
mode: "dev",
|
|
8393
8394
|
store: Y,
|
|
8394
8395
|
cdc: pc ? "on" : "off",
|
|
@@ -8407,7 +8408,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8407
8408
|
mode: "dev",
|
|
8408
8409
|
accessGate: dt,
|
|
8409
8410
|
config: M,
|
|
8410
|
-
...
|
|
8411
|
+
...Ae ? { rpcGroupFile: Ae } : {},
|
|
8411
8412
|
serverOnlyLeaks: ot,
|
|
8412
8413
|
migrations: Ac
|
|
8413
8414
|
}),
|
|
@@ -8415,7 +8416,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8415
8416
|
plugins: Wt.snapshot(),
|
|
8416
8417
|
capturedAt: Date.now()
|
|
8417
8418
|
}),
|
|
8418
|
-
env: () =>
|
|
8419
|
+
env: () => _(M?.name ?? N(n), {
|
|
8419
8420
|
contract: ps(M?.env) ? M.env : void 0,
|
|
8420
8421
|
plugins: M?.plugins ?? []
|
|
8421
8422
|
}),
|
|
@@ -8494,7 +8495,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8494
8495
|
workflowRuntime: J,
|
|
8495
8496
|
workflowRunRecorder: Ws,
|
|
8496
8497
|
closeChildrenForParent: Gs,
|
|
8497
|
-
onRunUpdated: (e) =>
|
|
8498
|
+
onRunUpdated: (e) => w.emit("workflowRuns", {
|
|
8498
8499
|
op: "update",
|
|
8499
8500
|
row: zs(e)
|
|
8500
8501
|
})
|
|
@@ -8563,7 +8564,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8563
8564
|
scheduleCoordChoice: ra
|
|
8564
8565
|
}),
|
|
8565
8566
|
runSeed: async (e) => {
|
|
8566
|
-
let n = await
|
|
8567
|
+
let n = await oe(Si.seeds, e, z, xi);
|
|
8567
8568
|
return t.recordSeedResult(n), kc();
|
|
8568
8569
|
},
|
|
8569
8570
|
rollbackMigration: async (e) => (xi.warn("rollbackMigration called but only memory store is wired — no-op"), kc()),
|
|
@@ -8577,7 +8578,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8577
8578
|
metrics: gs,
|
|
8578
8579
|
log: Z
|
|
8579
8580
|
}), Wc = (M?.plugins ?? []).flatMap((e) => e.httpRoutes ?? []), Gc = typeof _t == "object" ? _t.managementPath : void 0, Kc = () => `public-${Math.random().toString(36).slice(2, 10)}`, qc = [
|
|
8580
|
-
...
|
|
8581
|
+
...E.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
8581
8582
|
descriptor: e.descriptor,
|
|
8582
8583
|
invoke: (t, n) => Ps(e, t, {
|
|
8583
8584
|
subject: n.subject,
|
|
@@ -8588,14 +8589,14 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8588
8589
|
traceId: Kc()
|
|
8589
8590
|
}, r)
|
|
8590
8591
|
})),
|
|
8591
|
-
...
|
|
8592
|
+
...D.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
8592
8593
|
descriptor: e.descriptor,
|
|
8593
8594
|
invoke: (t, n) => Ss(e, t, {
|
|
8594
8595
|
subject: n.subject,
|
|
8595
8596
|
traceId: Kc()
|
|
8596
8597
|
})
|
|
8597
8598
|
})),
|
|
8598
|
-
...
|
|
8599
|
+
...O.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
8599
8600
|
descriptor: e.descriptor,
|
|
8600
8601
|
invoke: (t, n) => Cs(e, t, {
|
|
8601
8602
|
subject: n.subject,
|
|
@@ -8618,7 +8619,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8618
8619
|
...rr.httpRoutes
|
|
8619
8620
|
];
|
|
8620
8621
|
try {
|
|
8621
|
-
await
|
|
8622
|
+
await te(C, "voltro dev (api)");
|
|
8622
8623
|
} catch (e) {
|
|
8623
8624
|
Z.error(String(e.message ?? e)), process.exit(1);
|
|
8624
8625
|
}
|
|
@@ -8626,7 +8627,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8626
8627
|
group: To,
|
|
8627
8628
|
handlersLayer: lc,
|
|
8628
8629
|
httpHandlersLayer: dc,
|
|
8629
|
-
port:
|
|
8630
|
+
port: C,
|
|
8630
8631
|
path: M?.transport?.wsPath ?? "/ws",
|
|
8631
8632
|
security: Wl(M),
|
|
8632
8633
|
...Uc,
|
|
@@ -8673,11 +8674,11 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8673
8674
|
if (e === "/_voltro/inspect/seeds/run" || e === "/_voltro/inspect/migrations/rollback") return i;
|
|
8674
8675
|
}
|
|
8675
8676
|
if (n === "POST" && e === "/_voltro/inspect/clientLog") return {
|
|
8676
|
-
...
|
|
8677
|
+
...f(r ?? "", w),
|
|
8677
8678
|
headers: A(t.origin)
|
|
8678
8679
|
};
|
|
8679
8680
|
if (n === "GET" && (e === "/_voltro/inspect/logs" || e.startsWith("/_voltro/inspect/logs?"))) return {
|
|
8680
|
-
...
|
|
8681
|
+
...l(e, s(), t),
|
|
8681
8682
|
headers: A(t.origin)
|
|
8682
8683
|
};
|
|
8683
8684
|
if (n === "GET" && (e === "/_voltro/inspect/traces" || e.startsWith("/_voltro/inspect/traces?"))) {
|
|
@@ -8738,10 +8739,10 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8738
8739
|
reason: "forbidden host (DNS-rebinding guard)"
|
|
8739
8740
|
},
|
|
8740
8741
|
isDisabled: () => We(),
|
|
8741
|
-
replay: () =>
|
|
8742
|
-
subscribe: (e) =>
|
|
8742
|
+
replay: () => w.buffered().map(m),
|
|
8743
|
+
subscribe: (e) => w.subscribe((t) => e(m(t))),
|
|
8743
8744
|
corsHeaders: (e) => A(e),
|
|
8744
|
-
keepAlive: () =>
|
|
8745
|
+
keepAlive: () => p()
|
|
8745
8746
|
},
|
|
8746
8747
|
webhookRoutes: new Map(Array.from(Ia.entries()).map(([e, t]) => [e, { handle: t }])),
|
|
8747
8748
|
...Zn ? { tracerLayer: Zn } : {}
|
|
@@ -8749,43 +8750,43 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8749
8750
|
try {
|
|
8750
8751
|
await ca(Xc);
|
|
8751
8752
|
} catch (e) {
|
|
8752
|
-
Z.error(`rpc server failed to bind on port ${
|
|
8753
|
+
Z.error(`rpc server failed to bind on port ${C} — aborting boot`, { port: C }, e), process.exit(1);
|
|
8753
8754
|
}
|
|
8754
|
-
Z.info(`listening on http://localhost:${
|
|
8755
|
-
port:
|
|
8756
|
-
ws: `ws://localhost:${
|
|
8755
|
+
Z.info(`listening on http://localhost:${C}`, {
|
|
8756
|
+
port: C,
|
|
8757
|
+
ws: `ws://localhost:${C}/ws`,
|
|
8757
8758
|
store: Y
|
|
8758
|
-
}),
|
|
8759
|
+
}), Se?.set({ phase: "ready" }), process.send?.({ type: el }), process.channel?.unref(), Y === "postgres" && Z.info("postgres change-data-capture", { enabled: (process.env.CDC ?? "1") !== "0" }), await Jo();
|
|
8759
8760
|
try {
|
|
8760
8761
|
await jt({
|
|
8761
|
-
id:
|
|
8762
|
-
name:
|
|
8762
|
+
id: ie,
|
|
8763
|
+
name: re,
|
|
8763
8764
|
kind: "api",
|
|
8764
|
-
url: `http://localhost:${
|
|
8765
|
+
url: `http://localhost:${C}`,
|
|
8765
8766
|
pid: process.pid,
|
|
8766
8767
|
status: "live",
|
|
8767
|
-
logFile:
|
|
8768
|
+
logFile: ue.path
|
|
8768
8769
|
});
|
|
8769
|
-
let e =
|
|
8770
|
+
let e = d(n);
|
|
8770
8771
|
if (e) {
|
|
8771
|
-
let t = await
|
|
8772
|
+
let t = await u({ dashboardAppPath: e });
|
|
8772
8773
|
t.status === "launched" ? Z.info(`dashboard launched at http://localhost:${t.port}`, { port: t.port }) : t.status === "already-running" && Z.debug(`dashboard already running on :${t.port}`, { port: t.port });
|
|
8773
8774
|
}
|
|
8774
8775
|
setInterval(() => {
|
|
8775
8776
|
jt({
|
|
8776
|
-
id:
|
|
8777
|
-
name:
|
|
8777
|
+
id: ie,
|
|
8778
|
+
name: re,
|
|
8778
8779
|
kind: "api",
|
|
8779
|
-
url: `http://localhost:${
|
|
8780
|
+
url: `http://localhost:${C}`,
|
|
8780
8781
|
pid: process.pid,
|
|
8781
8782
|
status: "live",
|
|
8782
|
-
logFile:
|
|
8783
|
+
logFile: ue.path
|
|
8783
8784
|
}).catch(() => {});
|
|
8784
8785
|
}, 1e4).unref();
|
|
8785
8786
|
let t = async () => {
|
|
8786
8787
|
Wt.deactivate();
|
|
8787
8788
|
for (let e of vr) e.stop();
|
|
8788
|
-
pr?.dispose(), Mt(
|
|
8789
|
+
pr?.dispose(), Mt(ie), ue.dispose(), Kr(), Ar?.close(), await mi();
|
|
8789
8790
|
};
|
|
8790
8791
|
W(t);
|
|
8791
8792
|
let r = process.ppid;
|
|
@@ -8798,7 +8799,7 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8798
8799
|
} catch (e) {
|
|
8799
8800
|
Z.warn("runtime-registry write failed", {}, e);
|
|
8800
8801
|
}
|
|
8801
|
-
return
|
|
8802
|
+
return v(e, Z, {
|
|
8802
8803
|
root: n,
|
|
8803
8804
|
onBeforeRestart: () => {
|
|
8804
8805
|
try {
|
|
@@ -8807,12 +8808,12 @@ ${r.join("\n")}\n A consumer with no producer waits forever and looks exactly l
|
|
|
8807
8808
|
Xc.close();
|
|
8808
8809
|
}
|
|
8809
8810
|
}), Xt({
|
|
8810
|
-
app:
|
|
8811
|
+
app: re,
|
|
8811
8812
|
kind: "api",
|
|
8812
|
-
url: `http://localhost:${
|
|
8813
|
+
url: `http://localhost:${C}`,
|
|
8813
8814
|
extras: [{
|
|
8814
8815
|
label: "WS",
|
|
8815
|
-
url: `ws://localhost:${
|
|
8816
|
+
url: `ws://localhost:${C}/ws`
|
|
8816
8817
|
}],
|
|
8817
8818
|
bootMs: Date.now() - g
|
|
8818
8819
|
}), new Promise(() => {});
|