@voltro/cli 0.33.0 → 0.34.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 (337) hide show
  1. package/CHANGELOG.md +1801 -0
  2. package/bin/nodeEnvironment.d.mts +30 -0
  3. package/bin/nodeEnvironment.mjs +158 -0
  4. package/bin/voltro.mjs +69 -5
  5. package/dist/addCommand-BNeoeSxe.js +124 -0
  6. package/dist/addCommand-aXSQveak.js +2 -0
  7. package/dist/agentsMd-BTchIZku.js +2 -0
  8. package/dist/agentsMd-mhQMF1bx.js +254 -0
  9. package/dist/apiBuild-BICVGnEC.js +2 -0
  10. package/dist/{apiBuild-h9VHtnlw.js → apiBuild-DZF_f0_I.js} +46 -46
  11. package/dist/appPort-B_HpJ_ck.js +48 -0
  12. package/dist/baselineCommand-C2ClWZN3.js +2 -0
  13. package/dist/baselineCommand-DIttzO8A.js +227 -0
  14. package/dist/bin.js +71 -28
  15. package/dist/build-CE7Ca9gm.js +711 -0
  16. package/dist/cacheCommand-DA4OH9xt.js +42 -0
  17. package/dist/capabilitiesCommand-nq_pz5xd.js +123 -0
  18. package/dist/checkCommand-Dv8r9tGO.js +231 -0
  19. package/dist/checkCommand-YZDmkAGd.js +2 -0
  20. package/dist/{cliArgs-qdZSElM3.js → cliArgs-D4p8n7EE.js} +12 -1
  21. package/dist/cliError-BmdYnghb.js +10 -0
  22. package/dist/cliOutput-D1tSBoRM.js +15 -0
  23. package/dist/{cliRuntime-Oh517vCV.js → cliRuntime-Dh7UDinH.js} +20 -20
  24. package/dist/cloudClient-DWL-Hw_T.js +67 -0
  25. package/dist/cloudCmd-Cvv5HGaZ.js +364 -0
  26. package/dist/clusterCmd-CNXKlcvD.js +54 -0
  27. package/dist/codegen-CYM3Zqrf.js +605 -0
  28. package/dist/codegen-ChBi_hVa.js +2 -0
  29. package/dist/codegenCommand-DC6w2tNZ.js +30 -0
  30. package/dist/codemodRunner-DRRqXR74.js +5243 -0
  31. package/dist/commandRunner-BLAEFLjp.js +47 -0
  32. package/dist/commands-gutsz-Ac.js +808 -0
  33. package/dist/connectionConfig-UFlIEiys.js +66 -0
  34. package/dist/dashboardCommand-3YG8p-UA.js +25 -0
  35. package/dist/dataCommand-qL0r7fPO.js +535 -0
  36. package/dist/dataProfile-dW-PsfLB.js +15 -0
  37. package/dist/{dbCommand-DTLKAfbA.js → dbCommand-B6X0FZbq.js} +551 -401
  38. package/dist/dbCommand-CpdKLeQq.js +2 -0
  39. package/dist/{dev-C_P8FLSx.js → dev-CerMd0mW.js} +3122 -3129
  40. package/dist/dev-CoG-ZPx8.js +3 -0
  41. package/dist/devActivity-Dx_3nnGv.js +100 -0
  42. package/dist/devActivity.js +1 -1
  43. package/dist/dialectDriver-CgXnDfec.js +39 -0
  44. package/dist/discover-C9XKJDco.js +25 -0
  45. package/dist/doctorCommand-BvqGBwNG.js +2 -0
  46. package/dist/{checkCommand-xGhRFFg2.js → doctorCommand-CnDXQxfa.js} +520 -1278
  47. package/dist/dormancyCommand-Dszo57d6.js +69 -0
  48. package/dist/e2eCmd-BRabZww-.js +147 -0
  49. package/dist/embeddingsCommand-C0sKVRo1.js +73 -0
  50. package/dist/envCommand-DPgdV1Bq.js +60 -0
  51. package/dist/evalCommand-6RUfPen4.js +118 -0
  52. package/dist/evolveCommand-DHpkgjgH.js +281 -0
  53. package/dist/fileTaxonomy-CJfgOllU.js +457 -0
  54. package/dist/frameworkTableAssembly-BGHmck-x.js +2 -0
  55. package/dist/{frameworkTableAssembly-BwIrO5nv.js → frameworkTableAssembly-DkkP6BgC.js} +184 -148
  56. package/dist/generateCommand-oibemh97.js +147 -0
  57. package/dist/index.d.ts +45 -0
  58. package/dist/index.js +4 -3
  59. package/dist/infoCommand-BJw9nLUR.js +60 -0
  60. package/dist/{inspect-BUUjt773.js → inspect-CBqFtAKA.js} +82 -40
  61. package/dist/inspect-C_T_WGvl.js +2 -0
  62. package/dist/inspectCmd-Bppy-GGw.js +224 -0
  63. package/dist/inspectFetch-Cm8_wVvp.js +151 -0
  64. package/dist/inspectMetrics-CfdKLh6t.js +72 -0
  65. package/dist/loadEnv-D9nEOClM.js +44 -0
  66. package/dist/logFileSink-C_D2wRN1.js +105 -0
  67. package/dist/logsCmd-CCca3KRZ.js +260 -0
  68. package/dist/manifestBuild-ChsKAhmn.js +2 -0
  69. package/dist/{manifestBuild-BLrVuSlM.js → manifestBuild-sxpwdKY1.js} +1 -1
  70. package/dist/metaCommands-7MJfZ5cf.js +196 -0
  71. package/dist/migrate-CBwOt_iV.js +83 -0
  72. package/dist/mssqlClusterPatch-_4cE_nun.js +44 -0
  73. package/dist/newCommand-COWOJ1_E.js +156 -0
  74. package/dist/nodeEnvironment-cGFAj1J8.js +28 -0
  75. package/dist/packageCommand-Cug_3Ogl.js +271 -0
  76. package/dist/pageConvention-cEiRxdab.js +5 -0
  77. package/dist/privacyCommand-C-Df56U_.js +146 -0
  78. package/dist/projectScaffold-DmzEKHib.js +2 -0
  79. package/dist/projectScaffold-LMMtaavR.js +814 -0
  80. package/dist/renderModeScan-D7J1B7Kw.js +105 -0
  81. package/dist/renderProfile-1OWWAAtx.js +81 -0
  82. package/dist/runtimeRegistry-DMeKfTHP.js +81 -0
  83. package/dist/runtimeTrace-CRxalXTs.js +91 -0
  84. package/dist/scheduleCmd--jksTrf6.js +69 -0
  85. package/dist/scheduleManifestCmd-D2x0CTTY.js +249 -0
  86. package/dist/schemaIr-UJybUUZW.js +103 -0
  87. package/dist/{sdkgen-C81QIkiL.js → sdkgen-CYJscZC7.js} +111 -209
  88. package/dist/seedRunner-TFHHiToI.js +329 -0
  89. package/dist/serveCommand-B_isw7q4.js +1647 -0
  90. package/dist/serveCommand-DOvbgRnQ.js +2 -0
  91. package/dist/serveEntry.js +5 -5
  92. package/dist/serverlessCommand-CfJZy6dS.js +482 -0
  93. package/dist/start-9LiUOfES.js +1087 -0
  94. package/dist/start-B-9Nsp-S.js +3 -0
  95. package/dist/startEntry.js +2 -2
  96. package/dist/staticCommand-Dr2M6tpU.js +304 -0
  97. package/dist/storageCommand-Co6NfLqN.js +42 -0
  98. package/dist/templates-De8IR5-c.js +102 -0
  99. package/dist/test-CI6iDsYc.js +115 -0
  100. package/dist/tracesCmd-CkEZQrtt.js +232 -0
  101. package/dist/tsconfigPaths-BWXBWgcl.js +107 -0
  102. package/dist/tsxLoader-EuXmSJ1K.js +51 -0
  103. package/dist/typecheckCommand-BlsWiCNq.js +61 -0
  104. package/dist/updateCommand-Bkptutss.js +585 -0
  105. package/dist/updateCommand-us1_hdIC.js +2 -0
  106. package/dist/{inspectMetrics-1xzTKAFx.js → webDev-CBYvPqQr.js} +975 -1559
  107. package/dist/webDev-Cg-fFiyd2.js +2 -0
  108. package/dist/webhookDiscovery-CrGAfhIG.js +2 -0
  109. package/dist/webhookDiscovery-D7VaeMlz.js +51 -0
  110. package/dist/webhooksCommand-CID96Rga.js +267 -0
  111. package/dist/workflowsCmd-D1VTmLMY.js +608 -0
  112. package/package.json +179 -17
  113. package/templates/AGENTS.core.md +58 -3
  114. package/templates/AGENTS.md +64 -7
  115. package/templates/agent-docs/_index.md +6 -4
  116. package/templates/agent-docs/_manifest.json +22 -5
  117. package/templates/agent-docs/ai.md +370 -0
  118. package/templates/agent-docs/authentication.md +265 -31
  119. package/templates/agent-docs/caching.md +6 -0
  120. package/templates/agent-docs/cli.md +794 -50
  121. package/templates/agent-docs/data.md +550 -11
  122. package/templates/agent-docs/database/migrations.md +174 -25
  123. package/templates/agent-docs/database/misc.md +156 -40
  124. package/templates/agent-docs/database/querying.md +19 -1
  125. package/templates/agent-docs/database/scaling.md +60 -0
  126. package/templates/agent-docs/database/schema.md +1 -0
  127. package/templates/agent-docs/database/seedsdialects.md +208 -19
  128. package/templates/agent-docs/database/transactions.md +68 -0
  129. package/templates/agent-docs/deployment.md +69 -3
  130. package/templates/agent-docs/introduction.md +87 -16
  131. package/templates/agent-docs/local-first-mobile.md +79 -4
  132. package/templates/agent-docs/multi-tenancy.md +95 -20
  133. package/templates/agent-docs/observability.md +58 -3
  134. package/templates/agent-docs/plugins/ai-flows.md +161 -2
  135. package/templates/agent-docs/plugins/analytics-postgres.md +1 -1
  136. package/templates/agent-docs/plugins/audit.md +37 -1
  137. package/templates/agent-docs/plugins/auth-social.md +143 -0
  138. package/templates/agent-docs/plugins/auth-workos.md +4 -2
  139. package/templates/agent-docs/plugins/auth.md +131 -6
  140. package/templates/agent-docs/plugins/billing.md +132 -15
  141. package/templates/agent-docs/plugins/cdc-out.md +46 -7
  142. package/templates/agent-docs/plugins/clickhouse.md +1 -1
  143. package/templates/agent-docs/plugins/duckdb.md +1 -1
  144. package/templates/agent-docs/plugins/flags.md +132 -0
  145. package/templates/agent-docs/plugins/governance.md +105 -7
  146. package/templates/agent-docs/plugins/multitenancy.md +9 -4
  147. package/templates/agent-docs/plugins/presence.md +13 -2
  148. package/templates/agent-docs/plugins/ratelimit.md +9 -0
  149. package/templates/agent-docs/plugins/search.md +157 -6
  150. package/templates/agent-docs/plugins/sso-saml.md +47 -8
  151. package/templates/agent-docs/plugins/webhooks.md +105 -0
  152. package/templates/agent-docs/plugins.md +150 -18
  153. package/templates/agent-docs/reference.md +60 -3
  154. package/templates/agent-docs/releases.md +1117 -0
  155. package/templates/agent-docs/routing.md +43 -25
  156. package/templates/agent-docs/scheduling.md +10 -0
  157. package/templates/agent-docs/schema-driven-ui.md +92 -12
  158. package/templates/agent-docs/security.md +426 -0
  159. package/templates/agent-docs/templates/apibackends.md +87 -18
  160. package/templates/agent-docs/templates/appshells.md +32 -14
  161. package/templates/agent-docs/templates/overview.md +13 -8
  162. package/templates/agent-docs/testing.md +211 -14
  163. package/templates/agent-docs/whats-new.md +1700 -104
  164. package/templates/agent-docs/workflows.md +130 -14
  165. package/templates/apps/api-ai/actions/summarize.action.ts +11 -0
  166. package/templates/apps/api-ai/package.json +8 -7
  167. package/templates/apps/api-auth/actions/me.action.ts +13 -0
  168. package/templates/apps/api-auth/package.json +9 -8
  169. package/templates/apps/api-backend/mutations/notes.create.mutation.ts +9 -0
  170. package/templates/apps/api-backend/package.json +12 -8
  171. package/templates/apps/api-backend/queries/notes.query.ts +30 -8
  172. package/templates/apps/api-backend-deactivation/actions/users.get.action.ts +14 -0
  173. package/templates/apps/api-backend-deactivation/mutations/users.create.mutation.ts +8 -0
  174. package/templates/apps/api-backend-deactivation/mutations/users.deactivate.mutation.ts +10 -0
  175. package/templates/apps/api-backend-deactivation/package.json +8 -7
  176. package/templates/apps/api-backend-mail/actions/sendWelcome.action.ts +17 -0
  177. package/templates/apps/api-backend-mail/mutations/notes.create.mutation.ts +9 -0
  178. package/templates/apps/api-backend-mail/package.json +9 -8
  179. package/templates/apps/api-backend-mail/queries/notes.query.ts +30 -8
  180. package/templates/apps/api-backend-mariadb/.env.example +14 -0
  181. package/templates/apps/api-backend-mariadb/mutations/notes.create.mutation.ts +9 -0
  182. package/templates/apps/api-backend-mariadb/package.json +10 -9
  183. package/templates/apps/api-backend-mariadb/queries/notes.query.ts +30 -8
  184. package/templates/apps/api-backend-sqlite/.env.example +14 -0
  185. package/templates/apps/api-backend-sqlite/mutations/notes.create.mutation.ts +9 -0
  186. package/templates/apps/api-backend-sqlite/package.json +9 -8
  187. package/templates/apps/api-backend-sqlite/queries/notes.query.ts +30 -8
  188. package/templates/apps/api-backend-storage/actions/uploadAvatar.action.ts +13 -0
  189. package/templates/apps/api-backend-storage/actions/uploadDocument.action.ts +12 -0
  190. package/templates/apps/api-backend-storage/mutations/notes.create.mutation.ts +9 -0
  191. package/templates/apps/api-backend-storage/package.json +9 -8
  192. package/templates/apps/api-backend-storage/queries/notes.query.ts +30 -8
  193. package/templates/apps/api-cms/actions/content.get.action.ts +7 -0
  194. package/templates/apps/api-cms/actions/content.types.action.ts +6 -0
  195. package/templates/apps/api-cms/actions/me.action.ts +13 -0
  196. package/templates/apps/api-cms/app.config.ts +19 -0
  197. package/templates/apps/api-cms/authz.ts +63 -0
  198. package/templates/apps/api-cms/mutations/content.publish.mutation.ts +10 -0
  199. package/templates/apps/api-cms/mutations/content.saveDraft.mutation.ts +10 -0
  200. package/templates/apps/api-cms/mutations/content.unpublish.mutation.ts +5 -0
  201. package/templates/apps/api-cms/package.json +11 -10
  202. package/templates/apps/api-cms/queries/content.list.query.ts +23 -7
  203. package/templates/apps/api-cms/tests/accessDecisions.test.ts +121 -0
  204. package/templates/apps/api-cms/tests/content.descriptors.test.ts +8 -4
  205. package/templates/apps/api-collab/mutations/documents.create.mutation.ts +8 -0
  206. package/templates/apps/api-collab/mutations/documents.setBody.mutation.ts +13 -0
  207. package/templates/apps/api-collab/package.json +9 -8
  208. package/templates/apps/api-collab/queries/documents.query.ts +19 -7
  209. package/templates/apps/api-data-advanced/package.json +9 -8
  210. package/templates/apps/api-data-advanced/queries/authors.withBooks.query.ts +12 -0
  211. package/templates/apps/api-data-advanced/queries/books.search.query.ts +9 -0
  212. package/templates/apps/api-durable/mutations/orders.approve.mutation.ts +17 -0
  213. package/templates/apps/api-durable/mutations/orders.place.mutation.ts +9 -0
  214. package/templates/apps/api-durable/package.json +9 -8
  215. package/templates/apps/api-feature-flags/actions/notes.export.action.ts +16 -0
  216. package/templates/apps/api-feature-flags/mutations/notes.create.mutation.ts +12 -0
  217. package/templates/apps/api-feature-flags/package.json +10 -9
  218. package/templates/apps/api-governance/README.md +30 -8
  219. package/templates/apps/api-governance/actions/profiles.get.action.server.ts +17 -1
  220. package/templates/apps/api-governance/actions/profiles.get.action.ts +29 -4
  221. package/templates/apps/api-governance/database/schema.ts +16 -4
  222. package/templates/apps/api-governance/mutations/profiles.create.mutation.ts +12 -0
  223. package/templates/apps/api-governance/package.json +9 -8
  224. package/templates/apps/api-kv/actions/sync.pull.action.ts +15 -0
  225. package/templates/apps/api-kv/actions/sync.reset.action.ts +13 -0
  226. package/templates/apps/api-kv/actions/sync.status.action.ts +7 -0
  227. package/templates/apps/api-kv/package.json +9 -8
  228. package/templates/apps/api-kv/queries/events.list.query.ts +19 -8
  229. package/templates/apps/api-moderation/mutations/comments.create.mutation.ts +11 -0
  230. package/templates/apps/api-moderation/mutations/posts.create.mutation.ts +13 -0
  231. package/templates/apps/api-moderation/package.json +9 -8
  232. package/templates/apps/api-observability/mutations/notes.create.mutation.ts +8 -0
  233. package/templates/apps/api-observability/package.json +9 -8
  234. package/templates/apps/api-observability/queries/notes.list.query.ts +13 -0
  235. package/templates/apps/api-ratelimit/mutations/notes.create.mutation.ts +14 -0
  236. package/templates/apps/api-ratelimit/package.json +9 -8
  237. package/templates/apps/api-rbac/package.json +9 -8
  238. package/templates/apps/api-rest/package.json +8 -7
  239. package/templates/apps/api-saas/mutations/projects.create.mutation.ts +13 -0
  240. package/templates/apps/api-saas/package.json +12 -11
  241. package/templates/apps/api-saas/queries/projects.list.query.ts +11 -0
  242. package/templates/apps/api-saas-starter/actions/me.action.ts +13 -0
  243. package/templates/apps/api-saas-starter/app.config.ts +19 -0
  244. package/templates/apps/api-saas-starter/authz.ts +75 -0
  245. package/templates/apps/api-saas-starter/mutations/invites.create.mutation.ts +10 -0
  246. package/templates/apps/api-saas-starter/mutations/projects.create.mutation.ts +9 -0
  247. package/templates/apps/api-saas-starter/package.json +15 -11
  248. package/templates/apps/api-saas-starter/queries/invites.list.query.ts +19 -8
  249. package/templates/apps/api-saas-starter/queries/projects.list.query.ts +18 -7
  250. package/templates/apps/api-saas-starter/tests/accessDecisions.test.ts +135 -0
  251. package/templates/apps/api-search/mutations/articles.create.mutation.ts +14 -0
  252. package/templates/apps/api-search/package.json +9 -8
  253. package/templates/apps/api-search/queries/articles.list.query.ts +21 -8
  254. package/templates/apps/api-status/README.md +10 -3
  255. package/templates/apps/api-status/app.config.ts +8 -3
  256. package/templates/apps/api-status/authz.ts +5 -3
  257. package/templates/apps/api-status/package.json +9 -8
  258. package/templates/apps/api-status/queries/components.list.query.ts +14 -6
  259. package/templates/apps/api-status/queries/incidents.live.query.ts +23 -10
  260. package/templates/apps/api-status/queries/updates.list.query.ts +16 -9
  261. package/templates/apps/api-status/tests/status.test.ts +9 -1
  262. package/templates/apps/api-versioning/actions/documents.asOf.action.ts +12 -0
  263. package/templates/apps/api-versioning/actions/documents.history.action.ts +13 -0
  264. package/templates/apps/api-versioning/mutations/documents.create.mutation.ts +9 -0
  265. package/templates/apps/api-versioning/mutations/documents.update.mutation.ts +12 -0
  266. package/templates/apps/api-versioning/package.json +9 -8
  267. package/templates/apps/api-webhooks/mutations/orders.fulfill.mutation.ts +16 -0
  268. package/templates/apps/api-webhooks/package.json +10 -9
  269. package/templates/apps/api-webhooks/queries/orders.list.query.ts +10 -0
  270. package/templates/apps/changelog/package.json +8 -6
  271. package/templates/apps/edge-functions/package.json +2 -2
  272. package/templates/apps/frontend-admin/package.json +10 -8
  273. package/templates/apps/frontend-admin/src/lib/admin.ts +20 -9
  274. package/templates/apps/frontend-admin/src/locales/de.ts +11 -1
  275. package/templates/apps/frontend-admin/src/locales/en.ts +13 -1
  276. package/templates/apps/frontend-admin/src/pages/admin/[entity]/page.tsx +65 -22
  277. package/templates/apps/frontend-admin/src/pages/admin/entity.test.tsx +130 -23
  278. package/templates/apps/frontend-admin/src/pages/admin/layout.tsx +3 -2
  279. package/templates/apps/frontend-admin/src/pages/admin/page.test.tsx +19 -2
  280. package/templates/apps/frontend-admin/src/pages/admin/page.tsx +9 -4
  281. package/templates/apps/frontend-app/app.config.ts +4 -3
  282. package/templates/apps/frontend-app/package.json +11 -8
  283. package/templates/apps/frontend-app/src/lib/api.ts +25 -0
  284. package/templates/apps/frontend-app/src/pages/page.test.tsx +130 -82
  285. package/templates/apps/frontend-app/src/pages/page.tsx +14 -18
  286. package/templates/apps/frontend-auth/package.json +10 -8
  287. package/templates/apps/frontend-blank/package.json +9 -7
  288. package/templates/apps/frontend-cms/package.json +11 -9
  289. package/templates/apps/frontend-collab/package.json +12 -9
  290. package/templates/apps/frontend-collab/src/pages/page.test.tsx +122 -78
  291. package/templates/apps/frontend-contact/package.json +9 -7
  292. package/templates/apps/frontend-dashboard/package.json +9 -7
  293. package/templates/apps/frontend-docs/package.json +9 -7
  294. package/templates/apps/frontend-i18n/package.json +8 -6
  295. package/templates/apps/frontend-landing/package.json +9 -7
  296. package/templates/apps/frontend-portal/package.json +10 -8
  297. package/templates/apps/frontend-saas/app.config.ts +10 -6
  298. package/templates/apps/frontend-saas/package.json +10 -8
  299. package/templates/apps/frontend-saas/src/lib/api.ts +27 -32
  300. package/templates/apps/frontend-saas/src/pages/dashboard/billing/page.tsx +7 -8
  301. package/templates/apps/frontend-saas/src/pages/dashboard/page.test.tsx +27 -3
  302. package/templates/apps/frontend-saas/src/pages/dashboard/page.tsx +4 -4
  303. package/templates/apps/frontend-saas/src/pages/dashboard/team/page.tsx +3 -4
  304. package/templates/apps/frontend-spa/package.json +9 -7
  305. package/templates/apps/frontend-ssr/package.json +9 -7
  306. package/templates/apps/frontend-ssr-api/package.json +10 -8
  307. package/templates/apps/frontend-static-blog/package.json +8 -6
  308. package/templates/apps/frontend-status/package.json +10 -8
  309. package/templates/apps/mobile-app/README.md +1 -0
  310. package/templates/apps/mobile-app/package.json +4 -2
  311. package/templates/apps/mobile-app/src/app/index.tsx +22 -12
  312. package/templates/apps/mobile-app/src/app/orders/[id].tsx +1 -1
  313. package/templates/apps/mobile-app/src/lib/api.ts +34 -0
  314. package/templates/apps/mobile-app/voltro.mobile.ts +4 -2
  315. package/templates/baselines/bare/.env.example +14 -0
  316. package/templates/baselines/bare/baseline.json +4 -4
  317. package/templates/baselines/compose/.env.example +14 -0
  318. package/templates/baselines/compose/README.md +1 -1
  319. package/templates/baselines/compose/baseline.json +5 -5
  320. package/templates/baselines/compose-mariadb/.env.example +14 -0
  321. package/templates/baselines/compose-mariadb/README.md +1 -1
  322. package/templates/baselines/compose-mariadb/baseline.json +5 -5
  323. package/templates/baselines/helm/.env.example +14 -0
  324. package/templates/baselines/helm/baseline.json +4 -4
  325. package/dist/apiBuild-C-x9YacA.js +0 -2
  326. package/dist/checkCommand-DRovTKza.js +0 -2
  327. package/dist/commands-CJfepbm4.js +0 -11541
  328. package/dist/dbCommand-b1gum4td.js +0 -2
  329. package/dist/dev-iiMtlkfs.js +0 -3
  330. package/dist/devActivity-BhIu6ncs.js +0 -159
  331. package/dist/frameworkTableAssembly-D-EebUQX.js +0 -2
  332. package/dist/inspect-mmBuRXmy.js +0 -2
  333. package/dist/manifestBuild-Dj8Jjoto.js +0 -2
  334. package/dist/seedRunner-Bqxgp7HZ.js +0 -230
  335. package/dist/serveCommand-DdaM4Hup.js +0 -1608
  336. package/dist/start-C0koT0UO.js +0 -1084
  337. /package/templates/apps/api-ai/actions/{summarize.action.server.tsx → summarize.action.server.ts} +0 -0
@@ -1,191 +1,205 @@
1
1
  import { n as e } from "./appModuleLoader-C9r9mxZt.js";
2
- import { D as t, a as n, j as r, k as i } from "./fileConventions-Cof68_BL.js";
3
- import { basename as a, join as o } from "node:path";
4
- import { pathToFileURL as s } from "node:url";
5
- import { Effect as c } from "effect";
6
- import { existsSync as l, promises as u } from "node:fs";
7
- import { _voltroConnectionGrantsTable as d, _voltroConnectionsTable as f, _voltroScheduleClaimsTable as p, _voltroScheduleRunsTable as ee, _voltroTracesTable as te, _voltroUndoLogTable as ne, _voltroWakeupsTable as re, _voltroWorkflowEventDeliveriesTable as ie, _voltroWorkflowEventsTable as ae, outboxAttemptsTable as oe, outboxTable as se, undoCaptureEnabled as ce } from "@voltro/runtime";
8
- import { SqlClient as m } from "@effect/sql";
9
- import { _voltroWorkflowAdmissionsTable as le, _voltroWorkflowPausesTable as ue, _voltroWorkflowPendingTable as de, _voltroWorkflowRunEventsTable as fe, _voltroWorkflowRunStepsTable as pe, _voltroWorkflowRunsTable as me, _voltroWorkflowStartContextsTable as he, _voltroWorkflowWatermarksTable as ge } from "@voltro/workflow";
10
- import { agentMessagesTable as _e, agentThreadsTable as h, aiBudgetTable as g, aiInferencesTable as _, aiUsageTable as v, isAgentDescriptor as y, isAgentExecutor as b, resolveToolModuleHandlers as x } from "@voltro/ai";
11
- import { _voltroApiKeysTable as S, _voltroCdcOffsetsTable as C, _voltroIdempotencyTable as w, _voltroKvTable as T, _voltroMigrationPlansTable as E, _voltroMigrationsTable as D, _voltroMssqlCdcOffsetsTable as O, _voltroSeedsTable as k, lt as A } from "@voltro/database";
12
- import { _voltroWebhookDeliveriesTable as j, _voltroWebhookTargetsTable as M } from "@voltro/plugin-webhooks/mixin";
13
- import { _voltroStorageBlobsTable as N, _voltroStorageGrantsTable as P, _voltroStorageRefsTable as F, _voltroStorageUsageTable as I } from "@voltro/plugin-storage";
14
- import { defineAction as ve, defineMutation as ye, defineQuery as be } from "@voltro/protocol";
2
+ import { D as t, a as n, j as r, k as i, x as a } from "./fileConventions-Cof68_BL.js";
3
+ import { basename as o, join as s } from "node:path";
4
+ import { existsSync as c, promises as l } from "node:fs";
5
+ import { pathToFileURL as u } from "node:url";
6
+ import { defineAction as d, defineMutation as f, defineQuery as p } from "@voltro/protocol";
7
+ import { Effect as m } from "effect";
8
+ import { SqlClient as h } from "@effect/sql";
9
+ import { _voltroBudgetHoldsTable as ee, _voltroWorkflowAdmissionsTable as te, _voltroWorkflowPausesTable as ne, _voltroWorkflowPendingTable as re, _voltroWorkflowRunEventsTable as ie, _voltroWorkflowRunStepsTable as ae, _voltroWorkflowRunsTable as oe, _voltroWorkflowStartContextsTable as se, _voltroWorkflowWatermarksTable as ce } from "@voltro/workflow";
10
+ import { agentMessagesTable as le, agentThreadsTable as ue, aiBudgetTable as de, aiInferencesTable as fe, aiUsageTable as pe, isAgentDescriptor as me, isAgentExecutor as he, promptsTable as ge, resolveToolModuleHandlers as _e } from "@voltro/ai";
11
+ import { _voltroApiKeysTable as ve, _voltroCdcOffsetsTable as ye, _voltroIdempotencyTable as g, _voltroKvTable as _, _voltroMigrationPlansTable as v, _voltroMigrationsTable as y, _voltroMssqlCdcOffsetsTable as b, _voltroSeedsTable as x, lt as S } from "@voltro/database";
12
+ import { _voltroApprovalsTable as C, _voltroConnectionGrantsTable as w, _voltroConnectionsTable as T, _voltroScheduleClaimsTable as E, _voltroScheduleRunsTable as D, _voltroTracesTable as O, _voltroUndoLogTable as k, _voltroWakeupsTable as A, _voltroWorkflowEventDeliveriesTable as j, _voltroWorkflowEventsTable as M, outboxAttemptsTable as N, outboxTable as P, undoCaptureEnabled as be } from "@voltro/runtime";
13
+ import { _voltroWebhookDeliveriesTable as xe, _voltroWebhookTargetsTable as Se } from "@voltro/plugin-webhooks/mixin";
14
+ import { _voltroStorageBlobsTable as Ce, _voltroStorageGrantsTable as we, _voltroStorageRefsTable as Te, _voltroStorageUsageTable as Ee } from "@voltro/plugin-storage";
15
15
  //#region src/frameworkTables.ts
16
- var xe = [
16
+ var De = [
17
17
  {
18
- table: D,
18
+ table: y,
19
19
  when: "always"
20
20
  },
21
21
  {
22
- table: k,
22
+ table: x,
23
23
  when: "always"
24
24
  },
25
25
  {
26
- table: E,
26
+ table: v,
27
27
  when: "always"
28
28
  },
29
29
  {
30
- table: me,
30
+ table: oe,
31
31
  when: "workflows"
32
32
  },
33
33
  {
34
- table: pe,
34
+ table: ae,
35
35
  when: "workflows"
36
36
  },
37
37
  {
38
- table: fe,
38
+ table: ie,
39
39
  when: "workflows"
40
40
  },
41
41
  {
42
- table: he,
42
+ table: se,
43
43
  when: "workflows"
44
44
  },
45
45
  {
46
- table: de,
46
+ table: re,
47
47
  when: "workflows"
48
48
  },
49
49
  {
50
- table: le,
50
+ table: te,
51
51
  when: "workflows"
52
52
  },
53
53
  {
54
- table: ue,
54
+ table: ne,
55
55
  when: "workflows"
56
56
  },
57
57
  {
58
- table: ge,
58
+ table: ce,
59
59
  when: "workflows"
60
60
  },
61
61
  {
62
- table: ae,
62
+ table: M,
63
63
  when: "workflows"
64
64
  },
65
65
  {
66
- table: ie,
66
+ table: j,
67
67
  when: "workflows"
68
68
  },
69
69
  {
70
- table: ee,
70
+ table: D,
71
71
  when: "schedules"
72
72
  },
73
73
  {
74
- table: p,
74
+ table: E,
75
75
  when: "schedules"
76
76
  },
77
77
  {
78
- table: M,
78
+ table: Se,
79
79
  when: "webhooks"
80
80
  },
81
81
  {
82
- table: j,
82
+ table: xe,
83
83
  when: "webhooks"
84
84
  },
85
85
  {
86
- table: te,
86
+ table: O,
87
87
  when: "traces"
88
88
  },
89
89
  {
90
- table: ne,
90
+ table: k,
91
91
  when: "undo"
92
92
  },
93
93
  {
94
- table: se,
94
+ table: C,
95
95
  when: "always"
96
96
  },
97
97
  {
98
- table: oe,
98
+ table: ee,
99
+ when: "workflows"
100
+ },
101
+ {
102
+ table: P,
99
103
  when: "always"
100
104
  },
101
105
  {
102
- table: f,
106
+ table: N,
107
+ when: "always"
108
+ },
109
+ {
110
+ table: T,
103
111
  when: "connections"
104
112
  },
105
113
  {
106
- table: d,
114
+ table: w,
107
115
  when: "connections"
108
116
  },
109
117
  {
110
- table: re,
118
+ table: A,
111
119
  when: "always"
112
120
  },
113
121
  {
114
- table: F,
122
+ table: Te,
115
123
  when: "always"
116
124
  },
117
125
  {
118
- table: P,
126
+ table: we,
119
127
  when: "always"
120
128
  },
121
129
  {
122
- table: N,
130
+ table: Ce,
123
131
  when: "always"
124
132
  },
125
133
  {
126
- table: I,
134
+ table: Ee,
127
135
  when: "always"
128
136
  },
129
137
  {
130
- table: w,
138
+ table: g,
131
139
  when: "always"
132
140
  },
133
141
  {
134
- table: S,
142
+ table: ve,
135
143
  when: "always"
136
144
  },
137
145
  {
138
- table: T,
146
+ table: _,
139
147
  when: "always"
140
148
  }
141
- ], L = (e) => {
142
- let t = xe.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);
143
- return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? O : C), t;
144
- }, R = (e) => {
149
+ ], Oe = (e) => {
150
+ let t = De.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);
151
+ return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? b : ye), t;
152
+ }, F = (e) => {
145
153
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
146
154
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
147
- }, Se = (e) => {
155
+ }, ke = (e) => {
148
156
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
149
157
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/#/g, "--").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
150
- }, Ce = (e, t) => t.name.includes(".") ? t.name : `${R(e.name)}.${t.name}`, we = (e, t, n) => {
158
+ }, Ae = (e, t) => I(e, t.name), I = (e, t) => {
159
+ let n = F(e.name);
160
+ if (!t.includes(".")) return `${n}.${t}`;
161
+ if (e.baseName === void 0) return t;
162
+ let r = `${F(e.baseName)}.`;
163
+ return t.startsWith(r) ? `${n}.${t.slice(r.length)}` : t;
164
+ }, je = (e, t, n) => {
151
165
  switch (e) {
152
- case "query": return be({
166
+ case "query": return p({
153
167
  name: t,
154
168
  input: n.input,
155
169
  output: n.output,
156
170
  ...n.error === void 0 ? {} : { error: n.error },
157
171
  ...n.source === void 0 ? {} : { source: n.source }
158
172
  });
159
- case "mutation": return ye({
173
+ case "mutation": return f({
160
174
  name: t,
161
175
  input: n.input,
162
176
  output: n.output,
163
177
  ...n.error === void 0 ? {} : { error: n.error }
164
178
  });
165
- case "action": return ve({
179
+ case "action": return d({
166
180
  name: t,
167
181
  input: n.input,
168
182
  output: n.output,
169
183
  ...n.error === void 0 ? {} : { error: n.error }
170
184
  });
171
185
  }
172
- }, Te = (e) => (t, n) => c.suspend(() => {
186
+ }, Me = (e) => (t, n) => m.suspend(() => {
173
187
  let r = { request: {
174
188
  subject: n.request.subject,
175
189
  traceId: n.request.traceId
176
190
  } };
177
191
  return e.execute(t, r);
178
- }), Ee = (e) => {
192
+ }), Ne = (e) => {
179
193
  let t = [];
180
194
  for (let n of e) {
181
195
  let e = n.routes ?? [];
182
196
  for (let r of e) {
183
- let e = Ce(n, r), i = we(r.kind, e, r);
197
+ let e = Ae(n, r), i = je(r.kind, e, r);
184
198
  t.push({
185
199
  kind: r.kind,
186
200
  file: `plugin:${n.name}`,
187
201
  descriptor: i,
188
- executor: Te(r),
202
+ executor: Me(r),
189
203
  plugin: {
190
204
  name: n.name,
191
205
  version: n.version
@@ -194,7 +208,7 @@ var xe = [
194
208
  }
195
209
  }
196
210
  return t;
197
- }, De = (e, t, n = /* @__PURE__ */ new Set()) => {
211
+ }, Pe = (e, t, n = /* @__PURE__ */ new Set()) => {
198
212
  let r = /* @__PURE__ */ new Map();
199
213
  for (let e of t) r.set(e, "user-route");
200
214
  let i = [];
@@ -206,35 +220,35 @@ var xe = [
206
220
  }
207
221
  }
208
222
  return i;
209
- }, z = "_voltro_plugin_migrations", B = () => c.gen(function* () {
210
- yield* (yield* m.SqlClient).unsafe(`
211
- CREATE TABLE IF NOT EXISTS ${z} (
223
+ }, L = "_voltro_plugin_migrations", Fe = () => m.gen(function* () {
224
+ yield* (yield* h.SqlClient).unsafe(`
225
+ CREATE TABLE IF NOT EXISTS ${L} (
212
226
  id TEXT PRIMARY KEY,
213
227
  plugin_name TEXT NOT NULL,
214
228
  migration_id TEXT NOT NULL,
215
229
  description TEXT,
216
230
  applied_at TEXT NOT NULL
217
231
  );
218
- `).pipe(c.orDie);
219
- }), Oe = (e, t) => `${R(e)}__${t}`, ke = () => c.gen(function* () {
220
- let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(z)}`.pipe(c.orDie);
232
+ `).pipe(m.orDie);
233
+ }), Ie = (e, t) => `${F(e)}__${t}`, Le = () => m.gen(function* () {
234
+ let e = yield* h.SqlClient, t = yield* e`SELECT id FROM ${e(L)}`.pipe(m.orDie);
221
235
  return new Set(t.map((e) => e.id));
222
- }), Ae = (e) => c.gen(function* () {
223
- let t = yield* m.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
236
+ }), Re = (e) => m.gen(function* () {
237
+ let t = yield* h.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
224
238
  yield* t`
225
- INSERT INTO ${t(z)} (id, plugin_name, migration_id, description, applied_at)
239
+ INSERT INTO ${t(L)} (id, plugin_name, migration_id, description, applied_at)
226
240
  VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
227
- `.pipe(c.orDie);
228
- }), je = (e) => c.gen(function* () {
241
+ `.pipe(m.orDie);
242
+ }), R = (e) => m.gen(function* () {
229
243
  let t = e.flatMap((e) => (e.extendSchema?.migrations ?? []).map((t) => ({
230
244
  plugin: e,
231
245
  migration: t
232
246
  })));
233
247
  if (t.length === 0) return [];
234
- yield* B();
235
- let n = yield* ke(), r = [];
248
+ yield* Fe();
249
+ let n = yield* Le(), r = [];
236
250
  for (let { plugin: e, migration: i } of t) {
237
- let t = Oe(e.name, i.id), a = Date.now();
251
+ let t = Ie(e.name, i.id), a = Date.now();
238
252
  if (n.has(t)) {
239
253
  r.push({
240
254
  pluginName: e.name,
@@ -244,9 +258,9 @@ var xe = [
244
258
  });
245
259
  continue;
246
260
  }
247
- let o = yield* m.SqlClient;
261
+ let o = yield* h.SqlClient;
248
262
  try {
249
- yield* i.up(o).pipe(c.mapError((e) => e)), yield* Ae({
263
+ yield* i.up(o).pipe(m.mapError((e) => e)), yield* Re({
250
264
  key: t,
251
265
  pluginName: e.name,
252
266
  migration: i
@@ -263,28 +277,33 @@ var xe = [
263
277
  status: "failed",
264
278
  durationMs: Date.now() - a,
265
279
  error: t
266
- }), yield* c.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
280
+ }), yield* m.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
267
281
  }
268
282
  }
269
283
  return r;
270
- }), Me = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
284
+ }), ze = (e, t) => m.gen(function* () {
285
+ let n = yield* R(e);
286
+ if (n.length === 0) return n;
287
+ let r = n.filter((e) => e.status === "applied"), i = n.filter((e) => e.status === "skipped");
288
+ return t(`plugin migrations: ${r.length} applied, ${i.length} already applied`, { applied: r.map((e) => `${e.pluginName}:${e.migrationId}`) }), n;
289
+ }), Be = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
271
290
  pluginName: e.name,
272
- pluginAlias: R(e.name),
291
+ pluginAlias: F(e.name),
273
292
  tables: e.extendSchema.tables?.length ?? 0,
274
293
  migrations: e.extendSchema.migrations?.length ?? 0
275
- })), Ne = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), V = /(?<!\.server)\.agent\.tsx?$/, Pe = /\.agent\.server\.tsx?$/, H = /\.tool\.tsx?$/, Fe = async (t, n) => {
294
+ })), Ve = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), z = /(?<!\.server)\.agent\.tsx?$/, He = /\.agent\.server\.tsx?$/, B = /\.tool\.tsx?$/, Ue = async (t, n) => {
276
295
  let r = 0;
277
- for (let i of t) if (H.test(i)) try {
296
+ for (let i of t) if (B.test(i)) try {
278
297
  let t = await e(i);
279
- r += x(t);
298
+ r += _e(t);
280
299
  } catch (e) {
281
300
  n.warn("tool: failed to import — handler not wired", { file: i }, e);
282
301
  }
283
302
  return r;
284
- }, Ie = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Le = async (t, n) => {
303
+ }, We = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ge = async (t, n) => {
285
304
  let r = [], i = /* @__PURE__ */ new Set();
286
305
  for (let a of t) {
287
- if (!V.test(a)) continue;
306
+ if (!z.test(a)) continue;
288
307
  let t;
289
308
  try {
290
309
  t = await e(a);
@@ -292,7 +311,7 @@ var xe = [
292
311
  n.warn("agent: failed to import descriptor", { file: a }, e);
293
312
  continue;
294
313
  }
295
- let o = Object.values(t).find(y);
314
+ let o = Object.values(t).find(me);
296
315
  if (o === void 0) {
297
316
  n.warn("agent: no defineAgent() descriptor export found", { file: a });
298
317
  continue;
@@ -304,7 +323,7 @@ var xe = [
304
323
  });
305
324
  continue;
306
325
  }
307
- let s = Ie(a), c;
326
+ let s = We(a), c;
308
327
  try {
309
328
  c = await e(s);
310
329
  } catch (e) {
@@ -316,7 +335,7 @@ var xe = [
316
335
  continue;
317
336
  }
318
337
  let l = c.default;
319
- if (!b(l)) {
338
+ if (!he(l)) {
320
339
  n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
321
340
  file: s,
322
341
  name: o.name
@@ -331,7 +350,7 @@ var xe = [
331
350
  });
332
351
  }
333
352
  return { agents: r };
334
- }, U = /\.connection\.tsx?$/, Re = (e) => e.replace(U, ""), ze = async (t, n) => {
353
+ }, V = /\.connection\.tsx?$/, Ke = (e) => e.replace(V, ""), qe = async (t, n) => {
335
354
  let r = [], i = /* @__PURE__ */ new Map();
336
355
  for (let a of t) {
337
356
  let t;
@@ -374,26 +393,40 @@ var xe = [
374
393
  }
375
394
  return r.length > 0 && n.info("discovered connections", {
376
395
  connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
377
- files: r.map((e) => Re(a(e.file)))
396
+ files: r.map((e) => Ke(o(e.file)))
378
397
  }), r;
379
- }, W = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription."), G = (e) => {
398
+ }, H = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription."), U = (e) => {
380
399
  if (e.name.includes("_voltro_traces")) return !0;
381
400
  for (let t in e.attributes) {
382
401
  let n = e.attributes[t];
383
402
  if (typeof n == "string" && n.includes("_voltro_traces")) return !0;
384
403
  }
385
404
  return !1;
386
- }, Be = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription"), Ve = 1e3, He = 500, Ue = 50, K = class {
405
+ }, Je = [
406
+ "_voltro_schedule_claims",
407
+ "_voltro_workflow_pending",
408
+ "_voltro_workflow_pauses",
409
+ "_voltro_ai_inferences"
410
+ ], Ye = (e) => {
411
+ for (let t of Je) {
412
+ if (e.name.includes(t)) return !0;
413
+ for (let n in e.attributes) {
414
+ let r = e.attributes[n];
415
+ if (typeof r == "string" && r.includes(t)) return !0;
416
+ }
417
+ }
418
+ return !1;
419
+ }, Xe = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription"), Ze = 1e3, Qe = 500, $e = 50, W = class {
387
420
  capacity;
388
421
  buffer = [];
389
- constructor(e = Ve) {
422
+ constructor(e = Ze) {
390
423
  this.capacity = e;
391
424
  }
392
425
  append(e) {
393
426
  this.buffer.push(e), this.buffer.length > this.capacity && this.buffer.shift();
394
427
  }
395
428
  query(e = {}) {
396
- let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? He, this.capacity), i = e.traceId, a = e.minDurationMs, o = e.status, s = e.name?.toLowerCase(), c = [];
429
+ let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? Qe, this.capacity), i = e.traceId, a = e.minDurationMs, o = e.status, s = e.name?.toLowerCase(), c = [];
397
430
  for (let e = this.buffer.length - 1; e >= 0 && c.length < r; e--) {
398
431
  let r = this.buffer[e];
399
432
  r.startMs < t || r.startMs > n || i !== void 0 && r.traceId !== i || a !== void 0 && r.durationMs < a || o !== void 0 && r.status !== o || s !== void 0 && !r.name.toLowerCase().includes(s) || c.push(r);
@@ -401,7 +434,7 @@ var xe = [
401
434
  return c.reverse();
402
435
  }
403
436
  queryGrouped(e = {}) {
404
- let t = e.since ?? 0, n = e.maxTraces ?? Ue, r = e.onlyErrors ?? !1, i = /* @__PURE__ */ new Map();
437
+ let t = e.since ?? 0, n = e.maxTraces ?? $e, r = e.onlyErrors ?? !1, i = /* @__PURE__ */ new Map();
405
438
  for (let e of this.buffer) {
406
439
  if (e.startMs < t) continue;
407
440
  let n = i.get(e.traceId);
@@ -412,7 +445,7 @@ var xe = [
412
445
  t.sort((e, t) => e.startMs - t.startMs);
413
446
  let n = t.some((e) => e.status === "error");
414
447
  if (r && !n) continue;
415
- let i = t[0].startMs, o = t.reduce((e, t) => t.endMs > e ? t.endMs : e, i), s = t.filter(W), c = s.length > 0 || t.some(Be), l = s.reduce((e, t) => e === void 0 || t.startMs > e.startMs ? t : e, void 0);
448
+ let i = t[0].startMs, o = t.reduce((e, t) => t.endMs > e ? t.endMs : e, i), s = t.filter(H), c = s.length > 0 || t.some(Xe), l = s.reduce((e, t) => e === void 0 || t.startMs > e.startMs ? t : e, void 0);
416
449
  a.push({
417
450
  traceId: e,
418
451
  rootName: t[0].name,
@@ -437,69 +470,70 @@ var xe = [
437
470
  clear() {
438
471
  this.buffer = [];
439
472
  }
440
- }, q = null, We = () => (q === null && (q = new K()), q), Ge = /* @__PURE__ */ new Set([
473
+ }, G = null, et = () => (G === null && (G = new W()), G), tt = /* @__PURE__ */ new Set([
441
474
  "off",
442
475
  "errors",
443
476
  "interesting",
444
477
  "all"
445
- ]), J = (e, t, n, r) => {
478
+ ]), K = (e, t, n, r) => {
446
479
  let i = Number(e);
447
480
  return Number.isFinite(i) ? Math.min(r, Math.max(n, i)) : t;
448
- }, Ke = (e) => e !== void 0 && [
481
+ }, nt = (e) => e !== void 0 && [
449
482
  "1",
450
483
  "true",
451
484
  "yes",
452
485
  "on"
453
- ].includes(e.toLowerCase()), qe = (e) => {
486
+ ].includes(e.toLowerCase()), rt = (e) => {
454
487
  let t = Number(e);
455
488
  return Number.isFinite(t) && t > 0 ? t : 24;
456
- }, Y = (e = process.env) => {
457
- let t = (e.VOLTRO_TRACING_BUFFER ?? "").toLowerCase() === "off", n = J(e.VOLTRO_TRACING_SAMPLE, 1, 0, 1), r = (e.VOLTRO_TRACING_PERSIST ?? "").toLowerCase(), i = e.NODE_ENV === "production" ? "off" : "interesting";
489
+ }, q = (e = process.env) => {
490
+ let t = (e.VOLTRO_TRACING_BUFFER ?? "").toLowerCase() === "off", n = K(e.VOLTRO_TRACING_SAMPLE, 1, 0, 1), r = (e.VOLTRO_TRACING_PERSIST ?? "").toLowerCase(), i = e.NODE_ENV === "production" ? "off" : "interesting";
458
491
  return {
459
- mode: Ge.has(r) ? r : n <= 0 ? "off" : i,
492
+ mode: tt.has(r) ? r : n <= 0 ? "off" : i,
460
493
  sampleRate: n,
461
- slowMs: J(e.VOLTRO_TRACING_SLOW_MS, 500, 0, 2 ** 53 - 1),
462
- ttlHours: qe(e.VOLTRO_TRACING_TTL_HOURS),
463
- persistDelivery: Ke(e.VOLTRO_TRACING_PERSIST_DELIVERY),
494
+ slowMs: K(e.VOLTRO_TRACING_SLOW_MS, 500, 0, 2 ** 53 - 1),
495
+ ttlHours: rt(e.VOLTRO_TRACING_TTL_HOURS),
496
+ persistDelivery: nt(e.VOLTRO_TRACING_PERSIST_DELIVERY),
464
497
  bufferDisabled: t
465
498
  };
466
- }, X = (e = process.env) => {
467
- let t = Y(e);
499
+ }, J = (e = process.env) => {
500
+ let t = q(e);
468
501
  return !t.bufferDisabled && t.mode !== "off";
469
- }, Je = (e, t) => {
502
+ }, it = (e, t) => {
470
503
  if (t >= 1) return !0;
471
504
  if (t <= 0) return !1;
472
505
  let n = 2166136261;
473
506
  for (let t = 0; t < e.length; t++) n ^= e.charCodeAt(t), n = Math.imul(n, 16777619);
474
507
  return (n >>> 0) % 1e3 < t * 1e3;
475
- }, Ye = (e, t) => {
476
- if (t.mode === "off" || G(e) || W(e) && !t.persistDelivery) return !1;
508
+ }, at = (e, t) => {
509
+ if (t.mode === "off" || U(e) || H(e) && !t.persistDelivery) return !1;
477
510
  let n = e.status === "error";
478
511
  if (t.mode === "errors") return n;
479
512
  if (n) return !0;
480
- if (!Je(e.traceId, t.sampleRate)) return !1;
513
+ if (!it(e.traceId, t.sampleRate)) return !1;
481
514
  if (t.mode === "all") return !0;
515
+ if (Ye(e)) return !1;
482
516
  let r = e.parentSpanId === null || e.parentSpanId === void 0 || e.parentSpanId === "", i = typeof e.durationMs == "number" && e.durationMs >= t.slowMs;
483
517
  return r || i;
484
- }, Xe = (e) => {
518
+ }, ot = (e) => {
485
519
  if (e.bufferDisabled) return "durable traces: OFF (VOLTRO_TRACING_BUFFER=off)";
486
520
  if (e.mode === "off") return "durable traces: OFF — _voltro_traces not created (prod default; set VOLTRO_TRACING_PERSIST=interesting to enable, or use OTLP)";
487
521
  let t = e.mode === "interesting" ? ` (errors + slow≥${e.slowMs}ms + roots)` : e.mode === "errors" ? " (errors only)" : "";
488
522
  return `durable traces: mode=${e.mode}${t}` + (e.sampleRate < 1 ? ` · sample=${e.sampleRate}` : "") + (e.persistDelivery ? " · +delivery" : "") + ` · ttl=${e.ttlHours}h`;
489
- }, Ze = (e = 30 * 6e4) => {
523
+ }, st = (e = 30 * 6e4) => {
490
524
  let t = /* @__PURE__ */ new Map();
491
525
  return (n, r) => {
492
526
  let i = t.get(n);
493
527
  return i !== void 0 && r - i < e ? !1 : (t.set(n, r), !0);
494
528
  };
495
- }, Qe = (e) => {
496
- let { store: t, log: n } = e, r = e.policy ?? Y();
497
- n.info(Xe(r));
498
- let i = Ze(), a = [], o = () => {};
529
+ }, ct = (e) => {
530
+ let { store: t, log: n } = e, r = e.policy ?? q();
531
+ n.info(ot(r));
532
+ let i = st(), a = [], o = () => {};
499
533
  if (r.mode !== "off") {
500
534
  let e = [], s = 0;
501
535
  o = (t) => {
502
- Ye(t, r) && (e.length >= 5e3 && (e.shift(), s += 1, i("flush-drop", Date.now()) && (n.warn(`trace flush queue saturated — dropping durable spans (${s}+ since last warning). Durable inflow exceeds write throughput; reduce it with VOLTRO_TRACING_PERSIST=errors|interesting or VOLTRO_TRACING_SAMPLE<1.`), s = 0)), e.push(t));
536
+ at(t, r) && (e.length >= 5e3 && (e.shift(), s += 1, i("flush-drop", Date.now()) && (n.warn(`trace flush queue saturated — dropping durable spans (${s}+ since last warning). Durable inflow exceeds write throughput; reduce it with VOLTRO_TRACING_PERSIST=errors|interesting or VOLTRO_TRACING_SAMPLE<1.`), s = 0)), e.push(t));
503
537
  };
504
538
  let c = async () => {
505
539
  if (e.length === 0) return;
@@ -541,7 +575,7 @@ var xe = [
541
575
  let n = await t.query({
542
576
  table: "_voltro_traces",
543
577
  order: [],
544
- predicate: A("startedAt", e),
578
+ predicate: S("startedAt", e),
545
579
  projection: ["id"],
546
580
  skip: void 0,
547
581
  take: c
@@ -565,35 +599,39 @@ var xe = [
565
599
  for (let e of a) clearInterval(e);
566
600
  }
567
601
  };
568
- }, Z = async (e) => {
569
- let a = !1, s = !1, c = !1, l = !1, d = !1, f = async (e) => {
570
- let p = await u.readdir(e, { withFileTypes: !0 }).catch(() => []);
571
- for (let u of p) if (u.isDirectory()) {
572
- if (u.name === "node_modules" || u.name === "dist" || u.name === ".framework" || u.name.startsWith(".")) continue;
573
- await f(o(e, u.name));
602
+ }, Y = (e) => n.test(e) || a.test(e), X = async (e) => {
603
+ let n = !1, a = !1, o = !1, c = !1, u = !1, d = async (e) => {
604
+ let f = await l.readdir(e, { withFileTypes: !0 }).catch(() => []);
605
+ for (let l of f) if (l.isDirectory()) {
606
+ if (l.name === "node_modules" || l.name === "dist" || l.name === ".framework" || l.name.startsWith(".")) continue;
607
+ await d(s(e, l.name));
574
608
  } else {
575
- let e = u.name;
576
- (r.test(e) || t.test(e)) && (a = !0), n.test(e) && (s = !0), i.test(e) && (c = !0), V.test(e) && (l = !0), U.test(e) && (d = !0);
609
+ let e = l.name;
610
+ (r.test(e) || t.test(e)) && (n = !0), Y(e) && (a = !0), i.test(e) && (o = !0), z.test(e) && (c = !0), V.test(e) && (u = !0);
577
611
  }
578
612
  };
579
- return await f(e), {
580
- workflows: a,
581
- schedules: s,
582
- webhooks: c,
583
- agents: l,
584
- connections: d
613
+ return await d(e), {
614
+ workflows: n,
615
+ schedules: a,
616
+ webhooks: o,
617
+ agents: c,
618
+ connections: u
585
619
  };
586
- }, $e = async (e) => {
587
- let t = o(e, "app.config.ts");
588
- if (!l(t)) return { plugins: [] };
620
+ }, lt = async (e) => {
621
+ let t = s(e, "app.config.ts");
622
+ if (!c(t)) return { plugins: [] };
589
623
  try {
590
- return { plugins: (await import(s(t).href)).default?.plugins ?? [] };
624
+ return { plugins: (await import(u(t).href)).default?.plugins ?? [] };
591
625
  } catch (e) {
592
626
  return {
593
627
  plugins: [],
594
628
  error: e
595
629
  };
596
630
  }
631
+ }, Z = async (e) => {
632
+ let { plugins: t, error: n } = await lt(e);
633
+ if (n !== void 0) throw new Q(e, n);
634
+ return t;
597
635
  }, Q = class extends Error {
598
636
  root;
599
637
  cause;
@@ -610,29 +648,27 @@ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.caus
610
648
  let t = /* @__PURE__ */ new Map(), n = (e) => {
611
649
  e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
612
650
  };
613
- for (let t of L({
651
+ for (let t of Oe({
614
652
  workflows: e.mix.workflows,
615
653
  schedules: e.mix.schedules,
616
654
  webhooks: e.mix.webhooks,
617
- traces: X(),
655
+ traces: J(),
618
656
  cdc: e.cdc,
619
657
  ...e.cdcDialect ? { cdcDialect: e.cdcDialect } : {},
620
- undo: ce(),
658
+ undo: be(),
621
659
  connections: e.mix.connections
622
660
  })) n(t);
623
- e.mix.agents && (n(h), n(_e), n(v), n(g)), e.mix.workflows && n(_);
624
- for (let t of Ne(e.plugins)) n(t);
661
+ e.mix.agents && (n(ue), n(le), n(pe), n(de)), e.mix.workflows && n(fe), (e.mix.workflows || e.mix.agents) && n(ge);
662
+ for (let t of Ve(e.plugins)) n(t);
625
663
  return [...t.values()];
626
- }, et = async (e) => {
627
- let t = await Z(e.root), { plugins: n, error: r } = await $e(e.root);
628
- if (r !== void 0) throw new Q(e.root, r);
629
- let i = (process.env.DB_DIALECT ?? "postgres").toLowerCase(), a = i === "mariadb" ? "mariadb" : i === "mssql" ? "mssql" : void 0;
664
+ }, ut = async (e) => {
665
+ let t = await X(e.root), n = await Z(e.root), r = (process.env.DB_DIALECT ?? "postgres").toLowerCase(), i = r === "mariadb" ? "mariadb" : r === "mssql" ? "mssql" : void 0;
630
666
  return $({
631
667
  mix: t,
632
668
  plugins: n,
633
- cdc: e.cdc ?? (a !== void 0 && (process.env.CDC ?? "1") !== "0"),
634
- ...a ? { cdcDialect: a } : {}
669
+ cdc: e.cdc ?? (i !== void 0 && (process.env.CDC ?? "1") !== "0"),
670
+ ...i ? { cdcDialect: i } : {}
635
671
  });
636
672
  };
637
673
  //#endregion
638
- export { L as C, Se as S, je as _, Qe as a, Ee as b, We as c, ze as d, V as f, Fe as g, Le as h, Z as i, G as l, H as m, et as n, X as o, Pe as p, $ as r, K as s, Q as t, U as u, Me as v, R as x, De as y };
674
+ export { Ne as C, ke as E, Pe as S, F as T, Ge as _, Y as a, R as b, J as c, U as d, V as f, B as g, He as h, X as i, W as l, z as m, ut as n, Z as o, qe as p, $ as r, ct as s, Q as t, et as u, Ue as v, I as w, Be as x, ze as y };