@voltro/cli 0.56.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +395 -0
- package/dist/apiBuild-CDE4NXNi.js +2 -0
- package/dist/{apiBuild-Bdaetr37.js → apiBuild-CkpsCqIu.js} +2 -2
- package/dist/bin.js +1 -1
- package/dist/build-51qBWfYY.js +981 -0
- package/dist/{checkCommand-D0QV_zM_.js → checkCommand-C1EbNmwl.js} +1 -1
- package/dist/{checkCommand-CAwFXrxA.js → checkCommand-C30J2F18.js} +4 -4
- package/dist/{codegenCommand-CidbQzbv.js → codegenCommand-kS3Twuc9.js} +12 -12
- package/dist/{codemodRunner-BlQPfjzA.js → codemodRunner-BKjCwGiN.js} +1127 -895
- package/dist/{commands-CWjfThXv.js → commands-DowWkYtd.js} +25 -25
- package/dist/{dashboardCommand-BekcY5Ls.js → dashboardCommand-gG1y4PFG.js} +3 -3
- package/dist/{dataCommand-2pccgbIy.js → dataCommand-hNOGKz4K.js} +7 -7
- package/dist/{dbCommand-DpK_vQET.js → dbCommand-CMAIz-Bf.js} +3 -3
- package/dist/dbCommand-DHi_RuDl.js +2 -0
- package/dist/{dev-Dw263KPu.js → dev-Ce2gEziv.js} +2411 -2391
- package/dist/dev-Dff_pdik.js +3 -0
- package/dist/{doctorCommand-aR_bFmIi.js → doctorCommand-5ULMpL10.js} +652 -289
- package/dist/doctorCommand-B8H2MYCE.js +2 -0
- package/dist/{dormancyCommand-eXTQMbHU.js → dormancyCommand-DYgI0Kf-.js} +3 -3
- package/dist/{embeddingsCommand-CTmiQvwa.js → embeddingsCommand-yJivQSrI.js} +2 -2
- package/dist/emptyResultHeadline-Csa5fZOF.js +18 -0
- package/dist/{envCommand-BDUgV7EM.js → envCommand-ORJUf8r_.js} +2 -2
- package/dist/{evolveCommand-YV8qW1LU.js → evolveCommand-DTawtTxf.js} +2 -2
- package/dist/frameworkTableAssembly-B96WCNJA.js +2 -0
- package/dist/{frameworkTableAssembly-DNOFXfEQ.js → frameworkTableAssembly-vfkzuzEo.js} +104 -85
- package/dist/index.js +1 -1
- package/dist/{infoCommand-BjVXpMlP.js → infoCommand-BFksHunl.js} +1 -1
- package/dist/inspect-CZvsmp8t.js +2 -0
- package/dist/{inspect-CNYvNXPU.js → inspect-PcC5J-Dl.js} +74 -59
- package/dist/{logsCmd-BU8uCdys.js → logsCmd-C5y9HyrG.js} +58 -53
- package/dist/manifestBuild-AUh31bFU.js +2 -0
- package/dist/{manifestBuild-CEkjfpwc.js → manifestBuild-BwiS4iYm.js} +1 -1
- package/dist/{migrate-SICulyz1.js → migrate-DtC3lu7H.js} +4 -4
- package/dist/{probeCommand-6HxEkNDG.js → probeCommand-BUYzc0CT.js} +1 -1
- package/dist/{runtimeTrace-DgYMc09E.js → runtimeTrace-BUk5zMXY.js} +1 -1
- package/dist/{sdkgen-PY-umd6O.js → sdkgen-CAhmmbjx.js} +1 -1
- package/dist/serveCommand-BUXUtSF5.js +2 -0
- package/dist/serveCommand-DhtC7WBq.js +2545 -0
- package/dist/serveEntry.js +1 -1
- package/dist/{start-BFQQkL1i.js → start-C75w6ftA.js} +1 -1
- package/dist/{start-B9NGB8gn.js → start-DNtIlBcn.js} +527 -502
- package/dist/startEntry.js +1 -1
- package/dist/{tracesCmd-BWYDqMy6.js → tracesCmd-C1qKa94g.js} +68 -63
- package/dist/{updateCommand-C9n_Z_oG.js → updateCommand-CtuD5r1t.js} +1 -1
- package/dist/updateCommand-eVKVHj3N.js +2 -0
- package/dist/webDev-Bzb8ZFus.js +2 -0
- package/dist/{webDev-C53hJdcL.js → webDev-CBN9KkyQ.js} +949 -834
- package/dist/{webhooksCommand-uuPu8qQX.js → webhooksCommand-BPJQOGTe.js} +2 -2
- package/package.json +61 -19
- package/templates/AGENTS.md +1 -1
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/_manifest.json +2 -2
- package/templates/agent-docs/ai.md +175 -1
- package/templates/agent-docs/authentication.md +68 -19
- package/templates/agent-docs/cli.md +48 -0
- package/templates/agent-docs/configuration.md +29 -4
- package/templates/agent-docs/data.md +30 -0
- package/templates/agent-docs/database/scaling.md +10 -1
- package/templates/agent-docs/database/transactions.md +48 -0
- package/templates/agent-docs/deployment.md +22 -0
- package/templates/agent-docs/observability.md +13 -2
- package/templates/agent-docs/plugins/audit.md +21 -5
- package/templates/agent-docs/plugins/auth-supabase.md +21 -0
- package/templates/agent-docs/plugins/billing.md +2 -0
- package/templates/agent-docs/plugins/sentry.md +91 -8
- package/templates/agent-docs/reference.md +1 -0
- package/templates/agent-docs/scheduling.md +23 -0
- package/templates/agent-docs/schema-driven-ui.md +110 -0
- package/templates/agent-docs/whats-new.md +103 -399
- package/templates/apps/api-ai/package.json +6 -6
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +9 -9
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-row-history/package.json +8 -8
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +7 -7
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +7 -7
- package/templates/apps/frontend-app/package.json +8 -8
- package/templates/apps/frontend-auth/package.json +7 -7
- package/templates/apps/frontend-blank/package.json +6 -6
- package/templates/apps/frontend-cms/package.json +8 -8
- package/templates/apps/frontend-collab/package.json +9 -9
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +6 -6
- package/templates/apps/frontend-docs/package.json +8 -8
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-portal/package.json +7 -7
- package/templates/apps/frontend-saas/package.json +7 -7
- package/templates/apps/frontend-spa/package.json +6 -6
- package/templates/apps/frontend-ssr/package.json +6 -6
- package/templates/apps/frontend-ssr-api/package.json +7 -7
- package/templates/apps/frontend-static-blog/package.json +8 -8
- package/templates/apps/frontend-status/package.json +7 -7
- package/templates/apps/mobile-app/package.json +4 -4
- package/dist/apiBuild-Vw1figjO.js +0 -2
- package/dist/build-CI36wL4R.js +0 -868
- package/dist/dbCommand-DrycGWWt.js +0 -2
- package/dist/dev-B9Gz0k85.js +0 -3
- package/dist/doctorCommand-BMWs6aVm.js +0 -2
- package/dist/frameworkTableAssembly-CGNC0qr7.js +0 -2
- package/dist/inspect-S2rWy1Ys.js +0 -2
- package/dist/manifestBuild-DIa_s6u0.js +0 -2
- package/dist/serveCommand-BITS8Hpj.js +0 -2
- package/dist/serveCommand-DIJ3ma76.js +0 -2485
- package/dist/updateCommand-DsXEAHbd.js +0 -2
- package/dist/webDev-C2dRz9s5.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, l as t } from "./dev-Ce2gEziv.js";
|
|
2
2
|
import { n, t as r } from "./cliArgs-D4p8n7EE.js";
|
|
3
3
|
import { r as i } from "./appPort-B_HpJ_ck.js";
|
|
4
4
|
import { resolve as a } from "node:path";
|
|
@@ -14,7 +14,7 @@ var l = [
|
|
|
14
14
|
let d = o({ scope: "dormancy" }), f = {
|
|
15
15
|
info: (e, t) => d.info(e, t ?? {}),
|
|
16
16
|
warn: (e, t) => d.warn(e, t ?? {})
|
|
17
|
-
}, p = a(r(u, l) ?? process.cwd()), m = await
|
|
17
|
+
}, p = a(r(u, l) ?? process.cwd()), m = await t(p), h = (process.env.DB_DIALECT ?? m?.store ?? "memory").toLowerCase();
|
|
18
18
|
if (h === "memory") return d.error("voltro dormancy needs a SQL store (postgres/mysql/mariadb/mssql) — the orchestrator and the app share the `_voltro_wakeups` table, which an in-process `memory` store cannot do. Set DB_DIALECT or the app.config `store` field."), 2;
|
|
19
19
|
let g = i({
|
|
20
20
|
kind: "api",
|
|
@@ -23,7 +23,7 @@ var l = [
|
|
|
23
23
|
flagPort: n(u, "--port")
|
|
24
24
|
});
|
|
25
25
|
for (let e of g.warnings) d.warn(e);
|
|
26
|
-
let _ = g.port, v = Number(n(u, "--app-port") ?? _ + 1), y = Number(n(u, "--idle-grace-ms") ?? 6e4), b = Number(n(u, "--tick-ms") ?? 1e3), x = await
|
|
26
|
+
let _ = g.port, v = Number(n(u, "--app-port") ?? _ + 1), y = Number(n(u, "--idle-grace-ms") ?? 6e4), b = Number(n(u, "--tick-ms") ?? 1e3), x = await e(m, void 0), S = s({
|
|
27
27
|
command: process.execPath,
|
|
28
28
|
args: [
|
|
29
29
|
process.argv[1],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, l as t } from "./dev-Ce2gEziv.js";
|
|
2
2
|
import { Effect as n } from "effect";
|
|
3
3
|
import { embedMany as r } from "@voltro/ai";
|
|
4
4
|
//#region src/embeddingsBackfill.ts
|
|
@@ -58,7 +58,7 @@ var i = (e, t) => e.filter((e) => {
|
|
|
58
58
|
}, c = async (i) => {
|
|
59
59
|
let a = s(i);
|
|
60
60
|
if ("error" in a) return console.error(a.error), 1;
|
|
61
|
-
let c = process.cwd(), l = await
|
|
61
|
+
let c = process.cwd(), l = await t(c), u = await e(l, void 0), d = {
|
|
62
62
|
all: (e) => u.query({ table: e }).then((e) => e.map((e) => ({
|
|
63
63
|
...e,
|
|
64
64
|
id: String(e.id)
|
|
@@ -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 {
|
|
2
|
-
import {
|
|
1
|
+
import { l as e } from "./dev-Ce2gEziv.js";
|
|
2
|
+
import { Jt as t, Xt as n, Zt as r, qt as i } from "./webDev-CBN9KkyQ.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";
|
|
@@ -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-C30J2F18.js";
|
|
3
|
+
import { i as n, n as r } from "./codemodRunner-BKjCwGiN.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";
|
|
@@ -6,15 +6,15 @@ import { existsSync as l, promises as u } from "node:fs";
|
|
|
6
6
|
import { pathToFileURL as d } from "node:url";
|
|
7
7
|
import { defineAction as f, defineMutation as p, defineQuery as m, pluginAlias as h, pluginAlias as g, pluginSlug as ee } from "@voltro/protocol";
|
|
8
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
|
|
10
|
-
import { Effect as
|
|
11
|
-
import { SqlClient as
|
|
12
|
-
import { _voltroBudgetHoldsTable as
|
|
13
|
-
import { agentMessagesTable as
|
|
14
|
-
import { _voltroWebhookDeliveriesTable as
|
|
15
|
-
import { _voltroStorageBlobsTable as
|
|
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
19
|
table: se,
|
|
20
20
|
when: "always"
|
|
@@ -35,10 +35,6 @@ var Oe = [
|
|
|
35
35
|
table: re,
|
|
36
36
|
when: "always"
|
|
37
37
|
},
|
|
38
|
-
{
|
|
39
|
-
table: F,
|
|
40
|
-
when: "workflows"
|
|
41
|
-
},
|
|
42
38
|
{
|
|
43
39
|
table: P,
|
|
44
40
|
when: "workflows"
|
|
@@ -48,27 +44,27 @@ var Oe = [
|
|
|
48
44
|
when: "workflows"
|
|
49
45
|
},
|
|
50
46
|
{
|
|
51
|
-
table:
|
|
47
|
+
table: M,
|
|
52
48
|
when: "workflows"
|
|
53
49
|
},
|
|
54
50
|
{
|
|
55
|
-
table:
|
|
51
|
+
table: F,
|
|
56
52
|
when: "workflows"
|
|
57
53
|
},
|
|
58
54
|
{
|
|
59
|
-
table:
|
|
55
|
+
table: j,
|
|
60
56
|
when: "workflows"
|
|
61
57
|
},
|
|
62
58
|
{
|
|
63
|
-
table:
|
|
59
|
+
table: k,
|
|
64
60
|
when: "workflows"
|
|
65
61
|
},
|
|
66
62
|
{
|
|
67
|
-
table:
|
|
63
|
+
table: A,
|
|
68
64
|
when: "workflows"
|
|
69
65
|
},
|
|
70
66
|
{
|
|
71
|
-
table:
|
|
67
|
+
table: I,
|
|
72
68
|
when: "workflows"
|
|
73
69
|
},
|
|
74
70
|
{
|
|
@@ -76,27 +72,31 @@ var Oe = [
|
|
|
76
72
|
when: "workflows"
|
|
77
73
|
},
|
|
78
74
|
{
|
|
79
|
-
table:
|
|
80
|
-
when: "
|
|
75
|
+
table: S,
|
|
76
|
+
when: "workflows"
|
|
81
77
|
},
|
|
82
78
|
{
|
|
83
79
|
table: v,
|
|
84
80
|
when: "schedules"
|
|
85
81
|
},
|
|
86
82
|
{
|
|
87
|
-
table:
|
|
83
|
+
table: _,
|
|
84
|
+
when: "schedules"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
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
|
{
|
|
@@ -104,19 +104,19 @@ var Oe = [
|
|
|
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,23 +124,23 @@ var Oe = [
|
|
|
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
|
{
|
|
@@ -163,23 +163,23 @@ var Oe = [
|
|
|
163
163
|
table: ue,
|
|
164
164
|
when: "always"
|
|
165
165
|
}
|
|
166
|
-
],
|
|
167
|
-
let t =
|
|
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
168
|
return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? ce : ne), t;
|
|
169
|
-
},
|
|
169
|
+
}, Ne = (e, t) => z(e, t.name), z = (e, t) => {
|
|
170
170
|
let n = h(e.name);
|
|
171
171
|
if (!t.includes(".")) return `${n}.${t}`;
|
|
172
172
|
if (e.baseName === void 0) return t;
|
|
173
173
|
let r = `${h(e.baseName)}.`;
|
|
174
174
|
return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
|
|
175
|
-
},
|
|
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) => {
|
|
176
176
|
switch (e) {
|
|
177
177
|
case "query": return m({
|
|
178
178
|
name: t,
|
|
179
179
|
input: n.input,
|
|
180
180
|
output: n.output,
|
|
181
181
|
...n.error === void 0 ? {} : { error: n.error },
|
|
182
|
-
...
|
|
182
|
+
...B(n),
|
|
183
183
|
...n.source === void 0 ? {} : { source: n.source }
|
|
184
184
|
});
|
|
185
185
|
case "mutation": return p({
|
|
@@ -187,33 +187,33 @@ var Oe = [
|
|
|
187
187
|
input: n.input,
|
|
188
188
|
output: n.output,
|
|
189
189
|
...n.error === void 0 ? {} : { error: n.error },
|
|
190
|
-
...
|
|
190
|
+
...B(n)
|
|
191
191
|
});
|
|
192
192
|
case "action": return f({
|
|
193
193
|
name: t,
|
|
194
194
|
input: n.input,
|
|
195
195
|
output: n.output,
|
|
196
196
|
...n.error === void 0 ? {} : { error: n.error },
|
|
197
|
-
...
|
|
197
|
+
...B(n)
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
},
|
|
200
|
+
}, Fe = (e) => (t, n) => E.suspend(() => {
|
|
201
201
|
let r = { request: {
|
|
202
202
|
subject: n.request.subject,
|
|
203
203
|
traceId: n.request.traceId
|
|
204
204
|
} };
|
|
205
205
|
return e.execute(t, r);
|
|
206
|
-
}),
|
|
206
|
+
}), Ie = (e) => {
|
|
207
207
|
let t = [];
|
|
208
208
|
for (let n of e) {
|
|
209
209
|
let e = n.routes ?? [];
|
|
210
210
|
for (let r of e) {
|
|
211
|
-
let e =
|
|
211
|
+
let e = Ne(n, r), i = Pe(r.kind, e, r);
|
|
212
212
|
t.push({
|
|
213
213
|
kind: r.kind,
|
|
214
214
|
file: `plugin:${n.name}`,
|
|
215
215
|
descriptor: i,
|
|
216
|
-
executor:
|
|
216
|
+
executor: Fe(r),
|
|
217
217
|
plugin: {
|
|
218
218
|
name: n.name,
|
|
219
219
|
version: n.version
|
|
@@ -222,7 +222,7 @@ var Oe = [
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
return t;
|
|
225
|
-
},
|
|
225
|
+
}, Le = (e, t, n = /* @__PURE__ */ new Set()) => {
|
|
226
226
|
let r = /* @__PURE__ */ new Map();
|
|
227
227
|
for (let e of t) r.set(e, "user-route");
|
|
228
228
|
let i = [];
|
|
@@ -234,35 +234,35 @@ var Oe = [
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
return i;
|
|
237
|
-
},
|
|
238
|
-
yield* (yield*
|
|
239
|
-
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} (
|
|
240
240
|
id TEXT PRIMARY KEY,
|
|
241
241
|
plugin_name TEXT NOT NULL,
|
|
242
242
|
migration_id TEXT NOT NULL,
|
|
243
243
|
description TEXT,
|
|
244
244
|
applied_at TEXT NOT NULL
|
|
245
245
|
);
|
|
246
|
-
`).pipe(
|
|
247
|
-
}),
|
|
248
|
-
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);
|
|
249
249
|
return new Set(t.map((e) => e.id));
|
|
250
|
-
}),
|
|
251
|
-
let t = yield*
|
|
250
|
+
}), Ve = (e) => E.gen(function* () {
|
|
251
|
+
let t = yield* D.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
|
|
252
252
|
yield* t`
|
|
253
|
-
INSERT INTO ${t(
|
|
253
|
+
INSERT INTO ${t(V)} (id, plugin_name, migration_id, description, applied_at)
|
|
254
254
|
VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
|
|
255
|
-
`.pipe(
|
|
256
|
-
}),
|
|
255
|
+
`.pipe(E.orDie);
|
|
256
|
+
}), H = (e) => E.gen(function* () {
|
|
257
257
|
let t = e.flatMap((e) => (e.extendSchema?.migrations ?? []).map((t) => ({
|
|
258
258
|
plugin: e,
|
|
259
259
|
migration: t
|
|
260
260
|
})));
|
|
261
261
|
if (t.length === 0) return [];
|
|
262
|
-
yield*
|
|
263
|
-
let n = yield*
|
|
262
|
+
yield* Re();
|
|
263
|
+
let n = yield* Be(), r = [];
|
|
264
264
|
for (let { plugin: e, migration: i } of t) {
|
|
265
|
-
let t =
|
|
265
|
+
let t = ze(e.name, i.id), a = Date.now();
|
|
266
266
|
if (n.has(t)) {
|
|
267
267
|
r.push({
|
|
268
268
|
pluginName: e.name,
|
|
@@ -272,9 +272,9 @@ var Oe = [
|
|
|
272
272
|
});
|
|
273
273
|
continue;
|
|
274
274
|
}
|
|
275
|
-
let o = yield*
|
|
275
|
+
let o = yield* D.SqlClient;
|
|
276
276
|
try {
|
|
277
|
-
yield* i.up(o).pipe(
|
|
277
|
+
yield* i.up(o).pipe(E.mapError((e) => e)), yield* Ve({
|
|
278
278
|
key: t,
|
|
279
279
|
pluginName: e.name,
|
|
280
280
|
migration: i
|
|
@@ -291,33 +291,33 @@ var Oe = [
|
|
|
291
291
|
status: "failed",
|
|
292
292
|
durationMs: Date.now() - a,
|
|
293
293
|
error: t
|
|
294
|
-
}), yield*
|
|
294
|
+
}), yield* E.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
return r;
|
|
298
|
-
}),
|
|
299
|
-
let n = yield*
|
|
298
|
+
}), He = (e, t) => E.gen(function* () {
|
|
299
|
+
let n = yield* H(e);
|
|
300
300
|
if (n.length === 0) return n;
|
|
301
301
|
let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
|
|
302
302
|
return t(`plugin migrations: ${r.length} applied, ${i.length} already applied`, { applied: r.map((e) => `${e.pluginName}:${e.migrationId}`) }), n;
|
|
303
|
-
}),
|
|
303
|
+
}), Ue = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
|
|
304
304
|
pluginName: e.name,
|
|
305
305
|
pluginAlias: g(e.name),
|
|
306
306
|
tables: e.extendSchema.tables?.length ?? 0,
|
|
307
307
|
migrations: e.extendSchema.migrations?.length ?? 0
|
|
308
|
-
})),
|
|
308
|
+
})), We = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), U = /(?<!\.server)\.agent\.tsx?$/, Ge = /\.agent\.server\.tsx?$/, W = /\.tool\.tsx?$/, Ke = async (t, n) => {
|
|
309
309
|
let r = 0;
|
|
310
|
-
for (let i of t) if (
|
|
310
|
+
for (let i of t) if (W.test(i)) try {
|
|
311
311
|
let t = await e(i);
|
|
312
|
-
r +=
|
|
312
|
+
r += Se(t);
|
|
313
313
|
} catch (e) {
|
|
314
314
|
n.warn("tool: failed to import — handler not wired", { file: i }, e);
|
|
315
315
|
}
|
|
316
316
|
return r;
|
|
317
|
-
},
|
|
317
|
+
}, qe = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Je = async (t, n) => {
|
|
318
318
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
319
319
|
for (let a of t) {
|
|
320
|
-
if (!
|
|
320
|
+
if (!U.test(a)) continue;
|
|
321
321
|
let t;
|
|
322
322
|
try {
|
|
323
323
|
t = await e(a);
|
|
@@ -325,7 +325,7 @@ var Oe = [
|
|
|
325
325
|
n.warn("agent: failed to import descriptor", { file: a }, e);
|
|
326
326
|
continue;
|
|
327
327
|
}
|
|
328
|
-
let o = Object.values(t).find(
|
|
328
|
+
let o = Object.values(t).find(ye);
|
|
329
329
|
if (o === void 0) {
|
|
330
330
|
n.warn("agent: no defineAgent() descriptor export found", { file: a });
|
|
331
331
|
continue;
|
|
@@ -337,7 +337,7 @@ var Oe = [
|
|
|
337
337
|
});
|
|
338
338
|
continue;
|
|
339
339
|
}
|
|
340
|
-
let s =
|
|
340
|
+
let s = qe(a), c;
|
|
341
341
|
try {
|
|
342
342
|
c = await e(s);
|
|
343
343
|
} catch (e) {
|
|
@@ -349,7 +349,7 @@ var Oe = [
|
|
|
349
349
|
continue;
|
|
350
350
|
}
|
|
351
351
|
let l = c.default;
|
|
352
|
-
if (!
|
|
352
|
+
if (!be(l)) {
|
|
353
353
|
n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
|
|
354
354
|
file: s,
|
|
355
355
|
name: o.name
|
|
@@ -364,7 +364,7 @@ var Oe = [
|
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
return { agents: r };
|
|
367
|
-
},
|
|
367
|
+
}, G = /\.connection\.tsx?$/, K = (e) => e.replace(G, ""), Ye = async (t, n) => {
|
|
368
368
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
369
369
|
for (let a of t) {
|
|
370
370
|
let t;
|
|
@@ -407,7 +407,7 @@ var Oe = [
|
|
|
407
407
|
}
|
|
408
408
|
return r.length > 0 && n.info("discovered connections", {
|
|
409
409
|
connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
|
|
410
|
-
files: r.map((e) =>
|
|
410
|
+
files: r.map((e) => K(s(e.file)))
|
|
411
411
|
}), r;
|
|
412
412
|
}, q = (e) => o.test(e) || n.test(e), J = async (e) => {
|
|
413
413
|
let t = !1, n = !1, o = !1, s = !1, l = !1, d = async (e) => {
|
|
@@ -417,7 +417,7 @@ var Oe = [
|
|
|
417
417
|
await d(c(e, u.name));
|
|
418
418
|
} else {
|
|
419
419
|
let e = u.name;
|
|
420
|
-
(r.test(e) || a.test(e)) && (t = !0), q(e) && (n = !0), i.test(e) && (o = !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);
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
423
|
return await d(e), {
|
|
@@ -425,9 +425,28 @@ var Oe = [
|
|
|
425
425
|
schedules: n,
|
|
426
426
|
webhooks: o,
|
|
427
427
|
agents: s,
|
|
428
|
-
connections: l
|
|
428
|
+
connections: l,
|
|
429
|
+
ai: await Y(e)
|
|
429
430
|
};
|
|
430
|
-
},
|
|
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) => {
|
|
431
450
|
let t = c(e, "app.config.ts");
|
|
432
451
|
if (!l(t)) return { plugins: [] };
|
|
433
452
|
try {
|
|
@@ -442,8 +461,8 @@ var Oe = [
|
|
|
442
461
|
error: e
|
|
443
462
|
};
|
|
444
463
|
}
|
|
445
|
-
},
|
|
446
|
-
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);
|
|
447
466
|
if (r !== void 0) throw new Z(e, r);
|
|
448
467
|
return {
|
|
449
468
|
plugins: t,
|
|
@@ -465,7 +484,7 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
465
484
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
466
485
|
e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
|
|
467
486
|
};
|
|
468
|
-
for (let t of
|
|
487
|
+
for (let t of Me({
|
|
469
488
|
workflows: e.mix.workflows,
|
|
470
489
|
schedules: e.mix.schedules,
|
|
471
490
|
webhooks: e.mix.webhooks,
|
|
@@ -475,10 +494,10 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
475
494
|
undo: e.gates.undo,
|
|
476
495
|
connections: e.mix.connections
|
|
477
496
|
})) n(t);
|
|
478
|
-
e.mix.agents && (n(
|
|
479
|
-
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);
|
|
480
499
|
return [...t.values()];
|
|
481
|
-
},
|
|
500
|
+
}, Qe = async (e) => {
|
|
482
501
|
let n = await J(e.root), { plugins: r, schema: i } = await X(e.root);
|
|
483
502
|
return Q({
|
|
484
503
|
mix: n,
|
|
@@ -495,4 +514,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
|
|
|
495
514
|
return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
|
|
496
515
|
};
|
|
497
516
|
//#endregion
|
|
498
|
-
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-CtuD5r1t.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
|