@voltro/cli 0.56.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.
Files changed (115) hide show
  1. package/CHANGELOG.md +194 -0
  2. package/dist/apiBuild-B83Cb2Rv.js +2 -0
  3. package/dist/{apiBuild-Bdaetr37.js → apiBuild-DDr2aNFd.js} +2 -2
  4. package/dist/bin.js +1 -1
  5. package/dist/{build-CI36wL4R.js → build-QKP6Bm0J.js} +191 -187
  6. package/dist/{checkCommand-D0QV_zM_.js → checkCommand-BISqx1OJ.js} +1 -1
  7. package/dist/{checkCommand-CAwFXrxA.js → checkCommand-DUtMWjcR.js} +4 -4
  8. package/dist/{codegenCommand-CidbQzbv.js → codegenCommand-DnVuDxwT.js} +10 -10
  9. package/dist/{commands-CWjfThXv.js → commands-CRbxgxv0.js} +22 -22
  10. package/dist/{dashboardCommand-BekcY5Ls.js → dashboardCommand-Bf_-Ne3P.js} +5 -5
  11. package/dist/{dataCommand-2pccgbIy.js → dataCommand-BoBJJ-Gb.js} +2 -2
  12. package/dist/{dbCommand-DpK_vQET.js → dbCommand-CMAIz-Bf.js} +3 -3
  13. package/dist/dbCommand-DHi_RuDl.js +2 -0
  14. package/dist/dev-Bl9HqtV7.js +3 -0
  15. package/dist/{dev-Dw263KPu.js → dev-DOEJXicj.js} +2109 -2092
  16. package/dist/{doctorCommand-aR_bFmIi.js → doctorCommand-BrWu67JZ.js} +331 -189
  17. package/dist/doctorCommand-DrQv9SL3.js +2 -0
  18. package/dist/{dormancyCommand-eXTQMbHU.js → dormancyCommand-xn2y-pJm.js} +1 -1
  19. package/dist/{embeddingsCommand-CTmiQvwa.js → embeddingsCommand-Cn5MbRDM.js} +1 -1
  20. package/dist/emptyResultHeadline-Csa5fZOF.js +18 -0
  21. package/dist/{envCommand-BDUgV7EM.js → envCommand-UJmJIbs9.js} +8 -8
  22. package/dist/{evolveCommand-YV8qW1LU.js → evolveCommand-Db30twUy.js} +1 -1
  23. package/dist/frameworkTableAssembly-B96WCNJA.js +2 -0
  24. package/dist/{frameworkTableAssembly-DNOFXfEQ.js → frameworkTableAssembly-vfkzuzEo.js} +104 -85
  25. package/dist/index.js +1 -1
  26. package/dist/inspect-B0hL41s0.js +2 -0
  27. package/dist/{inspect-CNYvNXPU.js → inspect-DZnan87F.js} +68 -52
  28. package/dist/{logsCmd-BU8uCdys.js → logsCmd-C5y9HyrG.js} +58 -53
  29. package/dist/{manifestBuild-CEkjfpwc.js → manifestBuild-DnbFKF6w.js} +1 -1
  30. package/dist/manifestBuild-UXrnUcXP.js +2 -0
  31. package/dist/{migrate-SICulyz1.js → migrate-DtC3lu7H.js} +4 -4
  32. package/dist/{probeCommand-6HxEkNDG.js → probeCommand-C5fuN6Z2.js} +1 -1
  33. package/dist/{runtimeTrace-DgYMc09E.js → runtimeTrace-BQL_lfz6.js} +1 -1
  34. package/dist/{sdkgen-PY-umd6O.js → sdkgen-CMUPrDjH.js} +1 -1
  35. package/dist/{serveCommand-DIJ3ma76.js → serveCommand-B_w-Mpb_.js} +1013 -954
  36. package/dist/serveCommand-Dtb48ffg.js +2 -0
  37. package/dist/serveEntry.js +1 -1
  38. package/dist/{start-B9NGB8gn.js → start-YaUehtDV.js} +564 -571
  39. package/dist/{start-BFQQkL1i.js → start-s25GAIgn.js} +1 -1
  40. package/dist/startEntry.js +1 -1
  41. package/dist/{tracesCmd-BWYDqMy6.js → tracesCmd-C1qKa94g.js} +68 -63
  42. package/dist/{webDev-C2dRz9s5.js → webDev-B6ZMX42w.js} +1 -1
  43. package/dist/{webDev-C53hJdcL.js → webDev-BgdkyjP6.js} +881 -774
  44. package/dist/{webhooksCommand-uuPu8qQX.js → webhooksCommand-CYXTNvXq.js} +2 -2
  45. package/package.json +19 -19
  46. package/templates/AGENTS.md +1 -1
  47. package/templates/agent-docs/_index.md +1 -1
  48. package/templates/agent-docs/_manifest.json +1 -1
  49. package/templates/agent-docs/ai.md +1 -1
  50. package/templates/agent-docs/authentication.md +34 -19
  51. package/templates/agent-docs/cli.md +48 -0
  52. package/templates/agent-docs/configuration.md +29 -4
  53. package/templates/agent-docs/database/scaling.md +10 -1
  54. package/templates/agent-docs/deployment.md +22 -0
  55. package/templates/agent-docs/plugins/audit.md +21 -5
  56. package/templates/agent-docs/plugins/billing.md +2 -0
  57. package/templates/agent-docs/reference.md +1 -0
  58. package/templates/agent-docs/scheduling.md +23 -0
  59. package/templates/agent-docs/schema-driven-ui.md +81 -0
  60. package/templates/agent-docs/whats-new.md +100 -403
  61. package/templates/apps/api-ai/package.json +6 -6
  62. package/templates/apps/api-auth/package.json +8 -8
  63. package/templates/apps/api-backend/package.json +7 -7
  64. package/templates/apps/api-backend-deactivation/package.json +7 -7
  65. package/templates/apps/api-backend-mail/package.json +8 -8
  66. package/templates/apps/api-backend-mariadb/package.json +9 -9
  67. package/templates/apps/api-backend-sqlite/package.json +8 -8
  68. package/templates/apps/api-backend-storage/package.json +8 -8
  69. package/templates/apps/api-cms/package.json +9 -9
  70. package/templates/apps/api-collab/package.json +8 -8
  71. package/templates/apps/api-data-advanced/package.json +8 -8
  72. package/templates/apps/api-durable/package.json +8 -8
  73. package/templates/apps/api-feature-flags/package.json +9 -9
  74. package/templates/apps/api-governance/package.json +8 -8
  75. package/templates/apps/api-kv/package.json +8 -8
  76. package/templates/apps/api-moderation/package.json +8 -8
  77. package/templates/apps/api-observability/package.json +8 -8
  78. package/templates/apps/api-ratelimit/package.json +8 -8
  79. package/templates/apps/api-rbac/package.json +8 -8
  80. package/templates/apps/api-rest/package.json +7 -7
  81. package/templates/apps/api-row-history/package.json +8 -8
  82. package/templates/apps/api-saas/package.json +11 -11
  83. package/templates/apps/api-saas-starter/package.json +10 -10
  84. package/templates/apps/api-search/package.json +8 -8
  85. package/templates/apps/api-status/package.json +8 -8
  86. package/templates/apps/api-webhooks/package.json +9 -9
  87. package/templates/apps/changelog/package.json +7 -7
  88. package/templates/apps/edge-functions/package.json +2 -2
  89. package/templates/apps/frontend-admin/package.json +7 -7
  90. package/templates/apps/frontend-app/package.json +8 -8
  91. package/templates/apps/frontend-auth/package.json +7 -7
  92. package/templates/apps/frontend-blank/package.json +6 -6
  93. package/templates/apps/frontend-cms/package.json +8 -8
  94. package/templates/apps/frontend-collab/package.json +9 -9
  95. package/templates/apps/frontend-contact/package.json +7 -7
  96. package/templates/apps/frontend-dashboard/package.json +6 -6
  97. package/templates/apps/frontend-docs/package.json +8 -8
  98. package/templates/apps/frontend-i18n/package.json +6 -6
  99. package/templates/apps/frontend-landing/package.json +7 -7
  100. package/templates/apps/frontend-portal/package.json +7 -7
  101. package/templates/apps/frontend-saas/package.json +7 -7
  102. package/templates/apps/frontend-spa/package.json +6 -6
  103. package/templates/apps/frontend-ssr/package.json +6 -6
  104. package/templates/apps/frontend-ssr-api/package.json +7 -7
  105. package/templates/apps/frontend-static-blog/package.json +8 -8
  106. package/templates/apps/frontend-status/package.json +7 -7
  107. package/templates/apps/mobile-app/package.json +4 -4
  108. package/dist/apiBuild-Vw1figjO.js +0 -2
  109. package/dist/dbCommand-DrycGWWt.js +0 -2
  110. package/dist/dev-B9Gz0k85.js +0 -3
  111. package/dist/doctorCommand-BMWs6aVm.js +0 -2
  112. package/dist/frameworkTableAssembly-CGNC0qr7.js +0 -2
  113. package/dist/inspect-S2rWy1Ys.js +0 -2
  114. package/dist/manifestBuild-DIa_s6u0.js +0 -2
  115. package/dist/serveCommand-BITS8Hpj.js +0 -2
@@ -0,0 +1,2 @@
1
+ import { b as e, y as t } from "./doctorCommand-BrWu67JZ.js";
2
+ export { t as runDoctorCommand, e as runServePreflight };
@@ -1,4 +1,4 @@
1
- import { c as e, i as t } from "./dev-Dw263KPu.js";
1
+ import { c as e, i as t } from "./dev-DOEJXicj.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";
@@ -1,4 +1,4 @@
1
- import { c as e, i as t } from "./dev-Dw263KPu.js";
1
+ import { c as e, i as t } from "./dev-DOEJXicj.js";
2
2
  import { Effect as n } from "effect";
3
3
  import { embedMany as r } from "@voltro/ai";
4
4
  //#region src/embeddingsBackfill.ts
@@ -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-Dw263KPu.js";
2
- import { Bt as t, Ht as n, Ut as r, zt as i } from "./webDev-C53hJdcL.js";
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";
@@ -21,8 +21,8 @@ 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 = 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);
24
+ let n = r(t.name, t.input), i = `${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(i);
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}`);
@@ -38,10 +38,10 @@ var u = s({ scope: "voltro:env" }), d = "# Environment for this app", f = async
38
38
  }
39
39
  return await o.writeFile(s, i, "utf8"), u.info("wrote .env.example", { app: r.name }), 0;
40
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);
41
+ let r = await e(t).catch(() => null);
42
+ if (!r) return u.error("no app.config.ts found in the current directory"), 1;
43
+ let a = l(r.env) ? r.env : void 0;
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,5 +1,5 @@
1
1
  import { n as e } from "./cliOutput-D1tSBoRM.js";
2
- import { i as t } from "./checkCommand-CAwFXrxA.js";
2
+ import { i as t } from "./checkCommand-DUtMWjcR.js";
3
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";
@@ -0,0 +1,2 @@
1
+ import { l as e, n as t } from "./frameworkTableAssembly-vfkzuzEo.js";
2
+ export { t as assembleFrameworkTables, e as loadAppSchemaInputs };
@@ -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 _, _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";
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 Oe = [
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: I,
47
+ table: M,
52
48
  when: "workflows"
53
49
  },
54
50
  {
55
- table: M,
51
+ table: F,
56
52
  when: "workflows"
57
53
  },
58
54
  {
59
- table: A,
55
+ table: j,
60
56
  when: "workflows"
61
57
  },
62
58
  {
63
- table: j,
59
+ table: k,
64
60
  when: "workflows"
65
61
  },
66
62
  {
67
- table: L,
63
+ table: A,
68
64
  when: "workflows"
69
65
  },
70
66
  {
71
- table: w,
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: y,
80
- when: "schedules"
75
+ table: S,
76
+ when: "workflows"
81
77
  },
82
78
  {
83
79
  table: v,
84
80
  when: "schedules"
85
81
  },
86
82
  {
87
- table: Ce,
83
+ table: _,
84
+ when: "schedules"
85
+ },
86
+ {
87
+ table: Ee,
88
88
  when: "webhooks"
89
89
  },
90
90
  {
91
- table: Se,
91
+ table: Te,
92
92
  when: "webhooks"
93
93
  },
94
94
  {
95
- table: b,
95
+ table: y,
96
96
  when: "traces"
97
97
  },
98
98
  {
99
- table: x,
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: k,
107
+ table: O,
108
108
  when: "workflows"
109
109
  },
110
110
  {
111
- table: E,
111
+ table: T,
112
112
  when: "always"
113
113
  },
114
114
  {
115
- table: T,
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: S,
127
+ table: x,
128
128
  when: "always"
129
129
  },
130
130
  {
131
- table: Ee,
131
+ table: ke,
132
132
  when: "always"
133
133
  },
134
134
  {
135
- table: Te,
135
+ table: Oe,
136
136
  when: "always"
137
137
  },
138
138
  {
139
- table: we,
139
+ table: De,
140
140
  when: "always"
141
141
  },
142
142
  {
143
- table: De,
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
- ], 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);
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
- }, Ae = (e, t) => B(e, t.name), B = (e, t) => {
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
- }, V = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, je = (e, t, n) => {
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
- ...V(n),
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
- ...V(n)
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
- ...V(n)
197
+ ...B(n)
198
198
  });
199
199
  }
200
- }, Me = (e) => (t, n) => D.suspend(() => {
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
- }), Ne = (e) => {
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 = Ae(n, r), i = je(r.kind, e, r);
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: Me(r),
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
- }, Pe = (e, t, n = /* @__PURE__ */ new Set()) => {
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
- }, H = "_voltro_plugin_migrations", Fe = () => D.gen(function* () {
238
- yield* (yield* O.SqlClient).unsafe(`
239
- CREATE TABLE IF NOT EXISTS ${H} (
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(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);
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
- }), Re = (e) => D.gen(function* () {
251
- let t = yield* O.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
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(H)} (id, plugin_name, migration_id, description, applied_at)
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(D.orDie);
256
- }), U = (e) => D.gen(function* () {
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* Fe();
263
- let n = yield* Le(), r = [];
262
+ yield* Re();
263
+ let n = yield* Be(), r = [];
264
264
  for (let { plugin: e, migration: i } of t) {
265
- let t = Ie(e.name, i.id), a = Date.now();
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* O.SqlClient;
275
+ let o = yield* D.SqlClient;
276
276
  try {
277
- yield* i.up(o).pipe(D.mapError((e) => e)), yield* Re({
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* D.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
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
- }), ze = (e, t) => D.gen(function* () {
299
- let n = yield* U(e);
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
- }), Be = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
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
- })), Ve = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, He = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, Ue = async (t, n) => {
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 (G.test(i)) try {
310
+ for (let i of t) if (W.test(i)) try {
311
311
  let t = await e(i);
312
- r += xe(t);
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
- }, We = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ge = async (t, n) => {
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 (!W.test(a)) continue;
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(ve);
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 = We(a), c;
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 (!ye(l)) {
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
- }, K = /\.connection\.tsx?$/, Ke = (e) => e.replace(K, ""), qe = async (t, n) => {
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) => Ke(s(e.file)))
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), W.test(e) && (s = !0), K.test(e) && (l = !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
- }, Je = async (e) => {
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
- }, Y = async (e) => (await X(e)).plugins, X = async (e) => {
446
- let { plugins: t, schema: n, error: r } = await Je(e);
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 ke({
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(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);
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
- }, Ye = async (e) => {
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 { 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 };
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,4 +1,4 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-CWjfThXv.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-CRbxgxv0.js";
2
2
  import { r as o } from "./templates-BTWZkJJT.js";
3
3
  //#region src/index.ts
4
4
  var s = "framework";
@@ -0,0 +1,2 @@
1
+ import { i as e } from "./inspect-DZnan87F.js";
2
+ export { e as buildCapabilityManifest };