@voltro/cli 0.43.1 → 0.44.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 +65 -0
- package/dist/{apiBuild-DF0f69Gf.js → apiBuild-DvWreIQP.js} +1 -1
- package/dist/apiBuild-XaW40W8x.js +2 -0
- package/dist/bin.js +1 -1
- package/dist/{build-LC_IJaHL.js → build-Ckc-FA7d.js} +6 -6
- package/dist/{checkCommand-DBpTSK8d.js → checkCommand-AlbawIal.js} +1 -1
- package/dist/{checkCommand-DDxwJCja.js → checkCommand-BNfEs4KG.js} +2 -2
- package/dist/{codegenCommand-LjxfK4Am.js → codegenCommand-iClXoRCW.js} +1 -1
- package/dist/{codemodRunner-Cnnz4-I7.js → codemodRunner-BKTnaGOz.js} +22 -0
- package/dist/{commands-CbQcuWsE.js → commands-fsnezHLH.js} +18 -18
- package/dist/{dashboardCommand-CAHjCe_9.js → dashboardCommand-DHDmlo9A.js} +1 -1
- package/dist/dataCommand-sfpGV694.js +867 -0
- package/dist/{dev-D0E5x2Ue.js → dev-BZO5aLdr.js} +1 -1
- package/dist/{dev-B2rZfqxw.js → dev-D-JZ6CGQ.js} +930 -916
- package/dist/doctorCommand-BeLOwq7S.js +2 -0
- package/dist/{doctorCommand-Ct_3BHgd.js → doctorCommand-BlUyESpD.js} +9 -9
- package/dist/{dormancyCommand-D1DKnYce.js → dormancyCommand-lQxdrU8C.js} +1 -1
- package/dist/{embeddingsCommand-1sZRBKlM.js → embeddingsCommand-ByBTju6X.js} +1 -1
- package/dist/{envCommand-7qjlQgLD.js → envCommand-CpCbYAgR.js} +1 -1
- package/dist/{evolveCommand-D5opB48I.js → evolveCommand-CBV3-TtK.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{infoCommand-Bs_8RU22.js → infoCommand-DJoA9cKD.js} +1 -1
- package/dist/{runtimeTrace-Wmi7V-wN.js → runtimeTrace-DJ9tPhrc.js} +1 -1
- package/dist/{sdkgen-DbTFGCjg.js → sdkgen-7dr8-Onw.js} +1 -1
- package/dist/serveCommand-BlnAlNQg.js +1891 -0
- package/dist/serveCommand-Dg_E1ev4.js +2 -0
- package/dist/serveEntry.js +1 -1
- package/dist/{updateCommand-CrI9B4d7.js → updateCommand-BvRidHp6.js} +1 -1
- package/dist/updateCommand-DcKVmLVN.js +2 -0
- package/dist/{webhooksCommand-BXUP5YjW.js → webhooksCommand-BfO_JF2b.js} +1 -1
- package/package.json +23 -17
- package/templates/AGENTS.md +1 -1
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/cli.md +144 -4
- package/templates/agent-docs/database/seedsdialects.md +12 -0
- package/templates/agent-docs/plugins/versioning.md +2 -0
- package/templates/agent-docs/whats-new.md +16 -51
- package/templates/apps/api-ai/package.json +7 -7
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +10 -10
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-versioning/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +6 -6
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +8 -8
- package/templates/apps/frontend-app/package.json +9 -9
- package/templates/apps/frontend-auth/package.json +8 -8
- package/templates/apps/frontend-blank/package.json +7 -7
- package/templates/apps/frontend-cms/package.json +9 -9
- package/templates/apps/frontend-collab/package.json +10 -10
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +7 -7
- package/templates/apps/frontend-docs/package.json +7 -7
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-portal/package.json +8 -8
- package/templates/apps/frontend-saas/package.json +8 -8
- package/templates/apps/frontend-spa/package.json +7 -7
- package/templates/apps/frontend-ssr/package.json +7 -7
- package/templates/apps/frontend-ssr-api/package.json +8 -8
- package/templates/apps/frontend-static-blog/package.json +6 -6
- package/templates/apps/frontend-status/package.json +8 -8
- package/templates/apps/mobile-app/package.json +4 -4
- package/dist/apiBuild-B7NgSMhX.js +0 -2
- package/dist/dataCommand-CrqvbVOv.js +0 -679
- package/dist/doctorCommand-CdsctSwg.js +0 -2
- package/dist/serveCommand-C8xzYCwa.js +0 -1776
- package/dist/serveCommand-CGNTXafv.js +0 -2
- package/dist/updateCommand-BvkKlV7D.js +0 -2
|
@@ -4,14 +4,14 @@ import { n } from "./appModuleLoader-C9r9mxZt.js";
|
|
|
4
4
|
import { t as r } from "./bootRefusal-pgvDxlrU.js";
|
|
5
5
|
import { n as i, r as a } from "./startupRunner-CEqQq7ax.js";
|
|
6
6
|
import { r as o } from "./appPort-B_HpJ_ck.js";
|
|
7
|
-
import { H as s, J as c, K as l, V as u, W as d, X as f, Y as p, Z as m, ct as h, ft as g, g as _, ht as v, lt as ee, pt as te, q as
|
|
8
|
-
import { n as
|
|
9
|
-
import { a as
|
|
10
|
-
import { a as
|
|
11
|
-
import { r as
|
|
12
|
-
import { C as
|
|
13
|
-
import { A as
|
|
14
|
-
import { A as
|
|
7
|
+
import { H as s, J as c, K as l, V as u, W as d, X as f, Y as p, Z as m, ct as h, ft as g, g as _, ht as v, lt as ee, pt as te, q as ne, ut as y } from "./webDev-101csg6Q.js";
|
|
8
|
+
import { n as b, r as x } from "./dialectDriver-czCHYpeH.js";
|
|
9
|
+
import { a as S, i as re, n as ie, t as ae } from "./connectionConfig-Bk9IC7D0.js";
|
|
10
|
+
import { a as oe, c as se, i as ce, n as le, o as ue, r as de, t as fe } from "./seedRunner-IdHEprqf.js";
|
|
11
|
+
import { r as pe } from "./devActivity-Dx_3nnGv.js";
|
|
12
|
+
import { C as me, E as C, S as he, T as ge, _ as _e, b as ve, d as ye, f as be, g as xe, h as Se, m as Ce, o as we, p as w, r as Te, u as Ee, v as De, w as Oe, x as ke } from "./frameworkTableAssembly-oMPBKqlE.js";
|
|
13
|
+
import { A as Ae, D as je, M as Me, P as Ne, S as Pe, _ as Fe, a as T, b as E, c as Ie, g as D, k as Le, n as Re, o as ze, p as Be, s as Ve, t as He, v as Ue, w as We, x as Ge, y as Ke } from "./fileConventions-Cof68_BL.js";
|
|
14
|
+
import { A as qe, C as Je, D as O, E as k, N as Ye, O as Xe, S as Ze, T as Qe, _ as $e, a as et, b as tt, c as nt, d as rt, f as it, g as at, h as ot, i as st, l as ct, m as lt, o as ut, p as dt, r as ft, s as pt, t as mt, u as ht, v as gt, w as A, x as _t, y as j } from "./inspect-B7U7Cl_Z.js";
|
|
15
15
|
import { t as vt } from "./manifestBuild-BK42hu0k.js";
|
|
16
16
|
import { n as yt } from "./cliRuntime-Dh7UDinH.js";
|
|
17
17
|
import { n as bt, t as xt } from "./tsxLoader-EuXmSJ1K.js";
|
|
@@ -37,26 +37,26 @@ import { ADMISSIONS_TABLE as gr, EVENTS_TABLE as _r, PAUSES_TABLE as vr, Workflo
|
|
|
37
37
|
import { makeClusterCronLayer as Jr, parseShardLockMode as Yr, pollWorkflowStorage as Xr, redriveFailedRun as Zr, resolveRunnerIdentity as Qr, resolveRunnerStorage as $r, resumeRunFromStep as ei, workflowEngineLayer as ti } from "@voltro/workflow/cluster";
|
|
38
38
|
import { appToolDecision as ni, loadAgentMessages as ri, runAgentTurn as ii } from "@voltro/ai";
|
|
39
39
|
import { actorsTable as ai, allRegisteredTables as oi, and as si, auditAllTableIndexes as ci, bindResidentStore as li, connectionIdentity as ui, contains as di, drainIdentifierWarnings as fi, encryptedColumnsOf as pi, ensureTableRegistered as mi, eq as z, formatIndexAuditIssue as hi, gte as gi, inSet as _i, isEmptyRelationsSpec as vi, isEncrypted as yi, isNotNull as bi, isNull as xi, isSqliteFamily as Si, lt as Ci, lte as wi, notInSubquery as Ti, or as Ei, registerCoreTables as Di, registerDiscoveredRelations as Oi, resolveTenantNamespace as ki, runWithWriteAttribution as Ai, serverOnlyColumns as ji, setResidencyConfig as Mi, startsWith as Ni, validateRegisteredRelations as Pi, walkLeaves as Fi } from "@voltro/database";
|
|
40
|
-
import { AggregateError as Ii, AggregateMaintainer as Li, AggregateNotFound as Ri, AggregateRegistry as zi, AggregateStale as Bi, AnalyticsSink as Vi, CostRegistry as Hi, DEFAULT_APPROVAL_EXPIRY_MS as Ui, DORMANCY_WAKEUP_TENANT as Wi, Dispatcher as Gi, EventBus as Ki, ExpectationRegistry as qi, ExperimentRegistry as Ji, InMemoryDataStore as Yi, InstanceMembership as Xi, NO_ROW_FILTER as Zi, OUTBOX_TABLE as Qi, ReactionRateLimiter as $i, ReplicatedDataStore as ea, SYSTEM_SUBJECT as B, actingUserId as ta, apiKeyManagementRoutes as na, applyPluginRefRules as ra, applyUndoInvocation as ia, approvalsPendingExecutor as aa, assertConnectionCipherConfigured as oa, attachAnalyticsMirror as sa, attachExpectations as ca, attachExperiments as la, attachFinops as ua, awaitServerListening as da, bindEvent as fa, bindMutation as pa, bindStream as ma, bindSubscription as ha, buildTracingLayer as ga, cacheScopeLeaks as _a, cancelWakeup as va, collectPluginRefRules as ya, compileCron as ba, completeOAuthConnect as xa, cronOccurrences as Sa, dataStoreApiKeyStore as Ca, dataStoreIdempotencyStore as wa, decideApprovalInvocation as Ta, defineSchedule as Ea, drainOutbox as Da, enableGraphObservation as Oa, enterRequestLoader as V, extractDbCause as ka, formatCacheScopeLeaks as Aa, formatServerOnlyLeaks as ja, formatUnresolvedSources as Ma, frameworkApiKeyStrategy as Na, getFieldCipher as Pa, getResourcePolicy as Fa, getTimelineRecorder as Ia, installApprovalGate as La, installPolicyGuardResolver as Ra, isAggregateDefinition as
|
|
41
|
-
import { isEnvContract as
|
|
42
|
-
import { SESSION_COOKIE_NAME as
|
|
43
|
-
import { randomBytes as
|
|
44
|
-
import { Cache as
|
|
45
|
-
import { WEBHOOK_EMIT_EFFECT as
|
|
46
|
-
import { Kv as
|
|
47
|
-
import { FetchHttpClient as
|
|
48
|
-
import { getAuthSessionStrategy as
|
|
49
|
-
import { collectPublicApiRoutes as
|
|
50
|
-
import { spawn as
|
|
51
|
-
import { watch as
|
|
52
|
-
import { agentRouteDescriptors as
|
|
53
|
-
import { ArrayFormatter as
|
|
54
|
-
import { isEmailTemplate as
|
|
55
|
-
import { attachBroadcastBus as
|
|
56
|
-
import { runImport as
|
|
57
|
-
import { createServer as
|
|
40
|
+
import { AggregateError as Ii, AggregateMaintainer as Li, AggregateNotFound as Ri, AggregateRegistry as zi, AggregateStale as Bi, AnalyticsSink as Vi, CostRegistry as Hi, DEFAULT_APPROVAL_EXPIRY_MS as Ui, DORMANCY_WAKEUP_TENANT as Wi, Dispatcher as Gi, EventBus as Ki, ExpectationRegistry as qi, ExperimentRegistry as Ji, InMemoryDataStore as Yi, InstanceMembership as Xi, NO_ROW_FILTER as Zi, OUTBOX_TABLE as Qi, ReactionRateLimiter as $i, ReplicatedDataStore as ea, SYSTEM_SUBJECT as B, actingUserId as ta, apiKeyManagementRoutes as na, applyPluginRefRules as ra, applyUndoInvocation as ia, approvalsPendingExecutor as aa, assertConnectionCipherConfigured as oa, attachAnalyticsMirror as sa, attachExpectations as ca, attachExperiments as la, attachFinops as ua, awaitServerListening as da, bindEvent as fa, bindMutation as pa, bindStream as ma, bindSubscription as ha, buildTracingLayer as ga, cacheScopeLeaks as _a, cancelWakeup as va, collectPluginRefRules as ya, compileCron as ba, completeOAuthConnect as xa, cronOccurrences as Sa, dataStoreApiKeyStore as Ca, dataStoreIdempotencyStore as wa, decideApprovalInvocation as Ta, defineSchedule as Ea, drainOutbox as Da, enableGraphObservation as Oa, enterRequestLoader as V, extractDbCause as ka, formatCacheScopeLeaks as Aa, formatServerOnlyLeaks as ja, formatUnresolvedSources as Ma, frameworkApiKeyStrategy as Na, getFieldCipher as Pa, getResourcePolicy as Fa, getTimelineRecorder as Ia, installApprovalGate as La, installPolicyGuardResolver as Ra, isAggregateDefinition as H, isCostBudgetDefinition as za, isEmptyTenantScopedRead as Ba, isExpectationDefinition as Va, isExperimentDefinition as Ha, isOrglessUserSubject as Ua, isScheduleDefinition as Wa, isWorkflowEventTriggerDefinition as Ga, listRetentionConflicts as Ka, listRetentions as U, loadResourceTuples as qa, localityAwareSelector as Ja, makeActionRunner as Ya, makeAdvisoryLockCoordinator as Xa, makeApiKeyService as Za, makeApiKeyUsageBuffer as Qa, makeApiKeyUsageFlusher as $a, makeAppAccess as eo, makeApprovalGate as to, makeAsyncKv as no, makeAuthMiddlewareLayers as ro, makeBufferingSpanProcessor as io, makeConnectionRegistry as ao, makeConnectionResolver as oo, makeConnectionsFacade as so, makeCoordinatedScheduler as co, makeDataLoader as lo, makeDisconnectConnectionExecutor as uo, makeEffectStoreLayer as fo, makeEventPublisher as po, makeEventsFacade as mo, makeLazyWorkflowFacade as ho, makeListConnectionsExecutor as go, makeMutationOutputCodec as _o, makeMutationRunner as vo, makeOneShotQueryRunner as yo, makeOutboxFacade as bo, makePostCommitWorkflowFacade as xo, makeQueryDescriptorProducer as So, makeQueryFinalizer as Co, makeQueryReauthorizer as wo, makeQuerySubscriber as To, makeSchemaRegistry as Eo, makeStartConnectionExecutor as Do, makeSubmitTokenExecutor as Oo, makeUndoCapture as ko, makeWorkflowFacade as Ao, makeWorkflowFacadeWithCallerContext as jo, makeWorkflowLayers as Mo, memoryRywPositionStore as No, nextFiring as Po, noopAnalytics as Fo, noopAnalyticsSpec as Io, observedGraph as Lo, onProcessShutdown as W, parseApprovalInterval as Ro, powerOfTwoSelector as zo, recordSubscriptionDelivery as Bo, recordTimelineEvent as Vo, recordWorkflowRun as Ho, redisRywPositionStore as Uo, redoUndoInvocation as Wo, registerDefaultTupleSource as Go, registerRetention as G, registerWakeup as Ko, resolveCurrentRegion as qo, resolveSecretsBackend as Jo, retentionTtlMsFromEnv as K, runProvidedEffect as Yo, runReaction as Xo, sanitizeRedirectTo as Zo, serverOnlyLeaks as Qo, setConnectionResolver as q, setSecretsBackend as $o, setSystemStoreHandle as es, settleHandlerBody as ts, singleCoordinator as ns, ssrfGuardHttpClientLayer as rs, startRpcServer as is, startScheduler as as, stripForbiddenForWire as os, sweepRetention as ss, tracingHttpClientLayer as cs, undoCaptureEnabled as ls, undoLogExecutor as us, undoSurfaceEnabled as ds, unresolvedSources as fs, withScopedRequest as ps, wrapStoreWithBootCodec as ms, wrapStoreWithMixinBehaviour as hs } from "@voltro/runtime";
|
|
41
|
+
import { isEnvContract as gs } from "@voltro/env";
|
|
42
|
+
import { SESSION_COOKIE_NAME as _s, readCookie as vs, resolveOptionalSessionSecrets as ys, verifySessionKeyed as bs } from "@voltro/protocol/session";
|
|
43
|
+
import { randomBytes as xs, randomUUID as Ss } from "node:crypto";
|
|
44
|
+
import { Cache as Cs, CacheLayer as ws, InvalidationBus as Ts, SemanticCache as Es } from "@voltro/cache";
|
|
45
|
+
import { WEBHOOK_EMIT_EFFECT as Ds, buildDeliverWebhookExecute as Os, buildWebhooksService as ks, defaultIncomingPath as As, deliverWebhookWorkflow as js, makeDeferredEmitHandler as Ms, mountIncomingWebhook as Ns } from "@voltro/plugin-webhooks";
|
|
46
|
+
import { Kv as Ps } from "@voltro/kv";
|
|
47
|
+
import { FetchHttpClient as Fs } from "@effect/platform";
|
|
48
|
+
import { getAuthSessionStrategy as Is } from "@voltro/plugin-auth";
|
|
49
|
+
import { collectPublicApiRoutes as Ls, restRoutesToHttpRoutes as Rs } from "@voltro/protocol/rest";
|
|
50
|
+
import { spawn as zs } from "node:child_process";
|
|
51
|
+
import { watch as Bs } from "chokidar";
|
|
52
|
+
import { agentRouteDescriptors as Vs } from "@voltro/ai/agent";
|
|
53
|
+
import { ArrayFormatter as Hs } from "effect/ParseResult";
|
|
54
|
+
import { isEmailTemplate as Us, registerEmailTemplates as Ws } from "@voltro/plugin-mail";
|
|
55
|
+
import { attachBroadcastBus as Gs, channelFor as Ks, describeNamespaceResolution as qs, eventChannelFor as Js, getBroadcastPlugin as Ys, resolveBroadcastNamespace as Xs } from "@voltro/plugin-broadcast";
|
|
56
|
+
import { runImport as Zs } from "@voltro/data-transfer";
|
|
57
|
+
import { createServer as Qs } from "node:http";
|
|
58
58
|
//#region src/advisoryGuardAudit.ts
|
|
59
|
-
var
|
|
59
|
+
var $s = (e) => {
|
|
60
60
|
let t = [];
|
|
61
61
|
for (let n of e) for (let e of n) {
|
|
62
62
|
let n = e.descriptor?.tag;
|
|
@@ -68,34 +68,34 @@ var ec = (e) => {
|
|
|
68
68
|
} : { tag: n });
|
|
69
69
|
}
|
|
70
70
|
return t;
|
|
71
|
-
},
|
|
71
|
+
}, ec = (e, t) => {
|
|
72
72
|
let n = bn(e);
|
|
73
73
|
return n.length === 0 ? 0 : (t(on(n)), n.length);
|
|
74
|
-
},
|
|
74
|
+
}, tc = (e, t, n = [], r = 0) => {
|
|
75
75
|
let i = n.length, a = 1 + Math.max(0, r), o = e === void 0 ? void 0 : e * a + i, s = o !== void 0 && t !== void 0 ? o * t : void 0, c = i === 0 ? " No connections outside the pool in this process." : ` PLUS ${i} outside the pool (${n.map((e) => e.reason).join("; ")}) — those do not come out of the pool budget, they come out of the DATABASE's.`, l = r > 0 ? ` This process opens ${a} pools of that size — 1 primary + ${r} read replica(s) (DB_REPLICA_URLS), each with its own DB_MAX_CONNECTIONS.` : "";
|
|
76
|
-
if (e === void 0) return "db pool: max per replica UNSET (DB_MAX_CONNECTIONS) — each replica opens the driver's default pool, so the fleet total is that default × replicas. Set DB_MAX_CONNECTIONS so the total stays under your database's connection limit; the pool scales with replicaCount and the database does not." + l + c +
|
|
76
|
+
if (e === void 0) return "db pool: max per replica UNSET (DB_MAX_CONNECTIONS) — each replica opens the driver's default pool, so the fleet total is that default × replicas. Set DB_MAX_CONNECTIONS so the total stays under your database's connection limit; the pool scales with replicaCount and the database does not." + l + c + nc;
|
|
77
77
|
let u = (r > 0 ? `max × ${a}` : "max") + (i === 0 ? "" : ` + ${i}`), d = r === 0 ? i === 0 ? "" : ` + ${i} = ${o}` : ` → ${u} = ${o} per pod`, f = r === 0 && i === 0 ? "max" : `(${u})`;
|
|
78
|
-
return `db pool: max=${e} per replica (DB_MAX_CONNECTIONS)` + d + (s === void 0 ? ` — the fleet opens up to ${f} × replicas connections. Check that against your database's limit before raising replicaCount.` : ` × ${t} replicas = up to ${s} connections. Check that against your database's limit.`) + l + c +
|
|
79
|
-
},
|
|
78
|
+
return `db pool: max=${e} per replica (DB_MAX_CONNECTIONS)` + d + (s === void 0 ? ` — the fleet opens up to ${f} × replicas connections. Check that against your database's limit before raising replicaCount.` : ` × ${t} replicas = up to ${s} connections. Check that against your database's limit.`) + l + c + nc;
|
|
79
|
+
}, nc = " A rolling update runs BOTH generations at once, so budget for (replicas + surge), not replicas — a surge pod that cannot get a connection crashloops, and a rollout that never completes cannot free the connections it is waiting for.", J = (e = process.env) => {
|
|
80
80
|
let t = e.REPLICA_COUNT;
|
|
81
81
|
if (t === void 0 || t === "") return;
|
|
82
82
|
let n = Number(t);
|
|
83
83
|
return Number.isInteger(n) && n > 0 ? n : void 0;
|
|
84
|
-
},
|
|
84
|
+
}, rc = (e, t) => t ? e === "postgres" ? [{ reason: "CDC LISTEN consumer" }] : e === "mysql" || e === "mariadb" ? [{ reason: "binlog CDC reader (replication connection)" }] : [] : [], ic = (e = process.env) => J(e) !== void 0 || (e.DB_MAX_CONNECTIONS ?? "") !== "" || (e.PG_MAX_CONNECTIONS ?? "") !== "" || (e.DB_REPLICA_URLS ?? "") !== "", ac = (e) => {
|
|
85
85
|
let t = e.env ?? process.env;
|
|
86
|
-
return !e.always && !
|
|
87
|
-
},
|
|
86
|
+
return !e.always && !ic(t) ? !1 : (e.log.info(tc(e.max, J(t), e.outOfPool, e.readPools ?? 0)), !0);
|
|
87
|
+
}, oc = /* @__PURE__ */ new Set([
|
|
88
88
|
"_voltro_workflow_runs",
|
|
89
89
|
"_voltro_workflow_run_events",
|
|
90
90
|
"_voltro_workflow_start_contexts"
|
|
91
|
-
]),
|
|
91
|
+
]), sc = {
|
|
92
92
|
publishWake: () => {},
|
|
93
93
|
active: !1,
|
|
94
94
|
cdcActive: !1,
|
|
95
95
|
detach: async () => {}
|
|
96
|
-
},
|
|
96
|
+
}, cc = async (e) => {
|
|
97
97
|
let t = e.provider !== void 0 && e.crossReplica;
|
|
98
|
-
if (!t && e.onChange === void 0) return
|
|
98
|
+
if (!t && e.onChange === void 0) return sc;
|
|
99
99
|
let n = (t) => {
|
|
100
100
|
let n = !1;
|
|
101
101
|
return () => {
|
|
@@ -122,15 +122,15 @@ var ec = (e) => {
|
|
|
122
122
|
let c;
|
|
123
123
|
if (e.onChange !== void 0) try {
|
|
124
124
|
c = e.onChange((e) => {
|
|
125
|
-
e.origin === "injected" &&
|
|
125
|
+
e.origin === "injected" && oc.has(e.table) && e.op !== "delete" && i();
|
|
126
126
|
}), e.log.info("workflow wake: change-stream wake enabled", {
|
|
127
|
-
tables: [...
|
|
127
|
+
tables: [...oc],
|
|
128
128
|
coalesceMs: 200
|
|
129
129
|
});
|
|
130
130
|
} catch (t) {
|
|
131
131
|
e.log.warn("workflow wake: change-stream subscribe failed — falling back to the poll interval", { reason: t?.message ?? String(t) });
|
|
132
132
|
}
|
|
133
|
-
return !s && c === void 0 ?
|
|
133
|
+
return !s && c === void 0 ? sc : {
|
|
134
134
|
publishWake: o,
|
|
135
135
|
active: s,
|
|
136
136
|
cdcActive: c !== void 0,
|
|
@@ -143,7 +143,7 @@ var ec = (e) => {
|
|
|
143
143
|
} catch {}
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
|
-
},
|
|
146
|
+
}, lc = (e) => {
|
|
147
147
|
let t = e;
|
|
148
148
|
return {
|
|
149
149
|
name: t.name,
|
|
@@ -151,15 +151,15 @@ var ec = (e) => {
|
|
|
151
151
|
output: t.element,
|
|
152
152
|
error: t.error
|
|
153
153
|
};
|
|
154
|
-
},
|
|
154
|
+
}, uc = (e, t) => [
|
|
155
155
|
...e.queries.map((e) => vt(e.descriptor, "query", zt(t, e.file))),
|
|
156
156
|
...e.mutations.map((e) => vt(e.descriptor, "mutation", zt(t, e.file))),
|
|
157
157
|
...e.actions.map((e) => vt(e.descriptor, "action", zt(t, e.file))),
|
|
158
|
-
...(e.streams ?? []).map((e) => vt(
|
|
159
|
-
],
|
|
158
|
+
...(e.streams ?? []).map((e) => vt(lc(e.descriptor), "stream", zt(t, e.file)))
|
|
159
|
+
], dc = (e, t) => e.workflows.map((e) => ({
|
|
160
160
|
tag: String(e.definition.name),
|
|
161
161
|
file: zt(t, e.file)
|
|
162
|
-
})),
|
|
162
|
+
})), fc = (e, t) => {
|
|
163
163
|
if (typeof process.getuid != "function") return;
|
|
164
164
|
let n;
|
|
165
165
|
try {
|
|
@@ -174,21 +174,21 @@ var ec = (e) => {
|
|
|
174
174
|
} catch (t) {
|
|
175
175
|
return `${e} was written as uid ${r} but the workspace is owned by uid ${n.uid}, and it could not be handed over (${t.message}). The file is mode 0600, so tools running as uid ${n.uid} — your tests, your editor, \`voltro doctor\` — will fail to read it with EACCES. Run this container as the workspace owner (docker \`--user ${n.uid}:${n.gid}\`), or set the variable(s) yourself so nothing needs minting.`;
|
|
176
176
|
}
|
|
177
|
-
},
|
|
177
|
+
}, pc = ".env.local", mc = (e) => {
|
|
178
178
|
let t = N(e, ".gitignore"), n = "";
|
|
179
179
|
try {
|
|
180
180
|
Ut(t) && (n = Gt(t, "utf8"));
|
|
181
181
|
} catch {
|
|
182
182
|
return !1;
|
|
183
183
|
}
|
|
184
|
-
if (n.split(/\r?\n/).map((e) => e.trim()).some((e) => e ===
|
|
184
|
+
if (n.split(/\r?\n/).map((e) => e.trim()).some((e) => e === pc || e === `/${pc}` || e === ".env*" || e === ".env.*" || e === ".env.local*")) return !0;
|
|
185
185
|
try {
|
|
186
186
|
let e = n === "" || n.endsWith("\n") ? "" : "\n";
|
|
187
|
-
return Vt(t, `${e}\n# Local secrets minted by \`voltro dev\` — machine-specific, never commit.\n${
|
|
187
|
+
return Vt(t, `${e}\n# Local secrets minted by \`voltro dev\` — machine-specific, never commit.\n${pc}\n`, "utf8"), !0;
|
|
188
188
|
} catch {
|
|
189
189
|
return !1;
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, hc = (e) => xs(32).toString(e), Y = [{
|
|
192
192
|
key: "VOLTRO_INSPECT_TOKEN",
|
|
193
193
|
encoding: "base64url",
|
|
194
194
|
description: "Bearer token for /_voltro/inspect/* — minted so the dev inspect surface is not open to the network."
|
|
@@ -196,13 +196,13 @@ var ec = (e) => {
|
|
|
196
196
|
key: "VOLTRO_INSPECT_WRITE_TOKEN",
|
|
197
197
|
encoding: "base64url",
|
|
198
198
|
description: "Second factor for MUTATING /_voltro/inspect/* endpoints (GDPR erase/export, storage share/revoke)."
|
|
199
|
-
}],
|
|
199
|
+
}], gc = (e, t, n = process.env) => {
|
|
200
200
|
let r = [];
|
|
201
|
-
for (let e of
|
|
201
|
+
for (let e of Y) {
|
|
202
202
|
let t = n[e.key];
|
|
203
203
|
(t === void 0 || t.trim() === "") && r.push({
|
|
204
204
|
key: e.key,
|
|
205
|
-
value:
|
|
205
|
+
value: hc(e.encoding),
|
|
206
206
|
description: e.description
|
|
207
207
|
});
|
|
208
208
|
}
|
|
@@ -211,13 +211,13 @@ var ec = (e) => {
|
|
|
211
211
|
let e = n[t];
|
|
212
212
|
(e === void 0 || e.trim() === "") && r.push({
|
|
213
213
|
key: t,
|
|
214
|
-
value:
|
|
214
|
+
value: hc(i.generate),
|
|
215
215
|
description: i.description
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
if (r.length === 0) return { minted: [] };
|
|
219
|
-
if (!
|
|
220
|
-
let i = N(t,
|
|
219
|
+
if (!mc(t)) throw Error(`cannot mint ${r.map((e) => e.key).join(", ")}: failed to add "${pc}" to ${N(t, ".gitignore")}. Refusing to write a secret to a path that might be committed — add the entry by hand, or set the variable(s) yourself (\`voltro secret generate\`).`);
|
|
220
|
+
let i = N(t, pc), a = r.map((e) => `${e.description ? `# ${e.description}\n` : ""}${e.key}=${e.value}`).join("\n"), o;
|
|
221
221
|
try {
|
|
222
222
|
if (Ut(i)) {
|
|
223
223
|
let e = Gt(i, "utf8"), t = e === "" || e.endsWith("\n") ? "" : "\n";
|
|
@@ -228,7 +228,7 @@ var ec = (e) => {
|
|
|
228
228
|
\n${a}\n`, {
|
|
229
229
|
encoding: "utf8",
|
|
230
230
|
mode: 384
|
|
231
|
-
}), o =
|
|
231
|
+
}), o = fc(i, t);
|
|
232
232
|
} catch (e) {
|
|
233
233
|
throw Error(`cannot mint ${r.map((e) => e.key).join(", ")}: failed to write ${i} — ${e.message}`);
|
|
234
234
|
}
|
|
@@ -238,7 +238,7 @@ var ec = (e) => {
|
|
|
238
238
|
file: i,
|
|
239
239
|
...o ? { ownershipWarning: o } : {}
|
|
240
240
|
};
|
|
241
|
-
},
|
|
241
|
+
}, _c = [".framework", ".env.local"], vc = /\.generated\./i, yc = (e) => {
|
|
242
242
|
try {
|
|
243
243
|
let t = Kt(e);
|
|
244
244
|
return {
|
|
@@ -248,7 +248,7 @@ var ec = (e) => {
|
|
|
248
248
|
} catch {
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
},
|
|
251
|
+
}, bc = (e, t, n) => {
|
|
252
252
|
let r = !0;
|
|
253
253
|
try {
|
|
254
254
|
Ht(e, t, n);
|
|
@@ -262,28 +262,28 @@ var ec = (e) => {
|
|
|
262
262
|
} catch {
|
|
263
263
|
return r;
|
|
264
264
|
}
|
|
265
|
-
for (let a of i)
|
|
265
|
+
for (let a of i) bc(N(e, a), t, n) || (r = !1);
|
|
266
266
|
return r;
|
|
267
|
-
},
|
|
267
|
+
}, xc = (e) => {
|
|
268
268
|
if (typeof process.getuid != "function") return { adopted: [] };
|
|
269
|
-
let t =
|
|
269
|
+
let t = yc(e);
|
|
270
270
|
if (t === void 0) return { adopted: [] };
|
|
271
271
|
let n = process.getuid();
|
|
272
272
|
if (t.uid === n) return { adopted: [] };
|
|
273
|
-
let r = [...
|
|
273
|
+
let r = [..._c];
|
|
274
274
|
try {
|
|
275
|
-
for (let t of P(e))
|
|
275
|
+
for (let t of P(e)) vc.test(t) && r.push(t);
|
|
276
276
|
} catch {}
|
|
277
277
|
let i = [], a = !1;
|
|
278
278
|
for (let n of r) {
|
|
279
279
|
let r = N(e, n);
|
|
280
|
-
|
|
280
|
+
yc(r) !== void 0 && (bc(r, t.uid, t.gid) ? i.push(n) : a = !0);
|
|
281
281
|
}
|
|
282
282
|
return a ? {
|
|
283
283
|
adopted: i,
|
|
284
284
|
warning: `generated files under ${e} are owned by uid ${n} but the workspace is owned by uid ${t.uid}, and they could not be handed over. On the host, tools running as uid ${t.uid} will fail with EACCES — \`voltro build\` cannot read \`.framework\`, and \`vitest\` cannot read \`.env.local\`. Run this container as the workspace owner (docker \`--user ${t.uid}:${t.gid}\`).`
|
|
285
285
|
} : { adopted: i };
|
|
286
|
-
},
|
|
286
|
+
}, Sc = (e) => {
|
|
287
287
|
let t = Number(e.REPLICA_COUNT);
|
|
288
288
|
if (Number.isFinite(t) && t >= 1) return t > 1 ? `REPLICA_COUNT=${t}` : null;
|
|
289
289
|
for (let [t, n] of [
|
|
@@ -299,27 +299,27 @@ var ec = (e) => {
|
|
|
299
299
|
["RENDER_INSTANCE_ID", "Render"]
|
|
300
300
|
]) if ((e[t] ?? "") !== "") return `${t} is set (${n})`;
|
|
301
301
|
return null;
|
|
302
|
-
},
|
|
303
|
-
if (e.dialect === "turso" &&
|
|
302
|
+
}, Cc = (e) => e.startsWith("_voltro_"), wc = (e) => e === void 0 || e === "" || !/^file:/i.test(e) || (process.env.TURSO_SYNC_URL ?? "") !== "", Tc = (e) => {
|
|
303
|
+
if (e.dialect === "turso" && wc(e.dbUrl)) return [{
|
|
304
304
|
level: "warn",
|
|
305
305
|
message: "turso is configured against a shared primary, but this dialect has no NATIVE cross-instance change capture: it reuses the SQLite store, which emits inline only. Subscribers see writes made by THEIR OWN instance and never another's — for every table, regardless of .nonReactive(). Add @voltro/plugin-broadcast (Redis / NATS) to fan changes out between instances, or run a single instance."
|
|
306
306
|
}];
|
|
307
307
|
if (e.dialect === "sqlite" || e.dialect === "memory") {
|
|
308
|
-
let t = e.crossReplicaBus ? null :
|
|
308
|
+
let t = e.crossReplicaBus ? null : Sc(e.env ?? process.env);
|
|
309
309
|
if (t !== null) return [{
|
|
310
310
|
level: "warn",
|
|
311
311
|
message: `this app runs on '${e.dialect}' — a ${e.dialect === "memory" ? "process-local store" : "local database file"} — but ${t}, which means several replicas. Neither dialect has ANY cross-instance change capture: a client connected to replica A never sees a write made on replica B, for every table, and each replica is also reading its OWN data. Nothing here will error — the app looks healthy and serves stale views. Use postgres (LISTEN/NOTIFY) or mysql/mariadb (binlog CDC) for a shared, reactive database; or run a SINGLE replica and set REPLICA_COUNT=1 to silence this. Adding @voltro/plugin-broadcast fans CHANGES out but does not give the replicas one database, so it silences this warning only because a bus means you have already thought about it.`
|
|
312
312
|
}];
|
|
313
313
|
}
|
|
314
314
|
if (e.changeStrategy !== "cdc" || e.dialect === "sqlite" || e.dialect === "turso") return [];
|
|
315
|
-
let t = new Set(e.querySources.filter((e) => !
|
|
315
|
+
let t = new Set(e.querySources.filter((e) => !Cc(e))), n = e.tables.filter((e) => !Cc(e.tableName)).filter((e) => e.isReactive === !1 && t.has(e.tableName)).map((e) => e.tableName).sort();
|
|
316
316
|
if (n.length === 0) return [];
|
|
317
317
|
let r = n.slice(0, 8).join(", "), i = n.length > 8 ? `, … (+${n.length - 8})` : "";
|
|
318
318
|
return [{
|
|
319
319
|
level: "warn",
|
|
320
320
|
message: `${n.length} table(s) are .nonReactive() but a query declares them as a source — ${r}${i}. Those subscriptions will NEVER fire: a non-reactive table emits no change events at all, in this process or any other, so the query returns its first snapshot and then goes quiet forever. Either drop .nonReactive() from the table, or stop subscribing to it.`
|
|
321
321
|
}];
|
|
322
|
-
},
|
|
322
|
+
}, Ec = (e, t) => {
|
|
323
323
|
let n = e.length + 1, r = t.length + 1, i = Array.from({ length: r }, (e, t) => t);
|
|
324
324
|
for (let a = 1; a < n; a += 1) {
|
|
325
325
|
let n = [a, ...Array.from({ length: r - 1 }, () => 0)];
|
|
@@ -327,16 +327,16 @@ var ec = (e) => {
|
|
|
327
327
|
i = n;
|
|
328
328
|
}
|
|
329
329
|
return i[r - 1];
|
|
330
|
-
},
|
|
330
|
+
}, Dc = (e, t) => {
|
|
331
331
|
let n = t.find((t) => t.endsWith(`_${e}`) || t === `_voltro_${e}`);
|
|
332
332
|
if (n !== void 0) return n;
|
|
333
333
|
let r, i = Infinity;
|
|
334
334
|
for (let n of t) {
|
|
335
|
-
let t =
|
|
335
|
+
let t = Ec(e, n);
|
|
336
336
|
t < i && (i = t, r = n);
|
|
337
337
|
}
|
|
338
338
|
return r !== void 0 && i <= Math.max(2, Math.floor(e.length / 3)) ? r : void 0;
|
|
339
|
-
},
|
|
339
|
+
}, Oc = (e) => {
|
|
340
340
|
let t = e.tables.map((e) => e.tableName), n = new Set(t), r = vn(), i = [];
|
|
341
341
|
for (let a of e.queries) for (let e of An(a.source)) {
|
|
342
342
|
if (e === "") continue;
|
|
@@ -350,7 +350,7 @@ var ec = (e) => {
|
|
|
350
350
|
continue;
|
|
351
351
|
}
|
|
352
352
|
if (n.has(e)) continue;
|
|
353
|
-
let o =
|
|
353
|
+
let o = Dc(e, t);
|
|
354
354
|
i.push({
|
|
355
355
|
query: a.name,
|
|
356
356
|
source: e,
|
|
@@ -358,14 +358,14 @@ var ec = (e) => {
|
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
return i;
|
|
361
|
-
},
|
|
361
|
+
}, kc = (e) => {
|
|
362
362
|
if (e.length === 0) return;
|
|
363
363
|
let t = e.map((e) => e.channel === !0 ? ` ${e.query}: source '${e.source}' is not a declared reactivity channel` : ` ${e.query}: source '${e.source}' is not a declared table` + (e.suggestion === void 0 ? "" : ` — did you mean '${e.suggestion}'?`)), n = e.some((e) => e.channel === !0) ? "\n For the `channel:` entries: declare it with `reactivityChannel(<name>)` and pass the CHANNEL\n as `source:` rather than its key as a string — the import edge is what makes a channel\n source impossible to leave stale." : "";
|
|
364
364
|
return `${e.length} quer${e.length === 1 ? "y declares" : "ies declare"} a \`source\` that names no table:\n${t.join("\n")}\n A \`source\` is matched BY NAME against change events, so one naming a table that does not\n exist matches nothing: the query returns its first result and never updates again. That is\n not an error at any layer — it is silence, and it looks exactly like "nothing has changed".` + n;
|
|
365
|
-
},
|
|
365
|
+
}, Ac = "VOLTRO_REMOTE_MIGRATIONS_OK", jc = /^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.)/, Mc = (e) => {
|
|
366
366
|
let t = e.toLowerCase().replace(/^\[|\]$/g, "");
|
|
367
|
-
return !!(t === "" || t === "localhost" || t === "ip6-localhost" || t === "::1" || t === "0.0.0.0" || t === "::" || t.startsWith("127.") || t === "host.docker.internal" || t === "gateway.docker.internal" || t.endsWith(".localhost") || t.endsWith(".local") ||
|
|
368
|
-
},
|
|
367
|
+
return !!(t === "" || t === "localhost" || t === "ip6-localhost" || t === "::1" || t === "0.0.0.0" || t === "::" || t.startsWith("127.") || t === "host.docker.internal" || t === "gateway.docker.internal" || t.endsWith(".localhost") || t.endsWith(".local") || jc.test(t) || !t.includes(".") && !t.includes(":"));
|
|
368
|
+
}, Nc = (e) => {
|
|
369
369
|
if (e.url !== void 0 && e.url !== "") {
|
|
370
370
|
if (/^(file|sqlite):/i.test(e.url)) return {
|
|
371
371
|
kind: "local",
|
|
@@ -374,7 +374,7 @@ var ec = (e) => {
|
|
|
374
374
|
try {
|
|
375
375
|
let t = new URL(e.url).hostname;
|
|
376
376
|
return {
|
|
377
|
-
kind:
|
|
377
|
+
kind: Mc(t) ? "local" : "remote",
|
|
378
378
|
host: t
|
|
379
379
|
};
|
|
380
380
|
} catch {
|
|
@@ -386,12 +386,12 @@ var ec = (e) => {
|
|
|
386
386
|
}
|
|
387
387
|
let t = e.host ?? "localhost";
|
|
388
388
|
return {
|
|
389
|
-
kind:
|
|
389
|
+
kind: Mc(t) ? "local" : "remote",
|
|
390
390
|
host: t
|
|
391
391
|
};
|
|
392
|
-
},
|
|
392
|
+
}, Pc = (e) => {
|
|
393
393
|
if (e.pendingIds.length === 0 || e.optIn) return { allowed: !0 };
|
|
394
|
-
let t =
|
|
394
|
+
let t = Nc(e.conn);
|
|
395
395
|
if (t.kind === "local") return { allowed: !0 };
|
|
396
396
|
let n = e.pendingIds.map((e) => ` • ${e}`).join("\n");
|
|
397
397
|
return {
|
|
@@ -410,16 +410,16 @@ var ec = (e) => {
|
|
|
410
410
|
" Choose one:",
|
|
411
411
|
" • Point the app at a local database (DB_URL), which is what dev boot assumes.",
|
|
412
412
|
" • Apply them deliberately, once: voltro db files .",
|
|
413
|
-
` • Accept it for this environment: ${
|
|
413
|
+
` • Accept it for this environment: ${Ac}=1`
|
|
414
414
|
].join("\n")
|
|
415
415
|
};
|
|
416
|
-
},
|
|
416
|
+
}, Fc = async ({ env: e = process.env, semantic: t = !1 } = {}) => {
|
|
417
417
|
let n, r;
|
|
418
418
|
if (t) {
|
|
419
|
-
let e = $n.make(I.mergeAll(
|
|
420
|
-
r = await e.runPromise(
|
|
421
|
-
} else n = $n.make(I.mergeAll(
|
|
422
|
-
let i = await n.runPromise(
|
|
419
|
+
let e = $n.make(I.mergeAll(Cs.Default, Es.Default, Ts.Default).pipe(I.provide(ws.storeLayer)));
|
|
420
|
+
r = await e.runPromise(Es), n = e;
|
|
421
|
+
} else n = $n.make(I.mergeAll(ws.layer, Ts.Default)), r = void 0;
|
|
422
|
+
let i = await n.runPromise(Cs), a = await n.runPromise(Ts), o = r, s = o === void 0 ? void 0 : (e) => {
|
|
423
423
|
n.runFork(o.onSourceChange(e));
|
|
424
424
|
}, c = (e.CACHE_BACKEND ?? "memory").toLowerCase();
|
|
425
425
|
return await n.runPromise(a.addSink((e) => i.invalidateTag(e))), {
|
|
@@ -455,40 +455,40 @@ var ec = (e) => {
|
|
|
455
455
|
stats: () => n.runSync(i.stats()),
|
|
456
456
|
dispose: () => n.dispose()
|
|
457
457
|
};
|
|
458
|
-
},
|
|
458
|
+
}, Ic = (e) => {
|
|
459
459
|
let t = e / 36e5;
|
|
460
460
|
return t < 48 ? `${Math.round(t)}h` : `${Math.round(t / 24)}d`;
|
|
461
|
-
},
|
|
462
|
-
|
|
461
|
+
}, Lc = ({ store: e, dialect: t, env: n = process.env, log: r }) => {
|
|
462
|
+
G({
|
|
463
463
|
table: "_voltro_schedule_runs",
|
|
464
464
|
timeColumn: "scheduledAt",
|
|
465
465
|
source: "framework",
|
|
466
|
-
ttlMs:
|
|
466
|
+
ttlMs: K(n.VOLTRO_SCHEDULE_RUNS_TTL_HOURS, 720),
|
|
467
467
|
envVar: "VOLTRO_SCHEDULE_RUNS_TTL_HOURS"
|
|
468
|
-
}),
|
|
468
|
+
}), G({
|
|
469
469
|
table: "_voltro_schedule_claims",
|
|
470
470
|
timeColumn: "claimedAt",
|
|
471
471
|
source: "framework",
|
|
472
|
-
ttlMs:
|
|
472
|
+
ttlMs: K(n.VOLTRO_SCHEDULE_CLAIMS_TTL_HOURS, 24),
|
|
473
473
|
envVar: "VOLTRO_SCHEDULE_CLAIMS_TTL_HOURS"
|
|
474
|
-
}),
|
|
474
|
+
}), G({
|
|
475
475
|
source: "framework",
|
|
476
476
|
table: "_voltro_undo_log",
|
|
477
477
|
timeColumn: "createdAt",
|
|
478
|
-
ttlMs:
|
|
478
|
+
ttlMs: K(n.VOLTRO_UNDO_LOG_TTL_HOURS, 720),
|
|
479
479
|
envVar: "VOLTRO_UNDO_LOG_TTL_HOURS"
|
|
480
|
-
}),
|
|
480
|
+
}), G({
|
|
481
481
|
source: "framework",
|
|
482
482
|
table: "_voltro_workflow_admissions",
|
|
483
483
|
timeColumn: "admittedAt",
|
|
484
|
-
ttlMs:
|
|
484
|
+
ttlMs: K(n.VOLTRO_WORKFLOW_ADMISSIONS_TTL_HOURS, 720),
|
|
485
485
|
envVar: "VOLTRO_WORKFLOW_ADMISSIONS_TTL_HOURS",
|
|
486
486
|
where: bi("releasedAt")
|
|
487
|
-
}),
|
|
487
|
+
}), G({
|
|
488
488
|
source: "framework",
|
|
489
489
|
table: "_voltro_workflow_start_contexts",
|
|
490
490
|
timeColumn: "createdAt",
|
|
491
|
-
ttlMs:
|
|
491
|
+
ttlMs: K(n.VOLTRO_WORKFLOW_START_CONTEXTS_TTL_HOURS, 720),
|
|
492
492
|
envVar: "VOLTRO_WORKFLOW_START_CONTEXTS_TTL_HOURS",
|
|
493
493
|
where: Ti("executionId", {
|
|
494
494
|
table: "_voltro_workflow_runs",
|
|
@@ -498,37 +498,37 @@ var ec = (e) => {
|
|
|
498
498
|
take: void 0,
|
|
499
499
|
skip: void 0
|
|
500
500
|
})
|
|
501
|
-
}),
|
|
501
|
+
}), G({
|
|
502
502
|
table: "_voltro_workflow_runs",
|
|
503
503
|
timeColumn: "completedAt",
|
|
504
504
|
source: "framework",
|
|
505
|
-
ttlMs:
|
|
505
|
+
ttlMs: K(n.VOLTRO_WORKFLOW_RUNS_TTL_HOURS, 720),
|
|
506
506
|
envVar: "VOLTRO_WORKFLOW_RUNS_TTL_HOURS",
|
|
507
507
|
where: Ei(z("status", "succeeded"), z("status", "failed"), z("status", "cancelled"))
|
|
508
|
-
}),
|
|
508
|
+
}), G({
|
|
509
509
|
table: "_voltro_outbox_attempts",
|
|
510
510
|
timeColumn: "startedAt",
|
|
511
511
|
source: "framework",
|
|
512
|
-
ttlMs:
|
|
512
|
+
ttlMs: K(n.VOLTRO_OUTBOX_ATTEMPTS_TTL_HOURS, 720),
|
|
513
513
|
envVar: "VOLTRO_OUTBOX_ATTEMPTS_TTL_HOURS"
|
|
514
|
-
}),
|
|
514
|
+
}), G({
|
|
515
515
|
table: "_voltro_outbox",
|
|
516
516
|
timeColumn: "deliveredAt",
|
|
517
517
|
source: "framework",
|
|
518
|
-
ttlMs:
|
|
518
|
+
ttlMs: K(n.VOLTRO_OUTBOX_TTL_HOURS, 720),
|
|
519
519
|
envVar: "VOLTRO_OUTBOX_TTL_HOURS",
|
|
520
520
|
where: z("status", "delivered")
|
|
521
|
-
}),
|
|
521
|
+
}), G({
|
|
522
522
|
table: "_voltro_workflow_events",
|
|
523
523
|
timeColumn: "occurredAt",
|
|
524
524
|
source: "framework",
|
|
525
|
-
ttlMs:
|
|
525
|
+
ttlMs: K(n.VOLTRO_WORKFLOW_EVENTS_TTL_HOURS, 720),
|
|
526
526
|
envVar: "VOLTRO_WORKFLOW_EVENTS_TTL_HOURS"
|
|
527
|
-
}),
|
|
527
|
+
}), G({
|
|
528
528
|
table: "_voltro_workflow_event_deliveries",
|
|
529
529
|
timeColumn: "createdAt",
|
|
530
530
|
source: "framework",
|
|
531
|
-
ttlMs:
|
|
531
|
+
ttlMs: K(n.VOLTRO_WORKFLOW_EVENT_DELIVERIES_TTL_HOURS, 720),
|
|
532
532
|
envVar: "VOLTRO_WORKFLOW_EVENT_DELIVERIES_TTL_HOURS"
|
|
533
533
|
});
|
|
534
534
|
let i = t === "postgres" ? e.raw?.bind(e) : void 0, a = (e) => {
|
|
@@ -564,17 +564,17 @@ var ec = (e) => {
|
|
|
564
564
|
}
|
|
565
565
|
}, s = async () => {
|
|
566
566
|
let e = Date.now();
|
|
567
|
-
for (let t of
|
|
568
|
-
await
|
|
567
|
+
for (let t of U()) try {
|
|
568
|
+
await ss(t, e, o, 2e4);
|
|
569
569
|
} catch {}
|
|
570
|
-
}, c =
|
|
570
|
+
}, c = U();
|
|
571
571
|
if (c.length > 0) {
|
|
572
572
|
r?.info?.(`retention: ${c.length} policy(ies) armed — rows older than the TTL are DELETED`);
|
|
573
573
|
for (let e of [...c].sort((e, t) => e.table.localeCompare(t.table))) {
|
|
574
574
|
let t = e.where === void 0 ? "every row" : "matching rows only";
|
|
575
|
-
r?.info?.(` · ${e.table}: ${t} older than ${
|
|
575
|
+
r?.info?.(` · ${e.table}: ${t} older than ${Ic(e.ttlMs)} by ${e.timeColumn}${e.envVar === void 0 ? "" : ` (${e.envVar})`}`);
|
|
576
576
|
}
|
|
577
|
-
for (let e of
|
|
577
|
+
for (let e of Ka()) r?.info?.(` ! ${e.table}: two registrations — kept the ${e.kept.source}'s ${Ic(e.kept.ttlMs)}, dropped the ${e.dropped.source}'s ${Ic(e.dropped.ttlMs)}. An app registration wins over a plugin's, and a plugin's over a framework default.`);
|
|
578
578
|
}
|
|
579
579
|
let l = setTimeout(() => {
|
|
580
580
|
s();
|
|
@@ -586,12 +586,12 @@ var ec = (e) => {
|
|
|
586
586
|
return u.unref?.(), { stop: () => {
|
|
587
587
|
clearTimeout(l), clearInterval(u);
|
|
588
588
|
} };
|
|
589
|
-
},
|
|
589
|
+
}, Rc = (e) => {
|
|
590
590
|
if (typeof e == "string") return e;
|
|
591
591
|
let t = e;
|
|
592
592
|
if (typeof t?.id == "string") return t.id;
|
|
593
593
|
if (typeof t?.name == "string") return t.name;
|
|
594
|
-
},
|
|
594
|
+
}, zc = (e, t) => {
|
|
595
595
|
let n = { tenantId: t.tenantId ?? null }, r = t.afterCommit, i = t.enqueue;
|
|
596
596
|
return new Proxy(e, { get: (e, a, o) => a === "subscribe" ? (n) => typeof n != "object" || !n ? e.subscribe(n) : e.subscribe(n.tenantId === void 0 ? {
|
|
597
597
|
...n,
|
|
@@ -599,8 +599,8 @@ var ec = (e) => {
|
|
|
599
599
|
} : n) : a === "emit" ? (t, a, o) => {
|
|
600
600
|
let s = o?.tenantId === void 0 ? n : o;
|
|
601
601
|
if (o?.immediate === !0 || r === void 0) return e.emit(t, a, s);
|
|
602
|
-
let c =
|
|
603
|
-
return i !== void 0 && c !== void 0 ? i(
|
|
602
|
+
let c = Rc(t);
|
|
603
|
+
return i !== void 0 && c !== void 0 ? i(Ds, {
|
|
604
604
|
event: c,
|
|
605
605
|
payload: a,
|
|
606
606
|
tenantId: s.tenantId ?? null
|
|
@@ -666,14 +666,14 @@ var ec = (e) => {
|
|
|
666
666
|
return r.set(i, c), c;
|
|
667
667
|
} });
|
|
668
668
|
}, Uc = (e) => {
|
|
669
|
-
let t =
|
|
669
|
+
let t = lo({ store: e.store });
|
|
670
670
|
return V(t), {
|
|
671
|
-
storeForTenant: (t) =>
|
|
671
|
+
storeForTenant: (t) => hs(e.store, {
|
|
672
672
|
subject: Nn(B, t),
|
|
673
673
|
schemaRegistry: e.schemaRegistry,
|
|
674
674
|
rowFilter: Zi
|
|
675
675
|
}),
|
|
676
|
-
store:
|
|
676
|
+
store: hs(e.store, {
|
|
677
677
|
subject: B,
|
|
678
678
|
schemaRegistry: e.schemaRegistry,
|
|
679
679
|
rowFilter: Zi
|
|
@@ -682,7 +682,7 @@ var ec = (e) => {
|
|
|
682
682
|
subject: B,
|
|
683
683
|
traceId: "webhooks:trigger"
|
|
684
684
|
},
|
|
685
|
-
access:
|
|
685
|
+
access: eo(B),
|
|
686
686
|
load: t.load,
|
|
687
687
|
loadMany: t.loadMany,
|
|
688
688
|
cache: e.cache,
|
|
@@ -696,13 +696,13 @@ var ec = (e) => {
|
|
|
696
696
|
return e.ensureTenantProvisioned === void 0 ? i : Hc(i, r, e.ensureTenantProvisioned);
|
|
697
697
|
}, m = (n, r) => e.resolveResidentStore === void 0 || n !== t ? n : e.resolveResidentStore(r);
|
|
698
698
|
return (e, c = t, h, g = "app-context", _) => {
|
|
699
|
-
let v = p(m(c, e.subject), e.subject), ee = o === void 0 ? void 0 :
|
|
699
|
+
let v = p(m(c, e.subject), e.subject), ee = o === void 0 ? void 0 : jo(o, {
|
|
700
700
|
subject: e.subject,
|
|
701
701
|
traceId: e.traceId,
|
|
702
702
|
source: g,
|
|
703
703
|
..._?.parentExecutionId === void 0 ? {} : { parentExecutionId: _.parentExecutionId },
|
|
704
704
|
..._?.parentClosePolicy === void 0 ? {} : { parentClosePolicy: _.parentClosePolicy }
|
|
705
|
-
}), te = s.length === 0 || o === void 0 ? void 0 :
|
|
705
|
+
}), te = s.length === 0 || o === void 0 ? void 0 : mo({
|
|
706
706
|
triggers: s,
|
|
707
707
|
store: p(t, e.subject),
|
|
708
708
|
source: g,
|
|
@@ -710,8 +710,8 @@ var ec = (e) => {
|
|
|
710
710
|
traceId: e.traceId,
|
|
711
711
|
...l === void 0 ? {} : { emit: l },
|
|
712
712
|
..._?.parentExecutionId === void 0 ? {} : { parentExecutionId: _.parentExecutionId },
|
|
713
|
-
startWorkflow: (e, t, n) =>
|
|
714
|
-
}),
|
|
713
|
+
startWorkflow: (e, t, n) => jo(o, n).start(e, t)
|
|
714
|
+
}), ne = f === void 0 ? void 0 : po({
|
|
715
715
|
bus: f,
|
|
716
716
|
tenantId: e.subject.tenantId ?? null,
|
|
717
717
|
...h === void 0 ? {} : { deferToCommit: (e) => {
|
|
@@ -722,48 +722,48 @@ var ec = (e) => {
|
|
|
722
722
|
onPublished: (e, t, n) => {
|
|
723
723
|
te !== void 0 && te.emit(e, t).catch(() => {}), n.webhook !== void 0 && a !== void 0 && a.emit(n, t).catch(() => {});
|
|
724
724
|
}
|
|
725
|
-
}),
|
|
725
|
+
}), y = u === void 0 ? void 0 : bo({
|
|
726
726
|
store: v,
|
|
727
727
|
subject: e.subject,
|
|
728
728
|
traceId: e.traceId,
|
|
729
729
|
nudge: u.nudge,
|
|
730
730
|
...h === void 0 ? {} : { afterCommit: h.afterCommit }
|
|
731
|
-
}),
|
|
731
|
+
}), b = d === void 0 ? void 0 : so({
|
|
732
732
|
store: v,
|
|
733
733
|
registry: d.registry,
|
|
734
734
|
subject: e.subject
|
|
735
|
-
}),
|
|
736
|
-
V(
|
|
737
|
-
let
|
|
735
|
+
}), x = lo({ store: v });
|
|
736
|
+
V(x);
|
|
737
|
+
let S = e.rowFilter === void 0 ? {} : { rowFilter: e.rowFilter };
|
|
738
738
|
return {
|
|
739
739
|
storeForTenant: (t) => {
|
|
740
740
|
let r = Nn(e.subject, t);
|
|
741
|
-
return
|
|
741
|
+
return hs(p(m(c, r), r), {
|
|
742
742
|
subject: r,
|
|
743
743
|
schemaRegistry: n,
|
|
744
|
-
...
|
|
744
|
+
...S
|
|
745
745
|
});
|
|
746
746
|
},
|
|
747
|
-
store:
|
|
747
|
+
store: hs(v, {
|
|
748
748
|
subject: e.subject,
|
|
749
749
|
schemaRegistry: n,
|
|
750
750
|
...e.rowFilter === void 0 ? {} : { rowFilter: e.rowFilter }
|
|
751
751
|
}),
|
|
752
|
-
load:
|
|
753
|
-
loadMany:
|
|
752
|
+
load: x.load,
|
|
753
|
+
loadMany: x.loadMany,
|
|
754
754
|
request: e,
|
|
755
|
-
access:
|
|
755
|
+
access: eo(e.subject),
|
|
756
756
|
cache: r,
|
|
757
757
|
kv: i,
|
|
758
|
-
...a === void 0 ? {} : { webhooks:
|
|
758
|
+
...a === void 0 ? {} : { webhooks: zc(a, {
|
|
759
759
|
tenantId: e.subject.tenantId ?? null,
|
|
760
760
|
...h === void 0 ? {} : { afterCommit: h.afterCommit },
|
|
761
|
-
...
|
|
761
|
+
...y === void 0 ? {} : { enqueue: (e, t) => y.enqueue(e, t) }
|
|
762
762
|
}) },
|
|
763
|
-
...
|
|
764
|
-
...
|
|
765
|
-
...
|
|
766
|
-
...ee === void 0 ? {} : { workflows: h ?
|
|
763
|
+
...ne === void 0 ? {} : { events: ne },
|
|
764
|
+
...y === void 0 ? {} : { outbox: y },
|
|
765
|
+
...b === void 0 ? {} : { connections: b },
|
|
766
|
+
...ee === void 0 ? {} : { workflows: h ? xo(ee, h.afterCommit) : ee }
|
|
767
767
|
};
|
|
768
768
|
};
|
|
769
769
|
}, Gc = async (e, t, n) => {
|
|
@@ -777,8 +777,8 @@ var ec = (e) => {
|
|
|
777
777
|
take: 1
|
|
778
778
|
}))[0], a = i?.subject?.tenantId ?? null, o = t.tenantId ?? null;
|
|
779
779
|
if (i === void 0 || a !== o) throw new tn({ reason: "not authorized for this workflow run" });
|
|
780
|
-
}, Kc = (e = {}) =>
|
|
781
|
-
let t = I.succeed(
|
|
780
|
+
}, Kc = (e = {}) => cs.pipe(I.provide(rs(e)), I.provide(Fs.layer), I.provide(I.succeed(Fs.RequestInit, { redirect: "manual" }))), qc = (e) => {
|
|
781
|
+
let t = I.succeed(Cs, e.cacheService), n = I.succeed(Ps, e.kvService), r = e.semanticCache === void 0 ? [] : [I.succeed(Es, e.semanticCache)], i = [
|
|
782
782
|
e.analyticsLayer,
|
|
783
783
|
t,
|
|
784
784
|
n,
|
|
@@ -809,12 +809,12 @@ var ec = (e) => {
|
|
|
809
809
|
ttlMs: n?.ttlMs ?? 864e5
|
|
810
810
|
};
|
|
811
811
|
}, Zc = (e) => {
|
|
812
|
-
let t =
|
|
812
|
+
let t = Ls(e.publicApiEntries ?? []), n = [...e.restRoutes ?? [], ...t];
|
|
813
813
|
if (n.length === 0) return {
|
|
814
814
|
routes: [],
|
|
815
815
|
httpRoutes: []
|
|
816
816
|
};
|
|
817
|
-
let r =
|
|
817
|
+
let r = Rs(n, {
|
|
818
818
|
store: e.store,
|
|
819
819
|
resolveSubject: e.resolveSubject,
|
|
820
820
|
...e.idempotency === void 0 ? {} : { idempotency: e.idempotency }
|
|
@@ -844,7 +844,7 @@ var ec = (e) => {
|
|
|
844
844
|
}, o = (e) => zt(a(e), e), s = (e) => {
|
|
845
845
|
let t = a(e);
|
|
846
846
|
return t === r ? o(e) : zt(Rt(Rt(t)), e);
|
|
847
|
-
}, c =
|
|
847
|
+
}, c = Bs(i, {
|
|
848
848
|
persistent: !0,
|
|
849
849
|
ignoreInitial: !0,
|
|
850
850
|
atomic: !0,
|
|
@@ -900,7 +900,7 @@ var ec = (e) => {
|
|
|
900
900
|
}), ll = "voltro:dev:ready", ul = (e, t = () => {}) => F.acquireUseRelease(F.sync(() => {
|
|
901
901
|
let n = process.argv[1] ?? "", r = xt(), i = bt(r);
|
|
902
902
|
i !== void 0 && X.warn(i);
|
|
903
|
-
let a =
|
|
903
|
+
let a = zs(process.execPath, [
|
|
904
904
|
...r.execArgv,
|
|
905
905
|
n,
|
|
906
906
|
"dev",
|
|
@@ -966,14 +966,14 @@ var ec = (e) => {
|
|
|
966
966
|
process.exitCode = u;
|
|
967
967
|
});
|
|
968
968
|
}), pl = async (e) => {
|
|
969
|
-
let t = e.spec ??
|
|
969
|
+
let t = e.spec ?? Io, n;
|
|
970
970
|
return t.kind !== "noop" && e.sqlLayer !== void 0 ? n = await F.runPromise(F.gen(function* () {
|
|
971
971
|
let n = yield* nr.SqlClient, r = t.build(n);
|
|
972
972
|
return t.initialize && (yield* t.initialize(r).pipe(F.catchAll((t) => F.sync(() => e.log.warn("analytics sink initialize failed", {
|
|
973
973
|
provider: r.info.provider,
|
|
974
974
|
err: String(t)
|
|
975
975
|
}))))), r;
|
|
976
|
-
}).pipe(F.provide(e.sqlLayer))) : (t.kind !== "noop" && e.sqlLayer === void 0 && e.log.warn(`analytics sink '${t.kind}' requires a real SQL store — falling back to noop`), n =
|
|
976
|
+
}).pipe(F.provide(e.sqlLayer))) : (t.kind !== "noop" && e.sqlLayer === void 0 && e.log.warn(`analytics sink '${t.kind}' requires a real SQL store — falling back to noop`), n = Fo()), e.log.info("analytics sink", {
|
|
977
977
|
provider: n.info.provider,
|
|
978
978
|
capabilities: n.info.capabilities,
|
|
979
979
|
...n.info.detail ?? {}
|
|
@@ -1039,11 +1039,11 @@ var ec = (e) => {
|
|
|
1039
1039
|
return r;
|
|
1040
1040
|
}, vl = (e, t, n, r, i) => {
|
|
1041
1041
|
if (e.length === 0) return () => {};
|
|
1042
|
-
let a =
|
|
1042
|
+
let a = hs(t, {
|
|
1043
1043
|
subject: B,
|
|
1044
1044
|
schemaRegistry: r,
|
|
1045
1045
|
rowFilter: Zi
|
|
1046
|
-
}), o = i === void 0 ? void 0 :
|
|
1046
|
+
}), o = i === void 0 ? void 0 : po({
|
|
1047
1047
|
bus: i,
|
|
1048
1048
|
tenantId: B.tenantId ?? null
|
|
1049
1049
|
}), s = [];
|
|
@@ -1057,7 +1057,7 @@ var ec = (e) => {
|
|
|
1057
1057
|
...o === void 0 ? {} : { publish: o.publish }
|
|
1058
1058
|
};
|
|
1059
1059
|
try {
|
|
1060
|
-
let a =
|
|
1060
|
+
let a = ts(c(t, n));
|
|
1061
1061
|
a !== void 0 && a.catch((n) => {
|
|
1062
1062
|
e.warn("subscriber: handler rejected", {
|
|
1063
1063
|
table: i,
|
|
@@ -1203,7 +1203,7 @@ var ec = (e) => {
|
|
|
1203
1203
|
isArmed: () => !s && !f
|
|
1204
1204
|
};
|
|
1205
1205
|
}, Cl = "<builtin:connections>", wl = {
|
|
1206
|
-
registry:
|
|
1206
|
+
registry: ao([]),
|
|
1207
1207
|
queries: [],
|
|
1208
1208
|
mutations: [],
|
|
1209
1209
|
actions: [],
|
|
@@ -1213,15 +1213,15 @@ var ec = (e) => {
|
|
|
1213
1213
|
let { definitions: t, store: n, publicUrl: r, log: i } = e;
|
|
1214
1214
|
if (t.length === 0) return wl;
|
|
1215
1215
|
oa(t);
|
|
1216
|
-
let a =
|
|
1216
|
+
let a = ao(t), o = {
|
|
1217
1217
|
registry: a,
|
|
1218
1218
|
publicUrl: r
|
|
1219
1219
|
};
|
|
1220
|
-
|
|
1220
|
+
q(oo({
|
|
1221
1221
|
store: n,
|
|
1222
1222
|
registry: a
|
|
1223
1223
|
}));
|
|
1224
|
-
let s =
|
|
1224
|
+
let s = go(o), c = Do(o), l = Oo(o), u = uo(o), d = t.some((e) => e.kind === "oauth2"), f = d ? [{
|
|
1225
1225
|
method: "GET",
|
|
1226
1226
|
path: "/_voltro/connections",
|
|
1227
1227
|
handle: async (e) => {
|
|
@@ -1294,7 +1294,7 @@ var ec = (e) => {
|
|
|
1294
1294
|
};
|
|
1295
1295
|
}, El = (e) => ({
|
|
1296
1296
|
status: 302,
|
|
1297
|
-
headers: { location:
|
|
1297
|
+
headers: { location: Zo(e.startsWith("/") ? e : `/${e}`) },
|
|
1298
1298
|
body: ""
|
|
1299
1299
|
}), Dl = (e) => process.env.VOLTRO_PUBLIC_URL?.replace(/\/+$/, "") ?? `http://localhost:${e}`, Ol = class extends Error {
|
|
1300
1300
|
constructor(e) {
|
|
@@ -1609,18 +1609,18 @@ var ec = (e) => {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
return n.authorization = t, n;
|
|
1611
1611
|
}, ru = async (e, t, n, r, i = {}) => {
|
|
1612
|
-
let a = e.includes("?") ? e.slice(0, e.indexOf("?")) : e, o = `${
|
|
1612
|
+
let a = e.includes("?") ? e.slice(0, e.indexOf("?")) : e, o = `${mt}/agent/tools`, s = `${mt}/agent/call`;
|
|
1613
1613
|
if (a !== o && a !== s) return null;
|
|
1614
|
-
let c =
|
|
1614
|
+
let c = O(n.origin ?? n.Origin), l = (i.method ?? "GET").toUpperCase(), u = (e, t) => ({
|
|
1615
1615
|
status: e,
|
|
1616
1616
|
contentType: "application/json; charset=utf-8",
|
|
1617
1617
|
body: JSON.stringify(t),
|
|
1618
1618
|
headers: c
|
|
1619
1619
|
});
|
|
1620
|
-
if (
|
|
1621
|
-
let d =
|
|
1620
|
+
if (qe()) return u(503, { error: "inspect disabled (VOLTRO_INSPECT=off)" });
|
|
1621
|
+
let d = st(l, n, c);
|
|
1622
1622
|
if (d !== null) return d;
|
|
1623
|
-
let f = (i.authResolver ??
|
|
1623
|
+
let f = (i.authResolver ?? et)(n, l);
|
|
1624
1624
|
if (!f.ok) return u(401, {
|
|
1625
1625
|
error: "unauthorized",
|
|
1626
1626
|
reason: f.reason
|
|
@@ -1666,15 +1666,15 @@ var ec = (e) => {
|
|
|
1666
1666
|
error: "no app credential",
|
|
1667
1667
|
reason: `an agent tool call must carry the app credential it acts as, in the \`${Xl}\` header (e.g. \`Bearer <api key>\`). The inspect token authorises the TRANSPORT; it is not an app identity, and running as the anonymous subject instead would execute under a principal nobody chose.`
|
|
1668
1668
|
});
|
|
1669
|
-
let
|
|
1669
|
+
let ne = await p.resolveSubject(te), y = Zl();
|
|
1670
1670
|
try {
|
|
1671
1671
|
return u(200, {
|
|
1672
1672
|
ok: !0,
|
|
1673
1673
|
result: await v.run(_.input, {
|
|
1674
|
-
subject:
|
|
1675
|
-
traceId:
|
|
1674
|
+
subject: ne,
|
|
1675
|
+
traceId: y
|
|
1676
1676
|
}),
|
|
1677
|
-
traceId:
|
|
1677
|
+
traceId: y
|
|
1678
1678
|
});
|
|
1679
1679
|
} catch (e) {
|
|
1680
1680
|
return u(200, {
|
|
@@ -1683,7 +1683,7 @@ var ec = (e) => {
|
|
|
1683
1683
|
message: e.message,
|
|
1684
1684
|
name: e.name
|
|
1685
1685
|
} : String(e),
|
|
1686
|
-
traceId:
|
|
1686
|
+
traceId: y
|
|
1687
1687
|
});
|
|
1688
1688
|
}
|
|
1689
1689
|
}, iu = (e) => {
|
|
@@ -1791,7 +1791,7 @@ var ec = (e) => {
|
|
|
1791
1791
|
...e
|
|
1792
1792
|
}), l = t.onChange((e) => {
|
|
1793
1793
|
let t = s.get(e.table);
|
|
1794
|
-
if (t !== void 0) for (let { reaction: n, log: r } of t)
|
|
1794
|
+
if (t !== void 0) for (let { reaction: n, log: r } of t) Xo(n, e, c()).then((t) => {
|
|
1795
1795
|
t === "acted" && r.info("reaction: acted", {
|
|
1796
1796
|
table: e.table,
|
|
1797
1797
|
op: e.op
|
|
@@ -2046,7 +2046,7 @@ var ec = (e) => {
|
|
|
2046
2046
|
continue;
|
|
2047
2047
|
}
|
|
2048
2048
|
let o = e.default;
|
|
2049
|
-
if (!
|
|
2049
|
+
if (!H(o)) {
|
|
2050
2050
|
t.warn("aggregate: default export is not a defineAggregate() result", { file: a });
|
|
2051
2051
|
continue;
|
|
2052
2052
|
}
|
|
@@ -2098,7 +2098,7 @@ var ec = (e) => {
|
|
|
2098
2098
|
for (let e = 0; e < t.length; e++) {
|
|
2099
2099
|
let i = n(t[e]);
|
|
2100
2100
|
if (i._tag === "Left") {
|
|
2101
|
-
let t =
|
|
2101
|
+
let t = Hs.formatErrorSync(i.left)[0], n = t?.path?.length ? t.path.join(".") : "<root>";
|
|
2102
2102
|
return {
|
|
2103
2103
|
ok: !1,
|
|
2104
2104
|
reason: `row[${e}] failed output-schema decode at ${n}: ${t?.message ?? "unknown"}`
|
|
@@ -2315,7 +2315,7 @@ var ec = (e) => {
|
|
|
2315
2315
|
}, h);
|
|
2316
2316
|
g.unref(), a.scheduleTimer = g;
|
|
2317
2317
|
}, ju = async (e) => {
|
|
2318
|
-
let t = e.storage ?? fu(), n = e.coordinator ??
|
|
2318
|
+
let t = e.storage ?? fu(), n = e.coordinator ?? ns, r = e.analytics ?? Fo(), i = e.log;
|
|
2319
2319
|
await t.initialize();
|
|
2320
2320
|
let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = {
|
|
2321
2321
|
refreshedAt: null,
|
|
@@ -2538,7 +2538,7 @@ var ec = (e) => {
|
|
|
2538
2538
|
});
|
|
2539
2539
|
}
|
|
2540
2540
|
return o;
|
|
2541
|
-
}, zu = (e, t) => Ru(e, t,
|
|
2541
|
+
}, zu = (e, t) => Ru(e, t, Va, "expectation", "defineExpectation"), Bu = (e, t) => Ru(e, t, za, "budget", "defineCostBudget"), Vu = (e, t) => Ru(e, t, Ha, "experiment", "defineExperiment"), Hu = {
|
|
2542
2542
|
snapshot: () => [],
|
|
2543
2543
|
get: () => null,
|
|
2544
2544
|
violations: () => [],
|
|
@@ -3339,7 +3339,7 @@ var ec = (e) => {
|
|
|
3339
3339
|
t.warn("email: failed to import", { file: i }, e);
|
|
3340
3340
|
continue;
|
|
3341
3341
|
}
|
|
3342
|
-
let a = Object.values(e).filter(
|
|
3342
|
+
let a = Object.values(e).filter(Us);
|
|
3343
3343
|
if (a.length === 0) {
|
|
3344
3344
|
t.warn("email: no defineEmail export found", { file: i });
|
|
3345
3345
|
continue;
|
|
@@ -3356,7 +3356,7 @@ var ec = (e) => {
|
|
|
3356
3356
|
let t = r.child("seeds"), s = await e.loadSeedFiles(i, t);
|
|
3357
3357
|
if (a = s.length, o = s, s.length > 0) {
|
|
3358
3358
|
for (let t of s) e.onSeedDiscovered?.(t);
|
|
3359
|
-
if (
|
|
3359
|
+
if (fe(s, n, t), e.seedPolicy === "run" && e.runBootSeeds !== void 0) {
|
|
3360
3360
|
t.info("discovered seeds", { ids: s.map((e) => e.definition.id) });
|
|
3361
3361
|
let r = await e.runBootSeeds(s, n, t);
|
|
3362
3362
|
for (let t of r) e.onSeedResult?.(t);
|
|
@@ -3393,7 +3393,7 @@ var ec = (e) => {
|
|
|
3393
3393
|
seeds: o
|
|
3394
3394
|
});
|
|
3395
3395
|
}, nf = (e) => {
|
|
3396
|
-
let t =
|
|
3396
|
+
let t = oe(e.seeds, e.store, e.log);
|
|
3397
3397
|
return t.length === 0 ? e.schedules : (e.log.info(`${t.length} cron-lifecycle seed(s) scheduled on the coordinated cron scheduler`, { schedules: t.map((e) => e.name) }), [...e.schedules, ...t]);
|
|
3398
3398
|
}, rf = (e) => `workflow:${e}`, af = {
|
|
3399
3399
|
skip: "skip",
|
|
@@ -3504,7 +3504,7 @@ var ec = (e) => {
|
|
|
3504
3504
|
return e.log?.warn("inspect.migrations: snapshot build failed", { err: String(n) }), t;
|
|
3505
3505
|
}
|
|
3506
3506
|
}, lf = (e) => F.map(e, (e) => ({ text: e })), uf = (e) => {
|
|
3507
|
-
let { descriptor: t, executor: n, file: r } = e, { send: i, messages: a } =
|
|
3507
|
+
let { descriptor: t, executor: n, file: r } = e, { send: i, messages: a } = Vs(t);
|
|
3508
3508
|
return [{
|
|
3509
3509
|
kind: "action",
|
|
3510
3510
|
file: r,
|
|
@@ -3529,16 +3529,16 @@ var ec = (e) => {
|
|
|
3529
3529
|
executor: (e, t) => ri(t.store, e.threadId)
|
|
3530
3530
|
}];
|
|
3531
3531
|
}, df = "<builtin:undo>", ff = () => {
|
|
3532
|
-
if (!
|
|
3532
|
+
if (!ds()) return {
|
|
3533
3533
|
queries: [],
|
|
3534
3534
|
mutations: []
|
|
3535
3535
|
};
|
|
3536
|
-
let e =
|
|
3536
|
+
let e = ls();
|
|
3537
3537
|
return {
|
|
3538
3538
|
queries: [{
|
|
3539
3539
|
file: df,
|
|
3540
3540
|
descriptor: Fn,
|
|
3541
|
-
executor: (t, n) => e ?
|
|
3541
|
+
executor: (t, n) => e ? us(t, n) : Promise.resolve([])
|
|
3542
3542
|
}],
|
|
3543
3543
|
mutations: [{
|
|
3544
3544
|
file: df,
|
|
@@ -3547,22 +3547,22 @@ var ec = (e) => {
|
|
|
3547
3547
|
}, {
|
|
3548
3548
|
file: df,
|
|
3549
3549
|
descriptor: In,
|
|
3550
|
-
executor: (t, n) => e ?
|
|
3550
|
+
executor: (t, n) => e ? Wo(t, n) : Promise.reject(new nn({ invocationId: t.invocationId }))
|
|
3551
3551
|
}]
|
|
3552
3552
|
};
|
|
3553
|
-
}, pf = () =>
|
|
3553
|
+
}, pf = () => ds() && !ls() ? "undo: the `__voltro.undo.*` procedures are served but capture is OFF for this environment, so the undo log will always be empty and apply/redo will answer UndoNotFound. Set VOLTRO_UNDO=on to capture (it costs a read-before-write per update/delete plus one log row per mutation), or VOLTRO_UNDO=off to remove the procedures from the client bundle as well." : void 0, mf = () => ls() ? (e) => ko(e) : (e) => ({
|
|
3554
3554
|
tx: e,
|
|
3555
3555
|
persist: async () => {}
|
|
3556
3556
|
}), hf = "<builtin:approvals>", gf = (e, t = process.env) => {
|
|
3557
3557
|
let n = e?.approvals?.expiresIn;
|
|
3558
3558
|
if (n !== void 0) {
|
|
3559
|
-
let e =
|
|
3559
|
+
let e = Ro(n);
|
|
3560
3560
|
if (e === null) throw Error(`app.config.ts: \`approvals.expiresIn\` must be an interval like '4h' / '30m' (got ${JSON.stringify(n)})`);
|
|
3561
3561
|
return e;
|
|
3562
3562
|
}
|
|
3563
3563
|
let r = Number(t.VOLTRO_APPROVAL_EXPIRY_HOURS);
|
|
3564
3564
|
return Number.isFinite(r) && r > 0 ? r * 36e5 : Ui;
|
|
3565
|
-
}, _f = (e) => e.some((e) => e?.requiresApproval != null), vf = (e) => (La(
|
|
3565
|
+
}, _f = (e) => e.some((e) => e?.requiresApproval != null), vf = (e) => (La(to({
|
|
3566
3566
|
store: e.store,
|
|
3567
3567
|
defaultExpiryMs: e.defaultExpiryMs ?? Ui
|
|
3568
3568
|
})), {
|
|
@@ -3853,7 +3853,7 @@ var ec = (e) => {
|
|
|
3853
3853
|
mutation: Pf(pn(Nf(e, "mutation", t))),
|
|
3854
3854
|
action: Pf(pn(Nf(e, "action", t))),
|
|
3855
3855
|
query: Pf(pn(Nf(e, "query", t)))
|
|
3856
|
-
}), If = `${
|
|
3856
|
+
}), If = `${mt}/plugins/`, Lf = (e) => e.startsWith("/") ? e : `/${e}`, Rf = (e) => {
|
|
3857
3857
|
let t = e.indexOf("?");
|
|
3858
3858
|
return t >= 0 ? e.slice(0, t) : e;
|
|
3859
3859
|
}, zf = (e, t) => e.kind === "json" ? {
|
|
@@ -3869,7 +3869,7 @@ var ec = (e) => {
|
|
|
3869
3869
|
}, Bf = (e) => {
|
|
3870
3870
|
let t = /* @__PURE__ */ new Map(), n = [];
|
|
3871
3871
|
for (let r of e) {
|
|
3872
|
-
let e = r.inspectEndpoints ?? [], i =
|
|
3872
|
+
let e = r.inspectEndpoints ?? [], i = C(r.name);
|
|
3873
3873
|
for (let a of e) {
|
|
3874
3874
|
let e = `${If}${i}${Lf(a.path)}`, o = `${a.method} ${e}`, s = t.get(o);
|
|
3875
3875
|
if (s !== void 0) throw Error(`plugin inspect endpoint collision: "${a.method} ${e}" declared by plugin "${r.name}" but already claimed by ${s}`);
|
|
@@ -3887,20 +3887,20 @@ var ec = (e) => {
|
|
|
3887
3887
|
async dispatch(e, t, r, i, a) {
|
|
3888
3888
|
let o = Rf(e);
|
|
3889
3889
|
if (!o.startsWith(If)) return null;
|
|
3890
|
-
let s =
|
|
3890
|
+
let s = O(r.origin ?? r.Origin), c = t.toUpperCase();
|
|
3891
3891
|
if (c === "OPTIONS") return {
|
|
3892
3892
|
status: 204,
|
|
3893
3893
|
contentType: "text/plain",
|
|
3894
3894
|
body: "",
|
|
3895
3895
|
headers: s
|
|
3896
3896
|
};
|
|
3897
|
-
if (
|
|
3897
|
+
if (qe()) return {
|
|
3898
3898
|
status: 503,
|
|
3899
3899
|
contentType: "application/json; charset=utf-8",
|
|
3900
3900
|
body: JSON.stringify({ error: "inspect disabled (VOLTRO_INSPECT=off)" }),
|
|
3901
3901
|
headers: s
|
|
3902
3902
|
};
|
|
3903
|
-
let l = (a?.authResolver ??
|
|
3903
|
+
let l = (a?.authResolver ?? et)(r, t);
|
|
3904
3904
|
if (!l.ok) return {
|
|
3905
3905
|
status: 401,
|
|
3906
3906
|
contentType: "application/json; charset=utf-8",
|
|
@@ -4254,7 +4254,7 @@ var ec = (e) => {
|
|
|
4254
4254
|
for (let n of e) {
|
|
4255
4255
|
let e = n.dashboard ?? [];
|
|
4256
4256
|
if (e.length === 0) continue;
|
|
4257
|
-
let r =
|
|
4257
|
+
let r = ge(n.name), i = /* @__PURE__ */ new Set();
|
|
4258
4258
|
for (let a of e) {
|
|
4259
4259
|
if (i.has(a.id)) throw Error(`plugin "${n.name}" declares duplicate dashboard mount id "${a.id}"`);
|
|
4260
4260
|
i.add(a.id), t.push({
|
|
@@ -4292,7 +4292,7 @@ var ec = (e) => {
|
|
|
4292
4292
|
for (let i of r) {
|
|
4293
4293
|
if (op.has(i.name)) continue;
|
|
4294
4294
|
let r = N(e, i.name);
|
|
4295
|
-
i.isDirectory() ? await n(r) : i.isFile() && (ip.test(i.name) && !ap.test(i.name) ||
|
|
4295
|
+
i.isDirectory() ? await n(r) : i.isFile() && (ip.test(i.name) && !ap.test(i.name) || Ae.test(i.name)) && t.push(r);
|
|
4296
4296
|
}
|
|
4297
4297
|
};
|
|
4298
4298
|
return await n(e), t;
|
|
@@ -4308,7 +4308,7 @@ var ec = (e) => {
|
|
|
4308
4308
|
tag: e.name
|
|
4309
4309
|
});
|
|
4310
4310
|
}
|
|
4311
|
-
if (r && typeof r == "object" &&
|
|
4311
|
+
if (r && typeof r == "object" && Ae.test(e) && "name" in r) {
|
|
4312
4312
|
let e = r;
|
|
4313
4313
|
typeof e.name == "string" && n.push({
|
|
4314
4314
|
kind: "workflow",
|
|
@@ -4327,7 +4327,7 @@ var ec = (e) => {
|
|
|
4327
4327
|
if (r.length === 0) return [];
|
|
4328
4328
|
let i = await cp(n);
|
|
4329
4329
|
return r.map((e) => {
|
|
4330
|
-
let n =
|
|
4330
|
+
let n = ge(e.name), r = {
|
|
4331
4331
|
pluginName: e.name,
|
|
4332
4332
|
pluginAlias: n,
|
|
4333
4333
|
apiName: t,
|
|
@@ -4343,7 +4343,7 @@ var ec = (e) => {
|
|
|
4343
4343
|
pluginContributions: await lp(e, t, n),
|
|
4344
4344
|
pluginErrorImports: e.flatMap((e) => (e.errorSchemas ?? []).map((e) => e.import)),
|
|
4345
4345
|
pluginRpcImports: e.flatMap((e) => (e.rpcClientDescriptors ?? []).map((t) => ({
|
|
4346
|
-
tag:
|
|
4346
|
+
tag: Oe(e, t.tag),
|
|
4347
4347
|
kind: t.kind,
|
|
4348
4348
|
module: t.import.module,
|
|
4349
4349
|
name: t.import.name
|
|
@@ -4612,7 +4612,7 @@ var ec = (e) => {
|
|
|
4612
4612
|
return {
|
|
4613
4613
|
inspectStartWorkflow: async (e) => {
|
|
4614
4614
|
if (i === void 0) throw Error("workflow runtime is not configured");
|
|
4615
|
-
let t = await
|
|
4615
|
+
let t = await jo(i, {
|
|
4616
4616
|
traceId: `inspect-workflow-start-${Date.now()}`,
|
|
4617
4617
|
source: "inspect"
|
|
4618
4618
|
}).start(e.name, e.payload);
|
|
@@ -5011,7 +5011,7 @@ var ec = (e) => {
|
|
|
5011
5011
|
let t = e.now ?? Date.now, n = {
|
|
5012
5012
|
phase: "booting",
|
|
5013
5013
|
startedAt: t()
|
|
5014
|
-
}, r =
|
|
5014
|
+
}, r = Qs((e, r) => {
|
|
5015
5015
|
let i = (e.url ?? "/").split("?")[0], a = n.phase === "ready";
|
|
5016
5016
|
if (i === "/internal/liveness") {
|
|
5017
5017
|
r.writeHead(200, {
|
|
@@ -5086,7 +5086,7 @@ var ec = (e) => {
|
|
|
5086
5086
|
delivery. Rename one of them.`);
|
|
5087
5087
|
}, mm = (e) => {
|
|
5088
5088
|
let t = new Map(e.events.map((e) => [e.descriptor.name, e.descriptor.delivery ?? "each"])), n = new Ki({
|
|
5089
|
-
origin: e.origin ??
|
|
5089
|
+
origin: e.origin ?? Ss(),
|
|
5090
5090
|
deliveryOf: (e) => t.get(e),
|
|
5091
5091
|
...e.publishRemote === void 0 ? {} : { publishRemote: e.publishRemote }
|
|
5092
5092
|
}), r = [], i = {};
|
|
@@ -5394,14 +5394,14 @@ var ec = (e) => {
|
|
|
5394
5394
|
if ((e.includes("?") ? e.slice(0, e.indexOf("?")) : e) !== "/_voltro/inspect/checks") return null;
|
|
5395
5395
|
let i = (r.method ?? "GET").toUpperCase();
|
|
5396
5396
|
if (i !== "GET") return null;
|
|
5397
|
-
let a =
|
|
5397
|
+
let a = O(n.origin ?? n.Origin), o = (e, t) => ({
|
|
5398
5398
|
status: e,
|
|
5399
5399
|
contentType: "application/json; charset=utf-8",
|
|
5400
5400
|
body: JSON.stringify(t),
|
|
5401
5401
|
headers: a
|
|
5402
5402
|
});
|
|
5403
|
-
if (
|
|
5404
|
-
let s = (r.authResolver ??
|
|
5403
|
+
if (qe()) return o(503, { error: "inspect disabled (VOLTRO_INSPECT=off)" });
|
|
5404
|
+
let s = (r.authResolver ?? et)(n, i);
|
|
5405
5405
|
if (!s.ok) return o(401, {
|
|
5406
5406
|
error: "unauthorized",
|
|
5407
5407
|
reason: s.reason
|
|
@@ -5420,65 +5420,65 @@ var ec = (e) => {
|
|
|
5420
5420
|
if (r) return r;
|
|
5421
5421
|
}
|
|
5422
5422
|
if (e.startsWith("/_voltro/inspect/schedules")) {
|
|
5423
|
-
let r = await
|
|
5423
|
+
let r = await at(e, t, n, {
|
|
5424
5424
|
method: i,
|
|
5425
5425
|
...a === void 0 ? {} : { body: a }
|
|
5426
5426
|
});
|
|
5427
5427
|
if (r) return r;
|
|
5428
5428
|
}
|
|
5429
5429
|
if (e === "/_voltro/inspect/cluster" || e.startsWith("/_voltro/inspect/cluster?")) {
|
|
5430
|
-
let r = await
|
|
5430
|
+
let r = await pt(e, t, n, { method: i });
|
|
5431
5431
|
if (r) return r;
|
|
5432
5432
|
}
|
|
5433
5433
|
if (i === "GET" && (e === "/_voltro/inspect/data/rows" || e.startsWith("/_voltro/inspect/data/rows?"))) {
|
|
5434
|
-
let r = await
|
|
5434
|
+
let r = await ct(e, t, n, { method: i });
|
|
5435
5435
|
if (r) return r;
|
|
5436
5436
|
}
|
|
5437
5437
|
if (i === "GET" && e.startsWith("/_voltro/inspect/provenance")) {
|
|
5438
|
-
let r = await
|
|
5438
|
+
let r = await lt(e, t, n, { method: i });
|
|
5439
5439
|
if (r) return r;
|
|
5440
5440
|
}
|
|
5441
5441
|
if (e.startsWith("/_voltro/inspect/workflows/flow-control")) {
|
|
5442
|
-
let r = await
|
|
5442
|
+
let r = await rt(e, t, n, a ?? "", { method: i });
|
|
5443
5443
|
if (r) return r;
|
|
5444
5444
|
}
|
|
5445
5445
|
if (i === "GET" && (e === "/_voltro/inspect/workflows/runs" || e.startsWith("/_voltro/inspect/workflows/runs?"))) {
|
|
5446
|
-
let r = await
|
|
5446
|
+
let r = await Qe(e, t, n, { method: i });
|
|
5447
5447
|
if (r) return r;
|
|
5448
5448
|
}
|
|
5449
5449
|
if (i === "GET" && (e === "/_voltro/inspect/workflows/stats" || e.startsWith("/_voltro/inspect/workflows/stats?"))) {
|
|
5450
|
-
let r = await
|
|
5450
|
+
let r = await Je(e, t, n, { method: i });
|
|
5451
5451
|
if (r) return r;
|
|
5452
5452
|
}
|
|
5453
5453
|
if (i === "POST" && e.startsWith("/_voltro/inspect/workflows/start/")) {
|
|
5454
|
-
let r = await
|
|
5454
|
+
let r = await k(e, t, n, a ?? "", { method: i });
|
|
5455
5455
|
if (r) return r;
|
|
5456
5456
|
}
|
|
5457
5457
|
if (i === "GET" && e.startsWith("/_voltro/inspect/workflows/runs/") && e.endsWith("/steps")) {
|
|
5458
|
-
let r = await
|
|
5458
|
+
let r = await A(e, t, n, { method: i });
|
|
5459
5459
|
if (r) return r;
|
|
5460
5460
|
}
|
|
5461
5461
|
if (i === "GET" && e.startsWith("/_voltro/inspect/workflows/runs/") && e.endsWith("/events")) {
|
|
5462
|
-
let r = await
|
|
5462
|
+
let r = await Ze(e, t, n, { method: i });
|
|
5463
5463
|
if (r) return r;
|
|
5464
5464
|
}
|
|
5465
5465
|
if (i === "GET" && (e === "/_voltro/inspect/workflows/events" || e.startsWith("/_voltro/inspect/workflows/events?"))) {
|
|
5466
|
-
let r = await
|
|
5466
|
+
let r = await tt(t, e, n, { method: i });
|
|
5467
5467
|
if (r) return r;
|
|
5468
5468
|
}
|
|
5469
5469
|
if (i === "GET" && e.startsWith("/_voltro/inspect/workflows/events/") && e.endsWith("/deliveries")) {
|
|
5470
|
-
let r = await
|
|
5470
|
+
let r = await _t(t, e, n, { method: i });
|
|
5471
5471
|
if (r) return r;
|
|
5472
5472
|
}
|
|
5473
5473
|
if (i === "GET" && (e === "/_voltro/inspect/workflows/children" || e.startsWith("/_voltro/inspect/workflows/children?"))) {
|
|
5474
|
-
let r = await
|
|
5474
|
+
let r = await j(e, t, n, { method: i });
|
|
5475
5475
|
if (r) return r;
|
|
5476
5476
|
}
|
|
5477
5477
|
if (i === "POST" && e.startsWith("/_voltro/inspect/workflows/runs/") && (e.endsWith("/cancel") || e.endsWith("/retry") || e.endsWith("/suspend") || e.endsWith("/resume") || e.endsWith("/signal"))) {
|
|
5478
|
-
let r = await
|
|
5478
|
+
let r = await gt(e, t, n, a ?? "", { method: i });
|
|
5479
5479
|
if (r) return r;
|
|
5480
5480
|
}
|
|
5481
|
-
return i === "POST" && e.startsWith("/_voltro/inspect/webhooks/") ?
|
|
5481
|
+
return i === "POST" && e.startsWith("/_voltro/inspect/webhooks/") ? $e(e, t, n, a ?? "", { method: i }).then((e) => e ?? {
|
|
5482
5482
|
status: 404,
|
|
5483
5483
|
contentType: "application/json; charset=utf-8",
|
|
5484
5484
|
body: JSON.stringify({ error: "unknown webhook URL" })
|
|
@@ -5491,12 +5491,12 @@ var ec = (e) => {
|
|
|
5491
5491
|
targets: [],
|
|
5492
5492
|
deliveries: []
|
|
5493
5493
|
}),
|
|
5494
|
-
headers:
|
|
5494
|
+
headers: O(n.origin)
|
|
5495
5495
|
} : t.webhooks().then((e) => ({
|
|
5496
5496
|
status: 200,
|
|
5497
5497
|
contentType: "application/json; charset=utf-8",
|
|
5498
5498
|
body: JSON.stringify(e),
|
|
5499
|
-
headers:
|
|
5499
|
+
headers: O(n.origin)
|
|
5500
5500
|
})) : null;
|
|
5501
5501
|
}, Am = (e) => ({
|
|
5502
5502
|
schedules: e.schedules.map((t) => ({
|
|
@@ -5508,7 +5508,7 @@ var ec = (e) => {
|
|
|
5508
5508
|
backfill: t.backfill ?? "skip",
|
|
5509
5509
|
maxRuntimeMs: t.maxRuntimeMs ?? 18e5,
|
|
5510
5510
|
...t.description === void 0 ? {} : { description: t.description },
|
|
5511
|
-
nextFiringAt:
|
|
5511
|
+
nextFiringAt: Po(t).toISOString()
|
|
5512
5512
|
})),
|
|
5513
5513
|
coordination: e.coordination
|
|
5514
5514
|
}), jm = 1e4, Mm = (e) => async (t) => {
|
|
@@ -6137,11 +6137,11 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6137
6137
|
}
|
|
6138
6138
|
!l && c > n && t.onTruncated?.(c, n);
|
|
6139
6139
|
}, fh = (e, t, n) => ({
|
|
6140
|
-
option:
|
|
6140
|
+
option: Ys(e ?? [])?.broadcast?.namespace,
|
|
6141
6141
|
env: n.VOLTRO_BROADCAST_NAMESPACE,
|
|
6142
6142
|
appName: t
|
|
6143
|
-
}), ph = (e, t, n = process.env) =>
|
|
6144
|
-
let r =
|
|
6143
|
+
}), ph = (e, t, n = process.env) => Xs(fh(e, t, n)), mh = (e, t, n = process.env) => {
|
|
6144
|
+
let r = qs(fh(e, t, n));
|
|
6145
6145
|
if (r.changed) return `broadcast namespace "${r.configured}" was normalised to "${r.resolved}" — it becomes a broker subject, so whitespace, dots and wildcards are folded to "-".
|
|
6146
6146
|
Two deployments configured differently can collapse onto ONE channel this way ("my app" and "my.app" both give "my-app"); if these are meant to be separate, make the resolved names differ.`;
|
|
6147
6147
|
}, hh = (e) => typeof e == "object" && !!e && typeof e.route == "string" && typeof e.event == "string" && typeof e.origin == "string" && Number.isFinite(e.n) && Number.isFinite(e.emittedAt), gh = async (e) => {
|
|
@@ -6167,7 +6167,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6167
6167
|
}
|
|
6168
6168
|
}, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = (a) => {
|
|
6169
6169
|
if (i.has(a)) return;
|
|
6170
|
-
let o =
|
|
6170
|
+
let o = Js(e.namespace, a);
|
|
6171
6171
|
F.runPromise(e.provider.subscribe(o, n(o))).then((e) => {
|
|
6172
6172
|
if (!r.has(a)) {
|
|
6173
6173
|
e();
|
|
@@ -6204,7 +6204,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6204
6204
|
}, _h = (e, t, n) => {
|
|
6205
6205
|
let r = !1;
|
|
6206
6206
|
return (i) => {
|
|
6207
|
-
let a =
|
|
6207
|
+
let a = Js(t, i.event);
|
|
6208
6208
|
F.runPromise(e.publish(a, JSON.stringify(i))).then(() => {
|
|
6209
6209
|
r = !1;
|
|
6210
6210
|
}, (e) => {
|
|
@@ -6215,7 +6215,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6215
6215
|
});
|
|
6216
6216
|
};
|
|
6217
6217
|
}, vh = (e, t, n) => {
|
|
6218
|
-
let r =
|
|
6218
|
+
let r = Ys(e ?? [])?.broadcast?.provider;
|
|
6219
6219
|
return r === void 0 ? {
|
|
6220
6220
|
publishRemote: void 0,
|
|
6221
6221
|
attach: async () => null
|
|
@@ -6230,12 +6230,12 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6230
6230
|
});
|
|
6231
6231
|
return n?.info("events: cross-instance fan-out active", {
|
|
6232
6232
|
provider: r.name,
|
|
6233
|
-
channelPrefix: `${
|
|
6233
|
+
channelPrefix: `${Ks(t, "events")}:`
|
|
6234
6234
|
}), i;
|
|
6235
6235
|
}
|
|
6236
6236
|
};
|
|
6237
6237
|
}, yh = (e) => typeof e == "object" && !!e && typeof e.instanceId == "string" && Number.isFinite(e.startedAt), bh = (e, t) => {
|
|
6238
|
-
let n =
|
|
6238
|
+
let n = Ys(e ?? [])?.broadcast?.provider, r = t.logger;
|
|
6239
6239
|
if (n === void 0) {
|
|
6240
6240
|
let e = new Xi({
|
|
6241
6241
|
instanceId: t.instanceId,
|
|
@@ -6252,10 +6252,10 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6252
6252
|
instanceId: t.instanceId,
|
|
6253
6253
|
...t.meta === void 0 ? {} : { meta: t.meta },
|
|
6254
6254
|
announce: (e) => {
|
|
6255
|
-
F.runPromise(n.publish(
|
|
6255
|
+
F.runPromise(n.publish(Ks(t.namespace, "members"), JSON.stringify(e))).catch(() => {});
|
|
6256
6256
|
}
|
|
6257
6257
|
}), a;
|
|
6258
|
-
return F.runPromise(n.subscribe(
|
|
6258
|
+
return F.runPromise(n.subscribe(Ks(t.namespace, "members"), (e) => {
|
|
6259
6259
|
let t;
|
|
6260
6260
|
try {
|
|
6261
6261
|
t = JSON.parse(e);
|
|
@@ -6271,7 +6271,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6271
6271
|
r?.info(`membership: instance ${e.kind}`, { instanceId: e.instanceId });
|
|
6272
6272
|
}), i.start(), r?.info("membership: announcing", {
|
|
6273
6273
|
instanceId: t.instanceId,
|
|
6274
|
-
channel:
|
|
6274
|
+
channel: Ks(t.namespace, "members")
|
|
6275
6275
|
}), {
|
|
6276
6276
|
membership: i,
|
|
6277
6277
|
detach: async () => {
|
|
@@ -6342,11 +6342,11 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6342
6342
|
})(), Dh = process.env.TENANT ?? "acme", Oh = {
|
|
6343
6343
|
id: "voltro-password",
|
|
6344
6344
|
resolve: (e) => {
|
|
6345
|
-
let t = e.headers.cookie ?? e.headers.Cookie, n =
|
|
6345
|
+
let t = e.headers.cookie ?? e.headers.Cookie, n = vs(t, _s);
|
|
6346
6346
|
if (!n) return { kind: "skip" };
|
|
6347
|
-
let r =
|
|
6347
|
+
let r = ys();
|
|
6348
6348
|
if (!r) return { kind: "skip" };
|
|
6349
|
-
let i =
|
|
6349
|
+
let i = bs(n, r);
|
|
6350
6350
|
return i ? {
|
|
6351
6351
|
kind: "matched",
|
|
6352
6352
|
subject: i.subject
|
|
@@ -6425,7 +6425,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6425
6425
|
for (let i of r) {
|
|
6426
6426
|
if (Ph.has(i.name)) continue;
|
|
6427
6427
|
let r = N(e, i.name);
|
|
6428
|
-
i.isDirectory() ? await n(r) : i.isFile() && (
|
|
6428
|
+
i.isDirectory() ? await n(r) : i.isFile() && (D.test(i.name) && !Fe.test(i.name) || Fe.test(i.name) || Ae.test(i.name) || Me.test(i.name) || je.test(i.name) || E.test(i.name) || Ke.test(i.name) || Ge.test(i.name) || Pe.test(i.name) || T.test(i.name) || Le.test(i.name) || $d.test(i.name) || Ce.test(i.name) || Se.test(i.name) || We.test(i.name) || Be.test(i.name) || Ue.test(i.name) || He.test(i.name) || Ve.test(i.name) || Re.test(i.name) || Ie.test(i.name) || ze.test(i.name)) && t.push(r);
|
|
6429
6429
|
}
|
|
6430
6430
|
};
|
|
6431
6431
|
return await n(e), t;
|
|
@@ -6494,13 +6494,13 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6494
6494
|
let r = [], i = [], a = [], o = [], s = [], c = [], l = [], u = [], d = [], f = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Map(), h = [], g = [], _ = /* @__PURE__ */ new Map();
|
|
6495
6495
|
for (let t of e) {
|
|
6496
6496
|
let e = M(t);
|
|
6497
|
-
if (
|
|
6497
|
+
if (E.test(e)) {
|
|
6498
6498
|
let e = new Set(oi().map((e) => e.tableName)), r = await n(t), i = [...Object.values(r).filter((e) => Hh(e)), ...oi().filter((t) => !e.has(t.tableName))];
|
|
6499
6499
|
for (let e of i) m.set(e.tableName, e), Gh(e) && f.add(e.tableName), qh(e) && p.add(e.tableName);
|
|
6500
6500
|
Oi(r);
|
|
6501
6501
|
continue;
|
|
6502
6502
|
}
|
|
6503
|
-
if (
|
|
6503
|
+
if (Ke.test(e)) {
|
|
6504
6504
|
let e = await n(t);
|
|
6505
6505
|
if (Oi(e) === 0) {
|
|
6506
6506
|
let n = Object.entries(e).filter(([, e]) => vi(e)).map(([e]) => e);
|
|
@@ -6511,14 +6511,14 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6511
6511
|
}
|
|
6512
6512
|
continue;
|
|
6513
6513
|
}
|
|
6514
|
-
if (
|
|
6514
|
+
if (Ne(e)) {
|
|
6515
6515
|
Z.warn("skipping workflow — a workflow module must be `.workflow.tsx` (JSX steps); rename it", {
|
|
6516
6516
|
file: t,
|
|
6517
6517
|
expected: e.replace(/\.workflow\.ts$/, ".workflow.tsx")
|
|
6518
6518
|
});
|
|
6519
6519
|
continue;
|
|
6520
6520
|
}
|
|
6521
|
-
if (
|
|
6521
|
+
if (Ae.test(e)) {
|
|
6522
6522
|
let e = await n(t), r = Object.values(e).find(Vh);
|
|
6523
6523
|
if (!r) {
|
|
6524
6524
|
Z.warn("skipping workflow — no workflow(...) export", { file: t });
|
|
@@ -6547,9 +6547,9 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6547
6547
|
for (let t of [...Object.values(e), ...Object.values(a)]) Nr(t) && l.push(t);
|
|
6548
6548
|
continue;
|
|
6549
6549
|
}
|
|
6550
|
-
if (
|
|
6551
|
-
let r = await n(t), i = r.default ?? Object.values(r).find(
|
|
6552
|
-
if (!
|
|
6550
|
+
if (je.test(e)) {
|
|
6551
|
+
let r = await n(t), i = r.default ?? Object.values(r).find(Ga);
|
|
6552
|
+
if (!Ga(i)) {
|
|
6553
6553
|
Z.warn("skipping trigger — default export is not triggerWorkflow(...)", { file: t });
|
|
6554
6554
|
continue;
|
|
6555
6555
|
}
|
|
@@ -6564,9 +6564,9 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6564
6564
|
});
|
|
6565
6565
|
continue;
|
|
6566
6566
|
}
|
|
6567
|
-
if (
|
|
6567
|
+
if (T.test(e)) {
|
|
6568
6568
|
let e = (await n(t)).default;
|
|
6569
|
-
if (!
|
|
6569
|
+
if (!Wa(e)) {
|
|
6570
6570
|
Z.warn("skipping cron — default export is not defineSchedule(...)", { file: t });
|
|
6571
6571
|
continue;
|
|
6572
6572
|
}
|
|
@@ -6580,16 +6580,16 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6580
6580
|
d.push(e);
|
|
6581
6581
|
continue;
|
|
6582
6582
|
}
|
|
6583
|
-
if (
|
|
6583
|
+
if (Fe.test(e)) {
|
|
6584
6584
|
let n = t.slice(0, -e.length), r = e.replace(/\.server\.ts$/, ".ts");
|
|
6585
6585
|
_.set(n + r, t);
|
|
6586
6586
|
continue;
|
|
6587
6587
|
}
|
|
6588
|
-
if (
|
|
6588
|
+
if (D.test(e)) {
|
|
6589
6589
|
h.push(t);
|
|
6590
6590
|
continue;
|
|
6591
6591
|
}
|
|
6592
|
-
if (
|
|
6592
|
+
if (ze.test(e)) {
|
|
6593
6593
|
g.push(t);
|
|
6594
6594
|
continue;
|
|
6595
6595
|
}
|
|
@@ -6644,7 +6644,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6644
6644
|
let n = ji(t);
|
|
6645
6645
|
n.length > 0 && v.set(e, n);
|
|
6646
6646
|
}
|
|
6647
|
-
let ee = v.size === 0 ? [] : r.flatMap((e) =>
|
|
6647
|
+
let ee = v.size === 0 ? [] : r.flatMap((e) => Qo({
|
|
6648
6648
|
name: e.descriptor.name,
|
|
6649
6649
|
output: e.descriptor.output,
|
|
6650
6650
|
source: e.descriptor.source
|
|
@@ -6655,17 +6655,17 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6655
6655
|
...e.descriptor.cache === void 0 ? {} : { cache: e.descriptor.cache }
|
|
6656
6656
|
}, f));
|
|
6657
6657
|
m.has("actors") || m.set("actors", ai);
|
|
6658
|
-
let
|
|
6659
|
-
(
|
|
6660
|
-
...
|
|
6661
|
-
...
|
|
6658
|
+
let ne = m.get("actors"), y = m.get("tenants");
|
|
6659
|
+
(ne !== void 0 || y !== void 0) && Di({
|
|
6660
|
+
...ne === void 0 ? {} : { actors: () => ne },
|
|
6661
|
+
...y === void 0 ? {} : { tenants: () => y }
|
|
6662
6662
|
});
|
|
6663
|
-
let
|
|
6663
|
+
let b = e.filter((e) => be.test(M(e))), x = b.length > 0 ? await w(b, Z.child("connections")) : [], S = {
|
|
6664
6664
|
workflows: c.length > 0 || u.length > 0,
|
|
6665
|
-
schedules: d.length > 0 || e.some((e) =>
|
|
6666
|
-
webhooks: e.some((e) =>
|
|
6667
|
-
agents: e.some((e) =>
|
|
6668
|
-
connections:
|
|
6665
|
+
schedules: d.length > 0 || e.some((e) => we(M(e))),
|
|
6666
|
+
webhooks: e.some((e) => Le.test(M(e))),
|
|
6667
|
+
agents: e.some((e) => Ce.test(M(e))),
|
|
6668
|
+
connections: b.length > 0
|
|
6669
6669
|
};
|
|
6670
6670
|
return Pi(), {
|
|
6671
6671
|
queries: r,
|
|
@@ -6677,9 +6677,9 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6677
6677
|
workflowWorkers: l,
|
|
6678
6678
|
eventTriggers: u,
|
|
6679
6679
|
schedules: d,
|
|
6680
|
-
connections:
|
|
6680
|
+
connections: x,
|
|
6681
6681
|
tables: [...m.values()],
|
|
6682
|
-
featureMix:
|
|
6682
|
+
featureMix: S,
|
|
6683
6683
|
tenantScopedTables: f,
|
|
6684
6684
|
softDeleteScopedTables: p,
|
|
6685
6685
|
serverOnlyLeaks: ee,
|
|
@@ -6703,8 +6703,8 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6703
6703
|
...r ? { error: e } : {}
|
|
6704
6704
|
};
|
|
6705
6705
|
}
|
|
6706
|
-
}, Qh = async (e) => (await Zh(e)).config, Q = () =>
|
|
6707
|
-
let t =
|
|
6706
|
+
}, Qh = async (e) => (await Zh(e)).config, Q = () => S("runtime"), $h = (e) => {
|
|
6707
|
+
let t = ae();
|
|
6708
6708
|
if ("url" in e && e.url) try {
|
|
6709
6709
|
let n = new URL(e.url), r = n.username ? `${n.username}@` : "", i = n.port ? `:${n.port}` : "";
|
|
6710
6710
|
return {
|
|
@@ -6729,29 +6729,30 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6729
6729
|
let t = 2166136261;
|
|
6730
6730
|
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
6731
6731
|
return 1e3 + (t >>> 0) % 2147482647;
|
|
6732
|
-
}, $ = (e) => (process.env.DB_DIALECT ?? e?.store ?? "memory").toLowerCase(), ng = async (e, n, r) => {
|
|
6733
|
-
let
|
|
6734
|
-
if (
|
|
6735
|
-
let
|
|
6736
|
-
Z.info(`sql dialect resolved: ${
|
|
6737
|
-
let
|
|
6738
|
-
Z.info(`db connection: ${
|
|
6739
|
-
let
|
|
6740
|
-
if (
|
|
6741
|
-
let { connectionFromConfig: e } = await
|
|
6742
|
-
|
|
6732
|
+
}, $ = (e) => (process.env.DB_DIALECT ?? e?.store ?? "memory").toLowerCase(), ng = async (e, n, r, i) => {
|
|
6733
|
+
let a = $(e);
|
|
6734
|
+
if (a === "memory") return Z.info("sql dialect resolved: memory — in-process store, no persistence"), new Yi({});
|
|
6735
|
+
let o = (process.env.CDC ?? "1") !== "0", s = await x(a), c = s.id === "postgres" ? "LISTEN/NOTIFY" : Si(s.id) ? "in-process bus" : s.id === "mariadb" ? "binlog CDC (ROW)" : s.id === "mssql" ? "Change Tracking (polled)" : s.id === "mysql" ? "binlog CDC (ROW)" : "inline only", l = s.id === "postgres" ? "native" : s.id === "mysql" ? "INSERT/UPDATE/DELETE then SELECT (no RETURNING)" : s.id === "mariadb" ? "native (INSERT/DELETE); UPDATE then SELECT" : s.id === "mssql" ? "OUTPUT INSERTED/DELETED" : Si(s.id) ? "native" : "unknown";
|
|
6736
|
+
Z.info(`sql dialect resolved: ${s.id} — CDC: ${o ? c : "inline emit (CDC=0)"}, RETURNING: ${l}`);
|
|
6737
|
+
let u = r ?? Q(), { summary: d, fromEnv: f } = $h(u);
|
|
6738
|
+
Z.info(`db connection: ${d}${f ? "" : " (DEFAULT FALLBACK — no DB_URL / PG_HOST set)"}`), f || Z.warn("db connection: falling back to localhost:5432/app — no DB_URL or PG_HOST env var set.\n If this app should run against its OWN postgres (e.g. its docker-compose), set DB_URL.\n Copy `.env.example` to `.env` in the app dir, or set DB_URL in the shell.\n Otherwise this app is silently using whatever DB is at localhost:5432/app — which is\n voltro-starter's docker default + may carry foreign tables that confuse the planner.");
|
|
6739
|
+
let p;
|
|
6740
|
+
if (o && (s.id === "mysql" || s.id === "mariadb")) {
|
|
6741
|
+
let { connectionFromConfig: e } = await b("@voltro/sql-mysql"), t = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, n = oi().filter((e) => e.isReactive !== !1).map((e) => e.tableName).filter((e) => !e.startsWith("_voltro_"));
|
|
6742
|
+
p = {
|
|
6743
6743
|
serverId: tg(t),
|
|
6744
6744
|
replicaId: t,
|
|
6745
|
-
connection: e(
|
|
6746
|
-
includeTables: n
|
|
6747
|
-
|
|
6745
|
+
connection: e(u),
|
|
6746
|
+
includeTables: n,
|
|
6747
|
+
...i?.schemaWorkFollows === !0 ? { exclusionRefreshFollows: !0 } : {}
|
|
6748
|
+
}, n.length === 0 ? (o = !1, p = void 0, Z.info(`${s.id} binlog CDC skipped — every app table is .nonReactive()`)) : Z.info(`${s.id} binlog CDC enabled`, {
|
|
6748
6749
|
replicaId: t,
|
|
6749
|
-
serverId:
|
|
6750
|
+
serverId: p.serverId,
|
|
6750
6751
|
tables: n.length
|
|
6751
6752
|
});
|
|
6752
|
-
} else if (
|
|
6753
|
-
let { connectionFromConfig: e } = await
|
|
6754
|
-
|
|
6753
|
+
} else if (o && s.id === "mssql") {
|
|
6754
|
+
let { connectionFromConfig: e } = await b("@voltro/sql-mssql"), t = e(u), n = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, r = oi().filter((e) => e.isReactive !== !1).map((e) => e.tableName).filter((e) => !e.startsWith("_voltro_"));
|
|
6755
|
+
p = {
|
|
6755
6756
|
serverId: 0,
|
|
6756
6757
|
replicaId: n,
|
|
6757
6758
|
connection: {
|
|
@@ -6762,91 +6763,91 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6762
6763
|
database: t.database ?? "master"
|
|
6763
6764
|
},
|
|
6764
6765
|
includeTables: r
|
|
6765
|
-
}, r.length === 0 ? (
|
|
6766
|
+
}, r.length === 0 ? (o = !1, p = void 0, Z.info("mssql Change Tracking CDC skipped — every app table is .nonReactive()")) : Z.info("mssql Change Tracking CDC enabled", {
|
|
6766
6767
|
replicaId: n,
|
|
6767
6768
|
tables: r.length
|
|
6768
6769
|
});
|
|
6769
6770
|
}
|
|
6770
|
-
let
|
|
6771
|
-
sqlLayer:
|
|
6771
|
+
let m = await s.makeStore({
|
|
6772
|
+
sqlLayer: s.makeSqlLayer(u),
|
|
6772
6773
|
...n ? { tracerLayer: n } : {},
|
|
6773
|
-
changeStrategy:
|
|
6774
|
-
...
|
|
6775
|
-
}),
|
|
6776
|
-
if (
|
|
6774
|
+
changeStrategy: o ? "cdc" : "inline",
|
|
6775
|
+
...p ? { cdcConfig: p } : {}
|
|
6776
|
+
}), h = eg();
|
|
6777
|
+
if (h.length === 0) return Z.info("read replicas: none configured (DB_REPLICA_URLS unset) — all queries → primary"), t.recordReplication({
|
|
6777
6778
|
replicaCount: 0,
|
|
6778
6779
|
rywPolicy: "off",
|
|
6779
6780
|
rywStore: "memory",
|
|
6780
6781
|
region: null,
|
|
6781
6782
|
localityEnabled: !1
|
|
6782
|
-
}),
|
|
6783
|
-
if (Si(
|
|
6783
|
+
}), m;
|
|
6784
|
+
if (Si(s.id)) return Z.warn(`read replicas: not applicable (${s.id} is single-process); ignoring DB_REPLICA_URLS`), t.recordReplication({
|
|
6784
6785
|
replicaCount: 0,
|
|
6785
6786
|
rywPolicy: "off",
|
|
6786
6787
|
rywStore: "memory",
|
|
6787
6788
|
region: null,
|
|
6788
6789
|
localityEnabled: !1
|
|
6789
|
-
}),
|
|
6790
|
-
let
|
|
6791
|
-
if (
|
|
6790
|
+
}), m;
|
|
6791
|
+
let g = await sg(s.id);
|
|
6792
|
+
if (g === null) return Z.warn(`read replicas: no replication adapter for dialect ${s.id}; falling back to primary-only routing`), t.recordReplication({
|
|
6792
6793
|
replicaCount: 0,
|
|
6793
6794
|
rywPolicy: "off",
|
|
6794
6795
|
rywStore: "memory",
|
|
6795
6796
|
region: null,
|
|
6796
6797
|
localityEnabled: !1
|
|
6797
|
-
}),
|
|
6798
|
-
let
|
|
6799
|
-
for (let e of
|
|
6800
|
-
let t = await
|
|
6801
|
-
sqlLayer:
|
|
6798
|
+
}), m;
|
|
6799
|
+
let _ = [];
|
|
6800
|
+
for (let e of h) {
|
|
6801
|
+
let t = await s.makeStore({
|
|
6802
|
+
sqlLayer: s.makeSqlLayer(re(u, e)),
|
|
6802
6803
|
...n ? { tracerLayer: n } : {},
|
|
6803
6804
|
changeStrategy: "inline"
|
|
6804
6805
|
});
|
|
6805
|
-
|
|
6806
|
+
_.push(t);
|
|
6806
6807
|
}
|
|
6807
|
-
let
|
|
6808
|
-
if (
|
|
6808
|
+
let v = process.env.RYW_POLICY ?? "fallback", ee = (process.env.RYW_STORE ?? "memory").toLowerCase(), te, ne = "memory";
|
|
6809
|
+
if (ee === "redis") {
|
|
6809
6810
|
let e = process.env.REDIS_URL;
|
|
6810
6811
|
if (!e) Z.warn("RYW_STORE=redis set but REDIS_URL is empty — falling back to memory store");
|
|
6811
6812
|
else try {
|
|
6812
6813
|
let { default: t } = await import("ioredis"), n = new t(e), r = n.duplicate();
|
|
6813
|
-
|
|
6814
|
+
te = Uo({
|
|
6814
6815
|
client: n,
|
|
6815
6816
|
subscriber: r
|
|
6816
|
-
}),
|
|
6817
|
+
}), ne = "redis", Z.info(`read replicas: ryw store = redis @ ${ig(e)}`);
|
|
6817
6818
|
} catch (e) {
|
|
6818
6819
|
Z.warn("RYW_STORE=redis but ioredis import / connect failed — falling back to memory store", { err: e });
|
|
6819
6820
|
}
|
|
6820
6821
|
}
|
|
6821
|
-
|
|
6822
|
-
let y = ag(
|
|
6823
|
-
currentRegion:
|
|
6824
|
-
replicaRegions: og(
|
|
6825
|
-
inner:
|
|
6826
|
-
}) :
|
|
6827
|
-
return Z.info(`read replicas: ${
|
|
6828
|
-
replicaCount:
|
|
6829
|
-
rywPolicy:
|
|
6830
|
-
rywStore:
|
|
6831
|
-
region:
|
|
6832
|
-
localityEnabled: y.length > 0 &&
|
|
6822
|
+
te ||= No();
|
|
6823
|
+
let y = ag(h.length), S = qo(), ie = S && y.length > 0 ? Ja({
|
|
6824
|
+
currentRegion: S,
|
|
6825
|
+
replicaRegions: og(_, y),
|
|
6826
|
+
inner: zo()
|
|
6827
|
+
}) : zo();
|
|
6828
|
+
return Z.info(`read replicas: ${_.length} configured, ryw policy '${v}', dialect=${s.id}, region=${S ?? "unknown"}` + (y.length > 0 ? ", replica-locality=on" : "")), t.recordReplication({
|
|
6829
|
+
replicaCount: _.length,
|
|
6830
|
+
rywPolicy: v,
|
|
6831
|
+
rywStore: ne,
|
|
6832
|
+
region: S ?? null,
|
|
6833
|
+
localityEnabled: y.length > 0 && S !== void 0
|
|
6833
6834
|
}), new ea({
|
|
6834
|
-
primary:
|
|
6835
|
-
replicas:
|
|
6836
|
-
replicationAdapter:
|
|
6837
|
-
rywPolicy:
|
|
6838
|
-
rywStore:
|
|
6839
|
-
replicaSelector:
|
|
6835
|
+
primary: m,
|
|
6836
|
+
replicas: _,
|
|
6837
|
+
replicationAdapter: g,
|
|
6838
|
+
rywPolicy: v,
|
|
6839
|
+
rywStore: te,
|
|
6840
|
+
replicaSelector: ie
|
|
6840
6841
|
});
|
|
6841
6842
|
}, rg = async (e, t, n, r, i, a) => {
|
|
6842
|
-
let o =
|
|
6843
|
+
let o = Ys(t?.plugins ?? []), s = n === "postgres" || n === "mysql" || n === "mariadb", c = n === "postgres" ? "LISTEN/NOTIFY" : "binlog CDC";
|
|
6843
6844
|
if (!o) return n === "memory" || n === "sqlite" || n === "turso" ? i.info(`reactivity: single-instance (${n}) — no cross-replica fan-out needed`) : s ? i.info(`reactivity: cross-instance via native ${c} (${n})`) : i.warn(`reactivity: cross-instance fan-out is OFF for dialect '${n}'. A write on one replica will NOT reach clients on other replicas. Add @voltro/plugin-broadcast (Redis / NATS) to close the gap, or use postgres (LISTEN/NOTIFY) / mariadb (binlog CDC).`), null;
|
|
6844
6845
|
let l = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`;
|
|
6845
|
-
return o.broadcast.crossReplica ? s ? i.info(`reactivity: native ${c} (${n}) + @voltro/plugin-broadcast (${o.broadcast.provider.name}) — both paths active (own-origin skip dedups)`) : i.info(`reactivity: cross-instance via @voltro/plugin-broadcast (${o.broadcast.provider.name}) for dialect '${n}'`) : i.warn("reactivity: @voltro/plugin-broadcast resolved to the in-process memory provider — NO real cross-replica fan-out. Set BROADCAST_URL (redis:// or nats://) for a real bus."), await
|
|
6846
|
+
return o.broadcast.crossReplica ? s ? i.info(`reactivity: native ${c} (${n}) + @voltro/plugin-broadcast (${o.broadcast.provider.name}) — both paths active (own-origin skip dedups)`) : i.info(`reactivity: cross-instance via @voltro/plugin-broadcast (${o.broadcast.provider.name}) for dialect '${n}'`) : i.warn("reactivity: @voltro/plugin-broadcast resolved to the in-process memory provider — NO real cross-replica fan-out. Set BROADCAST_URL (redis:// or nats://) for a real bus."), await Gs({
|
|
6846
6847
|
store: e,
|
|
6847
6848
|
provider: o.broadcast.provider,
|
|
6848
6849
|
replicaId: l,
|
|
6849
|
-
channel:
|
|
6850
|
+
channel: Ks(r, "changes"),
|
|
6850
6851
|
logger: i,
|
|
6851
6852
|
...a === void 0 ? {} : { onGap: a }
|
|
6852
6853
|
});
|
|
@@ -6868,48 +6869,48 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6868
6869
|
return n;
|
|
6869
6870
|
}, sg = async (e) => {
|
|
6870
6871
|
switch (e) {
|
|
6871
|
-
case "postgres": return (await
|
|
6872
|
+
case "postgres": return (await b("@voltro/sql-postgres")).postgresReplicationAdapter();
|
|
6872
6873
|
case "mysql":
|
|
6873
|
-
case "mariadb": return (await
|
|
6874
|
-
case "mssql": return (await
|
|
6874
|
+
case "mariadb": return (await b("@voltro/sql-mysql")).mysqlReplicationAdapter();
|
|
6875
|
+
case "mssql": return (await b("@voltro/sql-mssql")).mssqlReplicationAdapter();
|
|
6875
6876
|
default: return null;
|
|
6876
6877
|
}
|
|
6877
6878
|
}, cg = async (e) => {
|
|
6878
6879
|
let t = e.find((e) => !e.startsWith("-")) ?? process.cwd(), n = Bt(t), r = await _(n);
|
|
6879
6880
|
return r.ran ? r.exitCode : process.env.FRAMEWORK_DEV_INNER !== "1" && process.env.WATCH !== "0" ? (yt(fl({ root: n }), { scope: "voltro:dev" }), new Promise(() => {})) : lg(n);
|
|
6880
6881
|
}, lg = async (n) => {
|
|
6881
|
-
let g = Date.now(), _ = await Qh(n),
|
|
6882
|
+
let g = Date.now(), _ = await Qh(n), b = o({
|
|
6882
6883
|
kind: "api",
|
|
6883
6884
|
configPort: _?.port,
|
|
6884
6885
|
env: process.env
|
|
6885
6886
|
});
|
|
6886
|
-
for (let e of
|
|
6887
|
-
let
|
|
6887
|
+
for (let e of b.warnings) Z.warn(e);
|
|
6888
|
+
let S = b.port, ae = _?.name ?? M(n), oe = Ft("api", ae, S), fe = It(ae);
|
|
6888
6889
|
await Nt({
|
|
6889
|
-
id:
|
|
6890
|
-
name:
|
|
6890
|
+
id: oe,
|
|
6891
|
+
name: ae,
|
|
6891
6892
|
kind: "api",
|
|
6892
|
-
url: `http://localhost:${
|
|
6893
|
+
url: `http://localhost:${S}`,
|
|
6893
6894
|
pid: process.pid,
|
|
6894
6895
|
status: "booting",
|
|
6895
|
-
logFile:
|
|
6896
|
+
logFile: fe.path
|
|
6896
6897
|
}).catch(() => {});
|
|
6897
|
-
let
|
|
6898
|
-
|
|
6898
|
+
let C = f();
|
|
6899
|
+
ne(C), Z.info("booting voltro dev", {
|
|
6899
6900
|
root: n,
|
|
6900
6901
|
version: Eh,
|
|
6901
|
-
logFile:
|
|
6902
|
+
logFile: fe.path
|
|
6902
6903
|
}), h(n, Z);
|
|
6903
|
-
let
|
|
6904
|
+
let ge = await pe({
|
|
6904
6905
|
project: M(n),
|
|
6905
6906
|
cliVersion: Eh
|
|
6906
6907
|
});
|
|
6907
|
-
if (
|
|
6908
|
-
${
|
|
6909
|
-
|
|
6910
|
-
let
|
|
6911
|
-
|
|
6912
|
-
port:
|
|
6908
|
+
if (ge.kind === "not-personal") return Z.error(`voltro dev needs a personal login — the stored credential belongs to no user.
|
|
6909
|
+
${ge.message}`), 1;
|
|
6910
|
+
ge.kind === "reported" && ge.seat === "claimed" && Z.info("cloud: this machine now counts toward your organisation's seats (voltro cloud whoami)");
|
|
6911
|
+
let be = process.env.VOLTRO_DEV_HEALTH_PORT, Se = be === void 0 ? S + 1 : Number(be), we;
|
|
6912
|
+
Se > 0 && Number.isFinite(Se) && (we = await um({
|
|
6913
|
+
port: Se,
|
|
6913
6914
|
log: {
|
|
6914
6915
|
info: (e, t) => Z.debug(e, t),
|
|
6915
6916
|
warn: (e, t) => Z.warn(e, t)
|
|
@@ -6922,81 +6923,81 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
6922
6923
|
}).catch((e) => {
|
|
6923
6924
|
Z.warn("agent-instructions seed failed (non-fatal)", {}, e);
|
|
6924
6925
|
});
|
|
6925
|
-
let
|
|
6926
|
-
Z.info(`discovered ${
|
|
6927
|
-
let { pluginContributions:
|
|
6926
|
+
let w = await Fh(n);
|
|
6927
|
+
Z.info(`discovered ${w.length} files`, { count: w.length });
|
|
6928
|
+
let { pluginContributions: Oe, pluginErrorImports: Ae, pluginRpcImports: je } = await up(_?.plugins ?? [], _?.name ?? M(n), n), Me = await Et({
|
|
6928
6929
|
root: n,
|
|
6929
|
-
...
|
|
6930
|
-
...
|
|
6931
|
-
...
|
|
6930
|
+
...Oe.length > 0 ? { pluginContributions: Oe } : {},
|
|
6931
|
+
...Ae.length > 0 ? { pluginErrorImports: Ae } : {},
|
|
6932
|
+
...je.length > 0 ? { pluginRpcImports: je } : {},
|
|
6932
6933
|
..._?.name === void 0 ? {} : { apiName: _.name }
|
|
6933
6934
|
});
|
|
6934
|
-
if (
|
|
6935
|
-
let e = await wt(n,
|
|
6935
|
+
if (Me ? (Z.info("codegen wrote rpcGroup", { path: zt(n, Me) }), await Ct(Me)) : Z.debug("codegen skipped — no descriptors discovered"), process.env.VOLTRO_BROWSER_SAFETY !== "off") {
|
|
6936
|
+
let e = await wt(n, w);
|
|
6936
6937
|
if (e.length > 0) throw Error(e.map(Tt).join("\n\n"));
|
|
6937
6938
|
}
|
|
6938
|
-
let
|
|
6939
|
-
queries:
|
|
6940
|
-
mutations:
|
|
6941
|
-
actions:
|
|
6942
|
-
streams:
|
|
6943
|
-
events:
|
|
6939
|
+
let Ne = $(_ ?? null), Fe = Ne === "mariadb" ? "mariadb" : Ne === "mssql" ? "mssql" : void 0, { queries: T, mutations: E, actions: D, streams: Ke, events: Je, workflows: k, workflowWorkers: Ze, eventTriggers: Qe, schedules: $e, connections: tt, tables: rt, featureMix: at, tenantScopedTables: st, softDeleteScopedTables: ct, serverOnlyLeaks: lt, cacheScopeLeaks: pt } = await Xh(w, { cdc: Fe !== void 0 && (process.env.CDC ?? "1") !== "0" }), mt = Hl({
|
|
6940
|
+
queries: T,
|
|
6941
|
+
mutations: E,
|
|
6942
|
+
actions: D,
|
|
6943
|
+
streams: Ke,
|
|
6944
|
+
events: Je
|
|
6944
6945
|
});
|
|
6945
6946
|
{
|
|
6946
|
-
let e = Il(
|
|
6947
|
+
let e = Il(lt, Fl(process.env, "warn"), ja, "`voltro dev`");
|
|
6947
6948
|
if (e.action === "fail") throw Error(e.message);
|
|
6948
6949
|
e.action === "warn" && Z.warn(e.message ?? "");
|
|
6949
6950
|
}
|
|
6950
6951
|
{
|
|
6951
|
-
let e = Il(
|
|
6952
|
+
let e = Il(pt, Fl(process.env, "warn"), Aa, "`voltro dev`");
|
|
6952
6953
|
if (e.action === "fail") throw Error(e.message);
|
|
6953
6954
|
e.action === "warn" && Z.warn(e.message ?? "");
|
|
6954
6955
|
}
|
|
6955
|
-
Wl(
|
|
6956
|
+
Wl(mt, {
|
|
6956
6957
|
defaultDeny: Bl(_),
|
|
6957
6958
|
commandHint: "`voltro dev`"
|
|
6958
6959
|
});
|
|
6959
|
-
let
|
|
6960
|
-
|
|
6961
|
-
let
|
|
6962
|
-
|
|
6963
|
-
keys:
|
|
6964
|
-
file: zt(n,
|
|
6965
|
-
}), e.includes(
|
|
6966
|
-
rawEnv:
|
|
6960
|
+
let gt = k.length > 0 || Qe.length > 0, A = await Qh(n), _t = Kc(A?.http ?? {});
|
|
6961
|
+
$o(Jo(A?.secrets));
|
|
6962
|
+
let j = gc(gs(A?.env) ? A.env : void 0, n);
|
|
6963
|
+
j.minted.length > 0 && j.file !== void 0 && (Z.warn(`minted ${j.minted.length} project secret(s) into ${zt(n, j.file)} — unique to this project, gitignored. Your DEPLOYMENT needs its own values (\`voltro secret generate\`).`, {
|
|
6964
|
+
keys: j.minted,
|
|
6965
|
+
file: zt(n, j.file)
|
|
6966
|
+
}), e.includes(j.file) || e.unshift(j.file)), j.ownershipWarning !== void 0 && Z.warn(j.ownershipWarning), await v({
|
|
6967
|
+
rawEnv: A?.env,
|
|
6967
6968
|
appType: "api",
|
|
6968
6969
|
root: n,
|
|
6969
6970
|
log: Z,
|
|
6970
6971
|
generateTypes: !0
|
|
6971
6972
|
});
|
|
6972
|
-
let vt = { current: void 0 }, yt =
|
|
6973
|
+
let vt = { current: void 0 }, yt = A?.apiKeys;
|
|
6973
6974
|
if (yt) {
|
|
6974
|
-
let e = new Set((
|
|
6975
|
+
let e = new Set((A?.plugins ?? []).flatMap((e) => e.declaredScopes ?? []));
|
|
6975
6976
|
e.size > 0 && ![
|
|
6976
6977
|
"apikeys:issue:self",
|
|
6977
6978
|
"apikeys:issue:org",
|
|
6978
6979
|
"apikeys:issue:other"
|
|
6979
6980
|
].some((t) => e.has(t)) && !e.has("admin:full") && Z.warn("apiKeys is enabled but no role declares any of apikeys:issue:self / :org / :other. The management routes are mounted and every issue request will fail its guard — the capability is on and reachable by nobody. Grant the right one in your role map (`:self` lets a user mint their own key, `:org` a shared one, `:other` on behalf of a colleague).");
|
|
6980
6981
|
}
|
|
6981
|
-
let bt = (typeof yt == "object" ? yt.prefix : void 0) ?? "voltro_", xt, Dt = yt ? [Na({ resolveByHash: (e, t) => xt ? xt.resolveByHash(e, t) : Promise.resolve(null) }, { prefix: bt })] : [], Rt = kh([...
|
|
6982
|
+
let bt = (typeof yt == "object" ? yt.prefix : void 0) ?? "voltro_", xt, Dt = yt ? [Na({ resolveByHash: (e, t) => xt ? xt.resolveByHash(e, t) : Promise.resolve(null) }, { prefix: bt })] : [], Rt = kh([...A?.auth?.strategies ?? [], ...Dt], Is(A?.plugins ?? []), A?.auth?.anonymousTenantRequired ?? !1, A?.auth, () => vt.current), Bt = ro({ resolveSubject: Rt }), Vt = Ee({
|
|
6982
6983
|
nodeEnv: process.env.NODE_ENV,
|
|
6983
|
-
cdcDialect:
|
|
6984
|
-
declared:
|
|
6985
|
-
}), Ht =
|
|
6984
|
+
cdcDialect: Fe,
|
|
6985
|
+
declared: A?.schema
|
|
6986
|
+
}), Ht = ye({
|
|
6986
6987
|
gates: Vt,
|
|
6987
6988
|
runtime: {
|
|
6988
6989
|
traces: im(),
|
|
6989
|
-
undo:
|
|
6990
|
+
undo: ls()
|
|
6990
6991
|
}
|
|
6991
6992
|
});
|
|
6992
6993
|
if (Ht !== void 0) throw r(`dev: ${Ht}`);
|
|
6993
|
-
let Ut =
|
|
6994
|
-
mix:
|
|
6995
|
-
plugins:
|
|
6994
|
+
let Ut = Te({
|
|
6995
|
+
mix: at,
|
|
6996
|
+
plugins: A?.plugins ?? [],
|
|
6996
6997
|
gates: Vt,
|
|
6997
|
-
...
|
|
6998
|
-
}), Gt =
|
|
6999
|
-
let e = new Set(
|
|
6998
|
+
...Fe ? { cdcDialect: Fe } : {}
|
|
6999
|
+
}), Gt = A?.analytics?.tables ?? [], P = (() => {
|
|
7000
|
+
let e = new Set(rt.map((e) => e.tableName)), t = [...rt];
|
|
7000
7001
|
for (let n of [...Ut, ...Gt]) {
|
|
7001
7002
|
let r = n.tableName;
|
|
7002
7003
|
r === void 0 || e.has(r) || (e.add(r), t.push(n));
|
|
@@ -7005,7 +7006,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7005
7006
|
})();
|
|
7006
7007
|
for (let e of P) mi(e);
|
|
7007
7008
|
{
|
|
7008
|
-
let e = Ma(
|
|
7009
|
+
let e = Ma(fs(T.map((e) => ({
|
|
7009
7010
|
name: e.descriptor.name,
|
|
7010
7011
|
source: e.descriptor.source
|
|
7011
7012
|
})), new Set(P.flatMap((e) => {
|
|
@@ -7015,47 +7016,47 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7015
7016
|
e !== void 0 && Z.warn(e);
|
|
7016
7017
|
}
|
|
7017
7018
|
let Kt = Af({
|
|
7018
|
-
plugins:
|
|
7019
|
-
appName:
|
|
7019
|
+
plugins: A?.plugins ?? [],
|
|
7020
|
+
appName: A?.name ?? M(n),
|
|
7020
7021
|
appType: "api",
|
|
7021
7022
|
voltroVersion: process.env.npm_package_version ?? "0.0.0",
|
|
7022
7023
|
log: Z
|
|
7023
7024
|
});
|
|
7024
|
-
|
|
7025
|
-
let qt = await Kt.gatherObservability(), Jt = Bf(
|
|
7025
|
+
A?.plugins?.length && (Z.info("plugins loaded", { plugins: A.plugins.map((e) => e.name) }), await Kt.activate());
|
|
7026
|
+
let qt = await Kt.gatherObservability(), Jt = Bf(A?.plugins ?? []);
|
|
7026
7027
|
Jt.endpoints.length > 0 && Z.info("plugin inspect endpoints registered", {
|
|
7027
7028
|
count: Jt.endpoints.length,
|
|
7028
7029
|
endpoints: Jt.endpoints.map((e) => `${e.method} ${e.path}`)
|
|
7029
7030
|
});
|
|
7030
|
-
let Yt = rp(
|
|
7031
|
+
let Yt = rp(A?.plugins ?? []);
|
|
7031
7032
|
Yt.length > 0 && Z.info("plugin dashboard mounts registered", {
|
|
7032
7033
|
count: Yt.length,
|
|
7033
7034
|
mounts: Yt.map((e) => `${e.fullId} (${e.slot})`)
|
|
7034
7035
|
});
|
|
7035
|
-
let Xt =
|
|
7036
|
+
let Xt = ke(A?.plugins ?? []);
|
|
7036
7037
|
Xt.length > 0 && Z.info("plugin schema contributions", { plugins: Xt.map((e) => `${e.pluginName}: ${e.tables}t/${e.migrations}m`) });
|
|
7037
|
-
let tn =
|
|
7038
|
+
let tn = me(A?.plugins ?? []);
|
|
7038
7039
|
if (tn.length > 0) {
|
|
7039
7040
|
let e = [
|
|
7041
|
+
...T.map((e) => e.descriptor.name),
|
|
7040
7042
|
...E.map((e) => e.descriptor.name),
|
|
7041
7043
|
...D.map((e) => e.descriptor.name),
|
|
7042
|
-
...
|
|
7043
|
-
...Ge.map((e) => e.descriptor.name)
|
|
7044
|
+
...Ke.map((e) => e.descriptor.name)
|
|
7044
7045
|
], t = /* @__PURE__ */ new Set([
|
|
7046
|
+
...T.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name),
|
|
7045
7047
|
...E.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name),
|
|
7046
|
-
...D.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name)
|
|
7047
|
-
|
|
7048
|
-
]), n = me(tn, e, t);
|
|
7048
|
+
...D.filter((e) => e.descriptor.overridesPlugin === !0).map((e) => e.descriptor.name)
|
|
7049
|
+
]), n = he(tn, e, t);
|
|
7049
7050
|
tn.length - n.length > 0 && Z.info(`plugin routes overridden by app procedures: ${[...t].join(", ")}`);
|
|
7050
|
-
for (let e of n) e.kind === "query" ?
|
|
7051
|
+
for (let e of n) e.kind === "query" ? T.push({
|
|
7051
7052
|
file: e.file,
|
|
7052
7053
|
descriptor: e.descriptor,
|
|
7053
7054
|
executor: e.executor
|
|
7054
|
-
}) : e.kind === "mutation" ?
|
|
7055
|
+
}) : e.kind === "mutation" ? E.push({
|
|
7055
7056
|
file: e.file,
|
|
7056
7057
|
descriptor: e.descriptor,
|
|
7057
7058
|
executor: e.executor
|
|
7058
|
-
}) :
|
|
7059
|
+
}) : D.push({
|
|
7059
7060
|
file: e.file,
|
|
7060
7061
|
descriptor: e.descriptor,
|
|
7061
7062
|
executor: e.executor
|
|
@@ -7065,20 +7066,20 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7065
7066
|
routes: tn.map((e) => `${e.plugin.name}:${e.descriptor.name} (${e.kind})`)
|
|
7066
7067
|
});
|
|
7067
7068
|
}
|
|
7068
|
-
let nn = Z.child("agent"), on =
|
|
7069
|
+
let nn = Z.child("agent"), on = w.filter((e) => xe.test(M(e)));
|
|
7069
7070
|
if (on.length > 0) {
|
|
7070
|
-
let e = await
|
|
7071
|
+
let e = await De(on, nn);
|
|
7071
7072
|
e > 0 && nn.info("wired tool handlers", { tools: e });
|
|
7072
7073
|
}
|
|
7073
|
-
let cn =
|
|
7074
|
+
let cn = w.filter((e) => Ce.test(M(e))), ln = [];
|
|
7074
7075
|
if (cn.length > 0) {
|
|
7075
|
-
let e = await
|
|
7076
|
+
let e = await _e(cn, nn);
|
|
7076
7077
|
ln = e.agents.map((e) => e.descriptor.name);
|
|
7077
|
-
for (let t of e.agents) for (let e of uf(t)) e.kind === "action" ?
|
|
7078
|
+
for (let t of e.agents) for (let e of uf(t)) e.kind === "action" ? D.push({
|
|
7078
7079
|
file: e.file,
|
|
7079
7080
|
descriptor: e.descriptor,
|
|
7080
7081
|
executor: e.executor
|
|
7081
|
-
}) :
|
|
7082
|
+
}) : T.push({
|
|
7082
7083
|
file: e.file,
|
|
7083
7084
|
descriptor: e.descriptor,
|
|
7084
7085
|
executor: e.executor
|
|
@@ -7093,31 +7094,31 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7093
7094
|
let e = pf();
|
|
7094
7095
|
e !== void 0 && Z.info(e);
|
|
7095
7096
|
}
|
|
7096
|
-
(un.queries.length > 0 || un.mutations.length > 0) && (
|
|
7097
|
+
(un.queries.length > 0 || un.mutations.length > 0) && (T.push(...un.queries), E.push(...un.mutations), Z.info("undo built-ins registered", { routes: [
|
|
7097
7098
|
"__voltro.undo.log",
|
|
7098
7099
|
"__voltro.undo.apply",
|
|
7099
7100
|
"__voltro.undo.redo"
|
|
7100
7101
|
] }));
|
|
7101
|
-
let dn = Z.child("aggregate"), fn =
|
|
7102
|
+
let dn = Z.child("aggregate"), fn = w.filter((e) => He.test(e)), pn = fn.length > 0 ? await yu(fn, dn) : [], mn = pn.map((e) => e.definition.name), hn = Z.child("expectation"), gn = w.filter((e) => Ve.test(e)), _n = gn.length > 0 ? await zu(gn, hn) : [], vn = Z.child("finops"), yn = w.filter((e) => Re.test(e)), bn = yn.length > 0 ? await Bu(yn, vn) : [], xn = Z.child("experiment"), Sn = w.filter((e) => Ie.test(e)), Cn = Sn.length > 0 ? await Vu(Sn, xn) : [];
|
|
7102
7103
|
for (let e of fi()) Z.warn(`identifier length · ${e}`);
|
|
7103
|
-
let wn =
|
|
7104
|
-
|
|
7104
|
+
let wn = A?.restRoutes ?? [], Tn = w.filter((e) => We.test(e)).length, On = w.filter((e) => Pe.test(e)).length, An = w.filter((e) => /\.seed\.ts$/.test(e)).length, Mn = w.filter((e) => Le.test(e)).length, Nn = w.filter((e) => $d.test(e)).length;
|
|
7105
|
+
ec($s([
|
|
7106
|
+
T,
|
|
7105
7107
|
E,
|
|
7106
7108
|
D,
|
|
7107
|
-
|
|
7108
|
-
Ge
|
|
7109
|
+
Ke
|
|
7109
7110
|
]), (e) => {
|
|
7110
7111
|
Z.warn(e);
|
|
7111
7112
|
}), Z.info("app surface", {
|
|
7112
|
-
queryCount:
|
|
7113
|
-
mutationCount:
|
|
7114
|
-
actionCount:
|
|
7115
|
-
streamCount:
|
|
7113
|
+
queryCount: T.length,
|
|
7114
|
+
mutationCount: E.length,
|
|
7115
|
+
actionCount: D.length,
|
|
7116
|
+
streamCount: Ke.length,
|
|
7116
7117
|
restRouteCount: wn.length,
|
|
7117
|
-
workflowCount:
|
|
7118
|
-
workflowWorkerCount:
|
|
7119
|
-
triggerCount:
|
|
7120
|
-
scheduleCount:
|
|
7118
|
+
workflowCount: k.length,
|
|
7119
|
+
workflowWorkerCount: Ze.length,
|
|
7120
|
+
triggerCount: Qe.length,
|
|
7121
|
+
scheduleCount: $e.length,
|
|
7121
7122
|
agentCount: ln.length,
|
|
7122
7123
|
aggregateCount: mn.length,
|
|
7123
7124
|
expectationCount: _n.length,
|
|
@@ -7128,17 +7129,17 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7128
7129
|
seedCount: An,
|
|
7129
7130
|
webhookCount: Mn,
|
|
7130
7131
|
emailCount: Nn,
|
|
7131
|
-
tenantTables: [...
|
|
7132
|
+
tenantTables: [...st]
|
|
7132
7133
|
}), Zt({
|
|
7133
|
-
appName:
|
|
7134
|
-
queries:
|
|
7135
|
-
mutations:
|
|
7136
|
-
actions:
|
|
7137
|
-
streams:
|
|
7134
|
+
appName: A?.name ?? M(n),
|
|
7135
|
+
queries: T.map((e) => e.descriptor.name),
|
|
7136
|
+
mutations: E.map((e) => e.descriptor.name),
|
|
7137
|
+
actions: D.map((e) => e.descriptor.name),
|
|
7138
|
+
streams: Ke.map((e) => e.descriptor.name),
|
|
7138
7139
|
restRoutes: wn.map((e) => `${e.method} ${e.path}`),
|
|
7139
|
-
workflows:
|
|
7140
|
-
triggers:
|
|
7141
|
-
schedules:
|
|
7140
|
+
workflows: k.map((e) => e.definition.name),
|
|
7141
|
+
triggers: Qe.map((e) => `${e.event}→${e.workflow}`),
|
|
7142
|
+
schedules: $e.map((e) => e.name),
|
|
7142
7143
|
agents: ln,
|
|
7143
7144
|
aggregates: mn,
|
|
7144
7145
|
lifecycle: {
|
|
@@ -7148,16 +7149,16 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7148
7149
|
webhooks: Mn,
|
|
7149
7150
|
emails: Nn
|
|
7150
7151
|
},
|
|
7151
|
-
tenantTables: [...
|
|
7152
|
+
tenantTables: [...st]
|
|
7152
7153
|
});
|
|
7153
7154
|
let Pn = Qp(), Fn = (process.env.VOLTRO_TRACING_BUFFER ?? "").toLowerCase() === "off", In = (process.env.VOLTRO_TRACING_STREAM ?? "").toLowerCase() === "all", Yn = () => {}, Xn = (e) => {
|
|
7154
7155
|
if (!e.name.startsWith("http.server")) return !1;
|
|
7155
7156
|
let t = e.attributes, n = String(t["url.path"] ?? t["http.route"] ?? t["http.target"] ?? "");
|
|
7156
7157
|
return n.startsWith("/_voltro/") || n === "/ws" || n.startsWith("/ws/") || n.startsWith("/ws?");
|
|
7157
7158
|
}, Zn = (e) => {
|
|
7158
|
-
Xn(e) || Up(e) || e.name.startsWith("RpcServer.") || (Pn.append(e), (In || e.status === "error") &&
|
|
7159
|
-
}, Qn = Fn ? void 0 :
|
|
7160
|
-
serviceName: process.env.OTEL_SERVICE_NAME ??
|
|
7159
|
+
Xn(e) || Up(e) || e.name.startsWith("RpcServer.") || (Pn.append(e), (In || e.status === "error") && C.emit("trace", e), Yn(e));
|
|
7160
|
+
}, Qn = Fn ? void 0 : io(Zn), L = await ga({
|
|
7161
|
+
serviceName: process.env.OTEL_SERVICE_NAME ?? A?.name ?? "voltro-api",
|
|
7161
7162
|
...Qn ? { traceSink: Qn } : {},
|
|
7162
7163
|
...qt.spanProcessors.length > 0 ? { extraSpanProcessors: qt.spanProcessors } : {},
|
|
7163
7164
|
...qt.metricReaders.length > 0 ? { extraMetricReaders: qt.metricReaders } : {},
|
|
@@ -7165,33 +7166,33 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7165
7166
|
...qt.sampler === void 0 ? {} : { sampler: qt.sampler }
|
|
7166
7167
|
});
|
|
7167
7168
|
L.mode === "off" ? L.bufferOnly || Z.info("tracing disabled", { reason: "buffer off" }) : Z.info("tracing enabled", { mode: L.mode });
|
|
7168
|
-
let er = L.mode === "off" && L.bufferOnly === !1 ? void 0 : L.layer, R = await ng(
|
|
7169
|
+
let er = L.mode === "off" && L.bufferOnly === !1 ? void 0 : L.layer, R = await ng(A, er, void 0, { schemaWorkFollows: !0 }), tr = ms(R, $(A ?? null));
|
|
7169
7170
|
vt.current = tr;
|
|
7170
7171
|
let rr = vf({
|
|
7171
7172
|
store: R,
|
|
7172
|
-
defaultExpiryMs: gf(
|
|
7173
|
+
defaultExpiryMs: gf(A)
|
|
7173
7174
|
});
|
|
7174
|
-
|
|
7175
|
-
let ar = [...
|
|
7175
|
+
T.push(...rr.queries), E.push(...rr.mutations);
|
|
7176
|
+
let ar = [...E.map((e) => e.descriptor), ...D.map((e) => e.descriptor)];
|
|
7176
7177
|
_f(ar) && Z.info("approvals: `requiresApproval` declared — the second-human gate is active", { procedures: ar.filter((e) => e.requiresApproval != null).map((e) => e.name ?? "?") });
|
|
7177
|
-
for (let e of
|
|
7178
|
-
dialect: $(
|
|
7178
|
+
for (let e of Tc({
|
|
7179
|
+
dialect: $(A ?? null),
|
|
7179
7180
|
changeStrategy: (process.env.CDC ?? "1") === "0" ? "inline" : "cdc",
|
|
7180
7181
|
dbUrl: process.env.DB_URL,
|
|
7181
|
-
crossReplicaBus:
|
|
7182
|
+
crossReplicaBus: Ys(A?.plugins ?? [])?.broadcast.crossReplica === !0,
|
|
7182
7183
|
tables: oi().map((e) => ({
|
|
7183
7184
|
tableName: e.tableName,
|
|
7184
7185
|
isReactive: e.isReactive === !0
|
|
7185
7186
|
})),
|
|
7186
|
-
querySources:
|
|
7187
|
+
querySources: T.flatMap((e) => {
|
|
7187
7188
|
let t = e.descriptor.source;
|
|
7188
7189
|
return t === void 0 ? [] : typeof t == "string" ? [t] : [...t];
|
|
7189
7190
|
})
|
|
7190
7191
|
})) e.level === "warn" ? Z.warn(e.message) : Z.info(e.message);
|
|
7191
7192
|
{
|
|
7192
|
-
let e =
|
|
7193
|
+
let e = kc(Oc({
|
|
7193
7194
|
tables: oi().map((e) => ({ tableName: e.tableName })),
|
|
7194
|
-
queries:
|
|
7195
|
+
queries: T.map((e) => ({
|
|
7195
7196
|
name: e.descriptor.name,
|
|
7196
7197
|
source: e.descriptor.source
|
|
7197
7198
|
}))
|
|
@@ -7199,22 +7200,22 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7199
7200
|
e !== void 0 && Z.warn(e);
|
|
7200
7201
|
}
|
|
7201
7202
|
if (yt) {
|
|
7202
|
-
let e = Ca(R), t =
|
|
7203
|
-
|
|
7203
|
+
let e = Ca(R), t = Qa({ flush: $a(e) });
|
|
7204
|
+
W(() => t.shutdown()), xt = Za(e, {
|
|
7204
7205
|
prefix: bt,
|
|
7205
7206
|
usage: t
|
|
7206
7207
|
}), Z.info("api keys active", { prefix: bt });
|
|
7207
7208
|
}
|
|
7208
7209
|
let or = Tl({
|
|
7209
|
-
definitions:
|
|
7210
|
+
definitions: tt.map((e) => e.definition),
|
|
7210
7211
|
store: R,
|
|
7211
|
-
publicUrl: Dl(
|
|
7212
|
+
publicUrl: Dl(S),
|
|
7212
7213
|
log: Z.child("connections")
|
|
7213
7214
|
});
|
|
7214
|
-
|
|
7215
|
-
let cr = $(
|
|
7215
|
+
T.push(...or.queries), E.push(...or.mutations), D.push(...or.actions);
|
|
7216
|
+
let cr = $(A), lr = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, gr, _r;
|
|
7216
7217
|
if (cr !== "memory") {
|
|
7217
|
-
let e = await
|
|
7218
|
+
let e = await x(cr);
|
|
7218
7219
|
gr = $n.make(e.makeSqlLayer(Q())), _r = await gr.runPromise(nr.SqlClient);
|
|
7219
7220
|
}
|
|
7220
7221
|
let vr = [
|
|
@@ -7222,17 +7223,17 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7222
7223
|
"mariadb",
|
|
7223
7224
|
"mysql",
|
|
7224
7225
|
"mssql"
|
|
7225
|
-
].includes(cr) ?
|
|
7226
|
+
].includes(cr) ? Xa(R, lr, Z) : ns, yr = dd(A?.scheduling), br = co({
|
|
7226
7227
|
coordinator: vr,
|
|
7227
7228
|
replicaId: lr,
|
|
7228
7229
|
log: Z,
|
|
7229
7230
|
maxIdleIntervalMs: yr.pollCeilingMs
|
|
7230
|
-
}), xr = [], Sr = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, Tr = ph(
|
|
7231
|
+
}), xr = [], Sr = process.env.POD_NAME ?? process.env.HOSTNAME ?? `dev-${process.pid}`, Tr = ph(A?.plugins, A?.name ?? M(n));
|
|
7231
7232
|
{
|
|
7232
|
-
let e = mh(
|
|
7233
|
+
let e = mh(A?.plugins, A?.name ?? M(n));
|
|
7233
7234
|
e !== void 0 && Z.warn(e);
|
|
7234
7235
|
}
|
|
7235
|
-
let Er = vh(
|
|
7236
|
+
let Er = vh(A?.plugins, Tr, Z), Dr = Ys(A?.plugins ?? [])?.broadcast?.provider, Or = bh(A?.plugins, {
|
|
7236
7237
|
instanceId: Sr,
|
|
7237
7238
|
namespace: Tr,
|
|
7238
7239
|
meta: { mode: "dev" },
|
|
@@ -7242,29 +7243,29 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7242
7243
|
instanceId: Sr,
|
|
7243
7244
|
membership: Or.membership,
|
|
7244
7245
|
...Dr === void 0 ? {} : { broadcast: Dr },
|
|
7245
|
-
broadcastChannels: { presence:
|
|
7246
|
+
broadcastChannels: { presence: Ks(Tr, "presence") },
|
|
7246
7247
|
scheduleCoordinated: (e, t, n) => {
|
|
7247
7248
|
let r = br(e, t, n);
|
|
7248
7249
|
return xr.push(r), r;
|
|
7249
7250
|
}
|
|
7250
7251
|
};
|
|
7251
|
-
for (let e of
|
|
7252
|
-
let jr = $(
|
|
7252
|
+
for (let e of A?.plugins ?? []) e.bindDataStore?.(tr, kr);
|
|
7253
|
+
let jr = $(A), Mr, Nr = await rg(R, A, jr, Tr, Z, (e, t) => {
|
|
7253
7254
|
Mr?.refreshAll(`broadcast gap: missed ${t} change(s) from ${e}`);
|
|
7254
7255
|
}), Pr = pd({
|
|
7255
7256
|
changeScope: R.changeScope,
|
|
7256
7257
|
broadcastAttached: Nr !== void 0
|
|
7257
7258
|
});
|
|
7258
|
-
|
|
7259
|
-
let { service: Ir, invalidationBus: Lr, snapshotCache: Rr, cache: zr, semantic: Br, evictSource: Wr, backend: Gr, stats: Kr, dispose: Yr } = await
|
|
7259
|
+
A?.cache && !process.env.CACHE_BACKEND && (process.env.CACHE_BACKEND = A.cache), A?.cacheRedisUrl && !process.env.CACHE_REDIS_URL && (process.env.CACHE_REDIS_URL = A.cacheRedisUrl), A?.cacheRedisDriver && !process.env.CACHE_REDIS_DRIVER && (process.env.CACHE_REDIS_DRIVER = A.cacheRedisDriver), A?.cacheKeyPrefix && !process.env.CACHE_KEY_PREFIX && (process.env.CACHE_KEY_PREFIX = A.cacheKeyPrefix);
|
|
7260
|
+
let { service: Ir, invalidationBus: Lr, snapshotCache: Rr, cache: zr, semantic: Br, evictSource: Wr, backend: Gr, stats: Kr, dispose: Yr } = await Fc({
|
|
7260
7261
|
env: process.env,
|
|
7261
|
-
semantic:
|
|
7262
|
+
semantic: A?.cacheSemantic ?? !1
|
|
7262
7263
|
});
|
|
7263
|
-
Br !== void 0 && Z.info("semantic cache enabled — reactive eviction on live writes"), Z.info(`cache backend resolved: ${Gr}` + (Gr === "redis" ? ` (driver ${process.env.CACHE_REDIS_DRIVER ?? "resp"})` : " — in-process, not cross-instance")),
|
|
7264
|
-
let { kv: Qr, service: ni, backend: ri } = await
|
|
7264
|
+
Br !== void 0 && Z.info("semantic cache enabled — reactive eviction on live writes"), Z.info(`cache backend resolved: ${Gr}` + (Gr === "redis" ? ` (driver ${process.env.CACHE_REDIS_DRIVER ?? "resp"})` : " — in-process, not cross-instance")), A?.kv && !process.env.KV_BACKEND && (process.env.KV_BACKEND = A.kv), A?.kvRedisUrl && !process.env.KV_REDIS_URL && (process.env.KV_REDIS_URL = A.kvRedisUrl), A?.kvKeyPrefix && !process.env.KV_KEY_PREFIX && (process.env.KV_KEY_PREFIX = A.kvKeyPrefix);
|
|
7265
|
+
let { kv: Qr, service: ni, backend: ri } = await no({ store: R });
|
|
7265
7266
|
Z.info(`kv backend resolved: ${ri}` + (ri === "database" ? " (durable, _voltro_kv)" : ri === "memory" ? " — in-process, non-durable" : ` (driver ${process.env.KV_REDIS_DRIVER ?? "resp"}, non-durable)`));
|
|
7266
|
-
let ii = $(
|
|
7267
|
-
spec:
|
|
7267
|
+
let ii = $(A), ai = A?.analytics !== void 0 && A.analytics.kind !== "noop" && ii !== "memory" ? (await x(ii)).makeSqlLayer(Q()) : void 0, li = await pl({
|
|
7268
|
+
spec: A?.analytics,
|
|
7268
7269
|
sqlLayer: ai,
|
|
7269
7270
|
log: Z
|
|
7270
7271
|
});
|
|
@@ -7284,27 +7285,27 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7284
7285
|
log: Z
|
|
7285
7286
|
}), await li.dispose();
|
|
7286
7287
|
})()), gi);
|
|
7287
|
-
|
|
7288
|
-
let vi = $(
|
|
7288
|
+
W(_i);
|
|
7289
|
+
let vi = $(A), yi;
|
|
7289
7290
|
if (vi !== "memory" && process.env.VOLTRO_AUTO_MIGRATE !== "0") {
|
|
7290
7291
|
let e = Date.now(), t = (process.env.NODE_ENV ?? "").toLowerCase() === "production" ? "prod" : (process.env.NODE_ENV ?? "").toLowerCase() === "staging" ? "staging" : "dev";
|
|
7291
7292
|
Z.info("auto-migrate: planning schema", {
|
|
7292
7293
|
dialect: vi,
|
|
7293
7294
|
env: t,
|
|
7294
7295
|
tables: P.length
|
|
7295
|
-
}),
|
|
7296
|
+
}), we?.set({
|
|
7296
7297
|
phase: "migrating",
|
|
7297
7298
|
tablesTotal: P.length
|
|
7298
7299
|
});
|
|
7299
7300
|
try {
|
|
7300
|
-
let r = await
|
|
7301
|
+
let r = await x(vi), i = r.makeSqlLayer(Q());
|
|
7301
7302
|
yi = i;
|
|
7302
7303
|
let a = Uh(P.filter((e) => e.tableName.startsWith("_voltro_") || e.tableName === "voltro_isr_cache"), P);
|
|
7303
7304
|
await dr(a, i, r.id, { retryFilter: r.retryFilter });
|
|
7304
|
-
let o =
|
|
7305
|
+
let o = Pc({
|
|
7305
7306
|
conn: Q(),
|
|
7306
7307
|
pendingIds: await F.runPromise(nr.SqlClient.pipe(F.flatMap((e) => sr(e, n)), F.provide(i))),
|
|
7307
|
-
optIn: process.env[
|
|
7308
|
+
optIn: process.env[Ac] === "1"
|
|
7308
7309
|
});
|
|
7309
7310
|
if (!o.allowed) throw Z.error(`file-based migrations: ${o.message}`), Error("file-based migrations refused — see error above");
|
|
7310
7311
|
let s = await F.runPromise(nr.SqlClient.pipe(F.flatMap((e) => ur(e, {
|
|
@@ -7321,28 +7322,28 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7321
7322
|
if (c.kind === "refused-blocked" || c.kind === "prod-mismatch") throw Z.error(ir(c, r.id)), Error("auto-migrate refused — see error above");
|
|
7322
7323
|
Z.info(ir(c, r.id), { durationMs: Date.now() - e });
|
|
7323
7324
|
} catch (e) {
|
|
7324
|
-
throw Z.error("auto-migrate failed — aborting boot", { err: e }),
|
|
7325
|
+
throw Z.error("auto-migrate failed — aborting boot", { err: e }), we?.set({
|
|
7325
7326
|
phase: "error",
|
|
7326
7327
|
error: e instanceof Error ? e.message : String(e)
|
|
7327
7328
|
}), e;
|
|
7328
7329
|
}
|
|
7329
7330
|
} else vi !== "memory" && Z.info("auto-migrate: skipped (VOLTRO_AUTO_MIGRATE=0)");
|
|
7330
|
-
await
|
|
7331
|
+
await ue({
|
|
7331
7332
|
dialectId: vi,
|
|
7332
7333
|
tables: P,
|
|
7333
|
-
mode:
|
|
7334
|
+
mode: se(A?.reactiveTriggers),
|
|
7334
7335
|
lockSchema: Q().schema,
|
|
7335
|
-
makeLayer: async () => (await
|
|
7336
|
+
makeLayer: async () => (await x(vi)).makeSqlLayer(Q()),
|
|
7336
7337
|
log: {
|
|
7337
7338
|
info: (e, t) => Z.info(e, t ?? {}),
|
|
7338
7339
|
warn: (e, t) => Z.warn(e, t ?? {})
|
|
7339
7340
|
}
|
|
7340
7341
|
});
|
|
7341
|
-
let bi = $(
|
|
7342
|
-
if ((
|
|
7343
|
-
let e = (await
|
|
7342
|
+
let bi = $(A);
|
|
7343
|
+
if ((A?.plugins ?? []).some((e) => (e.extendSchema?.migrations?.length ?? 0) > 0) && bi !== "memory") {
|
|
7344
|
+
let e = (await x(bi)).makeSqlLayer(Q());
|
|
7344
7345
|
try {
|
|
7345
|
-
let t = await F.runPromise(
|
|
7346
|
+
let t = await F.runPromise(ve(A.plugins).pipe(F.provide(e))), n = t.filter((e) => e.status === "applied"), r = t.filter((e) => e.status === "skipped");
|
|
7346
7347
|
Z.info("plugin migrations complete", {
|
|
7347
7348
|
applied: n.map((e) => `${e.pluginName}:${e.migrationId} (${e.durationMs}ms)`),
|
|
7348
7349
|
skippedCount: r.length
|
|
@@ -7351,67 +7352,76 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7351
7352
|
throw Z.error("plugin migrations failed — aborting boot", { err: e }), e;
|
|
7352
7353
|
}
|
|
7353
7354
|
}
|
|
7354
|
-
|
|
7355
|
-
|
|
7355
|
+
if (R.refreshChangeCaptureExclusions) try {
|
|
7356
|
+
let e = await R.refreshChangeCaptureExclusions();
|
|
7357
|
+
(e.readmitted.length > 0 || e.newlyExcluded.length > 0) && Z.info("cdc: exclusion set re-checked after schema work", {
|
|
7358
|
+
readmitted: e.readmitted,
|
|
7359
|
+
newlyExcluded: e.newlyExcluded
|
|
7360
|
+
});
|
|
7361
|
+
} catch (e) {
|
|
7362
|
+
Z.warn("cdc: could not re-check the exclusion set after schema work", {}, e);
|
|
7363
|
+
}
|
|
7364
|
+
let xi = Rp(R, C);
|
|
7365
|
+
W(() => {
|
|
7356
7366
|
xi();
|
|
7357
7367
|
});
|
|
7358
|
-
let Ci =
|
|
7359
|
-
|
|
7368
|
+
let Ci = Eo(P);
|
|
7369
|
+
es({
|
|
7360
7370
|
dataStore: R,
|
|
7361
7371
|
schemaRegistry: Ci
|
|
7362
7372
|
});
|
|
7363
7373
|
let wi = Z.child("seeds"), Ti = await tf({
|
|
7364
|
-
files:
|
|
7374
|
+
files: w,
|
|
7365
7375
|
store: R,
|
|
7366
7376
|
log: Z,
|
|
7367
7377
|
seedPolicy: "run",
|
|
7368
|
-
seedPattern:
|
|
7369
|
-
loadSeedFiles:
|
|
7370
|
-
runBootSeeds:
|
|
7378
|
+
seedPattern: Ge,
|
|
7379
|
+
loadSeedFiles: le,
|
|
7380
|
+
runBootSeeds: de,
|
|
7371
7381
|
onSeedDiscovered: (e) => {
|
|
7372
7382
|
t.registerSeed(e);
|
|
7373
7383
|
},
|
|
7374
7384
|
onSeedResult: (e) => {
|
|
7375
7385
|
t.recordSeedResult(e);
|
|
7376
7386
|
},
|
|
7377
|
-
startupPattern:
|
|
7387
|
+
startupPattern: Pe,
|
|
7378
7388
|
loadStartupFiles: i,
|
|
7379
7389
|
runStartups: a,
|
|
7380
7390
|
emailPattern: $d,
|
|
7381
7391
|
loadEmailFiles: ef,
|
|
7382
|
-
registerEmailTemplates:
|
|
7392
|
+
registerEmailTemplates: Ws
|
|
7383
7393
|
}), Di = of({
|
|
7384
7394
|
schedules: nf({
|
|
7385
|
-
schedules:
|
|
7395
|
+
schedules: $e,
|
|
7386
7396
|
seeds: Ti.seeds,
|
|
7387
7397
|
store: R,
|
|
7388
7398
|
log: wi
|
|
7389
7399
|
}),
|
|
7390
|
-
workflows:
|
|
7400
|
+
workflows: k,
|
|
7391
7401
|
log: Z
|
|
7392
7402
|
}), Oi = Ti.startups;
|
|
7393
|
-
Oi &&
|
|
7394
|
-
demands: Kl(
|
|
7403
|
+
Oi && W(() => Oi.shutdown()), Yl({
|
|
7404
|
+
demands: Kl(mt),
|
|
7395
7405
|
isRegistered: (e) => Fa(e) !== void 0
|
|
7396
7406
|
});
|
|
7397
|
-
let ki = Z.child("subscribe"), ji =
|
|
7407
|
+
let ki = Z.child("subscribe"), ji = w.filter((e) => We.test(e)), Mi = ji.length > 0 ? await _l(ji, ki) : [], Ni;
|
|
7398
7408
|
pm({
|
|
7399
|
-
events:
|
|
7409
|
+
events: Je,
|
|
7400
7410
|
rpcTags: [
|
|
7411
|
+
...T.map((e) => e.descriptor.name),
|
|
7401
7412
|
...E.map((e) => e.descriptor.name),
|
|
7402
7413
|
...D.map((e) => e.descriptor.name),
|
|
7403
|
-
...
|
|
7404
|
-
...Ge.map((e) => e.descriptor.name)
|
|
7414
|
+
...Ke.map((e) => e.descriptor.name)
|
|
7405
7415
|
]
|
|
7406
7416
|
});
|
|
7407
7417
|
let Pi = mm({
|
|
7408
|
-
events:
|
|
7418
|
+
events: Je,
|
|
7409
7419
|
origin: Sr,
|
|
7410
7420
|
...Er.publishRemote === void 0 ? {} : { publishRemote: Er.publishRemote }
|
|
7411
7421
|
});
|
|
7412
|
-
if (
|
|
7413
|
-
let e = Ym(
|
|
7414
|
-
for (let [, t] of lh(
|
|
7422
|
+
if (Je.length > 0 && await Er.attach(Pi.bus), Je.length > 0) {
|
|
7423
|
+
let e = Ym(Je);
|
|
7424
|
+
for (let [, t] of lh(w.filter((e) => !ze.test(e)))) if (e.offer(t), e.settled) break;
|
|
7415
7425
|
e.settled || dh(n, {
|
|
7416
7426
|
onFile: (t, n) => (e.offer(n), e.settled ? "stop" : "continue"),
|
|
7417
7427
|
onTruncated: (e, t) => Z.warn(`event audit: stopped after ${t} sibling files (saw ${e}) — a \`no-consumer\` line below may mean "we stopped looking", not "nothing consumes it"`)
|
|
@@ -7421,13 +7431,13 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7421
7431
|
let r = e.abstained();
|
|
7422
7432
|
r > 0 && Z.info(`events: ${r} webhook event(s) NOT verified — this app emits through a shared helper that takes the descriptor as a value, so a source scan cannot tell a published event from a dead one. Not a warning, and not a pass either.`);
|
|
7423
7433
|
}
|
|
7424
|
-
Mi.length > 0 && (ki.info("discovered subscribers", { subscribers: Mi.map((e) => `${e.id}@${e.definition.table}`) }), Ni = vl(Mi, R, ki, Ci, Pi.bus)), Ni &&
|
|
7434
|
+
Mi.length > 0 && (ki.info("discovered subscribers", { subscribers: Mi.map((e) => `${e.id}@${e.definition.table}`) }), Ni = vl(Mi, R, ki, Ci, Pi.bus)), Ni && W(() => {
|
|
7425
7435
|
Ni();
|
|
7426
|
-
}), Ra(),
|
|
7427
|
-
let Ii, Li = Z.child("outbox"), Ri =
|
|
7436
|
+
}), Ra(), Go((e) => qa(R, e.subjectId, e.resourceType, e.resourceId)) || Z.info("policy guards: using the app-registered tuple source");
|
|
7437
|
+
let Ii, Li = Z.child("outbox"), Ri = w.filter((e) => Be.test(e)), Bi = Ri.length > 0 ? await bl(Ri, Li) : [], Vi = jt(w.filter((e) => Le.test(e)).length, Je) ? [...Bi, {
|
|
7428
7438
|
file: "<framework>/webhooks",
|
|
7429
7439
|
id: "voltro-webhook-emit",
|
|
7430
|
-
definition:
|
|
7440
|
+
definition: Ms(() => Ii)
|
|
7431
7441
|
}] : Bi, Ui = Vi.length > 0 ? Sl({
|
|
7432
7442
|
handlers: Vi,
|
|
7433
7443
|
store: R,
|
|
@@ -7436,14 +7446,14 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7436
7446
|
table: t.table,
|
|
7437
7447
|
op: t.op
|
|
7438
7448
|
})),
|
|
7439
|
-
onShutdown:
|
|
7440
|
-
}) : void 0, Ki = fu(), Yi = $(
|
|
7449
|
+
onShutdown: W
|
|
7450
|
+
}) : void 0, Ki = fu(), Yi = $(A);
|
|
7441
7451
|
if (pn.length > 0 && Yi !== "memory") try {
|
|
7442
|
-
Ki = _u((await
|
|
7452
|
+
Ki = _u((await x(Yi)).makeSqlLayer(Q()));
|
|
7443
7453
|
} catch (e) {
|
|
7444
7454
|
dn.warn("aggregate: SQL storage init failed — falling back to in-process", { err: e });
|
|
7445
7455
|
}
|
|
7446
|
-
let Xi = Yi === "memory" ?
|
|
7456
|
+
let Xi = Yi === "memory" ? ns : Xa(R, `aggregate@${process.pid}`, dn), Zi = pn.length > 0 ? await ju({
|
|
7447
7457
|
discovered: pn,
|
|
7448
7458
|
store: R,
|
|
7449
7459
|
analytics: di,
|
|
@@ -7459,7 +7469,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7459
7469
|
names: Zi.registered,
|
|
7460
7470
|
storage: Yi === "memory" ? "in-process" : "sql-backed",
|
|
7461
7471
|
coordination: Xi.kind
|
|
7462
|
-
}),
|
|
7472
|
+
}), W(() => {
|
|
7463
7473
|
Zi.detach();
|
|
7464
7474
|
});
|
|
7465
7475
|
let Qi = _n.length > 0 ? ca({
|
|
@@ -7467,14 +7477,14 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7467
7477
|
store: R,
|
|
7468
7478
|
log: hn
|
|
7469
7479
|
}) : void 0;
|
|
7470
|
-
Qi !== void 0 && (hn.info("expectations registered", { names: Qi.registered }),
|
|
7480
|
+
Qi !== void 0 && (hn.info("expectations registered", { names: Qi.registered }), W(() => {
|
|
7471
7481
|
Qi.detach();
|
|
7472
7482
|
}));
|
|
7473
7483
|
let $i = bn.length > 0 ? ua({
|
|
7474
7484
|
discovered: bn,
|
|
7475
7485
|
log: vn
|
|
7476
7486
|
}) : void 0;
|
|
7477
|
-
$i !== void 0 && (vn.info("cost budgets registered", { names: $i.registered }),
|
|
7487
|
+
$i !== void 0 && (vn.info("cost budgets registered", { names: $i.registered }), W(() => {
|
|
7478
7488
|
$i.detach();
|
|
7479
7489
|
}));
|
|
7480
7490
|
let ea = Cn.length > 0 ? la({
|
|
@@ -7482,10 +7492,10 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7482
7492
|
store: R,
|
|
7483
7493
|
log: xn
|
|
7484
7494
|
}) : void 0;
|
|
7485
|
-
ea !== void 0 && (xn.info("experiments registered", { names: ea.registered }),
|
|
7495
|
+
ea !== void 0 && (xn.info("experiments registered", { names: ea.registered }), W(() => {
|
|
7486
7496
|
ea.detach();
|
|
7487
7497
|
}));
|
|
7488
|
-
let B = $(
|
|
7498
|
+
let B = $(A), ra, ia = A?.scheduling ?? {}, aa = ia.trigger ?? "self", oa = ia.coordination ?? ([
|
|
7489
7499
|
"postgres",
|
|
7490
7500
|
"mariadb",
|
|
7491
7501
|
"mysql",
|
|
@@ -7503,7 +7513,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7503
7513
|
}
|
|
7504
7514
|
})) : [], ya = "in-memory", xa = await (async () => {
|
|
7505
7515
|
if (B === "memory") return hr.layerMemory;
|
|
7506
|
-
let e = await
|
|
7516
|
+
let e = await x(B), t = e.makeSqlLayer(Q()), n = $r({ sqliteFamily: Si(e.id) });
|
|
7507
7517
|
if (ya = `cluster-${n}`, Z.info(`workflow engine: cluster-${n}, dialect=${e.id}` + (n === "memory" ? " — single-process durable replay, no horizontal scaling" + (Si(e.id) ? "" : " (VOLTRO_WORKFLOW_RUNNER_STORAGE=memory: SqlRunnerStorage/cluster_runners + GET_LOCK skipped)") : "")), e.id === "mssql") {
|
|
7508
7518
|
let e = await Ot(process.cwd());
|
|
7509
7519
|
e && Z.warn(e);
|
|
@@ -7521,26 +7531,26 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7521
7531
|
store: R,
|
|
7522
7532
|
warn: (e, t) => Z.warn(e, t)
|
|
7523
7533
|
}), Ta = wa.remember, Ea = wa.resolve, Da = kl({
|
|
7524
|
-
authority:
|
|
7534
|
+
authority: A?.auth,
|
|
7525
7535
|
getStore: () => vt.current
|
|
7526
|
-
}), V =
|
|
7536
|
+
}), V = k.length > 0 ? ho(() => Sa) : void 0, ka = Z.child("webhooks"), Pa = w.filter((e) => Le.test(e)), La = Pa.length > 0 ? await Mt(Pa, ka) : {
|
|
7527
7537
|
outgoing: [],
|
|
7528
7538
|
incoming: [],
|
|
7529
7539
|
providers: []
|
|
7530
|
-
},
|
|
7540
|
+
}, H = {
|
|
7531
7541
|
...La,
|
|
7532
|
-
outgoing: [...La.outgoing, ...At(
|
|
7542
|
+
outgoing: [...La.outgoing, ...At(Je)]
|
|
7533
7543
|
};
|
|
7534
|
-
|
|
7535
|
-
outgoing:
|
|
7536
|
-
incoming:
|
|
7537
|
-
providers:
|
|
7544
|
+
H.outgoing.length + H.incoming.length + H.providers.length > 0 && ka.info("discovered webhooks", {
|
|
7545
|
+
outgoing: H.outgoing.map((e) => e.descriptor.id),
|
|
7546
|
+
incoming: H.incoming.map((e) => e.descriptor.id),
|
|
7547
|
+
providers: H.providers.map((e) => e.descriptor.id)
|
|
7538
7548
|
});
|
|
7539
|
-
let
|
|
7540
|
-
for (let e of
|
|
7541
|
-
let t = e.descriptor.path ??
|
|
7549
|
+
let za = /* @__PURE__ */ new Map();
|
|
7550
|
+
for (let e of H.incoming) {
|
|
7551
|
+
let t = e.descriptor.path ?? As(e.descriptor.id), n = `VOLTRO_WEBHOOK_SECRET_${e.descriptor.id.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, r = Ns(e.descriptor, {
|
|
7542
7552
|
resolveSecret: async () => process.env[n] ?? null,
|
|
7543
|
-
resolveWorkflows: () => V === void 0 ? void 0 :
|
|
7553
|
+
resolveWorkflows: () => V === void 0 ? void 0 : jo(V, {
|
|
7544
7554
|
traceId: `incoming:${e.descriptor.id}`,
|
|
7545
7555
|
source: `incoming:${e.descriptor.id}`
|
|
7546
7556
|
}),
|
|
@@ -7555,36 +7565,36 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7555
7565
|
e.status >= 500 ? ka.error("incoming delivery failed", t) : e.status >= 400 ? ka.warn("incoming delivery rejected", t) : ka.info("incoming delivery handled", t);
|
|
7556
7566
|
}
|
|
7557
7567
|
});
|
|
7558
|
-
|
|
7568
|
+
za.set(t, r), ka.info("mounted incoming webhook", {
|
|
7559
7569
|
id: e.descriptor.id,
|
|
7560
7570
|
path: t,
|
|
7561
7571
|
secretEnvKey: n
|
|
7562
7572
|
});
|
|
7563
7573
|
}
|
|
7564
|
-
let
|
|
7565
|
-
if (
|
|
7566
|
-
|
|
7567
|
-
let e = qd(R, { onError: (e) =>
|
|
7568
|
-
|
|
7574
|
+
let Va = Z.child("reaction"), Ha = w.filter((e) => Ue.test(e)), Wa = Ha.length > 0 ? await su(Ha, Va) : [], Ga;
|
|
7575
|
+
if (Wa.length > 0) {
|
|
7576
|
+
Va.info("discovered reactions", { reactions: Wa.map((e) => `${e.definition.name}@${e.definition.watch.table}`) });
|
|
7577
|
+
let e = qd(R, { onError: (e) => Va.warn("reaction: rate-slot claim failed; refusing the act", { cause: String(e) }) });
|
|
7578
|
+
Ga = lu(Wa, R, {
|
|
7569
7579
|
runAct: async (e, t) => {
|
|
7570
7580
|
if (e.kind === "workflow") {
|
|
7571
7581
|
if (V === void 0) {
|
|
7572
|
-
|
|
7582
|
+
Va.warn("reaction workflow act skipped — no workflow engine in this app", { workflow: e.workflow });
|
|
7573
7583
|
return;
|
|
7574
7584
|
}
|
|
7575
7585
|
let n = e.payload === void 0 ? t.new ?? t.old ?? {} : e.payload(t);
|
|
7576
|
-
await
|
|
7586
|
+
await jo(V, {
|
|
7577
7587
|
traceId: `reaction:${e.workflow}`,
|
|
7578
7588
|
source: `reaction:${e.workflow}`
|
|
7579
7589
|
}).start(e.workflow, n);
|
|
7580
7590
|
return;
|
|
7581
7591
|
}
|
|
7582
7592
|
await cu(e.agent, t, {
|
|
7583
|
-
findAgentSend: (e) =>
|
|
7584
|
-
runAction: (e, t, n) => Promise.resolve(
|
|
7593
|
+
findAgentSend: (e) => D.find((t) => t.descriptor.name === `${e}.send`),
|
|
7594
|
+
runAction: (e, t, n) => Promise.resolve(Es(e, t, n)),
|
|
7585
7595
|
makeSubject: (e) => sn(e),
|
|
7586
7596
|
now: () => Date.now(),
|
|
7587
|
-
log:
|
|
7597
|
+
log: Va
|
|
7588
7598
|
});
|
|
7589
7599
|
},
|
|
7590
7600
|
checkBudget: async (e, t) => {
|
|
@@ -7595,29 +7605,29 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7595
7605
|
limitUsd: t
|
|
7596
7606
|
}))))._tag === "Right";
|
|
7597
7607
|
} catch (t) {
|
|
7598
|
-
return
|
|
7608
|
+
return Va.warn("reaction budget check failed — refusing the act", { tenantId: e }, t), !1;
|
|
7599
7609
|
}
|
|
7600
7610
|
},
|
|
7601
7611
|
claimRateSlot: (t) => e.claim(t)
|
|
7602
|
-
},
|
|
7612
|
+
}, Va);
|
|
7603
7613
|
}
|
|
7604
|
-
|
|
7605
|
-
|
|
7614
|
+
Ga && W(() => {
|
|
7615
|
+
Ga();
|
|
7606
7616
|
});
|
|
7607
|
-
let
|
|
7617
|
+
let Ka = 0, U = new Gi({
|
|
7608
7618
|
store: R,
|
|
7609
7619
|
cache: Rr,
|
|
7610
|
-
...
|
|
7620
|
+
...A?.reactive === void 0 ? {} : { reactive: A.reactive },
|
|
7611
7621
|
...$i === void 0 ? {} : { recordCost: $i.record },
|
|
7612
7622
|
recordDelivery: (e) => {
|
|
7613
|
-
|
|
7623
|
+
Bo({
|
|
7614
7624
|
label: e.label,
|
|
7615
7625
|
kind: e.kind,
|
|
7616
7626
|
durationMs: e.durationMs,
|
|
7617
7627
|
rowCount: e.rowCount
|
|
7618
7628
|
}), Zn({
|
|
7619
7629
|
traceId: e.traceId,
|
|
7620
|
-
spanId: (
|
|
7630
|
+
spanId: (Ka++).toString(16).padStart(16, "0"),
|
|
7621
7631
|
parentSpanId: e.parentSpanId ?? null,
|
|
7622
7632
|
name: `${e.label}.${e.kind}`,
|
|
7623
7633
|
kind: "internal",
|
|
@@ -7632,21 +7642,21 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7632
7642
|
});
|
|
7633
7643
|
}
|
|
7634
7644
|
});
|
|
7635
|
-
Mr =
|
|
7636
|
-
let
|
|
7637
|
-
|
|
7645
|
+
Mr = U;
|
|
7646
|
+
let Ja = () => {
|
|
7647
|
+
C.emit("subscriptions", Wm(() => U));
|
|
7638
7648
|
};
|
|
7639
|
-
|
|
7640
|
-
let
|
|
7649
|
+
U.onSubscriptionsChange(Ja), Ja();
|
|
7650
|
+
let eo = Z.child("store"), to = (A?.plugins ?? []).filter((e) => typeof e.onChangeEvent == "function"), ao = R.changeScope ?? "local";
|
|
7641
7651
|
vm({
|
|
7642
7652
|
store: R,
|
|
7643
7653
|
..._m(),
|
|
7644
7654
|
log: Z
|
|
7645
7655
|
}), R.onChange((e) => {
|
|
7646
|
-
if (
|
|
7656
|
+
if (eo.debug(`${e.op} on ${e.table}`, {
|
|
7647
7657
|
op: e.op,
|
|
7648
7658
|
table: e.table
|
|
7649
|
-
}),
|
|
7659
|
+
}), Vo({
|
|
7650
7660
|
table: e.table,
|
|
7651
7661
|
op: e.op,
|
|
7652
7662
|
old: e.old ?? null,
|
|
@@ -7659,10 +7669,10 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7659
7669
|
...t === void 0 ? {} : { id: t }
|
|
7660
7670
|
});
|
|
7661
7671
|
}
|
|
7662
|
-
if (
|
|
7663
|
-
let t = au(e,
|
|
7664
|
-
for (let n of
|
|
7665
|
-
let r =
|
|
7672
|
+
if (to.length > 0) {
|
|
7673
|
+
let t = au(e, ao);
|
|
7674
|
+
for (let n of to) {
|
|
7675
|
+
let r = eo.child(`plugin:${n.name}`);
|
|
7666
7676
|
F.runFork(n.onChangeEvent(t).pipe(F.catchAllCause((t) => F.sync(() => r.warn("onChangeEvent failed", {
|
|
7667
7677
|
table: e.table,
|
|
7668
7678
|
op: e.op
|
|
@@ -7670,11 +7680,11 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7670
7680
|
}
|
|
7671
7681
|
}
|
|
7672
7682
|
});
|
|
7673
|
-
let
|
|
7683
|
+
let oo = k.map((e) => pr.make(e.definition.name, {
|
|
7674
7684
|
payload: e.definition.payloadSchema,
|
|
7675
7685
|
success: rn,
|
|
7676
7686
|
error: e.definition.errorSchema
|
|
7677
|
-
})),
|
|
7687
|
+
})), so = gt ? [
|
|
7678
7688
|
kn(Un),
|
|
7679
7689
|
kn(Gn),
|
|
7680
7690
|
kn(Wn),
|
|
@@ -7685,27 +7695,27 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7685
7695
|
an(Vn),
|
|
7686
7696
|
an(Kn),
|
|
7687
7697
|
an(qn)
|
|
7688
|
-
] : [],
|
|
7689
|
-
...
|
|
7690
|
-
...
|
|
7691
|
-
...
|
|
7692
|
-
...
|
|
7698
|
+
] : [], lo = (A?.plugins ?? []).flatMap((e) => (e.errorSchemas ?? []).map((e) => e.schema)), uo = lo.length > 0 ? lo : void 0, po = (e) => e.filter((e) => En(e.descriptor)), mo = po(T), go = po(E), bo = po(D), xo = po(Ke), Do = [
|
|
7699
|
+
...mo.map((e) => kn(e.descriptor, uo)),
|
|
7700
|
+
...go.map((e) => Dn(e.descriptor, uo)),
|
|
7701
|
+
...bo.map((e) => an(e.descriptor, uo)),
|
|
7702
|
+
...xo.map((e) => jn(e.descriptor, uo)),
|
|
7693
7703
|
...Pi.rpcs,
|
|
7694
|
-
...
|
|
7695
|
-
...
|
|
7696
|
-
],
|
|
7704
|
+
...oo,
|
|
7705
|
+
...so
|
|
7706
|
+
], Oo = mr.make(...Do).middleware($t).middleware(en), ko = A?.layers ?? [], No = (A?.plugins ?? []).map((e) => e.services).filter((e) => e !== void 0), Po = I.succeed(zi, Zi.registry), Fo = I.succeed(qi, Qi?.registry ?? Hu), Io = I.succeed(Hi, $i?.registry ?? Uu), Ro = I.succeed(Ji, ea?.registry ?? Wu), zo = I.mergeAll(qc({
|
|
7697
7707
|
analyticsLayer: li.layer,
|
|
7698
7708
|
cacheService: Ir,
|
|
7699
7709
|
kvService: ni,
|
|
7700
7710
|
...Br === void 0 ? {} : { semanticCache: Br },
|
|
7701
|
-
pluginServices:
|
|
7702
|
-
userLayers:
|
|
7703
|
-
}), Fo, Io,
|
|
7704
|
-
(
|
|
7705
|
-
userLayers:
|
|
7706
|
-
pluginLayers:
|
|
7711
|
+
pluginServices: No,
|
|
7712
|
+
userLayers: ko
|
|
7713
|
+
}), Po, Fo, Io, Ro);
|
|
7714
|
+
(ko.length > 0 || No.length > 0) && Z.info("layers loaded", {
|
|
7715
|
+
userLayers: ko.length,
|
|
7716
|
+
pluginLayers: No.length
|
|
7707
7717
|
});
|
|
7708
|
-
let
|
|
7718
|
+
let Uo = (e, t) => Yo(e.pipe(F.provide(fo(t)), F.provide(zo), F.provide(_t)));
|
|
7709
7719
|
if ((process.env.VOLTRO_INDEX_AUDIT ?? "on") !== "off") {
|
|
7710
7720
|
let e = ci(P), t = process.stdout.isTTY === !0 && (process.env.NO_COLOR ?? "") === "";
|
|
7711
7721
|
for (let n of e) Z.warn("\n" + hi(n, {
|
|
@@ -7713,16 +7723,16 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7713
7723
|
indent: " "
|
|
7714
7724
|
}));
|
|
7715
7725
|
}
|
|
7716
|
-
let
|
|
7717
|
-
if (
|
|
7726
|
+
let Wo;
|
|
7727
|
+
if (H.outgoing.length > 0) {
|
|
7718
7728
|
let e = Uc({
|
|
7719
7729
|
store: R,
|
|
7720
7730
|
schemaRegistry: Ci,
|
|
7721
7731
|
cache: zr,
|
|
7722
7732
|
kv: Qr
|
|
7723
|
-
}), t =
|
|
7724
|
-
|
|
7725
|
-
|
|
7733
|
+
}), t = H.outgoing.map((e) => e.descriptor);
|
|
7734
|
+
Wo = js.toLayer(Os(e, { events: t })), Ii = ks(e, async (e) => {
|
|
7735
|
+
J.runPromise(js.execute(e)).catch((t) => {
|
|
7726
7736
|
ka.error("deliverWebhook workflow crashed", {
|
|
7727
7737
|
deliveryId: e.deliveryId,
|
|
7728
7738
|
targetId: e.targetId
|
|
@@ -7730,63 +7740,63 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7730
7740
|
});
|
|
7731
7741
|
}, { events: t });
|
|
7732
7742
|
}
|
|
7733
|
-
let
|
|
7734
|
-
|
|
7735
|
-
let
|
|
7736
|
-
let e = await
|
|
7743
|
+
let G = (process.env.VOLTRO_TENANT_ISOLATION ?? A?.tenancy?.isolation) === "namespace";
|
|
7744
|
+
G && Z.info("multi-tenancy: PHYSICAL namespace isolation ON — each request runs against its tenant's own namespace (schema/database/attached file). Requests without a resolvable tenant fail closed.");
|
|
7745
|
+
let qo = $(A), K = G && qo !== "memory" ? await (async () => {
|
|
7746
|
+
let e = await x(qo);
|
|
7737
7747
|
return Bc({
|
|
7738
7748
|
tables: oi(),
|
|
7739
7749
|
sqlLayer: e.makeSqlLayer(Q()),
|
|
7740
|
-
dialect:
|
|
7750
|
+
dialect: qo,
|
|
7741
7751
|
options: { retryFilter: e.retryFilter },
|
|
7742
7752
|
log: {
|
|
7743
7753
|
info: (e, t) => Z.info(e, t),
|
|
7744
7754
|
error: (e, t, n) => Z.error(e, t ?? {}, n)
|
|
7745
7755
|
}
|
|
7746
7756
|
});
|
|
7747
|
-
})() : void 0,
|
|
7748
|
-
input:
|
|
7749
|
-
namespaceIsolationOn:
|
|
7750
|
-
makeStoreForUrl: (e, t) => ng(
|
|
7757
|
+
})() : void 0, Xo = await wh({
|
|
7758
|
+
input: A?.tenancy?.residency,
|
|
7759
|
+
namespaceIsolationOn: G,
|
|
7760
|
+
makeStoreForUrl: (e, t) => ng(A, er, re(Q(), t)),
|
|
7751
7761
|
log: {
|
|
7752
7762
|
info: (e, t) => Z.info(e, t),
|
|
7753
7763
|
warn: (e, t) => Z.warn(e, t)
|
|
7754
7764
|
}
|
|
7755
7765
|
});
|
|
7756
|
-
|
|
7757
|
-
await
|
|
7766
|
+
Xo !== void 0 && W(async () => {
|
|
7767
|
+
await Xo.close();
|
|
7758
7768
|
});
|
|
7759
|
-
let
|
|
7769
|
+
let Zo = Wc({
|
|
7760
7770
|
store: R,
|
|
7761
7771
|
schemaRegistry: Ci,
|
|
7762
7772
|
cache: zr,
|
|
7763
7773
|
kv: Qr,
|
|
7764
|
-
...
|
|
7774
|
+
...Xo === void 0 ? {} : { resolveResidentStore: Xo.resolveStore },
|
|
7765
7775
|
...Ii === void 0 ? {} : { webhooksService: Ii },
|
|
7766
7776
|
...V === void 0 ? {} : { workflowsProxy: V },
|
|
7767
|
-
eventTriggers:
|
|
7768
|
-
namespaceIsolationOn:
|
|
7769
|
-
...
|
|
7770
|
-
onEventEmit: (e, t) =>
|
|
7777
|
+
eventTriggers: Qe,
|
|
7778
|
+
namespaceIsolationOn: G,
|
|
7779
|
+
...K === void 0 ? {} : { ensureTenantProvisioned: K.ensure },
|
|
7780
|
+
onEventEmit: (e, t) => C.emit(e, t),
|
|
7771
7781
|
...Ui === void 0 ? {} : { outbox: { nudge: Ui.nudge } },
|
|
7772
7782
|
...or.active ? { connections: { registry: or.registry } } : {},
|
|
7773
7783
|
eventBus: Pi.bus
|
|
7774
|
-
}),
|
|
7784
|
+
}), Qo = async () => {
|
|
7775
7785
|
if (Di.length === 0) return;
|
|
7776
7786
|
let e = process.env.HOSTNAME ?? `pid-${process.pid}`, t;
|
|
7777
|
-
fa ? t =
|
|
7787
|
+
fa ? t = ns : oa === "cluster" ? (Z.warn("scheduling.coordination=cluster needs store=postgres — falling back to single (dev/memory)"), t = ns) : oa === "advisoryLock" ? B === "memory" ? (Z.warn("scheduling.coordination=advisoryLock needs a SQL store (the claim-row gate) — falling back to single (memory)"), t = ns) : t = Xa(R, e, {
|
|
7778
7788
|
info: (e, t) => Z.info(e, t ?? {}),
|
|
7779
7789
|
warn: (e, t) => Z.warn(e, t ?? {})
|
|
7780
|
-
}) : t =
|
|
7781
|
-
let n = Hf(
|
|
7782
|
-
ra = await
|
|
7790
|
+
}) : t = ns;
|
|
7791
|
+
let n = Hf(A?.plugins ?? [], ys);
|
|
7792
|
+
ra = await as(Di, {
|
|
7783
7793
|
store: R,
|
|
7784
7794
|
coordinator: t,
|
|
7785
7795
|
defaultTrigger: aa,
|
|
7786
7796
|
replicaId: e,
|
|
7787
7797
|
armSelf: !fa,
|
|
7788
|
-
dormancy:
|
|
7789
|
-
buildContext: ({ traceId: e, scheduleName: t, subject: n }) =>
|
|
7798
|
+
dormancy: A?.dormancy ?? "always-on",
|
|
7799
|
+
buildContext: ({ traceId: e, scheduleName: t, subject: n }) => Zo({
|
|
7790
7800
|
subject: n,
|
|
7791
7801
|
traceId: e
|
|
7792
7802
|
}, R, void 0, `schedule:${t}`),
|
|
@@ -7796,7 +7806,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7796
7806
|
error: (e, t) => Z.error(e, t ?? {}),
|
|
7797
7807
|
debug: (e, t) => Z.debug(e, t ?? {})
|
|
7798
7808
|
},
|
|
7799
|
-
onRunEvent: (e, t) =>
|
|
7809
|
+
onRunEvent: (e, t) => C.emit("scheduleRuns", {
|
|
7800
7810
|
op: e,
|
|
7801
7811
|
row: t
|
|
7802
7812
|
}),
|
|
@@ -7805,32 +7815,32 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7805
7815
|
schedules: Di.length,
|
|
7806
7816
|
coordination: fa ? "cluster" : t.kind,
|
|
7807
7817
|
clusterCrons: _a.length
|
|
7808
|
-
}),
|
|
7809
|
-
},
|
|
7810
|
-
|
|
7818
|
+
}), W(() => ra?.shutdown());
|
|
7819
|
+
}, q = {}, ts = /* @__PURE__ */ new Set(), rs = (e, t) => {
|
|
7820
|
+
Ba(e, st, t) && (ts.has(e.table) || (ts.add(e.table), Z.warn("tenant-scoped read with an EMPTY tenant — every row is filtered out", {
|
|
7811
7821
|
table: e.table,
|
|
7812
7822
|
tenantId: "",
|
|
7813
7823
|
cause: "the subject authenticated but has no resolved org (tenantId=''), so the auto-merged `eq('tenantId', '')` matches no real row — this is NOT 'no such row'",
|
|
7814
7824
|
fix: "resolve the subject to an active org before the read, or mark the query `.unscoped()` if it is deliberately cross-tenant"
|
|
7815
7825
|
})));
|
|
7816
|
-
},
|
|
7817
|
-
|
|
7826
|
+
}, ss = !1, cs = (e) => {
|
|
7827
|
+
ss || !Ua(e) || (ss = !0, Z.warn("authenticated subject has NO active org (tenantId='') — every tenant-scoped read will be empty", {
|
|
7818
7828
|
subjectType: "user",
|
|
7819
7829
|
cause: "the session resolved a user but no organization/tenant; the empty-string sentinel fails closed",
|
|
7820
7830
|
fix: "resolve the user to an active org during auth, or route org-less users to an onboarding flow"
|
|
7821
7831
|
}));
|
|
7822
|
-
},
|
|
7832
|
+
}, us = /* @__PURE__ */ new Set(), ds = (e) => {
|
|
7823
7833
|
if (e.usingIndex !== void 0 || e.predicate === void 0) return;
|
|
7824
7834
|
let t = /* @__PURE__ */ new Set();
|
|
7825
7835
|
for (let n of Fi(e.predicate)) n.conjunctive && t.add(n.column);
|
|
7826
7836
|
if (t.size === 0 || Ci.anyFieldIndexed(e.table, t)) return;
|
|
7827
7837
|
let n = `${e.table}::${[...t].sort().join(",")}`;
|
|
7828
|
-
|
|
7838
|
+
us.has(n) || (us.add(n), Z.warn("non-indexed predicate — slow at scale", {
|
|
7829
7839
|
table: e.table,
|
|
7830
7840
|
fields: [...t],
|
|
7831
7841
|
hint: "declare `.index()` on a column, add `.index(name, [...fields])` to the table, or annotate the query with `.using('indexName')` if a covering index exists"
|
|
7832
7842
|
}));
|
|
7833
|
-
},
|
|
7843
|
+
}, hs = (e) => {
|
|
7834
7844
|
if (e.usingIndex === void 0) return;
|
|
7835
7845
|
let t = Ci.tables.get(e.table);
|
|
7836
7846
|
if (!t) return;
|
|
@@ -7839,7 +7849,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7839
7849
|
name: n.name,
|
|
7840
7850
|
fields: n.fields
|
|
7841
7851
|
};
|
|
7842
|
-
},
|
|
7852
|
+
}, _s = (e) => JSON.stringify(e, (e, t) => typeof t == "object" && t && !Array.isArray(t) ? Object.fromEntries(Object.entries(t).sort(([e], [t]) => e.localeCompare(t))) : t), vs = (e, t) => {
|
|
7843
7853
|
let n = e.cache;
|
|
7844
7854
|
if (n === void 0) return;
|
|
7845
7855
|
let r = kt(n.ttl);
|
|
@@ -7847,64 +7857,64 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7847
7857
|
ttlMs: r,
|
|
7848
7858
|
swrMs: n.swr === void 0 ? void 0 : kt(n.swr) ?? void 0,
|
|
7849
7859
|
scope: n.scope,
|
|
7850
|
-
baseKey: `q:${e.name}:${
|
|
7860
|
+
baseKey: `q:${e.name}:${_s(t)}`
|
|
7851
7861
|
};
|
|
7852
|
-
},
|
|
7862
|
+
}, ys = Lt(), bs = Ff(A?.plugins ?? [], ys), xs = bs.mutation, Ss = bs.action, Cs = bs.query, ws = Bl(_), Ts = vo({
|
|
7853
7863
|
store: R,
|
|
7854
|
-
defaultDeny:
|
|
7855
|
-
buildContext: (e, t, n) =>
|
|
7856
|
-
runEffect: (e, t) =>
|
|
7857
|
-
...
|
|
7858
|
-
recordMetric: (e) =>
|
|
7864
|
+
defaultDeny: ws,
|
|
7865
|
+
buildContext: (e, t, n) => Zo(e, t, n),
|
|
7866
|
+
runEffect: (e, t) => Uo(e, t),
|
|
7867
|
+
...xs ? { interceptor: xs } : {},
|
|
7868
|
+
recordMetric: (e) => ys.record(e),
|
|
7859
7869
|
undoCapture: mf()
|
|
7860
|
-
}),
|
|
7861
|
-
defaultDeny:
|
|
7862
|
-
buildContext: (e) =>
|
|
7863
|
-
runEffect: (e, t) =>
|
|
7864
|
-
...
|
|
7865
|
-
recordMetric: (e) =>
|
|
7866
|
-
}),
|
|
7867
|
-
tenantScopedTables:
|
|
7868
|
-
softDeleteScopedTables:
|
|
7870
|
+
}), Es = Ya({
|
|
7871
|
+
defaultDeny: ws,
|
|
7872
|
+
buildContext: (e) => Zo(e),
|
|
7873
|
+
runEffect: (e, t) => Uo(e, t),
|
|
7874
|
+
...Ss ? { interceptor: Ss } : {},
|
|
7875
|
+
recordMetric: (e) => ys.record(e)
|
|
7876
|
+
}), Ds = Co({
|
|
7877
|
+
tenantScopedTables: st,
|
|
7878
|
+
softDeleteScopedTables: ct,
|
|
7869
7879
|
observe: {
|
|
7870
7880
|
beforeScope: (e, t) => {
|
|
7871
|
-
|
|
7881
|
+
cs(t), rs(e, t.tenantId);
|
|
7872
7882
|
},
|
|
7873
|
-
afterScope:
|
|
7874
|
-
}
|
|
7875
|
-
}),
|
|
7876
|
-
defaultDeny:
|
|
7877
|
-
buildContext: (e) =>
|
|
7878
|
-
finalize: (e, t) =>
|
|
7879
|
-
provideEffect: (e, t) => e.pipe(F.provide(
|
|
7880
|
-
...
|
|
7881
|
-
},
|
|
7882
|
-
...
|
|
7883
|
-
queryRows: (e, t) => R.query(e).then((n) =>
|
|
7884
|
-
}),
|
|
7885
|
-
...
|
|
7886
|
-
subscribeDescriptor: (e, t, n) =>
|
|
7887
|
-
subscribeComputed: (e, t, n) =>
|
|
7883
|
+
afterScope: ds
|
|
7884
|
+
}
|
|
7885
|
+
}), Ps = {
|
|
7886
|
+
defaultDeny: ws,
|
|
7887
|
+
buildContext: (e) => Zo(e),
|
|
7888
|
+
finalize: (e, t) => Ds(e, t.subject),
|
|
7889
|
+
provideEffect: (e, t) => e.pipe(F.provide(fo(t)), F.provide(zo), F.provide(_t)),
|
|
7890
|
+
...Cs ? { interceptor: Cs } : {}
|
|
7891
|
+
}, Fs = So(Ps), Ls = yo({
|
|
7892
|
+
...Ps,
|
|
7893
|
+
queryRows: (e, t) => R.query(e).then((n) => os(e.table, n, t.subject))
|
|
7894
|
+
}), Rs = To({
|
|
7895
|
+
...Ps,
|
|
7896
|
+
subscribeDescriptor: (e, t, n) => U.subscribe(e, t, n),
|
|
7897
|
+
subscribeComputed: (e, t, n) => U.subscribeComputed(e, t, n)
|
|
7888
7898
|
});
|
|
7889
|
-
for (let e of
|
|
7890
|
-
let
|
|
7891
|
-
for (let e of
|
|
7892
|
-
let t = `mutation.${e.descriptor.name}`, n =
|
|
7893
|
-
|
|
7899
|
+
for (let e of mo) q[e.descriptor.name] = (t) => ha(Fs(e, t), U, `subscription.${e.descriptor.name}`, hs, vs(e.descriptor, t), wo(e, t));
|
|
7900
|
+
let zs = Xc(A?.idempotency, R);
|
|
7901
|
+
for (let e of go) {
|
|
7902
|
+
let t = `mutation.${e.descriptor.name}`, n = _o(e.descriptor.output);
|
|
7903
|
+
q[e.descriptor.name] = (r) => pa(async (t, n) => Ts(e, t, n), r, t, n, zs, Ln(e.descriptor, "mutation"));
|
|
7894
7904
|
}
|
|
7895
|
-
for (let e of
|
|
7896
|
-
let t = `action.${e.descriptor.name}`, n =
|
|
7897
|
-
|
|
7905
|
+
for (let e of bo) {
|
|
7906
|
+
let t = `action.${e.descriptor.name}`, n = _o(e.descriptor.output);
|
|
7907
|
+
q[e.descriptor.name] = (r) => pa(async (t, n) => Es(e, t, n), r, t, n, zs, e.descriptor.error);
|
|
7898
7908
|
}
|
|
7899
|
-
Object.assign(
|
|
7900
|
-
for (let e of
|
|
7909
|
+
Object.assign(q, Pi.handlers);
|
|
7910
|
+
for (let e of xo) {
|
|
7901
7911
|
let t = `stream.${e.descriptor.name}`;
|
|
7902
|
-
|
|
7903
|
-
let r =
|
|
7904
|
-
return F.isEffect(i) ? i.pipe(F.provide(
|
|
7912
|
+
q[e.descriptor.name] = (n) => ma((t) => ps(t, (t) => {
|
|
7913
|
+
let r = Zo(t), i = e.executor(n, r);
|
|
7914
|
+
return F.isEffect(i) ? i.pipe(F.provide(fo(r.store)), F.provide(zo), F.provide(_t)) : typeof i == "object" && i && typeof i.then == "function" ? F.promise(() => i) : i;
|
|
7905
7915
|
}), t);
|
|
7906
7916
|
}
|
|
7907
|
-
|
|
7917
|
+
gt && (q[Un.name] = (e) => ha(Fs({
|
|
7908
7918
|
descriptor: Un,
|
|
7909
7919
|
executor: (e) => {
|
|
7910
7920
|
let t = e.id;
|
|
@@ -7920,7 +7930,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7920
7930
|
projection: void 0
|
|
7921
7931
|
};
|
|
7922
7932
|
}
|
|
7923
|
-
}, e),
|
|
7933
|
+
}, e), U, `subscription.${Un.name}`), q[Gn.name] = (e) => ha(Fs({
|
|
7924
7934
|
descriptor: Gn,
|
|
7925
7935
|
executor: (e) => {
|
|
7926
7936
|
let t = e, n = [...t.tag === void 0 ? [] : [z("tag", t.tag)], ...t.status === void 0 ? [] : [z("status", t.status)]], r = Number.isFinite(t.limit) && t.limit !== void 0 ? Math.min(Math.max(Math.floor(t.limit), 1), 500) : 100;
|
|
@@ -7936,7 +7946,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7936
7946
|
projection: void 0
|
|
7937
7947
|
};
|
|
7938
7948
|
}
|
|
7939
|
-
}, e),
|
|
7949
|
+
}, e), U, `subscription.${Gn.name}`), q[Wn.name] = (e) => ha(Fs({
|
|
7940
7950
|
descriptor: Wn,
|
|
7941
7951
|
executor: (e) => {
|
|
7942
7952
|
let t = e.runId;
|
|
@@ -7952,7 +7962,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7952
7962
|
projection: void 0
|
|
7953
7963
|
};
|
|
7954
7964
|
}
|
|
7955
|
-
}, e),
|
|
7965
|
+
}, e), U, `subscription.${Wn.name}`), q[Hn.name] = (e) => ha(Fs({
|
|
7956
7966
|
descriptor: Hn,
|
|
7957
7967
|
executor: (e) => {
|
|
7958
7968
|
let t = e.runId;
|
|
@@ -7968,7 +7978,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7968
7978
|
projection: void 0
|
|
7969
7979
|
};
|
|
7970
7980
|
}
|
|
7971
|
-
}, e),
|
|
7981
|
+
}, e), U, `subscription.${Hn.name}`), q[zn.name] = (e) => ha(Fs({
|
|
7972
7982
|
descriptor: zn,
|
|
7973
7983
|
executor: (e) => {
|
|
7974
7984
|
let t = e;
|
|
@@ -7984,7 +7994,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
7984
7994
|
projection: void 0
|
|
7985
7995
|
};
|
|
7986
7996
|
}
|
|
7987
|
-
}, e),
|
|
7997
|
+
}, e), U, `subscription.${zn.name}`), q[Bn.name] = (e) => ha(Fs({
|
|
7988
7998
|
descriptor: Bn,
|
|
7989
7999
|
executor: (e) => {
|
|
7990
8000
|
let t = e.eventId;
|
|
@@ -8000,32 +8010,32 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8000
8010
|
projection: void 0
|
|
8001
8011
|
};
|
|
8002
8012
|
}
|
|
8003
|
-
}, e),
|
|
8013
|
+
}, e), U, `subscription.${Bn.name}`), q[Rn.name] = (e) => pa(async (e, t) => {
|
|
8004
8014
|
let n = e;
|
|
8005
|
-
return await Gc(R, t.subject, { executionId: n.executionId }), await V.cancel(n.workflowName, n.executionId), await
|
|
8006
|
-
}, e, `action.${Rn.name}`),
|
|
8015
|
+
return await Gc(R, t.subject, { executionId: n.executionId }), await V.cancel(n.workflowName, n.executionId), await Xs(n.workflowName, n.executionId, "workflow.cancel"), { ok: !0 };
|
|
8016
|
+
}, e, `action.${Rn.name}`), q[Vn.name] = (e) => pa(async (e, t) => {
|
|
8007
8017
|
let n = e;
|
|
8008
8018
|
return await Gc(R, t.subject, { executionId: n.executionId }), await V.resume(n.workflowName, n.executionId), { ok: !0 };
|
|
8009
|
-
}, e, `action.${Vn.name}`),
|
|
8019
|
+
}, e, `action.${Vn.name}`), q[Kn.name] = (e) => pa(async (e, t) => {
|
|
8010
8020
|
let n = e;
|
|
8011
8021
|
return await Gc(R, t.subject, { id: n.id }), V.signal({ id: n.id }, n.signalName, n.payload);
|
|
8012
|
-
}, e, `action.${Kn.name}`),
|
|
8022
|
+
}, e, `action.${Kn.name}`), q[qn.name] = (e) => pa(async (e, t) => {
|
|
8013
8023
|
let n = e;
|
|
8014
8024
|
return await Gc(R, t.subject, { id: n.id }), V.update({ id: n.id }, n.updateName, n.payload, n.timeoutMs === void 0 ? void 0 : { timeoutMs: n.timeoutMs });
|
|
8015
8025
|
}, e, `action.${qn.name}`));
|
|
8016
|
-
for (let e of
|
|
8026
|
+
for (let e of k) q[e.definition.name] = (t) => pa(async (t, n) => {
|
|
8017
8027
|
let r = n;
|
|
8018
|
-
return
|
|
8028
|
+
return jo(V, {
|
|
8019
8029
|
subject: r.subject,
|
|
8020
8030
|
traceId: r.traceId,
|
|
8021
8031
|
source: "workflow-rpc"
|
|
8022
8032
|
}).start(e.definition.name, t);
|
|
8023
8033
|
}, t, `workflow.${e.definition.name}`);
|
|
8024
|
-
let
|
|
8034
|
+
let Bs = (e, t) => Zo({
|
|
8025
8035
|
subject: e.subject,
|
|
8026
8036
|
traceId: e.traceId
|
|
8027
|
-
}, R, void 0, `workflow:${t.workflowName}`, { parentExecutionId: t.executionId }),
|
|
8028
|
-
register: (e, t, n) =>
|
|
8037
|
+
}, R, void 0, `workflow:${t.workflowName}`, { parentExecutionId: t.executionId }), Vs = Wf(A?.plugins ?? [], ys), Hs = Ur, Us = (e, t) => C.emit(e, t), Gs = A?.dormancy === "sleep" ? {
|
|
8038
|
+
register: (e, t, n) => Ko(R, {
|
|
8029
8039
|
tenantId: n ?? Wi,
|
|
8030
8040
|
kind: "workflow",
|
|
8031
8041
|
refId: e,
|
|
@@ -8036,24 +8046,24 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8036
8046
|
kind: "workflow",
|
|
8037
8047
|
refId: e
|
|
8038
8048
|
}).then(() => {})
|
|
8039
|
-
} : void 0,
|
|
8049
|
+
} : void 0, qs = Fr({
|
|
8040
8050
|
store: R,
|
|
8041
|
-
emit:
|
|
8051
|
+
emit: Us,
|
|
8042
8052
|
log: Z,
|
|
8043
|
-
recording: fd(
|
|
8044
|
-
...
|
|
8045
|
-
}),
|
|
8053
|
+
recording: fd(A?.workflows?.recording),
|
|
8054
|
+
...Gs === void 0 ? {} : { wakeups: Gs }
|
|
8055
|
+
}), Js = async (e, t) => {
|
|
8046
8056
|
await Cr({
|
|
8047
8057
|
store: R,
|
|
8048
8058
|
parentExecutionId: e,
|
|
8049
8059
|
parentStatus: t,
|
|
8050
|
-
recorder:
|
|
8051
|
-
emit:
|
|
8060
|
+
recorder: qs,
|
|
8061
|
+
emit: Us,
|
|
8052
8062
|
log: Z,
|
|
8053
8063
|
interruptChild: async (t, n, r) => {
|
|
8054
|
-
let i =
|
|
8064
|
+
let i = k.find((e) => e.definition.name === t);
|
|
8055
8065
|
if (!i) throw Error(`Unknown child workflow: ${t}`);
|
|
8056
|
-
await
|
|
8066
|
+
await J.runPromise(i.definition.interrupt(n)), Z.info("workflow.parentClose.childInterrupted", {
|
|
8057
8067
|
parentExecutionId: e,
|
|
8058
8068
|
childWorkflowName: t,
|
|
8059
8069
|
childExecutionId: n,
|
|
@@ -8061,7 +8071,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8061
8071
|
});
|
|
8062
8072
|
}
|
|
8063
8073
|
});
|
|
8064
|
-
},
|
|
8074
|
+
}, Xs = async (e, t, n) => {
|
|
8065
8075
|
let r = (await R.query({
|
|
8066
8076
|
table: "_voltro_workflow_runs",
|
|
8067
8077
|
order: [],
|
|
@@ -8076,12 +8086,12 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8076
8086
|
cancelled: !0,
|
|
8077
8087
|
completedAt: /* @__PURE__ */ new Date()
|
|
8078
8088
|
});
|
|
8079
|
-
i &&
|
|
8089
|
+
i && C.emit("workflowRuns", {
|
|
8080
8090
|
op: "update",
|
|
8081
|
-
row:
|
|
8091
|
+
row: Hs(i)
|
|
8082
8092
|
});
|
|
8083
8093
|
let a = r.subject?.tenantId ?? void 0;
|
|
8084
|
-
i && await
|
|
8094
|
+
i && await qs.recordEvent({
|
|
8085
8095
|
runId: r.id,
|
|
8086
8096
|
eventType: "run-cancelled",
|
|
8087
8097
|
payload: {
|
|
@@ -8090,8 +8100,8 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8090
8100
|
executionId: t,
|
|
8091
8101
|
...a == null ? {} : { tenantId: a }
|
|
8092
8102
|
}
|
|
8093
|
-
}), i && await
|
|
8094
|
-
},
|
|
8103
|
+
}), i && await Js(t, "cancelled");
|
|
8104
|
+
}, Qs = (e, t, n, r) => {
|
|
8095
8105
|
let i = Ar(t);
|
|
8096
8106
|
return qr({
|
|
8097
8107
|
name: e,
|
|
@@ -8104,35 +8114,35 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8104
8114
|
workflowPatches: i.patches,
|
|
8105
8115
|
parentExecutionId: r?.parentExecutionId ?? null,
|
|
8106
8116
|
parentClosePolicy: r?.parentClosePolicy ?? null,
|
|
8107
|
-
onParentClose: ({ executionId: e, status: t }) =>
|
|
8117
|
+
onParentClose: ({ executionId: e, status: t }) => Js(e, t),
|
|
8108
8118
|
...Yd(t),
|
|
8109
8119
|
onTerminal: async ({ executionId: e }) => {
|
|
8110
|
-
await
|
|
8120
|
+
await lc?.gate.release(e);
|
|
8111
8121
|
},
|
|
8112
|
-
recorder:
|
|
8113
|
-
pluginWorkflowStepLayer:
|
|
8114
|
-
emit:
|
|
8115
|
-
recordRun:
|
|
8122
|
+
recorder: qs,
|
|
8123
|
+
pluginWorkflowStepLayer: Vs,
|
|
8124
|
+
emit: Us,
|
|
8125
|
+
recordRun: Ho,
|
|
8116
8126
|
log: Z
|
|
8117
8127
|
}, n);
|
|
8118
|
-
},
|
|
8119
|
-
...
|
|
8120
|
-
buildContext:
|
|
8128
|
+
}, tc = [
|
|
8129
|
+
...Mo(k, {
|
|
8130
|
+
buildContext: Bs,
|
|
8121
8131
|
resolveStartContext: Ea,
|
|
8122
8132
|
...Da === void 0 ? {} : { resolveAuthority: Da }
|
|
8123
|
-
}, (e, t, n) =>
|
|
8124
|
-
...
|
|
8125
|
-
...
|
|
8126
|
-
],
|
|
8127
|
-
Z.child("workflow").info(`workflow runtime ready — ${
|
|
8128
|
-
let
|
|
8129
|
-
|
|
8130
|
-
let
|
|
8133
|
+
}, (e, t, n) => Qs(e.definition.name, e.definition, t, n)),
|
|
8134
|
+
...Ze,
|
|
8135
|
+
...Wo === void 0 ? [] : [Wo]
|
|
8136
|
+
], nc = tc.length > 0 ? I.mergeAll(...tc) : I.empty;
|
|
8137
|
+
Z.child("workflow").info(`workflow runtime ready — ${tc.length} entity type(s) registered`, { entities: [...k.map((e) => e.definition.name).filter(Boolean), ...Wo === void 0 ? [] : ["voltro.deliverWebhook"]] });
|
|
8138
|
+
let J = $n.make(nc.pipe(I.provideMerge(xa), I.provideMerge(zo), I.provideMerge(_t)));
|
|
8139
|
+
W(() => J.dispose());
|
|
8140
|
+
let ic = await cc({
|
|
8131
8141
|
provider: Dr,
|
|
8132
|
-
crossReplica:
|
|
8142
|
+
crossReplica: Ys(A?.plugins ?? [])?.broadcast?.crossReplica ?? !1,
|
|
8133
8143
|
namespace: Tr,
|
|
8134
8144
|
replicaId: crypto.randomUUID(),
|
|
8135
|
-
pollStorage: () =>
|
|
8145
|
+
pollStorage: () => J.runPromise(Xr),
|
|
8136
8146
|
onChange: (e) => R.onChange((t) => e({
|
|
8137
8147
|
table: t.table,
|
|
8138
8148
|
op: t.op,
|
|
@@ -8140,23 +8150,23 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8140
8150
|
})),
|
|
8141
8151
|
log: Z
|
|
8142
8152
|
});
|
|
8143
|
-
|
|
8144
|
-
let
|
|
8145
|
-
if (
|
|
8146
|
-
if (V !== void 0) return
|
|
8153
|
+
W(() => ic.detach());
|
|
8154
|
+
let oc, sc = () => {
|
|
8155
|
+
if (oc !== void 0) return oc;
|
|
8156
|
+
if (V !== void 0) return oc = Mp({
|
|
8147
8157
|
store: R,
|
|
8148
8158
|
log: Z,
|
|
8149
|
-
workflows:
|
|
8159
|
+
workflows: k,
|
|
8150
8160
|
workflowsProxy: V,
|
|
8151
|
-
workflowRuntime:
|
|
8152
|
-
workflowRunRecorder:
|
|
8153
|
-
closeChildrenForParent:
|
|
8154
|
-
onRunUpdated: (e) =>
|
|
8161
|
+
workflowRuntime: J,
|
|
8162
|
+
workflowRunRecorder: qs,
|
|
8163
|
+
closeChildrenForParent: Js,
|
|
8164
|
+
onRunUpdated: (e) => C.emit("workflowRuns", {
|
|
8155
8165
|
op: "update",
|
|
8156
|
-
row:
|
|
8166
|
+
row: Hs(e)
|
|
8157
8167
|
})
|
|
8158
|
-
}),
|
|
8159
|
-
},
|
|
8168
|
+
}), oc;
|
|
8169
|
+
}, lc = bd({
|
|
8160
8170
|
store: R,
|
|
8161
8171
|
onChange: (e) => R.onChange((t) => e({
|
|
8162
8172
|
table: t.table,
|
|
@@ -8166,16 +8176,16 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8166
8176
|
drainIntervalMs: yr.admissionDrainMs,
|
|
8167
8177
|
cancelSweepIntervalMs: yr.cancelSweepMs,
|
|
8168
8178
|
stalenessSweepIntervalMs: yr.stalenessSweepMs,
|
|
8169
|
-
workflows:
|
|
8179
|
+
workflows: k,
|
|
8170
8180
|
facade: () => Sa,
|
|
8171
|
-
cancelRunWithReason:
|
|
8172
|
-
recordRunEvent: () =>
|
|
8173
|
-
...
|
|
8174
|
-
...
|
|
8181
|
+
cancelRunWithReason: sc,
|
|
8182
|
+
recordRunEvent: () => qs.recordEvent,
|
|
8183
|
+
...A?.workflows?.staleness === void 0 ? {} : { staleness: A.workflows.staleness },
|
|
8184
|
+
...A?.workflows?.suspendSignalHintMs === void 0 ? {} : { suspendSignalHintMs: A.workflows.suspendSignalHintMs },
|
|
8175
8185
|
scheduleCoordinated: br,
|
|
8176
8186
|
onAbandoned: async (e) => {
|
|
8177
8187
|
await Zd({
|
|
8178
|
-
workflows:
|
|
8188
|
+
workflows: k,
|
|
8179
8189
|
facade: () => Sa,
|
|
8180
8190
|
log: Z,
|
|
8181
8191
|
...e
|
|
@@ -8183,8 +8193,8 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8183
8193
|
},
|
|
8184
8194
|
log: Z
|
|
8185
8195
|
});
|
|
8186
|
-
|
|
8187
|
-
let
|
|
8196
|
+
lc !== void 0 && W(() => lc.stop());
|
|
8197
|
+
let fc = Wd({
|
|
8188
8198
|
store: R,
|
|
8189
8199
|
onChange: (e) => R.onChange((t) => e({
|
|
8190
8200
|
table: t.table,
|
|
@@ -8192,38 +8202,38 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8192
8202
|
})),
|
|
8193
8203
|
disarmWhenIdle: Pr,
|
|
8194
8204
|
tickIntervalMs: yr.inferenceTickMs,
|
|
8195
|
-
enabled:
|
|
8205
|
+
enabled: k.length > 0,
|
|
8196
8206
|
resumeSignal: () => async ({ executionId: e, workflowName: t, signalName: n, payload: r }) => {
|
|
8197
|
-
await
|
|
8207
|
+
await J.runPromise(wr({
|
|
8198
8208
|
store: R,
|
|
8199
8209
|
target: Hd(e, t),
|
|
8200
8210
|
signalName: n,
|
|
8201
8211
|
payload: r
|
|
8202
8212
|
}));
|
|
8203
8213
|
},
|
|
8204
|
-
runEffect: (e) =>
|
|
8214
|
+
runEffect: (e) => J.runPromise(e),
|
|
8205
8215
|
scheduleCoordinated: br,
|
|
8206
8216
|
log: Z
|
|
8207
8217
|
});
|
|
8208
|
-
|
|
8209
|
-
workflows:
|
|
8210
|
-
runEffect: (e) =>
|
|
8211
|
-
onEnqueue: () =>
|
|
8212
|
-
...
|
|
8213
|
-
admitStart:
|
|
8214
|
-
startPayloadSchema:
|
|
8215
|
-
parkDelayedStart:
|
|
8218
|
+
fc !== void 0 && W(() => fc.stop()), Sa = k.length > 0 ? Ao({
|
|
8219
|
+
workflows: k,
|
|
8220
|
+
runEffect: (e) => J.runPromise(e),
|
|
8221
|
+
onEnqueue: () => ic.publishWake(),
|
|
8222
|
+
...lc === void 0 ? {} : {
|
|
8223
|
+
admitStart: lc.gate.admitStart,
|
|
8224
|
+
startPayloadSchema: lc.gate.startPayloadSchema,
|
|
8225
|
+
parkDelayedStart: lc.gate.parkDelayed
|
|
8216
8226
|
},
|
|
8217
8227
|
rememberStartContext: Ta,
|
|
8218
8228
|
signal: async (e, t, n) => {
|
|
8219
8229
|
let r = await Vr({
|
|
8220
8230
|
store: R,
|
|
8221
|
-
recorder:
|
|
8231
|
+
recorder: qs,
|
|
8222
8232
|
target: e,
|
|
8223
8233
|
signalName: t,
|
|
8224
8234
|
payload: n
|
|
8225
8235
|
});
|
|
8226
|
-
return await
|
|
8236
|
+
return await J.runPromise(wr({
|
|
8227
8237
|
store: R,
|
|
8228
8238
|
target: e,
|
|
8229
8239
|
signalName: t,
|
|
@@ -8232,7 +8242,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8232
8242
|
},
|
|
8233
8243
|
update: (e, t, n, r) => Hr({
|
|
8234
8244
|
store: R,
|
|
8235
|
-
recorder:
|
|
8245
|
+
recorder: qs,
|
|
8236
8246
|
target: e,
|
|
8237
8247
|
updateName: t,
|
|
8238
8248
|
payload: n,
|
|
@@ -8241,51 +8251,51 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8241
8251
|
listRuns: (e) => Xf(R, e),
|
|
8242
8252
|
retry: (e, t) => Zf({
|
|
8243
8253
|
store: R,
|
|
8244
|
-
workflows:
|
|
8245
|
-
runPromise: (e) =>
|
|
8254
|
+
workflows: k,
|
|
8255
|
+
runPromise: (e) => J.runPromise(e)
|
|
8246
8256
|
}, e, t),
|
|
8247
8257
|
redrive: (e) => $f({
|
|
8248
8258
|
store: R,
|
|
8249
|
-
workflows:
|
|
8250
|
-
runRedrive: (e) =>
|
|
8259
|
+
workflows: k,
|
|
8260
|
+
runRedrive: (e) => J.runPromise(Zr(e))
|
|
8251
8261
|
}, e).then((e) => e.outcome)
|
|
8252
8262
|
}) : void 0;
|
|
8253
|
-
let
|
|
8254
|
-
if (
|
|
8263
|
+
let pc = I.mergeAll(Oo.toLayer(q), Bt), mc = Yc(q, T.map((e) => e.descriptor.name), gt), hc = I.mergeAll(Oo.toLayer(mc), Bt), Y = B, _c = (Y === "postgres" || Y === "mysql" || Y === "mariadb" || Y === "mssql") && (process.env.CDC ?? "1") !== "0";
|
|
8264
|
+
if (Y === "postgres" && im()) {
|
|
8255
8265
|
let e = lm({
|
|
8256
8266
|
store: R,
|
|
8257
8267
|
log: Z
|
|
8258
8268
|
});
|
|
8259
|
-
Yn = e.persistTraceSpan,
|
|
8269
|
+
Yn = e.persistTraceSpan, W(e.stop);
|
|
8260
8270
|
}
|
|
8261
|
-
let
|
|
8271
|
+
let vc = Lc({
|
|
8262
8272
|
store: R,
|
|
8263
|
-
dialect:
|
|
8273
|
+
dialect: Y,
|
|
8264
8274
|
log: { info: (e) => Z.info(e) }
|
|
8265
8275
|
});
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
}),
|
|
8276
|
+
W(() => {
|
|
8277
|
+
vc.stop();
|
|
8278
|
+
}), ac({
|
|
8269
8279
|
log: Z,
|
|
8270
|
-
max:
|
|
8271
|
-
outOfPool:
|
|
8280
|
+
max: ie(),
|
|
8281
|
+
outOfPool: rc(Y, _c),
|
|
8272
8282
|
readPools: t.replicationSnapshot()?.replicaCount ?? 0,
|
|
8273
8283
|
always: !1
|
|
8274
8284
|
});
|
|
8275
|
-
let
|
|
8276
|
-
queries:
|
|
8277
|
-
mutations:
|
|
8278
|
-
actions:
|
|
8279
|
-
streams:
|
|
8280
|
-
workflows:
|
|
8281
|
-
}, n),
|
|
8282
|
-
queries:
|
|
8283
|
-
mutations:
|
|
8284
|
-
actions:
|
|
8285
|
-
streams:
|
|
8286
|
-
workflows:
|
|
8285
|
+
let yc = uc({
|
|
8286
|
+
queries: T,
|
|
8287
|
+
mutations: E,
|
|
8288
|
+
actions: D,
|
|
8289
|
+
streams: Ke,
|
|
8290
|
+
workflows: k
|
|
8291
|
+
}, n), bc = dc({
|
|
8292
|
+
queries: T,
|
|
8293
|
+
mutations: E,
|
|
8294
|
+
actions: D,
|
|
8295
|
+
streams: Ke,
|
|
8296
|
+
workflows: k
|
|
8287
8297
|
}, n);
|
|
8288
|
-
Wt.writeFile(N(n, "app.manifest.generated.json"), `${JSON.stringify(
|
|
8298
|
+
Wt.writeFile(N(n, "app.manifest.generated.json"), `${JSON.stringify(ft(yc, bc, [], A?.plugins ?? []), null, 2)}\n`, "utf8").catch(() => {}), (async () => {
|
|
8289
8299
|
let e = N(n, ".gitignore"), t = "";
|
|
8290
8300
|
try {
|
|
8291
8301
|
t = await Wt.readFile(e, "utf8");
|
|
@@ -8293,18 +8303,18 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8293
8303
|
let r = t.split("\n").filter((e) => e.trim() !== "");
|
|
8294
8304
|
r.includes("app.manifest.generated.json") || (r.push("app.manifest.generated.json"), await Wt.writeFile(e, `${r.join("\n")}\n`, "utf8"));
|
|
8295
8305
|
})().catch(() => {}), Oa();
|
|
8296
|
-
let
|
|
8306
|
+
let Sc = N(n, "app.graph.observed.generated.json");
|
|
8297
8307
|
Wt.rm(N(n, "app.graph.observed.json"), { force: !0 }).catch(() => {});
|
|
8298
|
-
let
|
|
8299
|
-
|
|
8300
|
-
let
|
|
8308
|
+
let Cc = xc(n);
|
|
8309
|
+
Cc.warning === void 0 ? Cc.adopted.length > 0 && Z.debug("handed generated output to the workspace owner", { paths: Cc.adopted.join(", ") }) : Z.warn(Cc.warning);
|
|
8310
|
+
let wc = async () => {
|
|
8301
8311
|
try {
|
|
8302
|
-
await Wt.writeFile(
|
|
8312
|
+
await Wt.writeFile(Sc, `${JSON.stringify(Lo(), null, 2)}\n`, "utf8");
|
|
8303
8313
|
} catch {}
|
|
8304
8314
|
};
|
|
8305
8315
|
setInterval(() => {
|
|
8306
|
-
|
|
8307
|
-
}, 1e4).unref(),
|
|
8316
|
+
wc();
|
|
8317
|
+
}, 1e4).unref(), W(() => wc()), (async () => {
|
|
8308
8318
|
let e = N(n, ".gitignore"), t = "";
|
|
8309
8319
|
try {
|
|
8310
8320
|
t = await Wt.readFile(e, "utf8");
|
|
@@ -8312,8 +8322,8 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8312
8322
|
let r = t.split("\n").filter((e) => e.trim() !== "");
|
|
8313
8323
|
r.includes("app.graph.observed.generated.json") || (r.push("app.graph.observed.generated.json"), await Wt.writeFile(e, `${r.join("\n")}\n`, "utf8"));
|
|
8314
8324
|
})().catch(() => {});
|
|
8315
|
-
let
|
|
8316
|
-
for (let e of
|
|
8325
|
+
let Ec = /* @__PURE__ */ new Map();
|
|
8326
|
+
for (let e of go) Ec.set(e.descriptor.name, async (t, n) => {
|
|
8317
8327
|
let r = {
|
|
8318
8328
|
subject: (await Rt({
|
|
8319
8329
|
headers: n,
|
|
@@ -8328,7 +8338,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8328
8338
|
traceId: r.traceId,
|
|
8329
8339
|
subjectId: ta(r.subject),
|
|
8330
8340
|
procedure: e.descriptor.name
|
|
8331
|
-
}, () =>
|
|
8341
|
+
}, () => Ts(e, t, r))
|
|
8332
8342
|
};
|
|
8333
8343
|
} catch (t) {
|
|
8334
8344
|
let n = Nh(t);
|
|
@@ -8341,7 +8351,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8341
8351
|
};
|
|
8342
8352
|
}
|
|
8343
8353
|
});
|
|
8344
|
-
for (let e of
|
|
8354
|
+
for (let e of bo) Ec.set(e.descriptor.name, async (t, n) => {
|
|
8345
8355
|
let r = {
|
|
8346
8356
|
subject: (await Rt({
|
|
8347
8357
|
headers: n,
|
|
@@ -8356,7 +8366,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8356
8366
|
traceId: r.traceId,
|
|
8357
8367
|
subjectId: ta(r.subject),
|
|
8358
8368
|
procedure: e.descriptor.name
|
|
8359
|
-
}, () =>
|
|
8369
|
+
}, () => Es(e, t, r))
|
|
8360
8370
|
};
|
|
8361
8371
|
} catch (t) {
|
|
8362
8372
|
let n = Nh(t);
|
|
@@ -8369,23 +8379,23 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8369
8379
|
};
|
|
8370
8380
|
}
|
|
8371
8381
|
});
|
|
8372
|
-
let
|
|
8382
|
+
let Dc = {
|
|
8373
8383
|
candidates: eu({
|
|
8374
|
-
queries:
|
|
8375
|
-
mutations:
|
|
8376
|
-
actions:
|
|
8384
|
+
queries: mo,
|
|
8385
|
+
mutations: go,
|
|
8386
|
+
actions: bo,
|
|
8377
8387
|
descriptorOf: (e) => e.descriptor,
|
|
8378
|
-
runQuery: (e, t, n) => Promise.resolve(
|
|
8379
|
-
runMutation: (e, t, n) =>
|
|
8380
|
-
runAction: (e, t, n) =>
|
|
8388
|
+
runQuery: (e, t, n) => Promise.resolve(Ls(e, t, n)),
|
|
8389
|
+
runMutation: (e, t, n) => Ts(e, t, n),
|
|
8390
|
+
runAction: (e, t, n) => Es(e, t, n)
|
|
8381
8391
|
}),
|
|
8382
|
-
policy:
|
|
8383
|
-
mcpEnabled:
|
|
8392
|
+
policy: A?.agents?.tools ?? {},
|
|
8393
|
+
mcpEnabled: A?.agents?.mcp === !0,
|
|
8384
8394
|
resolveSubject: async (e) => (await Rt({
|
|
8385
8395
|
headers: e,
|
|
8386
8396
|
clientId: -1
|
|
8387
8397
|
})).subject
|
|
8388
|
-
},
|
|
8398
|
+
}, jc = () => ({
|
|
8389
8399
|
dialect: B,
|
|
8390
8400
|
replication: t.replicationSnapshot() ?? {
|
|
8391
8401
|
replicaCount: 0,
|
|
@@ -8417,11 +8427,11 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8417
8427
|
...e.lastRunRowsTouched === void 0 ? {} : { lastRunRowsTouched: e.lastRunRowsTouched },
|
|
8418
8428
|
...e.lastError ? { lastError: e.lastError } : {}
|
|
8419
8429
|
}))
|
|
8420
|
-
}),
|
|
8430
|
+
}), Mc = async () => cf({
|
|
8421
8431
|
sqlLayer: yi,
|
|
8422
8432
|
declared: P,
|
|
8423
8433
|
log: Z
|
|
8424
|
-
}),
|
|
8434
|
+
}), Nc = async (e) => {
|
|
8425
8435
|
let t = await R.query({
|
|
8426
8436
|
table: "_voltro_workflow_runs",
|
|
8427
8437
|
order: [],
|
|
@@ -8430,17 +8440,17 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8430
8440
|
skip: void 0,
|
|
8431
8441
|
take: 1
|
|
8432
8442
|
});
|
|
8433
|
-
t[0] &&
|
|
8443
|
+
t[0] && C.emit("workflowRuns", {
|
|
8434
8444
|
op: "update",
|
|
8435
|
-
row:
|
|
8445
|
+
row: Hs(t[0])
|
|
8436
8446
|
});
|
|
8437
|
-
},
|
|
8447
|
+
}, Ic = async (e) => {
|
|
8438
8448
|
let t = await $f({
|
|
8439
8449
|
store: R,
|
|
8440
|
-
workflows:
|
|
8441
|
-
runRedrive: (e) =>
|
|
8450
|
+
workflows: k,
|
|
8451
|
+
runRedrive: (e) => J.runPromise(Zr(e))
|
|
8442
8452
|
}, e.runId);
|
|
8443
|
-
return t.statusReset && (await
|
|
8453
|
+
return t.statusReset && (await Nc(e.runId), await qs.recordEvent({
|
|
8444
8454
|
runId: e.runId,
|
|
8445
8455
|
eventType: "run-redriven",
|
|
8446
8456
|
payload: {
|
|
@@ -8457,53 +8467,53 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8457
8467
|
activitiesReset: t.outcome.activitiesReset,
|
|
8458
8468
|
reason: t.outcome.reason
|
|
8459
8469
|
};
|
|
8460
|
-
},
|
|
8461
|
-
dialect:
|
|
8470
|
+
}, Rc = ui({
|
|
8471
|
+
dialect: Y,
|
|
8462
8472
|
...Q()
|
|
8463
|
-
}),
|
|
8473
|
+
}), zc = {
|
|
8464
8474
|
kind: "api",
|
|
8465
8475
|
meta: {
|
|
8466
|
-
name:
|
|
8476
|
+
name: A?.name ?? M(n),
|
|
8467
8477
|
voltroVersion: Eh,
|
|
8468
|
-
port:
|
|
8478
|
+
port: S,
|
|
8469
8479
|
mode: "dev",
|
|
8470
|
-
store:
|
|
8471
|
-
cdc:
|
|
8472
|
-
...
|
|
8480
|
+
store: Y,
|
|
8481
|
+
cdc: _c ? "on" : "off",
|
|
8482
|
+
...Rc === void 0 ? {} : { databaseId: Rc }
|
|
8473
8483
|
},
|
|
8474
|
-
rpc:
|
|
8475
|
-
workflows:
|
|
8476
|
-
metrics: (e) =>
|
|
8484
|
+
rpc: yc,
|
|
8485
|
+
workflows: bc,
|
|
8486
|
+
metrics: (e) => ys.snapshot(e),
|
|
8477
8487
|
dataCache: () => Um({
|
|
8478
8488
|
stats: Kr,
|
|
8479
8489
|
backendKind: Gr
|
|
8480
8490
|
}),
|
|
8481
|
-
invokers:
|
|
8482
|
-
agentTools: () =>
|
|
8491
|
+
invokers: Ec,
|
|
8492
|
+
agentTools: () => Dc,
|
|
8483
8493
|
invariantChecks: () => ({
|
|
8484
8494
|
mode: "dev",
|
|
8485
|
-
accessGate:
|
|
8486
|
-
config:
|
|
8487
|
-
...
|
|
8488
|
-
serverOnlyLeaks:
|
|
8489
|
-
migrations:
|
|
8495
|
+
accessGate: mt,
|
|
8496
|
+
config: A,
|
|
8497
|
+
...Me ? { rpcGroupFile: Me } : {},
|
|
8498
|
+
serverOnlyLeaks: lt,
|
|
8499
|
+
migrations: Mc
|
|
8490
8500
|
}),
|
|
8491
8501
|
plugins: () => ({
|
|
8492
8502
|
plugins: Kt.snapshot(),
|
|
8493
8503
|
capturedAt: Date.now()
|
|
8494
8504
|
}),
|
|
8495
|
-
env: () => te(
|
|
8496
|
-
contract:
|
|
8497
|
-
plugins:
|
|
8505
|
+
env: () => te(A?.name ?? M(n), {
|
|
8506
|
+
contract: gs(A?.env) ? A.env : void 0,
|
|
8507
|
+
plugins: A?.plugins ?? []
|
|
8498
8508
|
}),
|
|
8499
|
-
subscriptions: () => Wm(() =>
|
|
8509
|
+
subscriptions: () => Wm(() => U),
|
|
8500
8510
|
events: hm(Pi.bus, Pi.declared),
|
|
8501
8511
|
members: () => ({
|
|
8502
8512
|
members: Or.membership.list(),
|
|
8503
8513
|
capturedAt: Date.now()
|
|
8504
8514
|
}),
|
|
8505
|
-
database:
|
|
8506
|
-
migrations: async () =>
|
|
8515
|
+
database: jc,
|
|
8516
|
+
migrations: async () => Mc(),
|
|
8507
8517
|
inspectTables: () => kp(P),
|
|
8508
8518
|
inspectRows: Ap({
|
|
8509
8519
|
store: R,
|
|
@@ -8540,62 +8550,66 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8540
8550
|
}), { deleted: t };
|
|
8541
8551
|
},
|
|
8542
8552
|
inspectImport: async (e) => {
|
|
8543
|
-
let t = await F.runPromise(
|
|
8553
|
+
let t = await F.runPromise(Zs({
|
|
8544
8554
|
store: R,
|
|
8545
8555
|
bundleDir: e.bundleDir,
|
|
8546
8556
|
...e.mode ? { mode: e.mode } : {},
|
|
8547
8557
|
...e.onConflict ? { onConflict: e.onConflict } : {},
|
|
8548
8558
|
...e.atomic === void 0 ? {} : { atomic: e.atomic }
|
|
8549
|
-
})), n = t.
|
|
8559
|
+
})), n = t.rowsWritten;
|
|
8550
8560
|
return Z.info("inspect.data.import", {
|
|
8551
8561
|
bundleDir: e.bundleDir,
|
|
8552
|
-
tables: t.
|
|
8562
|
+
tables: t.tablesWritten,
|
|
8553
8563
|
rows: n,
|
|
8554
|
-
mode: e.mode ?? "upsert"
|
|
8564
|
+
mode: e.mode ?? "upsert",
|
|
8565
|
+
...t.tablesSkipped > 0 ? {
|
|
8566
|
+
skippedTables: t.tablesSkipped,
|
|
8567
|
+
skippedRows: t.rowsSkipped
|
|
8568
|
+
} : {}
|
|
8555
8569
|
}), {
|
|
8556
|
-
tables: t.
|
|
8570
|
+
tables: t.tablesWritten,
|
|
8557
8571
|
rows: n
|
|
8558
8572
|
};
|
|
8559
8573
|
},
|
|
8560
|
-
...
|
|
8574
|
+
...gt ? {
|
|
8561
8575
|
...Hm(R, {
|
|
8562
|
-
controls: _d(
|
|
8563
|
-
active:
|
|
8564
|
-
cancellation: () =>
|
|
8576
|
+
controls: _d(k),
|
|
8577
|
+
active: k.length > 0,
|
|
8578
|
+
cancellation: () => lc?.cancelHealth()
|
|
8565
8579
|
}),
|
|
8566
8580
|
...Np({
|
|
8567
8581
|
store: R,
|
|
8568
8582
|
log: Z,
|
|
8569
|
-
workflows:
|
|
8583
|
+
workflows: k,
|
|
8570
8584
|
workflowsProxy: V,
|
|
8571
|
-
workflowRuntime:
|
|
8572
|
-
workflowRunRecorder:
|
|
8573
|
-
closeChildrenForParent:
|
|
8574
|
-
onRunUpdated: (e) =>
|
|
8585
|
+
workflowRuntime: J,
|
|
8586
|
+
workflowRunRecorder: qs,
|
|
8587
|
+
closeChildrenForParent: Js,
|
|
8588
|
+
onRunUpdated: (e) => C.emit("workflowRuns", {
|
|
8575
8589
|
op: "update",
|
|
8576
|
-
row:
|
|
8590
|
+
row: Hs(e)
|
|
8577
8591
|
})
|
|
8578
8592
|
}),
|
|
8579
8593
|
inspectInferences: async (e) => Bd({
|
|
8580
8594
|
store: R,
|
|
8581
|
-
active:
|
|
8582
|
-
dispatcher: () =>
|
|
8595
|
+
active: k.length > 0,
|
|
8596
|
+
dispatcher: () => fc?.health()
|
|
8583
8597
|
}, e.limit === void 0 ? {} : { limit: e.limit }),
|
|
8584
8598
|
...Pd({
|
|
8585
8599
|
store: R,
|
|
8586
|
-
cancelRun: async (e) => await
|
|
8600
|
+
cancelRun: async (e) => await sc()?.(e) ?? !1,
|
|
8587
8601
|
retryRun: async (e) => V?.retry(e),
|
|
8588
|
-
redriveRun: async (e) =>
|
|
8602
|
+
redriveRun: async (e) => Ic({ runId: e }),
|
|
8589
8603
|
log: Z
|
|
8590
8604
|
}),
|
|
8591
|
-
inspectRedriveWorkflowRun:
|
|
8605
|
+
inspectRedriveWorkflowRun: Ic,
|
|
8592
8606
|
inspectResumeWorkflowRunFromStep: async (e) => {
|
|
8593
8607
|
let t = await ep({
|
|
8594
8608
|
store: R,
|
|
8595
|
-
workflows:
|
|
8596
|
-
runResume: (e) =>
|
|
8609
|
+
workflows: k,
|
|
8610
|
+
runResume: (e) => J.runPromise(ei(e))
|
|
8597
8611
|
}, e.runId, e.step);
|
|
8598
|
-
return t.statusReset && (await
|
|
8612
|
+
return t.statusReset && (await Nc(e.runId), await qs.recordEvent({
|
|
8599
8613
|
runId: e.runId,
|
|
8600
8614
|
eventType: "run-redriven",
|
|
8601
8615
|
payload: {
|
|
@@ -8640,54 +8654,54 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8640
8654
|
scheduleCoordChoice: oa
|
|
8641
8655
|
}),
|
|
8642
8656
|
runSeed: async (e) => {
|
|
8643
|
-
let n = await
|
|
8644
|
-
return t.recordSeedResult(n),
|
|
8657
|
+
let n = await ce(Ti.seeds, e, R, wi);
|
|
8658
|
+
return t.recordSeedResult(n), jc();
|
|
8645
8659
|
},
|
|
8646
|
-
rollbackMigration: async (e) => (wi.warn("rollbackMigration called but only memory store is wired — no-op"),
|
|
8660
|
+
rollbackMigration: async (e) => (wi.warn("rollbackMigration called but only memory store is wired — no-op"), jc()),
|
|
8647
8661
|
webhooks: () => xm({
|
|
8648
8662
|
store: R,
|
|
8649
|
-
discoveredWebhooks:
|
|
8663
|
+
discoveredWebhooks: H
|
|
8650
8664
|
}),
|
|
8651
8665
|
...Ii === void 0 ? {} : { webhookActions: Gm(() => Ii) }
|
|
8652
8666
|
}, Vc = np({
|
|
8653
|
-
plugins:
|
|
8654
|
-
metrics:
|
|
8667
|
+
plugins: A?.plugins ?? [],
|
|
8668
|
+
metrics: ys,
|
|
8655
8669
|
log: Z
|
|
8656
|
-
}), Hc = (
|
|
8657
|
-
...
|
|
8670
|
+
}), Hc = (A?.plugins ?? []).flatMap((e) => e.httpRoutes ?? []), Jc = typeof yt == "object" ? yt.managementPath : void 0, X = () => `public-${Math.random().toString(36).slice(2, 10)}`, Qc = [
|
|
8671
|
+
...T.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
8658
8672
|
descriptor: e.descriptor,
|
|
8659
|
-
invoke: (t, n) =>
|
|
8673
|
+
invoke: (t, n) => Ls(e, t, {
|
|
8660
8674
|
subject: n.subject,
|
|
8661
8675
|
traceId: X()
|
|
8662
8676
|
}),
|
|
8663
|
-
subscribe: (t, n, r) =>
|
|
8677
|
+
subscribe: (t, n, r) => Rs(e, t, {
|
|
8664
8678
|
subject: n.subject,
|
|
8665
8679
|
traceId: X()
|
|
8666
8680
|
}, r)
|
|
8667
8681
|
})),
|
|
8668
|
-
...
|
|
8682
|
+
...E.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
8669
8683
|
descriptor: e.descriptor,
|
|
8670
|
-
invoke: (t, n) =>
|
|
8684
|
+
invoke: (t, n) => Ts(e, t, {
|
|
8671
8685
|
subject: n.subject,
|
|
8672
8686
|
traceId: X()
|
|
8673
8687
|
})
|
|
8674
8688
|
})),
|
|
8675
|
-
...
|
|
8689
|
+
...D.filter((e) => e.descriptor.publicApi !== void 0).map((e) => ({
|
|
8676
8690
|
descriptor: e.descriptor,
|
|
8677
|
-
invoke: (t, n) =>
|
|
8691
|
+
invoke: (t, n) => Es(e, t, {
|
|
8678
8692
|
subject: n.subject,
|
|
8679
8693
|
traceId: X()
|
|
8680
8694
|
})
|
|
8681
8695
|
}))
|
|
8682
8696
|
], $c = Zc({
|
|
8683
|
-
restRoutes: [...
|
|
8697
|
+
restRoutes: [...A?.restRoutes ?? [], ...xt ? na(xt, Jc ?? "/v1/api-keys") : []],
|
|
8684
8698
|
publicApiEntries: Qc,
|
|
8685
8699
|
store: R,
|
|
8686
8700
|
resolveSubject: async (e) => (await Rt({
|
|
8687
8701
|
headers: e,
|
|
8688
8702
|
clientId: -1
|
|
8689
8703
|
})).subject,
|
|
8690
|
-
...
|
|
8704
|
+
...zs === void 0 ? {} : { idempotency: zs },
|
|
8691
8705
|
log: Z
|
|
8692
8706
|
}).httpRoutes, el = [
|
|
8693
8707
|
...Hc,
|
|
@@ -8695,31 +8709,31 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8695
8709
|
...or.httpRoutes
|
|
8696
8710
|
];
|
|
8697
8711
|
try {
|
|
8698
|
-
await ee(
|
|
8712
|
+
await ee(S, "voltro dev (api)");
|
|
8699
8713
|
} catch (e) {
|
|
8700
8714
|
Z.error(String(e.message ?? e)), process.exit(1);
|
|
8701
8715
|
}
|
|
8702
|
-
let { server: tl } =
|
|
8703
|
-
group:
|
|
8704
|
-
handlersLayer:
|
|
8705
|
-
httpHandlersLayer:
|
|
8706
|
-
port:
|
|
8707
|
-
path:
|
|
8708
|
-
security: iu(
|
|
8716
|
+
let { server: tl } = is({
|
|
8717
|
+
group: Oo,
|
|
8718
|
+
handlersLayer: pc,
|
|
8719
|
+
httpHandlersLayer: hc,
|
|
8720
|
+
port: S,
|
|
8721
|
+
path: A?.transport?.wsPath ?? "/ws",
|
|
8722
|
+
security: iu(A),
|
|
8709
8723
|
...Vc,
|
|
8710
8724
|
...el.length > 0 ? { httpRoutes: el } : {},
|
|
8711
8725
|
getStore: () => vt.current,
|
|
8712
8726
|
inspectRoute: { handle: async (e, t, n, r) => {
|
|
8713
|
-
let i =
|
|
8727
|
+
let i = Ye(t.host, O(t.origin));
|
|
8714
8728
|
if (i) return i;
|
|
8715
8729
|
if (n !== "OPTIONS") {
|
|
8716
|
-
if (
|
|
8730
|
+
if (qe()) return {
|
|
8717
8731
|
status: 503,
|
|
8718
8732
|
contentType: "application/json",
|
|
8719
8733
|
body: JSON.stringify({ error: "inspect disabled (VOLTRO_INSPECT=off)" }),
|
|
8720
|
-
headers:
|
|
8734
|
+
headers: O(t.origin)
|
|
8721
8735
|
};
|
|
8722
|
-
let e =
|
|
8736
|
+
let e = et(t, n);
|
|
8723
8737
|
if (!e.ok) return {
|
|
8724
8738
|
status: 401,
|
|
8725
8739
|
contentType: "application/json",
|
|
@@ -8727,7 +8741,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8727
8741
|
error: "unauthorized",
|
|
8728
8742
|
reason: e.reason
|
|
8729
8743
|
}),
|
|
8730
|
-
headers:
|
|
8744
|
+
headers: O(t.origin)
|
|
8731
8745
|
};
|
|
8732
8746
|
}
|
|
8733
8747
|
if (n === "GET" && e === "/_voltro/inspect/plugins/dashboard-mounts") return {
|
|
@@ -8737,43 +8751,43 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8737
8751
|
mounts: Yt,
|
|
8738
8752
|
capturedAt: Date.now()
|
|
8739
8753
|
}),
|
|
8740
|
-
headers:
|
|
8754
|
+
headers: O(t.origin)
|
|
8741
8755
|
};
|
|
8742
|
-
if (n === "POST" && (e === "/_voltro/inspect/invoke" || e.startsWith("/_voltro/inspect/invoke?"))) return
|
|
8743
|
-
let a = await km(e,
|
|
8756
|
+
if (n === "POST" && (e === "/_voltro/inspect/invoke" || e.startsWith("/_voltro/inspect/invoke?"))) return dt(zc, t, r ?? "", { method: n });
|
|
8757
|
+
let a = await km(e, zc, t, {
|
|
8744
8758
|
method: n,
|
|
8745
8759
|
...r === void 0 ? {} : { body: r }
|
|
8746
8760
|
});
|
|
8747
8761
|
if (a) return a;
|
|
8748
8762
|
if (n === "POST" && e.startsWith("/_voltro/inspect/")) {
|
|
8749
|
-
let i =
|
|
8763
|
+
let i = it(e, zc, t, r ?? "", { method: n });
|
|
8750
8764
|
if (e === "/_voltro/inspect/seeds/run" || e === "/_voltro/inspect/migrations/rollback") return i;
|
|
8751
8765
|
}
|
|
8752
8766
|
if (n === "POST" && e === "/_voltro/inspect/clientLog") return {
|
|
8753
|
-
...l(r ?? "",
|
|
8754
|
-
headers:
|
|
8767
|
+
...l(r ?? "", C),
|
|
8768
|
+
headers: O(t.origin)
|
|
8755
8769
|
};
|
|
8756
8770
|
if (n === "GET" && (e === "/_voltro/inspect/logs" || e.startsWith("/_voltro/inspect/logs?"))) return {
|
|
8757
8771
|
...d(e, c(), t),
|
|
8758
|
-
headers:
|
|
8772
|
+
headers: O(t.origin)
|
|
8759
8773
|
};
|
|
8760
8774
|
if (n === "GET" && (e === "/_voltro/inspect/traces" || e.startsWith("/_voltro/inspect/traces?"))) {
|
|
8761
8775
|
let n = Qp();
|
|
8762
8776
|
return {
|
|
8763
|
-
...Bp(e,
|
|
8764
|
-
headers:
|
|
8777
|
+
...Bp(e, Y === "postgres" && im() ? await Yh(e, n, R) : n),
|
|
8778
|
+
headers: O(t.origin)
|
|
8765
8779
|
};
|
|
8766
8780
|
}
|
|
8767
8781
|
if ((n === "POST" || n === "PATCH" || n === "DELETE") && e.startsWith("/_voltro/inspect/data/rows")) {
|
|
8768
|
-
let i = await
|
|
8782
|
+
let i = await ht(e, zc, t, r ?? "", { method: n });
|
|
8769
8783
|
if (i) return i;
|
|
8770
8784
|
}
|
|
8771
8785
|
if (n === "POST" && e.startsWith("/_voltro/inspect/data/import")) {
|
|
8772
|
-
let i = await
|
|
8786
|
+
let i = await nt(e, zc, t, r ?? "", { method: n });
|
|
8773
8787
|
if (i) return i;
|
|
8774
8788
|
}
|
|
8775
8789
|
if (e.startsWith("/_voltro/inspect/aggregates")) {
|
|
8776
|
-
let r = await Lu(e, n, Zi.registry,
|
|
8790
|
+
let r = await Lu(e, n, Zi.registry, O(t.origin));
|
|
8777
8791
|
if (r) return r;
|
|
8778
8792
|
}
|
|
8779
8793
|
if (e.startsWith("/_voltro/inspect/expectations") || e.startsWith("/_voltro/inspect/budgets") || e.startsWith("/_voltro/inspect/experiments")) {
|
|
@@ -8781,67 +8795,67 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8781
8795
|
expectations: Qi?.registry ?? Hu,
|
|
8782
8796
|
cost: $i?.registry ?? Uu,
|
|
8783
8797
|
experiments: ea?.registry ?? Wu
|
|
8784
|
-
},
|
|
8798
|
+
}, O(t.origin));
|
|
8785
8799
|
if (r) return r;
|
|
8786
8800
|
}
|
|
8787
8801
|
if (e.startsWith("/_voltro/inspect/timeline")) {
|
|
8788
8802
|
let r = await od(e, n, {
|
|
8789
8803
|
recorder: Ia(),
|
|
8790
|
-
readCurrentRows: async (e) =>
|
|
8804
|
+
readCurrentRows: async (e) => zc.inspectRows === void 0 ? [] : (await zc.inspectRows({
|
|
8791
8805
|
table: e,
|
|
8792
8806
|
offset: 0,
|
|
8793
8807
|
limit: 500,
|
|
8794
8808
|
count: "none"
|
|
8795
8809
|
})).rows
|
|
8796
|
-
},
|
|
8810
|
+
}, O(t.origin));
|
|
8797
8811
|
if (r) return r;
|
|
8798
8812
|
}
|
|
8799
8813
|
if (e.startsWith("/_voltro/inspect/analytics")) {
|
|
8800
8814
|
let r = ed(e, n, {
|
|
8801
8815
|
sink: di,
|
|
8802
|
-
metricsCollector:
|
|
8803
|
-
},
|
|
8816
|
+
metricsCollector: ys
|
|
8817
|
+
}, O(t.origin));
|
|
8804
8818
|
if (r) return r;
|
|
8805
8819
|
}
|
|
8806
8820
|
if (e.startsWith("/_voltro/inspect/plugins/")) {
|
|
8807
8821
|
let i = await Jt.dispatch(e, n, t, r ?? "");
|
|
8808
8822
|
if (i) return i;
|
|
8809
8823
|
}
|
|
8810
|
-
return n === "GET" ?
|
|
8824
|
+
return n === "GET" ? ut(e, zc, t, { method: n }).then((r) => r ?? ot(e, zc, t, { method: n })) : ot(e, zc, t, { method: n });
|
|
8811
8825
|
} },
|
|
8812
8826
|
inspectStream: {
|
|
8813
|
-
authorize: (e) =>
|
|
8827
|
+
authorize: (e) => Xe(e.host) ? et(e, "GET") : {
|
|
8814
8828
|
ok: !1,
|
|
8815
8829
|
reason: "forbidden host (DNS-rebinding guard)"
|
|
8816
8830
|
},
|
|
8817
|
-
isDisabled: () =>
|
|
8818
|
-
replay: () =>
|
|
8819
|
-
subscribe: (e) =>
|
|
8820
|
-
corsHeaders: (e) =>
|
|
8831
|
+
isDisabled: () => qe(),
|
|
8832
|
+
replay: () => C.buffered().map(p),
|
|
8833
|
+
subscribe: (e) => C.subscribe((t) => e(p(t))),
|
|
8834
|
+
corsHeaders: (e) => O(e),
|
|
8821
8835
|
keepAlive: () => m()
|
|
8822
8836
|
},
|
|
8823
|
-
webhookRoutes: new Map(Array.from(
|
|
8837
|
+
webhookRoutes: new Map(Array.from(za.entries()).map(([e, t]) => [e, { handle: t }])),
|
|
8824
8838
|
...er ? { tracerLayer: er } : {}
|
|
8825
8839
|
});
|
|
8826
8840
|
try {
|
|
8827
8841
|
await da(tl);
|
|
8828
8842
|
} catch (e) {
|
|
8829
|
-
Z.error(`rpc server failed to bind on port ${
|
|
8843
|
+
Z.error(`rpc server failed to bind on port ${S} — aborting boot`, { port: S }, e), process.exit(1);
|
|
8830
8844
|
}
|
|
8831
|
-
Z.info(`listening on http://localhost:${
|
|
8832
|
-
port:
|
|
8833
|
-
ws: `ws://localhost:${
|
|
8834
|
-
store:
|
|
8835
|
-
}),
|
|
8845
|
+
Z.info(`listening on http://localhost:${S}`, {
|
|
8846
|
+
port: S,
|
|
8847
|
+
ws: `ws://localhost:${S}/ws`,
|
|
8848
|
+
store: Y
|
|
8849
|
+
}), we?.set({ phase: "ready" }), process.send?.({ type: ll }), process.channel?.unref(), Y === "postgres" && Z.info("postgres change-data-capture", { enabled: (process.env.CDC ?? "1") !== "0" }), await Qo();
|
|
8836
8850
|
try {
|
|
8837
8851
|
await Nt({
|
|
8838
|
-
id:
|
|
8839
|
-
name:
|
|
8852
|
+
id: oe,
|
|
8853
|
+
name: ae,
|
|
8840
8854
|
kind: "api",
|
|
8841
|
-
url: `http://localhost:${
|
|
8855
|
+
url: `http://localhost:${S}`,
|
|
8842
8856
|
pid: process.pid,
|
|
8843
8857
|
status: "live",
|
|
8844
|
-
logFile:
|
|
8858
|
+
logFile: fe.path
|
|
8845
8859
|
});
|
|
8846
8860
|
let e = s(n);
|
|
8847
8861
|
if (e) {
|
|
@@ -8850,21 +8864,21 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8850
8864
|
}
|
|
8851
8865
|
setInterval(() => {
|
|
8852
8866
|
Nt({
|
|
8853
|
-
id:
|
|
8854
|
-
name:
|
|
8867
|
+
id: oe,
|
|
8868
|
+
name: ae,
|
|
8855
8869
|
kind: "api",
|
|
8856
|
-
url: `http://localhost:${
|
|
8870
|
+
url: `http://localhost:${S}`,
|
|
8857
8871
|
pid: process.pid,
|
|
8858
8872
|
status: "live",
|
|
8859
|
-
logFile:
|
|
8873
|
+
logFile: fe.path
|
|
8860
8874
|
}).catch(() => {});
|
|
8861
8875
|
}, 1e4).unref();
|
|
8862
8876
|
let t = async () => {
|
|
8863
8877
|
Kt.deactivate();
|
|
8864
8878
|
for (let e of xr) e.stop();
|
|
8865
|
-
gr?.dispose(), Pt(
|
|
8879
|
+
gr?.dispose(), Pt(oe), fe.dispose(), Yr(), Nr?.close(), await _i();
|
|
8866
8880
|
};
|
|
8867
|
-
|
|
8881
|
+
W(t);
|
|
8868
8882
|
let r = process.ppid;
|
|
8869
8883
|
if (r > 1) {
|
|
8870
8884
|
let e = setInterval(() => {
|
|
@@ -8875,7 +8889,7 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8875
8889
|
} catch (e) {
|
|
8876
8890
|
Z.warn("runtime-registry write failed", {}, e);
|
|
8877
8891
|
}
|
|
8878
|
-
return
|
|
8892
|
+
return y(e, Z, {
|
|
8879
8893
|
root: n,
|
|
8880
8894
|
onBeforeRestart: () => {
|
|
8881
8895
|
try {
|
|
@@ -8884,15 +8898,15 @@ ${r.join("\n")}\n A deployment with no producer waits forever and looks exactly
|
|
|
8884
8898
|
tl.close();
|
|
8885
8899
|
}
|
|
8886
8900
|
}), Qt({
|
|
8887
|
-
app:
|
|
8901
|
+
app: ae,
|
|
8888
8902
|
kind: "api",
|
|
8889
|
-
url: `http://localhost:${
|
|
8903
|
+
url: `http://localhost:${S}`,
|
|
8890
8904
|
extras: [{
|
|
8891
8905
|
label: "WS",
|
|
8892
|
-
url: `ws://localhost:${
|
|
8906
|
+
url: `ws://localhost:${S}/ws`
|
|
8893
8907
|
}],
|
|
8894
8908
|
bootMs: Date.now() - g
|
|
8895
8909
|
}), new Promise(() => {});
|
|
8896
8910
|
};
|
|
8897
8911
|
//#endregion
|
|
8898
|
-
export { pf as $, pl as $t, vm as A, lu as At, np as B, zl as Bt, Hm as C, zu as Ct, km as D, yu as Dt, Mm as E, Mu as Et, Mp as F, eu as Ft, Wf as G, Nl as Gt, $f as H, Rl as Ht, Np as I, Yl as It, Af as J, Tl as Jt, Hf as K, kl as Kt, kp as L, Kl as Lt, mm as M, su as Mt, hm as N, au as Nt, xm as O, fu as Ot, im as P, iu as Pt, mf as Q, _l as Qt, Ap as R, Hl as Rt, Gm as S,
|
|
8912
|
+
export { pf as $, pl as $t, vm as A, lu as At, np as B, zl as Bt, Hm as C, zu as Ct, km as D, yu as Dt, Mm as E, Mu as Et, Mp as F, eu as Ft, Wf as G, Nl as Gt, $f as H, Rl as Ht, Np as I, Yl as It, Af as J, Tl as Jt, Hf as K, kl as Kt, kp as L, Kl as Lt, mm as M, su as Mt, hm as N, au as Nt, xm as O, fu as Ot, im as P, iu as Pt, mf as Q, _l as Qt, Ap as R, Hl as Rt, Gm as S, ec as Sn, Bu as St, Am as T, ju as Tt, ep as U, Fl as Ut, Xf as V, Bl as Vt, Zf as W, Il as Wt, vf as X, Sl as Xt, gf as Y, bl as Yt, ff as Z, vl as Zt, vh as _, dc as _n, dd as _t, Uh as a, qc as an, $d as at, Um as b, ac as bn, Hu as bt, Qh as c, Uc as cn, Yd as ct, cg as d, Fc as dn, Wd as dt, hl as en, uf as et, Fh as f, Oc as fn, Bd as ft, ph as g, uc as gn, pd as gt, mh as h, xc as hn, bd as ht, ng as i, Kc as in, tf as it, pm as j, cu as jt, _m as k, _u as kt, Zh as l, Bc as ln, qd as lt, wh as m, Tc as mn, _d as mt, Ah as n, Xc as nn, of as nt, Q as o, Gc as on, ef as ot, rg as p, kc as pn, Pd as pt, Ff as q, Dl as qt, kh as r, Yc as rn, nf as rt, Nh as s, Wc as sn, Zd as st, Eh as t, Zc as tn, cf as tt, Xh as u, Lc as un, Hd as ut, bh as v, cc as vn, fd as vt, Nm as w, Vu as wt, Wm as x, $s as xn, Wu as xt, qm as y, rc as yn, Uu as yt, up as z, Wl as zt };
|