@voltro/cli 0.55.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/CHANGELOG.md +497 -0
  2. package/bin/voltro.mjs +24 -0
  3. package/dist/{apiBuild-CMvLJM_K.js → apiBuild-Bdaetr37.js} +119 -88
  4. package/dist/apiBuild-Vw1figjO.js +2 -0
  5. package/dist/bin.js +1 -1
  6. package/dist/{build-S0QOzqPT.js → build-CI36wL4R.js} +337 -312
  7. package/dist/buildReport-52gHKgfO.js +64 -0
  8. package/dist/{checkCommand-fbj9GDjN.js → checkCommand-CAwFXrxA.js} +6 -6
  9. package/dist/{checkCommand-DNkY5kwF.js → checkCommand-D0QV_zM_.js} +1 -1
  10. package/dist/{clusterCmd-DrVFCzSj.js → clusterCmd-CdLB1GkT.js} +1 -1
  11. package/dist/{codegen-SIepQtUl.js → codegen-Bth5lUTU.js} +2 -1
  12. package/dist/codegen-DbH7NbCR.js +2 -0
  13. package/dist/{codegenCommand-3TDJezom.js → codegenCommand-CidbQzbv.js} +10 -10
  14. package/dist/{codemodRunner-C2zxZUIw.js → codemodRunner-BlQPfjzA.js} +222 -0
  15. package/dist/{commands-BBYJ7Q3B.js → commands-CWjfThXv.js} +35 -35
  16. package/dist/{dashboardCommand-D2kmyCLL.js → dashboardCommand-BekcY5Ls.js} +3 -3
  17. package/dist/{dataCommand-BEPPQiTl.js → dataCommand-2pccgbIy.js} +3 -3
  18. package/dist/{dbCommand-DZTmOFT4.js → dbCommand-DpK_vQET.js} +457 -441
  19. package/dist/dbCommand-DrycGWWt.js +2 -0
  20. package/dist/{dev-DfVZaoys.js → dev-B9Gz0k85.js} +1 -1
  21. package/dist/{dev-Ca_A_S9v.js → dev-Dw263KPu.js} +2603 -2482
  22. package/dist/doctorCommand-BMWs6aVm.js +2 -0
  23. package/dist/{doctorCommand-CGZJK_4o.js → doctorCommand-aR_bFmIi.js} +353 -251
  24. package/dist/{dormancyCommand-DY2rYpTa.js → dormancyCommand-eXTQMbHU.js} +1 -1
  25. package/dist/{embeddingsCommand-BoCqZsgp.js → embeddingsCommand-CTmiQvwa.js} +1 -1
  26. package/dist/{envCommand-Bxy2fOjc.js → envCommand-BDUgV7EM.js} +12 -12
  27. package/dist/{evolveCommand-BsbZ-XDg.js → evolveCommand-YV8qW1LU.js} +2 -2
  28. package/dist/frameworkTableAssembly-CGNC0qr7.js +2 -0
  29. package/dist/{frameworkTableAssembly-Do-cf6RJ.js → frameworkTableAssembly-DNOFXfEQ.js} +92 -84
  30. package/dist/index.js +1 -1
  31. package/dist/{infoCommand-EmM3jPKD.js → infoCommand-BjVXpMlP.js} +1 -1
  32. package/dist/inspect-CNYvNXPU.js +1484 -0
  33. package/dist/inspect-S2rWy1Ys.js +2 -0
  34. package/dist/{inspectCmd-niF97fAq.js → inspectCmd-CP-G0sVK.js} +1 -1
  35. package/dist/{inspectFetch-EMuhTG_9.js → inspectFetch-BU1NyzxV.js} +36 -24
  36. package/dist/{inspectMetrics-CGF94puw.js → inspectMetrics-BY0Sjb2F.js} +19 -19
  37. package/dist/{logsCmd-B6oNsfaZ.js → logsCmd-BU8uCdys.js} +1 -1
  38. package/dist/{manifestBuild-DjX5MoXy.js → manifestBuild-CEkjfpwc.js} +1 -1
  39. package/dist/manifestBuild-DIa_s6u0.js +2 -0
  40. package/dist/{migrate-CGFZS-1a.js → migrate-SICulyz1.js} +2 -2
  41. package/dist/precompressAssets-YhTi1aWp.js +40 -0
  42. package/dist/{probeCommand-Bs3iVBSL.js → probeCommand-6HxEkNDG.js} +2 -2
  43. package/dist/{runtimeTrace-C1BTpHGQ.js → runtimeTrace-DgYMc09E.js} +1 -1
  44. package/dist/{scheduleCmd-DQRu6BZC.js → scheduleCmd-DYBUfo_T.js} +1 -1
  45. package/dist/{sdkgen-CXMwLg9n.js → sdkgen-PY-umd6O.js} +1 -1
  46. package/dist/{seedRunner-Dgsiwk_e.js → seedRunner-DISBKow-.js} +16 -16
  47. package/dist/serveCommand-BITS8Hpj.js +2 -0
  48. package/dist/{serveCommand-C7IrCD58.js → serveCommand-DIJ3ma76.js} +910 -870
  49. package/dist/serveEntry.js +1 -1
  50. package/dist/{start-EOV7s1NZ.js → start-B9NGB8gn.js} +575 -546
  51. package/dist/{start-DH7cat4-.js → start-BFQQkL1i.js} +1 -1
  52. package/dist/startEntry.js +1 -1
  53. package/dist/staticCachePolicy-CIyj6DbS.js +15 -0
  54. package/dist/{test-DO27-x2P.js → test-jipIQ5Mx.js} +1 -1
  55. package/dist/{tracesCmd-DgtgOUdi.js → tracesCmd-BWYDqMy6.js} +1 -1
  56. package/dist/{updateCommand-C_jN1w18.js → updateCommand-C9n_Z_oG.js} +8 -2
  57. package/dist/updateCommand-DsXEAHbd.js +2 -0
  58. package/dist/webDev-C2dRz9s5.js +2 -0
  59. package/dist/{webDev-B7vNj4Bq.js → webDev-C53hJdcL.js} +1240 -1271
  60. package/dist/{webhooksCommand-B1LVcyO3.js → webhooksCommand-uuPu8qQX.js} +1 -1
  61. package/dist/{workflowsCmd-BGF-mRZ5.js → workflowsCmd-g-DNpaUc.js} +1 -1
  62. package/package.json +55 -19
  63. package/templates/AGENTS.core.md +20 -1
  64. package/templates/AGENTS.md +21 -2
  65. package/templates/agent-docs/_index.md +1 -1
  66. package/templates/agent-docs/_manifest.json +1 -1
  67. package/templates/agent-docs/cli.md +122 -0
  68. package/templates/agent-docs/data.md +145 -5
  69. package/templates/agent-docs/database/scaling.md +40 -1
  70. package/templates/agent-docs/deployment.md +53 -1
  71. package/templates/agent-docs/internationalization.md +32 -0
  72. package/templates/agent-docs/local-first-mobile.md +9 -2
  73. package/templates/agent-docs/observability.md +227 -0
  74. package/templates/agent-docs/plugins/billing.md +15 -0
  75. package/templates/agent-docs/plugins/broadcast.md +2 -1
  76. package/templates/agent-docs/plugins/ratelimit.md +6 -1
  77. package/templates/agent-docs/plugins/row-history.md +11 -0
  78. package/templates/agent-docs/plugins.md +19 -0
  79. package/templates/agent-docs/templates/appshells.md +3 -3
  80. package/templates/agent-docs/whats-new.md +432 -73
  81. package/templates/apps/api-ai/package.json +6 -6
  82. package/templates/apps/api-auth/package.json +8 -8
  83. package/templates/apps/api-backend/package.json +7 -7
  84. package/templates/apps/api-backend-deactivation/package.json +7 -7
  85. package/templates/apps/api-backend-mail/package.json +8 -8
  86. package/templates/apps/api-backend-mariadb/package.json +9 -9
  87. package/templates/apps/api-backend-sqlite/package.json +8 -8
  88. package/templates/apps/api-backend-storage/package.json +8 -8
  89. package/templates/apps/api-cms/package.json +9 -9
  90. package/templates/apps/api-collab/package.json +8 -8
  91. package/templates/apps/api-data-advanced/package.json +8 -8
  92. package/templates/apps/api-durable/package.json +8 -8
  93. package/templates/apps/api-feature-flags/package.json +9 -9
  94. package/templates/apps/api-governance/package.json +8 -8
  95. package/templates/apps/api-kv/package.json +8 -8
  96. package/templates/apps/api-moderation/package.json +8 -8
  97. package/templates/apps/api-observability/package.json +8 -8
  98. package/templates/apps/api-ratelimit/package.json +8 -8
  99. package/templates/apps/api-rbac/package.json +8 -8
  100. package/templates/apps/api-rest/package.json +7 -7
  101. package/templates/apps/api-row-history/package.json +8 -8
  102. package/templates/apps/api-saas/package.json +11 -11
  103. package/templates/apps/api-saas-starter/package.json +10 -10
  104. package/templates/apps/api-search/package.json +8 -8
  105. package/templates/apps/api-status/package.json +8 -8
  106. package/templates/apps/api-webhooks/package.json +9 -9
  107. package/templates/apps/changelog/package.json +7 -7
  108. package/templates/apps/changelog/src/pages/[locale]/page.tsx +7 -1
  109. package/templates/apps/edge-functions/package.json +2 -2
  110. package/templates/apps/frontend-admin/package.json +7 -8
  111. package/templates/apps/frontend-admin/src/pages/(marketing)/layout.tsx +1 -2
  112. package/templates/apps/frontend-admin/src/pages/admin/layout.tsx +1 -2
  113. package/templates/apps/frontend-app/package.json +8 -9
  114. package/templates/apps/frontend-app/src/pages/layout.tsx +1 -2
  115. package/templates/apps/frontend-auth/package.json +7 -8
  116. package/templates/apps/frontend-auth/src/components/AuthShell.tsx +1 -2
  117. package/templates/apps/frontend-blank/package.json +6 -7
  118. package/templates/apps/frontend-blank/src/pages/layout.tsx +1 -2
  119. package/templates/apps/frontend-cms/package.json +8 -9
  120. package/templates/apps/frontend-cms/src/pages/(app)/layout.tsx +1 -2
  121. package/templates/apps/frontend-collab/README.md +7 -2
  122. package/templates/apps/frontend-collab/package.json +9 -10
  123. package/templates/apps/frontend-collab/src/pages/layout.tsx +1 -2
  124. package/templates/apps/frontend-collab/src/pages/page.test.tsx +8 -4
  125. package/templates/apps/frontend-collab/src/pages/page.tsx +10 -5
  126. package/templates/apps/frontend-contact/package.json +7 -7
  127. package/templates/apps/frontend-contact/src/components/ContactForm.island.tsx +1 -1
  128. package/templates/apps/frontend-dashboard/package.json +6 -7
  129. package/templates/apps/frontend-dashboard/src/pages/(marketing)/layout.tsx +1 -2
  130. package/templates/apps/frontend-dashboard/src/pages/dashboard/layout.tsx +1 -2
  131. package/templates/apps/frontend-docs/package.json +8 -8
  132. package/templates/apps/frontend-i18n/package.json +6 -6
  133. package/templates/apps/frontend-landing/package.json +7 -7
  134. package/templates/apps/frontend-portal/package.json +7 -8
  135. package/templates/apps/frontend-portal/src/pages/(portal)/layout.tsx +1 -2
  136. package/templates/apps/frontend-saas/package.json +7 -8
  137. package/templates/apps/frontend-saas/src/pages/(marketing)/layout.tsx +1 -2
  138. package/templates/apps/frontend-saas/src/pages/dashboard/layout.tsx +1 -2
  139. package/templates/apps/frontend-spa/package.json +6 -7
  140. package/templates/apps/frontend-spa/src/pages/layout.tsx +1 -2
  141. package/templates/apps/frontend-ssr/package.json +6 -7
  142. package/templates/apps/frontend-ssr/src/pages/layout.tsx +1 -2
  143. package/templates/apps/frontend-ssr-api/package.json +7 -8
  144. package/templates/apps/frontend-ssr-api/src/pages/layout.tsx +1 -2
  145. package/templates/apps/frontend-static-blog/package.json +8 -8
  146. package/templates/apps/frontend-static-blog/src/components/ReadingProgress.island.tsx +1 -1
  147. package/templates/apps/frontend-static-blog/src/pages/[locale]/page.tsx +7 -1
  148. package/templates/apps/frontend-status/package.json +7 -8
  149. package/templates/apps/frontend-status/src/pages/layout.tsx +1 -2
  150. package/templates/apps/mobile-app/package.json +4 -4
  151. package/templates/baselines/compose/docker/api.Dockerfile +61 -5
  152. package/templates/baselines/compose/docker/web.Dockerfile +55 -10
  153. package/templates/baselines/compose-mariadb/docker/api.Dockerfile +61 -5
  154. package/templates/baselines/compose-mariadb/docker/web.Dockerfile +55 -10
  155. package/dist/apiBuild-Cl0IDx8c.js +0 -2
  156. package/dist/codegen-CN6vMM4J.js +0 -2
  157. package/dist/dbCommand-BTyBGhIA.js +0 -2
  158. package/dist/doctorCommand-djmqEcDC.js +0 -2
  159. package/dist/frameworkTableAssembly-Df2Ymp2f.js +0 -2
  160. package/dist/inspect-DCqILJ1G.js +0 -1197
  161. package/dist/inspect-DGJwpOAb.js +0 -2
  162. package/dist/manifestBuild-CJ2zvPvT.js +0 -2
  163. package/dist/serveCommand-Cjt5S9hD.js +0 -2
  164. package/dist/updateCommand-nnFjDbl4.js +0 -2
  165. package/dist/webDev-1XpVnYkW.js +0 -2
@@ -1,4 +1,4 @@
1
- import { c as e, i as t } from "./dev-Ca_A_S9v.js";
1
+ import { c as e, i as t } from "./dev-Dw263KPu.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-Ca_A_S9v.js";
1
+ import { c as e, i as t } from "./dev-Dw263KPu.js";
2
2
  import { Effect as n } from "effect";
3
3
  import { embedMany as r } from "@voltro/ai";
4
4
  //#region src/embeddingsBackfill.ts
@@ -1,5 +1,5 @@
1
- import { c as e } from "./dev-Ca_A_S9v.js";
2
- import { Gt as t, Ht as n, Vt as r, Wt as i } from "./webDev-B7vNj4Bq.js";
1
+ import { c as e } from "./dev-Dw263KPu.js";
2
+ import { Bt as t, Ht as n, Ut as r, zt as i } from "./webDev-C53hJdcL.js";
3
3
  import { join as a } from "node:path";
4
4
  import { promises as o } from "node:fs";
5
5
  import { createLogger as s } from "@voltro/logger";
@@ -21,27 +21,27 @@ var u = s({ scope: "voltro:env" }), d = "# Environment for this app", f = async
21
21
  }, h = async (e) => {
22
22
  let t = await f(e);
23
23
  if (!t) return u.error("no app.config.ts found in the current directory"), 1;
24
- let n = 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);
24
+ let n = i(t.name, t.input), r = `${p("KEY", 32)} ${p("OWNER", 16)} ${p("ACCESS", 8)} ${p("REQ", 4)} SET`;
25
+ u.info(`env manifest — ${n.app} (${n.summary.total} vars, ${n.summary.set} set)`), m(r);
26
26
  for (let e of n.entries) {
27
27
  let t = e.isSet ? "✓" : e.satisfied ? "·" : "✗";
28
28
  m(`${p(e.key, 32)} ${p(e.owner, 16)} ${p(e.access, 8)} ${p(e.required ? "yes" : "", 4)} ${t}`);
29
29
  }
30
30
  return n.summary.missingRequired > 0 ? (u.error(`${n.summary.missingRequired} required var(s) are unset`), 1) : 0;
31
- }, g = async (e, t) => {
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 = n(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) && !t) {
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 (n) => {
41
- let r = await e(n).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(n, a), u.info("wrote src/voltro-env.d.ts (publicEnv augmentation)", { app: r.name ?? "app" })) : (await t(n, 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);
40
+ }, _ = async (t) => {
41
+ let i = await e(t).catch(() => null);
42
+ if (!i) return u.error("no app.config.ts found in the current directory"), 1;
43
+ let a = l(i.env) ? i.env : void 0;
44
+ return a ? (i.type === "web" ? (await n(t, a), u.info("wrote src/voltro-env.d.ts (publicEnv augmentation)", { app: i.name ?? "app" })) : (await r(t, a), u.info("wrote env.generated.d.ts (serverEnv augmentation)", { app: i.name ?? "app" })), 0) : (u.warn("no `defineEnv` declared in app.config.ts — nothing to generate", { hint: "add `env: defineEnv({ ... })` to app.config.ts (see @voltro/env)" }), 0);
45
45
  }, v = () => {
46
46
  let e = c();
47
47
  return u.info(`${e.length} framework env vars for turbo.json globalPassThroughEnv:`), m(JSON.stringify([...e].sort(), null, 2)), u.info("merge these into the workspace turbo.json `globalPassThroughEnv` array (+ your own app vars)."), 0;
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./cliOutput-D1tSBoRM.js";
2
- import { i as t } from "./checkCommand-fbj9GDjN.js";
3
- import { i as n, n as r } from "./codemodRunner-C2zxZUIw.js";
2
+ import { i as t } from "./checkCommand-CAwFXrxA.js";
3
+ import { i as n, n as r } from "./codemodRunner-BlQPfjzA.js";
4
4
  import { basename as i, join as a, resolve as o } from "node:path";
5
5
  import { branchNamespaceName as s, planBranchProvision as c } from "@voltro/database";
6
6
  import { readFile as l } from "node:fs/promises";
@@ -0,0 +1,2 @@
1
+ import { c as e, n as t } from "./frameworkTableAssembly-DNOFXfEQ.js";
2
+ export { t as assembleFrameworkTables, e as loadAppSchemaInputs };
@@ -4,67 +4,67 @@ 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 ee, defineQuery as te, pluginAlias as p, pluginAlias as m, pluginSlug as ne } from "@voltro/protocol";
8
- import { _voltroApiKeysTable as re, _voltroCdcOffsetsTable as ie, _voltroDataTransfersTable as ae, _voltroIdempotencyTable as oe, _voltroKvTable as se, _voltroMigrationPlansTable as ce, _voltroMigrationsTable as le, _voltroMssqlCdcOffsetsTable as ue, _voltroReplaceInProgressTable as de, _voltroSeedsTable as fe } from "@voltro/database";
9
- import { Effect as h } from "effect";
10
- import { SqlClient as g } from "@effect/sql";
11
- import { _voltroApprovalsTable 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";
12
- import { _voltroBudgetHoldsTable as D, _voltroWorkflowAdmissionsTable as O, _voltroWorkflowPausesTable as k, _voltroWorkflowPendingTable as A, _voltroWorkflowRunEventsTable as j, _voltroWorkflowRunStepsTable as M, _voltroWorkflowRunsTable as N, _voltroWorkflowStartContextsTable as P, _voltroWorkflowWatermarksTable as F } from "@voltro/workflow";
13
- import { agentMessagesTable as I, agentThreadsTable as L, aiBudgetTable as R, aiInferencesTable as z, aiUsageTable as he, isAgentDescriptor as ge, isAgentExecutor as _e, promptsTable as ve, resolveToolModuleHandlers as ye } from "@voltro/ai";
14
- import { _voltroWebhookDeliveriesTable as be, _voltroWebhookTargetsTable as xe } from "@voltro/plugin-webhooks/mixin";
15
- import { _voltroStorageBlobsTable as Se, _voltroStorageGrantsTable as Ce, _voltroStorageRefsTable as we, _voltroStorageUsageTable as Te } from "@voltro/plugin-storage";
7
+ import { defineAction as f, defineMutation as p, defineQuery as m, pluginAlias as h, pluginAlias as g, pluginSlug as ee } from "@voltro/protocol";
8
+ import { _voltroApiKeysTable as te, _voltroCdcOffsetsTable as ne, _voltroDataTransfersTable as re, _voltroIdempotencyTable as ie, _voltroKvTable as ae, _voltroMigrationPlansTable as oe, _voltroMigrationsTable as se, _voltroMssqlCdcOffsetsTable as ce, _voltroReplaceInProgressTable as le, _voltroReplicaObservationsTable as ue, _voltroSeedsTable as de } from "@voltro/database";
9
+ import { _voltroApprovalsTable as fe, _voltroChangeClaimsTable as pe, _voltroConnectionGrantsTable as me, _voltroConnectionsTable as _, _voltroScheduleClaimsTable as v, _voltroScheduleRunsTable as y, _voltroTracesTable as b, _voltroUndoLogTable as x, _voltroWakeupsTable as S, _voltroWorkflowEventDeliveriesTable as C, _voltroWorkflowEventsTable as w, outboxAttemptsTable as T, outboxTable as E } from "@voltro/runtime";
10
+ import { Effect as D } from "effect";
11
+ import { SqlClient as O } from "@effect/sql";
12
+ import { _voltroBudgetHoldsTable as k, _voltroWorkflowAdmissionsTable as A, _voltroWorkflowPausesTable as j, _voltroWorkflowPendingTable as M, _voltroWorkflowRunEventsTable as N, _voltroWorkflowRunStepsTable as P, _voltroWorkflowRunsTable as F, _voltroWorkflowStartContextsTable as I, _voltroWorkflowWatermarksTable as L } from "@voltro/workflow";
13
+ import { agentMessagesTable as R, agentThreadsTable as z, aiBudgetTable as he, aiInferencesTable as ge, aiUsageTable as _e, isAgentDescriptor as ve, isAgentExecutor as ye, promptsTable as be, resolveToolModuleHandlers as xe } from "@voltro/ai";
14
+ import { _voltroWebhookDeliveriesTable as Se, _voltroWebhookTargetsTable as Ce } from "@voltro/plugin-webhooks/mixin";
15
+ import { _voltroStorageBlobsTable as we, _voltroStorageGrantsTable as Te, _voltroStorageRefsTable as Ee, _voltroStorageUsageTable as De } from "@voltro/plugin-storage";
16
16
  //#region src/frameworkTables.ts
17
- var Ee = [
17
+ var Oe = [
18
18
  {
19
- table: le,
19
+ table: se,
20
20
  when: "always"
21
21
  },
22
22
  {
23
- table: fe,
23
+ table: de,
24
24
  when: "always"
25
25
  },
26
26
  {
27
- table: ce,
27
+ table: oe,
28
28
  when: "always"
29
29
  },
30
30
  {
31
- table: de,
31
+ table: le,
32
32
  when: "always"
33
33
  },
34
34
  {
35
- table: ae,
35
+ table: re,
36
36
  when: "always"
37
37
  },
38
38
  {
39
- table: N,
39
+ table: F,
40
40
  when: "workflows"
41
41
  },
42
42
  {
43
- table: M,
43
+ table: P,
44
44
  when: "workflows"
45
45
  },
46
46
  {
47
- table: j,
47
+ table: N,
48
48
  when: "workflows"
49
49
  },
50
50
  {
51
- table: P,
51
+ table: I,
52
52
  when: "workflows"
53
53
  },
54
54
  {
55
- table: A,
55
+ table: M,
56
56
  when: "workflows"
57
57
  },
58
58
  {
59
- table: O,
59
+ table: A,
60
60
  when: "workflows"
61
61
  },
62
62
  {
63
- table: k,
63
+ table: j,
64
64
  when: "workflows"
65
65
  },
66
66
  {
67
- table: F,
67
+ table: L,
68
68
  when: "workflows"
69
69
  },
70
70
  {
@@ -84,11 +84,11 @@ var Ee = [
84
84
  when: "schedules"
85
85
  },
86
86
  {
87
- table: xe,
87
+ table: Ce,
88
88
  when: "webhooks"
89
89
  },
90
90
  {
91
- table: be,
91
+ table: Se,
92
92
  when: "webhooks"
93
93
  },
94
94
  {
@@ -100,11 +100,11 @@ var Ee = [
100
100
  when: "undo"
101
101
  },
102
102
  {
103
- table: pe,
103
+ table: fe,
104
104
  when: "always"
105
105
  },
106
106
  {
107
- table: D,
107
+ table: k,
108
108
  when: "workflows"
109
109
  },
110
110
  {
@@ -127,46 +127,54 @@ var Ee = [
127
127
  table: S,
128
128
  when: "always"
129
129
  },
130
+ {
131
+ table: Ee,
132
+ when: "always"
133
+ },
134
+ {
135
+ table: Te,
136
+ when: "always"
137
+ },
130
138
  {
131
139
  table: we,
132
140
  when: "always"
133
141
  },
134
142
  {
135
- table: Ce,
143
+ table: De,
136
144
  when: "always"
137
145
  },
138
146
  {
139
- table: Se,
147
+ table: ie,
140
148
  when: "always"
141
149
  },
142
150
  {
143
- table: Te,
151
+ table: pe,
144
152
  when: "always"
145
153
  },
146
154
  {
147
- table: oe,
155
+ table: te,
148
156
  when: "always"
149
157
  },
150
158
  {
151
- table: re,
159
+ table: ae,
152
160
  when: "always"
153
161
  },
154
162
  {
155
- table: se,
163
+ table: ue,
156
164
  when: "always"
157
165
  }
158
- ], De = (e) => {
159
- let t = Ee.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);
160
- return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? ue : ie), t;
161
- }, Oe = (e, t) => B(e, t.name), B = (e, t) => {
162
- let n = p(e.name);
166
+ ], ke = (e) => {
167
+ let t = Oe.filter((t) => t.when === "always" || t.when === "workflows" && e.workflows || t.when === "schedules" && e.schedules || t.when === "webhooks" && e.webhooks || t.when === "traces" && e.traces || t.when === "undo" && e.undo === !0 || t.when === "connections" && e.connections === !0).map((e) => e.table);
168
+ return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? ce : ne), t;
169
+ }, Ae = (e, t) => B(e, t.name), B = (e, t) => {
170
+ let n = h(e.name);
163
171
  if (!t.includes(".")) return `${n}.${t}`;
164
172
  if (e.baseName === void 0) return t;
165
- let r = `${p(e.baseName)}.`;
173
+ let r = `${h(e.baseName)}.`;
166
174
  return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
167
- }, V = (e) => e.openAccess === void 0 ? e.guards !== void 0 && e.guards.length > 0 ? { guards: e.guards } : {} : { openAccess: e.openAccess }, ke = (e, t, n) => {
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) => {
168
176
  switch (e) {
169
- case "query": return te({
177
+ case "query": return m({
170
178
  name: t,
171
179
  input: n.input,
172
180
  output: n.output,
@@ -174,7 +182,7 @@ var Ee = [
174
182
  ...V(n),
175
183
  ...n.source === void 0 ? {} : { source: n.source }
176
184
  });
177
- case "mutation": return ee({
185
+ case "mutation": return p({
178
186
  name: t,
179
187
  input: n.input,
180
188
  output: n.output,
@@ -189,23 +197,23 @@ var Ee = [
189
197
  ...V(n)
190
198
  });
191
199
  }
192
- }, Ae = (e) => (t, n) => h.suspend(() => {
200
+ }, Me = (e) => (t, n) => D.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
- }), je = (e) => {
206
+ }), Ne = (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 = Oe(n, r), i = ke(r.kind, e, r);
211
+ let e = Ae(n, r), i = je(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: Ae(r),
216
+ executor: Me(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
- }, Me = (e, t, n = /* @__PURE__ */ new Set()) => {
225
+ }, Pe = (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,8 +234,8 @@ var Ee = [
226
234
  }
227
235
  }
228
236
  return i;
229
- }, H = "_voltro_plugin_migrations", Ne = () => h.gen(function* () {
230
- yield* (yield* g.SqlClient).unsafe(`
237
+ }, H = "_voltro_plugin_migrations", Fe = () => D.gen(function* () {
238
+ yield* (yield* O.SqlClient).unsafe(`
231
239
  CREATE TABLE IF NOT EXISTS ${H} (
232
240
  id TEXT PRIMARY KEY,
233
241
  plugin_name TEXT NOT NULL,
@@ -235,26 +243,26 @@ var Ee = [
235
243
  description TEXT,
236
244
  applied_at TEXT NOT NULL
237
245
  );
238
- `).pipe(h.orDie);
239
- }), Pe = (e, t) => `${m(e)}__${t}`, Fe = () => h.gen(function* () {
240
- let e = yield* g.SqlClient, t = yield* e`SELECT id FROM ${e(H)}`.pipe(h.orDie);
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);
241
249
  return new Set(t.map((e) => e.id));
242
- }), Ie = (e) => h.gen(function* () {
243
- let t = yield* g.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
250
+ }), Re = (e) => D.gen(function* () {
251
+ let t = yield* O.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
244
252
  yield* t`
245
253
  INSERT INTO ${t(H)} (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(h.orDie);
248
- }), U = (e) => h.gen(function* () {
255
+ `.pipe(D.orDie);
256
+ }), U = (e) => D.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* Ne();
255
- let n = yield* Fe(), r = [];
262
+ yield* Fe();
263
+ let n = yield* Le(), r = [];
256
264
  for (let { plugin: e, migration: i } of t) {
257
- let t = Pe(e.name, i.id), a = Date.now();
265
+ let t = Ie(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* g.SqlClient;
275
+ let o = yield* O.SqlClient;
268
276
  try {
269
- yield* i.up(o).pipe(h.mapError((e) => e)), yield* Ie({
277
+ yield* i.up(o).pipe(D.mapError((e) => e)), yield* Re({
270
278
  key: t,
271
279
  pluginName: e.name,
272
280
  migration: i
@@ -283,30 +291,30 @@ var Ee = [
283
291
  status: "failed",
284
292
  durationMs: Date.now() - a,
285
293
  error: t
286
- }), yield* h.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
294
+ }), yield* D.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
- }), Le = (e, t) => h.gen(function* () {
298
+ }), ze = (e, t) => D.gen(function* () {
291
299
  let n = yield* U(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
- }), Re = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
303
+ }), Be = (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: m(e.name),
305
+ pluginAlias: g(e.name),
298
306
  tables: e.extendSchema.tables?.length ?? 0,
299
307
  migrations: e.extendSchema.migrations?.length ?? 0
300
- })), ze = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, Be = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, Ve = async (t, n) => {
308
+ })), Ve = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), W = /(?<!\.server)\.agent\.tsx?$/, He = /\.agent\.server\.tsx?$/, G = /\.tool\.tsx?$/, Ue = async (t, n) => {
301
309
  let r = 0;
302
310
  for (let i of t) if (G.test(i)) try {
303
311
  let t = await e(i);
304
- r += ye(t);
312
+ r += xe(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
- }, He = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ue = async (t, n) => {
317
+ }, We = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ge = async (t, n) => {
310
318
  let r = [], i = /* @__PURE__ */ new Set();
311
319
  for (let a of t) {
312
320
  if (!W.test(a)) continue;
@@ -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(ge);
328
+ let o = Object.values(t).find(ve);
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 = He(a), c;
340
+ let s = We(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 (!_e(l)) {
352
+ if (!ye(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
- }, K = /\.connection\.tsx?$/, q = (e) => e.replace(K, ""), We = async (t, n) => {
367
+ }, K = /\.connection\.tsx?$/, Ke = (e) => e.replace(K, ""), qe = 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) => q(s(e.file)))
410
+ files: r.map((e) => Ke(s(e.file)))
403
411
  }), r;
404
- }, J = (e) => o.test(e) || n.test(e), Y = async (e) => {
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), J(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), W.test(e) && (s = !0), K.test(e) && (l = !0);
413
421
  }
414
422
  };
415
423
  return await d(e), {
@@ -419,7 +427,7 @@ var Ee = [
419
427
  agents: s,
420
428
  connections: l
421
429
  };
422
- }, Ge = async (e) => {
430
+ }, Je = async (e) => {
423
431
  let t = c(e, "app.config.ts");
424
432
  if (!l(t)) return { plugins: [] };
425
433
  try {
@@ -434,8 +442,8 @@ var Ee = [
434
442
  error: e
435
443
  };
436
444
  }
437
- }, Ke = async (e) => (await X(e)).plugins, X = async (e) => {
438
- let { plugins: t, schema: n, error: r } = await Ge(e);
445
+ }, Y = async (e) => (await X(e)).plugins, X = async (e) => {
446
+ let { plugins: t, schema: n, error: r } = await Je(e);
439
447
  if (r !== void 0) throw new Z(e, r);
440
448
  return {
441
449
  plugins: t,
@@ -457,7 +465,7 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
457
465
  let t = /* @__PURE__ */ new Map(), n = (e) => {
458
466
  e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
459
467
  };
460
- for (let t of De({
468
+ for (let t of ke({
461
469
  workflows: e.mix.workflows,
462
470
  schedules: e.mix.schedules,
463
471
  webhooks: e.mix.webhooks,
@@ -467,11 +475,11 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
467
475
  undo: e.gates.undo,
468
476
  connections: e.mix.connections
469
477
  })) n(t);
470
- e.mix.agents && (n(L), n(I), n(he), n(R)), e.mix.workflows && n(z), (e.mix.workflows || e.mix.agents) && n(ve);
471
- for (let t of ze(e.plugins)) 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);
472
480
  return [...t.values()];
473
- }, qe = async (e) => {
474
- let n = await Y(e.root), { plugins: r, schema: i } = await X(e.root);
481
+ }, Ye = async (e) => {
482
+ let n = await J(e.root), { plugins: r, schema: i } = await X(e.root);
475
483
  return Q({
476
484
  mix: n,
477
485
  plugins: r,
@@ -487,4 +495,4 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
487
495
  return t === "mariadb" ? "mariadb" : t === "mssql" ? "mssql" : void 0;
488
496
  };
489
497
  //#endregion
490
- export { ne as C, m as S, U as _, Y as a, je as b, X as c, W as d, Be as f, Le as g, Ve as h, $ as i, K as l, Ue as m, qe as n, J as o, G as p, Q as r, Ke as s, Z as t, We as u, Re as v, B as x, Me as y };
498
+ export { ee as C, g as S, U as _, J as a, Ne as b, X as c, W as d, He as f, ze as g, Ue as h, $ as i, K as l, Ge as m, Ye as n, q as o, G as p, Q as r, Y as s, Z as t, qe as u, Be as v, B as x, Pe as y };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-BBYJ7Q3B.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-CWjfThXv.js";
2
2
  import { r as o } from "./templates-BTWZkJJT.js";
3
3
  //#region src/index.ts
4
4
  var s = "framework";
@@ -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-C_jN1w18.js";
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