@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
@@ -0,0 +1,1087 @@
1
+ import { i as e, t } from "./nodeEnvironment-cGFAj1J8.js";
2
+ import { r as n } from "./appPort-B_HpJ_ck.js";
3
+ import { A as r, B as i, C as a, D as o, E as s, H as c, I as l, J as u, N as d, O as f, P as p, S as m, T as ee, U as h, V as g, a as _, b as v, d as y, f as b, i as x, j as S, k as te, n as ne, q as C, s as re, st as ie, ut as w, w as T, x as E, y as ae, z as D } from "./webDev-CBYvPqQr.js";
4
+ import { o as O, t as k } from "./connectionConfig-UFlIEiys.js";
5
+ import { A, D as j, a as M, h as oe, j as N, k as se } from "./inspect-CBqFtAKA.js";
6
+ import { a as ce, c as P, d as le, f as ue, l as F, p as I, u as de } from "./renderModeScan-D7J1B7Kw.js";
7
+ import { i as fe, n as pe, r as me, t as he } from "./runtimeRegistry-DMeKfTHP.js";
8
+ import { n as ge } from "./logFileSink-C_D2wRN1.js";
9
+ import { t as _e } from "./inspectMetrics-CfdKLh6t.js";
10
+ import { t as ve } from "./bootTiming-BdyP9nYw.js";
11
+ import { dirname as ye, extname as be, join as L, resolve as R } from "node:path";
12
+ import { promises as z } from "node:fs";
13
+ import { fileURLToPath as B, pathToFileURL as xe } from "node:url";
14
+ import { createLogger as V, printReadyBlock as Se } from "@voltro/logger";
15
+ import { snapshotMetricsSync as Ce } from "@voltro/runtime";
16
+ import { createServer as we } from "node:http";
17
+ //#region src/isrCdcInvalidator.ts
18
+ var H = V({ scope: "voltro:start:cdc" }), U = (e) => (t) => {
19
+ let n = 0;
20
+ for (let [r, i] of e.tableSubscriptionsByPattern) {
21
+ if (!i.includes(t)) continue;
22
+ let a = e.regexByPattern.get(r);
23
+ a && (n += e.cache.invalidateBy((e) => {
24
+ let t = e.split("|")[0] ?? e;
25
+ return a.test(t);
26
+ }));
27
+ }
28
+ return n;
29
+ }, W = () => k() ? O() : null, Te = (e) => {
30
+ let t = e.channel ?? "framework_changes", n = U(e), r = null, i = null;
31
+ return {
32
+ start: async () => {
33
+ if (e.tableSubscriptionsByPattern.size === 0) {
34
+ H.debug("skipped — no pages declare cacheInvalidatesOn");
35
+ return;
36
+ }
37
+ let a = W();
38
+ if (!a) {
39
+ H.warn(`${e.tableSubscriptionsByPattern.size} route(s) declare \`cacheInvalidatesOn\` and will NOT be invalidated live — no database is configured for this web process. Set DB_URL (or DB_HOST / PG_HOST) so the CDC listener can connect; until then those routes go stale until their \`revalidate\` window expires.`, { routes: [...e.tableSubscriptionsByPattern.keys()] });
40
+ return;
41
+ }
42
+ r = new (await (import("pg"))).default.Client(a), await r.connect(), i = (e) => {
43
+ if (e.channel !== t || !e.payload) return;
44
+ let r;
45
+ try {
46
+ r = JSON.parse(e.payload);
47
+ } catch (e) {
48
+ H.warn("bad CDC payload", {}, e);
49
+ return;
50
+ }
51
+ let i = n(r.table);
52
+ i > 0 && H.info(`${r.op} on '${r.table}' → dropped ${i} cache entries`, {
53
+ op: r.op,
54
+ table: r.table,
55
+ dropped: i
56
+ });
57
+ }, r.on("notification", i), await r.query(`LISTEN ${t}`), H.info(`LISTEN ${t}`, {
58
+ channel: t,
59
+ ..."connectionString" in a ? { target: a.connectionString.replace(/\/\/[^@/]*@/, "//") } : {
60
+ host: a.host,
61
+ port: a.port,
62
+ database: a.database
63
+ }
64
+ });
65
+ },
66
+ stop: async () => {
67
+ if (r) {
68
+ try {
69
+ i && r.off("notification", i), await r.end();
70
+ } catch {}
71
+ r = null, i = null;
72
+ }
73
+ }
74
+ };
75
+ }, G = V({ scope: "voltro:start:isr-cache" }), K = "voltro_isr_cache", Ee = (e) => `
76
+ CREATE TABLE IF NOT EXISTS ${e} (
77
+ cache_key TEXT PRIMARY KEY,
78
+ html TEXT NOT NULL,
79
+ rendered_at BIGINT NOT NULL,
80
+ expires_at BIGINT NOT NULL,
81
+ servable_until BIGINT NOT NULL,
82
+ revalidate_ms BIGINT NOT NULL,
83
+ stale_while_revalidate_ms BIGINT NOT NULL DEFAULT 0
84
+ );
85
+ CREATE INDEX IF NOT EXISTS ${e}_servable_until_idx ON ${e} (servable_until);
86
+ `, De = (e) => {
87
+ let t = e.tableName ?? K, { client: n } = e, r = /* @__PURE__ */ new Map(), i = !1, a = (async () => {
88
+ i || (i = !0, await n.query(Ee(t)));
89
+ })().then(async () => {
90
+ let e = await n.query(`SELECT * FROM ${t}`);
91
+ for (let t of e.rows) r.set(t.cache_key, {
92
+ html: t.html,
93
+ renderedAt: Number(t.rendered_at),
94
+ expiresAt: Number(t.expires_at),
95
+ servableUntil: Number(t.servable_until),
96
+ revalidateMs: Number(t.revalidate_ms),
97
+ staleWhileRevalidateMs: Number(t.stale_while_revalidate_ms)
98
+ });
99
+ }).catch((e) => {
100
+ G.warn("postgres bootstrap failed", {}, e);
101
+ }), o = (e, t) => {
102
+ a.then(() => n.query(e, t)).catch((e) => {
103
+ G.warn("postgres write failed", {}, e);
104
+ });
105
+ };
106
+ return {
107
+ get(e) {
108
+ return r.get(e);
109
+ },
110
+ set(e, n) {
111
+ r.set(e, n), o(`INSERT INTO ${t}
112
+ (cache_key, html, rendered_at, expires_at, servable_until, revalidate_ms, stale_while_revalidate_ms)
113
+ VALUES ($1, $2, $3, $4, $5, $6, $7)
114
+ ON CONFLICT (cache_key) DO UPDATE SET
115
+ html = EXCLUDED.html,
116
+ rendered_at = EXCLUDED.rendered_at,
117
+ expires_at = EXCLUDED.expires_at,
118
+ servable_until = EXCLUDED.servable_until,
119
+ revalidate_ms = EXCLUDED.revalidate_ms,
120
+ stale_while_revalidate_ms = EXCLUDED.stale_while_revalidate_ms`, [
121
+ e,
122
+ n.html,
123
+ n.renderedAt,
124
+ n.expiresAt,
125
+ n.servableUntil,
126
+ n.revalidateMs,
127
+ n.staleWhileRevalidateMs
128
+ ]);
129
+ },
130
+ invalidate(e) {
131
+ r.delete(e), o(`DELETE FROM ${t} WHERE cache_key = $1`, [e]);
132
+ },
133
+ invalidateBy(e) {
134
+ let n = 0, i = [];
135
+ for (let t of r.keys()) e(t) && (r.delete(t), i.push(t), n++);
136
+ return i.length > 0 && o(`DELETE FROM ${t} WHERE cache_key = ANY($1)`, [i]), n;
137
+ },
138
+ clear() {
139
+ r.clear(), o(`DELETE FROM ${t}`, []);
140
+ },
141
+ size() {
142
+ return r.size;
143
+ },
144
+ snapshot() {
145
+ return Array.from(r.entries());
146
+ }
147
+ };
148
+ }, q = V({ scope: "voltro:start" }), Oe = await (async () => {
149
+ try {
150
+ let e = L(ye(B(import.meta.url)), "..", "package.json"), t = await z.readFile(e, "utf8");
151
+ return JSON.parse(t).version ?? "0.0.0";
152
+ } catch {
153
+ return "0.0.0";
154
+ }
155
+ })(), J = (e) => e instanceof Error && e._voltroControl === "redirect" && typeof e.location == "string", Y = (e) => e instanceof Error && e._voltroControl === "not-found", X = {
156
+ ".html": "text/html; charset=utf-8",
157
+ ".js": "application/javascript",
158
+ ".mjs": "application/javascript",
159
+ ".css": "text/css",
160
+ ".json": "application/json",
161
+ ".xml": "application/xml; charset=utf-8",
162
+ ".rss": "application/rss+xml; charset=utf-8",
163
+ ".atom": "application/atom+xml; charset=utf-8",
164
+ ".svg": "image/svg+xml",
165
+ ".png": "image/png",
166
+ ".jpg": "image/jpeg",
167
+ ".jpeg": "image/jpeg",
168
+ ".webp": "image/webp",
169
+ ".ico": "image/x-icon",
170
+ ".woff": "font/woff",
171
+ ".woff2": "font/woff2",
172
+ ".txt": "text/plain; charset=utf-8"
173
+ }, ke = (e) => X[be(e).toLowerCase()] ?? "application/octet-stream", Ae = (e) => e.replace(/<script\b(?=[^>]*\btype="module")(?:(?!<\/script>).)*<\/script>/gi, "").replace(/<script\b(?=[^>]*\bsrc=)(?:(?!<\/script>).)*<\/script>/gi, "").replace(/<link\b[^>]*\brel="modulepreload"[^>]*>/gi, ""), Z = async (e) => {
174
+ try {
175
+ return await z.stat(e), !0;
176
+ } catch {
177
+ return !1;
178
+ }
179
+ }, je = (e) => {
180
+ let t = [], n = 0, r = e.split("/").filter(Boolean), i = [];
181
+ for (let e of r) e.startsWith("[[...") && e.endsWith("]]") ? (i.push("(.*)"), t.push(e.slice(5, -2)), n += 2) : e.startsWith("[...") && e.endsWith("]") ? (i.push("(.+)"), t.push(e.slice(4, -1)), n += 3) : e.startsWith("[") && e.endsWith("]") ? (i.push("([^/]+)"), t.push(e.slice(1, -1)), n += 1) : i.push(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
182
+ let a = i.join("/");
183
+ return {
184
+ regex: a.length === 0 ? /^\/?$/ : RegExp(`^/${a}/?$`),
185
+ paramNames: t,
186
+ priority: n
187
+ };
188
+ }, Me = (e) => e.map((e) => {
189
+ let { regex: t, paramNames: n, priority: r } = je(e.pattern);
190
+ return {
191
+ pattern: e.pattern,
192
+ file: e.file,
193
+ dirChain: e.dirChain,
194
+ regex: t,
195
+ paramNames: n,
196
+ priority: r
197
+ };
198
+ }).slice().sort((e, t) => e.priority - t.priority), Q = (e, t) => {
199
+ for (let n of t) {
200
+ let t = n.regex.exec(e);
201
+ if (!t) continue;
202
+ let r = {};
203
+ for (let e = 0; e < n.paramNames.length; e++) r[n.paramNames[e]] = t[e + 1] ?? "";
204
+ return {
205
+ route: n,
206
+ params: r
207
+ };
208
+ }
209
+ return null;
210
+ }, Ne = async (e) => {
211
+ let { provider: t, route: n, params: i, pathname: c, dirs: l, shellTemplate: u, requestHeaders: d, requestUrl: p = "", apiOrigin: ee, apiName: h } = e, { search: g } = r(p), v = x(ee, d.cookie, { apiName: h }), y = await t.getPage(n.pattern, n.file), b = P(y, n.file), S = b === "spa" && re(l, n.dirChain).some((e) => e.hasLayout);
212
+ if (b !== "ssr" && b !== "isr" && !S) return null;
213
+ let ne = re(l, n.dirChain), C = {}, ie = null, w, ae = new AbortController();
214
+ try {
215
+ (await t.getHelpers()).beginStoreSeeds(), {chain: w, segmentLoaderData: C} = await _({
216
+ entries: ne,
217
+ loadLayout: (e) => t.getLayout(e.dir),
218
+ loadError: (e) => t.getError(e.dir),
219
+ loadPending: (e) => t.getPending(e.dir),
220
+ ctx: {
221
+ params: i,
222
+ pathname: c,
223
+ search: g,
224
+ signal: ae.signal,
225
+ headers: d,
226
+ query: v
227
+ }
228
+ }), typeof y.loader == "function" && !S && (ie = await y.loader({
229
+ params: i,
230
+ pathname: c,
231
+ search: g,
232
+ signal: ae.signal,
233
+ headers: d,
234
+ query: v
235
+ }));
236
+ } catch (e) {
237
+ if (J(e)) return {
238
+ control: "redirect",
239
+ status: e.status,
240
+ location: e.location
241
+ };
242
+ if (Y(e)) return { control: "not-found" };
243
+ throw e;
244
+ }
245
+ let D = await t.getHelpers();
246
+ S || await E({
247
+ pageMod: y,
248
+ params: i,
249
+ query: v,
250
+ apiName: h,
251
+ seed: D.seedPreloadedSubscription,
252
+ onError: ({ tag: e, apiName: t }, n) => q.warn("preload seed failed", {
253
+ tag: e,
254
+ apiName: t,
255
+ pathname: c
256
+ }, n)
257
+ });
258
+ let O = {
259
+ pattern: n.pattern,
260
+ Component: y.default,
261
+ meta: y.meta,
262
+ loader: y.loader,
263
+ ErrorBoundary: y.ErrorBoundary,
264
+ Pending: y.Pending,
265
+ renderMode: b,
266
+ chain: w
267
+ }, k = {
268
+ cookies: D.parseCookieHeader(d.cookie),
269
+ headers: d,
270
+ url: p
271
+ }, A = D.i18n?.resolve(d.cookie, d["accept-language"]), j = y.interactive ?? "full";
272
+ if (S) {
273
+ let e = o({
274
+ helpers: D,
275
+ page: n.pattern,
276
+ interactive: j,
277
+ delivery: "stream",
278
+ renderInput: {
279
+ descriptor: O,
280
+ params: i,
281
+ pathname: c,
282
+ search: g,
283
+ segmentLoaderData: C,
284
+ requestContext: k,
285
+ ...A ? {
286
+ outerWrap: A.outerWrap,
287
+ locale: A.locale
288
+ } : {}
289
+ }
290
+ }), t = A?.locale ?? k.cookies["voltro:locale"] ?? "en", r = (t) => te({
291
+ helpers: D,
292
+ prepared: e,
293
+ meta: t,
294
+ interactive: j
295
+ });
296
+ if (e.hasDeferred) {
297
+ let n = a({ shell: u });
298
+ return {
299
+ renderMode: "spa",
300
+ stream: (i) => T({
301
+ res: i,
302
+ shell: n,
303
+ htmlLang: t,
304
+ headers: {
305
+ "content-type": "text/html; charset=utf-8",
306
+ "x-voltro-rendered-by": "spa"
307
+ },
308
+ headInjection: r,
309
+ render: (t) => D.renderPageToStream({
310
+ ...e.renderInput,
311
+ ...t
312
+ }),
313
+ onShellError: (e) => {
314
+ q.error("spa layout shell render failed", { pathname: c }, e), i.writeHead(500, { "content-type": "text/plain; charset=utf-8" }), i.end("server error");
315
+ }
316
+ })
317
+ };
318
+ }
319
+ let s = f({
320
+ helpers: D,
321
+ prepared: e
322
+ });
323
+ return {
324
+ html: m(u.replace("<div id=\"root\"></div>", `<div id="root">${s.body}</div>`), r(s.meta)).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${t}"`),
325
+ renderMode: "spa",
326
+ revalidateMs: null
327
+ };
328
+ }
329
+ let M = s({
330
+ helpers: D,
331
+ page: n.pattern,
332
+ pathname: c,
333
+ renderMode: b,
334
+ interactive: j,
335
+ loaderData: ie,
336
+ segmentLoaderData: C,
337
+ pageLoaderRan: typeof y.loader == "function"
338
+ }), oe = {
339
+ descriptor: O,
340
+ params: i,
341
+ pathname: c,
342
+ search: g,
343
+ loaderData: M.loaderData,
344
+ segmentLoaderData: M.segmentLoaderData,
345
+ requestContext: k,
346
+ ...A ? {
347
+ outerWrap: A.outerWrap,
348
+ locale: A.locale
349
+ } : {}
350
+ }, N = (e) => [
351
+ D.renderMetaToHtml(e),
352
+ `<meta name="voltro-interactive" content="${j}" />`,
353
+ ...M.hasDeferred ? [D.renderDeferredRegistryScript()] : [],
354
+ D.renderRouterStateScript(M.stateInput)
355
+ ].filter((e) => e.length > 0).join("\n ");
356
+ if (b === "ssr" && j === "full" && e.buffered !== !0) {
357
+ let e = A?.locale ?? k.cookies["voltro:locale"] ?? "en", t = a({ shell: u });
358
+ return {
359
+ renderMode: "ssr",
360
+ stream: (n) => T({
361
+ res: n,
362
+ shell: t,
363
+ htmlLang: e,
364
+ headers: {
365
+ "content-type": "text/html; charset=utf-8",
366
+ "x-voltro-rendered-by": "ssr"
367
+ },
368
+ headInjection: N,
369
+ render: (e) => D.renderPageToStream({
370
+ ...oe,
371
+ ...e
372
+ }),
373
+ onShellError: (e) => {
374
+ q.error("ssr shell render failed", { pathname: c }, e), n.writeHead(500, { "content-type": "text/plain; charset=utf-8" }), n.end("server error");
375
+ }
376
+ })
377
+ };
378
+ }
379
+ let { html: se, meta: ce } = D.renderPageToHtml(oe), le = N(ce), ue = A?.locale ?? k.cookies["voltro:locale"] ?? "en", F = m(u.replace("<div id=\"root\"></div>", `<div id="root">${se}</div>`), le).replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${ue}"`);
380
+ j === "none" && (F = Ae(F));
381
+ let de = b === "isr" ? I(y.revalidate) : null;
382
+ return {
383
+ html: F,
384
+ renderMode: b,
385
+ revalidateMs: de
386
+ };
387
+ }, $ = (e) => e === "" ? "/" : e, Pe = async (e) => {
388
+ let t = await import(xe(e).href);
389
+ return {
390
+ kind: "bundle",
391
+ getPageMeta: () => t.pageMeta,
392
+ async getPage(e, n) {
393
+ let r = t.pages[e];
394
+ if (!r) throw Error(`[voltro start] ssr bundle missing page for pattern ${e}`);
395
+ return typeof r == "function" ? await r() : r;
396
+ },
397
+ async getLayout(e) {
398
+ let n = t.layouts[$(e)];
399
+ if (!n) throw Error(`[voltro start] ssr bundle missing layout for dir ${$(e)}`);
400
+ return typeof n == "function" ? await n() : n;
401
+ },
402
+ async getError(e) {
403
+ let n = t.errors[$(e)];
404
+ if (!n) throw Error(`[voltro start] ssr bundle missing error for dir ${$(e)}`);
405
+ return typeof n == "function" ? await n() : n;
406
+ },
407
+ async getPending(e) {
408
+ let n = t.pendings[$(e)];
409
+ if (!n) throw Error(`[voltro start] ssr bundle missing pending for dir ${$(e)}`);
410
+ return typeof n == "function" ? await n() : n;
411
+ },
412
+ async getHelpers() {
413
+ return t.helpers;
414
+ },
415
+ async close() {}
416
+ };
417
+ }, Fe = async (e, t) => {
418
+ let n = await w("vite", () => import("vite")), r = (await import("@vitejs/plugin-react")).default, i = (await import("@tailwindcss/vite")).default, a = await n.createServer({
419
+ root: t,
420
+ envPrefix: "__VOLTRO_VITE_ENV_DISABLED__",
421
+ plugins: [r(), i()],
422
+ resolve: { dedupe: [
423
+ "react",
424
+ "react-dom",
425
+ "react-intl",
426
+ "@voltro/i18n"
427
+ ] },
428
+ ssr: { noExternal: ["react-intl", "@voltro/i18n"] },
429
+ server: {
430
+ middlewareMode: !0,
431
+ hmr: !1
432
+ },
433
+ appType: "custom",
434
+ logLevel: "warn"
435
+ }), o = L(e, "src", "pages"), s = (e) => e === "" ? o : L(o, e), c = C({
436
+ limit: u(),
437
+ onColdStart: (e) => q.debug("ssr cold-compile start", { id: e }),
438
+ onColdEnd: (e, { durationMs: t, failed: n }) => q.debug(`ssr cold-compile ${n ? "FAILED" : "end"} ${t}ms`, {
439
+ id: e,
440
+ ms: t,
441
+ ...n ? { failed: !0 } : {}
442
+ })
443
+ }), l = (e) => c.load(e, async () => await a.ssrLoadModule(e));
444
+ return {
445
+ kind: "middleware",
446
+ async getPage(e, t) {
447
+ return l(L(o, t));
448
+ },
449
+ async getLayout(e) {
450
+ return l(L(s(e), "layout.tsx"));
451
+ },
452
+ async getError(e) {
453
+ return l(L(s(e), "error.tsx"));
454
+ },
455
+ async getPending(e) {
456
+ return l(L(s(e), "loading.tsx"));
457
+ },
458
+ async getHelpers() {
459
+ return await l("@voltro/web/ssr");
460
+ },
461
+ async close() {
462
+ await a.close();
463
+ }
464
+ };
465
+ }, Ie = async (t) => {
466
+ let r = ve(), a = await y(t);
467
+ if (!a) return {
468
+ ran: !1,
469
+ exitCode: 0
470
+ };
471
+ if (a.type !== "web") return q.error("only web apps are supported by `voltro start`"), {
472
+ ran: !0,
473
+ exitCode: 1
474
+ };
475
+ let { resolved: o } = await ie({
476
+ rawEnv: a.env,
477
+ appType: "web",
478
+ root: t,
479
+ log: q,
480
+ generateTypes: !1
481
+ }), s = o.publicValues;
482
+ r.mark("config");
483
+ let u = c();
484
+ D(u), q.info("booting voltro start", { app: a.name ?? "(unnamed)" });
485
+ let f = n({
486
+ kind: "web",
487
+ configPort: a.port,
488
+ env: process.env,
489
+ dashboardPin: process.env[S] === "1"
490
+ });
491
+ for (let e of f.warnings) q.warn(e);
492
+ let m = f.port, _ = L(t, ".framework"), x = L(_, "dist"), te = L(x, "index.html");
493
+ if (!await Z(te)) return q.error("no built dist found — run `voltro build` first", { distDir: x }), {
494
+ ran: !0,
495
+ exitCode: 1
496
+ };
497
+ let C = a.name ?? "unnamed", w = he("web", C, m), T = ge(C);
498
+ await fe({
499
+ id: w,
500
+ name: C,
501
+ kind: "web",
502
+ url: `http://localhost:${m}`,
503
+ pid: process.pid,
504
+ status: "booting",
505
+ logFile: T.path
506
+ }).catch(() => {});
507
+ let E = L(x, "_voltro", "shell.html"), P = await Z(E) ? await z.readFile(E, "utf8") : await z.readFile(te, "utf8"), I = await b(t, a), ye = ne(I[0]), be = I[0]?.name, R, B = null, xe = process.env.SSR_CACHE === "postgres";
508
+ if (xe && k()) B = new (await (import("pg"))).default.Client(O()), await B.connect(), R = De({ client: B }), q.info("isr cache backend: postgres", { table: "voltro_isr_cache" });
509
+ else if (xe) {
510
+ let t = "SSR_CACHE=postgres, but nothing in the environment names a database (looked for DB_URL, DB_PRIMARY_URL, DB_DIRECT_URL, DB_MIGRATE_URL, DB_HOST, PG_HOST).";
511
+ if (e()) throw q.fatal(`${t} Refusing to fall back to the per-process memory cache: it is not shared between instances and does not survive a restart, so the pages this process serves would differ from its replicas' with nothing to indicate it.`), Error("[voltro start] SSR_CACHE=postgres with no database configured");
512
+ R = ue(), q.warn(`${t} Falling back to the per-process memory cache — this would be a hard failure in production.`);
513
+ } else R = ue(), q.info("isr cache backend: memory (per-process)", { hint: "set SSR_CACHE=postgres for persistent storage" });
514
+ await v(t, a, I, s);
515
+ let { pages: V, dirs: H } = await ae(L(t, "src", "pages")), U = Me(V);
516
+ r.mark("scan");
517
+ let W = L(x, "server", "ssrEntry.js"), G = await Z(W);
518
+ if (!G && process.env.NODE_ENV === "production") throw q.fatal(`production \`voltro start\` requires a precompiled SSR bundle at ${W} but it is missing. Run \`voltro build\` before serving — production renders from the bundle and never compiles on demand.`), Error(`[voltro start] missing SSR bundle at ${W}`);
519
+ let K = G ? await Pe(W) : await Fe(t, _);
520
+ q.info(`ssr loader: ${K.kind}`, {
521
+ kind: K.kind,
522
+ ...K.kind === "middleware" ? { hint: "no pre-built SSR bundle found; run `voltro build` to enable bundle mode" } : {}
523
+ }), r.mark("provider");
524
+ let Ee = K.getPageMeta?.(), J = /* @__PURE__ */ new Map(), Y = 0;
525
+ for (let e of V) {
526
+ let t = Ee?.[e.pattern];
527
+ if (t) {
528
+ J.set(e.pattern, t);
529
+ continue;
530
+ }
531
+ try {
532
+ let t = await K.getPage(e.pattern, e.file);
533
+ J.set(e.pattern, ce(t, e.file)), Y++;
534
+ } catch (t) {
535
+ q.warn("failed to load page metadata", { pattern: e.pattern }, t);
536
+ }
537
+ }
538
+ q.info(`registered ${J.size} route(s)`, {
539
+ count: J.size,
540
+ fromManifest: J.size - Y,
541
+ fromModules: Y
542
+ }), r.mark("routes");
543
+ let X = /* @__PURE__ */ new Set();
544
+ for (let e of U) J.get(e.pattern)?.renderMode === "spa" && re(H, e.dirChain).some((e) => e.hasLayout) && X.add(e.pattern);
545
+ X.size > 0 && q.info(`${X.size} spa route(s) render an SSR layout shell`, { patterns: [...X] });
546
+ let Ae = /* @__PURE__ */ new Map();
547
+ for (let [e, t] of J) t.cacheInvalidatesOn.length > 0 && Ae.set(e, t.cacheInvalidatesOn);
548
+ let je = /* @__PURE__ */ new Map();
549
+ for (let e of U) je.set(e.pattern, e.regex);
550
+ let $ = Te({
551
+ cache: R,
552
+ tableSubscriptionsByPattern: Ae,
553
+ regexByPattern: je
554
+ });
555
+ await $.start(), r.mark("cdc");
556
+ let Ie = _e(), Le = V.map((e) => {
557
+ let t = J.get(e.pattern);
558
+ return {
559
+ pattern: e.pattern,
560
+ file: e.file,
561
+ dirChain: e.dirChain,
562
+ renderMode: t?.renderMode ?? "static",
563
+ interactive: t?.interactive ?? "full",
564
+ tenantAware: t?.tenantAware ?? !1,
565
+ revalidateMs: t?.revalidateMs ?? null,
566
+ staleWhileRevalidateMs: t?.staleWhileRevalidateMs ?? 0,
567
+ cacheInvalidatesOn: t?.cacheInvalidatesOn ?? [],
568
+ hasLoader: t?.hasLoader ?? !1,
569
+ hasMeta: t?.hasMeta ?? !1,
570
+ hasGetStaticPaths: t?.hasGetStaticPaths ?? !1
571
+ };
572
+ }), Re = H.map((e) => ({
573
+ dir: e.dir,
574
+ hasLayout: e.hasLayout,
575
+ hasError: e.hasError,
576
+ hasPending: e.hasPending,
577
+ hasNotFound: e.hasNotFound
578
+ })), ze = B ? "postgres" : "memory", Be = {
579
+ kind: "web",
580
+ meta: {
581
+ name: a.name ?? "(unnamed)",
582
+ voltroVersion: Oe,
583
+ port: m,
584
+ mode: "start",
585
+ apis: Object.entries(a.apis ?? {}).map(([e, t]) => {
586
+ let n = {
587
+ name: e,
588
+ package: t.package
589
+ };
590
+ return t.url !== void 0 && (n.url = t.url), n;
591
+ })
592
+ },
593
+ routes: Le,
594
+ dirs: Re,
595
+ cache: () => {
596
+ let e = Date.now(), t = R.snapshot().map(([t, n]) => ({
597
+ key: t,
598
+ renderedAt: n.renderedAt,
599
+ expiresAt: n.expiresAt,
600
+ servableUntil: n.servableUntil,
601
+ ageMs: e - n.renderedAt,
602
+ htmlBytes: Buffer.byteLength(n.html, "utf8"),
603
+ revalidateMs: n.revalidateMs,
604
+ staleWhileRevalidateMs: n.staleWhileRevalidateMs
605
+ }));
606
+ return {
607
+ backend: ze,
608
+ size: R.size(),
609
+ entries: t
610
+ };
611
+ },
612
+ metrics: () => Ce()
613
+ }, Ve = async (e, n) => {
614
+ let r = e.split("?")[0] ?? "/";
615
+ if (a.name === "voltroDashboard" && r === "/api/dashboard/registry") try {
616
+ let e = await pe();
617
+ return {
618
+ status: 200,
619
+ headers: { "content-type": "application/json; charset=utf-8" },
620
+ body: JSON.stringify(e)
621
+ };
622
+ } catch (e) {
623
+ return {
624
+ status: 500,
625
+ headers: { "content-type": "text/plain" },
626
+ body: `registry read error: ${e.message}`
627
+ };
628
+ }
629
+ if (a.name === "voltroDashboard" && r === "/api/dashboard/config") {
630
+ let e = process.env.VOLTRO_DASHBOARD_APPS, t = [];
631
+ if (e && e.trim().length > 0) {
632
+ let n;
633
+ try {
634
+ n = JSON.parse(e);
635
+ } catch (e) {
636
+ return {
637
+ status: 500,
638
+ headers: { "content-type": "text/plain" },
639
+ body: `VOLTRO_DASHBOARD_APPS is not valid JSON: ${e.message}`
640
+ };
641
+ }
642
+ for (let e of Array.isArray(n) ? n : []) {
643
+ if (typeof e != "object" || !e) continue;
644
+ let n = e;
645
+ typeof n.url != "string" || n.url.length === 0 || t.push({
646
+ url: n.url,
647
+ ...typeof n.name == "string" ? { name: n.name } : {},
648
+ ...typeof n.token == "string" ? { token: n.token } : {}
649
+ });
650
+ }
651
+ }
652
+ return {
653
+ status: 200,
654
+ headers: { "content-type": "application/json; charset=utf-8" },
655
+ body: JSON.stringify({ apps: t })
656
+ };
657
+ }
658
+ if (r === "/_voltro/inspect/logs") {
659
+ let t = l(e, i(), n);
660
+ return {
661
+ status: t.status,
662
+ headers: {
663
+ "content-type": t.contentType,
664
+ ...j(n.origin)
665
+ },
666
+ body: t.body
667
+ };
668
+ }
669
+ if (r !== "/_voltro/inspect/stream") {
670
+ let t = oe(e, Be, n);
671
+ if (t !== null) return {
672
+ status: t.status,
673
+ headers: {
674
+ "content-type": t.contentType,
675
+ ...t.headers ?? {}
676
+ },
677
+ body: t.body
678
+ };
679
+ }
680
+ let o = Q(r, U), s = o ? J.get(o.route.pattern)?.renderMode : void 0, c = s === "ssr" || s === "isr" || (o ? X.has(o.route.pattern) : !1), d = r === "/" ? L(x, "index.html") : L(x, r.replace(/^\//, ""), "index.html");
681
+ if (!c && await Z(d)) return {
682
+ status: 200,
683
+ headers: { "content-type": "text/html; charset=utf-8" },
684
+ body: await z.readFile(d)
685
+ };
686
+ if (/\.[a-z0-9]+$/i.test(r)) {
687
+ let e = L(x, r.replace(/^\//, ""));
688
+ if (await Z(e)) {
689
+ let t = await z.readFile(e);
690
+ return {
691
+ status: 200,
692
+ headers: { "content-type": ke(e) },
693
+ body: t
694
+ };
695
+ }
696
+ }
697
+ let f = Q(r, U);
698
+ if (!f) return {
699
+ status: 404,
700
+ headers: { "content-type": "text/plain" },
701
+ body: "not found"
702
+ };
703
+ let p = J.get(f.route.pattern), m = n["x-tenant"] ?? "anonymous", h = (await K.getHelpers()).i18n?.resolve(n.cookie, n["accept-language"])?.locale, g = F(r, {
704
+ ...p?.tenantAware ? { tenant: m } : {},
705
+ ...h ? { locale: h } : {}
706
+ }), _ = R.get(g), v = Date.now();
707
+ if (_ && de(_, v)) return u.emit("cache", {
708
+ kind: "HIT",
709
+ key: g,
710
+ ageMs: v - _.renderedAt
711
+ }), {
712
+ status: 200,
713
+ headers: {
714
+ "content-type": "text/html; charset=utf-8",
715
+ "x-voltro-rendered-by": "isr",
716
+ "x-voltro-cache": "HIT",
717
+ "x-voltro-cache-key": g,
718
+ "x-voltro-cache-age-ms": String(v - _.renderedAt)
719
+ },
720
+ body: _.html
721
+ };
722
+ if (_ && le(_, v)) return u.emit("cache", {
723
+ kind: "STALE",
724
+ key: g,
725
+ ageMs: v - _.renderedAt
726
+ }), (async () => {
727
+ try {
728
+ let i = await Ne({
729
+ provider: K,
730
+ root: t,
731
+ route: f.route,
732
+ params: f.params,
733
+ pathname: r,
734
+ dirs: H,
735
+ shellTemplate: P,
736
+ requestHeaders: n,
737
+ apiOrigin: ye,
738
+ apiName: be,
739
+ requestUrl: e,
740
+ buffered: !0
741
+ });
742
+ if (i && "html" in i && i.renderMode === "isr" && i.revalidateMs !== null) {
743
+ let e = J.get(f.route.pattern)?.staleWhileRevalidateMs ?? 0, t = Date.now();
744
+ R.set(g, {
745
+ html: i.html,
746
+ renderedAt: t,
747
+ expiresAt: t + i.revalidateMs,
748
+ servableUntil: t + i.revalidateMs + e,
749
+ revalidateMs: i.revalidateMs,
750
+ staleWhileRevalidateMs: e
751
+ });
752
+ }
753
+ } catch (e) {
754
+ q.warn("background SWR refresh failed", { url: r }, e);
755
+ }
756
+ })(), {
757
+ status: 200,
758
+ headers: {
759
+ "content-type": "text/html; charset=utf-8",
760
+ "x-voltro-rendered-by": "isr",
761
+ "x-voltro-cache": "STALE",
762
+ "x-voltro-cache-key": g,
763
+ "x-voltro-cache-age-ms": String(v - _.renderedAt)
764
+ },
765
+ body: _.html
766
+ };
767
+ try {
768
+ let i = await Ne({
769
+ provider: K,
770
+ root: t,
771
+ route: f.route,
772
+ params: f.params,
773
+ pathname: r,
774
+ dirs: H,
775
+ shellTemplate: P,
776
+ requestHeaders: n,
777
+ apiOrigin: ye,
778
+ apiName: be,
779
+ requestUrl: e
780
+ });
781
+ if (!i) return {
782
+ status: 200,
783
+ headers: {
784
+ "content-type": "text/html; charset=utf-8",
785
+ "x-voltro-rendered-by": "spa-fallback"
786
+ },
787
+ body: P
788
+ };
789
+ if ("stream" in i) return {
790
+ status: 200,
791
+ headers: { "x-voltro-rendered-by": i.renderMode },
792
+ body: "",
793
+ stream: i.stream
794
+ };
795
+ if ("control" in i) return i.control === "redirect" ? {
796
+ status: i.status,
797
+ headers: {
798
+ location: i.location,
799
+ "x-voltro-rendered-by": "loader-redirect"
800
+ },
801
+ body: ""
802
+ } : {
803
+ status: 404,
804
+ headers: {
805
+ "content-type": "text/plain; charset=utf-8",
806
+ "x-voltro-rendered-by": "loader-not-found"
807
+ },
808
+ body: "not found"
809
+ };
810
+ let a = {
811
+ "content-type": "text/html; charset=utf-8",
812
+ "x-voltro-rendered-by": i.renderMode
813
+ };
814
+ if (i.renderMode === "isr" && i.revalidateMs !== null) {
815
+ let e = Date.now(), t = J.get(f.route.pattern)?.staleWhileRevalidateMs ?? 0;
816
+ R.set(g, {
817
+ html: i.html,
818
+ renderedAt: e,
819
+ expiresAt: e + i.revalidateMs,
820
+ servableUntil: e + i.revalidateMs + t,
821
+ revalidateMs: i.revalidateMs,
822
+ staleWhileRevalidateMs: t
823
+ }), a["x-voltro-cache"] = "MISS", a["x-voltro-cache-key"] = g, a["x-voltro-cache-revalidate-ms"] = String(i.revalidateMs), t > 0 && (a["x-voltro-cache-swr-ms"] = String(t)), u.emit("cache", {
824
+ kind: "MISS",
825
+ key: g,
826
+ revalidateMs: i.revalidateMs,
827
+ swrMs: t
828
+ });
829
+ } else i.renderMode === "isr" && (a["x-voltro-cache"] = "BYPASS", u.emit("cache", {
830
+ kind: "BYPASS",
831
+ key: g
832
+ }));
833
+ return {
834
+ status: 200,
835
+ headers: a,
836
+ body: i.html
837
+ };
838
+ } catch (e) {
839
+ return q.error("render error", { url: r }, e), ee(e) ? {
840
+ status: 500,
841
+ headers: {
842
+ "content-type": "text/plain; charset=utf-8",
843
+ "x-voltro-rendered-by": "defer-unsupported"
844
+ },
845
+ body: e.message
846
+ } : {
847
+ status: 500,
848
+ headers: { "content-type": "text/plain" },
849
+ body: "server error"
850
+ };
851
+ }
852
+ }, He = !1, Ue = we(async (e, t) => {
853
+ let n = e.url ?? "/", r = Date.now(), i = {};
854
+ for (let [t, n] of Object.entries(e.headers)) n !== void 0 && (i[t.toLowerCase()] = Array.isArray(n) ? n.join(", ") : n);
855
+ let o = n.split("?")[0] ?? "/", s = (e.method ?? "GET").toUpperCase();
856
+ if (o === "/internal/liveness") {
857
+ t.writeHead(200, {
858
+ "content-type": "text/plain",
859
+ "cache-control": "no-store"
860
+ }), t.end("ok");
861
+ return;
862
+ }
863
+ if (o === "/internal/readiness") {
864
+ let e = He ? 200 : 503;
865
+ t.writeHead(e, {
866
+ "content-type": "text/plain",
867
+ "cache-control": "no-store"
868
+ }), t.end(He ? "ready" : "not-ready");
869
+ return;
870
+ }
871
+ if (s === "OPTIONS" && o.startsWith("/_voltro/inspect")) {
872
+ let e = j(i.origin);
873
+ t.writeHead(204, e), t.end();
874
+ return;
875
+ }
876
+ if (a.name === "voltroDashboard" && o === "/api/dashboard/proxy") {
877
+ let r = new URL(n, "http://x").searchParams.get("target");
878
+ if (!r) {
879
+ t.writeHead(400, { "content-type": "text/plain" }), t.end("missing ?target=");
880
+ return;
881
+ }
882
+ if (!se(r)) {
883
+ t.writeHead(400, { "content-type": "text/plain" }), t.end("target not allowed: must be loopback or an origin configured in VOLTRO_DASHBOARD_APPS");
884
+ return;
885
+ }
886
+ try {
887
+ let n = { accept: i.accept ?? "application/json" }, a = i.authorization;
888
+ a ? n.authorization = Array.isArray(a) ? a[0] : a : N(r) && process.env.VOLTRO_INSPECT_TOKEN && (n.authorization = `Bearer ${process.env.VOLTRO_INSPECT_TOKEN}`);
889
+ let o;
890
+ if (s && s !== "GET" && s !== "HEAD") {
891
+ let t = [];
892
+ for await (let n of e) t.push(n);
893
+ o = Buffer.concat(t);
894
+ let r = i["content-type"];
895
+ r && (n["content-type"] = Array.isArray(r) ? r[0] : r);
896
+ }
897
+ let c = await fetch(r, {
898
+ redirect: "manual",
899
+ method: s,
900
+ headers: n,
901
+ ...o ? { body: new Uint8Array(o.buffer, o.byteOffset, o.byteLength) } : {}
902
+ }), l = Buffer.from(await c.arrayBuffer());
903
+ t.writeHead(c.status, {
904
+ "content-type": c.headers.get("content-type") ?? "application/octet-stream",
905
+ "content-length": String(l.length)
906
+ }), t.end(l);
907
+ } catch (e) {
908
+ t.writeHead(502, { "content-type": "text/plain" }), t.end(`proxy error: ${e.message}`);
909
+ }
910
+ return;
911
+ }
912
+ if (a.name === "voltroDashboard" && o === "/api/dashboard/proxy/stream") {
913
+ let r = new URL(n, "http://x").searchParams.get("target");
914
+ if (!r) {
915
+ t.writeHead(400, { "content-type": "text/plain" }), t.end("missing ?target=");
916
+ return;
917
+ }
918
+ if (!se(r)) {
919
+ t.writeHead(400, { "content-type": "text/plain" }), t.end("target not allowed: must be loopback or an origin configured in VOLTRO_DASHBOARD_APPS");
920
+ return;
921
+ }
922
+ let a = new AbortController();
923
+ e.on("close", () => a.abort()), t.on("close", () => a.abort());
924
+ try {
925
+ let e = i.authorization ?? (N(r) && process.env.VOLTRO_INSPECT_TOKEN ? `Bearer ${process.env.VOLTRO_INSPECT_TOKEN}` : void 0), n = await fetch(r, {
926
+ redirect: "manual",
927
+ method: "GET",
928
+ headers: {
929
+ accept: "text/event-stream",
930
+ ...e ? { authorization: Array.isArray(e) ? e[0] : e } : {}
931
+ },
932
+ signal: a.signal
933
+ });
934
+ if (!n.ok || !n.body) {
935
+ t.writeHead(n.status, { "content-type": "text/plain" }), t.end(`upstream ${n.status}`);
936
+ return;
937
+ }
938
+ t.writeHead(200, {
939
+ "content-type": "text/event-stream; charset=utf-8",
940
+ "cache-control": "no-cache, no-transform",
941
+ connection: "keep-alive",
942
+ "x-accel-buffering": "no"
943
+ }), t.flushHeaders();
944
+ let o = n.body.getReader();
945
+ try {
946
+ for (;;) {
947
+ let { done: e, value: n } = await o.read();
948
+ if (e) break;
949
+ n && t.write(Buffer.from(n));
950
+ }
951
+ } finally {
952
+ o.releaseLock(), t.end();
953
+ }
954
+ } catch (e) {
955
+ e.name !== "AbortError" && (t.writeHead(502, { "content-type": "text/plain" }), t.end(`proxy stream error: ${e.message}`));
956
+ }
957
+ return;
958
+ }
959
+ if (o === "/_voltro/inspect/stream") {
960
+ let n = j(i.origin);
961
+ if (A()) {
962
+ t.writeHead(503, {
963
+ "content-type": "application/json",
964
+ ...n
965
+ }), t.end(JSON.stringify({ error: "inspect disabled (VOLTRO_INSPECT=off)" }));
966
+ return;
967
+ }
968
+ let r = M(i, "GET");
969
+ if (!r.ok) {
970
+ t.writeHead(401, {
971
+ "content-type": "application/json",
972
+ ...n
973
+ }), t.end(JSON.stringify({
974
+ error: "unauthorized",
975
+ reason: r.reason
976
+ }));
977
+ return;
978
+ }
979
+ t.writeHead(200, {
980
+ "content-type": "text/event-stream; charset=utf-8",
981
+ "cache-control": "no-cache, no-transform",
982
+ connection: "keep-alive",
983
+ "x-accel-buffering": "no",
984
+ ...n
985
+ }), t.flushHeaders(), t.write("retry: 5000\n\n");
986
+ for (let e of u.buffered()) t.write(g(e));
987
+ let a = u.subscribe((e) => {
988
+ t.write(g(e));
989
+ }), o = setInterval(() => {
990
+ t.write(h());
991
+ }, 15e3), s = () => {
992
+ clearInterval(o), a();
993
+ };
994
+ e.on("close", s), t.on("close", s);
995
+ return;
996
+ }
997
+ try {
998
+ let e = await Ve(n, i);
999
+ if (e.stream ? e.stream(t) : (t.writeHead(e.status, e.headers), t.end(e.body)), !o.startsWith("/_voltro/inspect")) {
1000
+ let t = Date.now() - r;
1001
+ u.emit("request", {
1002
+ url: o,
1003
+ status: e.status,
1004
+ durationMs: t,
1005
+ renderedBy: e.headers["x-voltro-rendered-by"],
1006
+ cache: e.headers["x-voltro-cache"]
1007
+ });
1008
+ let n = Q(o, U)?.route.pattern ?? (e.status === 404 ? "<unmatched>" : "<asset>");
1009
+ Ie.record({
1010
+ kind: "request",
1011
+ tag: n,
1012
+ durationMs: t,
1013
+ status: e.status >= 500 ? "error" : "ok"
1014
+ });
1015
+ }
1016
+ } catch (e) {
1017
+ t.writeHead(500, { "content-type": "text/plain" }), t.end(`internal error: ${e.message}`);
1018
+ }
1019
+ });
1020
+ await new Promise((e) => Ue.listen(m, "::", e)), He = !0, r.mark("ready"), q.info(`listening on http://localhost:${m}`, {
1021
+ port: m,
1022
+ distDir: x
1023
+ }), q.debug("dynamic + ssr/isr routes resolve via SSR loader");
1024
+ try {
1025
+ await fe({
1026
+ id: w,
1027
+ name: C,
1028
+ kind: "web",
1029
+ url: `http://localhost:${m}`,
1030
+ pid: process.pid,
1031
+ status: "live",
1032
+ logFile: T.path
1033
+ });
1034
+ let e = p(t);
1035
+ if (e) {
1036
+ let t = await d({ dashboardAppPath: e });
1037
+ t.status === "launched" ? q.info(`dashboard launched at http://localhost:${t.port}`, { port: t.port }) : t.status === "already-running" && q.debug(`dashboard already running on :${t.port}`, { port: t.port });
1038
+ }
1039
+ setInterval(() => {
1040
+ fe({
1041
+ id: w,
1042
+ name: C,
1043
+ kind: "web",
1044
+ url: `http://localhost:${m}`,
1045
+ pid: process.pid,
1046
+ status: "live",
1047
+ logFile: T.path
1048
+ }).catch(() => {});
1049
+ }, 1e4).unref();
1050
+ } catch (e) {
1051
+ q.warn("runtime-registry write failed", {}, e);
1052
+ }
1053
+ Se({
1054
+ app: a.name ?? "unnamed",
1055
+ kind: "web",
1056
+ url: `http://localhost:${m}`,
1057
+ bootMs: r.total()
1058
+ });
1059
+ let We = r.phaseBreakdown();
1060
+ q.info(`start: ready in ${r.total()}ms`, {
1061
+ bootMs: r.total(),
1062
+ ...We ? { phases: We } : {}
1063
+ });
1064
+ let Ge = !1, Ke = (e) => async () => {
1065
+ if (!Ge) {
1066
+ if (Ge = !0, q.info(`received ${e}, shutting down`, { signal: e }), Ue.close(), await $.stop(), B) try {
1067
+ await B.end();
1068
+ } catch {}
1069
+ await K.close(), await me(w), await T.dispose(), process.exit(0);
1070
+ }
1071
+ };
1072
+ process.on("SIGINT", Ke("SIGINT")), process.on("SIGTERM", Ke("SIGTERM"));
1073
+ let qe = process.ppid;
1074
+ if (qe > 1) {
1075
+ let e = setInterval(() => {
1076
+ (process.ppid !== qe || process.ppid === 1) && (clearInterval(e), Ke("SIGTERM")());
1077
+ }, 2e3);
1078
+ e.unref();
1079
+ }
1080
+ return new Promise(() => {});
1081
+ }, Le = async (e) => {
1082
+ t("start");
1083
+ let n = await Ie(R(e.find((e) => !e.startsWith("-")) ?? process.cwd()));
1084
+ return n.ran ? n.exitCode : (q.error("no web app found at this path"), 1);
1085
+ };
1086
+ //#endregion
1087
+ export { Ie as n, Le as t };