@voltro/cli 0.55.0 → 0.57.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 +691 -0
- package/bin/voltro.mjs +24 -0
- package/dist/apiBuild-B83Cb2Rv.js +2 -0
- package/dist/{apiBuild-CMvLJM_K.js → apiBuild-DDr2aNFd.js} +119 -88
- package/dist/bin.js +1 -1
- package/dist/{build-S0QOzqPT.js → build-QKP6Bm0J.js} +308 -279
- package/dist/buildReport-52gHKgfO.js +64 -0
- package/dist/{checkCommand-DNkY5kwF.js → checkCommand-BISqx1OJ.js} +1 -1
- package/dist/{checkCommand-fbj9GDjN.js → checkCommand-DUtMWjcR.js} +6 -6
- package/dist/{clusterCmd-DrVFCzSj.js → clusterCmd-CdLB1GkT.js} +1 -1
- package/dist/{codegen-SIepQtUl.js → codegen-Bth5lUTU.js} +2 -1
- package/dist/codegen-DbH7NbCR.js +2 -0
- package/dist/{codegenCommand-3TDJezom.js → codegenCommand-DnVuDxwT.js} +11 -11
- package/dist/{codemodRunner-C2zxZUIw.js → codemodRunner-BlQPfjzA.js} +222 -0
- package/dist/{commands-BBYJ7Q3B.js → commands-CRbxgxv0.js} +35 -35
- package/dist/{dashboardCommand-D2kmyCLL.js → dashboardCommand-Bf_-Ne3P.js} +5 -5
- package/dist/{dataCommand-BEPPQiTl.js → dataCommand-BoBJJ-Gb.js} +3 -3
- package/dist/{dbCommand-DZTmOFT4.js → dbCommand-CMAIz-Bf.js} +457 -441
- package/dist/dbCommand-DHi_RuDl.js +2 -0
- package/dist/dev-Bl9HqtV7.js +3 -0
- package/dist/{dev-Ca_A_S9v.js → dev-DOEJXicj.js} +2623 -2485
- package/dist/{doctorCommand-CGZJK_4o.js → doctorCommand-BrWu67JZ.js} +524 -280
- package/dist/doctorCommand-DrQv9SL3.js +2 -0
- package/dist/{dormancyCommand-DY2rYpTa.js → dormancyCommand-xn2y-pJm.js} +1 -1
- package/dist/{embeddingsCommand-BoCqZsgp.js → embeddingsCommand-Cn5MbRDM.js} +1 -1
- package/dist/emptyResultHeadline-Csa5fZOF.js +18 -0
- package/dist/{envCommand-Bxy2fOjc.js → envCommand-UJmJIbs9.js} +8 -8
- package/dist/{evolveCommand-BsbZ-XDg.js → evolveCommand-Db30twUy.js} +2 -2
- package/dist/frameworkTableAssembly-B96WCNJA.js +2 -0
- package/dist/{frameworkTableAssembly-Do-cf6RJ.js → frameworkTableAssembly-vfkzuzEo.js} +131 -104
- package/dist/index.js +1 -1
- package/dist/{infoCommand-EmM3jPKD.js → infoCommand-BjVXpMlP.js} +1 -1
- package/dist/inspect-B0hL41s0.js +2 -0
- package/dist/inspect-DZnan87F.js +1500 -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/{logsCmd-B6oNsfaZ.js → logsCmd-C5y9HyrG.js} +59 -54
- package/dist/{manifestBuild-DjX5MoXy.js → manifestBuild-DnbFKF6w.js} +1 -1
- package/dist/manifestBuild-UXrnUcXP.js +2 -0
- package/dist/{migrate-CGFZS-1a.js → migrate-DtC3lu7H.js} +4 -4
- package/dist/precompressAssets-YhTi1aWp.js +40 -0
- package/dist/{probeCommand-Bs3iVBSL.js → probeCommand-C5fuN6Z2.js} +2 -2
- package/dist/{runtimeTrace-C1BTpHGQ.js → runtimeTrace-BQL_lfz6.js} +1 -1
- package/dist/{scheduleCmd-DQRu6BZC.js → scheduleCmd-DYBUfo_T.js} +1 -1
- package/dist/{sdkgen-CXMwLg9n.js → sdkgen-CMUPrDjH.js} +1 -1
- package/dist/{seedRunner-Dgsiwk_e.js → seedRunner-DISBKow-.js} +16 -16
- package/dist/serveCommand-B_w-Mpb_.js +2544 -0
- package/dist/serveCommand-Dtb48ffg.js +2 -0
- package/dist/serveEntry.js +1 -1
- package/dist/{start-EOV7s1NZ.js → start-YaUehtDV.js} +580 -558
- package/dist/{start-DH7cat4-.js → start-s25GAIgn.js} +1 -1
- package/dist/startEntry.js +1 -1
- package/dist/staticCachePolicy-CIyj6DbS.js +15 -0
- package/dist/{test-DO27-x2P.js → test-jipIQ5Mx.js} +1 -1
- package/dist/{tracesCmd-DgtgOUdi.js → tracesCmd-C1qKa94g.js} +69 -64
- package/dist/{updateCommand-C_jN1w18.js → updateCommand-C9n_Z_oG.js} +8 -2
- package/dist/updateCommand-DsXEAHbd.js +2 -0
- package/dist/webDev-B6ZMX42w.js +2 -0
- package/dist/{webDev-B7vNj4Bq.js → webDev-BgdkyjP6.js} +1379 -1303
- package/dist/{webhooksCommand-B1LVcyO3.js → webhooksCommand-CYXTNvXq.js} +2 -2
- package/dist/{workflowsCmd-BGF-mRZ5.js → workflowsCmd-g-DNpaUc.js} +1 -1
- package/package.json +55 -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 +2 -2
- package/templates/agent-docs/ai.md +1 -1
- package/templates/agent-docs/authentication.md +34 -19
- package/templates/agent-docs/cli.md +170 -0
- package/templates/agent-docs/configuration.md +29 -4
- package/templates/agent-docs/data.md +145 -5
- package/templates/agent-docs/database/scaling.md +50 -2
- package/templates/agent-docs/deployment.md +75 -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/audit.md +21 -5
- package/templates/agent-docs/plugins/billing.md +17 -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 +19 -0
- package/templates/agent-docs/reference.md +1 -0
- package/templates/agent-docs/scheduling.md +23 -0
- package/templates/agent-docs/schema-driven-ui.md +81 -0
- package/templates/agent-docs/templates/appshells.md +3 -3
- package/templates/agent-docs/whats-new.md +133 -77
- 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-Cl0IDx8c.js +0 -2
- package/dist/codegen-CN6vMM4J.js +0 -2
- package/dist/dbCommand-BTyBGhIA.js +0 -2
- package/dist/dev-DfVZaoys.js +0 -3
- package/dist/doctorCommand-djmqEcDC.js +0 -2
- package/dist/frameworkTableAssembly-Df2Ymp2f.js +0 -2
- package/dist/inspect-DCqILJ1G.js +0 -1197
- package/dist/inspect-DGJwpOAb.js +0 -2
- package/dist/manifestBuild-CJ2zvPvT.js +0 -2
- package/dist/serveCommand-C7IrCD58.js +0 -2445
- package/dist/serveCommand-Cjt5S9hD.js +0 -2
- package/dist/updateCommand-nnFjDbl4.js +0 -2
- package/dist/webDev-1XpVnYkW.js +0 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/emptyResultHeadline.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let { noun: t, targets: n, failures: r } = e;
|
|
4
|
+
if (n === 0) return `voltro ${t}: no running voltro process was found to ask.`;
|
|
5
|
+
if (r.length < n) return;
|
|
6
|
+
let i = r.find((e) => e.error.trim() !== "")?.error;
|
|
7
|
+
return `voltro ${t}: NOTHING WAS SEARCHED — ${n === 1 ? "the target" : `all ${n} targets`} could not be read` + (i === void 0 ? "." : `: ${i}`);
|
|
8
|
+
}, t = async (e) => {
|
|
9
|
+
let t = `HTTP ${e.status}`;
|
|
10
|
+
try {
|
|
11
|
+
let n = await e.json(), r = typeof n.error == "string" ? n.error : void 0, i = typeof n.reason == "string" ? n.reason.replace(/\s+/g, " ").trim() : void 0;
|
|
12
|
+
return r === void 0 && i === void 0 ? t : `${t}${r === void 0 ? "" : ` ${r}`}${i === void 0 ? "" : ` — ${i}`}`;
|
|
13
|
+
} catch {
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { e as n, t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as e } from "./dev-
|
|
2
|
-
import { Gt as t,
|
|
1
|
+
import { c as e } from "./dev-DOEJXicj.js";
|
|
2
|
+
import { Gt as t, Jt as n, Wt as r, qt as i } from "./webDev-BgdkyjP6.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";
|
|
@@ -28,20 +28,20 @@ var u = s({ scope: "voltro:env" }), d = "# Environment for this app", f = async
|
|
|
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 r = await e(
|
|
40
|
+
}, _ = async (t) => {
|
|
41
|
+
let r = await e(t).catch(() => null);
|
|
42
42
|
if (!r) return u.error("no app.config.ts found in the current directory"), 1;
|
|
43
43
|
let a = l(r.env) ? r.env : void 0;
|
|
44
|
-
return a ? (r.type === "web" ? (await i(
|
|
44
|
+
return a ? (r.type === "web" ? (await i(t, a), u.info("wrote src/voltro-env.d.ts (publicEnv augmentation)", { app: r.name ?? "app" })) : (await n(t, a), u.info("wrote env.generated.d.ts (serverEnv augmentation)", { app: r.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-DUtMWjcR.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,119 +4,119 @@ 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 he, _voltroScheduleClaimsTable as _, _voltroScheduleRunsTable as v, _voltroTracesTable as y, _voltroUndoLogTable as b, _voltroWakeupsTable as x, _voltroWorkflowEventDeliveriesTable as S, _voltroWorkflowEventsTable as C, outboxAttemptsTable as w, outboxTable as T } from "@voltro/runtime";
|
|
10
|
+
import { Effect as E } from "effect";
|
|
11
|
+
import { SqlClient as D } from "@effect/sql";
|
|
12
|
+
import { _voltroBudgetHoldsTable as O, _voltroWorkflowAdmissionsTable as k, _voltroWorkflowPausesTable as A, _voltroWorkflowPendingTable as j, _voltroWorkflowRunEventsTable as M, _voltroWorkflowRunStepsTable as N, _voltroWorkflowRunsTable as P, _voltroWorkflowStartContextsTable as F, _voltroWorkflowWatermarksTable as I } from "@voltro/workflow";
|
|
13
|
+
import { agentMessagesTable as L, agentThreadsTable as R, aiBudgetTable as ge, aiInferencesTable as _e, aiUsageTable as ve, isAgentDescriptor as ye, isAgentExecutor as be, promptsTable as xe, resolveToolModuleHandlers as Se, streamEventsTable as Ce, streamStateTable as we } from "@voltro/ai";
|
|
14
|
+
import { _voltroWebhookDeliveriesTable as Te, _voltroWebhookTargetsTable as Ee } from "@voltro/plugin-webhooks/mixin";
|
|
15
|
+
import { _voltroStorageBlobsTable as De, _voltroStorageGrantsTable as Oe, _voltroStorageRefsTable as ke, _voltroStorageUsageTable as Ae } from "@voltro/plugin-storage";
|
|
16
16
|
//#region src/frameworkTables.ts
|
|
17
|
-
var
|
|
17
|
+
var je = [
|
|
18
18
|
{
|
|
19
|
-
table:
|
|
19
|
+
table: se,
|
|
20
20
|
when: "always"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
table:
|
|
23
|
+
table: de,
|
|
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: P,
|
|
40
40
|
when: "workflows"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
table:
|
|
43
|
+
table: N,
|
|
44
44
|
when: "workflows"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
table:
|
|
47
|
+
table: M,
|
|
48
48
|
when: "workflows"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
table:
|
|
51
|
+
table: F,
|
|
52
52
|
when: "workflows"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
table:
|
|
55
|
+
table: j,
|
|
56
56
|
when: "workflows"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
table:
|
|
59
|
+
table: k,
|
|
60
60
|
when: "workflows"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
table:
|
|
63
|
+
table: A,
|
|
64
64
|
when: "workflows"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
table:
|
|
67
|
+
table: I,
|
|
68
68
|
when: "workflows"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
table:
|
|
71
|
+
table: C,
|
|
72
72
|
when: "workflows"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
table:
|
|
75
|
+
table: S,
|
|
76
76
|
when: "workflows"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
table:
|
|
79
|
+
table: v,
|
|
80
80
|
when: "schedules"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
table:
|
|
83
|
+
table: _,
|
|
84
84
|
when: "schedules"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
table:
|
|
87
|
+
table: Ee,
|
|
88
88
|
when: "webhooks"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
table:
|
|
91
|
+
table: Te,
|
|
92
92
|
when: "webhooks"
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
table:
|
|
95
|
+
table: y,
|
|
96
96
|
when: "traces"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
|
-
table:
|
|
99
|
+
table: b,
|
|
100
100
|
when: "undo"
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
|
-
table:
|
|
103
|
+
table: fe,
|
|
104
104
|
when: "always"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
table:
|
|
107
|
+
table: O,
|
|
108
108
|
when: "workflows"
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
|
-
table:
|
|
111
|
+
table: T,
|
|
112
112
|
when: "always"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
|
-
table:
|
|
115
|
+
table: w,
|
|
116
116
|
when: "always"
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
table:
|
|
119
|
+
table: he,
|
|
120
120
|
when: "connections"
|
|
121
121
|
},
|
|
122
122
|
{
|
|
@@ -124,88 +124,96 @@ var Ee = [
|
|
|
124
124
|
when: "connections"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
table:
|
|
127
|
+
table: x,
|
|
128
128
|
when: "always"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
|
-
table:
|
|
131
|
+
table: ke,
|
|
132
132
|
when: "always"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
table:
|
|
135
|
+
table: Oe,
|
|
136
136
|
when: "always"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
|
-
table:
|
|
139
|
+
table: De,
|
|
140
140
|
when: "always"
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
|
-
table:
|
|
143
|
+
table: Ae,
|
|
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 n =
|
|
166
|
+
], Me = (e) => {
|
|
167
|
+
let t = je.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
|
+
}, Ne = (e, t) => z(e, t.name), z = (e, t) => {
|
|
170
|
+
let n = h(e.name);
|
|
163
171
|
if (!t.includes(".")) return `${n}.${t}`;
|
|
164
172
|
if (e.baseName === void 0) return t;
|
|
165
|
-
let r = `${
|
|
173
|
+
let r = `${h(e.baseName)}.`;
|
|
166
174
|
return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
|
|
167
|
-
},
|
|
175
|
+
}, B = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, Pe = (e, t, n) => {
|
|
168
176
|
switch (e) {
|
|
169
|
-
case "query": return
|
|
177
|
+
case "query": return m({
|
|
170
178
|
name: t,
|
|
171
179
|
input: n.input,
|
|
172
180
|
output: n.output,
|
|
173
181
|
...n.error === void 0 ? {} : { error: n.error },
|
|
174
|
-
...
|
|
182
|
+
...B(n),
|
|
175
183
|
...n.source === void 0 ? {} : { source: n.source }
|
|
176
184
|
});
|
|
177
|
-
case "mutation": return
|
|
185
|
+
case "mutation": return p({
|
|
178
186
|
name: t,
|
|
179
187
|
input: n.input,
|
|
180
188
|
output: n.output,
|
|
181
189
|
...n.error === void 0 ? {} : { error: n.error },
|
|
182
|
-
...
|
|
190
|
+
...B(n)
|
|
183
191
|
});
|
|
184
192
|
case "action": return f({
|
|
185
193
|
name: t,
|
|
186
194
|
input: n.input,
|
|
187
195
|
output: n.output,
|
|
188
196
|
...n.error === void 0 ? {} : { error: n.error },
|
|
189
|
-
...
|
|
197
|
+
...B(n)
|
|
190
198
|
});
|
|
191
199
|
}
|
|
192
|
-
},
|
|
200
|
+
}, Fe = (e) => (t, n) => E.suspend(() => {
|
|
193
201
|
let r = { request: {
|
|
194
202
|
subject: n.request.subject,
|
|
195
203
|
traceId: n.request.traceId
|
|
196
204
|
} };
|
|
197
205
|
return e.execute(t, r);
|
|
198
|
-
}),
|
|
206
|
+
}), Ie = (e) => {
|
|
199
207
|
let t = [];
|
|
200
208
|
for (let n of e) {
|
|
201
209
|
let e = n.routes ?? [];
|
|
202
210
|
for (let r of e) {
|
|
203
|
-
let e =
|
|
211
|
+
let e = Ne(n, r), i = Pe(r.kind, e, r);
|
|
204
212
|
t.push({
|
|
205
213
|
kind: r.kind,
|
|
206
214
|
file: `plugin:${n.name}`,
|
|
207
215
|
descriptor: i,
|
|
208
|
-
executor:
|
|
216
|
+
executor: Fe(r),
|
|
209
217
|
plugin: {
|
|
210
218
|
name: n.name,
|
|
211
219
|
version: n.version
|
|
@@ -214,7 +222,7 @@ var Ee = [
|
|
|
214
222
|
}
|
|
215
223
|
}
|
|
216
224
|
return t;
|
|
217
|
-
},
|
|
225
|
+
}, Le = (e, t, n = /* @__PURE__ */ new Set()) => {
|
|
218
226
|
let r = /* @__PURE__ */ new Map();
|
|
219
227
|
for (let e of t) r.set(e, "user-route");
|
|
220
228
|
let i = [];
|
|
@@ -226,35 +234,35 @@ var Ee = [
|
|
|
226
234
|
}
|
|
227
235
|
}
|
|
228
236
|
return i;
|
|
229
|
-
},
|
|
230
|
-
yield* (yield*
|
|
231
|
-
CREATE TABLE IF NOT EXISTS ${
|
|
237
|
+
}, V = "_voltro_plugin_migrations", Re = () => E.gen(function* () {
|
|
238
|
+
yield* (yield* D.SqlClient).unsafe(`
|
|
239
|
+
CREATE TABLE IF NOT EXISTS ${V} (
|
|
232
240
|
id TEXT PRIMARY KEY,
|
|
233
241
|
plugin_name TEXT NOT NULL,
|
|
234
242
|
migration_id TEXT NOT NULL,
|
|
235
243
|
description TEXT,
|
|
236
244
|
applied_at TEXT NOT NULL
|
|
237
245
|
);
|
|
238
|
-
`).pipe(
|
|
239
|
-
}),
|
|
240
|
-
let e = yield*
|
|
246
|
+
`).pipe(E.orDie);
|
|
247
|
+
}), ze = (e, t) => `${g(e)}__${t}`, Be = () => E.gen(function* () {
|
|
248
|
+
let e = yield* D.SqlClient, t = yield* e`SELECT id FROM ${e(V)}`.pipe(E.orDie);
|
|
241
249
|
return new Set(t.map((e) => e.id));
|
|
242
|
-
}),
|
|
243
|
-
let t = yield*
|
|
250
|
+
}), Ve = (e) => E.gen(function* () {
|
|
251
|
+
let t = yield* D.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
|
|
244
252
|
yield* t`
|
|
245
|
-
INSERT INTO ${t(
|
|
253
|
+
INSERT INTO ${t(V)} (id, plugin_name, migration_id, description, applied_at)
|
|
246
254
|
VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
|
|
247
|
-
`.pipe(
|
|
248
|
-
}),
|
|
255
|
+
`.pipe(E.orDie);
|
|
256
|
+
}), H = (e) => E.gen(function* () {
|
|
249
257
|
let t = e.flatMap((e) => (e.extendSchema?.migrations ?? []).map((t) => ({
|
|
250
258
|
plugin: e,
|
|
251
259
|
migration: t
|
|
252
260
|
})));
|
|
253
261
|
if (t.length === 0) return [];
|
|
254
|
-
yield*
|
|
255
|
-
let n = yield*
|
|
262
|
+
yield* Re();
|
|
263
|
+
let n = yield* Be(), r = [];
|
|
256
264
|
for (let { plugin: e, migration: i } of t) {
|
|
257
|
-
let t =
|
|
265
|
+
let t = ze(e.name, i.id), a = Date.now();
|
|
258
266
|
if (n.has(t)) {
|
|
259
267
|
r.push({
|
|
260
268
|
pluginName: e.name,
|
|
@@ -264,9 +272,9 @@ var Ee = [
|
|
|
264
272
|
});
|
|
265
273
|
continue;
|
|
266
274
|
}
|
|
267
|
-
let o = yield*
|
|
275
|
+
let o = yield* D.SqlClient;
|
|
268
276
|
try {
|
|
269
|
-
yield* i.up(o).pipe(
|
|
277
|
+
yield* i.up(o).pipe(E.mapError((e) => e)), yield* Ve({
|
|
270
278
|
key: t,
|
|
271
279
|
pluginName: e.name,
|
|
272
280
|
migration: i
|
|
@@ -283,33 +291,33 @@ var Ee = [
|
|
|
283
291
|
status: "failed",
|
|
284
292
|
durationMs: Date.now() - a,
|
|
285
293
|
error: t
|
|
286
|
-
}), yield*
|
|
294
|
+
}), yield* E.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
|
|
287
295
|
}
|
|
288
296
|
}
|
|
289
297
|
return r;
|
|
290
|
-
}),
|
|
291
|
-
let n = yield*
|
|
298
|
+
}), He = (e, t) => E.gen(function* () {
|
|
299
|
+
let n = yield* H(e);
|
|
292
300
|
if (n.length === 0) return n;
|
|
293
301
|
let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
|
|
294
302
|
return t(`plugin migrations: ${r.length} applied, ${i.length} already applied`, { applied: r.map((e) => `${e.pluginName}:${e.migrationId}`) }), n;
|
|
295
|
-
}),
|
|
303
|
+
}), Ue = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
|
|
296
304
|
pluginName: e.name,
|
|
297
|
-
pluginAlias:
|
|
305
|
+
pluginAlias: g(e.name),
|
|
298
306
|
tables: e.extendSchema.tables?.length ?? 0,
|
|
299
307
|
migrations: e.extendSchema.migrations?.length ?? 0
|
|
300
|
-
})),
|
|
308
|
+
})), We = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), U = /(?<!\.server)\.agent\.tsx?$/, Ge = /\.agent\.server\.tsx?$/, W = /\.tool\.tsx?$/, Ke = async (t, n) => {
|
|
301
309
|
let r = 0;
|
|
302
|
-
for (let i of t) if (
|
|
310
|
+
for (let i of t) if (W.test(i)) try {
|
|
303
311
|
let t = await e(i);
|
|
304
|
-
r +=
|
|
312
|
+
r += Se(t);
|
|
305
313
|
} catch (e) {
|
|
306
314
|
n.warn("tool: failed to import — handler not wired", { file: i }, e);
|
|
307
315
|
}
|
|
308
316
|
return r;
|
|
309
|
-
},
|
|
317
|
+
}, qe = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Je = async (t, n) => {
|
|
310
318
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
311
319
|
for (let a of t) {
|
|
312
|
-
if (!
|
|
320
|
+
if (!U.test(a)) continue;
|
|
313
321
|
let t;
|
|
314
322
|
try {
|
|
315
323
|
t = await e(a);
|
|
@@ -317,7 +325,7 @@ var Ee = [
|
|
|
317
325
|
n.warn("agent: failed to import descriptor", { file: a }, e);
|
|
318
326
|
continue;
|
|
319
327
|
}
|
|
320
|
-
let o = Object.values(t).find(
|
|
328
|
+
let o = Object.values(t).find(ye);
|
|
321
329
|
if (o === void 0) {
|
|
322
330
|
n.warn("agent: no defineAgent() descriptor export found", { file: a });
|
|
323
331
|
continue;
|
|
@@ -329,7 +337,7 @@ var Ee = [
|
|
|
329
337
|
});
|
|
330
338
|
continue;
|
|
331
339
|
}
|
|
332
|
-
let s =
|
|
340
|
+
let s = qe(a), c;
|
|
333
341
|
try {
|
|
334
342
|
c = await e(s);
|
|
335
343
|
} catch (e) {
|
|
@@ -341,7 +349,7 @@ var Ee = [
|
|
|
341
349
|
continue;
|
|
342
350
|
}
|
|
343
351
|
let l = c.default;
|
|
344
|
-
if (!
|
|
352
|
+
if (!be(l)) {
|
|
345
353
|
n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
|
|
346
354
|
file: s,
|
|
347
355
|
name: o.name
|
|
@@ -356,7 +364,7 @@ var Ee = [
|
|
|
356
364
|
});
|
|
357
365
|
}
|
|
358
366
|
return { agents: r };
|
|
359
|
-
},
|
|
367
|
+
}, G = /\.connection\.tsx?$/, K = (e) => e.replace(G, ""), Ye = async (t, n) => {
|
|
360
368
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
361
369
|
for (let a of t) {
|
|
362
370
|
let t;
|
|
@@ -399,9 +407,9 @@ var Ee = [
|
|
|
399
407
|
}
|
|
400
408
|
return r.length > 0 && n.info("discovered connections", {
|
|
401
409
|
connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
|
|
402
|
-
files: r.map((e) =>
|
|
410
|
+
files: r.map((e) => K(s(e.file)))
|
|
403
411
|
}), r;
|
|
404
|
-
},
|
|
412
|
+
}, q = (e) => o.test(e) || n.test(e), J = async (e) => {
|
|
405
413
|
let t = !1, n = !1, o = !1, s = !1, l = !1, d = async (e) => {
|
|
406
414
|
let f = await u.readdir(e, { withFileTypes: !0 }).catch(() => []);
|
|
407
415
|
for (let u of f) if (u.isDirectory()) {
|
|
@@ -409,7 +417,7 @@ var Ee = [
|
|
|
409
417
|
await d(c(e, u.name));
|
|
410
418
|
} else {
|
|
411
419
|
let e = u.name;
|
|
412
|
-
(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), U.test(e) && (s = !0), G.test(e) && (l = !0);
|
|
413
421
|
}
|
|
414
422
|
};
|
|
415
423
|
return await d(e), {
|
|
@@ -417,9 +425,28 @@ var Ee = [
|
|
|
417
425
|
schedules: n,
|
|
418
426
|
webhooks: o,
|
|
419
427
|
agents: s,
|
|
420
|
-
connections: l
|
|
428
|
+
connections: l,
|
|
429
|
+
ai: await Y(e)
|
|
421
430
|
};
|
|
422
|
-
},
|
|
431
|
+
}, Y = async (e) => {
|
|
432
|
+
let t = await u.readFile(c(e, "package.json"), "utf8").catch(() => void 0);
|
|
433
|
+
if (t === void 0) return !1;
|
|
434
|
+
let n;
|
|
435
|
+
try {
|
|
436
|
+
n = JSON.parse(t);
|
|
437
|
+
} catch {
|
|
438
|
+
return !1;
|
|
439
|
+
}
|
|
440
|
+
for (let e of [
|
|
441
|
+
"dependencies",
|
|
442
|
+
"devDependencies",
|
|
443
|
+
"peerDependencies"
|
|
444
|
+
]) {
|
|
445
|
+
let t = n[e];
|
|
446
|
+
if (typeof t == "object" && t && "@voltro/ai" in t) return !0;
|
|
447
|
+
}
|
|
448
|
+
return !1;
|
|
449
|
+
}, Xe = async (e) => {
|
|
423
450
|
let t = c(e, "app.config.ts");
|
|
424
451
|
if (!l(t)) return { plugins: [] };
|
|
425
452
|
try {
|
|
@@ -434,8 +461,8 @@ var Ee = [
|
|
|
434
461
|
error: e
|
|
435
462
|
};
|
|
436
463
|
}
|
|
437
|
-
},
|
|
438
|
-
let { plugins: t, schema: n, error: r } = await
|
|
464
|
+
}, Ze = async (e) => (await X(e)).plugins, X = async (e) => {
|
|
465
|
+
let { plugins: t, schema: n, error: r } = await Xe(e);
|
|
439
466
|
if (r !== void 0) throw new Z(e, r);
|
|
440
467
|
return {
|
|
441
468
|
plugins: t,
|
|
@@ -457,7 +484,7 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
457
484
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
458
485
|
e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
|
|
459
486
|
};
|
|
460
|
-
for (let t of
|
|
487
|
+
for (let t of Me({
|
|
461
488
|
workflows: e.mix.workflows,
|
|
462
489
|
schedules: e.mix.schedules,
|
|
463
490
|
webhooks: e.mix.webhooks,
|
|
@@ -467,11 +494,11 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
467
494
|
undo: e.gates.undo,
|
|
468
495
|
connections: e.mix.connections
|
|
469
496
|
})) n(t);
|
|
470
|
-
e.mix.agents && (n(
|
|
471
|
-
for (let t of
|
|
497
|
+
e.mix.agents && (n(R), n(L), n(ve), n(ge)), e.mix.workflows && n(_e), e.mix.ai && (n(Ce), n(we)), (e.mix.workflows || e.mix.agents) && n(xe);
|
|
498
|
+
for (let t of We(e.plugins)) n(t);
|
|
472
499
|
return [...t.values()];
|
|
473
|
-
},
|
|
474
|
-
let n = await
|
|
500
|
+
}, Qe = async (e) => {
|
|
501
|
+
let n = await J(e.root), { plugins: r, schema: i } = await X(e.root);
|
|
475
502
|
return Q({
|
|
476
503
|
mix: n,
|
|
477
504
|
plugins: r,
|
|
@@ -487,4 +514,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
487
514
|
return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
|
|
488
515
|
};
|
|
489
516
|
//#endregion
|
|
490
|
-
export {
|
|
517
|
+
export { g as C, z as S, He as _, Y as a, Le as b, Ze as c, Ye as d, U as f, Ke as g, Je as h, $ as i, X as l, W as m, Qe as n, J as o, Ge as p, Q as r, q as s, Z as t, G as u, H as v, ee as w, Ie as x, Ue 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
|