@voltro/cli 0.57.0 → 0.58.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 +201 -0
- package/dist/apiBuild-CDE4NXNi.js +2 -0
- package/dist/{apiBuild-DDr2aNFd.js → apiBuild-CkpsCqIu.js} +2 -2
- package/dist/bin.js +1 -1
- package/dist/build-51qBWfYY.js +981 -0
- package/dist/{checkCommand-BISqx1OJ.js → checkCommand-C1EbNmwl.js} +1 -1
- package/dist/{checkCommand-DUtMWjcR.js → checkCommand-C30J2F18.js} +3 -3
- package/dist/{codegenCommand-DnVuDxwT.js → codegenCommand-kS3Twuc9.js} +7 -7
- package/dist/{codemodRunner-BlQPfjzA.js → codemodRunner-BKjCwGiN.js} +1127 -895
- package/dist/{commands-CRbxgxv0.js → commands-DowWkYtd.js} +21 -21
- package/dist/{dashboardCommand-Bf_-Ne3P.js → dashboardCommand-gG1y4PFG.js} +5 -5
- package/dist/{dataCommand-BoBJJ-Gb.js → dataCommand-hNOGKz4K.js} +6 -6
- package/dist/{dev-DOEJXicj.js → dev-Ce2gEziv.js} +2422 -2419
- package/dist/dev-Dff_pdik.js +3 -0
- package/dist/{doctorCommand-BrWu67JZ.js → doctorCommand-5ULMpL10.js} +505 -284
- package/dist/doctorCommand-B8H2MYCE.js +2 -0
- package/dist/{dormancyCommand-xn2y-pJm.js → dormancyCommand-DYgI0Kf-.js} +3 -3
- package/dist/{embeddingsCommand-Cn5MbRDM.js → embeddingsCommand-yJivQSrI.js} +2 -2
- package/dist/{envCommand-UJmJIbs9.js → envCommand-ORJUf8r_.js} +8 -8
- package/dist/{evolveCommand-Db30twUy.js → evolveCommand-DTawtTxf.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{infoCommand-BjVXpMlP.js → infoCommand-BFksHunl.js} +1 -1
- package/dist/inspect-CZvsmp8t.js +2 -0
- package/dist/{inspect-DZnan87F.js → inspect-PcC5J-Dl.js} +6 -7
- package/dist/manifestBuild-AUh31bFU.js +2 -0
- package/dist/{manifestBuild-DnbFKF6w.js → manifestBuild-BwiS4iYm.js} +1 -1
- package/dist/{probeCommand-C5fuN6Z2.js → probeCommand-BUYzc0CT.js} +1 -1
- package/dist/{runtimeTrace-BQL_lfz6.js → runtimeTrace-BUk5zMXY.js} +1 -1
- package/dist/{sdkgen-CMUPrDjH.js → sdkgen-CAhmmbjx.js} +1 -1
- package/dist/serveCommand-BUXUtSF5.js +2 -0
- package/dist/{serveCommand-B_w-Mpb_.js → serveCommand-DhtC7WBq.js} +726 -725
- package/dist/serveEntry.js +1 -1
- package/dist/{start-s25GAIgn.js → start-C75w6ftA.js} +1 -1
- package/dist/{start-YaUehtDV.js → start-DNtIlBcn.js} +641 -609
- package/dist/startEntry.js +1 -1
- package/dist/{updateCommand-C9n_Z_oG.js → updateCommand-CtuD5r1t.js} +1 -1
- package/dist/updateCommand-eVKVHj3N.js +2 -0
- package/dist/webDev-Bzb8ZFus.js +2 -0
- package/dist/{webDev-BgdkyjP6.js → webDev-CBN9KkyQ.js} +154 -146
- package/dist/{webhooksCommand-CYXTNvXq.js → webhooksCommand-BPJQOGTe.js} +1 -1
- package/package.json +61 -19
- package/templates/AGENTS.md +1 -1
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/_manifest.json +1 -1
- package/templates/agent-docs/ai.md +174 -0
- package/templates/agent-docs/authentication.md +34 -0
- package/templates/agent-docs/data.md +30 -0
- package/templates/agent-docs/database/transactions.md +48 -0
- package/templates/agent-docs/observability.md +13 -2
- package/templates/agent-docs/plugins/auth-supabase.md +21 -0
- package/templates/agent-docs/plugins/sentry.md +91 -8
- package/templates/agent-docs/schema-driven-ui.md +29 -0
- package/templates/agent-docs/whats-new.md +112 -105
- package/templates/apps/api-ai/package.json +6 -6
- 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 +9 -9
- 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-row-history/package.json +8 -8
- 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-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +7 -7
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +7 -7
- package/templates/apps/frontend-app/package.json +8 -8
- package/templates/apps/frontend-auth/package.json +7 -7
- package/templates/apps/frontend-blank/package.json +6 -6
- package/templates/apps/frontend-cms/package.json +8 -8
- package/templates/apps/frontend-collab/package.json +9 -9
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +6 -6
- package/templates/apps/frontend-docs/package.json +8 -8
- 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 +7 -7
- package/templates/apps/frontend-saas/package.json +7 -7
- package/templates/apps/frontend-spa/package.json +6 -6
- package/templates/apps/frontend-ssr/package.json +6 -6
- package/templates/apps/frontend-ssr-api/package.json +7 -7
- package/templates/apps/frontend-static-blog/package.json +8 -8
- package/templates/apps/frontend-status/package.json +7 -7
- package/templates/apps/mobile-app/package.json +4 -4
- package/dist/apiBuild-B83Cb2Rv.js +0 -2
- package/dist/build-QKP6Bm0J.js +0 -872
- package/dist/dev-Bl9HqtV7.js +0 -3
- package/dist/doctorCommand-DrQv9SL3.js +0 -2
- package/dist/inspect-B0hL41s0.js +0 -2
- package/dist/manifestBuild-UXrnUcXP.js +0 -2
- package/dist/serveCommand-Dtb48ffg.js +0 -2
- package/dist/updateCommand-DsXEAHbd.js +0 -2
- package/dist/webDev-B6ZMX42w.js +0 -2
|
@@ -4,31 +4,31 @@ import { r as n, t as r } from "./appModuleLoader-C9r9mxZt.js";
|
|
|
4
4
|
import { t as i } from "./bootRefusal-pgvDxlrU.js";
|
|
5
5
|
import { n as a, r as o } from "./startupRunner-CEqQq7ax.js";
|
|
6
6
|
import { n as s, t as c } from "./interruptedReplace-CwnkBb2X.js";
|
|
7
|
-
import { $ as l, $t as u, A as d,
|
|
8
|
-
import {
|
|
9
|
-
import { g as
|
|
10
|
-
import { n as
|
|
11
|
-
import { r as
|
|
12
|
-
import { r as
|
|
13
|
-
import { r as
|
|
14
|
-
import { i as
|
|
15
|
-
import { c as
|
|
16
|
-
import { f as
|
|
17
|
-
import { n as
|
|
18
|
-
import { C as
|
|
19
|
-
import { i as
|
|
20
|
-
import { n as
|
|
21
|
-
import { i as
|
|
22
|
-
import { t as
|
|
23
|
-
import { a as
|
|
24
|
-
import
|
|
25
|
-
import { createWriteStream as
|
|
26
|
-
import { pathToFileURL as
|
|
27
|
-
import { LoggerLayer as
|
|
28
|
-
import { AuthMiddleware as
|
|
29
|
-
import { DATA_TRANSFERS_TABLE as
|
|
30
|
-
import { appMode as
|
|
31
|
-
import { AggregateRegistry as
|
|
7
|
+
import { $ as l, $t as u, A as d, At as f, B as ee, Bn as te, Bt as p, C as ne, Cn as m, Ct as re, D as ie, Dn as h, Dt as ae, E as oe, En as se, Et as g, F as _, Fn as ce, Ft as le, G as ue, Gt as de, H as fe, Hn as pe, Ht as me, I as he, In as v, It as ge, Jt as y, K as _e, Kt as ve, L as ye, Lt as b, M as be, Mn as xe, Mt as Se, N as Ce, Nn as we, Nt as Te, O as Ee, On as De, Ot as Oe, P as ke, Pn as Ae, Pt as x, Q as S, Qt as je, R as Me, Rn as Ne, Rt as Pe, S as Fe, Sn as Ie, St as Le, T as Re, Tn as ze, Tt as Be, U as Ve, Un as He, Ut as Ue, Vn as We, Vt as Ge, W as Ke, Wt as qe, X as Je, Xt as Ye, Y as Xe, Z as Ze, _ as Qe, _n as $e, _t as et, a as tt, an as nt, at as C, b as rt, bn as it, bt as at, cn as ot, ct as w, d as st, dn as T, dt as E, en as ct, et as lt, f as ut, fn as dt, ft, g as pt, gn as D, gt as mt, h as ht, hn as gt, ht as _t, i as vt, in as yt, it as bt, j as xt, jn as St, jt as Ct, k as O, kn as k, kt as wt, l as Tt, ln as Et, lt as Dt, m as Ot, mn as kt, mt as At, nn as jt, nt as Mt, on as Nt, ot as Pt, pn as Ft, pt as It, qt as Lt, rn as Rt, rt as zt, s as A, sn as Bt, st as Vt, t as j, tn as Ht, tt as Ut, un as Wt, ut as Gt, v as Kt, vn as qt, vt as Jt, w as Yt, wn as Xt, wt as Zt, x as Qt, xn as $t, xt as M, y as en, yn as tn, yt as nn, z as rn, zn as an, zt as on } from "./dev-Ce2gEziv.js";
|
|
8
|
+
import { Yt as sn, en as cn, ft as ln, ht as un, lt as dn, mt as fn, pt as pn, qt as mn } from "./webDev-CBN9KkyQ.js";
|
|
9
|
+
import { g as hn, s as gn } from "./inspect-PcC5J-Dl.js";
|
|
10
|
+
import { n as _n } from "./cliArgs-D4p8n7EE.js";
|
|
11
|
+
import { r as vn } from "./appPort-B_HpJ_ck.js";
|
|
12
|
+
import { r as yn, u as bn } from "./apiBuild-CkpsCqIu.js";
|
|
13
|
+
import { r as xn } from "./dialectDriver-czCHYpeH.js";
|
|
14
|
+
import { i as Sn, n as Cn } from "./connectionConfig-Bk9IC7D0.js";
|
|
15
|
+
import { c as wn, n as Tn, o as En } from "./seedRunner-DISBKow-.js";
|
|
16
|
+
import { f as Dn, g as On, h as kn, m as An, r as jn } from "./frameworkTableAssembly-vfkzuzEo.js";
|
|
17
|
+
import { n as Mn, r as Nn, t as Pn } from "./declaredSchemaGates-BlcwObhb.js";
|
|
18
|
+
import { C as Fn, a as In, h as Ln, l as Rn, n as zn, u as Bn, w as Vn } from "./fileConventions-l-RIXbx8.js";
|
|
19
|
+
import { i as Hn, n as Un, t as Wn } from "./inspectMetrics-BY0Sjb2F.js";
|
|
20
|
+
import { n as Gn } from "./mssqlClusterPatch-_4cE_nun.js";
|
|
21
|
+
import { i as Kn, n as qn, r as Jn, t as Yn } from "./webhookDiscovery-CphsQe59.js";
|
|
22
|
+
import { t as Xn } from "./bootTiming-BdyP9nYw.js";
|
|
23
|
+
import { a as Zn, o as Qn, t as $n } from "./dataProfile-Du3ztYxv.js";
|
|
24
|
+
import N, { basename as er, join as tr } from "node:path";
|
|
25
|
+
import { createWriteStream as nr, existsSync as rr } from "node:fs";
|
|
26
|
+
import { pathToFileURL as ir } from "node:url";
|
|
27
|
+
import { LoggerLayer as ar, createLogger as P } from "@voltro/logger";
|
|
28
|
+
import { AuthMiddleware as or, ConnectionInfoMiddleware as F, actionToRpc as I, anonymousSubject as sr, isWireReachable as cr, mutationToRpc as lr, queryToRpc as L, streamToRpc as ur, wireErrorUnion as dr, workflowCancelDescriptor as fr, workflowDomainEventsQueryDescriptor as pr, workflowEventDeliveriesQueryDescriptor as mr, workflowResumeDescriptor as hr, workflowRunEventsQueryDescriptor as gr, workflowRunQueryDescriptor as R, workflowRunStepsQueryDescriptor as _r, workflowRunsQueryDescriptor as vr, workflowSignalDescriptor as z, workflowUpdateDescriptor as yr } from "@voltro/protocol";
|
|
29
|
+
import { DATA_TRANSFERS_TABLE as B, _voltroDataTransfersTable as br, allRegisteredTables as xr, and as Sr, connectionIdentity as Cr, derivedRowId as wr, describeTransferRun as Tr, ensureTableRegistered as Er, eq as V, or as Dr } from "@voltro/database";
|
|
30
|
+
import { appMode as Or, frameworkVersion as kr, instanceId as Ar, replicaId as jr, resolveAdvertisedHost as Mr, setProcessAdvertisedAddress as Nr, setProcessBootPath as Pr } from "@voltro/protocol/identity";
|
|
31
|
+
import { AggregateRegistry as Fr, CostRegistry as H, DORMANCY_WAKEUP_TENANT as Ir, Dispatcher as Lr, ExpectationRegistry as Rr, ExperimentRegistry as zr, apiKeyManagementRoutes as Br, attachAnalyticsMirror as Vr, attachExpectations as Hr, attachExperiments as Ur, attachFinops as Wr, awaitServerListening as Gr, bindMutation as U, bindStream as Kr, bindSubscription as W, buildTracingLayer as qr, cancelWakeup as Jr, compileCron as Yr, dataStoreApiKeyStore as Xr, formatServerOnlyLeaks as Zr, formatUnresolvedSources as Qr, frameworkApiKeyStrategy as $r, getResourcePolicy as ei, installPolicyGuardResolver as ti, loadResourceTuples as ni, makeActionRunner as ri, makeAdvisoryLockCoordinator as ii, makeApiKeyService as ai, makeApiKeyUsageBuffer as oi, makeApiKeyUsageFlusher as si, makeAsyncKv as ci, makeAuthMiddlewareLayers as li, makeBufferingSpanProcessor as ui, makeCoordinatedScheduler as di, makeEffectStoreLayer as fi, makeLazyWorkflowFacade as pi, makeMutationOutputCodec as mi, makeMutationRunner as hi, makeOneShotQueryRunner as gi, makeQueryDescriptorProducer as _i, makeQueryFinalizer as vi, makeQueryReauthorizer as yi, makeQuerySubscriber as bi, makeSchemaRegistry as xi, makeWorkflowFacade as Si, makeWorkflowFacadeWithCallerContext as Ci, makeWorkflowLayers as wi, noopKv as Ti, onProcessShutdown as G, recordSubscriptionDelivery as K, recordWorkflowRun as Ei, registerDefaultTupleSource as Di, registerWakeup as Oi, resolveSecretsBackend as ki, runProvidedEffect as Ai, setSecretsBackend as ji, setSystemStoreHandle as Mi, shutdownGraceMsFromEnv as Ni, singleCoordinator as Pi, startRpcServer as Fi, startScheduler as q, stripForbiddenForWire as Ii, undoCaptureEnabled as Li, unresolvedSources as Ri, withScopedRequest as zi, workflowToRpc as Bi, wrapStoreWithBootCodec as Vi } from "@voltro/runtime";
|
|
32
32
|
import { assertProductionSessionSecret as Hi } from "@voltro/protocol/session";
|
|
33
33
|
import { Cause as Ui, Effect as J, Layer as Y, ManagedRuntime as Wi } from "effect";
|
|
34
34
|
import { SqlClient as Gi } from "@effect/sql";
|
|
@@ -110,7 +110,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
110
110
|
if (!t || t.length < 16) return Z(503, { error: "data transfer misconfigured (no/weak secret)" });
|
|
111
111
|
let r = Ra(e.headers);
|
|
112
112
|
return !r || !za(r, t) ? Z(401, { error: "unauthorized" }) : null;
|
|
113
|
-
}, Va = /^[A-Za-z0-9_-]{8,64}$/, Ha = (e) => Va.test(e), Ua = () => process.env.VOLTRO_IMPORT_UPLOAD_DIR ??
|
|
113
|
+
}, Va = /^[A-Za-z0-9_-]{8,64}$/, Ha = (e) => Va.test(e), Ua = () => process.env.VOLTRO_IMPORT_UPLOAD_DIR ?? N.join(Xi.tmpdir(), "voltro-import-uploads"), Wa = (e) => N.join(Ua(), e), Ga = (e) => N.join(Wa(e), "archive.bin"), Ka = (e) => N.join(Wa(e), "meta.json"), qa = async (e = Date.now()) => {
|
|
114
114
|
let t = 0;
|
|
115
115
|
try {
|
|
116
116
|
for (let n of await X.readdir(Ua())) {
|
|
@@ -193,7 +193,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
return await new Promise((t, n) => {
|
|
196
|
-
let r =
|
|
196
|
+
let r = nr(Ga(e.id), { flags: "a" });
|
|
197
197
|
r.on("error", n), r.on("finish", () => t()), r.end(Buffer.from(e.bytes));
|
|
198
198
|
}), { total: t.bytes + e.bytes.byteLength };
|
|
199
199
|
}, no = async (e) => {
|
|
@@ -202,7 +202,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
202
202
|
path: Ga(e),
|
|
203
203
|
bytes: t.size
|
|
204
204
|
};
|
|
205
|
-
}, ro = () =>
|
|
205
|
+
}, ro = () => N.join(Ua(), ".runs"), io = (e) => N.join(ro(), `${e}.bin`), ao = async (e, t) => {
|
|
206
206
|
if (!Ha(e)) return null;
|
|
207
207
|
let n = Ga(e), r = await X.stat(n).catch(() => null);
|
|
208
208
|
if (r === null || r.size === 0) return null;
|
|
@@ -211,7 +211,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
211
211
|
return await X.rename(n, i), i;
|
|
212
212
|
}, oo = async (e) => {
|
|
213
213
|
await X.rm(io(e), { force: !0 }).catch(() => void 0);
|
|
214
|
-
}, Q =
|
|
214
|
+
}, Q = P({ scope: "voltro:admin-import" }), so = "VBUNDLE2", co = (e) => {
|
|
215
215
|
let t = e.req.headers["x-import-rollback-key"];
|
|
216
216
|
if (e.mode !== "replace") return { options: {} };
|
|
217
217
|
if (typeof t != "string" || t.length === 0) return Q.warn("admin.import: no rollback capture — this run empties the target first, and nothing was asked to be kept. Send `x-import-rollback-key: <storage key>` (voltro data import --rollback-key <key>) to have the instance store the target's current rows before deleting them."), { options: {} };
|
|
@@ -222,7 +222,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
222
222
|
hint: "A capture written to the pod would not survive the failure it exists for. Configure storage (the same one the storage-push export uses), or re-send without `x-import-rollback-key` to accept that a run which does not finish can leave the target emptied. Note that CONFIGURED is not the same question as SURVIVES: a `filesystem` provider pointed at a container directory with no volume behind it passes this check and dies with the pod. The run says so when it can observe it — the capture path being on the same filesystem as `/`."
|
|
223
223
|
})
|
|
224
224
|
};
|
|
225
|
-
let n =
|
|
225
|
+
let n = tr(Zi(), `voltro-rollback-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`), r = e.deps.putArchive;
|
|
226
226
|
return {
|
|
227
227
|
key: t,
|
|
228
228
|
options: {
|
|
@@ -389,10 +389,10 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
389
389
|
}
|
|
390
390
|
let o = typeof a.bundleKey == "string" && a.bundleKey !== "" ? eo(a.bundleKey) : typeof a.uploadId == "string" ? a.uploadId : "";
|
|
391
391
|
if (!Ha(o)) return Z(400, { error: "start needs { uploadId } from an upload, or { bundleKey } for the storage transport" });
|
|
392
|
-
let s =
|
|
392
|
+
let s = wr("dimp", `${o}-${Date.now()}-${Math.random()}`), c = await Za(o, s);
|
|
393
393
|
if (c !== s) {
|
|
394
|
-
let t = await
|
|
395
|
-
if (
|
|
394
|
+
let t = await Zn(e.store, c);
|
|
395
|
+
if (Qn(t) === void 0 && t !== null) return Q.info("admin.import start: already running", {
|
|
396
396
|
uploadId: o,
|
|
397
397
|
runId: c
|
|
398
398
|
}), Z(202, {
|
|
@@ -403,7 +403,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
403
403
|
Q.info("admin.import start: taking over a claim whose run is not running", {
|
|
404
404
|
uploadId: o,
|
|
405
405
|
staleRunId: c,
|
|
406
|
-
outcome:
|
|
406
|
+
outcome: Qn(t) ?? "no record"
|
|
407
407
|
}), c = await Za(o, s, { takeOver: !0 });
|
|
408
408
|
}
|
|
409
409
|
let l = async (e) => (await Qa(o).catch(() => void 0), e), u = await uo(e, {
|
|
@@ -486,7 +486,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
486
486
|
}))
|
|
487
487
|
})) }), vo = async (e, t) => {
|
|
488
488
|
try {
|
|
489
|
-
return
|
|
489
|
+
return Er(br), await e.insert(B, {
|
|
490
490
|
id: t.runId,
|
|
491
491
|
direction: "import",
|
|
492
492
|
startedAt: /* @__PURE__ */ new Date(),
|
|
@@ -512,7 +512,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
512
512
|
runId: a,
|
|
513
513
|
transport: i.transport,
|
|
514
514
|
error: n
|
|
515
|
-
}), e.traced && await t.store.update(
|
|
515
|
+
}), e.traced && await t.store.update(B, a, {
|
|
516
516
|
failure: n,
|
|
517
517
|
finishedAt: null
|
|
518
518
|
}).then(() => void 0, () => void 0);
|
|
@@ -569,7 +569,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
569
569
|
force: !0
|
|
570
570
|
}).catch(() => void 0), await oo(a).catch(() => void 0), await Qa(i.uploadId).catch(() => void 0);
|
|
571
571
|
}
|
|
572
|
-
}, bo = /^[A-Za-z0-9_-]{8,64}$/, xo = (e) => bo.test(e), So = () => process.env.VOLTRO_EXPORT_ARTIFACT_DIR ??
|
|
572
|
+
}, bo = /^[A-Za-z0-9_-]{8,64}$/, xo = (e) => bo.test(e), So = () => process.env.VOLTRO_EXPORT_ARTIFACT_DIR ?? N.join(Xi.tmpdir(), "voltro-export-artifacts"), Co = (e) => N.join(So(), e), wo = (e) => N.join(Co(e), "archive.bin"), To = async (e = Date.now()) => {
|
|
573
573
|
let t = 0;
|
|
574
574
|
try {
|
|
575
575
|
for (let n of await X.readdir(So())) {
|
|
@@ -621,7 +621,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
621
621
|
recursive: !0,
|
|
622
622
|
force: !0
|
|
623
623
|
}).catch(() => void 0);
|
|
624
|
-
}, Ao =
|
|
624
|
+
}, Ao = P({ scope: "voltro:admin-export" }), jo = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], Mo = (e) => {
|
|
625
625
|
if (typeof e.tenant == "string" && e.tenant) return {
|
|
626
626
|
kind: "tenant",
|
|
627
627
|
tenantId: e.tenant
|
|
@@ -656,7 +656,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
let a = r.consistency === "snapshot" ? "snapshot" : i.consistency ?? "live", o = (typeof r.compression == "string" ? r.compression : void 0) ?? i.compression, s = i.scope ?? Mo(r), c = typeof r.bundleKey == "string" && r.bundleKey.length > 0, l = r.assets === !0 && e.assetSource ? { blobs: e.assetSource } : {}, u =
|
|
659
|
+
let a = r.consistency === "snapshot" ? "snapshot" : i.consistency ?? "live", o = (typeof r.compression == "string" ? r.compression : void 0) ?? i.compression, s = i.scope ?? Mo(r), c = typeof r.bundleKey == "string" && r.bundleKey.length > 0, l = r.assets === !0 && e.assetSource ? { blobs: e.assetSource } : {}, u = wr("dexp", `${Date.now()}-${Math.random()}`), d = await Po(e.store, {
|
|
660
660
|
runId: u,
|
|
661
661
|
mode: i.subset ? "subset" : s.kind,
|
|
662
662
|
bundle: c ? String(r.bundleKey) : null
|
|
@@ -684,7 +684,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
684
684
|
});
|
|
685
685
|
}, Po = async (e, t) => {
|
|
686
686
|
try {
|
|
687
|
-
return
|
|
687
|
+
return Er(br), await e.insert(B, {
|
|
688
688
|
id: t.runId,
|
|
689
689
|
direction: "export",
|
|
690
690
|
startedAt: /* @__PURE__ */ new Date(),
|
|
@@ -706,7 +706,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
706
706
|
}
|
|
707
707
|
}, Fo = async (e) => {
|
|
708
708
|
let { deps: t, runId: n } = e, r = await import("node:os"), i = await import("node:fs/promises"), a = await import("node:path"), o = await i.mkdtemp(a.join(r.tmpdir(), "voltro-admin-export-")), s = async (r) => {
|
|
709
|
-
e.recorded && await t.store.update(
|
|
709
|
+
e.recorded && await t.store.update(B, n, r).then(() => void 0, () => void 0);
|
|
710
710
|
};
|
|
711
711
|
try {
|
|
712
712
|
let r = await J.runPromise(Ca({
|
|
@@ -782,7 +782,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
784
|
}, Lo = 8388608, Ro = 33554432, zo = async (e, t) => await e.query({
|
|
785
|
-
table:
|
|
785
|
+
table: B,
|
|
786
786
|
order: [{
|
|
787
787
|
column: "startedAt",
|
|
788
788
|
direction: "desc"
|
|
@@ -807,7 +807,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
807
807
|
} catch (e) {
|
|
808
808
|
return Z(409, {
|
|
809
809
|
error: "no import history",
|
|
810
|
-
message: `this instance has no \`${
|
|
810
|
+
message: `this instance has no \`${B}\` table, so no import has been recorded. Run \`voltro db apply\` against it; imports themselves are unaffected.`,
|
|
811
811
|
detail: e?.message ?? String(e)
|
|
812
812
|
});
|
|
813
813
|
}
|
|
@@ -826,7 +826,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
826
826
|
direction: e.direction,
|
|
827
827
|
failure: e.failure,
|
|
828
828
|
staged: e.staged,
|
|
829
|
-
line:
|
|
829
|
+
line: Tr(e)
|
|
830
830
|
}))
|
|
831
831
|
});
|
|
832
832
|
}, Uo = (e, t, n = {}) => (async function* () {
|
|
@@ -849,14 +849,14 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
849
849
|
invalidateTag: async () => 0,
|
|
850
850
|
wrap: async (e, t, n) => n()
|
|
851
851
|
}, Go = async (e) => {
|
|
852
|
-
|
|
852
|
+
y(e.appProcedures ?? e.discovered, {
|
|
853
853
|
defaultDeny: e.security?.defaultDeny ?? !0,
|
|
854
854
|
commandHint: "`voltro serve`"
|
|
855
855
|
}), Mi({
|
|
856
856
|
dataStore: e.store,
|
|
857
857
|
schemaRegistry: e.schemaRegistry
|
|
858
858
|
});
|
|
859
|
-
let t = (e.discovered.budgets?.length ?? 0) > 0, n, r = new
|
|
859
|
+
let t = (e.discovered.budgets?.length ?? 0) > 0, n, r = new Lr({
|
|
860
860
|
crdtColumnsOf: (t) => e.schemaRegistry.crdtColumns(t),
|
|
861
861
|
store: e.store,
|
|
862
862
|
...e.snapshotCache ? { cache: e.snapshotCache } : {},
|
|
@@ -868,43 +868,43 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
868
868
|
durationMs: e.durationMs,
|
|
869
869
|
rowCount: e.rowCount
|
|
870
870
|
})
|
|
871
|
-
}), i = e.cache ?? Wo, a = e.kv ?? Ti, o, s = () => void 0, c,
|
|
871
|
+
}), i = e.cache ?? Wo, a = e.kv ?? Ti, o, s = () => void 0, c, u, d, ee, te, ne, m, re = P({ scope: "voltro:workflow" }), ie = P({ scope: "voltro:schedule" }), h = ct({
|
|
872
872
|
store: e.store,
|
|
873
873
|
warn: (e, t) => re.warn(e, t)
|
|
874
|
-
}),
|
|
874
|
+
}), ae = h.remember, oe = h.resolve, se = Ht({
|
|
875
875
|
authority: e.authority,
|
|
876
876
|
getStore: () => e.store
|
|
877
|
-
}),
|
|
878
|
-
if (
|
|
877
|
+
}), g = (e.discovered.workflows?.length ?? 0) > 0 ? pi(() => o) : void 0, ce = (e.discovered.workflows?.length ?? 0) > 0 || (e.discovered.eventTriggers?.length ?? 0) > 0, ue = ce || (e.discovered.workflowWorkers?.length ?? 0) > 0 || e.scheduleCoordination === "cluster", de = e.tenantIsolation === "namespace", fe = (e.log ?? P({ scope: "voltro:serve" })).child("webhooks"), pe, me, v = e.discovered.webhooks;
|
|
878
|
+
if (v && v.outgoing.length > 0 && e.workflowEngineLayer !== void 0) {
|
|
879
879
|
e.workflowEngineLayer;
|
|
880
|
-
let t =
|
|
880
|
+
let t = $t({
|
|
881
881
|
store: e.store,
|
|
882
882
|
schemaRegistry: e.schemaRegistry,
|
|
883
883
|
cache: i,
|
|
884
884
|
kv: a
|
|
885
|
-
}), n =
|
|
886
|
-
|
|
887
|
-
let t =
|
|
885
|
+
}), n = v.outgoing.map((e) => e.descriptor);
|
|
886
|
+
me = pa.toLayer(ua(t, { events: n })), pe = da(t, async (e) => {
|
|
887
|
+
let t = d;
|
|
888
888
|
if (t === void 0) {
|
|
889
|
-
|
|
889
|
+
fe.error("webhook delivery skipped — the workflow runtime was never built. This is a framework defect, not a configuration problem: report it with your engine setting. Deliveries are NOT queued and will not be retried.", {
|
|
890
890
|
deliveryId: e.deliveryId,
|
|
891
891
|
targetId: e.targetId
|
|
892
892
|
});
|
|
893
893
|
return;
|
|
894
894
|
}
|
|
895
895
|
t.runPromise(pa.execute(e)).catch((t) => {
|
|
896
|
-
|
|
896
|
+
fe.error("deliverWebhook workflow crashed", {
|
|
897
897
|
deliveryId: e.deliveryId,
|
|
898
898
|
targetId: e.targetId
|
|
899
899
|
}, t);
|
|
900
900
|
});
|
|
901
901
|
}, { events: n });
|
|
902
902
|
}
|
|
903
|
-
let
|
|
904
|
-
if (
|
|
903
|
+
let ge = /* @__PURE__ */ new Map();
|
|
904
|
+
if (v) for (let e of v.incoming) {
|
|
905
905
|
let t = e.descriptor.path ?? fa(e.descriptor.id), n = `VOLTRO_WEBHOOK_SECRET_${e.descriptor.id.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, r = ha(e.descriptor, {
|
|
906
906
|
resolveSecret: async () => process.env[n] ?? null,
|
|
907
|
-
resolveWorkflows: () =>
|
|
907
|
+
resolveWorkflows: () => g === void 0 ? void 0 : Ci(g, {
|
|
908
908
|
traceId: `incoming:${e.descriptor.id}`,
|
|
909
909
|
source: `incoming:${e.descriptor.id}`
|
|
910
910
|
}),
|
|
@@ -916,34 +916,34 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
916
916
|
idempotency: e.idempotency,
|
|
917
917
|
durationMs: e.durationMs
|
|
918
918
|
};
|
|
919
|
-
e.status >= 500 ?
|
|
919
|
+
e.status >= 500 ? fe.error("incoming delivery failed", t) : e.status >= 400 ? fe.warn("incoming delivery rejected", t) : fe.info("incoming delivery handled", t);
|
|
920
920
|
}
|
|
921
921
|
});
|
|
922
|
-
|
|
922
|
+
ge.set(t, { handle: r });
|
|
923
923
|
}
|
|
924
|
-
ti(), Di((t) => ni(e.store, t.subjectId, t.resourceType, t.resourceId)) ||
|
|
925
|
-
let
|
|
924
|
+
ti(), Di((t) => ni(e.store, t.subjectId, t.resourceType, t.resourceId)) || P({ scope: "voltro:serve" }).info("policy guards: using the app-registered tuple source");
|
|
925
|
+
let _e = [], ve = [...e.discovered.outboxHandlers ?? [], ...qn((v?.outgoing.length ?? 0) + (v?.incoming.length ?? 0) + (v?.providers.length ?? 0), []) ? [{
|
|
926
926
|
file: "<framework>/webhooks",
|
|
927
927
|
id: "voltro-webhook-emit",
|
|
928
|
-
definition: ma(() =>
|
|
929
|
-
}] : []],
|
|
930
|
-
handlers:
|
|
928
|
+
definition: ma(() => pe)
|
|
929
|
+
}] : []], ye = ve.length > 0 ? Nt({
|
|
930
|
+
handlers: ve,
|
|
931
931
|
store: e.store,
|
|
932
|
-
log: (e.log ??
|
|
932
|
+
log: (e.log ?? P({ scope: "voltro:serve" })).child("outbox"),
|
|
933
933
|
onChange: (t) => e.store.onChange((e) => t({
|
|
934
934
|
table: e.table,
|
|
935
935
|
op: e.op
|
|
936
936
|
})),
|
|
937
937
|
onShutdown: (e) => {
|
|
938
|
-
|
|
938
|
+
_e.push(e);
|
|
939
939
|
}
|
|
940
|
-
}) : void 0, b =
|
|
940
|
+
}) : void 0, b = Rt({
|
|
941
941
|
definitions: (e.discovered.connections ?? []).map((e) => e.definition),
|
|
942
942
|
store: e.store,
|
|
943
|
-
publicUrl:
|
|
944
|
-
log: (e.log ??
|
|
943
|
+
publicUrl: jt(e.port ?? 4e3),
|
|
944
|
+
log: (e.log ?? P({ scope: "voltro:serve" })).child("connections")
|
|
945
945
|
});
|
|
946
|
-
|
|
946
|
+
ke({
|
|
947
947
|
events: e.discovered.events ?? [],
|
|
948
948
|
rpcTags: [
|
|
949
949
|
...e.discovered.queries.map((e) => e.descriptor.name),
|
|
@@ -952,136 +952,136 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
952
952
|
...(e.discovered.streams ?? []).map((e) => e.descriptor.name)
|
|
953
953
|
]
|
|
954
954
|
});
|
|
955
|
-
let
|
|
956
|
-
instanceId:
|
|
957
|
-
namespace:
|
|
955
|
+
let be = (e.log ?? P({ scope: "voltro:serve" })).child("events"), xe = e.broadcastNamespace ?? en(e.plugins, void 0), Se = rt(e.plugins, xe, be), Ce = e.membership?.instanceId ?? jr(), we = Ar(), Te = e.membership ?? Qt(e.plugins, {
|
|
956
|
+
instanceId: Ce,
|
|
957
|
+
namespace: xe,
|
|
958
958
|
meta: { mode: "serve" },
|
|
959
|
-
logger:
|
|
960
|
-
}),
|
|
959
|
+
logger: be
|
|
960
|
+
}), Ee = _({
|
|
961
961
|
events: e.discovered.events ?? [],
|
|
962
|
-
origin:
|
|
963
|
-
...
|
|
964
|
-
}),
|
|
962
|
+
origin: we,
|
|
963
|
+
...Se.publishRemote === void 0 ? {} : { publishRemote: Se.publishRemote }
|
|
964
|
+
}), De = (e.discovered.events ?? []).length > 0 ? await Se.attach(Ee.bus) : null, je = it({
|
|
965
965
|
store: e.store,
|
|
966
966
|
schemaRegistry: e.schemaRegistry,
|
|
967
967
|
cache: i,
|
|
968
968
|
kv: a,
|
|
969
|
-
...
|
|
970
|
-
...
|
|
969
|
+
...pe === void 0 ? {} : { webhooksService: pe },
|
|
970
|
+
...g === void 0 ? {} : { workflowsProxy: g },
|
|
971
971
|
eventTriggers: e.discovered.eventTriggers ?? [],
|
|
972
|
-
namespaceIsolationOn:
|
|
972
|
+
namespaceIsolationOn: de,
|
|
973
973
|
...e.ensureTenantProvisioned === void 0 ? {} : { ensureTenantProvisioned: e.ensureTenantProvisioned },
|
|
974
974
|
...e.resolveResidentStore === void 0 ? {} : { resolveResidentStore: e.resolveResidentStore },
|
|
975
|
-
...
|
|
975
|
+
...ye === void 0 ? {} : { outbox: { nudge: ye.nudge } },
|
|
976
976
|
...b.active ? { connections: { registry: b.registry } } : {},
|
|
977
|
-
eventBus:
|
|
978
|
-
}),
|
|
977
|
+
eventBus: Ee.bus
|
|
978
|
+
}), Me = Y.succeed(Fr, le), Ne = Y.succeed(Rr, wt), Pe = Y.succeed(H, Oe), Fe = Y.succeed(zr, f), Ie = (t, n) => {
|
|
979
979
|
let r = t.pipe(J.provide(fi(n)));
|
|
980
|
-
return (e.baseLayer ? r.pipe(J.provide(e.baseLayer)) : r).pipe(J.provide(
|
|
981
|
-
},
|
|
982
|
-
let n =
|
|
980
|
+
return (e.baseLayer ? r.pipe(J.provide(e.baseLayer)) : r).pipe(J.provide(Me)).pipe(J.provide(Ne)).pipe(J.provide(Pe)).pipe(J.provide(Fe));
|
|
981
|
+
}, Le = (e, t) => {
|
|
982
|
+
let n = Ie(e, t);
|
|
983
983
|
return Ai(n);
|
|
984
|
-
},
|
|
984
|
+
}, Re = Wn(), ze = Mt(e.plugins ?? [], Re), Be = Xe({
|
|
985
985
|
plugins: e.plugins ?? [],
|
|
986
|
-
metrics:
|
|
987
|
-
log: e.log ??
|
|
988
|
-
}),
|
|
986
|
+
metrics: Re,
|
|
987
|
+
log: e.log ?? P({ scope: "voltro:serve" })
|
|
988
|
+
}), He = lt(e.plugins ?? [], Re), We = e.security?.defaultDeny ?? !0, Ge = hi({
|
|
989
989
|
store: e.store,
|
|
990
|
-
defaultDeny:
|
|
990
|
+
defaultDeny: We,
|
|
991
991
|
recordMetric: (e) => {
|
|
992
|
-
|
|
992
|
+
Re.record(e);
|
|
993
993
|
},
|
|
994
|
-
...
|
|
995
|
-
buildContext: (e, t, n) =>
|
|
996
|
-
runEffect:
|
|
997
|
-
undoCapture:
|
|
998
|
-
}),
|
|
994
|
+
...ze.mutation === void 0 ? {} : { interceptor: ze.mutation },
|
|
995
|
+
buildContext: (e, t, n) => je(e, t, n),
|
|
996
|
+
runEffect: Le,
|
|
997
|
+
undoCapture: w((t) => e.schemaRegistry.crdtColumns(t))
|
|
998
|
+
}), Ye = Vt();
|
|
999
999
|
{
|
|
1000
|
-
let t =
|
|
1001
|
-
t !== void 0 && (e.log ??
|
|
1000
|
+
let t = Dt();
|
|
1001
|
+
t !== void 0 && (e.log ?? P({ scope: "voltro:serve" })).info(t);
|
|
1002
1002
|
}
|
|
1003
|
-
let
|
|
1003
|
+
let Qe = Pt({
|
|
1004
1004
|
store: e.store,
|
|
1005
1005
|
...e.approvals === void 0 ? {} : { defaultExpiryMs: e.approvals.defaultExpiryMs }
|
|
1006
|
-
}),
|
|
1007
|
-
defaultDeny:
|
|
1008
|
-
buildContext: (e) =>
|
|
1009
|
-
runEffect:
|
|
1006
|
+
}), $e = ri({
|
|
1007
|
+
defaultDeny: We,
|
|
1008
|
+
buildContext: (e) => je(e),
|
|
1009
|
+
runEffect: Le,
|
|
1010
1010
|
recordMetric: (e) => {
|
|
1011
|
-
|
|
1011
|
+
Re.record(e);
|
|
1012
1012
|
},
|
|
1013
|
-
...
|
|
1014
|
-
}),
|
|
1013
|
+
...ze.action === void 0 ? {} : { interceptor: ze.action }
|
|
1014
|
+
}), tt = vi({
|
|
1015
1015
|
tenantScopedTables: e.tenantScopedTables,
|
|
1016
1016
|
softDeleteScopedTables: e.softDeleteScopedTables
|
|
1017
|
-
}),
|
|
1018
|
-
defaultDeny:
|
|
1019
|
-
buildContext: (e) =>
|
|
1020
|
-
finalize: (e, t) =>
|
|
1021
|
-
provideEffect:
|
|
1022
|
-
...
|
|
1023
|
-
},
|
|
1024
|
-
...
|
|
1017
|
+
}), nt = {
|
|
1018
|
+
defaultDeny: We,
|
|
1019
|
+
buildContext: (e) => je(e),
|
|
1020
|
+
finalize: (e, t) => tt(e, t.subject),
|
|
1021
|
+
provideEffect: Ie,
|
|
1022
|
+
...ze.query === void 0 ? {} : { interceptor: ze.query }
|
|
1023
|
+
}, C = _i(nt), ot = gi({
|
|
1024
|
+
...nt,
|
|
1025
1025
|
queryRows: (t, n) => e.store.query(t).then((e) => Ii(t.table, e, n.subject))
|
|
1026
|
-
}),
|
|
1027
|
-
...
|
|
1026
|
+
}), st = bi({
|
|
1027
|
+
...nt,
|
|
1028
1028
|
subscribeDescriptor: (e, t, n, i, a) => r.subscribe(e, t, n, void 0, void 0, void 0, i, a),
|
|
1029
1029
|
subscribeComputed: (e, t, n) => r.subscribeComputed(e, t, n)
|
|
1030
|
-
}),
|
|
1030
|
+
}), T = (e) => e.filter((e) => cr(e.descriptor)), E = {};
|
|
1031
1031
|
for (let t of [
|
|
1032
|
-
...
|
|
1033
|
-
...
|
|
1034
|
-
...
|
|
1032
|
+
...T(e.discovered.queries),
|
|
1033
|
+
...Ye.queries,
|
|
1034
|
+
...Qe.queries,
|
|
1035
1035
|
...b.queries
|
|
1036
|
-
])
|
|
1036
|
+
]) E[t.descriptor.name] = (e) => W(C(t, e), r, `subscription.${t.descriptor.name}`, void 0, void 0, yi(t, e));
|
|
1037
1037
|
for (let t of [
|
|
1038
|
-
...
|
|
1039
|
-
...
|
|
1040
|
-
...
|
|
1038
|
+
...T(e.discovered.mutations),
|
|
1039
|
+
...Ye.mutations,
|
|
1040
|
+
...Qe.mutations,
|
|
1041
1041
|
...b.mutations
|
|
1042
1042
|
]) {
|
|
1043
1043
|
let n = mi(t.descriptor.output);
|
|
1044
|
-
|
|
1044
|
+
E[t.descriptor.name] = (r) => U(async (e, n) => Ge(t, e, n), r, `mutation.${t.descriptor.name}`, n, e.idempotency, dr(t.descriptor, "mutation"));
|
|
1045
1045
|
}
|
|
1046
|
-
for (let t of [...
|
|
1046
|
+
for (let t of [...T(e.discovered.actions), ...b.actions]) {
|
|
1047
1047
|
let n = mi(t.descriptor.output);
|
|
1048
|
-
|
|
1048
|
+
E[t.descriptor.name] = (r) => U(async (e, n) => $e(t, e, n), r, `action.${t.descriptor.name}`, n, e.idempotency, dr(t.descriptor, "action"));
|
|
1049
1049
|
}
|
|
1050
|
-
let
|
|
1050
|
+
let ut = () => `public-${Math.random().toString(36).slice(2, 10)}`, dt = [
|
|
1051
1051
|
...e.discovered.queries.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
1052
1052
|
descriptor: e.descriptor,
|
|
1053
|
-
invoke: (t, n) =>
|
|
1053
|
+
invoke: (t, n) => ot(e, t, {
|
|
1054
1054
|
subject: n.subject,
|
|
1055
|
-
traceId:
|
|
1055
|
+
traceId: ut()
|
|
1056
1056
|
}),
|
|
1057
|
-
subscribe: (t, n, r) =>
|
|
1057
|
+
subscribe: (t, n, r) => st(e, t, {
|
|
1058
1058
|
subject: n.subject,
|
|
1059
|
-
traceId:
|
|
1059
|
+
traceId: ut()
|
|
1060
1060
|
}, r)
|
|
1061
1061
|
})),
|
|
1062
1062
|
...e.discovered.mutations.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
1063
1063
|
descriptor: e.descriptor,
|
|
1064
|
-
invoke: (t, n) =>
|
|
1064
|
+
invoke: (t, n) => Ge(e, t, {
|
|
1065
1065
|
subject: n.subject,
|
|
1066
|
-
traceId:
|
|
1066
|
+
traceId: ut()
|
|
1067
1067
|
})
|
|
1068
1068
|
})),
|
|
1069
1069
|
...e.discovered.actions.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
1070
1070
|
descriptor: e.descriptor,
|
|
1071
|
-
invoke: (t, n) =>
|
|
1071
|
+
invoke: (t, n) => $e(e, t, {
|
|
1072
1072
|
subject: n.subject,
|
|
1073
|
-
traceId:
|
|
1073
|
+
traceId: ut()
|
|
1074
1074
|
})
|
|
1075
1075
|
}))
|
|
1076
|
-
],
|
|
1077
|
-
candidates:
|
|
1076
|
+
], ft = {
|
|
1077
|
+
candidates: qe({
|
|
1078
1078
|
queries: e.discovered.queries,
|
|
1079
1079
|
mutations: e.discovered.mutations,
|
|
1080
1080
|
actions: e.discovered.actions,
|
|
1081
1081
|
descriptorOf: (e) => e.descriptor,
|
|
1082
|
-
runQuery: (e, t, n) => Promise.resolve(
|
|
1083
|
-
runMutation: (e, t, n) => Promise.resolve(
|
|
1084
|
-
runAction: (e, t, n) => Promise.resolve(
|
|
1082
|
+
runQuery: (e, t, n) => Promise.resolve(ot(e, t, n)),
|
|
1083
|
+
runMutation: (e, t, n) => Promise.resolve(Ge(e, t, n)),
|
|
1084
|
+
runAction: (e, t, n) => Promise.resolve($e(e, t, n))
|
|
1085
1085
|
}),
|
|
1086
1086
|
policy: e.agents?.tools ?? {},
|
|
1087
1087
|
mcpEnabled: e.agents?.mcp === !0,
|
|
@@ -1094,12 +1094,12 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1094
1094
|
kind: "query",
|
|
1095
1095
|
input: e.descriptor.input,
|
|
1096
1096
|
output: e.descriptor.output,
|
|
1097
|
-
invoke: (n, r, i) =>
|
|
1097
|
+
invoke: (n, r, i) => ot(e, n, {
|
|
1098
1098
|
subject: r.subject,
|
|
1099
1099
|
traceId: t(),
|
|
1100
1100
|
signal: i
|
|
1101
1101
|
}),
|
|
1102
|
-
subscribe: (n, r, i) =>
|
|
1102
|
+
subscribe: (n, r, i) => st(e, n, {
|
|
1103
1103
|
subject: r.subject,
|
|
1104
1104
|
traceId: t()
|
|
1105
1105
|
}, i)
|
|
@@ -1109,7 +1109,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1109
1109
|
kind: "mutation",
|
|
1110
1110
|
input: e.descriptor.input,
|
|
1111
1111
|
output: e.descriptor.output,
|
|
1112
|
-
invoke: (n, r, i) =>
|
|
1112
|
+
invoke: (n, r, i) => Ge(e, n, {
|
|
1113
1113
|
subject: r.subject,
|
|
1114
1114
|
traceId: t(),
|
|
1115
1115
|
signal: i
|
|
@@ -1120,14 +1120,14 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1120
1120
|
kind: "action",
|
|
1121
1121
|
input: e.descriptor.input,
|
|
1122
1122
|
output: e.descriptor.output,
|
|
1123
|
-
invoke: async (n, r, i) =>
|
|
1123
|
+
invoke: async (n, r, i) => $e(e, n, {
|
|
1124
1124
|
subject: r.subject,
|
|
1125
1125
|
traceId: t(),
|
|
1126
1126
|
signal: i
|
|
1127
1127
|
})
|
|
1128
1128
|
}))
|
|
1129
1129
|
];
|
|
1130
|
-
await
|
|
1130
|
+
await St({
|
|
1131
1131
|
config: e.grpc.config,
|
|
1132
1132
|
candidates: n,
|
|
1133
1133
|
resolveSubject: async (t) => {
|
|
@@ -1139,26 +1139,26 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1139
1139
|
},
|
|
1140
1140
|
store: e.store,
|
|
1141
1141
|
root: e.grpc.root,
|
|
1142
|
-
log: e.log ??
|
|
1142
|
+
log: e.log ?? P({ scope: "voltro:serve" }),
|
|
1143
1143
|
onShutdown: (e) => G(e)
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
|
-
let
|
|
1146
|
+
let pt = kt({
|
|
1147
1147
|
...e.restRoutes === void 0 ? {} : { restRoutes: e.restRoutes },
|
|
1148
|
-
publicApiEntries:
|
|
1148
|
+
publicApiEntries: dt,
|
|
1149
1149
|
store: e.store,
|
|
1150
1150
|
resolveSubject: (t) => e.resolveSubject(t, -1).then((e) => e.subject),
|
|
1151
1151
|
...e.idempotency === void 0 ? {} : { idempotency: e.idempotency },
|
|
1152
|
-
log: e.log ??
|
|
1153
|
-
}),
|
|
1152
|
+
log: e.log ?? P({ scope: "voltro:serve" })
|
|
1153
|
+
}), mt = e.dataTransferSecret ?? process.env.VOLTRO_DATA_TRANSFER_SECRET, ht = async (e, t) => {
|
|
1154
1154
|
let { Readable: n } = await import("node:stream"), r = $i(), i = ta("storage", () => n.from(t()));
|
|
1155
1155
|
await J.runPromise(ra(r, e, i, { contentType: "application/octet-stream" }));
|
|
1156
|
-
},
|
|
1156
|
+
}, gt = mt && mt.length >= 16 ? [
|
|
1157
1157
|
{
|
|
1158
1158
|
method: "POST",
|
|
1159
1159
|
path: Na,
|
|
1160
1160
|
handle: po({
|
|
1161
|
-
secret:
|
|
1161
|
+
secret: mt,
|
|
1162
1162
|
store: e.store,
|
|
1163
1163
|
...e.dataTransferSnapshot ? { snapshot: e.dataTransferSnapshot } : {},
|
|
1164
1164
|
...e.dataTransferDialect ? { dialect: e.dataTransferDialect } : {},
|
|
@@ -1167,7 +1167,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1167
1167
|
refreshSubscriptions: (e) => {
|
|
1168
1168
|
r.refreshAll(e);
|
|
1169
1169
|
},
|
|
1170
|
-
putArchive:
|
|
1170
|
+
putArchive: ht,
|
|
1171
1171
|
...e.dataTransferDialect ? { dialect: e.dataTransferDialect } : {}
|
|
1172
1172
|
})
|
|
1173
1173
|
},
|
|
@@ -1175,7 +1175,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1175
1175
|
method: "POST",
|
|
1176
1176
|
path: Pa,
|
|
1177
1177
|
handle: ho({
|
|
1178
|
-
secret:
|
|
1178
|
+
secret: mt,
|
|
1179
1179
|
store: e.store,
|
|
1180
1180
|
...e.dataTransferSnapshot ? { snapshot: e.dataTransferSnapshot } : {},
|
|
1181
1181
|
...e.dataTransferDialect ? { dialect: e.dataTransferDialect } : {},
|
|
@@ -1184,61 +1184,61 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1184
1184
|
refreshSubscriptions: (e) => {
|
|
1185
1185
|
r.refreshAll(e);
|
|
1186
1186
|
},
|
|
1187
|
-
putArchive:
|
|
1187
|
+
putArchive: ht
|
|
1188
1188
|
})
|
|
1189
1189
|
},
|
|
1190
1190
|
{
|
|
1191
1191
|
method: "GET",
|
|
1192
1192
|
path: La,
|
|
1193
1193
|
handle: Ho({
|
|
1194
|
-
secret:
|
|
1194
|
+
secret: mt,
|
|
1195
1195
|
store: e.store
|
|
1196
1196
|
})
|
|
1197
1197
|
},
|
|
1198
1198
|
{
|
|
1199
1199
|
method: "GET",
|
|
1200
1200
|
path: Ia,
|
|
1201
|
-
handle: Io({ secret:
|
|
1201
|
+
handle: Io({ secret: mt })
|
|
1202
1202
|
},
|
|
1203
1203
|
{
|
|
1204
1204
|
method: "POST",
|
|
1205
1205
|
path: Fa,
|
|
1206
1206
|
handle: No({
|
|
1207
|
-
secret:
|
|
1207
|
+
secret: mt,
|
|
1208
1208
|
store: e.store,
|
|
1209
1209
|
snapshot: e.dataTransferSnapshot ?? { tables: [] },
|
|
1210
1210
|
dialect: e.dataTransferDialect ?? "memory",
|
|
1211
1211
|
tenantTables: [...e.tenantScopedTables],
|
|
1212
|
-
loadProfile:
|
|
1212
|
+
loadProfile: $n,
|
|
1213
1213
|
assetSource: Ea($i(), e.store),
|
|
1214
|
-
putArchive:
|
|
1214
|
+
putArchive: ht
|
|
1215
1215
|
})
|
|
1216
1216
|
}
|
|
1217
|
-
] : [],
|
|
1217
|
+
] : [], _t = [
|
|
1218
1218
|
...e.httpRoutes ?? [],
|
|
1219
|
-
...
|
|
1220
|
-
...
|
|
1219
|
+
...pt.httpRoutes,
|
|
1220
|
+
...gt,
|
|
1221
1221
|
...b.httpRoutes
|
|
1222
1222
|
];
|
|
1223
|
-
Object.assign(
|
|
1224
|
-
for (let t of
|
|
1225
|
-
let i =
|
|
1223
|
+
Object.assign(E, Ee.handlers);
|
|
1224
|
+
for (let t of T(e.discovered.streams ?? [])) E[t.descriptor.name] = (n) => Kr((r) => zi(r, (r) => {
|
|
1225
|
+
let i = je(r), a = t.executor(n, i);
|
|
1226
1226
|
if (J.isEffect(a)) {
|
|
1227
1227
|
let t = a.pipe(J.provide(fi(i.store)));
|
|
1228
|
-
return (e.baseLayer ? t.pipe(J.provide(e.baseLayer)) : t).pipe(J.provide(
|
|
1228
|
+
return (e.baseLayer ? t.pipe(J.provide(e.baseLayer)) : t).pipe(J.provide(Me)).pipe(J.provide(Ne)).pipe(J.provide(Pe)).pipe(J.provide(Fe));
|
|
1229
1229
|
}
|
|
1230
1230
|
return typeof a == "object" && a && typeof a.then == "function" ? J.promise(() => a) : a;
|
|
1231
|
-
}), `stream.${t.descriptor.name}
|
|
1232
|
-
for (let t of e.discovered.workflows ?? [])
|
|
1231
|
+
}), `stream.${t.descriptor.name}`, t.descriptor.guards, n);
|
|
1232
|
+
for (let t of e.discovered.workflows ?? []) E[t.definition.name] = (e) => U(async (e, n) => {
|
|
1233
1233
|
let r = n;
|
|
1234
|
-
return Ci(
|
|
1234
|
+
return Ci(g, {
|
|
1235
1235
|
subject: r.subject,
|
|
1236
1236
|
traceId: r.traceId,
|
|
1237
1237
|
source: "workflow-rpc"
|
|
1238
1238
|
}).start(t.definition.name, e);
|
|
1239
1239
|
}, e, `workflow.${t.definition.name}`);
|
|
1240
|
-
|
|
1241
|
-
descriptor:
|
|
1240
|
+
ce && (E[R.name] = (e) => W(C({
|
|
1241
|
+
descriptor: R,
|
|
1242
1242
|
executor: (e) => {
|
|
1243
1243
|
let t = e.id;
|
|
1244
1244
|
return {
|
|
@@ -1247,30 +1247,30 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1247
1247
|
column: "startedAt",
|
|
1248
1248
|
direction: "desc"
|
|
1249
1249
|
}],
|
|
1250
|
-
predicate:
|
|
1250
|
+
predicate: Dr(V("id", t), V("executionId", t)),
|
|
1251
1251
|
take: 1,
|
|
1252
1252
|
skip: void 0,
|
|
1253
1253
|
projection: void 0
|
|
1254
1254
|
};
|
|
1255
1255
|
}
|
|
1256
|
-
}, e), r, `subscription.${
|
|
1257
|
-
descriptor:
|
|
1256
|
+
}, e), r, `subscription.${R.name}`), E[vr.name] = (e) => W(C({
|
|
1257
|
+
descriptor: vr,
|
|
1258
1258
|
executor: (e) => {
|
|
1259
|
-
let t = e, n = [...t.tag === void 0 ? [] : [
|
|
1259
|
+
let t = e, n = [...t.tag === void 0 ? [] : [V("tag", t.tag)], ...t.status === void 0 ? [] : [V("status", t.status)]], r = Number.isFinite(t.limit) && t.limit !== void 0 ? Math.min(Math.max(Math.floor(t.limit), 1), 500) : 100;
|
|
1260
1260
|
return {
|
|
1261
1261
|
table: "_voltro_workflow_runs",
|
|
1262
1262
|
order: [{
|
|
1263
1263
|
column: "startedAt",
|
|
1264
1264
|
direction: "desc"
|
|
1265
1265
|
}],
|
|
1266
|
-
predicate: n.length === 0 ? void 0 : n.length === 1 ? n[0] :
|
|
1266
|
+
predicate: n.length === 0 ? void 0 : n.length === 1 ? n[0] : Sr(...n),
|
|
1267
1267
|
take: r,
|
|
1268
1268
|
skip: void 0,
|
|
1269
1269
|
projection: void 0
|
|
1270
1270
|
};
|
|
1271
1271
|
}
|
|
1272
|
-
}, e), r, `subscription.${
|
|
1273
|
-
descriptor:
|
|
1272
|
+
}, e), r, `subscription.${vr.name}`), E[_r.name] = (e) => W(C({
|
|
1273
|
+
descriptor: _r,
|
|
1274
1274
|
executor: (e) => {
|
|
1275
1275
|
let t = e.runId;
|
|
1276
1276
|
return {
|
|
@@ -1279,14 +1279,14 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1279
1279
|
column: "startedAt",
|
|
1280
1280
|
direction: "asc"
|
|
1281
1281
|
}],
|
|
1282
|
-
predicate:
|
|
1282
|
+
predicate: V("runId", t),
|
|
1283
1283
|
take: 1e3,
|
|
1284
1284
|
skip: void 0,
|
|
1285
1285
|
projection: void 0
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
|
-
}, e), r, `subscription.${
|
|
1289
|
-
descriptor:
|
|
1288
|
+
}, e), r, `subscription.${_r.name}`), E[gr.name] = (e) => W(C({
|
|
1289
|
+
descriptor: gr,
|
|
1290
1290
|
executor: (e) => {
|
|
1291
1291
|
let t = e.runId;
|
|
1292
1292
|
return {
|
|
@@ -1295,14 +1295,14 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1295
1295
|
column: "occurredAt",
|
|
1296
1296
|
direction: "asc"
|
|
1297
1297
|
}],
|
|
1298
|
-
predicate:
|
|
1298
|
+
predicate: V("runId", t),
|
|
1299
1299
|
take: 1e3,
|
|
1300
1300
|
skip: void 0,
|
|
1301
1301
|
projection: void 0
|
|
1302
1302
|
};
|
|
1303
1303
|
}
|
|
1304
|
-
}, e), r, `subscription.${
|
|
1305
|
-
descriptor:
|
|
1304
|
+
}, e), r, `subscription.${gr.name}`), E[pr.name] = (e) => W(C({
|
|
1305
|
+
descriptor: pr,
|
|
1306
1306
|
executor: (e) => {
|
|
1307
1307
|
let t = e;
|
|
1308
1308
|
return {
|
|
@@ -1311,14 +1311,14 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1311
1311
|
column: "occurredAt",
|
|
1312
1312
|
direction: "desc"
|
|
1313
1313
|
}],
|
|
1314
|
-
predicate: t.name === void 0 ? void 0 :
|
|
1314
|
+
predicate: t.name === void 0 ? void 0 : V("name", t.name),
|
|
1315
1315
|
take: Math.max(1, Math.min(500, t.limit ?? 100)),
|
|
1316
1316
|
skip: void 0,
|
|
1317
1317
|
projection: void 0
|
|
1318
1318
|
};
|
|
1319
1319
|
}
|
|
1320
|
-
}, e), r, `subscription.${
|
|
1321
|
-
descriptor:
|
|
1320
|
+
}, e), r, `subscription.${pr.name}`), E[mr.name] = (e) => W(C({
|
|
1321
|
+
descriptor: mr,
|
|
1322
1322
|
executor: (e) => {
|
|
1323
1323
|
let t = e.eventId;
|
|
1324
1324
|
return {
|
|
@@ -1327,86 +1327,86 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1327
1327
|
column: "createdAt",
|
|
1328
1328
|
direction: "asc"
|
|
1329
1329
|
}],
|
|
1330
|
-
predicate:
|
|
1330
|
+
predicate: V("eventId", t),
|
|
1331
1331
|
take: 500,
|
|
1332
1332
|
skip: void 0,
|
|
1333
1333
|
projection: void 0
|
|
1334
1334
|
};
|
|
1335
1335
|
}
|
|
1336
|
-
}, e), r, `subscription.${
|
|
1336
|
+
}, e), r, `subscription.${mr.name}`), E[fr.name] = (t) => U(async (t, n) => {
|
|
1337
1337
|
let r = t;
|
|
1338
|
-
return await
|
|
1339
|
-
}, t, `action.${
|
|
1338
|
+
return await tn(e.store, n.subject, { executionId: r.executionId }), await g.cancel(r.workflowName, r.executionId), await Ot(r.workflowName, r.executionId, "workflow.cancel"), { ok: !0 };
|
|
1339
|
+
}, t, `action.${fr.name}`), E[hr.name] = (t) => U(async (t, n) => {
|
|
1340
1340
|
let r = t;
|
|
1341
|
-
return await
|
|
1342
|
-
}, t, `action.${
|
|
1341
|
+
return await tn(e.store, n.subject, { executionId: r.executionId }), await g.resume(r.workflowName, r.executionId), { ok: !0 };
|
|
1342
|
+
}, t, `action.${hr.name}`), E[z.name] = (t) => U(async (t, n) => {
|
|
1343
1343
|
let r = t;
|
|
1344
|
-
return await
|
|
1345
|
-
}, t, `action.${
|
|
1344
|
+
return await tn(e.store, n.subject, { id: r.id }), g.signal({ id: r.id }, r.signalName, r.payload);
|
|
1345
|
+
}, t, `action.${z.name}`), E[yr.name] = (t) => U(async (t, n) => {
|
|
1346
1346
|
let r = t;
|
|
1347
|
-
return await
|
|
1348
|
-
}, t, `action.${
|
|
1349
|
-
let
|
|
1350
|
-
...
|
|
1351
|
-
...
|
|
1352
|
-
...
|
|
1353
|
-
...
|
|
1354
|
-
...
|
|
1355
|
-
...
|
|
1356
|
-
...
|
|
1357
|
-
...b.queries.map((e) =>
|
|
1358
|
-
...b.mutations.map((e) =>
|
|
1359
|
-
...b.actions.map((e) =>
|
|
1360
|
-
...
|
|
1361
|
-
...
|
|
1347
|
+
return await tn(e.store, n.subject, { id: r.id }), g.update({ id: r.id }, r.updateName, r.payload, r.timeoutMs === void 0 ? void 0 : { timeoutMs: r.timeoutMs });
|
|
1348
|
+
}, t, `action.${yr.name}`));
|
|
1349
|
+
let vt = [
|
|
1350
|
+
...T(e.discovered.queries).map((e) => L(e.descriptor)),
|
|
1351
|
+
...T(e.discovered.mutations).map((e) => lr(e.descriptor)),
|
|
1352
|
+
...T(e.discovered.actions).map((e) => I(e.descriptor)),
|
|
1353
|
+
...Ye.queries.map((e) => L(e.descriptor)),
|
|
1354
|
+
...Ye.mutations.map((e) => lr(e.descriptor)),
|
|
1355
|
+
...Qe.queries.map((e) => L(e.descriptor)),
|
|
1356
|
+
...Qe.mutations.map((e) => lr(e.descriptor)),
|
|
1357
|
+
...b.queries.map((e) => L(e.descriptor)),
|
|
1358
|
+
...b.mutations.map((e) => lr(e.descriptor)),
|
|
1359
|
+
...b.actions.map((e) => I(e.descriptor)),
|
|
1360
|
+
...T(e.discovered.streams ?? []).map((e) => ur(e.descriptor)),
|
|
1361
|
+
...Ee.rpcs,
|
|
1362
1362
|
...(e.discovered.workflows ?? []).map((e) => Bi(e.definition)),
|
|
1363
|
-
...
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
z
|
|
1373
|
-
|
|
1363
|
+
...ce ? [
|
|
1364
|
+
L(R),
|
|
1365
|
+
L(vr),
|
|
1366
|
+
L(_r),
|
|
1367
|
+
L(gr),
|
|
1368
|
+
L(pr),
|
|
1369
|
+
L(mr),
|
|
1370
|
+
I(fr),
|
|
1371
|
+
I(hr),
|
|
1372
|
+
I(z),
|
|
1373
|
+
I(yr)
|
|
1374
1374
|
] : []
|
|
1375
|
-
],
|
|
1375
|
+
], yt = Qi.make(...vt).middleware(or).middleware(F), bt = li({ resolveSubject: ({ headers: t, clientId: n }) => e.resolveSubject(t, n) }), xt = e.dormancyTenantId ?? Ir, Ct = e.dormancy === "sleep" ? {
|
|
1376
1376
|
register: (t, n, r) => Oi(e.store, {
|
|
1377
|
-
tenantId: r ??
|
|
1377
|
+
tenantId: r ?? xt,
|
|
1378
1378
|
kind: "workflow",
|
|
1379
1379
|
refId: t,
|
|
1380
1380
|
wakeAt: n
|
|
1381
1381
|
}),
|
|
1382
1382
|
cancel: (t, n) => Jr(e.store, {
|
|
1383
|
-
tenantId: n ??
|
|
1383
|
+
tenantId: n ?? xt,
|
|
1384
1384
|
kind: "workflow",
|
|
1385
1385
|
refId: t
|
|
1386
1386
|
}).then(() => {})
|
|
1387
|
-
} : void 0,
|
|
1387
|
+
} : void 0, O = ue ? await import("@voltro/workflow") : void 0, k = O?.makeWorkflowRunRecorder({
|
|
1388
1388
|
store: e.store,
|
|
1389
1389
|
...e.workflowRecording === void 0 ? {} : { recording: e.workflowRecording },
|
|
1390
|
-
...
|
|
1391
|
-
}),
|
|
1392
|
-
await
|
|
1390
|
+
...Ct === void 0 ? {} : { wakeups: Ct }
|
|
1391
|
+
}), Tt = async (t, n) => {
|
|
1392
|
+
await O.closeWorkflowChildrenForParent({
|
|
1393
1393
|
store: e.store,
|
|
1394
1394
|
parentExecutionId: t,
|
|
1395
1395
|
parentStatus: n,
|
|
1396
|
-
recorder:
|
|
1396
|
+
recorder: k,
|
|
1397
1397
|
log: { warn: (e, t) => re.warn(e, t ?? {}) },
|
|
1398
1398
|
interruptChild: async (t, n) => {
|
|
1399
1399
|
let r = (e.discovered.workflows ?? []).find((e) => e.definition.name === t);
|
|
1400
1400
|
if (!r) throw Error(`Unknown child workflow: ${t}`);
|
|
1401
|
-
if (!
|
|
1402
|
-
await
|
|
1401
|
+
if (!d) throw Error("Workflow runtime is not ready");
|
|
1402
|
+
await d.runPromise(r.definition.interrupt(n));
|
|
1403
1403
|
}
|
|
1404
1404
|
});
|
|
1405
|
-
},
|
|
1405
|
+
}, Ot = async (t, n, r) => {
|
|
1406
1406
|
let i = (await e.store.query({
|
|
1407
1407
|
table: "_voltro_workflow_runs",
|
|
1408
1408
|
order: [],
|
|
1409
|
-
predicate:
|
|
1409
|
+
predicate: V("executionId", n),
|
|
1410
1410
|
projection: void 0,
|
|
1411
1411
|
skip: void 0,
|
|
1412
1412
|
take: 1
|
|
@@ -1417,7 +1417,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1417
1417
|
cancelled: !0,
|
|
1418
1418
|
completedAt: /* @__PURE__ */ new Date()
|
|
1419
1419
|
}), o = i.subject?.tenantId ?? void 0;
|
|
1420
|
-
a && await
|
|
1420
|
+
a && await k.recordEvent({
|
|
1421
1421
|
runId: i.id,
|
|
1422
1422
|
eventType: "run-cancelled",
|
|
1423
1423
|
payload: {
|
|
@@ -1426,18 +1426,19 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1426
1426
|
executionId: n,
|
|
1427
1427
|
...o == null ? {} : { tenantId: o }
|
|
1428
1428
|
}
|
|
1429
|
-
}), a && await
|
|
1430
|
-
},
|
|
1429
|
+
}), a && await Tt(n, "cancelled");
|
|
1430
|
+
}, At = [
|
|
1431
1431
|
...wi(e.discovered.workflows ?? [], {
|
|
1432
|
-
buildContext: (t, n) => e.buildContextForWorkflow?.(t, n) ??
|
|
1432
|
+
buildContext: (t, n) => e.buildContextForWorkflow?.(t, n) ?? je({
|
|
1433
1433
|
subject: t.subject,
|
|
1434
|
-
traceId: t.traceId
|
|
1434
|
+
traceId: t.traceId,
|
|
1435
|
+
rowFilter: t.rowFilter
|
|
1435
1436
|
}, e.store, void 0, `workflow:${n.workflowName}`, { parentExecutionId: n.executionId }),
|
|
1436
|
-
resolveStartContext:
|
|
1437
|
-
...
|
|
1437
|
+
resolveStartContext: oe,
|
|
1438
|
+
...se === void 0 ? {} : { resolveAuthority: se }
|
|
1438
1439
|
}, (t, n, r) => {
|
|
1439
|
-
let i =
|
|
1440
|
-
return
|
|
1440
|
+
let i = O.getWorkflowVersionMetadata(t.definition);
|
|
1441
|
+
return O.wrapWorkflowExecuteWithRunRecording({
|
|
1441
1442
|
name: t.definition.name,
|
|
1442
1443
|
store: e.store,
|
|
1443
1444
|
subject: r.subject,
|
|
@@ -1448,42 +1449,42 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1448
1449
|
workflowPatches: i.patches,
|
|
1449
1450
|
parentExecutionId: r?.parentExecutionId ?? null,
|
|
1450
1451
|
parentClosePolicy: r?.parentClosePolicy ?? null,
|
|
1451
|
-
onParentClose: ({ executionId: e, status: t }) =>
|
|
1452
|
-
|
|
1452
|
+
onParentClose: ({ executionId: e, status: t }) => Tt(e, t),
|
|
1453
|
+
...Jt(t.definition),
|
|
1453
1454
|
onTerminal: async ({ executionId: e }) => {
|
|
1454
|
-
await
|
|
1455
|
+
await u?.gate.release(e);
|
|
1455
1456
|
},
|
|
1456
|
-
recorder:
|
|
1457
|
-
pluginWorkflowStepLayer:
|
|
1457
|
+
recorder: k,
|
|
1458
|
+
pluginWorkflowStepLayer: He,
|
|
1458
1459
|
recordRun: Ei
|
|
1459
1460
|
}, n);
|
|
1460
1461
|
}),
|
|
1461
1462
|
...e.discovered.workflowWorkers ?? [],
|
|
1462
|
-
...
|
|
1463
|
-
],
|
|
1464
|
-
if (((e.discovered.workflows?.length ?? 0) > 0 || (e.discovered.workflowWorkers?.length ?? 0) > 0 || e.scheduleCoordination === "cluster" ||
|
|
1465
|
-
let t =
|
|
1466
|
-
|
|
1467
|
-
let n = await import("@voltro/workflow/cluster"), r = (e) =>
|
|
1468
|
-
ne = await
|
|
1463
|
+
...me === void 0 ? [] : [me]
|
|
1464
|
+
], Ft = [...(e.discovered.workflows ?? []).map((e) => e.definition.name).filter(Boolean), ...me === void 0 ? [] : ["voltro.deliverWebhook"]], It = At.length > 0 ? Y.mergeAll(...At) : Y.empty;
|
|
1465
|
+
if (((e.discovered.workflows?.length ?? 0) > 0 || (e.discovered.workflowWorkers?.length ?? 0) > 0 || e.scheduleCoordination === "cluster" || me !== void 0) && e.workflowEngineLayer !== void 0) {
|
|
1466
|
+
let t = It.pipe(Y.provideMerge(e.workflowEngineLayer));
|
|
1467
|
+
d = Wi.make((e.baseLayer === void 0 ? t : t.pipe(Y.provideMerge(e.baseLayer))).pipe(Y.provideMerge(ar({})))), await d.runPromise(J.void), (e.log ?? P({ scope: "voltro:serve" })).child("workflow").info(`workflow runtime ready — ${Ft.length} entity type(s) registered`, { entities: Ft });
|
|
1468
|
+
let n = await import("@voltro/workflow/cluster"), r = (e) => d.runPromise(n.redriveFailedRun(e)), i = (e) => d.runPromise(n.resumeRunFromStep(e));
|
|
1469
|
+
ne = await Ae({
|
|
1469
1470
|
provider: la(e.plugins ?? [])?.broadcast?.provider,
|
|
1470
1471
|
crossReplica: la(e.plugins ?? [])?.broadcast?.crossReplica ?? !1,
|
|
1471
|
-
namespace:
|
|
1472
|
+
namespace: xe,
|
|
1472
1473
|
replicaId: crypto.randomUUID(),
|
|
1473
|
-
pollStorage: () =>
|
|
1474
|
+
pollStorage: () => d.runPromise(n.pollWorkflowStorage),
|
|
1474
1475
|
onChange: (t) => e.store.onChange((e) => t({
|
|
1475
1476
|
table: e.table,
|
|
1476
1477
|
op: e.op,
|
|
1477
1478
|
...e.origin === void 0 ? {} : { origin: e.origin }
|
|
1478
1479
|
})),
|
|
1479
|
-
log: (e.log ??
|
|
1480
|
+
log: (e.log ?? P({ scope: "voltro:serve" })).child("workflow")
|
|
1480
1481
|
}), ee = async (t) => {
|
|
1481
|
-
let n = await
|
|
1482
|
+
let n = await Ze({
|
|
1482
1483
|
store: e.store,
|
|
1483
1484
|
workflows: e.discovered.workflows ?? [],
|
|
1484
1485
|
runRedrive: r
|
|
1485
1486
|
}, t.runId);
|
|
1486
|
-
return n.statusReset && await
|
|
1487
|
+
return n.statusReset && await k.recordEvent({
|
|
1487
1488
|
runId: t.runId,
|
|
1488
1489
|
eventType: "run-redriven",
|
|
1489
1490
|
payload: {
|
|
@@ -1496,12 +1497,12 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1496
1497
|
reason: n.outcome.reason
|
|
1497
1498
|
};
|
|
1498
1499
|
}, te = async (t) => {
|
|
1499
|
-
let n = await
|
|
1500
|
+
let n = await S({
|
|
1500
1501
|
store: e.store,
|
|
1501
1502
|
workflows: e.discovered.workflows ?? [],
|
|
1502
1503
|
runResume: i
|
|
1503
1504
|
}, t.runId, t.step);
|
|
1504
|
-
return n.statusReset && await
|
|
1505
|
+
return n.statusReset && await k.recordEvent({
|
|
1505
1506
|
runId: t.runId,
|
|
1506
1507
|
eventType: "run-redriven",
|
|
1507
1508
|
payload: {
|
|
@@ -1516,32 +1517,32 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1516
1517
|
reason: n.outcome.reason
|
|
1517
1518
|
};
|
|
1518
1519
|
};
|
|
1519
|
-
let a = (e.scheduleCoordination ?? "single") === "advisoryLock" ? ii(e.store, e.scheduleReplicaId ?? `pid-${process.pid}`) : Pi,
|
|
1520
|
+
let a = (e.scheduleCoordination ?? "single") === "advisoryLock" ? ii(e.store, e.scheduleReplicaId ?? `pid-${process.pid}`) : Pi, f = di({
|
|
1520
1521
|
coordinator: a,
|
|
1521
1522
|
replicaId: e.scheduleReplicaId ?? `pid-${process.pid}`
|
|
1522
|
-
}),
|
|
1523
|
+
}), p = P({ scope: "voltro:flow-control" }), m = {
|
|
1523
1524
|
info: (e, t) => {
|
|
1524
|
-
|
|
1525
|
+
p.info(e, t);
|
|
1525
1526
|
},
|
|
1526
1527
|
warn: (e, t) => {
|
|
1527
|
-
|
|
1528
|
+
p.warn(e, t);
|
|
1528
1529
|
},
|
|
1529
1530
|
error: (e, t) => {
|
|
1530
|
-
|
|
1531
|
+
p.error(e, t ?? {});
|
|
1531
1532
|
}
|
|
1532
|
-
},
|
|
1533
|
-
if (
|
|
1534
|
-
if (o !== void 0 &&
|
|
1533
|
+
}, re, ie = () => {
|
|
1534
|
+
if (re !== void 0) return re;
|
|
1535
|
+
if (o !== void 0 && k !== void 0) return re = Ve({
|
|
1535
1536
|
store: e.store,
|
|
1536
|
-
log:
|
|
1537
|
+
log: M,
|
|
1537
1538
|
workflows: e.discovered.workflows ?? [],
|
|
1538
1539
|
workflowsProxy: o,
|
|
1539
|
-
workflowRuntime:
|
|
1540
|
-
workflowRunRecorder:
|
|
1541
|
-
closeChildrenForParent:
|
|
1542
|
-
}),
|
|
1540
|
+
workflowRuntime: d,
|
|
1541
|
+
workflowRunRecorder: k,
|
|
1542
|
+
closeChildrenForParent: Tt
|
|
1543
|
+
}), re;
|
|
1543
1544
|
};
|
|
1544
|
-
s =
|
|
1545
|
+
s = ie, u = Zt({
|
|
1545
1546
|
store: e.store,
|
|
1546
1547
|
onChange: (t) => e.store.onChange((e) => t({
|
|
1547
1548
|
table: e.table,
|
|
@@ -1555,23 +1556,23 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1555
1556
|
},
|
|
1556
1557
|
workflows: e.discovered.workflows ?? [],
|
|
1557
1558
|
facade: () => o,
|
|
1558
|
-
cancelRunWithReason:
|
|
1559
|
-
recordRunEvent: () =>
|
|
1559
|
+
cancelRunWithReason: ie,
|
|
1560
|
+
recordRunEvent: () => k?.recordEvent,
|
|
1560
1561
|
...e.workflowStaleness === void 0 ? {} : { staleness: e.workflowStaleness },
|
|
1561
1562
|
...e.workflowSuspendSignalHintMs === void 0 ? {} : { suspendSignalHintMs: e.workflowSuspendSignalHintMs },
|
|
1562
|
-
scheduleCoordinated:
|
|
1563
|
+
scheduleCoordinated: f,
|
|
1563
1564
|
onAbandoned: async (t) => {
|
|
1564
|
-
await
|
|
1565
|
+
await et({
|
|
1565
1566
|
workflows: e.discovered.workflows ?? [],
|
|
1566
1567
|
facade: () => o,
|
|
1567
|
-
log:
|
|
1568
|
+
log: m,
|
|
1568
1569
|
...t
|
|
1569
1570
|
});
|
|
1570
1571
|
},
|
|
1571
|
-
log:
|
|
1572
|
+
log: m
|
|
1572
1573
|
});
|
|
1573
|
-
let
|
|
1574
|
-
|
|
1574
|
+
let h = u;
|
|
1575
|
+
h !== void 0 && G(() => h.stop()), c = at({
|
|
1575
1576
|
store: e.store,
|
|
1576
1577
|
onChange: (t) => e.store.onChange((e) => t({
|
|
1577
1578
|
table: e.table,
|
|
@@ -1582,82 +1583,82 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1582
1583
|
tickIntervalMs: e.scheduling.inferenceTickMs
|
|
1583
1584
|
},
|
|
1584
1585
|
enabled: (e.discovered.workflows?.length ?? 0) > 0,
|
|
1585
|
-
resumeSignal: () =>
|
|
1586
|
-
await
|
|
1586
|
+
resumeSignal: () => d === void 0 || O === void 0 ? void 0 : async ({ executionId: t, workflowName: n, signalName: r, payload: i }) => {
|
|
1587
|
+
await d.runPromise(O.completeSuspendingSignal({
|
|
1587
1588
|
store: e.store,
|
|
1588
|
-
target:
|
|
1589
|
+
target: nn(t, n),
|
|
1589
1590
|
signalName: r,
|
|
1590
1591
|
payload: i
|
|
1591
1592
|
}));
|
|
1592
1593
|
},
|
|
1593
|
-
runEffect: (e) =>
|
|
1594
|
-
scheduleCoordinated:
|
|
1595
|
-
log:
|
|
1594
|
+
runEffect: (e) => d.runPromise(e),
|
|
1595
|
+
scheduleCoordinated: f,
|
|
1596
|
+
log: m
|
|
1596
1597
|
});
|
|
1597
|
-
let
|
|
1598
|
-
|
|
1598
|
+
let oe = c;
|
|
1599
|
+
oe !== void 0 && G(() => oe.stop()), o = (e.discovered.workflows?.length ?? 0) > 0 ? Si({
|
|
1599
1600
|
workflows: e.discovered.workflows ?? [],
|
|
1600
|
-
runEffect: (e) =>
|
|
1601
|
+
runEffect: (e) => d.runPromise(e),
|
|
1601
1602
|
onEnqueue: () => ne?.publishWake(),
|
|
1602
|
-
...
|
|
1603
|
-
admitStart:
|
|
1604
|
-
startPayloadSchema:
|
|
1605
|
-
parkDelayedStart:
|
|
1603
|
+
...h === void 0 ? {} : {
|
|
1604
|
+
admitStart: h.gate.admitStart,
|
|
1605
|
+
startPayloadSchema: h.gate.startPayloadSchema,
|
|
1606
|
+
parkDelayedStart: h.gate.parkDelayed
|
|
1606
1607
|
},
|
|
1607
|
-
rememberStartContext:
|
|
1608
|
+
rememberStartContext: ae,
|
|
1608
1609
|
signal: async (t, n, r) => {
|
|
1609
|
-
let i = await
|
|
1610
|
+
let i = await O.sendWorkflowSignal({
|
|
1610
1611
|
store: e.store,
|
|
1611
|
-
recorder:
|
|
1612
|
+
recorder: k,
|
|
1612
1613
|
target: t,
|
|
1613
1614
|
signalName: n,
|
|
1614
1615
|
payload: r
|
|
1615
1616
|
});
|
|
1616
|
-
return await
|
|
1617
|
+
return await d.runPromise(O.completeSuspendingSignal({
|
|
1617
1618
|
store: e.store,
|
|
1618
1619
|
target: t,
|
|
1619
1620
|
signalName: n,
|
|
1620
1621
|
payload: r
|
|
1621
1622
|
})).catch(() => {}), i;
|
|
1622
1623
|
},
|
|
1623
|
-
update: (t, n, r, i) =>
|
|
1624
|
+
update: (t, n, r, i) => O.sendWorkflowUpdate({
|
|
1624
1625
|
store: e.store,
|
|
1625
|
-
recorder:
|
|
1626
|
+
recorder: k,
|
|
1626
1627
|
target: t,
|
|
1627
1628
|
updateName: n,
|
|
1628
1629
|
payload: r,
|
|
1629
1630
|
...i === void 0 ? {} : { options: i }
|
|
1630
1631
|
}),
|
|
1631
|
-
listRuns: (t) =>
|
|
1632
|
-
retry: (t, n) =>
|
|
1632
|
+
listRuns: (t) => Je(e.store, t),
|
|
1633
|
+
retry: (t, n) => l({
|
|
1633
1634
|
store: e.store,
|
|
1634
1635
|
workflows: e.discovered.workflows ?? [],
|
|
1635
|
-
runPromise: (e) =>
|
|
1636
|
+
runPromise: (e) => d.runPromise(e)
|
|
1636
1637
|
}, t, n),
|
|
1637
|
-
redrive: (t) =>
|
|
1638
|
+
redrive: (t) => Ze({
|
|
1638
1639
|
store: e.store,
|
|
1639
1640
|
workflows: e.discovered.workflows ?? [],
|
|
1640
1641
|
runRedrive: r
|
|
1641
1642
|
}, t).then((e) => e.outcome)
|
|
1642
1643
|
}) : void 0;
|
|
1643
1644
|
}
|
|
1644
|
-
let
|
|
1645
|
+
let Lt = Y.mergeAll(yt.toLayer(E), bt), zt = D(E, e.discovered.queries.map((e) => e.descriptor.name), ce), A = Y.mergeAll(yt.toLayer(zt), bt), j = e.observability, Ut = await qr({
|
|
1645
1646
|
...e.traceSink === void 0 ? {} : { traceSink: e.traceSink },
|
|
1646
1647
|
...e.appName === void 0 ? {} : { serviceName: e.appName },
|
|
1647
|
-
...
|
|
1648
|
-
...
|
|
1649
|
-
...
|
|
1650
|
-
...
|
|
1651
|
-
}),
|
|
1652
|
-
group:
|
|
1653
|
-
handlersLayer:
|
|
1654
|
-
httpHandlersLayer:
|
|
1648
|
+
...j && j.spanProcessors.length > 0 ? { extraSpanProcessors: j.spanProcessors } : {},
|
|
1649
|
+
...j && j.metricReaders.length > 0 ? { extraMetricReaders: j.metricReaders } : {},
|
|
1650
|
+
...j && Object.keys(j.resourceAttributes).length > 0 ? { resourceAttributes: j.resourceAttributes } : {},
|
|
1651
|
+
...j && j.sampler !== void 0 ? { sampler: j.sampler } : {}
|
|
1652
|
+
}), Gt = !1, Kt = e.store.ping ? () => e.store.ping().then(() => !0).catch(() => !1) : void 0, { server: qt, shutdown: Yt } = Fi({
|
|
1653
|
+
group: yt,
|
|
1654
|
+
handlersLayer: Lt,
|
|
1655
|
+
httpHandlersLayer: A,
|
|
1655
1656
|
port: e.port ?? 4e3,
|
|
1656
1657
|
...e.host === void 0 ? {} : { host: e.host },
|
|
1657
1658
|
path: e.path ?? "/ws",
|
|
1658
|
-
tracerLayer:
|
|
1659
|
-
security:
|
|
1660
|
-
...
|
|
1659
|
+
tracerLayer: Ut.layer,
|
|
1660
|
+
security: Ue(e),
|
|
1661
|
+
...Un(e),
|
|
1661
1662
|
...e.discovered.wsGateways !== void 0 && e.discovered.wsGateways.length > 0 ? { webSocketGateways: e.discovered.wsGateways } : {},
|
|
1662
1663
|
resolveGatewaySubject: async (t) => {
|
|
1663
1664
|
let n = await e.resolveSubject(t, -1);
|
|
@@ -1666,13 +1667,13 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1666
1667
|
...n.credentialExpiresAt === void 0 ? {} : { credentialExpiresAt: n.credentialExpiresAt * 1e3 }
|
|
1667
1668
|
};
|
|
1668
1669
|
},
|
|
1669
|
-
...
|
|
1670
|
+
...Be,
|
|
1670
1671
|
healthCheck: (() => {
|
|
1671
1672
|
let t = e.health;
|
|
1672
1673
|
if (t?.readiness !== void 0) {
|
|
1673
1674
|
let e = t.readiness;
|
|
1674
1675
|
return {
|
|
1675
|
-
isReady: () =>
|
|
1676
|
+
isReady: () => Gt,
|
|
1676
1677
|
ping: async () => {
|
|
1677
1678
|
try {
|
|
1678
1679
|
return await e();
|
|
@@ -1683,17 +1684,17 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1683
1684
|
};
|
|
1684
1685
|
}
|
|
1685
1686
|
return {
|
|
1686
|
-
isReady: () =>
|
|
1687
|
-
...
|
|
1687
|
+
isReady: () => Gt,
|
|
1688
|
+
...Kt ? { ping: Kt } : {}
|
|
1688
1689
|
};
|
|
1689
1690
|
})(),
|
|
1690
|
-
...
|
|
1691
|
+
..._t.length > 0 ? { httpRoutes: _t } : {},
|
|
1691
1692
|
...e.getStore === void 0 ? {} : { getStore: e.getStore },
|
|
1692
|
-
...
|
|
1693
|
+
...ge.size > 0 ? { webhookRoutes: ge } : {},
|
|
1693
1694
|
...e.inspectRoute === void 0 ? {} : { inspectRoute: e.inspectRoute },
|
|
1694
1695
|
...e.inspectStream === void 0 ? {} : { inspectStream: e.inspectStream }
|
|
1695
|
-
}),
|
|
1696
|
-
if (await
|
|
1696
|
+
}), Xt = Ma(qt);
|
|
1697
|
+
if (await Gr(qt), (e.discovered.schedules?.length ?? 0) > 0) {
|
|
1697
1698
|
let t = (e.scheduleCoordination ?? "single") === "advisoryLock" ? ii(e.store, e.scheduleReplicaId ?? `pid-${process.pid}`) : Pi;
|
|
1698
1699
|
m = await q(e.discovered.schedules ?? [], {
|
|
1699
1700
|
store: e.store,
|
|
@@ -1704,19 +1705,19 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1704
1705
|
dormancy: e.dormancy ?? "always-on",
|
|
1705
1706
|
...e.scheduling === void 0 ? {} : { runHeartbeatMs: e.scheduling.scheduleHeartbeatMs },
|
|
1706
1707
|
...e.dormancyTenantId === void 0 ? {} : { dormancyTenantId: e.dormancyTenantId },
|
|
1707
|
-
buildContext: ({ traceId: t, scheduleName: n, subject: r }) =>
|
|
1708
|
+
buildContext: ({ traceId: t, scheduleName: n, subject: r }) => je({
|
|
1708
1709
|
subject: r,
|
|
1709
1710
|
traceId: t
|
|
1710
1711
|
}, e.store, void 0, `schedule:${n}`),
|
|
1711
1712
|
log: {
|
|
1712
1713
|
info: (e, t) => {
|
|
1713
|
-
|
|
1714
|
+
ie.info(e, t);
|
|
1714
1715
|
},
|
|
1715
1716
|
warn: (e, t) => {
|
|
1716
|
-
|
|
1717
|
+
ie.warn(e, t);
|
|
1717
1718
|
},
|
|
1718
1719
|
error: (e, t) => {
|
|
1719
|
-
|
|
1720
|
+
ie.error(e, t ?? {});
|
|
1720
1721
|
},
|
|
1721
1722
|
debug: () => {}
|
|
1722
1723
|
},
|
|
@@ -1724,30 +1725,30 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1724
1725
|
...e.onScheduleRunEvent === void 0 ? {} : { onRunEvent: e.onScheduleRunEvent }
|
|
1725
1726
|
}), e.onSchedulerReady?.(m);
|
|
1726
1727
|
}
|
|
1727
|
-
let
|
|
1728
|
-
if ((e.discovered.subscribers?.length ?? 0) > 0 && (
|
|
1729
|
-
eventBus:
|
|
1730
|
-
...
|
|
1728
|
+
let M = e.log ?? P({ scope: "voltro:serve" }), rn, an, sn = e.claimChange;
|
|
1729
|
+
if ((e.discovered.subscribers?.length ?? 0) > 0 && (rn = Bt(e.discovered.subscribers ?? [], e.store, M.child("subscribe"), e.schemaRegistry, {
|
|
1730
|
+
eventBus: Ee.bus,
|
|
1731
|
+
...sn === void 0 ? {} : { claimOnce: sn }
|
|
1731
1732
|
})), (e.discovered.reactions?.length ?? 0) > 0) {
|
|
1732
|
-
let t =
|
|
1733
|
-
|
|
1733
|
+
let t = M.child("reaction");
|
|
1734
|
+
an = on(e.discovered.reactions ?? [], e.store, {
|
|
1734
1735
|
runAct: async (n, r) => {
|
|
1735
1736
|
if (n.kind === "workflow") {
|
|
1736
|
-
if (
|
|
1737
|
+
if (g === void 0) {
|
|
1737
1738
|
t.warn("reaction workflow act skipped — no workflow engine in this app", { workflow: n.workflow });
|
|
1738
1739
|
return;
|
|
1739
1740
|
}
|
|
1740
1741
|
let e = n.payload === void 0 ? r.new ?? r.old ?? {} : n.payload(r);
|
|
1741
|
-
await Ci(
|
|
1742
|
+
await Ci(g, {
|
|
1742
1743
|
traceId: `reaction:${n.workflow}`,
|
|
1743
1744
|
source: `reaction:${n.workflow}`
|
|
1744
1745
|
}).start(n.workflow, e);
|
|
1745
1746
|
return;
|
|
1746
1747
|
}
|
|
1747
|
-
await
|
|
1748
|
+
await p(n.agent, r, {
|
|
1748
1749
|
findAgentSend: (t) => e.discovered.actions.find((e) => e.descriptor.name === `${t}.send`),
|
|
1749
|
-
runAction: (e, t, n) => Promise.resolve(
|
|
1750
|
-
makeSubject: (e) =>
|
|
1750
|
+
runAction: (e, t, n) => Promise.resolve($e(e, t, n)),
|
|
1751
|
+
makeSubject: (e) => sr(e),
|
|
1751
1752
|
now: () => Date.now(),
|
|
1752
1753
|
log: t
|
|
1753
1754
|
});
|
|
@@ -1763,67 +1764,67 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1763
1764
|
return t.warn("reaction budget check failed — refusing the act", { tenantId: n }, e), !1;
|
|
1764
1765
|
}
|
|
1765
1766
|
},
|
|
1766
|
-
...
|
|
1767
|
-
...
|
|
1767
|
+
...sn === void 0 ? {} : { claimRateSlot: (e) => sn(Wt, e) },
|
|
1768
|
+
...sn === void 0 ? {} : { claimDedupe: (e) => sn(Et, e) }
|
|
1768
1769
|
}, t);
|
|
1769
1770
|
}
|
|
1770
|
-
let
|
|
1771
|
-
(e.discovered.aggregates?.length ?? 0) > 0 && (
|
|
1771
|
+
let cn;
|
|
1772
|
+
(e.discovered.aggregates?.length ?? 0) > 0 && (cn = await x({
|
|
1772
1773
|
discovered: e.discovered.aggregates ?? [],
|
|
1773
1774
|
store: e.store,
|
|
1774
|
-
log:
|
|
1775
|
+
log: M.child("aggregate"),
|
|
1775
1776
|
...e.analytics === void 0 ? {} : { analytics: e.analytics },
|
|
1776
1777
|
...e.aggregateStorage === void 0 ? {} : { storage: e.aggregateStorage },
|
|
1777
1778
|
...e.aggregateCoordinator === void 0 ? {} : { coordinator: e.aggregateCoordinator }
|
|
1778
|
-
}),
|
|
1779
|
-
let
|
|
1780
|
-
(e.discovered.expectations?.length ?? 0) > 0 && (
|
|
1779
|
+
}), Me = Y.succeed(Fr, cn.registry));
|
|
1780
|
+
let ln;
|
|
1781
|
+
(e.discovered.expectations?.length ?? 0) > 0 && (ln = Hr({
|
|
1781
1782
|
discovered: e.discovered.expectations ?? [],
|
|
1782
1783
|
store: e.store,
|
|
1783
|
-
log:
|
|
1784
|
-
}),
|
|
1784
|
+
log: M.child("expectation")
|
|
1785
|
+
}), Ne = Y.succeed(Rr, ln.registry)), (e.discovered.budgets?.length ?? 0) > 0 && (n = Wr({
|
|
1785
1786
|
discovered: e.discovered.budgets ?? [],
|
|
1786
|
-
log:
|
|
1787
|
-
}),
|
|
1788
|
-
let
|
|
1789
|
-
return (e.discovered.experiments?.length ?? 0) > 0 && (
|
|
1787
|
+
log: M.child("finops")
|
|
1788
|
+
}), Pe = Y.succeed(H, n.registry));
|
|
1789
|
+
let un;
|
|
1790
|
+
return (e.discovered.experiments?.length ?? 0) > 0 && (un = Ur({
|
|
1790
1791
|
discovered: e.discovered.experiments ?? [],
|
|
1791
1792
|
store: e.store,
|
|
1792
|
-
log:
|
|
1793
|
-
}),
|
|
1793
|
+
log: M.child("experiment")
|
|
1794
|
+
}), Fe = Y.succeed(zr, un.registry)), Gt = !0, e.bootTiming?.mark("ready"), {
|
|
1794
1795
|
dispatcher: r,
|
|
1795
|
-
server:
|
|
1796
|
+
server: qt,
|
|
1796
1797
|
scheduler: m,
|
|
1797
|
-
eventsSnapshot:
|
|
1798
|
+
eventsSnapshot: he(Ee.bus, Ee.declared),
|
|
1798
1799
|
membersSnapshot: () => ({
|
|
1799
|
-
members:
|
|
1800
|
+
members: Te.membership.list(),
|
|
1800
1801
|
capturedAt: Date.now()
|
|
1801
1802
|
}),
|
|
1802
|
-
agentTools: () =>
|
|
1803
|
-
rpcMetrics: () =>
|
|
1804
|
-
webhooksService: () =>
|
|
1803
|
+
agentTools: () => ft,
|
|
1804
|
+
rpcMetrics: () => Re,
|
|
1805
|
+
webhooksService: () => pe,
|
|
1805
1806
|
runCanceller: () => s(),
|
|
1806
|
-
flowControlHealth: () =>
|
|
1807
|
+
flowControlHealth: () => u?.cancelHealth(),
|
|
1807
1808
|
inferenceHealth: () => c?.health(),
|
|
1808
|
-
workflowWriteActions: () =>
|
|
1809
|
+
workflowWriteActions: () => g === void 0 || k === void 0 ? void 0 : Ke({
|
|
1809
1810
|
store: e.store,
|
|
1810
|
-
log:
|
|
1811
|
+
log: M,
|
|
1811
1812
|
workflows: e.discovered.workflows ?? [],
|
|
1812
1813
|
workflowsProxy: o,
|
|
1813
|
-
workflowRuntime:
|
|
1814
|
-
workflowRunRecorder:
|
|
1815
|
-
closeChildrenForParent:
|
|
1814
|
+
workflowRuntime: d,
|
|
1815
|
+
workflowRunRecorder: k,
|
|
1816
|
+
closeChildrenForParent: Tt
|
|
1816
1817
|
}),
|
|
1817
1818
|
redriveWorkflowRun: (e) => ee ? ee(e) : Promise.reject(/* @__PURE__ */ Error("redrive: this app registers no workflows")),
|
|
1818
1819
|
resumeWorkflowRunFromStep: (e) => te ? te(e) : Promise.reject(/* @__PURE__ */ Error("resume-from-step: this app registers no workflows")),
|
|
1819
1820
|
close: async () => {
|
|
1820
|
-
|
|
1821
|
-
for (let e of
|
|
1821
|
+
Gt = !1, await Xt.drainRequests();
|
|
1822
|
+
for (let e of _e) try {
|
|
1822
1823
|
await e();
|
|
1823
1824
|
} catch (e) {
|
|
1824
|
-
|
|
1825
|
+
M.warn("serve: teardown step failed", {}, e);
|
|
1825
1826
|
}
|
|
1826
|
-
await
|
|
1827
|
+
await De?.detach(), await Te.detach(), cn?.detach(), ln?.detach(), n?.detach(), un?.detach(), an?.(), rn?.(), await m?.shutdown(), r.close(), await ne?.detach(), await d?.dispose(), await Yt(), await Xt.finish();
|
|
1827
1828
|
}
|
|
1828
1829
|
};
|
|
1829
1830
|
}, Ko = (e) => {
|
|
@@ -1856,12 +1857,12 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1856
1857
|
}, Jo = (e, t = process.env) => ({
|
|
1857
1858
|
logs: qo(e?.logs, t.VOLTRO_INSPECT_LOGS),
|
|
1858
1859
|
traces: qo(e?.traces, t.VOLTRO_INSPECT_TRACES)
|
|
1859
|
-
}), $ =
|
|
1860
|
-
let t =
|
|
1861
|
-
if (
|
|
1860
|
+
}), $ = P({ scope: "voltro:serve" }), Yo = (e, t, n) => (e === "production" || e === "staging") && t !== "memory" && n !== "0", Xo = _n, Zo = async (e) => {
|
|
1861
|
+
let t = bn(process.cwd());
|
|
1862
|
+
if (rr(t)) {
|
|
1862
1863
|
let n;
|
|
1863
1864
|
try {
|
|
1864
|
-
let e = await import(
|
|
1865
|
+
let e = await import(ir(t).href);
|
|
1865
1866
|
typeof e.runServe == "function" ? n = e.runServe : $.warn("serve bundle has no runServe export — using the standard serve path");
|
|
1866
1867
|
} catch (e) {
|
|
1867
1868
|
$.warn("serve bundle failed to load — using the standard serve path", {}, e);
|
|
@@ -1870,138 +1871,138 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
1870
1871
|
}
|
|
1871
1872
|
return Qo(e);
|
|
1872
1873
|
}, Qo = async (l) => {
|
|
1873
|
-
|
|
1874
|
-
let
|
|
1874
|
+
Pr("serve");
|
|
1875
|
+
let f = Xn();
|
|
1875
1876
|
e("serve");
|
|
1876
1877
|
try {
|
|
1877
1878
|
Hi();
|
|
1878
1879
|
} catch (e) {
|
|
1879
1880
|
throw i(e instanceof Error ? e.message : String(e));
|
|
1880
1881
|
}
|
|
1881
|
-
let
|
|
1882
|
+
let p = process.cwd(), _ = await Tt(p), le = vn({
|
|
1882
1883
|
kind: "api",
|
|
1883
|
-
configPort:
|
|
1884
|
+
configPort: _?.port,
|
|
1884
1885
|
env: process.env,
|
|
1885
1886
|
flagPort: Xo(l, "--port")
|
|
1886
1887
|
});
|
|
1887
|
-
for (let e of
|
|
1888
|
-
let
|
|
1889
|
-
ji(ki(
|
|
1890
|
-
rawEnv:
|
|
1888
|
+
for (let e of le.warnings) $.warn(e);
|
|
1889
|
+
let he = le.port;
|
|
1890
|
+
ji(ki(_?.secrets)), await sn({
|
|
1891
|
+
rawEnv: _?.env,
|
|
1891
1892
|
appType: "api",
|
|
1892
|
-
root:
|
|
1893
|
+
root: p,
|
|
1893
1894
|
log: $,
|
|
1894
1895
|
generateTypes: !1,
|
|
1895
|
-
plugins:
|
|
1896
|
-
}),
|
|
1897
|
-
let
|
|
1898
|
-
if (!r() &&
|
|
1899
|
-
let e = await import(
|
|
1896
|
+
plugins: _?.plugins ?? []
|
|
1897
|
+
}), f.mark("config");
|
|
1898
|
+
let y = (process.env.DB_DIALECT ?? _?.store ?? "memory").toLowerCase(), Oe = (y === "mariadb" || y === "postgres" || y === "mssql") && (process.env.CDC ?? "1") !== "0", ke = y === "mariadb" ? "mariadb" : y === "mssql" ? "mssql" : void 0, Ae = yn(p);
|
|
1899
|
+
if (!r() && rr(Ae)) try {
|
|
1900
|
+
let e = await import(ir(Ae).href);
|
|
1900
1901
|
if (e.modules) {
|
|
1901
1902
|
let t = {};
|
|
1902
|
-
for (let [n, r] of Object.entries(e.modules)) t[
|
|
1903
|
+
for (let [n, r] of Object.entries(e.modules)) t[tr(p, n)] = r;
|
|
1903
1904
|
n(t), $.info("precompiled api bundle loaded", { modules: Object.keys(t).length });
|
|
1904
1905
|
}
|
|
1905
1906
|
} catch (e) {
|
|
1906
1907
|
$.warn("precompiled api bundle failed to load — falling back to source", {}, e);
|
|
1907
1908
|
}
|
|
1908
|
-
let x = await
|
|
1909
|
-
root:
|
|
1910
|
-
cdc:
|
|
1911
|
-
}),
|
|
1909
|
+
let x = await Ot(p), S = await st(x, {
|
|
1910
|
+
root: p,
|
|
1911
|
+
cdc: Oe && ke !== void 0
|
|
1912
|
+
}), Ve = Lt(S);
|
|
1912
1913
|
{
|
|
1913
|
-
|
|
1914
|
-
plugins:
|
|
1914
|
+
ut({
|
|
1915
|
+
plugins: _?.plugins ?? [],
|
|
1915
1916
|
queries: S.queries,
|
|
1916
1917
|
mutations: S.mutations,
|
|
1917
1918
|
actions: S.actions,
|
|
1918
1919
|
streams: S.streams,
|
|
1919
1920
|
log: $
|
|
1920
1921
|
});
|
|
1921
|
-
let e =
|
|
1922
|
+
let e = u(S.serverOnlyLeaks, je(process.env, "strict"), Zr, "`voltro serve`");
|
|
1922
1923
|
if (e.action === "fail") throw i(e.message ?? "");
|
|
1923
1924
|
e.action === "warn" && $.warn(e.message ?? "");
|
|
1924
1925
|
}
|
|
1925
|
-
let
|
|
1926
|
+
let Ke = x.filter((e) => Yn.test(e)), qe = Ke.length > 0 ? await Jn(Ke, $.child("webhooks")) : {
|
|
1926
1927
|
outgoing: [],
|
|
1927
1928
|
incoming: [],
|
|
1928
1929
|
providers: []
|
|
1929
|
-
},
|
|
1930
|
-
...
|
|
1931
|
-
outgoing: [...
|
|
1932
|
-
},
|
|
1930
|
+
}, Je = Kn(S.events), Xe = qe.outgoing.length + qe.incoming.length + qe.providers.length + Je.length === 0 ? void 0 : {
|
|
1931
|
+
...qe,
|
|
1932
|
+
outgoing: [...qe.outgoing, ...Je]
|
|
1933
|
+
}, Ze = Mn({
|
|
1933
1934
|
nodeEnv: process.env.NODE_ENV,
|
|
1934
|
-
cdcDialect:
|
|
1935
|
-
declared:
|
|
1936
|
-
}),
|
|
1937
|
-
gates:
|
|
1935
|
+
cdcDialect: ke,
|
|
1936
|
+
declared: _?.schema
|
|
1937
|
+
}), et = Nn({
|
|
1938
|
+
gates: Ze,
|
|
1938
1939
|
runtime: {
|
|
1939
|
-
traces:
|
|
1940
|
+
traces: ye(),
|
|
1940
1941
|
undo: Li()
|
|
1941
1942
|
}
|
|
1942
1943
|
});
|
|
1943
|
-
if (
|
|
1944
|
-
let
|
|
1944
|
+
if (et !== void 0) throw i(`serve: ${et}`);
|
|
1945
|
+
let rt = jn({
|
|
1945
1946
|
mix: S.featureMix,
|
|
1946
|
-
plugins:
|
|
1947
|
-
gates:
|
|
1948
|
-
...
|
|
1949
|
-
}),
|
|
1950
|
-
spec:
|
|
1951
|
-
sqlLayer:
|
|
1947
|
+
plugins: _?.plugins ?? [],
|
|
1948
|
+
gates: Ze,
|
|
1949
|
+
...ke ? { cdcDialect: ke } : {}
|
|
1950
|
+
}), it = _?.analytics !== void 0 && _.analytics.kind !== "noop" && y !== "memory" ? (await xn(y)).makeSqlLayer(A()) : void 0, at = await dt({
|
|
1951
|
+
spec: _?.analytics,
|
|
1952
|
+
sqlLayer: it,
|
|
1952
1953
|
log: $
|
|
1953
1954
|
}), w = (() => {
|
|
1954
1955
|
let e = new Set(S.tables.map((e) => e.tableName)), t = [...S.tables];
|
|
1955
|
-
for (let n of [...
|
|
1956
|
+
for (let n of [...rt, ...at.tables]) e.has(n.tableName) || (e.add(n.tableName), t.push(n));
|
|
1956
1957
|
return t;
|
|
1957
1958
|
})();
|
|
1958
|
-
for (let e of w)
|
|
1959
|
+
for (let e of w) Er(e);
|
|
1959
1960
|
{
|
|
1960
|
-
let e = Qr(Ri(
|
|
1961
|
+
let e = Qr(Ri(ce(S), v(w)));
|
|
1961
1962
|
e !== void 0 && $.warn(e);
|
|
1962
1963
|
}
|
|
1963
|
-
let
|
|
1964
|
-
if (Yo(
|
|
1965
|
-
let e = (await
|
|
1964
|
+
let ct = (process.env.NODE_ENV ?? "").toLowerCase();
|
|
1965
|
+
if (Yo(ct, y, process.env.VOLTRO_AUTO_MIGRATE)) {
|
|
1966
|
+
let e = (await xn(y)).makeSqlLayer(A()), t = await J.runPromise(Gi.SqlClient.pipe(J.flatMap((e) => Ji(e, p)), J.provide(e), J.catchAll(() => J.succeed([]))));
|
|
1966
1967
|
t.length > 0 && ($.error(`serve: refusing to boot — ${t.length} pending file-based migration(s) have never run against this database. They perform the changes a schema diff cannot infer (data moves, backfills, table splits), so the declarative fingerprint check below cannot see them and would have let this process serve un-migrated data.`, { pending: t }), $.error("Run them from your pre-deploy job — `voltro db migrate .` (schema + files) or `voltro db files .` (files alone) — or set VOLTRO_AUTO_MIGRATE=0 to bypass every boot schema check. `voltro serve` never applies them itself: a rolling deploy would start N replicas and each would try."), process.exit(1));
|
|
1967
1968
|
let n = await J.runPromise(Gi.SqlClient.pipe(J.flatMap((e) => Yi(e, w, {
|
|
1968
|
-
appliedBy: `serve:${
|
|
1969
|
+
appliedBy: `serve:${ct}`,
|
|
1969
1970
|
environment: "prod",
|
|
1970
|
-
dialectId:
|
|
1971
|
+
dialectId: y
|
|
1971
1972
|
})), J.provide(e)));
|
|
1972
|
-
n.kind === "prod-mismatch" && ($.error(qi(n,
|
|
1973
|
-
gates:
|
|
1973
|
+
n.kind === "prod-mismatch" && ($.error(qi(n, y)), $.error(Pn({
|
|
1974
|
+
gates: Ze,
|
|
1974
1975
|
nodeEnv: process.env.NODE_ENV,
|
|
1975
|
-
cdcDialect:
|
|
1976
|
-
declared:
|
|
1977
|
-
})), $.error("serve: refusing to boot — apply the schema first (voltro db apply in a pre-deploy step), or set VOLTRO_AUTO_MIGRATE=0 to bypass this check."), process.exit(1)), $.info(qi(n,
|
|
1976
|
+
cdcDialect: ke,
|
|
1977
|
+
declared: _?.schema
|
|
1978
|
+
})), $.error("serve: refusing to boot — apply the schema first (voltro db apply in a pre-deploy step), or set VOLTRO_AUTO_MIGRATE=0 to bypass this check."), process.exit(1)), $.info(qi(n, y));
|
|
1978
1979
|
}
|
|
1979
|
-
await
|
|
1980
|
-
dialectId:
|
|
1980
|
+
await En({
|
|
1981
|
+
dialectId: y,
|
|
1981
1982
|
tables: w,
|
|
1982
|
-
mode:
|
|
1983
|
-
lockSchema:
|
|
1984
|
-
makeLayer: async () => (await
|
|
1983
|
+
mode: wn(_?.reactiveTriggers),
|
|
1984
|
+
lockSchema: A().schema,
|
|
1985
|
+
makeLayer: async () => (await xn(y)).makeSqlLayer(A()),
|
|
1985
1986
|
log: {
|
|
1986
1987
|
info: (e, t) => $.info(e, t ?? {}),
|
|
1987
1988
|
warn: (e, t) => $.warn(e, t ?? {})
|
|
1988
1989
|
}
|
|
1989
1990
|
});
|
|
1990
|
-
let
|
|
1991
|
-
|
|
1992
|
-
let
|
|
1991
|
+
let lt = xi(w);
|
|
1992
|
+
f.mark("discover");
|
|
1993
|
+
let D = await tt(_, void 0);
|
|
1993
1994
|
{
|
|
1994
|
-
let e = await c(
|
|
1995
|
+
let e = await c(D);
|
|
1995
1996
|
if (e !== void 0) throw i(`serve: ${e}`);
|
|
1996
|
-
let t = await s(
|
|
1997
|
+
let t = await s(D, y, _);
|
|
1997
1998
|
t !== void 0 && $.warn(t);
|
|
1998
1999
|
}
|
|
1999
|
-
let
|
|
2000
|
-
for (let e of
|
|
2001
|
-
dialect: String(
|
|
2000
|
+
let St = Vi(D, y);
|
|
2001
|
+
for (let e of k({
|
|
2002
|
+
dialect: String(_?.store ?? process.env.DB_DIALECT ?? "postgres"),
|
|
2002
2003
|
changeStrategy: (process.env.CDC ?? "1") === "0" ? "inline" : "cdc",
|
|
2003
2004
|
dbUrl: process.env.DB_URL,
|
|
2004
|
-
crossReplicaBus: la(
|
|
2005
|
+
crossReplicaBus: la(_?.plugins ?? [])?.broadcast.crossReplica === !0,
|
|
2005
2006
|
tables: S.tables.map((e) => ({
|
|
2006
2007
|
tableName: e.tableName,
|
|
2007
2008
|
isReactive: e.isReactive === !0
|
|
@@ -2012,214 +2013,214 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
2012
2013
|
})
|
|
2013
2014
|
})) e.level === "warn" ? $.warn(e.message) : $.info(e.message);
|
|
2014
2015
|
{
|
|
2015
|
-
let e =
|
|
2016
|
-
tables:
|
|
2016
|
+
let e = h({
|
|
2017
|
+
tables: xr().map((e) => ({ tableName: e.tableName })),
|
|
2017
2018
|
queries: S.queries.map((e) => ({
|
|
2018
2019
|
name: e.descriptor.name,
|
|
2019
2020
|
source: e.descriptor.source
|
|
2020
2021
|
}))
|
|
2021
|
-
}), t =
|
|
2022
|
+
}), t = De(e);
|
|
2022
2023
|
t !== void 0 && $.warn(t);
|
|
2023
2024
|
}
|
|
2024
|
-
|
|
2025
|
-
let { service:
|
|
2025
|
+
_?.cache && !process.env.CACHE_BACKEND && (process.env.CACHE_BACKEND = _.cache), _?.cacheRedisUrl && !process.env.CACHE_REDIS_URL && (process.env.CACHE_REDIS_URL = _.cacheRedisUrl), _?.cacheRedisDriver && !process.env.CACHE_REDIS_DRIVER && (process.env.CACHE_REDIS_DRIVER = _.cacheRedisDriver), _?.cacheKeyPrefix && !process.env.CACHE_KEY_PREFIX && (process.env.CACHE_KEY_PREFIX = _.cacheKeyPrefix);
|
|
2026
|
+
let { service: wt, invalidationBus: Et, snapshotCache: Dt, cache: kt, semantic: jt, evictSource: Mt, backend: Nt, stats: Pt, dispose: Rt } = await se({
|
|
2026
2027
|
env: process.env,
|
|
2027
|
-
semantic:
|
|
2028
|
+
semantic: _?.cacheSemantic ?? !1
|
|
2028
2029
|
});
|
|
2029
|
-
|
|
2030
|
-
let
|
|
2031
|
-
J.runFork(
|
|
2030
|
+
jt !== void 0 && $.info("semantic cache enabled — reactive eviction on live writes"), $.info(`cache backend resolved: ${Nt}` + (Nt === "redis" ? ` (driver ${process.env.CACHE_REDIS_DRIVER ?? "resp"})` : " — in-process, not cross-instance"));
|
|
2031
|
+
let Bt = (e) => {
|
|
2032
|
+
J.runFork(Et.publish(e));
|
|
2032
2033
|
};
|
|
2033
|
-
|
|
2034
|
-
if (J.runFork(
|
|
2034
|
+
D.onChange((e) => {
|
|
2035
|
+
if (J.runFork(Et.publish(e.table)), Mt !== void 0) {
|
|
2035
2036
|
let t = (e.new ?? e.old)?.id;
|
|
2036
|
-
|
|
2037
|
+
Mt({
|
|
2037
2038
|
table: e.table,
|
|
2038
2039
|
op: e.op,
|
|
2039
2040
|
...t === void 0 ? {} : { id: t }
|
|
2040
2041
|
});
|
|
2041
2042
|
}
|
|
2042
|
-
}),
|
|
2043
|
-
let { kv:
|
|
2044
|
-
|
|
2043
|
+
}), _?.kv && !process.env.KV_BACKEND && (process.env.KV_BACKEND = _.kv), _?.kvRedisUrl && !process.env.KV_REDIS_URL && (process.env.KV_REDIS_URL = _.kvRedisUrl), _?.kvKeyPrefix && !process.env.KV_KEY_PREFIX && (process.env.KV_KEY_PREFIX = _.kvKeyPrefix);
|
|
2044
|
+
let { kv: Vt, service: Ht } = await ci({ store: D });
|
|
2045
|
+
an({
|
|
2045
2046
|
log: $,
|
|
2046
|
-
max:
|
|
2047
|
-
outOfPool:
|
|
2047
|
+
max: Cn(),
|
|
2048
|
+
outOfPool: Ne(y, (process.env.CDC ?? "1") !== "0"),
|
|
2048
2049
|
readPools: t.replicationSnapshot()?.replicaCount ?? 0,
|
|
2049
2050
|
always: !0
|
|
2050
|
-
}),
|
|
2051
|
-
let
|
|
2052
|
-
store:
|
|
2053
|
-
sink:
|
|
2051
|
+
}), f.mark("store");
|
|
2052
|
+
let Wt = Vr({
|
|
2053
|
+
store: D,
|
|
2054
|
+
sink: at.sink,
|
|
2054
2055
|
log: $
|
|
2055
|
-
}),
|
|
2056
|
-
store:
|
|
2057
|
-
dialect:
|
|
2056
|
+
}), Jt = gt(_?.idempotency, D), Zt = ze({
|
|
2057
|
+
store: D,
|
|
2058
|
+
dialect: y,
|
|
2058
2059
|
log: { info: (e) => $.info(e) },
|
|
2059
|
-
...
|
|
2060
|
-
}),
|
|
2061
|
-
|
|
2062
|
-
let
|
|
2060
|
+
...Jt === void 0 ? {} : { idempotencyTtlMs: Jt.ttlMs }
|
|
2061
|
+
}), $t = _?.plugins ?? [], tn = jr(), nn, on;
|
|
2062
|
+
y !== "memory" && (nn = Wi.make((await xn(y)).makeSqlLayer(A()).pipe(Y.provideMerge(ar({})))), on = await nn.runPromise(Gi.SqlClient));
|
|
2063
|
+
let _n = [
|
|
2063
2064
|
"postgres",
|
|
2064
2065
|
"mariadb",
|
|
2065
2066
|
"mysql",
|
|
2066
2067
|
"mssql"
|
|
2067
|
-
].includes(
|
|
2068
|
-
maxIdleIntervalMs:
|
|
2069
|
-
coordinator:
|
|
2070
|
-
replicaId:
|
|
2068
|
+
].includes(y) ? ii(D, tn, $) : Pi, bn = g(_?.scheduling), Un = di({
|
|
2069
|
+
maxIdleIntervalMs: bn.pollCeilingMs,
|
|
2070
|
+
coordinator: _n,
|
|
2071
|
+
replicaId: tn,
|
|
2071
2072
|
log: $
|
|
2072
|
-
}),
|
|
2073
|
+
}), qn = [], Zn = jr(), Qn = la(_?.plugins ?? [])?.broadcast?.provider, $n = en(_?.plugins, _?.name ?? er(p));
|
|
2073
2074
|
{
|
|
2074
|
-
let e =
|
|
2075
|
+
let e = Kt(_?.plugins, _?.name ?? er(p));
|
|
2075
2076
|
e !== void 0 && $.warn(e);
|
|
2076
2077
|
}
|
|
2077
|
-
let
|
|
2078
|
-
instanceId:
|
|
2079
|
-
namespace:
|
|
2078
|
+
let N = Qt(_?.plugins, {
|
|
2079
|
+
instanceId: Zn,
|
|
2080
|
+
namespace: $n,
|
|
2080
2081
|
meta: { mode: "serve" },
|
|
2081
2082
|
logger: $
|
|
2082
|
-
}),
|
|
2083
|
-
|
|
2084
|
-
let
|
|
2085
|
-
store:
|
|
2086
|
-
members: () =>
|
|
2087
|
-
}),
|
|
2088
|
-
let e =
|
|
2083
|
+
}), nr = Mr();
|
|
2084
|
+
Nr(`${nr.host}:${he}`, nr.declared);
|
|
2085
|
+
let or = cn(), F = Jo(_?.inspect), I = He({
|
|
2086
|
+
store: D,
|
|
2087
|
+
members: () => N.membership?.list() ?? []
|
|
2088
|
+
}), sr = () => {
|
|
2089
|
+
let e = N.membership?.list().length;
|
|
2089
2090
|
return typeof e == "number" && e > 0 ? { fleetSize: e } : {};
|
|
2090
|
-
},
|
|
2091
|
+
}, cr = Hn({
|
|
2091
2092
|
mode: "serve",
|
|
2092
|
-
dialect:
|
|
2093
|
-
...
|
|
2093
|
+
dialect: y,
|
|
2094
|
+
...Qn === void 0 ? {} : { provider: Qn },
|
|
2094
2095
|
logger: $
|
|
2095
2096
|
});
|
|
2096
2097
|
G(async () => {
|
|
2097
|
-
await
|
|
2098
|
-
}),
|
|
2099
|
-
let
|
|
2100
|
-
claimedBy:
|
|
2098
|
+
await cr.stop();
|
|
2099
|
+
}), Xt(_?.reactive), m(_);
|
|
2100
|
+
let lr = T(D, {
|
|
2101
|
+
claimedBy: Ar(),
|
|
2101
2102
|
onError: (e) => $.warn("change claim failed — the claimed effect is being SKIPPED, not duplicated", { cause: String(e) })
|
|
2102
|
-
}),
|
|
2103
|
-
...
|
|
2104
|
-
instanceId:
|
|
2105
|
-
membership:
|
|
2106
|
-
...
|
|
2107
|
-
broadcastChannels: { presence: ca(
|
|
2103
|
+
}), L = {
|
|
2104
|
+
...on ? { sql: on } : {},
|
|
2105
|
+
instanceId: Zn,
|
|
2106
|
+
membership: N.membership,
|
|
2107
|
+
...Qn === void 0 ? {} : { broadcast: Qn },
|
|
2108
|
+
broadcastChannels: { presence: ca($n, "presence") },
|
|
2108
2109
|
scheduleCoordinated: (e, t, n) => {
|
|
2109
|
-
let r =
|
|
2110
|
-
return
|
|
2110
|
+
let r = Un(e, t, n);
|
|
2111
|
+
return qn.push(r), r;
|
|
2111
2112
|
},
|
|
2112
|
-
claimChange:
|
|
2113
|
+
claimChange: lr.claim
|
|
2113
2114
|
};
|
|
2114
|
-
for (let e of
|
|
2115
|
-
|
|
2116
|
-
store:
|
|
2117
|
-
...
|
|
2115
|
+
for (let e of $t) e.bindDataStore?.(St, L);
|
|
2116
|
+
Ce({
|
|
2117
|
+
store: D,
|
|
2118
|
+
...be(),
|
|
2118
2119
|
log: $
|
|
2119
2120
|
});
|
|
2120
|
-
let
|
|
2121
|
-
if (
|
|
2122
|
-
let e =
|
|
2123
|
-
|
|
2124
|
-
let n =
|
|
2125
|
-
for (let e of
|
|
2121
|
+
let ur = $t.filter((e) => typeof e.onChangeEvent == "function");
|
|
2122
|
+
if (ur.length > 0) {
|
|
2123
|
+
let e = D.changeScope ?? "local";
|
|
2124
|
+
D.onChange((t) => {
|
|
2125
|
+
let n = me(t, e);
|
|
2126
|
+
for (let e of ur) J.runFork(e.onChangeEvent(n).pipe(J.catchAllCause((t) => J.sync(() => $.warn(`plugin ${e.name} onChangeEvent failed`, { error: Ui.pretty(t) })))));
|
|
2126
2127
|
});
|
|
2127
2128
|
}
|
|
2128
|
-
let
|
|
2129
|
-
|
|
2130
|
-
let
|
|
2131
|
-
plugins:
|
|
2132
|
-
appName:
|
|
2129
|
+
let dr = x.filter((e) => In.test(e));
|
|
2130
|
+
dr.length > 0 && (await yt(dr, $), $.info(`queue: ${dr.length} consumer file(s) loaded`));
|
|
2131
|
+
let fr = zt({
|
|
2132
|
+
plugins: $t,
|
|
2133
|
+
appName: _?.name ?? "voltro-api",
|
|
2133
2134
|
appType: "api",
|
|
2134
|
-
voltroVersion:
|
|
2135
|
+
voltroVersion: kr() ?? "unknown",
|
|
2135
2136
|
log: $
|
|
2136
2137
|
});
|
|
2137
|
-
|
|
2138
|
-
let
|
|
2138
|
+
$t.length && await fr.activate(), f.mark("plugins");
|
|
2139
|
+
let pr = await fr.gatherObservability(), mr = P({ scope: "voltro:broadcast" }), hr = {
|
|
2139
2140
|
info: (e, t) => {
|
|
2140
|
-
|
|
2141
|
+
mr.info(e, t);
|
|
2141
2142
|
},
|
|
2142
2143
|
warn: (e, t) => {
|
|
2143
|
-
|
|
2144
|
+
mr.warn(e, t);
|
|
2144
2145
|
},
|
|
2145
2146
|
debug: () => {}
|
|
2146
2147
|
};
|
|
2147
|
-
|
|
2148
|
-
let
|
|
2149
|
-
|
|
2150
|
-
let
|
|
2151
|
-
store:
|
|
2152
|
-
dispatcher: () =>
|
|
2153
|
-
invalidateTable: () =>
|
|
2154
|
-
log:
|
|
2155
|
-
}),
|
|
2156
|
-
|
|
2157
|
-
let
|
|
2158
|
-
prefix:
|
|
2159
|
-
...
|
|
2160
|
-
}) : void 0,
|
|
2161
|
-
analyticsLayer:
|
|
2162
|
-
cacheService:
|
|
2163
|
-
kvService:
|
|
2164
|
-
...
|
|
2165
|
-
pluginServices:
|
|
2166
|
-
userLayers:
|
|
2167
|
-
}),
|
|
2148
|
+
F.logs.on && (un(new pn(F.logs.size)), G(ln(or)), hr.info("inspect: serving /_voltro/inspect/logs", { ring: F.logs.size }));
|
|
2149
|
+
let gr;
|
|
2150
|
+
F.traces.on && (ee(new Me(F.traces.size)), gr = ui(pt({ buffer: rn() })), hr.info("inspect: serving /_voltro/inspect/traces", { ring: F.traces.size }));
|
|
2151
|
+
let R, _r = bt({
|
|
2152
|
+
store: D,
|
|
2153
|
+
dispatcher: () => R,
|
|
2154
|
+
invalidateTable: () => Bt,
|
|
2155
|
+
log: hr
|
|
2156
|
+
}), vr = await ht(D, _, y, $n, hr, _r.onBroadcastGap), z = _?.apiKeys, yr = (typeof z == "object" ? z.prefix : void 0) ?? "voltro_", B = z ? Xr(D) : void 0, br = B ? oi({ flush: si(B) }) : void 0;
|
|
2157
|
+
br && G(() => br.shutdown());
|
|
2158
|
+
let Sr = B ? ai(B, {
|
|
2159
|
+
prefix: yr,
|
|
2160
|
+
...br ? { usage: br } : {}
|
|
2161
|
+
}) : void 0, wr = Sr ? [$r(Sr, { prefix: yr })] : [], Tr = vt([..._?.auth?.strategies ?? [], ...wr], ga(_?.plugins ?? []), _?.auth?.anonymousTenantRequired ?? !1, _?.auth, () => St), V = [..._?.restRoutes ?? [], ...Sr ? Br(Sr, (typeof z == "object" ? z.managementPath : void 0) ?? "/v1/api-keys") : []], Dr = $t.map((e) => e.services).filter((e) => e !== void 0), Fr = Y.mergeAll(qt({
|
|
2162
|
+
analyticsLayer: at.layer,
|
|
2163
|
+
cacheService: wt,
|
|
2164
|
+
kvService: Ht,
|
|
2165
|
+
...jt === void 0 ? {} : { semanticCache: jt },
|
|
2166
|
+
pluginServices: Dr,
|
|
2167
|
+
userLayers: _?.layers ?? []
|
|
2168
|
+
}), $e(_?.http ?? {})), H = await At({
|
|
2168
2169
|
files: x,
|
|
2169
|
-
store:
|
|
2170
|
+
store: D,
|
|
2170
2171
|
log: $,
|
|
2171
2172
|
seedPolicy: "report",
|
|
2172
|
-
seedPattern:
|
|
2173
|
-
loadSeedFiles:
|
|
2174
|
-
startupPattern:
|
|
2173
|
+
seedPattern: Fn,
|
|
2174
|
+
loadSeedFiles: Tn,
|
|
2175
|
+
startupPattern: Vn,
|
|
2175
2176
|
loadStartupFiles: a,
|
|
2176
2177
|
runStartups: o,
|
|
2177
|
-
emailPattern:
|
|
2178
|
-
loadEmailFiles:
|
|
2178
|
+
emailPattern: _t,
|
|
2179
|
+
loadEmailFiles: mt,
|
|
2179
2180
|
registerEmailTemplates: _a
|
|
2180
2181
|
});
|
|
2181
|
-
(
|
|
2182
|
-
startups:
|
|
2183
|
-
emailTemplates:
|
|
2184
|
-
}),
|
|
2185
|
-
await
|
|
2186
|
-
}),
|
|
2187
|
-
demands:
|
|
2182
|
+
(H.startupCount > 0 || H.emailCount > 0) && $.info("boot lifecycle", {
|
|
2183
|
+
startups: H.startupCount,
|
|
2184
|
+
emailTemplates: H.emailCount
|
|
2185
|
+
}), H.startups !== void 0 && G(async () => {
|
|
2186
|
+
await H.startups.stop();
|
|
2187
|
+
}), de({
|
|
2188
|
+
demands: ve(Ve),
|
|
2188
2189
|
isRegistered: (e) => ei(e) !== void 0
|
|
2189
2190
|
});
|
|
2190
|
-
let
|
|
2191
|
-
schedules:
|
|
2191
|
+
let Ir = ft({
|
|
2192
|
+
schedules: It({
|
|
2192
2193
|
schedules: S.schedules,
|
|
2193
|
-
seeds:
|
|
2194
|
-
store:
|
|
2194
|
+
seeds: H.seeds,
|
|
2195
|
+
store: D,
|
|
2195
2196
|
log: $.child("seeds")
|
|
2196
2197
|
}),
|
|
2197
2198
|
workflows: S.workflows ?? [],
|
|
2198
2199
|
log: $.child("workflow-schedules")
|
|
2199
|
-
}),
|
|
2200
|
+
}), Lr = _?.scheduling ?? {}, Rr = Lr.trigger ?? "self", zr = /* @__PURE__ */ new Set([
|
|
2200
2201
|
"postgres",
|
|
2201
2202
|
"mysql",
|
|
2202
2203
|
"mariadb",
|
|
2203
2204
|
"mssql"
|
|
2204
|
-
]),
|
|
2205
|
-
|
|
2206
|
-
let
|
|
2207
|
-
if (
|
|
2208
|
-
if (
|
|
2209
|
-
let e = await
|
|
2205
|
+
]), Hr = Lr.coordination ?? (zr.has(y) ? "advisoryLock" : "single"), Ur = Hr === "cluster" && zr.has(y), Wr = Ur ? "cluster" : Hr === "advisoryLock" && zr.has(y) ? "advisoryLock" : "single";
|
|
2206
|
+
Hr === "cluster" && !Ur && $.warn("scheduling.coordination=cluster needs a sql-backed store except sqlite — falling back to single"), Hr === "advisoryLock" && !zr.has(y) && $.warn("scheduling.coordination=advisoryLock needs a SQL store (the claim-row gate) — falling back to single");
|
|
2207
|
+
let Gr, U = S.workflows.length > 0 || S.workflowWorkers.length > 0 || S.eventTriggers.length > 0 || (Xe?.outgoing.length ?? 0) > 0 || Ur, Kr;
|
|
2208
|
+
if (U) {
|
|
2209
|
+
if (y === "mssql") {
|
|
2210
|
+
let e = await Gn(process.cwd());
|
|
2210
2211
|
e && $.warn(e);
|
|
2211
2212
|
}
|
|
2212
|
-
let [{ WorkflowEngine: e }, { makeClusterCronLayer: t, workflowEngineLayer: n, resolveRunnerStorage: r, resolveFailoverTuning: i }] = await Promise.all([import("@effect/workflow"), import("@voltro/workflow/cluster")]), a =
|
|
2213
|
+
let [{ WorkflowEngine: e }, { makeClusterCronLayer: t, workflowEngineLayer: n, resolveRunnerStorage: r, resolveFailoverTuning: i }] = await Promise.all([import("@effect/workflow"), import("@voltro/workflow/cluster")]), a = Ur ? Ir.filter((e) => (e.trigger ?? Rr) === "self").map((e) => t({
|
|
2213
2214
|
name: e.name,
|
|
2214
2215
|
cron: Yr(e),
|
|
2215
2216
|
execute: async () => {
|
|
2216
|
-
await
|
|
2217
|
+
await Gr?.fireFromCluster(e.name);
|
|
2217
2218
|
}
|
|
2218
2219
|
})) : [];
|
|
2219
|
-
Kr =
|
|
2220
|
-
let e = await
|
|
2220
|
+
Kr = y === "memory" ? e.layerMemory : await (async () => {
|
|
2221
|
+
let e = await xn(y), t = r({ sqliteFamily: e.id === "sqlite" || e.id === "turso" });
|
|
2221
2222
|
return $.info(`workflow engine: cluster-${t}, dialect=${e.id}` + (t === "memory" ? " — single-process durable replay, no cross-pod shard handoff" + (e.id !== "sqlite" && e.id !== "turso" ? " (VOLTRO_WORKFLOW_RUNNER_STORAGE=memory: SqlRunnerStorage/cluster_runners + GET_LOCK skipped)" : "") : "")), n({
|
|
2222
|
-
sqlClientLayer: e.makeSqlLayer(
|
|
2223
|
+
sqlClientLayer: e.makeSqlLayer(A()),
|
|
2223
2224
|
runnerStorage: t,
|
|
2224
2225
|
dialectId: e.id,
|
|
2225
2226
|
...process.env.VOLTRO_WORKFLOW_RUNNER_PORT ? { runnerListenPort: Number(process.env.VOLTRO_WORKFLOW_RUNNER_PORT) } : {},
|
|
@@ -2228,118 +2229,118 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
2228
2229
|
});
|
|
2229
2230
|
})();
|
|
2230
2231
|
}
|
|
2231
|
-
let W =
|
|
2232
|
+
let W = Ut($t, Wn()), qr = x.filter((e) => /\.subscribe\.tsx?$/.test(e)), Jr = qr.length > 0 ? await ot(qr, $) : [], ti = x.filter((e) => /\.reaction\.tsx?$/.test(e)), ni = ti.length > 0 ? await Ge(ti, $) : [], ri = x.filter((e) => Ln.test(e)), li = ri.length > 0 ? await nt(ri, $) : [], fi = x.filter((e) => /\.aggregate\.tsx?$/.test(e)), pi = fi.length > 0 ? await ge(fi, $) : [];
|
|
2232
2233
|
{
|
|
2233
|
-
let e = Qr(Ri(
|
|
2234
|
+
let e = Qr(Ri(ce({ aggregates: pi.map((e) => e.definition) }), v(w)));
|
|
2234
2235
|
e !== void 0 && $.warn(e);
|
|
2235
2236
|
}
|
|
2236
|
-
let mi =
|
|
2237
|
-
if (pi.length > 0 &&
|
|
2238
|
-
let e = (await
|
|
2239
|
-
mi =
|
|
2237
|
+
let mi = b();
|
|
2238
|
+
if (pi.length > 0 && y !== "memory") try {
|
|
2239
|
+
let e = (await xn(y)).makeSqlLayer(A());
|
|
2240
|
+
mi = Pe(e);
|
|
2240
2241
|
} catch (e) {
|
|
2241
2242
|
$.warn("aggregate: SQL storage init failed — falling back to in-process", { err: String(e) });
|
|
2242
2243
|
}
|
|
2243
|
-
let hi =
|
|
2244
|
+
let hi = y === "memory" ? Pi : ii(D, `aggregate@${process.pid}`, $), gi = x.filter((e) => Rn.test(e)), _i = gi.length > 0 ? await Se(gi, $) : [], vi = x.filter((e) => zn.test(e)), yi = vi.length > 0 ? await Ct(vi, $) : [], bi = x.filter((e) => Bn.test(e)), Si = bi.length > 0 ? await Te(bi, $) : [], Ci = [], wi = [], Ti = x.filter((e) => Dn.test(e));
|
|
2244
2245
|
if (Ti.length > 0) {
|
|
2245
|
-
let e = $.child("agent"), t = x.filter((e) =>
|
|
2246
|
-
t.length > 0 && await
|
|
2247
|
-
let n = await
|
|
2248
|
-
for (let e of n.agents) for (let t of
|
|
2246
|
+
let e = $.child("agent"), t = x.filter((e) => An.test(e));
|
|
2247
|
+
t.length > 0 && await On(t, e);
|
|
2248
|
+
let n = await kn(Ti, e);
|
|
2249
|
+
for (let e of n.agents) for (let t of Gt(e)) (t.kind === "action" ? Ci : wi).push({
|
|
2249
2250
|
file: t.file,
|
|
2250
2251
|
descriptor: t.descriptor,
|
|
2251
2252
|
executor: t.executor
|
|
2252
2253
|
});
|
|
2253
2254
|
n.agents.length > 0 && e.info("synthesized agent routes", { agents: n.agents.map((e) => e.descriptor.name) });
|
|
2254
2255
|
}
|
|
2255
|
-
|
|
2256
|
+
f.mark("workflow");
|
|
2256
2257
|
let K = () => {
|
|
2257
2258
|
let e = q.workflowWriteActions();
|
|
2258
2259
|
if (e === void 0) throw Error("workflow actions: this app registers no workflows");
|
|
2259
2260
|
return e;
|
|
2260
|
-
}, Ei =
|
|
2261
|
-
dialect:
|
|
2262
|
-
...
|
|
2263
|
-
}), Di =
|
|
2261
|
+
}, Ei = Cr({
|
|
2262
|
+
dialect: y,
|
|
2263
|
+
...A()
|
|
2264
|
+
}), Di = y === "memory" ? void 0 : (await xn(y)).makeSqlLayer(A()), Oi = async () => E({
|
|
2264
2265
|
sqlLayer: Di,
|
|
2265
2266
|
declared: w,
|
|
2266
2267
|
log: $
|
|
2267
2268
|
}), Ai = {
|
|
2268
2269
|
kind: "api",
|
|
2269
2270
|
meta: {
|
|
2270
|
-
name:
|
|
2271
|
-
voltroVersion:
|
|
2272
|
-
port:
|
|
2273
|
-
mode:
|
|
2274
|
-
store:
|
|
2275
|
-
cdc:
|
|
2271
|
+
name: _?.name ?? "voltro-api",
|
|
2272
|
+
voltroVersion: j,
|
|
2273
|
+
port: he,
|
|
2274
|
+
mode: Or(),
|
|
2275
|
+
store: y,
|
|
2276
|
+
cdc: Oe ? "on" : "off",
|
|
2276
2277
|
...Ei === void 0 ? {} : { databaseId: Ei }
|
|
2277
2278
|
},
|
|
2278
|
-
rpc:
|
|
2279
|
-
workflows:
|
|
2279
|
+
rpc: xe(S, p),
|
|
2280
|
+
workflows: we(S, p),
|
|
2280
2281
|
migrations: Oi,
|
|
2281
2282
|
events: () => q.eventsSnapshot(),
|
|
2282
2283
|
agentTools: () => q.agentTools(),
|
|
2283
2284
|
invariantChecks: () => ({
|
|
2284
2285
|
mode: "serve",
|
|
2285
|
-
accessGate:
|
|
2286
|
-
config:
|
|
2286
|
+
accessGate: Ve,
|
|
2287
|
+
config: _,
|
|
2287
2288
|
serverOnlyLeaks: S.serverOnlyLeaks,
|
|
2288
2289
|
migrations: Oi
|
|
2289
2290
|
}),
|
|
2290
2291
|
members: () => q.membersSnapshot(),
|
|
2291
2292
|
inspectFireSchedule: async ({ name: e, trigger: t }) => {
|
|
2292
|
-
if (!
|
|
2293
|
-
return { runId: await
|
|
2293
|
+
if (!Gr) throw Error("scheduler not started — this app registers no self-triggered schedules (all schedules are trigger:'external', or there are none).");
|
|
2294
|
+
return { runId: await Gr.fireNow(e, t) ?? null };
|
|
2294
2295
|
},
|
|
2295
|
-
inspectBackfillSchedule:
|
|
2296
|
-
getHandle: () =>
|
|
2297
|
-
getSchedules: () =>
|
|
2296
|
+
inspectBackfillSchedule: O({
|
|
2297
|
+
getHandle: () => Gr,
|
|
2298
|
+
getSchedules: () => Ir
|
|
2298
2299
|
}),
|
|
2299
|
-
...
|
|
2300
|
-
store:
|
|
2301
|
-
discoveredWebhooks:
|
|
2300
|
+
...Xe === void 0 ? {} : { webhooks: () => xt({
|
|
2301
|
+
store: D,
|
|
2302
|
+
discoveredWebhooks: Xe
|
|
2302
2303
|
}) },
|
|
2303
2304
|
plugins: () => ({
|
|
2304
|
-
plugins:
|
|
2305
|
+
plugins: fr.snapshot(),
|
|
2305
2306
|
capturedAt: Date.now()
|
|
2306
2307
|
}),
|
|
2307
|
-
env: () =>
|
|
2308
|
-
...
|
|
2309
|
-
plugins:
|
|
2308
|
+
env: () => mn(_?.name ?? er(p), {
|
|
2309
|
+
..._?.env !== void 0 && aa(_.env) ? { contract: _.env } : {},
|
|
2310
|
+
plugins: _?.plugins ?? []
|
|
2310
2311
|
}),
|
|
2311
|
-
dataCache: () =>
|
|
2312
|
-
stats:
|
|
2313
|
-
backendKind:
|
|
2312
|
+
dataCache: () => ne({
|
|
2313
|
+
stats: Pt,
|
|
2314
|
+
backendKind: Nt
|
|
2314
2315
|
}),
|
|
2315
|
-
subscriptions: () =>
|
|
2316
|
-
fleetObservations: (e) =>
|
|
2317
|
-
peerAddress: (e) =>
|
|
2318
|
-
inspectTables: () =>
|
|
2319
|
-
inspectRows:
|
|
2320
|
-
store:
|
|
2316
|
+
subscriptions: () => Yt(() => R),
|
|
2317
|
+
fleetObservations: (e) => I.fleet(e),
|
|
2318
|
+
peerAddress: (e) => I.addressOf(e),
|
|
2319
|
+
inspectTables: () => ue(w),
|
|
2320
|
+
inspectRows: _e({
|
|
2321
|
+
store: D,
|
|
2321
2322
|
tables: w,
|
|
2322
2323
|
mask: !0
|
|
2323
2324
|
}),
|
|
2324
2325
|
metrics: (e) => q.rpcMetrics().snapshot(e),
|
|
2325
|
-
cluster: () =>
|
|
2326
|
-
store:
|
|
2327
|
-
dialect:
|
|
2328
|
-
useClusterCron:
|
|
2329
|
-
scheduleCoordChoice:
|
|
2326
|
+
cluster: () => Fe({
|
|
2327
|
+
store: D,
|
|
2328
|
+
dialect: y,
|
|
2329
|
+
useClusterCron: Ur,
|
|
2330
|
+
scheduleCoordChoice: Hr
|
|
2330
2331
|
}),
|
|
2331
|
-
inspectSchedules: () =>
|
|
2332
|
-
schedules:
|
|
2333
|
-
defaultTrigger:
|
|
2334
|
-
coordination:
|
|
2332
|
+
inspectSchedules: () => Ee({
|
|
2333
|
+
schedules: Ir,
|
|
2334
|
+
defaultTrigger: Rr,
|
|
2335
|
+
coordination: Wr
|
|
2335
2336
|
}),
|
|
2336
|
-
inspectScheduleRuns: (e) =>
|
|
2337
|
-
...
|
|
2338
|
-
controls:
|
|
2337
|
+
inspectScheduleRuns: (e) => ie(D, e),
|
|
2338
|
+
...oe(D, {
|
|
2339
|
+
controls: re(S.workflows ?? []),
|
|
2339
2340
|
active: (S.workflows?.length ?? 0) > 0,
|
|
2340
2341
|
cancellation: () => q.flowControlHealth()
|
|
2341
2342
|
}),
|
|
2342
|
-
webhookActions:
|
|
2343
|
+
webhookActions: Re(() => q.webhooksService()),
|
|
2343
2344
|
inspectStartWorkflow: (e) => K().inspectStartWorkflow(e),
|
|
2344
2345
|
inspectCancelWorkflowRun: (e) => K().inspectCancelWorkflowRun(e),
|
|
2345
2346
|
inspectSuspendWorkflowRun: (e) => K().inspectSuspendWorkflowRun(e),
|
|
@@ -2348,13 +2349,13 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
2348
2349
|
inspectRetryWorkflowRun: (e) => K().inspectRetryWorkflowRun(e),
|
|
2349
2350
|
inspectSignalWorkflowRun: (e) => K().inspectSignalWorkflowRun(e),
|
|
2350
2351
|
inspectUpdateWorkflowRun: (e) => K().inspectUpdateWorkflowRun(e),
|
|
2351
|
-
inspectInferences: (e) =>
|
|
2352
|
-
store:
|
|
2352
|
+
inspectInferences: (e) => M({
|
|
2353
|
+
store: D,
|
|
2353
2354
|
active: (S.workflows?.length ?? 0) > 0,
|
|
2354
2355
|
dispatcher: () => q.inferenceHealth()
|
|
2355
2356
|
}, e.limit === void 0 ? {} : { limit: e.limit }),
|
|
2356
|
-
...
|
|
2357
|
-
store:
|
|
2357
|
+
...Le({
|
|
2358
|
+
store: D,
|
|
2358
2359
|
cancelRun: async (e) => await q.runCanceller()?.(e) ?? !1,
|
|
2359
2360
|
retryRun: async (e) => K().inspectRetryWorkflowRun({ runId: e }),
|
|
2360
2361
|
redriveRun: async (e) => q.redriveWorkflowRun({ runId: e }),
|
|
@@ -2362,22 +2363,22 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
2362
2363
|
}),
|
|
2363
2364
|
inspectRedriveWorkflowRun: (e) => q.redriveWorkflowRun(e),
|
|
2364
2365
|
inspectResumeWorkflowRunFromStep: (e) => q.resumeWorkflowRunFromStep(e)
|
|
2365
|
-
}, Mi = (process.env.VOLTRO_TENANT_ISOLATION ??
|
|
2366
|
-
let e = await
|
|
2367
|
-
return
|
|
2366
|
+
}, Mi = (process.env.VOLTRO_TENANT_ISOLATION ?? _?.tenancy?.isolation) === "namespace", Ni = Mi && y !== "memory" ? await (async () => {
|
|
2367
|
+
let e = await xn(y);
|
|
2368
|
+
return Ie({
|
|
2368
2369
|
tables: w,
|
|
2369
|
-
sqlLayer: e.makeSqlLayer(
|
|
2370
|
-
dialect:
|
|
2370
|
+
sqlLayer: e.makeSqlLayer(A()),
|
|
2371
|
+
dialect: y,
|
|
2371
2372
|
options: { retryFilter: e.retryFilter },
|
|
2372
2373
|
log: {
|
|
2373
2374
|
info: (e, t) => $.info(e, t),
|
|
2374
2375
|
error: (e, t, n) => $.error(e, t ?? {}, n)
|
|
2375
2376
|
}
|
|
2376
2377
|
});
|
|
2377
|
-
})() : void 0, Fi = await
|
|
2378
|
-
input:
|
|
2378
|
+
})() : void 0, Fi = await Qe({
|
|
2379
|
+
input: _?.tenancy?.residency,
|
|
2379
2380
|
namespaceIsolationOn: Mi,
|
|
2380
|
-
makeStoreForUrl: (e, t) =>
|
|
2381
|
+
makeStoreForUrl: (e, t) => tt(_, void 0, Sn(A(), t)),
|
|
2381
2382
|
log: {
|
|
2382
2383
|
info: (e, t) => $.info(e, t),
|
|
2383
2384
|
warn: (e, t) => $.warn(e, t)
|
|
@@ -2387,43 +2388,43 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
2387
2388
|
await Fi.close();
|
|
2388
2389
|
});
|
|
2389
2390
|
let q = await Go({
|
|
2390
|
-
bootTiming:
|
|
2391
|
-
claimChange:
|
|
2392
|
-
broadcastNamespace:
|
|
2391
|
+
bootTiming: f,
|
|
2392
|
+
claimChange: lr.claim,
|
|
2393
|
+
broadcastNamespace: $n,
|
|
2393
2394
|
scheduling: (() => {
|
|
2394
|
-
let e =
|
|
2395
|
+
let e = bn;
|
|
2395
2396
|
return {
|
|
2396
2397
|
admissionDrainMs: e.admissionDrainMs,
|
|
2397
2398
|
inferenceTickMs: e.inferenceTickMs,
|
|
2398
2399
|
cancelSweepMs: e.cancelSweepMs,
|
|
2399
2400
|
stalenessSweepMs: e.stalenessSweepMs,
|
|
2400
2401
|
scheduleHeartbeatMs: e.scheduleHeartbeatMs,
|
|
2401
|
-
disarmWhenIdle:
|
|
2402
|
-
changeScope:
|
|
2403
|
-
broadcastAttached:
|
|
2402
|
+
disarmWhenIdle: Be({
|
|
2403
|
+
changeScope: D.changeScope,
|
|
2404
|
+
broadcastAttached: vr !== void 0
|
|
2404
2405
|
})
|
|
2405
2406
|
};
|
|
2406
2407
|
})(),
|
|
2407
|
-
...
|
|
2408
|
-
...
|
|
2409
|
-
workflowRecording:
|
|
2408
|
+
..._?.workflows?.staleness === void 0 ? {} : { workflowStaleness: _.workflows.staleness },
|
|
2409
|
+
..._?.workflows?.suspendSignalHintMs === void 0 ? {} : { workflowSuspendSignalHintMs: _.workflows.suspendSignalHintMs },
|
|
2410
|
+
workflowRecording: ae(_?.workflows?.recording),
|
|
2410
2411
|
membership: {
|
|
2411
|
-
...
|
|
2412
|
-
instanceId:
|
|
2412
|
+
...N,
|
|
2413
|
+
instanceId: Zn
|
|
2413
2414
|
},
|
|
2414
2415
|
security: {
|
|
2415
|
-
defaultDeny:
|
|
2416
|
-
...
|
|
2416
|
+
defaultDeny: Ye(_),
|
|
2417
|
+
...Ue(_)
|
|
2417
2418
|
},
|
|
2418
|
-
approvals: { defaultExpiryMs:
|
|
2419
|
-
...
|
|
2420
|
-
...
|
|
2421
|
-
restRoutes:
|
|
2422
|
-
...
|
|
2423
|
-
config:
|
|
2424
|
-
root:
|
|
2419
|
+
approvals: { defaultExpiryMs: C(_) },
|
|
2420
|
+
..._?.plugins === void 0 ? {} : { plugins: _.plugins },
|
|
2421
|
+
...Jt ? { idempotency: Jt } : {},
|
|
2422
|
+
restRoutes: V,
|
|
2423
|
+
..._?.grpc === void 0 ? {} : { grpc: {
|
|
2424
|
+
config: _.grpc,
|
|
2425
|
+
root: p
|
|
2425
2426
|
} },
|
|
2426
|
-
appProcedures:
|
|
2427
|
+
appProcedures: Ve,
|
|
2427
2428
|
discovered: {
|
|
2428
2429
|
wsGateways: S.wsGateways,
|
|
2429
2430
|
queries: [...S.queries, ...wi],
|
|
@@ -2434,7 +2435,7 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
2434
2435
|
workflows: S.workflows,
|
|
2435
2436
|
workflowWorkers: S.workflowWorkers,
|
|
2436
2437
|
eventTriggers: S.eventTriggers,
|
|
2437
|
-
schedules:
|
|
2438
|
+
schedules: Ir,
|
|
2438
2439
|
subscribers: Jr,
|
|
2439
2440
|
outboxHandlers: li,
|
|
2440
2441
|
connections: S.connections,
|
|
@@ -2443,98 +2444,98 @@ var ka = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
|
|
|
2443
2444
|
expectations: _i,
|
|
2444
2445
|
budgets: yi,
|
|
2445
2446
|
experiments: Si,
|
|
2446
|
-
...
|
|
2447
|
+
...Xe === void 0 ? {} : { webhooks: Xe }
|
|
2447
2448
|
},
|
|
2448
2449
|
log: $,
|
|
2449
|
-
analytics:
|
|
2450
|
+
analytics: at.sink,
|
|
2450
2451
|
aggregateStorage: mi,
|
|
2451
2452
|
aggregateCoordinator: hi,
|
|
2452
|
-
store:
|
|
2453
|
-
kv:
|
|
2454
|
-
cache:
|
|
2455
|
-
snapshotCache:
|
|
2456
|
-
...
|
|
2457
|
-
schemaRegistry:
|
|
2453
|
+
store: D,
|
|
2454
|
+
kv: Vt,
|
|
2455
|
+
cache: kt,
|
|
2456
|
+
snapshotCache: Dt,
|
|
2457
|
+
..._?.reactive === void 0 ? {} : { reactive: _.reactive },
|
|
2458
|
+
schemaRegistry: lt,
|
|
2458
2459
|
tenantScopedTables: S.tenantScopedTables,
|
|
2459
2460
|
softDeleteScopedTables: S.softDeleteScopedTables,
|
|
2460
|
-
dataTransferSnapshot: Ki(w,
|
|
2461
|
-
dataTransferDialect:
|
|
2461
|
+
dataTransferSnapshot: Ki(w, y),
|
|
2462
|
+
dataTransferDialect: y,
|
|
2462
2463
|
...Ni === void 0 ? {} : { ensureTenantProvisioned: Ni.ensure },
|
|
2463
2464
|
...Fi === void 0 ? {} : { resolveResidentStore: Fi.resolveStore },
|
|
2464
|
-
tenantIsolation: (process.env.VOLTRO_TENANT_ISOLATION ??
|
|
2465
|
-
resolveSubject: (e, t) =>
|
|
2465
|
+
tenantIsolation: (process.env.VOLTRO_TENANT_ISOLATION ?? _?.tenancy?.isolation) === "namespace" ? "namespace" : "shared-schema",
|
|
2466
|
+
resolveSubject: (e, t) => Tr({
|
|
2466
2467
|
headers: e,
|
|
2467
2468
|
clientId: t
|
|
2468
2469
|
}),
|
|
2469
|
-
...
|
|
2470
|
-
...
|
|
2471
|
-
httpRoutes:
|
|
2472
|
-
getStore: () =>
|
|
2473
|
-
...
|
|
2470
|
+
..._?.auth === void 0 ? {} : { authority: _.auth },
|
|
2471
|
+
..._?.agents === void 0 ? {} : { agents: _.agents },
|
|
2472
|
+
httpRoutes: $t.flatMap((e) => e.httpRoutes ?? []),
|
|
2473
|
+
getStore: () => St,
|
|
2474
|
+
...Fr ? { baseLayer: Fr } : {},
|
|
2474
2475
|
...Kr === void 0 ? {} : { workflowEngineLayer: Kr },
|
|
2475
|
-
scheduleDefaultTrigger:
|
|
2476
|
-
scheduleCoordination:
|
|
2477
|
-
scheduleArmSelf: !
|
|
2478
|
-
dormancy: process.env.VOLTRO_DORMANCY === "sleep" || process.env.VOLTRO_DORMANCY === "always-on" ? process.env.VOLTRO_DORMANCY :
|
|
2479
|
-
scheduleReplicaId:
|
|
2476
|
+
scheduleDefaultTrigger: Rr,
|
|
2477
|
+
scheduleCoordination: Wr,
|
|
2478
|
+
scheduleArmSelf: !Ur,
|
|
2479
|
+
dormancy: process.env.VOLTRO_DORMANCY === "sleep" || process.env.VOLTRO_DORMANCY === "always-on" ? process.env.VOLTRO_DORMANCY : _?.dormancy ?? "always-on",
|
|
2480
|
+
scheduleReplicaId: jr(),
|
|
2480
2481
|
...W === void 0 ? {} : { scheduleFireInterceptor: W },
|
|
2481
2482
|
onSchedulerReady: (e) => {
|
|
2482
|
-
|
|
2483
|
+
Gr = e;
|
|
2483
2484
|
},
|
|
2484
|
-
inspectStream:
|
|
2485
|
-
inspectRoute: { handle: async (e, t, n, r) =>
|
|
2485
|
+
inspectStream: pe(or),
|
|
2486
|
+
inspectRoute: { handle: async (e, t, n, r) => F.logs.on && n === "GET" && (e === "/_voltro/inspect/logs" || e.startsWith("/_voltro/inspect/logs?")) ? dn(e, fn(), t) : F.traces.on && n === "GET" && (e === "/_voltro/inspect/traces" || e.startsWith("/_voltro/inspect/traces?")) ? fe(e, rn()) : await d(e, Ai, t, {
|
|
2486
2487
|
method: n,
|
|
2487
2488
|
...r === void 0 ? {} : { body: r },
|
|
2488
|
-
...
|
|
2489
|
-
}) || ((n === "GET" ? await
|
|
2489
|
+
...sr()
|
|
2490
|
+
}) || ((n === "GET" ? await gn(e, Ai, t, {
|
|
2490
2491
|
method: n,
|
|
2491
|
-
...
|
|
2492
|
-
}) : null) ??
|
|
2492
|
+
...sr()
|
|
2493
|
+
}) : null) ?? hn(e, Ai, t, {
|
|
2493
2494
|
method: n,
|
|
2494
2495
|
...r === void 0 ? {} : { body: r },
|
|
2495
|
-
...
|
|
2496
|
+
...sr()
|
|
2496
2497
|
}) ?? {
|
|
2497
2498
|
status: 404,
|
|
2498
2499
|
contentType: "application/json",
|
|
2499
2500
|
body: JSON.stringify({ error: "not an inspect route" })
|
|
2500
2501
|
}) },
|
|
2501
|
-
...
|
|
2502
|
-
observability:
|
|
2503
|
-
...
|
|
2504
|
-
...
|
|
2505
|
-
port:
|
|
2506
|
-
...
|
|
2507
|
-
...
|
|
2502
|
+
..._?.name === void 0 ? {} : { appName: _.name },
|
|
2503
|
+
observability: pr,
|
|
2504
|
+
..._?.health === void 0 ? {} : { health: _.health },
|
|
2505
|
+
...gr === void 0 ? {} : { traceSink: gr },
|
|
2506
|
+
port: he,
|
|
2507
|
+
..._?.transport?.wsPath ? { path: _.transport.wsPath } : {},
|
|
2508
|
+
..._?.http === void 0 ? {} : { http: _.http }
|
|
2508
2509
|
});
|
|
2509
|
-
|
|
2510
|
+
R = q.dispatcher;
|
|
2510
2511
|
let Ii = () => {
|
|
2511
|
-
|
|
2512
|
+
or.emit("subscriptions", Yt(() => R));
|
|
2512
2513
|
}, zi = q.dispatcher.onSubscriptionsChange(Ii);
|
|
2513
|
-
return Ii(),
|
|
2514
|
+
return Ii(), We(te([
|
|
2514
2515
|
S.queries,
|
|
2515
2516
|
S.mutations,
|
|
2516
2517
|
S.actions,
|
|
2517
2518
|
S.streams
|
|
2518
2519
|
]), (e) => {
|
|
2519
2520
|
$.warn(e);
|
|
2520
|
-
}), $.info(`API listening on :${
|
|
2521
|
-
dialect:
|
|
2521
|
+
}), $.info(`API listening on :${he}`, {
|
|
2522
|
+
dialect: y,
|
|
2522
2523
|
queries: S.queries.length,
|
|
2523
2524
|
mutations: S.mutations.length,
|
|
2524
2525
|
actions: S.actions.length,
|
|
2525
2526
|
streams: S.streams.length,
|
|
2526
2527
|
workflows: S.workflows.length,
|
|
2527
2528
|
workflowWorkers: S.workflowWorkers.length,
|
|
2528
|
-
schedules:
|
|
2529
|
-
scheduleCoordination:
|
|
2530
|
-
}),
|
|
2531
|
-
for (let e of
|
|
2532
|
-
|
|
2529
|
+
schedules: Ir.length,
|
|
2530
|
+
scheduleCoordination: Wr
|
|
2531
|
+
}), f.finish($), G(async () => {
|
|
2532
|
+
for (let e of qn) e.stop();
|
|
2533
|
+
Zt.stop(), zi(), I.stop();
|
|
2533
2534
|
try {
|
|
2534
|
-
await q.close(),
|
|
2535
|
-
mirror:
|
|
2535
|
+
await q.close(), Rt(), nn?.dispose(), await fr.deactivate(), await vr?.close(), await Ft({
|
|
2536
|
+
mirror: Wt,
|
|
2536
2537
|
log: $
|
|
2537
|
-
}), await
|
|
2538
|
+
}), await at.dispose(), await D.close?.();
|
|
2538
2539
|
} catch (e) {
|
|
2539
2540
|
console.error("serve: shutdown step failed, exiting anyway:", e);
|
|
2540
2541
|
}
|