@voltro/cli 0.54.0 → 0.56.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 +639 -2
- package/bin/voltro.mjs +24 -0
- package/dist/{apiBuild-DTWp0S_q.js → apiBuild-Bdaetr37.js} +119 -88
- package/dist/apiBuild-Vw1figjO.js +2 -0
- package/dist/bin.js +1 -1
- package/dist/{build-D4ygSbnV.js → build-CI36wL4R.js} +339 -314
- package/dist/buildReport-52gHKgfO.js +64 -0
- package/dist/{checkCommand-Dg1G7Gwd.js → checkCommand-CAwFXrxA.js} +6 -6
- package/dist/{checkCommand-L7DTlpIF.js → checkCommand-D0QV_zM_.js} +1 -1
- package/dist/{clusterCmd-DrVFCzSj.js → clusterCmd-CdLB1GkT.js} +1 -1
- package/dist/{codegen-DSLM8Su9.js → codegen-Bth5lUTU.js} +76 -64
- package/dist/codegen-DbH7NbCR.js +2 -0
- package/dist/{codegenCommand-CG_Vx4lc.js → codegenCommand-CidbQzbv.js} +15 -14
- package/dist/{codemodRunner-Cd4xkC6u.js → codemodRunner-BlQPfjzA.js} +277 -0
- package/dist/{commands-6Kzi92Np.js → commands-CWjfThXv.js} +35 -35
- package/dist/{dashboardCommand-Cq1PWvI1.js → dashboardCommand-BekcY5Ls.js} +3 -3
- package/dist/{dataCommand-DYzW8vkv.js → dataCommand-2pccgbIy.js} +267 -195
- package/dist/{dbCommand-B4NWZtGL.js → dbCommand-DpK_vQET.js} +457 -441
- package/dist/dbCommand-DrycGWWt.js +2 -0
- package/dist/{dev-cKUiZZsB.js → dev-B9Gz0k85.js} +1 -1
- package/dist/{dev-CmuvUKRq.js → dev-Dw263KPu.js} +2598 -2452
- package/dist/doctorCommand-BMWs6aVm.js +2 -0
- package/dist/{doctorCommand-DCiFVMtZ.js → doctorCommand-aR_bFmIi.js} +353 -251
- package/dist/{dormancyCommand-w1TrmgYP.js → dormancyCommand-eXTQMbHU.js} +1 -1
- package/dist/{embeddingsCommand-CMgPyRTr.js → embeddingsCommand-CTmiQvwa.js} +1 -1
- package/dist/{envCommand-Cyynmcfa.js → envCommand-BDUgV7EM.js} +12 -12
- package/dist/{evolveCommand-BwvQ8dVH.js → evolveCommand-YV8qW1LU.js} +2 -2
- package/dist/frameworkTableAssembly-CGNC0qr7.js +2 -0
- package/dist/{frameworkTableAssembly-D7LJuALW.js → frameworkTableAssembly-DNOFXfEQ.js} +102 -100
- package/dist/index.js +1 -1
- package/dist/{infoCommand-DlYlUPqs.js → infoCommand-BjVXpMlP.js} +1 -1
- package/dist/inspect-CNYvNXPU.js +1484 -0
- package/dist/inspect-S2rWy1Ys.js +2 -0
- package/dist/{inspectCmd-niF97fAq.js → inspectCmd-CP-G0sVK.js} +1 -1
- package/dist/{inspectFetch-EMuhTG_9.js → inspectFetch-BU1NyzxV.js} +36 -24
- package/dist/{inspectMetrics-CGF94puw.js → inspectMetrics-BY0Sjb2F.js} +19 -19
- package/dist/interruptedReplace-CwnkBb2X.js +41 -0
- package/dist/interruptedReplace-qzmFI020.js +2 -0
- package/dist/{logsCmd-B6oNsfaZ.js → logsCmd-BU8uCdys.js} +1 -1
- package/dist/{manifestBuild-Cqgsx2bM.js → manifestBuild-CEkjfpwc.js} +1 -1
- package/dist/manifestBuild-DIa_s6u0.js +2 -0
- package/dist/{migrate-BK_Bbx-_.js → migrate-SICulyz1.js} +2 -2
- package/dist/precompressAssets-YhTi1aWp.js +40 -0
- package/dist/{probeCommand-_C0YU207.js → probeCommand-6HxEkNDG.js} +2 -2
- package/dist/{runtimeTrace-CGWx1Q6l.js → runtimeTrace-DgYMc09E.js} +1 -1
- package/dist/{scheduleCmd-DQRu6BZC.js → scheduleCmd-DYBUfo_T.js} +1 -1
- package/dist/{sdkgen-CDGHQUFj.js → sdkgen-PY-umd6O.js} +1 -1
- package/dist/{seedRunner-Dgsiwk_e.js → seedRunner-DISBKow-.js} +16 -16
- package/dist/serveCommand-BITS8Hpj.js +2 -0
- package/dist/{serveCommand-Bje09q1v.js → serveCommand-DIJ3ma76.js} +951 -909
- package/dist/serveEntry.js +1 -1
- package/dist/{start-Clz-1BHB.js → start-B9NGB8gn.js} +627 -588
- package/dist/{start-B0bnJgxI.js → start-BFQQkL1i.js} +1 -1
- package/dist/startEntry.js +1 -1
- package/dist/staticCachePolicy-CIyj6DbS.js +15 -0
- package/dist/{test-D_kW4KMj.js → test-jipIQ5Mx.js} +1 -1
- package/dist/{tracesCmd-DgtgOUdi.js → tracesCmd-BWYDqMy6.js} +1 -1
- package/dist/{updateCommand-CRJlAOaM.js → updateCommand-C9n_Z_oG.js} +8 -2
- package/dist/updateCommand-DsXEAHbd.js +2 -0
- package/dist/webDev-C2dRz9s5.js +2 -0
- package/dist/{webDev-DSI9SOhs.js → webDev-C53hJdcL.js} +1265 -1288
- package/dist/{webhooksCommand-BvzXNHji.js → webhooksCommand-uuPu8qQX.js} +1 -1
- package/dist/{workflowsCmd-BGF-mRZ5.js → workflowsCmd-g-DNpaUc.js} +1 -1
- package/package.json +67 -19
- package/templates/AGENTS.core.md +20 -1
- package/templates/AGENTS.md +21 -2
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/_manifest.json +1 -1
- package/templates/agent-docs/authentication.md +49 -6
- package/templates/agent-docs/cli.md +216 -11
- package/templates/agent-docs/data.md +209 -18
- package/templates/agent-docs/database/scaling.md +40 -1
- package/templates/agent-docs/deployment.md +53 -1
- package/templates/agent-docs/internationalization.md +32 -0
- package/templates/agent-docs/local-first-mobile.md +9 -2
- package/templates/agent-docs/observability.md +227 -0
- package/templates/agent-docs/plugins/billing.md +15 -0
- package/templates/agent-docs/plugins/broadcast.md +2 -1
- package/templates/agent-docs/plugins/ratelimit.md +6 -1
- package/templates/agent-docs/plugins/row-history.md +11 -0
- package/templates/agent-docs/plugins.md +65 -8
- package/templates/agent-docs/reference.md +5 -3
- package/templates/agent-docs/routing.md +18 -0
- package/templates/agent-docs/schema-driven-ui.md +125 -0
- package/templates/agent-docs/templates/appshells.md +3 -3
- package/templates/agent-docs/whats-new.md +408 -106
- package/templates/apps/api-ai/package.json +6 -6
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +9 -9
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-row-history/package.json +8 -8
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +7 -7
- package/templates/apps/changelog/src/pages/[locale]/page.tsx +7 -1
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +7 -8
- package/templates/apps/frontend-admin/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-admin/src/pages/admin/layout.tsx +1 -2
- package/templates/apps/frontend-app/package.json +8 -9
- package/templates/apps/frontend-app/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-auth/package.json +7 -8
- package/templates/apps/frontend-auth/src/components/AuthShell.tsx +1 -2
- package/templates/apps/frontend-blank/package.json +6 -7
- package/templates/apps/frontend-blank/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-cms/package.json +8 -9
- package/templates/apps/frontend-cms/src/pages/(app)/layout.tsx +1 -2
- package/templates/apps/frontend-collab/README.md +7 -2
- package/templates/apps/frontend-collab/package.json +9 -10
- package/templates/apps/frontend-collab/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-collab/src/pages/page.test.tsx +8 -4
- package/templates/apps/frontend-collab/src/pages/page.tsx +10 -5
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-contact/src/components/ContactForm.island.tsx +1 -1
- package/templates/apps/frontend-dashboard/package.json +6 -7
- package/templates/apps/frontend-dashboard/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-dashboard/src/pages/dashboard/layout.tsx +1 -2
- package/templates/apps/frontend-docs/package.json +8 -8
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-portal/package.json +7 -8
- package/templates/apps/frontend-portal/src/pages/(portal)/layout.tsx +1 -2
- package/templates/apps/frontend-saas/package.json +7 -8
- package/templates/apps/frontend-saas/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-saas/src/pages/dashboard/layout.tsx +1 -2
- package/templates/apps/frontend-spa/package.json +6 -7
- package/templates/apps/frontend-spa/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-ssr/package.json +6 -7
- package/templates/apps/frontend-ssr/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-ssr-api/package.json +7 -8
- package/templates/apps/frontend-ssr-api/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-static-blog/package.json +8 -8
- package/templates/apps/frontend-static-blog/src/components/ReadingProgress.island.tsx +1 -1
- package/templates/apps/frontend-static-blog/src/pages/[locale]/page.tsx +7 -1
- package/templates/apps/frontend-status/package.json +7 -8
- package/templates/apps/frontend-status/src/pages/layout.tsx +1 -2
- package/templates/apps/mobile-app/package.json +4 -4
- package/templates/baselines/compose/docker/api.Dockerfile +61 -5
- package/templates/baselines/compose/docker/web.Dockerfile +55 -10
- package/templates/baselines/compose-mariadb/docker/api.Dockerfile +61 -5
- package/templates/baselines/compose-mariadb/docker/web.Dockerfile +55 -10
- package/dist/apiBuild-CeUN55uk.js +0 -2
- package/dist/codegen-DjgxEOnD.js +0 -2
- package/dist/dbCommand-CSFWs9ev.js +0 -2
- package/dist/doctorCommand-J3qu4E0Y.js +0 -2
- package/dist/frameworkTableAssembly-IPD1pUnZ.js +0 -2
- package/dist/inspect-Bd8-9wsi.js +0 -1193
- package/dist/inspect-CuoDInfZ.js +0 -2
- package/dist/interruptedReplace-C3O3M1MM.js +0 -28
- package/dist/interruptedReplace-CvmiAM9K.js +0 -2
- package/dist/manifestBuild-C4-J1-m_.js +0 -2
- package/dist/serveCommand-BiPe8BJm.js +0 -2
- package/dist/updateCommand-CIoVDKnj.js +0 -2
- package/dist/webDev-DlvZO30c.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as e } from "./dev-
|
|
2
|
-
import {
|
|
1
|
+
import { c as e } from "./dev-Dw263KPu.js";
|
|
2
|
+
import { Bt as t, Ht as n, Ut as r, zt as i } from "./webDev-C53hJdcL.js";
|
|
3
3
|
import { join as a } from "node:path";
|
|
4
4
|
import { promises as o } from "node:fs";
|
|
5
5
|
import { createLogger as s } from "@voltro/logger";
|
|
@@ -21,27 +21,27 @@ var u = s({ scope: "voltro:env" }), d = "# Environment for this app", f = async
|
|
|
21
21
|
}, h = async (e) => {
|
|
22
22
|
let t = await f(e);
|
|
23
23
|
if (!t) return u.error("no app.config.ts found in the current directory"), 1;
|
|
24
|
-
let n =
|
|
25
|
-
u.info(`env manifest — ${n.app} (${n.summary.total} vars, ${n.summary.set} set)`), m(
|
|
24
|
+
let n = i(t.name, t.input), r = `${p("KEY", 32)} ${p("OWNER", 16)} ${p("ACCESS", 8)} ${p("REQ", 4)} SET`;
|
|
25
|
+
u.info(`env manifest — ${n.app} (${n.summary.total} vars, ${n.summary.set} set)`), m(r);
|
|
26
26
|
for (let e of n.entries) {
|
|
27
27
|
let t = e.isSet ? "✓" : e.satisfied ? "·" : "✗";
|
|
28
28
|
m(`${p(e.key, 32)} ${p(e.owner, 16)} ${p(e.access, 8)} ${p(e.required ? "yes" : "", 4)} ${t}`);
|
|
29
29
|
}
|
|
30
30
|
return n.summary.missingRequired > 0 ? (u.error(`${n.summary.missingRequired} required var(s) are unset`), 1) : 0;
|
|
31
|
-
}, g = async (e,
|
|
31
|
+
}, g = async (e, n) => {
|
|
32
32
|
let r = await f(e);
|
|
33
33
|
if (!r) return u.error("no app.config.ts found in the current directory"), 1;
|
|
34
|
-
let i =
|
|
35
|
-
if (c !== null && !c.startsWith(d) && !
|
|
34
|
+
let i = t(r.input, ["Environment for this app — generated from app.config.ts `env` + plugin declarations.", "Regenerate with `voltro env sync`. Copy to `.env` and fill in the blanks."]), s = a(e, ".env.example"), c = await o.readFile(s, "utf8").catch(() => null);
|
|
35
|
+
if (c !== null && !c.startsWith(d) && !n) {
|
|
36
36
|
let t = a(e, ".env.example.generated");
|
|
37
37
|
return await o.writeFile(t, i, "utf8"), u.warn(".env.example exists and is not framework-generated — wrote .env.example.generated instead", { hint: "merge it by hand, or pass --force to overwrite .env.example" }), 0;
|
|
38
38
|
}
|
|
39
39
|
return await o.writeFile(s, i, "utf8"), u.info("wrote .env.example", { app: r.name }), 0;
|
|
40
|
-
}, _ = async (
|
|
41
|
-
let
|
|
42
|
-
if (!
|
|
43
|
-
let a = l(
|
|
44
|
-
return a ? (
|
|
40
|
+
}, _ = async (t) => {
|
|
41
|
+
let i = await e(t).catch(() => null);
|
|
42
|
+
if (!i) return u.error("no app.config.ts found in the current directory"), 1;
|
|
43
|
+
let a = l(i.env) ? i.env : void 0;
|
|
44
|
+
return a ? (i.type === "web" ? (await n(t, a), u.info("wrote src/voltro-env.d.ts (publicEnv augmentation)", { app: i.name ?? "app" })) : (await r(t, a), u.info("wrote env.generated.d.ts (serverEnv augmentation)", { app: i.name ?? "app" })), 0) : (u.warn("no `defineEnv` declared in app.config.ts — nothing to generate", { hint: "add `env: defineEnv({ ... })` to app.config.ts (see @voltro/env)" }), 0);
|
|
45
45
|
}, v = () => {
|
|
46
46
|
let e = c();
|
|
47
47
|
return u.info(`${e.length} framework env vars for turbo.json globalPassThroughEnv:`), m(JSON.stringify([...e].sort(), null, 2)), u.info("merge these into the workspace turbo.json `globalPassThroughEnv` array (+ your own app vars)."), 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as e } from "./cliOutput-D1tSBoRM.js";
|
|
2
|
-
import { i as t } from "./checkCommand-
|
|
3
|
-
import { i as n, n as r } from "./codemodRunner-
|
|
2
|
+
import { i as t } from "./checkCommand-CAwFXrxA.js";
|
|
3
|
+
import { i as n, n as r } from "./codemodRunner-BlQPfjzA.js";
|
|
4
4
|
import { basename as i, join as a, resolve as o } from "node:path";
|
|
5
5
|
import { branchNamespaceName as s, planBranchProvision as c } from "@voltro/database";
|
|
6
6
|
import { readFile as l } from "node:fs/promises";
|
|
@@ -4,19 +4,19 @@ import { C as n, N as r, j as i, k as a, o } from "./fileConventions-l-RIXbx8.js
|
|
|
4
4
|
import { basename as s, join as c } from "node:path";
|
|
5
5
|
import { existsSync as l, promises as u } from "node:fs";
|
|
6
6
|
import { pathToFileURL as d } from "node:url";
|
|
7
|
-
import { defineAction as f, defineMutation as
|
|
8
|
-
import { _voltroApiKeysTable as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { _voltroBudgetHoldsTable as
|
|
13
|
-
import { agentMessagesTable as
|
|
14
|
-
import { _voltroWebhookDeliveriesTable as
|
|
15
|
-
import { _voltroStorageBlobsTable as
|
|
7
|
+
import { defineAction as f, defineMutation as p, defineQuery as m, pluginAlias as h, pluginAlias as g, pluginSlug as ee } from "@voltro/protocol";
|
|
8
|
+
import { _voltroApiKeysTable as te, _voltroCdcOffsetsTable as ne, _voltroDataTransfersTable as re, _voltroIdempotencyTable as ie, _voltroKvTable as ae, _voltroMigrationPlansTable as oe, _voltroMigrationsTable as se, _voltroMssqlCdcOffsetsTable as ce, _voltroReplaceInProgressTable as le, _voltroReplicaObservationsTable as ue, _voltroSeedsTable as de } from "@voltro/database";
|
|
9
|
+
import { _voltroApprovalsTable as fe, _voltroChangeClaimsTable as pe, _voltroConnectionGrantsTable as me, _voltroConnectionsTable as _, _voltroScheduleClaimsTable as v, _voltroScheduleRunsTable as y, _voltroTracesTable as b, _voltroUndoLogTable as x, _voltroWakeupsTable as S, _voltroWorkflowEventDeliveriesTable as C, _voltroWorkflowEventsTable as w, outboxAttemptsTable as T, outboxTable as E } from "@voltro/runtime";
|
|
10
|
+
import { Effect as D } from "effect";
|
|
11
|
+
import { SqlClient as O } from "@effect/sql";
|
|
12
|
+
import { _voltroBudgetHoldsTable as k, _voltroWorkflowAdmissionsTable as A, _voltroWorkflowPausesTable as j, _voltroWorkflowPendingTable as M, _voltroWorkflowRunEventsTable as N, _voltroWorkflowRunStepsTable as P, _voltroWorkflowRunsTable as F, _voltroWorkflowStartContextsTable as I, _voltroWorkflowWatermarksTable as L } from "@voltro/workflow";
|
|
13
|
+
import { agentMessagesTable as R, agentThreadsTable as z, aiBudgetTable as he, aiInferencesTable as ge, aiUsageTable as _e, isAgentDescriptor as ve, isAgentExecutor as ye, promptsTable as be, resolveToolModuleHandlers as xe } from "@voltro/ai";
|
|
14
|
+
import { _voltroWebhookDeliveriesTable as Se, _voltroWebhookTargetsTable as Ce } from "@voltro/plugin-webhooks/mixin";
|
|
15
|
+
import { _voltroStorageBlobsTable as we, _voltroStorageGrantsTable as Te, _voltroStorageRefsTable as Ee, _voltroStorageUsageTable as De } from "@voltro/plugin-storage";
|
|
16
16
|
//#region src/frameworkTables.ts
|
|
17
|
-
var
|
|
17
|
+
var Oe = [
|
|
18
18
|
{
|
|
19
|
-
table:
|
|
19
|
+
table: se,
|
|
20
20
|
when: "always"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
@@ -24,79 +24,79 @@ var we = [
|
|
|
24
24
|
when: "always"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
table:
|
|
27
|
+
table: oe,
|
|
28
28
|
when: "always"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
table:
|
|
31
|
+
table: le,
|
|
32
32
|
when: "always"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
table:
|
|
35
|
+
table: re,
|
|
36
36
|
when: "always"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
table:
|
|
39
|
+
table: F,
|
|
40
40
|
when: "workflows"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
table:
|
|
43
|
+
table: P,
|
|
44
44
|
when: "workflows"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
table:
|
|
47
|
+
table: N,
|
|
48
48
|
when: "workflows"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
table:
|
|
51
|
+
table: I,
|
|
52
52
|
when: "workflows"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
table:
|
|
55
|
+
table: M,
|
|
56
56
|
when: "workflows"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
table:
|
|
59
|
+
table: A,
|
|
60
60
|
when: "workflows"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
table:
|
|
63
|
+
table: j,
|
|
64
64
|
when: "workflows"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
table:
|
|
67
|
+
table: L,
|
|
68
68
|
when: "workflows"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
table:
|
|
71
|
+
table: w,
|
|
72
72
|
when: "workflows"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
table:
|
|
75
|
+
table: C,
|
|
76
76
|
when: "workflows"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
table:
|
|
79
|
+
table: y,
|
|
80
80
|
when: "schedules"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
table:
|
|
83
|
+
table: v,
|
|
84
84
|
when: "schedules"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
table:
|
|
87
|
+
table: Ce,
|
|
88
88
|
when: "webhooks"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
table:
|
|
91
|
+
table: Se,
|
|
92
92
|
when: "webhooks"
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
table:
|
|
95
|
+
table: b,
|
|
96
96
|
when: "traces"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
|
-
table:
|
|
99
|
+
table: x,
|
|
100
100
|
when: "undo"
|
|
101
101
|
},
|
|
102
102
|
{
|
|
@@ -104,75 +104,77 @@ var we = [
|
|
|
104
104
|
when: "always"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
table:
|
|
107
|
+
table: k,
|
|
108
108
|
when: "workflows"
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
|
-
table:
|
|
111
|
+
table: E,
|
|
112
112
|
when: "always"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
|
-
table:
|
|
115
|
+
table: T,
|
|
116
116
|
when: "always"
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
table:
|
|
119
|
+
table: _,
|
|
120
120
|
when: "connections"
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
|
-
table:
|
|
123
|
+
table: me,
|
|
124
124
|
when: "connections"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
table:
|
|
127
|
+
table: S,
|
|
128
128
|
when: "always"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
|
-
table:
|
|
131
|
+
table: Ee,
|
|
132
132
|
when: "always"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
table:
|
|
135
|
+
table: Te,
|
|
136
136
|
when: "always"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
|
-
table:
|
|
139
|
+
table: we,
|
|
140
140
|
when: "always"
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
|
-
table:
|
|
143
|
+
table: De,
|
|
144
144
|
when: "always"
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
|
-
table:
|
|
147
|
+
table: ie,
|
|
148
148
|
when: "always"
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
|
-
table:
|
|
151
|
+
table: pe,
|
|
152
152
|
when: "always"
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
|
-
table:
|
|
155
|
+
table: te,
|
|
156
|
+
when: "always"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
table: ae,
|
|
160
|
+
when: "always"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
table: ue,
|
|
156
164
|
when: "always"
|
|
157
165
|
}
|
|
158
|
-
],
|
|
159
|
-
let t =
|
|
160
|
-
return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ?
|
|
161
|
-
},
|
|
162
|
-
let
|
|
163
|
-
return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
|
|
164
|
-
}, Ee = (e) => {
|
|
165
|
-
let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
|
|
166
|
-
return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/#/g, "--").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
167
|
-
}, De = (e, t) => B(e, t.name), B = (e, t) => {
|
|
168
|
-
let n = z(e.name);
|
|
166
|
+
], ke = (e) => {
|
|
167
|
+
let t = Oe.filter((t) => t.when === "always" || t.when === "workflows" && e.workflows || t.when === "schedules" && e.schedules || t.when === "webhooks" && e.webhooks || t.when === "traces" && e.traces || t.when === "undo" && e.undo === !0 || t.when === "connections" && e.connections === !0).map((e) => e.table);
|
|
168
|
+
return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? ce : ne), t;
|
|
169
|
+
}, Ae = (e, t) => B(e, t.name), B = (e, t) => {
|
|
170
|
+
let n = h(e.name);
|
|
169
171
|
if (!t.includes(".")) return `${n}.${t}`;
|
|
170
172
|
if (e.baseName === void 0) return t;
|
|
171
|
-
let r = `${
|
|
173
|
+
let r = `${h(e.baseName)}.`;
|
|
172
174
|
return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
|
|
173
|
-
}, V = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess },
|
|
175
|
+
}, V = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, je = (e, t, n) => {
|
|
174
176
|
switch (e) {
|
|
175
|
-
case "query": return
|
|
177
|
+
case "query": return m({
|
|
176
178
|
name: t,
|
|
177
179
|
input: n.input,
|
|
178
180
|
output: n.output,
|
|
@@ -180,7 +182,7 @@ var we = [
|
|
|
180
182
|
...V(n),
|
|
181
183
|
...n.source === void 0 ? {} : { source: n.source }
|
|
182
184
|
});
|
|
183
|
-
case "mutation": return
|
|
185
|
+
case "mutation": return p({
|
|
184
186
|
name: t,
|
|
185
187
|
input: n.input,
|
|
186
188
|
output: n.output,
|
|
@@ -195,23 +197,23 @@ var we = [
|
|
|
195
197
|
...V(n)
|
|
196
198
|
});
|
|
197
199
|
}
|
|
198
|
-
},
|
|
200
|
+
}, Me = (e) => (t, n) => D.suspend(() => {
|
|
199
201
|
let r = { request: {
|
|
200
202
|
subject: n.request.subject,
|
|
201
203
|
traceId: n.request.traceId
|
|
202
204
|
} };
|
|
203
205
|
return e.execute(t, r);
|
|
204
|
-
}),
|
|
206
|
+
}), Ne = (e) => {
|
|
205
207
|
let t = [];
|
|
206
208
|
for (let n of e) {
|
|
207
209
|
let e = n.routes ?? [];
|
|
208
210
|
for (let r of e) {
|
|
209
|
-
let e =
|
|
211
|
+
let e = Ae(n, r), i = je(r.kind, e, r);
|
|
210
212
|
t.push({
|
|
211
213
|
kind: r.kind,
|
|
212
214
|
file: `plugin:${n.name}`,
|
|
213
215
|
descriptor: i,
|
|
214
|
-
executor:
|
|
216
|
+
executor: Me(r),
|
|
215
217
|
plugin: {
|
|
216
218
|
name: n.name,
|
|
217
219
|
version: n.version
|
|
@@ -220,7 +222,7 @@ var we = [
|
|
|
220
222
|
}
|
|
221
223
|
}
|
|
222
224
|
return t;
|
|
223
|
-
},
|
|
225
|
+
}, Pe = (e, t, n = /* @__PURE__ */ new Set()) => {
|
|
224
226
|
let r = /* @__PURE__ */ new Map();
|
|
225
227
|
for (let e of t) r.set(e, "user-route");
|
|
226
228
|
let i = [];
|
|
@@ -232,8 +234,8 @@ var we = [
|
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
return i;
|
|
235
|
-
}, H = "_voltro_plugin_migrations",
|
|
236
|
-
yield* (yield*
|
|
237
|
+
}, H = "_voltro_plugin_migrations", Fe = () => D.gen(function* () {
|
|
238
|
+
yield* (yield* O.SqlClient).unsafe(`
|
|
237
239
|
CREATE TABLE IF NOT EXISTS ${H} (
|
|
238
240
|
id TEXT PRIMARY KEY,
|
|
239
241
|
plugin_name TEXT NOT NULL,
|
|
@@ -241,26 +243,26 @@ var we = [
|
|
|
241
243
|
description TEXT,
|
|
242
244
|
applied_at TEXT NOT NULL
|
|
243
245
|
);
|
|
244
|
-
`).pipe(
|
|
245
|
-
}),
|
|
246
|
-
let e = yield*
|
|
246
|
+
`).pipe(D.orDie);
|
|
247
|
+
}), Ie = (e, t) => `${g(e)}__${t}`, Le = () => D.gen(function* () {
|
|
248
|
+
let e = yield* O.SqlClient, t = yield* e`SELECT id FROM ${e(H)}`.pipe(D.orDie);
|
|
247
249
|
return new Set(t.map((e) => e.id));
|
|
248
|
-
}),
|
|
249
|
-
let t = yield*
|
|
250
|
+
}), Re = (e) => D.gen(function* () {
|
|
251
|
+
let t = yield* O.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
|
|
250
252
|
yield* t`
|
|
251
253
|
INSERT INTO ${t(H)} (id, plugin_name, migration_id, description, applied_at)
|
|
252
254
|
VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
|
|
253
|
-
`.pipe(
|
|
254
|
-
}), U = (e) =>
|
|
255
|
+
`.pipe(D.orDie);
|
|
256
|
+
}), U = (e) => D.gen(function* () {
|
|
255
257
|
let t = e.flatMap((e) => (e.extendSchema?.migrations ?? []).map((t) => ({
|
|
256
258
|
plugin: e,
|
|
257
259
|
migration: t
|
|
258
260
|
})));
|
|
259
261
|
if (t.length === 0) return [];
|
|
260
|
-
yield*
|
|
261
|
-
let n = yield*
|
|
262
|
+
yield* Fe();
|
|
263
|
+
let n = yield* Le(), r = [];
|
|
262
264
|
for (let { plugin: e, migration: i } of t) {
|
|
263
|
-
let t =
|
|
265
|
+
let t = Ie(e.name, i.id), a = Date.now();
|
|
264
266
|
if (n.has(t)) {
|
|
265
267
|
r.push({
|
|
266
268
|
pluginName: e.name,
|
|
@@ -270,9 +272,9 @@ var we = [
|
|
|
270
272
|
});
|
|
271
273
|
continue;
|
|
272
274
|
}
|
|
273
|
-
let o = yield*
|
|
275
|
+
let o = yield* O.SqlClient;
|
|
274
276
|
try {
|
|
275
|
-
yield* i.up(o).pipe(
|
|
277
|
+
yield* i.up(o).pipe(D.mapError((e) => e)), yield* Re({
|
|
276
278
|
key: t,
|
|
277
279
|
pluginName: e.name,
|
|
278
280
|
migration: i
|
|
@@ -289,30 +291,30 @@ var we = [
|
|
|
289
291
|
status: "failed",
|
|
290
292
|
durationMs: Date.now() - a,
|
|
291
293
|
error: t
|
|
292
|
-
}), yield*
|
|
294
|
+
}), yield* D.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
return r;
|
|
296
|
-
}),
|
|
298
|
+
}), ze = (e, t) => D.gen(function* () {
|
|
297
299
|
let n = yield* U(e);
|
|
298
300
|
if (n.length === 0) return n;
|
|
299
301
|
let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
|
|
300
302
|
return t(`plugin migrations: ${r.length} applied, ${i.length} already applied`, { applied: r.map((e) => `${e.pluginName}:${e.migrationId}`) }), n;
|
|
301
|
-
}),
|
|
303
|
+
}), Be = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
|
|
302
304
|
pluginName: e.name,
|
|
303
|
-
pluginAlias:
|
|
305
|
+
pluginAlias: g(e.name),
|
|
304
306
|
tables: e.extendSchema.tables?.length ?? 0,
|
|
305
307
|
migrations: e.extendSchema.migrations?.length ?? 0
|
|
306
|
-
})),
|
|
308
|
+
})), Ve = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, He = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, Ue = async (t, n) => {
|
|
307
309
|
let r = 0;
|
|
308
310
|
for (let i of t) if (G.test(i)) try {
|
|
309
311
|
let t = await e(i);
|
|
310
|
-
r +=
|
|
312
|
+
r += xe(t);
|
|
311
313
|
} catch (e) {
|
|
312
314
|
n.warn("tool: failed to import — handler not wired", { file: i }, e);
|
|
313
315
|
}
|
|
314
316
|
return r;
|
|
315
|
-
},
|
|
317
|
+
}, We = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ge = async (t, n) => {
|
|
316
318
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
317
319
|
for (let a of t) {
|
|
318
320
|
if (!W.test(a)) continue;
|
|
@@ -323,7 +325,7 @@ var we = [
|
|
|
323
325
|
n.warn("agent: failed to import descriptor", { file: a }, e);
|
|
324
326
|
continue;
|
|
325
327
|
}
|
|
326
|
-
let o = Object.values(t).find(
|
|
328
|
+
let o = Object.values(t).find(ve);
|
|
327
329
|
if (o === void 0) {
|
|
328
330
|
n.warn("agent: no defineAgent() descriptor export found", { file: a });
|
|
329
331
|
continue;
|
|
@@ -335,7 +337,7 @@ var we = [
|
|
|
335
337
|
});
|
|
336
338
|
continue;
|
|
337
339
|
}
|
|
338
|
-
let s =
|
|
340
|
+
let s = We(a), c;
|
|
339
341
|
try {
|
|
340
342
|
c = await e(s);
|
|
341
343
|
} catch (e) {
|
|
@@ -347,7 +349,7 @@ var we = [
|
|
|
347
349
|
continue;
|
|
348
350
|
}
|
|
349
351
|
let l = c.default;
|
|
350
|
-
if (!
|
|
352
|
+
if (!ye(l)) {
|
|
351
353
|
n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
|
|
352
354
|
file: s,
|
|
353
355
|
name: o.name
|
|
@@ -362,7 +364,7 @@ var we = [
|
|
|
362
364
|
});
|
|
363
365
|
}
|
|
364
366
|
return { agents: r };
|
|
365
|
-
},
|
|
367
|
+
}, K = /\.connection\.tsx?$/, Ke = (e) => e.replace(K, ""), qe = async (t, n) => {
|
|
366
368
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
367
369
|
for (let a of t) {
|
|
368
370
|
let t;
|
|
@@ -405,9 +407,9 @@ var we = [
|
|
|
405
407
|
}
|
|
406
408
|
return r.length > 0 && n.info("discovered connections", {
|
|
407
409
|
connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
|
|
408
|
-
files: r.map((e) =>
|
|
410
|
+
files: r.map((e) => Ke(s(e.file)))
|
|
409
411
|
}), r;
|
|
410
|
-
},
|
|
412
|
+
}, q = (e) => o.test(e) || n.test(e), J = async (e) => {
|
|
411
413
|
let t = !1, n = !1, o = !1, s = !1, l = !1, d = async (e) => {
|
|
412
414
|
let f = await u.readdir(e, { withFileTypes: !0 }).catch(() => []);
|
|
413
415
|
for (let u of f) if (u.isDirectory()) {
|
|
@@ -415,7 +417,7 @@ var we = [
|
|
|
415
417
|
await d(c(e, u.name));
|
|
416
418
|
} else {
|
|
417
419
|
let e = u.name;
|
|
418
|
-
(r.test(e) || a.test(e)) && (t = !0),
|
|
420
|
+
(r.test(e) || a.test(e)) && (t = !0), q(e) && (n = !0), i.test(e) && (o = !0), W.test(e) && (s = !0), K.test(e) && (l = !0);
|
|
419
421
|
}
|
|
420
422
|
};
|
|
421
423
|
return await d(e), {
|
|
@@ -425,7 +427,7 @@ var we = [
|
|
|
425
427
|
agents: s,
|
|
426
428
|
connections: l
|
|
427
429
|
};
|
|
428
|
-
},
|
|
430
|
+
}, Je = async (e) => {
|
|
429
431
|
let t = c(e, "app.config.ts");
|
|
430
432
|
if (!l(t)) return { plugins: [] };
|
|
431
433
|
try {
|
|
@@ -440,8 +442,8 @@ var we = [
|
|
|
440
442
|
error: e
|
|
441
443
|
};
|
|
442
444
|
}
|
|
443
|
-
},
|
|
444
|
-
let { plugins: t, schema: n, error: r } = await
|
|
445
|
+
}, Y = async (e) => (await X(e)).plugins, X = async (e) => {
|
|
446
|
+
let { plugins: t, schema: n, error: r } = await Je(e);
|
|
445
447
|
if (r !== void 0) throw new Z(e, r);
|
|
446
448
|
return {
|
|
447
449
|
plugins: t,
|
|
@@ -463,7 +465,7 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
463
465
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
464
466
|
e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
|
|
465
467
|
};
|
|
466
|
-
for (let t of
|
|
468
|
+
for (let t of ke({
|
|
467
469
|
workflows: e.mix.workflows,
|
|
468
470
|
schedules: e.mix.schedules,
|
|
469
471
|
webhooks: e.mix.webhooks,
|
|
@@ -473,11 +475,11 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
473
475
|
undo: e.gates.undo,
|
|
474
476
|
connections: e.mix.connections
|
|
475
477
|
})) n(t);
|
|
476
|
-
e.mix.agents && (n(
|
|
477
|
-
for (let t of
|
|
478
|
+
e.mix.agents && (n(z), n(R), n(_e), n(he)), e.mix.workflows && n(ge), (e.mix.workflows || e.mix.agents) && n(be);
|
|
479
|
+
for (let t of Ve(e.plugins)) n(t);
|
|
478
480
|
return [...t.values()];
|
|
479
|
-
},
|
|
480
|
-
let n = await
|
|
481
|
+
}, Ye = async (e) => {
|
|
482
|
+
let n = await J(e.root), { plugins: r, schema: i } = await X(e.root);
|
|
481
483
|
return Q({
|
|
482
484
|
mix: n,
|
|
483
485
|
plugins: r,
|
|
@@ -493,4 +495,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
493
495
|
return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
|
|
494
496
|
};
|
|
495
497
|
//#endregion
|
|
496
|
-
export {
|
|
498
|
+
export { ee as C, g as S, U as _, J as a, Ne as b, X as c, W as d, He as f, ze as g, Ue as h, $ as i, K as l, Ge as m, Ye as n, q as o, G as p, Q as r, Y as s, Z as t, qe as u, Be as v, B as x, Pe as y };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e, r as t, t as n } from "./cliOutput-D1tSBoRM.js";
|
|
2
|
-
import { o as r } from "./updateCommand-
|
|
2
|
+
import { o as r } from "./updateCommand-C9n_Z_oG.js";
|
|
3
3
|
import { join as i, resolve as a } from "node:path";
|
|
4
4
|
import { readFileSync as o, readdirSync as s, statSync as c } from "node:fs";
|
|
5
5
|
//#region src/infoCommand.ts
|