@geekmidas/cli 10.0.0-alpha.15 → 10.0.0-alpha.150

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 (438) hide show
  1. package/README.md +313 -380
  2. package/bin/adjacent-tsconfig.mjs +46 -8
  3. package/bin/gkm.mjs +11 -3
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-CusLH-9S.mjs +1037 -0
  7. package/dist/EndpointGenerator-CusLH-9S.mjs.map +1 -0
  8. package/dist/EndpointGenerator-DyLMYClE.cjs +1096 -0
  9. package/dist/EndpointGenerator-DyLMYClE.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-CytuBrRm.cjs +412 -0
  11. package/dist/GoDaddyProvider-CytuBrRm.cjs.map +1 -0
  12. package/dist/GoDaddyProvider-W0Dxd5v9.mjs +412 -0
  13. package/dist/GoDaddyProvider-W0Dxd5v9.mjs.map +1 -0
  14. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-CCc9xoBN.cjs} +23 -9
  15. package/dist/HostingerProvider-CCc9xoBN.cjs.map +1 -0
  16. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-DaQr2ueR.mjs} +23 -9
  17. package/dist/HostingerProvider-DaQr2ueR.mjs.map +1 -0
  18. package/dist/LegacyStateStore-BDA0rx3b.cjs +124 -0
  19. package/dist/LegacyStateStore-BDA0rx3b.cjs.map +1 -0
  20. package/dist/LegacyStateStore-BTcTbCGk.mjs +124 -0
  21. package/dist/LegacyStateStore-BTcTbCGk.mjs.map +1 -0
  22. package/dist/LocalStateStore-BNuQoZYe.cjs +178 -0
  23. package/dist/LocalStateStore-BNuQoZYe.cjs.map +1 -0
  24. package/dist/LocalStateStore-CqpCKVvi.mjs +167 -0
  25. package/dist/LocalStateStore-CqpCKVvi.mjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-BTMuu1WS.mjs +534 -0
  27. package/dist/OpenApiTsGenerator-BTMuu1WS.mjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-CI-tceXV.cjs +539 -0
  29. package/dist/OpenApiTsGenerator-CI-tceXV.cjs.map +1 -0
  30. package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
  31. package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
  32. package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
  33. package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
  34. package/dist/S3StateStore-BpsGWDMK.mjs +223 -0
  35. package/dist/S3StateStore-BpsGWDMK.mjs.map +1 -0
  36. package/dist/S3StateStore-nrmSClXN.cjs +222 -0
  37. package/dist/S3StateStore-nrmSClXN.cjs.map +1 -0
  38. package/dist/SSMStateStore-DrPCC_VN.mjs +205 -0
  39. package/dist/SSMStateStore-DrPCC_VN.mjs.map +1 -0
  40. package/dist/SSMStateStore-hexM8C7n.cjs +204 -0
  41. package/dist/SSMStateStore-hexM8C7n.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-BNJyPmXJ.cjs +848 -0
  43. package/dist/SubscriberGenerator-BNJyPmXJ.cjs.map +1 -0
  44. package/dist/SubscriberGenerator-CzPrixYu.mjs +783 -0
  45. package/dist/SubscriberGenerator-CzPrixYu.mjs.map +1 -0
  46. package/dist/add-DXMYV5ak.mjs +711 -0
  47. package/dist/add-DXMYV5ak.mjs.map +1 -0
  48. package/dist/add-DgAeo6ht.cjs +713 -0
  49. package/dist/add-DgAeo6ht.cjs.map +1 -0
  50. package/dist/appPorts-BoXMwolc.mjs +249 -0
  51. package/dist/appPorts-BoXMwolc.mjs.map +1 -0
  52. package/dist/appPorts-IW-OZmRi.cjs +296 -0
  53. package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
  54. package/dist/apps-Bb05wCBm.mjs +5534 -0
  55. package/dist/apps-Bb05wCBm.mjs.map +1 -0
  56. package/dist/apps-CMLyyVGQ.cjs +6148 -0
  57. package/dist/apps-CMLyyVGQ.cjs.map +1 -0
  58. package/dist/aws-8QQ8n-t6.mjs +89 -0
  59. package/dist/aws-8QQ8n-t6.mjs.map +1 -0
  60. package/dist/aws-DY9NqQIT.cjs +100 -0
  61. package/dist/aws-DY9NqQIT.cjs.map +1 -0
  62. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  63. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  64. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  65. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  66. package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  67. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  68. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  69. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  70. package/dist/backups/runner.cjs +519 -0
  71. package/dist/backups/runner.cjs.map +1 -0
  72. package/dist/backups/runner.d.cts +102 -0
  73. package/dist/backups/runner.d.cts.map +1 -0
  74. package/dist/backups/runner.d.mts +102 -0
  75. package/dist/backups/runner.d.mts.map +1 -0
  76. package/dist/backups/runner.mjs +506 -0
  77. package/dist/backups/runner.mjs.map +1 -0
  78. package/dist/{bundler-BodTL4kf.mjs → bundler-C1kDZyQ-.mjs} +59 -14
  79. package/dist/bundler-C1kDZyQ-.mjs.map +1 -0
  80. package/dist/{bundler-BeNDZdHQ.cjs → bundler-CD9Ug2uu.cjs} +59 -14
  81. package/dist/bundler-CD9Ug2uu.cjs.map +1 -0
  82. package/dist/cli-35yoGg9o.cjs +71 -0
  83. package/dist/cli-35yoGg9o.cjs.map +1 -0
  84. package/dist/cli-BAcJaRG7.mjs +71 -0
  85. package/dist/cli-BAcJaRG7.mjs.map +1 -0
  86. package/dist/compose-BZTh5HR3.mjs +1560 -0
  87. package/dist/compose-BZTh5HR3.mjs.map +1 -0
  88. package/dist/compose-CAhGIfG8.mjs +2877 -0
  89. package/dist/compose-CAhGIfG8.mjs.map +1 -0
  90. package/dist/compose-DF08HNJE.cjs +2966 -0
  91. package/dist/compose-DF08HNJE.cjs.map +1 -0
  92. package/dist/compose-KV6q3cEz.cjs +1919 -0
  93. package/dist/compose-KV6q3cEz.cjs.map +1 -0
  94. package/dist/config-BLrAd7Of.mjs +659 -0
  95. package/dist/config-BLrAd7Of.mjs.map +1 -0
  96. package/dist/config-CRk2vdSp.d.mts +268 -0
  97. package/dist/config-CRk2vdSp.d.mts.map +1 -0
  98. package/dist/config-juUyBlb1.cjs +772 -0
  99. package/dist/config-juUyBlb1.cjs.map +1 -0
  100. package/dist/config-oBgsbLip.d.cts +268 -0
  101. package/dist/config-oBgsbLip.d.cts.map +1 -0
  102. package/dist/config.cjs +11 -3
  103. package/dist/config.d.cts +4 -117
  104. package/dist/config.d.mts +4 -117
  105. package/dist/config.mjs +3 -3
  106. package/dist/credentialSchemas-BAklWDna.cjs +271 -0
  107. package/dist/credentialSchemas-BAklWDna.cjs.map +1 -0
  108. package/dist/credentialSchemas-mz9QZTYh.mjs +236 -0
  109. package/dist/credentialSchemas-mz9QZTYh.mjs.map +1 -0
  110. package/dist/credentials-B72Jrk66.mjs +1817 -0
  111. package/dist/credentials-B72Jrk66.mjs.map +1 -0
  112. package/dist/credentials-Dmhuj3FX.cjs +2272 -0
  113. package/dist/credentials-Dmhuj3FX.cjs.map +1 -0
  114. package/dist/databases-DawSdqBI.cjs +703 -0
  115. package/dist/databases-DawSdqBI.cjs.map +1 -0
  116. package/dist/databases-mzSUFBTw.mjs +588 -0
  117. package/dist/databases-mzSUFBTw.mjs.map +1 -0
  118. package/dist/define-6poNqm5O.mjs +106 -0
  119. package/dist/define-6poNqm5O.mjs.map +1 -0
  120. package/dist/define-crmMcXFS.cjs +153 -0
  121. package/dist/define-crmMcXFS.cjs.map +1 -0
  122. package/dist/deploy/public.cjs +211 -0
  123. package/dist/deploy/public.cjs.map +1 -0
  124. package/dist/deploy/public.d.cts +647 -0
  125. package/dist/deploy/public.d.cts.map +1 -0
  126. package/dist/deploy/public.d.mts +647 -0
  127. package/dist/deploy/public.d.mts.map +1 -0
  128. package/dist/deploy/public.mjs +144 -0
  129. package/dist/deploy/public.mjs.map +1 -0
  130. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  131. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  132. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  133. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  134. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  135. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  136. package/dist/deploy/sniffer-hooks.cjs +1 -1
  137. package/dist/deploy/sniffer-hooks.mjs +1 -1
  138. package/dist/deploy/sniffer-loader.cjs +2 -2
  139. package/dist/deploy/sniffer-loader.mjs +1 -1
  140. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  141. package/dist/deploy/sniffer-routes-worker.mjs +1 -1
  142. package/dist/deploy-BV6Tw73K.cjs +3892 -0
  143. package/dist/deploy-BV6Tw73K.cjs.map +1 -0
  144. package/dist/deploy-C4XjPy-a.mjs +3836 -0
  145. package/dist/deploy-C4XjPy-a.mjs.map +1 -0
  146. package/dist/discover-CRywE7yc.cjs +1085 -0
  147. package/dist/discover-CRywE7yc.cjs.map +1 -0
  148. package/dist/discover-DbDrCQ8h.mjs +940 -0
  149. package/dist/discover-DbDrCQ8h.mjs.map +1 -0
  150. package/dist/docker-B0di7_Ub.cjs +1514 -0
  151. package/dist/docker-B0di7_Ub.cjs.map +1 -0
  152. package/dist/docker-D_NN2Z6W.mjs +1407 -0
  153. package/dist/docker-D_NN2Z6W.mjs.map +1 -0
  154. package/dist/dokploy-DDyZ0o4M.mjs +38 -0
  155. package/dist/dokploy-DDyZ0o4M.mjs.map +1 -0
  156. package/dist/dokploy-FFNHKz37.cjs +38 -0
  157. package/dist/dokploy-FFNHKz37.cjs.map +1 -0
  158. package/dist/drivers-aM87NQJi.cjs +224 -0
  159. package/dist/drivers-aM87NQJi.cjs.map +1 -0
  160. package/dist/drivers-uxLBq3e3.mjs +195 -0
  161. package/dist/drivers-uxLBq3e3.mjs.map +1 -0
  162. package/dist/eas-6_Z1ImVg.mjs +334 -0
  163. package/dist/eas-6_Z1ImVg.mjs.map +1 -0
  164. package/dist/eas-BetrZzjq.cjs +337 -0
  165. package/dist/eas-BetrZzjq.cjs.map +1 -0
  166. package/dist/emit-Bj6XSivk.mjs +136 -0
  167. package/dist/emit-Bj6XSivk.mjs.map +1 -0
  168. package/dist/emit-CDC__ubE.cjs +147 -0
  169. package/dist/emit-CDC__ubE.cjs.map +1 -0
  170. package/dist/encryption-BrRVjItb.cjs +90 -0
  171. package/dist/encryption-BrRVjItb.cjs.map +1 -0
  172. package/dist/encryption-DGnfdO68.mjs +89 -0
  173. package/dist/encryption-DGnfdO68.mjs.map +1 -0
  174. package/dist/engine-8TjM26dd.mjs +3217 -0
  175. package/dist/engine-8TjM26dd.mjs.map +1 -0
  176. package/dist/engine-C36N8por.cjs +3330 -0
  177. package/dist/engine-C36N8por.cjs.map +1 -0
  178. package/dist/errors-D8Gwp5kU.mjs +23 -0
  179. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  180. package/dist/errors-DMC4Umsb.cjs +34 -0
  181. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  182. package/dist/github-BOu0bETi.cjs +901 -0
  183. package/dist/github-BOu0bETi.cjs.map +1 -0
  184. package/dist/github-Ct6XDkzE.mjs +900 -0
  185. package/dist/github-Ct6XDkzE.mjs.map +1 -0
  186. package/dist/googlePlay-BaRsxlJo.mjs +931 -0
  187. package/dist/googlePlay-BaRsxlJo.mjs.map +1 -0
  188. package/dist/googlePlay-JAxXMaGu.cjs +931 -0
  189. package/dist/googlePlay-JAxXMaGu.cjs.map +1 -0
  190. package/dist/{index-D-iAVHx-.d.cts → index-B35vTdAW.d.cts} +39 -15
  191. package/dist/index-B35vTdAW.d.cts.map +1 -0
  192. package/dist/{index-Cd-qeOam.d.mts → index-Dv1Zj86i.d.mts} +39 -15
  193. package/dist/index-Dv1Zj86i.d.mts.map +1 -0
  194. package/dist/index.cjs +13594 -12347
  195. package/dist/index.cjs.map +1 -1
  196. package/dist/index.mjs +13541 -12292
  197. package/dist/index.mjs.map +1 -1
  198. package/dist/local-D7WVQcJJ.mjs +224 -0
  199. package/dist/local-D7WVQcJJ.mjs.map +1 -0
  200. package/dist/local-DFPeCIJi.cjs +241 -0
  201. package/dist/local-DFPeCIJi.cjs.map +1 -0
  202. package/dist/migrate-BMIUYmpM.mjs +267 -0
  203. package/dist/migrate-BMIUYmpM.mjs.map +1 -0
  204. package/dist/migrate-CnE-X40v.mjs +181 -0
  205. package/dist/migrate-CnE-X40v.mjs.map +1 -0
  206. package/dist/migrate-CvuWFjos.cjs +181 -0
  207. package/dist/migrate-CvuWFjos.cjs.map +1 -0
  208. package/dist/migrate-DdE8kF0j.cjs +272 -0
  209. package/dist/migrate-DdE8kF0j.cjs.map +1 -0
  210. package/dist/notes-C_4SO0x4.mjs +399 -0
  211. package/dist/notes-C_4SO0x4.mjs.map +1 -0
  212. package/dist/notes-ORze6zXA.cjs +500 -0
  213. package/dist/notes-ORze6zXA.cjs.map +1 -0
  214. package/dist/openapi.cjs +213 -7
  215. package/dist/openapi.cjs.map +1 -0
  216. package/dist/openapi.d.cts +32 -8
  217. package/dist/openapi.d.cts.map +1 -1
  218. package/dist/openapi.d.mts +32 -8
  219. package/dist/openapi.d.mts.map +1 -1
  220. package/dist/openapi.mjs +208 -2
  221. package/dist/openapi.mjs.map +1 -0
  222. package/dist/projectBucket-C9x0gzEO.cjs +263 -0
  223. package/dist/projectBucket-C9x0gzEO.cjs.map +1 -0
  224. package/dist/projectBucket-CdRj4IyR.mjs +222 -0
  225. package/dist/projectBucket-CdRj4IyR.mjs.map +1 -0
  226. package/dist/provider-BqpjG9QM.cjs +57 -0
  227. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  228. package/dist/provider-CEOKk8NS.mjs +46 -0
  229. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  230. package/dist/publish-CL376jrq.cjs +124 -0
  231. package/dist/publish-CL376jrq.cjs.map +1 -0
  232. package/dist/publish-DkkWS3Pj.mjs +123 -0
  233. package/dist/publish-DkkWS3Pj.mjs.map +1 -0
  234. package/dist/ready-BNh3zsSn.cjs +404 -0
  235. package/dist/ready-BNh3zsSn.cjs.map +1 -0
  236. package/dist/ready-g25dcGzK.mjs +375 -0
  237. package/dist/ready-g25dcGzK.mjs.map +1 -0
  238. package/dist/reconcile/public.cjs +3 -5
  239. package/dist/reconcile/public.d.cts +31 -89
  240. package/dist/reconcile/public.d.cts.map +1 -1
  241. package/dist/reconcile/public.d.mts +31 -89
  242. package/dist/reconcile/public.d.mts.map +1 -1
  243. package/dist/reconcile/public.mjs +3 -3
  244. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  245. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  246. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  247. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  248. package/dist/resolve-BXzDwYUS.cjs +316 -0
  249. package/dist/resolve-BXzDwYUS.cjs.map +1 -0
  250. package/dist/resolve-CZ_Wel7j.mjs +263 -0
  251. package/dist/resolve-CZ_Wel7j.mjs.map +1 -0
  252. package/dist/rollback-D_FXI_K5.mjs +136 -0
  253. package/dist/rollback-D_FXI_K5.mjs.map +1 -0
  254. package/dist/rollback-p1y0KlED.cjs +165 -0
  255. package/dist/rollback-p1y0KlED.cjs.map +1 -0
  256. package/dist/runtime-CFvcLEJW.d.cts +82 -0
  257. package/dist/runtime-CFvcLEJW.d.cts.map +1 -0
  258. package/dist/runtime-dwsH6ddo.d.mts +82 -0
  259. package/dist/runtime-dwsH6ddo.d.mts.map +1 -0
  260. package/dist/s3-CV5baYeq.mjs +215 -0
  261. package/dist/s3-CV5baYeq.mjs.map +1 -0
  262. package/dist/s3-DTX4Kkmn.cjs +215 -0
  263. package/dist/s3-DTX4Kkmn.cjs.map +1 -0
  264. package/dist/sandbox/config-worker.cjs +43 -0
  265. package/dist/sandbox/config-worker.cjs.map +1 -0
  266. package/dist/sandbox/config-worker.d.cts +1 -0
  267. package/dist/sandbox/config-worker.d.mts +1 -0
  268. package/dist/sandbox/config-worker.mjs +44 -0
  269. package/dist/sandbox/config-worker.mjs.map +1 -0
  270. package/dist/sandbox/credentials-worker.cjs +53 -0
  271. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  272. package/dist/sandbox/credentials-worker.d.cts +1 -0
  273. package/dist/sandbox/credentials-worker.d.mts +1 -0
  274. package/dist/sandbox/credentials-worker.mjs +54 -0
  275. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  276. package/dist/sandbox/discover-worker.cjs +47 -0
  277. package/dist/sandbox/discover-worker.cjs.map +1 -0
  278. package/dist/sandbox/discover-worker.d.cts +1 -0
  279. package/dist/sandbox/discover-worker.d.mts +1 -0
  280. package/dist/sandbox/discover-worker.mjs +48 -0
  281. package/dist/sandbox/discover-worker.mjs.map +1 -0
  282. package/dist/sandbox/migrate-worker.cjs +75 -0
  283. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  284. package/dist/sandbox/migrate-worker.d.cts +1 -0
  285. package/dist/sandbox/migrate-worker.d.mts +1 -0
  286. package/dist/sandbox/migrate-worker.mjs +76 -0
  287. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  288. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  289. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  290. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  291. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  292. package/dist/secretsManager-CQORubp9.mjs +97 -0
  293. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  294. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  295. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  296. package/dist/seeds-B3xvUAQf.cjs +363 -0
  297. package/dist/seeds-B3xvUAQf.cjs.map +1 -0
  298. package/dist/seeds-BCC8vAXR.mjs +298 -0
  299. package/dist/seeds-BCC8vAXR.mjs.map +1 -0
  300. package/dist/serverSetup-BykJrnYe.cjs +652 -0
  301. package/dist/serverSetup-BykJrnYe.cjs.map +1 -0
  302. package/dist/serverSetup-CkuvIoej.mjs +652 -0
  303. package/dist/serverSetup-CkuvIoej.mjs.map +1 -0
  304. package/dist/sniffer-BIpoMNGz.mjs +1824 -0
  305. package/dist/sniffer-BIpoMNGz.mjs.map +1 -0
  306. package/dist/sniffer-DiBMi93N.cjs +1997 -0
  307. package/dist/sniffer-DiBMi93N.cjs.map +1 -0
  308. package/dist/snsSubscriptions-CkO_zk0j.cjs +1173 -0
  309. package/dist/snsSubscriptions-CkO_zk0j.cjs.map +1 -0
  310. package/dist/snsSubscriptions-CrmfcJfv.mjs +1048 -0
  311. package/dist/snsSubscriptions-CrmfcJfv.mjs.map +1 -0
  312. package/dist/sst-BZ9sTG8H.mjs +462 -0
  313. package/dist/sst-BZ9sTG8H.mjs.map +1 -0
  314. package/dist/sst-D233GoQY.cjs +485 -0
  315. package/dist/sst-D233GoQY.cjs.map +1 -0
  316. package/dist/stack-1yXKqI83.cjs +2287 -0
  317. package/dist/stack-1yXKqI83.cjs.map +1 -0
  318. package/dist/stack-pUz70Rmw.mjs +2124 -0
  319. package/dist/stack-pUz70Rmw.mjs.map +1 -0
  320. package/dist/stage-D6E_TlvR.mjs +302 -0
  321. package/dist/stage-D6E_TlvR.mjs.map +1 -0
  322. package/dist/stage-DAhomyUk.cjs +313 -0
  323. package/dist/stage-DAhomyUk.cjs.map +1 -0
  324. package/dist/stages-Bs1THSy7.cjs +190 -0
  325. package/dist/stages-Bs1THSy7.cjs.map +1 -0
  326. package/dist/stages-_xCG4Ymu.mjs +190 -0
  327. package/dist/stages-_xCG4Ymu.mjs.map +1 -0
  328. package/dist/target/public.cjs +15 -0
  329. package/dist/target/public.d.cts +28 -0
  330. package/dist/target/public.d.cts.map +1 -0
  331. package/dist/target/public.d.mts +28 -0
  332. package/dist/target/public.d.mts.map +1 -0
  333. package/dist/target/public.mjs +4 -0
  334. package/dist/terminal-CKBLsg6b.cjs +85 -0
  335. package/dist/terminal-CKBLsg6b.cjs.map +1 -0
  336. package/dist/terminal-CRinpE1t.mjs +85 -0
  337. package/dist/terminal-CRinpE1t.mjs.map +1 -0
  338. package/dist/types-Bl_CwZC9.cjs +90 -0
  339. package/dist/types-Bl_CwZC9.cjs.map +1 -0
  340. package/dist/{types-BGo5TaNE.d.mts → types-Dk--xVOT.d.cts} +2234 -439
  341. package/dist/types-Dk--xVOT.d.cts.map +1 -0
  342. package/dist/{types-C5ZNpUad.d.cts → types-DwQYpd_0.d.mts} +2232 -439
  343. package/dist/types-DwQYpd_0.d.mts.map +1 -0
  344. package/dist/types-Y1NfWlyG.mjs +61 -0
  345. package/dist/types-Y1NfWlyG.mjs.map +1 -0
  346. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  347. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  348. package/dist/utils-D_fxUqvU.mjs +156 -0
  349. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  350. package/dist/vitest.cjs +65 -0
  351. package/dist/vitest.cjs.map +1 -0
  352. package/dist/vitest.d.cts +29 -0
  353. package/dist/vitest.d.cts.map +1 -0
  354. package/dist/vitest.d.mts +29 -0
  355. package/dist/vitest.d.mts.map +1 -0
  356. package/dist/vitest.mjs +65 -0
  357. package/dist/vitest.mjs.map +1 -0
  358. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  359. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  360. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  361. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  362. package/dist/workspace/index.cjs +6 -2
  363. package/dist/workspace/index.d.cts +3 -3
  364. package/dist/workspace/index.d.mts +3 -3
  365. package/dist/workspace/index.mjs +2 -2
  366. package/dist/workspace-1szcahj9.cjs +2916 -0
  367. package/dist/workspace-1szcahj9.cjs.map +1 -0
  368. package/dist/workspace-DFGsrjGD.mjs +2480 -0
  369. package/dist/workspace-DFGsrjGD.mjs.map +1 -0
  370. package/package.json +66 -14
  371. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  372. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  373. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  374. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  375. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  376. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  377. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  378. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  379. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  380. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  381. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  382. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  383. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  384. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  385. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  386. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  387. package/dist/config-Q1rvKHvw.cjs +0 -467
  388. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  389. package/dist/config-pqGD3hF9.mjs +0 -414
  390. package/dist/config-pqGD3hF9.mjs.map +0 -1
  391. package/dist/config.d.cts.map +0 -1
  392. package/dist/config.d.mts.map +0 -1
  393. package/dist/credentials-BekkKtY_.mjs +0 -2780
  394. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  395. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  396. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  397. package/dist/discover-BERGFg8v.cjs +0 -288
  398. package/dist/discover-BERGFg8v.cjs.map +0 -1
  399. package/dist/discover-CK-n3w6b.mjs +0 -244
  400. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  401. package/dist/emit-BdoPFjZf.cjs +0 -253
  402. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  403. package/dist/emit-Bzq7JsMP.mjs +0 -224
  404. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  405. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  406. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  407. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  408. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  409. package/dist/generator-LfZU7NlU.mjs +0 -247
  410. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  411. package/dist/generator-Wdfp0jCS.cjs +0 -282
  412. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  413. package/dist/github-BfflNPVe.cjs +0 -203
  414. package/dist/github-BfflNPVe.cjs.map +0 -1
  415. package/dist/github-CRwnxKmD.mjs +0 -203
  416. package/dist/github-CRwnxKmD.mjs.map +0 -1
  417. package/dist/index-Cd-qeOam.d.mts.map +0 -1
  418. package/dist/index-D-iAVHx-.d.cts.map +0 -1
  419. package/dist/keystore-B4PRlbgE.mjs +0 -81
  420. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  421. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  422. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  423. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  424. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  425. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  426. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  427. package/dist/storage-C-30BD1e.cjs +0 -272
  428. package/dist/storage-C-30BD1e.cjs.map +0 -1
  429. package/dist/storage-P_b3w7uj.mjs +0 -231
  430. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  431. package/dist/sync-B3xxXtJT.mjs +0 -88
  432. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  433. package/dist/sync-D7uTIIEi.cjs +0 -111
  434. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  435. package/dist/types-BGo5TaNE.d.mts.map +0 -1
  436. package/dist/types-C5ZNpUad.d.cts.map +0 -1
  437. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  438. package/dist/workspace-mFpI_ky_.cjs.map +0 -1
@@ -1,12 +1,303 @@
1
- import { ConstructManifest } from "@geekmidas/manifest";
1
+ import { ConstructManifest, Declaration } from "@geekmidas/manifest";
2
+ //#region src/errors.d.ts
3
+ /**
4
+ * The errors gkm raises on purpose.
5
+ *
6
+ * A {@link GkmError} is a failure gkm saw coming and explained: a stage
7
+ * missing a key, a config that names nothing, no AWS credentials. Its
8
+ * message is the whole answer — what went wrong and what to do — so the CLI
9
+ * prints `Name: message` and nothing else. A stack trace under it would point
10
+ * at gkm's own code, which is not where the fix is.
11
+ *
12
+ * Anything else that reaches the CLI — a TypeError, an SDK error nothing
13
+ * wrapped — is a failure nobody explained, and keeps its stack. `--debug` or
14
+ * `GKM_DEBUG=1` shows the stack of both.
15
+ */
16
+ declare class GkmError extends Error {}
2
17
  //#endregion
3
- //#region src/deploy/state.d.ts
18
+ //#region src/sandbox/sandbox.d.ts
19
+ /** Where a command's output goes. */
20
+ type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';
21
+ interface SandboxExecOptions {
22
+ /**
23
+ * Where the command runs: the project root or a directory below it, as an
24
+ * absolute path or relative to the root. Anywhere else is refused with
25
+ * {@link SandboxCwdEscape}.
26
+ */
27
+ cwd: string;
28
+ /**
29
+ * The command's whole environment. Nothing of the host's is added to it:
30
+ * start from {@link Sandbox.env} and add what the step needs.
31
+ */
32
+ env: Readonly<Record<string, string>>;
33
+ /**
34
+ * How long the command may run before it is killed. Required: a step that
35
+ * waits forever — a sniffed entry that opens a server, a build stuck on a
36
+ * prompt — would otherwise hold the deploy, and its lock, forever.
37
+ */
38
+ timeoutMs: number;
39
+ /**
40
+ * Files the command can read, by name. Mounted in a directory of their own
41
+ * — named by `GKM_SECRETS_DIR` in the command's environment — and removed
42
+ * when it exits. Never set as variables, which every child inherits, a
43
+ * crash report prints and `/proc/<pid>/environ` shows.
44
+ */
45
+ secrets?: Readonly<Record<string, string>>;
46
+ /**
47
+ * `capture` (the default) returns stdout and stderr in the result;
48
+ * `inherit` gives the command the host's terminal; `stderr` sends both
49
+ * streams to the host's stderr; `ignore` discards them.
50
+ */
51
+ output?: SandboxOutput;
52
+ /** Kills the command when aborted; `exec` rejects with the signal's reason. */
53
+ signal?: AbortSignal;
54
+ }
55
+ /** How a command ended. A non-zero exit is a result, not an error. */
56
+ interface SandboxResult {
57
+ exitCode: number | null;
58
+ signal: string | null;
59
+ /** What it wrote to stdout, when its output was captured. */
60
+ stdout: string;
61
+ /** What it wrote to stderr, when its output was captured. */
62
+ stderr: string;
63
+ }
64
+ /**
65
+ * Runs a command against the project, and nothing else of the host's.
66
+ *
67
+ * `exec` resolves with the result however the command exited. It rejects
68
+ * with {@link CommandTimedOut} once the timeout passes — after the command is
69
+ * gone — with {@link SandboxCwdEscape} for a directory outside the project,
70
+ * with the signal's reason when aborted, and with the spawn error when the
71
+ * program cannot be started.
72
+ */
73
+ interface Sandbox {
74
+ /** The project: the directory every command runs at or below. */
75
+ readonly root: string;
76
+ /**
77
+ * Whether the code it runs is kept from the host: its files, its
78
+ * processes, its memory.
79
+ *
80
+ * An isolating sandbox shares nothing but what crosses `exec`, so a config
81
+ * reaches the deploy as data — a live object in it (a custom state store,
82
+ * an inline target) cannot cross, and is refused with
83
+ * `ConfigObjectNotSerializable`. A non-isolating one, like
84
+ * {@link LocalSandbox}, runs on the host as the host's user; a project
85
+ * whose config holds live objects is then loaded in-process as before,
86
+ * because a project trusted to run there is trusted to do that.
87
+ */
88
+ readonly isolating: boolean;
89
+ /**
90
+ * The environment a command starts from: what any program needs to run
91
+ * here — `PATH`, `HOME`, the locale — and no credential.
92
+ */
93
+ readonly env: Readonly<Record<string, string>>;
94
+ exec(command: string, args: readonly string[], options: SandboxExecOptions): Promise<SandboxResult>;
95
+ }
96
+ /** The variable naming the directory a command's secrets are mounted in. */
97
+ declare const SECRETS_DIR_ENV = "GKM_SECRETS_DIR";
98
+ /** A command was asked to run outside the project. */
99
+ declare class SandboxCwdEscape extends GkmError {
100
+ readonly cwd: string;
101
+ readonly root: string;
102
+ constructor(cwd: string, root: string);
103
+ }
104
+ /**
105
+ * `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.
106
+ *
107
+ * Symlinks are resolved on both sides first, so a link inside the project
108
+ * that points out of it is an escape, and a project reached through a link
109
+ * (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call
110
+ * before it runs anything.
111
+ */
112
+ declare function confineCwd(root: string, cwd: string): string;
113
+ /** A secret's file name: one path segment, so it cannot be written elsewhere. */
114
+ declare class SecretNameInvalid extends GkmError {
115
+ readonly secretName: string;
116
+ constructor(secretName: string);
117
+ }
118
+ //#endregion
119
+ //#region src/deploy/identity.d.ts
120
+ interface DeployIdentity {
121
+ /**
122
+ * Whose deploy this is — an organisation, a team, a repository. Two
123
+ * workspaces with the same name are told apart by it. Defaults to the
124
+ * kebab-cased workspace name; set `deploy.namespace` to choose one.
125
+ */
126
+ readonly namespace: string;
127
+ /** The workspace name as the target spells it: lowercase, `[a-z0-9-]`. */
128
+ readonly project: string;
129
+ readonly stage: string;
130
+ /**
131
+ * `<namespace>/<project>`: what a Dokploy project is claimed by.
132
+ *
133
+ * The stage is not part of it because one Dokploy project holds every stage
134
+ * of a workspace, each as an environment — the key has to be the same from
135
+ * every stage that deploys into it.
136
+ */
137
+ readonly key: string;
138
+ /**
139
+ * The prefix every name on the target carries: the project alone in the
140
+ * default namespace, `<namespace>-<project>` in any other.
141
+ *
142
+ * The default adds nothing so that a workspace that never set a namespace
143
+ * keeps the names it was already deployed under — a Postgres is found by
144
+ * its name, and a new name would be a new, empty database.
145
+ */
146
+ readonly scope: string;
147
+ }
148
+ /** What an identity is derived from: a workspace's name and namespace. */
149
+ interface IdentitySource {
150
+ name: string;
151
+ deploy?: {
152
+ namespace?: string;
153
+ };
154
+ }
155
+ declare function deployIdentity(workspace: IdentitySource, stage: string): DeployIdentity;
156
+ //#endregion
157
+ //#region src/secrets/types.d.ts
158
+ /** Credentials for a specific service */
159
+ interface ServiceCredentials {
160
+ host: string;
161
+ port: number;
162
+ username: string;
163
+ password: string;
164
+ /** Database name (for postgres) */
165
+ database?: string;
166
+ /** Bucket name (for minio) */
167
+ bucket?: string;
168
+ /** Access key ID (for localstack) */
169
+ accessKeyId?: string;
170
+ /** Region (for localstack) */
171
+ region?: string;
172
+ }
173
+ /** Stage secrets configuration */
174
+ interface StageSecrets {
175
+ /** Stage name (e.g., 'production', 'staging') */
176
+ stage: string;
177
+ /** ISO timestamp when secrets were created */
178
+ createdAt: string;
179
+ /** ISO timestamp when secrets were last updated */
180
+ updatedAt: string;
181
+ /** Service-specific credentials */
182
+ services: {
183
+ postgres?: ServiceCredentials;
184
+ redis?: ServiceCredentials;
185
+ minio?: ServiceCredentials;
186
+ mailpit?: ServiceCredentials;
187
+ localstack?: ServiceCredentials;
188
+ };
189
+ /** Generated connection URLs */
190
+ urls: {
191
+ DATABASE_URL?: string;
192
+ REDIS_URL?: string;
193
+ STORAGE_ENDPOINT?: string;
194
+ SMTP_HOST?: string;
195
+ SMTP_PORT?: string;
196
+ };
197
+ /**
198
+ * Values injected by key: those set with `gkm secrets:set` — a third
199
+ * party's credentials — and those generated once for the stage, such as an
200
+ * auth server's signing secret.
201
+ */
202
+ custom: Record<string, string>;
203
+ /**
204
+ * Random, generated once per stage: what every password a deploy derives
205
+ * is salted with. Without it a derived password is a function of the
206
+ * project and stage names, which anyone reading the repo has.
207
+ */
208
+ seed?: string;
209
+ }
210
+ //#endregion
211
+ //#region src/secrets/store.d.ts
212
+ interface SecretsStore {
213
+ /**
214
+ * Which kind of store this is — `'file'`, `'s3'`, `'ssm'`,
215
+ * `'secrets-manager'`, or a custom one's.
216
+ */
217
+ readonly name: string;
218
+ /** The stage's secrets, or null when it has none here. */
219
+ read(stage: string): Promise<StageSecrets | null>;
220
+ /** Replace the stage's secrets. */
221
+ write(stage: string, secrets: StageSecrets): Promise<void>;
222
+ }
223
+ /** Secrets in SSM Parameter Store, in the account of the active credentials. */
224
+ interface SsmSecretsStoreConfig {
225
+ provider: 'ssm';
226
+ region: string;
227
+ }
4
228
  /**
5
- * Deploy state management for Dokploy deployments
229
+ * Secrets in AWS Secrets Manager, in the account of the active credentials:
230
+ * one secret per stage, `gkm/<project>/<stage>/secrets`. Up to 64 KB where
231
+ * SSM holds 8 KB, at a monthly price per secret.
232
+ */
233
+ interface SecretsManagerSecretsStoreConfig {
234
+ provider: 'secrets-manager';
235
+ region: string;
236
+ /**
237
+ * The KMS key (id, ARN or alias) a stage's secret is created with. Unset,
238
+ * it is the account's AWS-managed `aws/secretsmanager` key.
239
+ */
240
+ kmsKeyId?: string;
241
+ }
242
+ /**
243
+ * Secrets in S3, one object per stage —
244
+ * `<prefix>/<project>/<stage>/secrets.json` — in the project bucket beside the
245
+ * deploy state and backups, or in a bucket that exists. Encrypted with SSE-S3,
246
+ * every past document kept by the bucket's versioning, and no size limit.
247
+ */
248
+ interface S3SecretsStoreConfig {
249
+ provider: 's3';
250
+ /**
251
+ * A bucket that already exists. Omitted, the project bucket —
252
+ * `gkm-<project>-<account id>`, created by the first write.
253
+ */
254
+ bucket?: string;
255
+ /** The bucket's region. Omitted, the deploy state's, when it is in S3. */
256
+ region?: string;
257
+ /** Key prefix inside the bucket. Omitted, the S3 state's, else `gkm`. */
258
+ prefix?: string;
259
+ }
260
+ /** Any other backend: an object implementing {@link SecretsStore}. */
261
+ interface CustomSecretsStoreConfig {
262
+ provider: SecretsStore;
263
+ }
264
+ /**
265
+ * `secrets.store` in gkm.config.ts.
6
266
  *
7
- * Stores resource IDs (applications, services) per stage to avoid
8
- * re-creating resources on subsequent deploys.
267
+ * `'file'` — the default — keeps each stage's secrets in the encrypted
268
+ * `.gkm/secrets/<stage>.json`, its key in the CLI's home (`GKM_HOME`, else
269
+ * `~/.gkm`). It cannot serve a
270
+ * deploy from CI while `.gkm/` is gitignored; `s3`, `ssm`, `secrets-manager`
271
+ * or a custom store can.
9
272
  */
273
+ type SecretsStoreConfig = 'file' | S3SecretsStoreConfig | SsmSecretsStoreConfig | SecretsManagerSecretsStoreConfig | CustomSecretsStoreConfig;
274
+ //#endregion
275
+ //#region src/deploy/actor.d.ts
276
+ /**
277
+ * Who wrote a stage's deploy state: a GitHub Actions run, or a person at a
278
+ * machine. Recorded on every state write (`updatedBy`), on every resource
279
+ * record and on every release (`releasedBy`), so "who put this here" has an
280
+ * answer that does not depend on anyone's memory.
281
+ */
282
+ /** A GitHub Actions run: the account that triggered it and the run's page. */
283
+ interface GithubActor {
284
+ kind: 'github';
285
+ /** `GITHUB_ACTOR` — the account that triggered the run. */
286
+ actor: string;
287
+ /** `<server>/<repository>/actions/runs/<run id>` */
288
+ run: string;
289
+ /** `GITHUB_WORKFLOW` — the workflow's name. */
290
+ workflow?: string;
291
+ }
292
+ /** A person at a machine. */
293
+ interface LocalActor {
294
+ kind: 'local';
295
+ user: string;
296
+ host: string;
297
+ }
298
+ type Actor = GithubActor | LocalActor;
299
+ //#endregion
300
+ //#region src/deploy/state.d.ts
10
301
  /**
11
302
  * Per-app database credentials
12
303
  */
@@ -61,12 +352,30 @@ interface BackupState {
61
352
  /** Timestamp when backup was configured */
62
353
  createdAt: string;
63
354
  }
355
+ /** What every target's state for a stage holds. */
356
+ interface StageStateCore {
357
+ stage: string;
358
+ lastDeployedAt: string;
359
+ /**
360
+ * The deploy identity's key (`<namespace>/<project>`) that last deployed
361
+ * this stage — what the project's ownership marker says.
362
+ */
363
+ identity?: string;
364
+ /**
365
+ * Each app's releases, keyed by app name: what runs now, what ran before
366
+ * it — which `gkm deploy:rollback` restores — and the history behind both.
367
+ */
368
+ releases?: Record<string, AppReleases>;
369
+ }
370
+ /** A compose stage's state: the core, and nothing Dokploy-specific. */
371
+ interface ComposeStageState extends StageStateCore {
372
+ provider: 'compose';
373
+ }
64
374
  /**
65
375
  * State for a single stage deployment
66
376
  */
67
- interface DokployStageState {
377
+ interface DokployStageState extends StageStateCore {
68
378
  provider: 'dokploy';
69
- stage: string;
70
379
  /** Dokploy project ID - created on first deploy */
71
380
  projectId: string;
72
381
  environmentId: string;
@@ -85,7 +394,169 @@ interface DokployStageState {
85
394
  dnsRecords?: Record<string, CreatedDnsRecord>;
86
395
  /** Backup destination state */
87
396
  backups?: BackupState;
88
- lastDeployedAt: string;
397
+ /**
398
+ * The Dokploy registry the stage's images are pulled through. Kept per
399
+ * stage rather than once per machine, so a stage keeps the registry it was
400
+ * deployed with whoever deploys it next.
401
+ */
402
+ registryId?: string;
403
+ }
404
+ /** A stage's state, whichever target wrote it. */
405
+ type StageState = DokployStageState | ComposeStageState;
406
+ /** An image a stage runs: the ref it was pushed as, and what it resolved to. */
407
+ interface DeployedImage {
408
+ ref: string;
409
+ /**
410
+ * The tag it was released under — a site's carries its stage
411
+ * (`v1.4.0-production`). Recorded by targets that pull a release by tag.
412
+ */
413
+ tag?: string;
414
+ /** The registry's digest, `sha256:…` — absent if it could not be read. */
415
+ digest?: string;
416
+ }
417
+ /** An image that went live, and when. */
418
+ interface ReleasedImage extends DeployedImage {
419
+ /** The image tag the deploy released under. */
420
+ tag?: string;
421
+ releasedAt: string;
422
+ /** Who released it — absent on a release recorded before it was kept. */
423
+ releasedBy?: Actor;
424
+ /** Set when a rollback replaced it: it is never rolled back *to*. */
425
+ rolledBack?: true;
426
+ }
427
+ /** An app's releases: what runs, what ran before it, and what ran before that. */
428
+ interface AppReleases {
429
+ current: ReleasedImage;
430
+ /** What a rollback restores; absent until a second release. */
431
+ previous?: ReleasedImage;
432
+ /** Every release, newest first, at most {@link RELEASE_HISTORY} of them. */
433
+ history: ReleasedImage[];
434
+ }
435
+ //#endregion
436
+ //#region src/deploy/StateStore.d.ts
437
+ /** Opaque: a file hash, an SSM parameter version or an S3 ETag. */
438
+ type StateVersion = string;
439
+ /**
440
+ * `pending` is written before the call that creates the resource, `ready`
441
+ * once the target has returned its id. A run that finds a `pending` record
442
+ * knows a previous run may have created the resource and should look for it
443
+ * before creating another.
444
+ */
445
+ type ResourceStatus = 'pending' | 'ready';
446
+ interface ResourceRecord {
447
+ /** Unique within the stage, `<type>:<name>` — e.g. `application:api`. */
448
+ key: string;
449
+ /** What kind of resource it is — e.g. `application`, `postgres`. */
450
+ type: string;
451
+ /** The id the target gave it. Absent while `pending`. */
452
+ id?: string;
453
+ status: ResourceStatus;
454
+ /** Whatever the target needs to adopt the resource on a later run. */
455
+ data?: Record<string, unknown>;
456
+ updatedAt: string;
457
+ /** Who wrote the record — absent on one written before it was kept. */
458
+ updatedBy?: Actor;
459
+ }
460
+ /** A resource as a caller hands it to `putResource`; the store stamps it. */
461
+ type ResourceInput = Omit<ResourceRecord, 'updatedAt' | 'updatedBy'>;
462
+ /** One write of a stage's state: which, when, by whom, doing what. */
463
+ interface HistoryEntry {
464
+ serial: number;
465
+ at: string;
466
+ by: Actor;
467
+ /** The lock's operation — `deploy`, `rollback`, `setup`, `state:push` … */
468
+ operation: string;
469
+ }
470
+ interface StoredStageState {
471
+ state: StageState;
472
+ resources: Record<string, ResourceRecord>;
473
+ /** The latest writes, newest first. */
474
+ history: HistoryEntry[];
475
+ /** Pass back as `expectedVersion` to write on top of exactly this read. */
476
+ version: StateVersion;
477
+ }
478
+ interface WriteOptions {
479
+ /**
480
+ * The version this write is based on — `null` to create state that must
481
+ * not exist yet.
482
+ */
483
+ expectedVersion: StateVersion | null;
484
+ }
485
+ interface ResourceWriteOptions {
486
+ /**
487
+ * Omitted, the record is applied on top of whatever is stored now (still
488
+ * conditionally, so a concurrent write raises rather than being lost).
489
+ */
490
+ expectedVersion?: StateVersion;
491
+ }
492
+ interface LockHolder {
493
+ /** Unique per acquisition, so a release never removes someone else's lock. */
494
+ id: string;
495
+ owner: string;
496
+ host: string;
497
+ pid: number;
498
+ acquiredAt: string;
499
+ /** What the holder is doing, e.g. `deploy`. */
500
+ operation?: string;
501
+ }
502
+ interface LockOptions {
503
+ operation?: string;
504
+ }
505
+ interface StateLock {
506
+ readonly stage: string;
507
+ readonly holder: LockHolder;
508
+ /** Removes the lock if it is still this one; safe to call twice. */
509
+ release(): Promise<void>;
510
+ }
511
+ interface StateStore {
512
+ /** Takes the stage's lock, or raises `StateLocked` naming its holder. */
513
+ lock(stage: string, options?: LockOptions): Promise<StateLock>;
514
+ /**
515
+ * Removes the stage's lock whoever holds it, for a run that crashed with
516
+ * it held. Returns the holder it removed, or `null` if there was none.
517
+ */
518
+ forceUnlock(stage: string): Promise<LockHolder | null>;
519
+ read(stage: string): Promise<StoredStageState | null>;
520
+ /** Replaces the stage's state, keeping its resource records. */
521
+ write(stage: string, state: StageState, options: WriteOptions): Promise<StateVersion>;
522
+ putResource(stage: string, record: ResourceInput, options?: ResourceWriteOptions): Promise<StateVersion>;
523
+ deleteResource(stage: string, key: string, options?: ResourceWriteOptions): Promise<StateVersion>;
524
+ /**
525
+ * How big the stage's document is as this store would write it, against
526
+ * the most it can hold — for a store with a limit (SSM). `null` when the
527
+ * stage has no state yet.
528
+ */
529
+ capacity?(stage: string): Promise<StateCapacity | null>;
530
+ }
531
+ /** A stored document's size against the store's limit, in bytes. */
532
+ interface StateCapacity {
533
+ bytes: number;
534
+ limit: number;
535
+ location: string;
536
+ /** The store's AWS region, for the message that suggests S3. */
537
+ region?: string;
538
+ }
539
+ declare class StateLocked extends GkmError {
540
+ readonly stage: string;
541
+ readonly holder: LockHolder | null;
542
+ readonly location: string;
543
+ constructor(stage: string, holder: LockHolder | null, location: string);
544
+ }
545
+ declare class StateVersionConflict extends GkmError {
546
+ readonly stage: string;
547
+ readonly expectedVersion: StateVersion | null;
548
+ readonly actualVersion: StateVersion | null;
549
+ constructor(stage: string, expectedVersion: StateVersion | null, actualVersion: StateVersion | null);
550
+ }
551
+ /**
552
+ * A deploy, setup or rollback of a stage in CI, with the stage's state kept on
553
+ * the runner — which is discarded when the job ends.
554
+ */
555
+ declare class LocalStateInCi extends GkmError {
556
+ readonly stage: string;
557
+ readonly operation: string;
558
+ readonly region: string;
559
+ constructor(stage: string, operation: string, region: string);
89
560
  }
90
561
  //#endregion
91
562
  //#region src/deploy/StateProvider.d.ts
@@ -103,14 +574,14 @@ interface StateProvider {
103
574
  * @param stage - The deployment stage (e.g., 'development', 'production')
104
575
  * @returns The state object or null if not found
105
576
  */
106
- read(stage: string): Promise<DokployStageState | null>;
577
+ read(stage: string): Promise<StageState | null>;
107
578
  /**
108
579
  * Write deployment state for a stage.
109
580
  *
110
581
  * @param stage - The deployment stage
111
582
  * @param state - The state object to persist
112
583
  */
113
- write(stage: string, state: DokployStageState): Promise<void>;
584
+ write(stage: string, state: StageState): Promise<void>;
114
585
  }
115
586
  /**
116
587
  * Valid AWS regions.
@@ -125,24 +596,910 @@ interface LocalStateConfig {
125
596
  /**
126
597
  * SSM state provider config (requires region).
127
598
  */
128
- interface SSMStateConfig {
129
- provider: 'ssm';
130
- /** AWS region (required for SSM provider) */
131
- region: AwsRegion;
132
- /** AWS profile name (optional - uses default credential chain if not provided) */
133
- profile?: string;
599
+ interface SSMStateConfig {
600
+ provider: 'ssm';
601
+ /** AWS region (required for SSM provider) */
602
+ region: AwsRegion;
603
+ /** AWS profile name (optional - uses default credential chain if not provided) */
604
+ profile?: string;
605
+ }
606
+ /**
607
+ * S3 state config: one object per stage, written with conditional puts
608
+ * (`If-Match` / `If-None-Match`), and a lock object beside it.
609
+ *
610
+ * Keys: `<prefix>/<workspace name>/<stage>/state.json` and `lock.json`.
611
+ */
612
+ interface S3StateConfig {
613
+ provider: 's3';
614
+ /**
615
+ * Bucket the state lives in; it must already exist. Omitted, the project
616
+ * bucket — `gkm-<project>-<account id>`, created by the first deploy.
617
+ */
618
+ bucket?: string;
619
+ /** AWS region of the bucket */
620
+ region: AwsRegion;
621
+ /** Key prefix inside the bucket (default: `gkm`) */
622
+ prefix?: string;
623
+ /** AWS profile name (optional - uses default credential chain if not provided) */
624
+ profile?: string;
625
+ }
626
+ /**
627
+ * Custom state provider config.
628
+ */
629
+ interface CustomStateConfig {
630
+ /**
631
+ * Custom implementation. A `StateStore` is used as is; a `StateProvider`
632
+ * still works, but cannot lock — deploy warns `StateStoreWithoutLocking`.
633
+ */
634
+ provider: StateProvider | StateStore;
635
+ }
636
+ /**
637
+ * State configuration types.
638
+ */
639
+ type StateConfig = LocalStateConfig | SSMStateConfig | S3StateConfig | CustomStateConfig;
640
+ //#endregion
641
+ //#region src/reconcile/discover.d.ts
642
+ /** The construct face discovery needs: an id, and the ability to declare. */
643
+ interface Declarable {
644
+ id: string;
645
+ declare(): Declaration[];
646
+ }
647
+ /**
648
+ * Whether a module export is a construct.
649
+ *
650
+ * Deliberately loose about what else it carries — a construct that also has a
651
+ * `service` is still a construct, and requiring one would exclude the kinds that
652
+ * own no address.
653
+ */
654
+ declare function isDeclarable(value: unknown): value is Declarable;
655
+ interface DiscoverOptions {
656
+ /** The glob(s) to search. One pattern, not one per kind. */
657
+ patterns: string | readonly string[];
658
+ cwd?: string;
659
+ /**
660
+ * Re-import changed modules, for the dev watcher.
661
+ *
662
+ * A single glob makes discovery more central, not less: a new construct file
663
+ * has to be picked up on `add`, not only on `change`.
664
+ */
665
+ bustCache?: boolean;
666
+ /**
667
+ * Filled in with where each construct was found, when provided.
668
+ *
669
+ * Discovery is the only thing that knows: it globbed the files and imported
670
+ * them. Everything downstream that needs to *write* an import — the build,
671
+ * generating a server entry that reads a surface's logger — would otherwise
672
+ * have to be told the path in config, which is the string this removes.
673
+ *
674
+ * An out-parameter rather than a second return value so that every existing
675
+ * caller, which wants the manifest and nothing else, is unchanged.
676
+ */
677
+ sources?: Record<string, ConstructSource>;
678
+ /**
679
+ * Filled in, when provided, with the files each worker's background work is
680
+ * declared in — its crons, queue consumers and topic subscribers — keyed by
681
+ * the worker.
682
+ *
683
+ * What says which app's build carries a worker's entry: the one whose
684
+ * directory holds its work. A worker declares no path of its own.
685
+ */
686
+ background?: Record<string, string[]>;
687
+ /**
688
+ * Filled in, when provided, with the files that export something built
689
+ * from each surface — an endpoint, a WebSocket route — keyed by the
690
+ * surface. What a surface that serves itself imports its routes from.
691
+ */
692
+ served?: Record<string, string[]>;
693
+ /**
694
+ * Filled in, when provided, with each worker's subscribers — by the export
695
+ * a push route is named after, and the key its deliveries come from: its
696
+ * topic's, or its bucket's events — keyed by the worker.
697
+ *
698
+ * What says which worker SNS pushes to, and on which paths: a build bound
699
+ * for a server records no subscriber in the manifest, because none has a
700
+ * handler of its own there.
701
+ */
702
+ subscribers?: Record<string, BoundSubscriber[]>;
703
+ /**
704
+ * Import the construct modules in this sandbox rather than in this
705
+ * process. Defaults to the run's own (`withSandbox`), so a deploy's every
706
+ * discovery — the engine's included — happens there; with neither, they
707
+ * are imported here, as before.
708
+ */
709
+ sandbox?: Sandbox;
710
+ }
711
+ /** A worker's subscriber — to a topic or to a bucket — as discovery found it. */
712
+ interface BoundSubscriber {
713
+ /** Its export — what its push route is named after. */
714
+ name: string;
715
+ /**
716
+ * The env key its deliveries come from: its topic's publisher connection
717
+ * string, or its bucket's events connection string. An `sns://` value is
718
+ * what makes SNS push to it.
719
+ */
720
+ connectionKey: string;
721
+ /**
722
+ * The event types a topic subscriber names — its SNS subscription's filter
723
+ * on the `type` attribute the topic's publisher sets. Absent for a
724
+ * bucket's subscriber: S3 sets no such attribute, and the subscriber's own
725
+ * filter decides.
726
+ */
727
+ events?: readonly string[];
728
+ }
729
+ /** Importing a construct module, or declaring one, threw in the sandbox. */
730
+ declare class ConstructDiscoveryFailed extends Error {
731
+ readonly errorName: string;
732
+ readonly detail: string;
733
+ constructor(errorName: string, detail: string);
734
+ }
735
+ /**
736
+ * The constructs' declarations hold something that is not data, and the
737
+ * sandbox they were discovered in hands the deploy nothing but data.
738
+ */
739
+ declare class ConstructsNotSerializable extends Error {
740
+ readonly paths: readonly string[];
741
+ constructor(paths: readonly string[]);
742
+ }
743
+ /** Where a construct was declared, and under what name. */
744
+ interface ConstructSource {
745
+ /** Absolute path to the module that exported it. */
746
+ file: string;
747
+ /** The name it was exported as — what an import statement has to say. */
748
+ exportName: string;
749
+ /**
750
+ * The exported construct itself.
751
+ *
752
+ * What a declaration cannot say — whether it serves itself — the object can
753
+ * be asked, and discovery already imported it.
754
+ */
755
+ construct: unknown;
756
+ }
757
+ /**
758
+ * Build the construct manifest for a project.
759
+ *
760
+ * Runs the manifest's own validation before returning, so an app is wrong here
761
+ * — where the error names a file — rather than at deploy.
762
+ *
763
+ * @throws {DuplicateConstruct} when two exports claim one id.
764
+ */
765
+ declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
766
+ //#endregion
767
+ //#region src/providers/types.d.ts
768
+ /** The manifest kinds a stage can name a provider for. */
769
+ declare const PROVIDER_KINDS: readonly ['objects', 'inbox'];
770
+ type ProviderKind = (typeof PROVIDER_KINDS)[number];
771
+ //#endregion
772
+ //#region src/providers/ses/config.d.ts
773
+ /** `inbox: { provider: 'ses' }` — each inbox received by SES in the stage's account. */
774
+ interface SesInboxConfig {
775
+ provider: 'ses';
776
+ /**
777
+ * Where mail is received, and the inbox's bucket and topic live. Defaults
778
+ * to the secrets store's region, then `AWS_REGION` — and must be one SES
779
+ * receives mail in.
780
+ */
781
+ region?: string;
782
+ }
783
+ //#endregion
784
+ //#region src/deploy/credentials.d.ts
785
+ /**
786
+ * What each kind of credential is asked for with, and what it is.
787
+ *
788
+ * A target that needs a kind the CLI does not know declares it by augmenting
789
+ * this interface, and lists it in its `credentials`:
790
+ *
791
+ * ```ts
792
+ * declare module '@geekmidas/cli/target' {
793
+ * interface CredentialKinds {
794
+ * fly: { request: { org: string }; value: { token: string } };
795
+ * }
796
+ * }
797
+ * ```
798
+ */
799
+ interface CredentialKinds {
800
+ /** The Dokploy API a stage deploys through. */
801
+ dokploy: {
802
+ /** `deploy.dokploy.endpoint`, when the config names one. */
803
+ request: {
804
+ endpoint?: string;
805
+ };
806
+ value: {
807
+ endpoint: string;
808
+ token: string;
809
+ };
810
+ };
811
+ /**
812
+ * A container registry login, for Dokploy to pull with. Asked for only when
813
+ * Dokploy has no registry for `deploy.registry` and one has to be
814
+ * created.
815
+ */
816
+ registry: {
817
+ /** `deploy.registry`. */
818
+ request: {
819
+ url: string;
820
+ };
821
+ value: {
822
+ username: string;
823
+ password: string;
824
+ };
825
+ };
826
+ /**
827
+ * The AWS account a stage deploys to, for the SST target's `sst deploy`.
828
+ * Handed to that one command's environment and to nothing else.
829
+ */
830
+ aws: {
831
+ /** The stage, for a provider that keeps one account per stage. */
832
+ request: {
833
+ stage: string;
834
+ };
835
+ value: AwsCredential;
836
+ };
837
+ /**
838
+ * A GoDaddy Personal Access Token, for a `dns` domain whose provider is
839
+ * `godaddy`. Read on the machine that writes the records — never the
840
+ * server's.
841
+ */
842
+ godaddy: {
843
+ request: Record<never, never>;
844
+ value: GoDaddyCredential;
845
+ };
846
+ /**
847
+ * A Hostinger API token, for a `dns` domain whose provider is
848
+ * `hostinger`. Like GoDaddy's, read where the records are written.
849
+ */
850
+ hostinger: {
851
+ request: Record<never, never>;
852
+ value: HostingerCredential;
853
+ };
854
+ }
855
+ /** A Hostinger API token, from hpanel.hostinger.com/profile/api. */
856
+ interface HostingerCredential {
857
+ token: string;
858
+ }
859
+ /** A GoDaddy Personal Access Token, sent as `Authorization: Bearer <token>`. */
860
+ interface GoDaddyCredential {
861
+ token: string;
862
+ }
863
+ /**
864
+ * Who to act as on AWS: a named profile, or keys.
865
+ *
866
+ * Never both. Given both, every AWS SDK takes the keys and ignores the
867
+ * profile, so `--profile prod` with staging's keys still exported would deploy
868
+ * production's stack into staging's account — the reason `secretsStoreFor`
869
+ * resolves a named profile on its own, and why this cannot express the mix.
870
+ */
871
+ type AwsCredential = {
872
+ /** A profile in `~/.aws/config` — keys, SSO, an assumed role. */
873
+ profile: string;
874
+ region?: string;
875
+ } | {
876
+ accessKeyId: string;
877
+ secretAccessKey: string;
878
+ /** Present for temporary keys: an assumed role, GitHub's OIDC. */
879
+ sessionToken?: string;
880
+ region?: string;
881
+ };
882
+ type CredentialKind = keyof CredentialKinds;
883
+ /** What a deploy asks a provider for. */
884
+ type CredentialRequest<K extends CredentialKind = CredentialKind> = { [P in K]: {
885
+ kind: P;
886
+ } & CredentialKinds[P]['request']; }[K];
887
+ /** What a provider answers with. */
888
+ type Credential<K extends CredentialKind> = CredentialKinds[K]['value'];
889
+ interface CredentialProvider {
890
+ /**
891
+ * The credential `request` asks for, or `undefined` when this provider has
892
+ * none — the deploy then raises {@link MissingCredential}.
893
+ */
894
+ get<K extends CredentialKind>(request: CredentialRequest<K>, options?: {
895
+ signal?: AbortSignal;
896
+ }): Promise<Credential<K> | undefined>;
897
+ }
898
+ /** A deploy needed a credential, and its provider had none. */
899
+ declare class MissingCredential extends GkmError {
900
+ readonly kind: CredentialKind;
901
+ /** What it was for: the Dokploy endpoint or the registry URL. */
902
+ readonly target: string | undefined;
903
+ /** How to supply it. */
904
+ readonly howToProvide: string;
905
+ constructor(kind: CredentialKind,
906
+ /** What it was for: the Dokploy endpoint or the registry URL. */
907
+ target: string | undefined,
908
+ /** How to supply it. */
909
+ howToProvide?: string);
910
+ }
911
+ /** Whatever was asked for, from the first provider that has it. */
912
+ declare function chainCredentials(...providers: CredentialProvider[]): CredentialProvider;
913
+ interface StoredCredentialsOptions {
914
+ /** Where to read the variables from. Defaults to `process.env`. */
915
+ env?: NodeJS.ProcessEnv;
916
+ /**
917
+ * The CLI's home, whose `credentials.json` holds stored logins. Defaults
918
+ * to `GKM_HOME`, else `~/.gkm`.
919
+ */
920
+ home?: string;
921
+ }
922
+ /**
923
+ * Credentials from the environment, then from what `gkm login` stored. What
924
+ * `deploy()` uses when it is handed no provider.
925
+ *
926
+ * - Dokploy: `DOKPLOY_API_TOKEN` / `DOKPLOY_ENDPOINT`, each falling back to
927
+ * the stored login, and the endpoint finally to `deploy.dokploy.endpoint`.
928
+ * Each half is read on its own: a token is a secret and belongs in the
929
+ * environment, an endpoint is configuration and belongs in the config.
930
+ * - Registry: `DOCKER_REGISTRY_USERNAME` / `DOCKER_REGISTRY_PASSWORD`.
931
+ * - AWS: `AWS_PROFILE` when it is set, and then nothing else; otherwise
932
+ * `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`. The
933
+ * profile winning is `secretsStoreFor`'s rule: a profile is a choice of
934
+ * account someone made, exported keys may be left over from another.
935
+ * Read here, by name, and handed only to the command that deploys — the
936
+ * sandbox every other step runs in passes no `AWS_*` on.
937
+ */
938
+ declare function storedCredentials(options?: StoredCredentialsOptions): CredentialProvider;
939
+ //#endregion
940
+ //#region src/deploy/types.d.ts
941
+ /** Result for a single app deployment in workspace mode */
942
+ interface AppDeployResult {
943
+ /** App name */
944
+ appName: string;
945
+ /** App type */
946
+ type: 'backend' | 'web' | 'mobile';
947
+ /** Whether deployment succeeded */
948
+ success: boolean;
949
+ /** Dokploy application ID */
950
+ applicationId?: string;
951
+ /** Docker image reference */
952
+ imageRef?: string;
953
+ /** The registry's digest for the image, `sha256:…`, once pushed */
954
+ digest?: string;
955
+ /** Deployment URL */
956
+ url?: string;
957
+ /** Error message if failed */
958
+ error?: string;
959
+ }
960
+ /** Result from workspace deployment */
961
+ interface WorkspaceDeployResult {
962
+ /** Results for each app */
963
+ apps: AppDeployResult[];
964
+ /** Dokploy project ID */
965
+ projectId: string;
966
+ /** Total number of successful deployments */
967
+ successCount: number;
968
+ /** Total number of failed deployments */
969
+ failedCount: number;
970
+ }
971
+ /**
972
+ * What a deploy did — or, for a dry run, would do. Plain JSON, so it can be
973
+ * written out as is (`gkm deploy --json` ends with it).
974
+ */
975
+ interface DeployResult extends WorkspaceDeployResult {
976
+ stage: string;
977
+ /** `<namespace>/<project>`. */
978
+ identity: string;
979
+ /** The image tag every app was built with. */
980
+ tag: string;
981
+ /** Whether this was a dry run: nothing was created, built or pushed. */
982
+ dryRun: boolean;
983
+ /** Dokploy's environment for the stage; empty when a dry run would create it. */
984
+ environmentId: string;
985
+ /** Apps left out, and why — a mobile app, another deploy target. */
986
+ skipped: {
987
+ app: string;
988
+ reason: string;
989
+ }[];
990
+ /** Each deployed app's public URL. */
991
+ urls: Record<string, string>;
992
+ /**
993
+ * Every resource the run touched, in order: what it applied, or for a dry
994
+ * run, what it would.
995
+ */
996
+ changes: ResourceChange[];
997
+ }
998
+ //#endregion
999
+ //#region src/deploy/events.d.ts
1000
+ /**
1001
+ * The stretch of a deploy an event belongs to.
1002
+ *
1003
+ * - `validate`: the config, the target, the stage, the apps, the lock, the
1004
+ * stage's secrets and what each app reads from its environment
1005
+ * - `plan`: a dry run's lookups — what would be created and what reused
1006
+ * - `provision`: what the apps run on — for Dokploy the project, environment
1007
+ * and registry — and the declared constructs
1008
+ * - `build`: each app's artifact, built without changing anything live
1009
+ * - `release`: the artifacts put live. Dokploy applies the stage's
1010
+ * migrations and runs its seeds, then builds and pushes each image here, beside its
1011
+ * application, because a site's build args are resolved per app — and
1012
+ * checks each backend before any site is released
1013
+ * - `verify`: what was released answers — for Dokploy, each site's DNS
1014
+ * records and health
1015
+ * - `rollback`: the previous release restored, after `release` or `verify`
1016
+ * failed, on a target that can
1017
+ */
1018
+ type DeployPhase = 'validate' | 'plan' | 'provision' | 'build' | 'release' | 'verify' | 'rollback';
1019
+ /** An error, as an event carries it. */
1020
+ interface DeployEventError {
1021
+ /** The error's class name — `MissingCredential`, `StateLocked`. */
1022
+ name: string;
1023
+ message: string;
1024
+ }
1025
+ /**
1026
+ * How a resource came to be used:
1027
+ * - `recorded`: the id the stage's state holds still resolves
1028
+ * - `resumed`: a run that died after creating it is picked up
1029
+ * - `found`: it existed and was looked up
1030
+ * - `created`: this run created it
1031
+ */
1032
+ type ResourceVia = 'recorded' | 'resumed' | 'found' | 'created';
1033
+ /** One resource a deploy touches, planned or applied. */
1034
+ interface ResourceChange {
1035
+ /** `<type>:<name>`, unique within the stage — `application:api`. */
1036
+ key: string;
1037
+ /** `project`, `environment`, `registry`, `application`, `domain`, `image`, or a construct's kind. */
1038
+ resourceType: string;
1039
+ /**
1040
+ * For a plan: whether the run would create it, reuse what exists, or
1041
+ * ensure it (look it up, and create it if missing). For an applied change:
1042
+ * what was done.
1043
+ */
1044
+ action: 'create' | 'reuse' | 'ensure' | 'build';
1045
+ /** The target's id, once there is one. */
1046
+ id?: string;
1047
+ }
1048
+ type DeployEvent = {
1049
+ type: 'deploy.started';
1050
+ stage: string;
1051
+ /** The target the run deploys through, by the name it was given. */
1052
+ target: string;
1053
+ /** `<namespace>/<project>`. */
1054
+ identity: string;
1055
+ tag: string;
1056
+ /** The apps this run deploys, in order. */
1057
+ apps: string[];
1058
+ dryRun: boolean;
1059
+ } | {
1060
+ type: 'phase.started';
1061
+ phase: DeployPhase;
1062
+ } | {
1063
+ type: 'phase.finished';
1064
+ phase: DeployPhase;
1065
+ } |
1066
+ /** A phase threw; `deploy.failed` follows (after a rollback, if any). */
1067
+ {
1068
+ type: 'phase.failed';
1069
+ phase: DeployPhase;
1070
+ error: DeployEventError;
1071
+ } |
1072
+ /**
1073
+ * A progress line, exactly as `gkm deploy` prints it — leading newline and
1074
+ * indentation included, so a terminal renderer prints `message` as is.
1075
+ */
1076
+ {
1077
+ type: 'log';
1078
+ level: 'info' | 'warn' | 'error';
1079
+ message: string;
1080
+ } | {
1081
+ type: 'app.skipped';
1082
+ app: string;
1083
+ reason: string;
1084
+ } | ({
1085
+ type: 'resource.planned';
1086
+ } & ResourceChange) | ({
1087
+ type: 'resource.applied';
1088
+ via: ResourceVia;
1089
+ } & ResourceChange & {
1090
+ id: string;
1091
+ }) | {
1092
+ type: 'artifact.built';
1093
+ app: string;
1094
+ imageRef: string;
1095
+ /** The registry's digest, `sha256:…`, once pushed. */
1096
+ digest?: string;
1097
+ } | {
1098
+ type: 'app.deployed';
1099
+ app: string;
1100
+ applicationId: string;
1101
+ imageRef: string;
1102
+ url: string;
1103
+ } | {
1104
+ type: 'app.failed';
1105
+ app: string;
1106
+ error: DeployEventError;
1107
+ } |
1108
+ /** One check of whether a released app answers. */
1109
+ {
1110
+ type: 'health.checked';
1111
+ app: string;
1112
+ /** What was asked: a URL, or the target's own status check. */
1113
+ url: string;
1114
+ healthy: boolean;
1115
+ /** The HTTP status, when the check was a request. */
1116
+ status?: number;
1117
+ /** 1 for the first check of the app in this run. */
1118
+ attempt: number;
1119
+ } |
1120
+ /**
1121
+ * A deployed stage runs a dev service — `--allow-dev-services` — in place
1122
+ * of real mail or object storage: Mailpit delivers no mail, MinIO keeps
1123
+ * every object on one container's disk. A warning, every run.
1124
+ */
1125
+ {
1126
+ type: 'dev-service.used';
1127
+ service: 'minio' | 'mailpit';
1128
+ stage: string;
1129
+ /** The constructs it stands in for. */
1130
+ constructs: string[];
1131
+ } |
1132
+ /**
1133
+ * The stack's log UI (`deploy.compose.logs`) is up and answering: where
1134
+ * it is and how it is reached — through an SSH tunnel to a loopback
1135
+ * port, or publicly on a host that allows only some addresses.
1136
+ */
1137
+ {
1138
+ type: 'logs.ready';
1139
+ service: 'openobserve';
1140
+ access: 'tunnel' | 'public';
1141
+ /** Where a browser opens it: the tunnel's end, or its public host. */
1142
+ url: string;
1143
+ /** The loopback port it is published on, for a tunnel. */
1144
+ port?: number;
1145
+ /** The addresses a public host answers. */
1146
+ allow?: string[];
1147
+ email: string;
1148
+ } |
1149
+ /**
1150
+ * One construct's migrations applied by the deploy, before any app
1151
+ * started. Only for a construct that had one to apply.
1152
+ */
1153
+ {
1154
+ type: 'migration.applied';
1155
+ /** The construct, by id: `Database`. */
1156
+ construct: string;
1157
+ /** Its folder: `db/database/migrations`. */
1158
+ folder: string;
1159
+ /** The migrations applied, in order. */
1160
+ applied: string[];
1161
+ } |
1162
+ /**
1163
+ * One construct's seeds run by the deploy — after its migrations, before
1164
+ * any app started, every one of them on every deploy. Only for a
1165
+ * construct that has seeds.
1166
+ */
1167
+ {
1168
+ type: 'seed.ran';
1169
+ /** The construct, by id: `Database`. */
1170
+ construct: string;
1171
+ /** Its folder: `db/database/seeds`. */
1172
+ folder: string;
1173
+ /** The seeds run, in order. */
1174
+ seeded: string[];
1175
+ } | {
1176
+ type: 'deploy.finished';
1177
+ result: DeployResult;
1178
+ } | {
1179
+ type: 'deploy.failed';
1180
+ error: DeployEventError;
1181
+ };
1182
+ /** Every `type` a deploy event can have. */
1183
+ type DeployEventType = DeployEvent['type'];
1184
+ //#endregion
1185
+ //#region src/target/types.d.ts
1186
+ /**
1187
+ * Which family of defaults a target's deploys belong to.
1188
+ *
1189
+ * - `server`: the target runs containers the project controls, so a cache can
1190
+ * live in the database and events go through pg-boss.
1191
+ * - `aws`: the target runs on managed AWS services, so the defaults are
1192
+ * Upstash, S3 and SNS/SQS.
1193
+ *
1194
+ * `gkm dev` and `gkm build` choose backends by it, which is why a target from
1195
+ * a package declares it in its `package.json` too: they read it without
1196
+ * importing the target.
1197
+ */
1198
+ type DeployRuntime = 'server' | 'aws';
1199
+ /** What a target can do, beyond the phases every target has. */
1200
+ interface DeployTargetCapabilities {
1201
+ /**
1202
+ * Whether `rollback` restores the previous release. When it does, a failed
1203
+ * `release` or `verify` is rolled back before the deploy reports failure.
1204
+ */
1205
+ rollback: boolean;
1206
+ /**
1207
+ * Who applies database migrations: the target, as part of `release`, or
1208
+ * the app itself when it starts.
1209
+ */
1210
+ migrations: 'target' | 'app';
1211
+ /**
1212
+ * Whether the target builds container images — and so needs Docker where
1213
+ * the deploy runs, and a registry to push to.
1214
+ */
1215
+ images: boolean;
1216
+ /**
1217
+ * Whether it can also run the project's local stage — `gkm deploy --stage
1218
+ * <local>`. Only a target that runs on this machine can: a stack started
1219
+ * here is the local stage's, while one on a server is shared, and the local
1220
+ * stage's secrets are a developer's. Absent, a deploy refuses the local
1221
+ * stage with `UndeclaredStage`.
1222
+ */
1223
+ localStage?: boolean;
1224
+ /**
1225
+ * Whether it runs telemetry's self-hosted provider — OpenObserve beside
1226
+ * the apps — for a stage whose `deploy.telemetry` asks for it, or names
1227
+ * nothing. Absent, a stage that uses a `Telemetry` construct names a
1228
+ * provider of its own (`otlp`) or opts out with `false`.
1229
+ */
1230
+ selfHostedTelemetry?: boolean;
1231
+ }
1232
+ /** A failed validation of a target's options, issue by issue. */
1233
+ interface TargetOptionsIssue {
1234
+ readonly message: string;
1235
+ readonly path?: ReadonlyArray<PropertyKey | {
1236
+ readonly key: PropertyKey;
1237
+ }>;
1238
+ }
1239
+ type TargetOptionsResult<Output> = {
1240
+ readonly value: Output;
1241
+ readonly issues?: undefined;
1242
+ } | {
1243
+ readonly issues: ReadonlyArray<TargetOptionsIssue>;
1244
+ };
1245
+ /**
1246
+ * The schema a target's options are validated with: any Standard Schema —
1247
+ * a Zod, Valibot or ArkType schema is one.
1248
+ *
1249
+ * The interface is the Standard Schema spec's own, copied as the spec asks,
1250
+ * so a target's types do not depend on a package the CLI does not ship.
1251
+ */
1252
+ interface TargetOptionsSchema<Output = unknown> {
1253
+ readonly '~standard': {
1254
+ readonly version: 1;
1255
+ readonly vendor: string;
1256
+ readonly validate: (value: unknown) => TargetOptionsResult<Output> | Promise<TargetOptionsResult<Output>>;
1257
+ readonly types?: {
1258
+ readonly input: unknown;
1259
+ readonly output: Output;
1260
+ } | undefined;
1261
+ };
1262
+ }
1263
+ /**
1264
+ * The stage's secrets, as a target reads and writes them.
1265
+ *
1266
+ * Every secret value read through here is masked: a progress line that
1267
+ * would print one prints `***` instead, in the terminal and in the events.
1268
+ */
1269
+ interface DeploySecrets {
1270
+ /** Which kind of store holds them — `'file'`, `'s3'`, `'ssm'`, `'secrets-manager'`, or
1271
+ * a custom one's. */
1272
+ readonly store: string;
1273
+ /** The stage's secrets, or null when it has none yet. */
1274
+ read(): Promise<StageSecrets | null>;
1275
+ /** Replace the stage's secrets. */
1276
+ write(secrets: StageSecrets): Promise<void>;
1277
+ /** Mask `value` in everything this run prints or emits from now on. */
1278
+ mask(value: string): void;
1279
+ }
1280
+ /** Where a target's progress lines go: `log` events of the run. */
1281
+ interface DeployTargetLogger {
1282
+ info(message: string): void;
1283
+ warn(message: string): void;
1284
+ error(message: string): void;
1285
+ }
1286
+ /**
1287
+ * The events a target reports. The run's own — `deploy.*` and `phase.*` —
1288
+ * are the CLI's, which emits them around each phase it calls.
1289
+ */
1290
+ type TargetEvent = Exclude<DeployEvent, {
1291
+ type: 'deploy.started' | 'deploy.finished' | 'deploy.failed' | 'phase.started' | 'phase.finished' | 'phase.failed';
1292
+ }>;
1293
+ /** Everything a phase is handed. The same object for every phase of a run. */
1294
+ interface DeployPhaseContext<Options = undefined> {
1295
+ /** The name the target was resolved by — `deploy.default`, `--target`. */
1296
+ readonly target: string;
1297
+ /**
1298
+ * The workspace root. Never `process.cwd()`: a host deploys projects
1299
+ * that are not where it runs.
1300
+ */
1301
+ readonly cwd: string;
1302
+ readonly stage: string;
1303
+ /** The image tag, or whatever version label the target releases under. */
1304
+ readonly tag: string;
1305
+ /**
1306
+ * Whether `tag` was asked for (`--tag`) rather than made up for this run
1307
+ * — by the target's own `tag()`, else `<stage>-<timestamp>`. A target that
1308
+ * releases what CI already pushed when given one tells the two apart here.
1309
+ */
1310
+ readonly tagGiven: boolean;
1311
+ /**
1312
+ * The apps this target deploys, in dependency order: those asked for that
1313
+ * deploy here. Apps that deploy elsewhere are already in `skipped`.
1314
+ */
1315
+ readonly apps: readonly string[];
1316
+ /** The apps the run leaves out, and why. */
1317
+ readonly skipped: readonly {
1318
+ app: string;
1319
+ reason: string;
1320
+ }[];
1321
+ /** Who the deploy is, for naming and claiming what it creates. */
1322
+ readonly identity: DeployIdentity;
1323
+ /** The workspace, with its apps derived from the manifest. */
1324
+ readonly workspace: NormalizedWorkspace;
1325
+ /** What the workspace declares. */
1326
+ readonly manifest: ConstructManifest;
1327
+ /**
1328
+ * Where each Worker's crons, queues and subscribers are declared, from the
1329
+ * same discovery: which workers have work to run, and which app each is
1330
+ * built from (`workerUnits`).
1331
+ */
1332
+ readonly background?: Readonly<Record<string, readonly string[]>>;
1333
+ /**
1334
+ * Each Worker's subscribers, from the same discovery — by export, and the
1335
+ * key its deliveries come from: which of them SNS pushes to.
1336
+ */
1337
+ readonly subscribers?: Readonly<Record<string, readonly BoundSubscriber[]>>;
1338
+ /** The target's options, as its `options` schema parsed them. */
1339
+ readonly options: Options;
1340
+ /**
1341
+ * Look everything up and report what would happen — as `resource.planned`
1342
+ * events — without changing anything. Only `validate` and `plan` run.
1343
+ */
1344
+ readonly dryRun: boolean;
1345
+ /**
1346
+ * When `release` or `verify` fails, roll back every app the run released
1347
+ * rather than only those that failed — for apps that must move together,
1348
+ * an API and the site built against it. Only a target that can roll back
1349
+ * reads it.
1350
+ */
1351
+ readonly atomic: boolean;
1352
+ /**
1353
+ * `--allow-dev-services`: a deployed stage runs the dev service for every
1354
+ * bucket and mail it does not account for — no key in its secrets, no
1355
+ * provider backing the kind. Off by default: a deployed stage's mail and
1356
+ * buckets come from its secrets or its providers, and a server target
1357
+ * refuses one that lacks them. The local stage ignores it — it always
1358
+ * runs both.
1359
+ */
1360
+ readonly allowDevServices: boolean;
1361
+ /**
1362
+ * `--skip-dns`: a server target neither writes its public hosts' DNS
1363
+ * records nor checks that they point at the stage's server — for a CDN or
1364
+ * proxy in front of it, or records written by another step.
1365
+ */
1366
+ readonly skipDns?: boolean;
1367
+ /** Where every credential comes from. Nothing prompts. */
1368
+ readonly credentials: CredentialProvider;
1369
+ /**
1370
+ * The stage's deploy state. A real run holds the stage's lock for every
1371
+ * phase; a dry run holds none and must write nothing.
1372
+ */
1373
+ readonly state: StateStore;
1374
+ readonly secrets: DeploySecrets;
1375
+ readonly logger: DeployTargetLogger;
1376
+ /** Fires when the run is stopped; every phase stops what it is doing. */
1377
+ readonly signal: AbortSignal;
1378
+ /**
1379
+ * Where the output of what a phase spawns goes: the host's terminal, its
1380
+ * stderr (so stdout carries only events), or nowhere.
1381
+ */
1382
+ readonly childOutput: 'inherit' | 'stderr' | 'ignore';
1383
+ /** Report progress. */
1384
+ emit(event: TargetEvent): void;
1385
+ /** Leave an app out of this run, with the reason a person will read. */
1386
+ skip(app: string, reason: string): void;
1387
+ /**
1388
+ * What a resource is called on the target: scoped by the stage and the
1389
+ * identity exactly as the constructs are — `name('api')` is
1390
+ * `production-shop-api`. Two workspaces, or two stages, never share one.
1391
+ */
1392
+ name(resource: string): string;
1393
+ }
1394
+ /** Why `rollback` was called: the phase that failed, and its error. */
1395
+ interface DeployFailure {
1396
+ readonly phase: 'release' | 'verify';
1397
+ readonly error: unknown;
1398
+ }
1399
+ /**
1400
+ * A deploy target.
1401
+ *
1402
+ * The CLI calls the phases in order — `validate`, then `plan` for a dry run,
1403
+ * or `provision → build → release → verify` for a real one — emitting
1404
+ * `phase.started`/`phase.finished` around each. Every phase must be safe to
1405
+ * run again: a deploy stopped part way is finished by deploying again, so a
1406
+ * phase finds what an earlier run made (through `state`) before making it.
1407
+ *
1408
+ * `Run` is whatever the target carries from one phase to the next within a
1409
+ * run — `validate` makes it, every later phase is handed it.
1410
+ *
1411
+ * ```ts
1412
+ * import { defineTarget } from '@geekmidas/cli/target';
1413
+ * import { z } from 'zod';
1414
+ *
1415
+ * export default defineTarget({
1416
+ * name: 'fly',
1417
+ * runtime: 'server',
1418
+ * capabilities: { rollback: true, migrations: 'target', images: true },
1419
+ * options: z.object({ org: z.string(), region: z.string().default('ams') }),
1420
+ * async validate(ctx) {
1421
+ * return { org: ctx.options.org, region: ctx.options.region };
1422
+ * },
1423
+ * async plan(ctx, run) { … },
1424
+ * async release(ctx, run) { … },
1425
+ * async rollback(ctx, run, failure) { … },
1426
+ * result(ctx, run) { … },
1427
+ * });
1428
+ * ```
1429
+ */
1430
+ interface DeployTarget<Options = undefined, Run = unknown> {
1431
+ /** The target's own name, for messages. Config refers to it by its key. */
1432
+ readonly name: string;
1433
+ readonly runtime: DeployRuntime;
1434
+ readonly capabilities: DeployTargetCapabilities;
1435
+ /**
1436
+ * What `deploy.targets` may pass it — `[package, options]` — validated
1437
+ * before any phase runs. Without one, the target takes no options.
1438
+ */
1439
+ readonly options?: TargetOptionsSchema<Options>;
1440
+ /**
1441
+ * The kinds of credential it asks the run's `CredentialProvider` for, so a
1442
+ * host or `gkm login` can collect them up front.
1443
+ */
1444
+ readonly credentials?: readonly CredentialKind[];
1445
+ /**
1446
+ * The tag a run releases under when none is asked for. Without one it is
1447
+ * `<stage>-<timestamp>`; a target that builds from the checkout can name
1448
+ * its images after the commit instead.
1449
+ */
1450
+ tag?(where: {
1451
+ readonly cwd: string;
1452
+ readonly stage: string;
1453
+ }): Promise<string>;
1454
+ /**
1455
+ * What the run is — the apps, the images, what each runs with — checked
1456
+ * before anything changes. A build-only run calls it too, so it checks
1457
+ * what building needs; what only a deploy needs is `ready`'s.
1458
+ */
1459
+ validate(ctx: DeployPhaseContext<Options>): Promise<Run>;
1460
+ /**
1461
+ * What only this target checks before a deploy changes anything — compose's
1462
+ * server address and its hosts' DNS. Run after `validate` and the stage's
1463
+ * own readiness check (every key it needs, after its providers wrote
1464
+ * theirs), on a deploy and its dry run. A build-only run never calls it:
1465
+ * an image needs none of it.
1466
+ */
1467
+ ready?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1468
+ /** A dry run: emit `resource.planned` for what a real run would do. */
1469
+ plan(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1470
+ /** Create or find what the apps run on, and what they declare. */
1471
+ provision?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1472
+ /** Build each app's artifact (`artifact.built`), changing nothing live. */
1473
+ build?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1474
+ /** Put the built artifacts live (`app.deployed`). */
1475
+ release(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1476
+ /** Check what was released answers (`health.checked`). */
1477
+ verify?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1478
+ /**
1479
+ * Restore the previous release, after `release` or `verify` failed. Called
1480
+ * only when `capabilities.rollback` is true.
1481
+ */
1482
+ rollback?(ctx: DeployPhaseContext<Options>, run: Run, failure: DeployFailure): Promise<void>;
1483
+ /** What the run did, once its last phase has finished. */
1484
+ result(ctx: DeployPhaseContext<Options>, run: Run): DeployResult | Promise<DeployResult>;
134
1485
  }
135
1486
  /**
136
- * Custom state provider config.
1487
+ * A target of any options and run state — what the CLI holds once a target
1488
+ * is resolved, its types left behind in the config that named it. The phases
1489
+ * are methods, so their parameters are compared bivariantly and every
1490
+ * `DeployTarget<O, R>` is one.
137
1491
  */
138
- interface CustomStateConfig {
139
- /** Custom StateProvider implementation */
140
- provider: StateProvider;
141
- }
1492
+ type AnyDeployTarget = DeployTarget<unknown, unknown>;
1493
+ /** A target's options type, from the target. */
1494
+ type TargetOptions<T> = T extends DeployTarget<infer O, infer _Run> ? O : never;
142
1495
  /**
143
- * State configuration types.
1496
+ * One `deploy.targets` entry:
1497
+ *
1498
+ * - `'@acme/gkm-target'` — a package, its default export the target
1499
+ * - a target object, from `defineTarget` or a package's factory
1500
+ * - `['@acme/gkm-target', { region: 'ams' }]` — either, with options
144
1501
  */
145
- type StateConfig = LocalStateConfig | SSMStateConfig | CustomStateConfig;
1502
+ type DeployTargetEntry = string | AnyDeployTarget | readonly [string | AnyDeployTarget, unknown];
146
1503
  declare namespace json_schema_d_exports {
147
1504
  export { ArraySchema, BaseSchema, BooleanSchema, IntegerSchema, JSONSchema, NullSchema, NumberSchema, ObjectSchema, Schema$1 as Schema, SchemaType, StringSchema, _JSONSchema };
148
1505
  }
@@ -4421,10 +5778,10 @@ declare namespace external_d_exports {
4421
5778
  * Backend framework schema for non-gkm apps.
4422
5779
  */
4423
5780
  declare const BackendFrameworkSchema: ZodEnum<{
4424
- hono: "hono";
4425
5781
  "better-auth": "better-auth";
4426
5782
  express: "express";
4427
5783
  fastify: "fastify";
5784
+ hono: "hono";
4428
5785
  }>;
4429
5786
  /**
4430
5787
  * Backend framework types for apps that don't use gkm routes.
@@ -4456,8 +5813,8 @@ type BackendFramework = output$1<typeof BackendFrameworkSchema>;
4456
5813
  declare const FrontendFrameworkSchema: ZodEnum<{
4457
5814
  nextjs: "nextjs";
4458
5815
  remix: "remix";
4459
- vite: "vite";
4460
5816
  "tanstack-start": "tanstack-start";
5817
+ vite: "vite";
4461
5818
  }>;
4462
5819
  /**
4463
5820
  * Frontend framework types. Derived from {@link FrontendFrameworkSchema}.
@@ -4516,15 +5873,15 @@ type MobileFramework = output$1<typeof MobileFrameworkSchema>;
4516
5873
  * Combined framework schema (backend, frontend, or mobile).
4517
5874
  */
4518
5875
  declare const FrameworkSchema: ZodUnion<readonly [ZodEnum<{
4519
- hono: "hono";
4520
5876
  "better-auth": "better-auth";
4521
5877
  express: "express";
4522
5878
  fastify: "fastify";
5879
+ hono: "hono";
4523
5880
  }>, ZodEnum<{
4524
5881
  nextjs: "nextjs";
4525
5882
  remix: "remix";
4526
- vite: "vite";
4527
5883
  "tanstack-start": "tanstack-start";
5884
+ vite: "vite";
4528
5885
  }>, ZodEnum<{
4529
5886
  expo: "expo";
4530
5887
  }>]>;
@@ -4534,17 +5891,18 @@ declare const FrameworkSchema: ZodUnion<readonly [ZodEnum<{
4534
5891
  */
4535
5892
  type Framework = output$1<typeof FrameworkSchema>;
4536
5893
  /**
4537
- * Supported deploy targets (Phase 1).
4538
- */
4539
- declare const SUPPORTED_DEPLOY_TARGETS: readonly ["dokploy"];
4540
- /**
4541
- * Phase 2 deploy targets (not yet implemented).
5894
+ * The built-in targets a config may name, both deployed by `gkm deploy`:
5895
+ * `dokploy`, and `sst`, which runs `sst deploy` on the manifest `gkm build`
5896
+ * writes.
4542
5897
  */
4543
- declare const PHASE_2_DEPLOY_TARGETS: readonly ["vercel", "cloudflare"];
5898
+ declare const SUPPORTED_DEPLOY_TARGETS: string[];
5899
+ /** Built-in names reserved for targets that do not exist yet. */
5900
+ declare const PHASE_2_DEPLOY_TARGETS: string[];
4544
5901
  /**
4545
- * Check if a deploy target is supported.
5902
+ * Whether a config may name `target`: a usable built-in, or one of its own
5903
+ * `deploy.targets`.
4546
5904
  */
4547
- declare function isDeployTargetSupported(target: string): boolean;
5905
+ declare function isDeployTargetSupported(target: string, targets?: Record<string, unknown>): boolean;
4548
5906
  /**
4549
5907
  * Check if a deploy target is planned for Phase 2.
4550
5908
  */
@@ -4554,107 +5912,73 @@ declare function isPhase2DeployTarget(target: string): boolean;
4554
5912
  */
4555
5913
  declare function getDeployTargetError(target: string, appName?: string): string;
4556
5914
  /**
4557
- * Combined DNS config that supports both new multi-domain and legacy single-domain formats.
5915
+ * Single DNS provider config (for one domain).
4558
5916
  */
4559
- declare const DnsConfigWithLegacySchema: ZodUnion<readonly [ZodRecord<ZodString, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
5917
+ declare const DnsProviderSchema: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4560
5918
  provider: ZodLiteral<"hostinger">;
5919
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5920
+ mode: ZodLiteral<"cname">;
5921
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5922
+ }, $strict>]>>;
4561
5923
  ttl: ZodOptional<ZodNumber>;
4562
5924
  }, $strip>, ZodObject<{
4563
5925
  provider: ZodLiteral<"route53">;
5926
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5927
+ mode: ZodLiteral<"cname">;
5928
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5929
+ }, $strict>]>>;
4564
5930
  region: ZodOptional<ZodEnum<{
4565
- "us-east-1": "us-east-1";
4566
- "us-east-2": "us-east-2";
4567
- "us-west-1": "us-west-1";
4568
- "us-west-2": "us-west-2";
4569
5931
  "af-south-1": "af-south-1";
4570
5932
  "ap-east-1": "ap-east-1";
5933
+ "ap-northeast-1": "ap-northeast-1";
5934
+ "ap-northeast-2": "ap-northeast-2";
5935
+ "ap-northeast-3": "ap-northeast-3";
4571
5936
  "ap-south-1": "ap-south-1";
4572
5937
  "ap-south-2": "ap-south-2";
4573
5938
  "ap-southeast-1": "ap-southeast-1";
4574
5939
  "ap-southeast-2": "ap-southeast-2";
4575
5940
  "ap-southeast-3": "ap-southeast-3";
4576
5941
  "ap-southeast-4": "ap-southeast-4";
4577
- "ap-northeast-1": "ap-northeast-1";
4578
- "ap-northeast-2": "ap-northeast-2";
4579
- "ap-northeast-3": "ap-northeast-3";
4580
5942
  "ca-central-1": "ca-central-1";
4581
5943
  "eu-central-1": "eu-central-1";
4582
5944
  "eu-central-2": "eu-central-2";
5945
+ "eu-north-1": "eu-north-1";
5946
+ "eu-south-1": "eu-south-1";
5947
+ "eu-south-2": "eu-south-2";
4583
5948
  "eu-west-1": "eu-west-1";
4584
5949
  "eu-west-2": "eu-west-2";
4585
5950
  "eu-west-3": "eu-west-3";
4586
- "eu-south-1": "eu-south-1";
4587
- "eu-south-2": "eu-south-2";
4588
- "eu-north-1": "eu-north-1";
4589
- "me-south-1": "me-south-1";
4590
5951
  "me-central-1": "me-central-1";
5952
+ "me-south-1": "me-south-1";
4591
5953
  "sa-east-1": "sa-east-1";
4592
- }>>;
4593
- profile: ZodOptional<ZodString>;
4594
- hostedZoneId: ZodOptional<ZodString>;
4595
- ttl: ZodOptional<ZodNumber>;
4596
- }, $strip>, ZodObject<{
4597
- provider: ZodLiteral<"cloudflare">;
4598
- ttl: ZodOptional<ZodNumber>;
4599
- }, $strip>, ZodObject<{
4600
- provider: ZodLiteral<"manual">;
4601
- }, $strip>], "provider">, ZodObject<{
4602
- provider: ZodCustom<{
4603
- name: string;
4604
- getRecords: Function;
4605
- upsertRecords: Function;
4606
- }, {
4607
- name: string;
4608
- getRecords: Function;
4609
- upsertRecords: Function;
4610
- }>;
4611
- ttl: ZodOptional<ZodNumber>;
4612
- }, $strip>]>>, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4613
- provider: ZodLiteral<"hostinger">;
4614
- ttl: ZodOptional<ZodNumber>;
4615
- domain: ZodString;
4616
- }, $strip>, ZodObject<{
4617
- provider: ZodLiteral<"route53">;
4618
- region: ZodOptional<ZodEnum<{
4619
5954
  "us-east-1": "us-east-1";
4620
5955
  "us-east-2": "us-east-2";
4621
5956
  "us-west-1": "us-west-1";
4622
5957
  "us-west-2": "us-west-2";
4623
- "af-south-1": "af-south-1";
4624
- "ap-east-1": "ap-east-1";
4625
- "ap-south-1": "ap-south-1";
4626
- "ap-south-2": "ap-south-2";
4627
- "ap-southeast-1": "ap-southeast-1";
4628
- "ap-southeast-2": "ap-southeast-2";
4629
- "ap-southeast-3": "ap-southeast-3";
4630
- "ap-southeast-4": "ap-southeast-4";
4631
- "ap-northeast-1": "ap-northeast-1";
4632
- "ap-northeast-2": "ap-northeast-2";
4633
- "ap-northeast-3": "ap-northeast-3";
4634
- "ca-central-1": "ca-central-1";
4635
- "eu-central-1": "eu-central-1";
4636
- "eu-central-2": "eu-central-2";
4637
- "eu-west-1": "eu-west-1";
4638
- "eu-west-2": "eu-west-2";
4639
- "eu-west-3": "eu-west-3";
4640
- "eu-south-1": "eu-south-1";
4641
- "eu-south-2": "eu-south-2";
4642
- "eu-north-1": "eu-north-1";
4643
- "me-south-1": "me-south-1";
4644
- "me-central-1": "me-central-1";
4645
- "sa-east-1": "sa-east-1";
4646
5958
  }>>;
4647
5959
  profile: ZodOptional<ZodString>;
4648
5960
  hostedZoneId: ZodOptional<ZodString>;
4649
5961
  ttl: ZodOptional<ZodNumber>;
4650
- domain: ZodString;
5962
+ }, $strip>, ZodObject<{
5963
+ provider: ZodLiteral<"godaddy">;
5964
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5965
+ mode: ZodLiteral<"cname">;
5966
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5967
+ }, $strict>]>>;
5968
+ ttl: ZodOptional<ZodNumber>;
4651
5969
  }, $strip>, ZodObject<{
4652
5970
  provider: ZodLiteral<"cloudflare">;
5971
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5972
+ mode: ZodLiteral<"cname">;
5973
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5974
+ }, $strict>]>>;
4653
5975
  ttl: ZodOptional<ZodNumber>;
4654
- domain: ZodString;
4655
5976
  }, $strip>, ZodObject<{
4656
5977
  provider: ZodLiteral<"manual">;
4657
- domain: ZodString;
5978
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5979
+ mode: ZodLiteral<"cname">;
5980
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5981
+ }, $strict>]>>;
4658
5982
  }, $strip>], "provider">, ZodObject<{
4659
5983
  provider: ZodCustom<{
4660
5984
  name: string;
@@ -4665,103 +5989,78 @@ declare const DnsConfigWithLegacySchema: ZodUnion<readonly [ZodRecord<ZodString,
4665
5989
  getRecords: Function;
4666
5990
  upsertRecords: Function;
4667
5991
  }>;
5992
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5993
+ mode: ZodLiteral<"cname">;
5994
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5995
+ }, $strict>]>>;
4668
5996
  ttl: ZodOptional<ZodNumber>;
4669
- domain: ZodString;
4670
- }, $strip>]>]>;
4671
- type DnsConfig = output$1<typeof DnsConfigWithLegacySchema>;
5997
+ }, $strip>]>;
5998
+ type DnsProvider = output$1<typeof DnsProviderSchema>;
4672
5999
  /**
4673
6000
  * Backups configuration schema.
4674
6001
  *
4675
6002
  * Configures automatic backup destinations for database services.
4676
6003
  * On first deploy, creates S3 bucket with unique name and IAM credentials.
4677
6004
  */
4678
- declare const BackupsConfigSchema: ZodObject<{
6005
+ declare const DokployBackupsConfigSchema: ZodObject<{
4679
6006
  type: ZodLiteral<"s3">;
4680
6007
  profile: ZodOptional<ZodString>;
4681
6008
  region: ZodEnum<{
4682
- "us-east-1": "us-east-1";
4683
- "us-east-2": "us-east-2";
4684
- "us-west-1": "us-west-1";
4685
- "us-west-2": "us-west-2";
4686
6009
  "af-south-1": "af-south-1";
4687
6010
  "ap-east-1": "ap-east-1";
6011
+ "ap-northeast-1": "ap-northeast-1";
6012
+ "ap-northeast-2": "ap-northeast-2";
6013
+ "ap-northeast-3": "ap-northeast-3";
4688
6014
  "ap-south-1": "ap-south-1";
4689
6015
  "ap-south-2": "ap-south-2";
4690
6016
  "ap-southeast-1": "ap-southeast-1";
4691
6017
  "ap-southeast-2": "ap-southeast-2";
4692
6018
  "ap-southeast-3": "ap-southeast-3";
4693
6019
  "ap-southeast-4": "ap-southeast-4";
4694
- "ap-northeast-1": "ap-northeast-1";
4695
- "ap-northeast-2": "ap-northeast-2";
4696
- "ap-northeast-3": "ap-northeast-3";
4697
6020
  "ca-central-1": "ca-central-1";
4698
6021
  "eu-central-1": "eu-central-1";
4699
6022
  "eu-central-2": "eu-central-2";
6023
+ "eu-north-1": "eu-north-1";
6024
+ "eu-south-1": "eu-south-1";
6025
+ "eu-south-2": "eu-south-2";
4700
6026
  "eu-west-1": "eu-west-1";
4701
6027
  "eu-west-2": "eu-west-2";
4702
6028
  "eu-west-3": "eu-west-3";
4703
- "eu-south-1": "eu-south-1";
4704
- "eu-south-2": "eu-south-2";
4705
- "eu-north-1": "eu-north-1";
4706
- "me-south-1": "me-south-1";
4707
6029
  "me-central-1": "me-central-1";
6030
+ "me-south-1": "me-south-1";
4708
6031
  "sa-east-1": "sa-east-1";
6032
+ "us-east-1": "us-east-1";
6033
+ "us-east-2": "us-east-2";
6034
+ "us-west-1": "us-west-1";
6035
+ "us-west-2": "us-west-2";
4709
6036
  }>;
4710
6037
  schedule: ZodOptional<ZodString>;
4711
6038
  retention: ZodOptional<ZodNumber>;
4712
6039
  }, $strip>;
4713
- type BackupsConfig = output$1<typeof BackupsConfigSchema>;
6040
+ type DokployBackupsConfig = output$1<typeof DokployBackupsConfigSchema>;
4714
6041
  /**
4715
6042
  * Workspace configuration schema.
4716
6043
  */
4717
6044
  declare const WorkspaceConfigSchema: ZodObject<{
4718
6045
  name: ZodOptional<ZodString>;
4719
- constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4720
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4721
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4722
- }, $strip>]>>;
6046
+ constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
4723
6047
  apps: ZodOptional<ZodRecord<ZodString, ZodObject<{
4724
6048
  type: ZodDefault<ZodOptional<ZodEnum<{
4725
6049
  backend: "backend";
4726
- web: "web";
4727
6050
  mobile: "mobile";
6051
+ web: "web";
4728
6052
  }>>>;
4729
6053
  path: ZodString;
4730
6054
  port: ZodNumber;
4731
6055
  dependencies: ZodOptional<ZodArray<ZodString>>;
4732
- deploy: ZodOptional<ZodEnum<{
4733
- dokploy: "dokploy";
4734
- vercel: "vercel";
4735
- cloudflare: "cloudflare";
4736
- }>>;
4737
- constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4738
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4739
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4740
- }, $strip>]>>;
4741
- routes: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4742
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4743
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4744
- }, $strip>]>>;
4745
- functions: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4746
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4747
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4748
- }, $strip>]>>;
4749
- crons: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4750
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4751
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4752
- }, $strip>]>>;
4753
- queues: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4754
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4755
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4756
- }, $strip>]>>;
4757
- topics: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4758
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4759
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4760
- }, $strip>]>>;
4761
- subscribers: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4762
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4763
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4764
- }, $strip>]>>;
6056
+ deploy: ZodOptional<ZodString>;
6057
+ constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6058
+ routes: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6059
+ functions: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6060
+ crons: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6061
+ queues: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6062
+ topics: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6063
+ subscribers: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
4765
6064
  envParser: ZodOptional<ZodString>;
4766
6065
  logger: ZodOptional<ZodString>;
4767
6066
  hooks: ZodOptional<ZodObject<{
@@ -4776,11 +6075,6 @@ declare const WorkspaceConfigSchema: ZodObject<{
4776
6075
  maxEntries: ZodOptional<ZodNumber>;
4777
6076
  websocket: ZodOptional<ZodBoolean>;
4778
6077
  }, $strip>]>>;
4779
- studio: ZodOptional<ZodUnion<readonly [ZodString, ZodBoolean, ZodObject<{
4780
- enabled: ZodOptional<ZodBoolean>;
4781
- path: ZodOptional<ZodString>;
4782
- schema: ZodOptional<ZodString>;
4783
- }, $strip>]>>;
4784
6078
  openapi: ZodOptional<ZodUnion<readonly [ZodBoolean, ZodObject<{
4785
6079
  enabled: ZodOptional<ZodBoolean>;
4786
6080
  title: ZodOptional<ZodString>;
@@ -4788,21 +6082,21 @@ declare const WorkspaceConfigSchema: ZodObject<{
4788
6082
  description: ZodOptional<ZodString>;
4789
6083
  }, $strip>]>>;
4790
6084
  runtime: ZodOptional<ZodEnum<{
4791
- node: "node";
4792
6085
  bun: "bun";
6086
+ node: "node";
4793
6087
  }>>;
4794
6088
  env: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
4795
6089
  entry: ZodOptional<ZodString>;
4796
6090
  framework: ZodOptional<ZodUnion<readonly [ZodEnum<{
4797
- hono: "hono";
4798
6091
  "better-auth": "better-auth";
4799
6092
  express: "express";
4800
6093
  fastify: "fastify";
6094
+ hono: "hono";
4801
6095
  }>, ZodEnum<{
4802
6096
  nextjs: "nextjs";
4803
6097
  remix: "remix";
4804
- vite: "vite";
4805
6098
  "tanstack-start": "tanstack-start";
6099
+ vite: "vite";
4806
6100
  }>, ZodEnum<{
4807
6101
  expo: "expo";
4808
6102
  }>]>>;
@@ -4820,178 +6114,296 @@ declare const WorkspaceConfigSchema: ZodObject<{
4820
6114
  }>>;
4821
6115
  }, $strip>>;
4822
6116
  }, $strip>>;
4823
- deploy: ZodOptional<ZodObject<{
4824
- default: ZodOptional<ZodEnum<{
4825
- dokploy: "dokploy";
4826
- vercel: "vercel";
4827
- cloudflare: "cloudflare";
6117
+ domains: ZodOptional<ZodRecord<ZodString, ZodString>>;
6118
+ protectedSubdomains: ZodOptional<ZodArray<ZodString>>;
6119
+ dns: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
6120
+ provider: ZodLiteral<"hostinger">;
6121
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6122
+ mode: ZodLiteral<"cname">;
6123
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6124
+ }, $strict>]>>;
6125
+ ttl: ZodOptional<ZodNumber>;
6126
+ }, $strip>, ZodObject<{
6127
+ provider: ZodLiteral<"route53">;
6128
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6129
+ mode: ZodLiteral<"cname">;
6130
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6131
+ }, $strict>]>>;
6132
+ region: ZodOptional<ZodEnum<{
6133
+ "af-south-1": "af-south-1";
6134
+ "ap-east-1": "ap-east-1";
6135
+ "ap-northeast-1": "ap-northeast-1";
6136
+ "ap-northeast-2": "ap-northeast-2";
6137
+ "ap-northeast-3": "ap-northeast-3";
6138
+ "ap-south-1": "ap-south-1";
6139
+ "ap-south-2": "ap-south-2";
6140
+ "ap-southeast-1": "ap-southeast-1";
6141
+ "ap-southeast-2": "ap-southeast-2";
6142
+ "ap-southeast-3": "ap-southeast-3";
6143
+ "ap-southeast-4": "ap-southeast-4";
6144
+ "ca-central-1": "ca-central-1";
6145
+ "eu-central-1": "eu-central-1";
6146
+ "eu-central-2": "eu-central-2";
6147
+ "eu-north-1": "eu-north-1";
6148
+ "eu-south-1": "eu-south-1";
6149
+ "eu-south-2": "eu-south-2";
6150
+ "eu-west-1": "eu-west-1";
6151
+ "eu-west-2": "eu-west-2";
6152
+ "eu-west-3": "eu-west-3";
6153
+ "me-central-1": "me-central-1";
6154
+ "me-south-1": "me-south-1";
6155
+ "sa-east-1": "sa-east-1";
6156
+ "us-east-1": "us-east-1";
6157
+ "us-east-2": "us-east-2";
6158
+ "us-west-1": "us-west-1";
6159
+ "us-west-2": "us-west-2";
4828
6160
  }>>;
6161
+ profile: ZodOptional<ZodString>;
6162
+ hostedZoneId: ZodOptional<ZodString>;
6163
+ ttl: ZodOptional<ZodNumber>;
6164
+ }, $strip>, ZodObject<{
6165
+ provider: ZodLiteral<"godaddy">;
6166
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6167
+ mode: ZodLiteral<"cname">;
6168
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6169
+ }, $strict>]>>;
6170
+ ttl: ZodOptional<ZodNumber>;
6171
+ }, $strip>, ZodObject<{
6172
+ provider: ZodLiteral<"cloudflare">;
6173
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6174
+ mode: ZodLiteral<"cname">;
6175
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6176
+ }, $strict>]>>;
6177
+ ttl: ZodOptional<ZodNumber>;
6178
+ }, $strip>, ZodObject<{
6179
+ provider: ZodLiteral<"manual">;
6180
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6181
+ mode: ZodLiteral<"cname">;
6182
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6183
+ }, $strict>]>>;
6184
+ }, $strip>], "provider">, ZodObject<{
6185
+ provider: ZodCustom<{
6186
+ name: string;
6187
+ getRecords: Function;
6188
+ upsertRecords: Function;
6189
+ }, {
6190
+ name: string;
6191
+ getRecords: Function;
6192
+ upsertRecords: Function;
6193
+ }>;
6194
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6195
+ mode: ZodLiteral<"cname">;
6196
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6197
+ }, $strict>]>>;
6198
+ ttl: ZodOptional<ZodNumber>;
6199
+ }, $strip>]>>>;
6200
+ deploy: ZodOptional<ZodObject<{
6201
+ default: ZodOptional<ZodString>;
6202
+ targets: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodCustom<unknown, unknown>, ZodTuple<[ZodUnion<readonly [ZodString, ZodCustom<unknown, unknown>]>, ZodUnknown], null>]>>>;
6203
+ namespace: ZodOptional<ZodString>;
6204
+ registry: ZodOptional<ZodString>;
4829
6205
  dokploy: ZodOptional<ZodObject<{
4830
6206
  endpoint: ZodOptional<ZodURL>;
4831
6207
  endpoints: ZodOptional<ZodRecord<ZodString, ZodURL>>;
4832
- registry: ZodOptional<ZodString>;
4833
6208
  registryId: ZodOptional<ZodString>;
4834
- domains: ZodOptional<ZodRecord<ZodString, ZodString>>;
6209
+ backups: ZodOptional<ZodLazy<ZodObject<{
6210
+ type: ZodLiteral<"s3">;
6211
+ profile: ZodOptional<ZodString>;
6212
+ region: ZodEnum<{
6213
+ "af-south-1": "af-south-1";
6214
+ "ap-east-1": "ap-east-1";
6215
+ "ap-northeast-1": "ap-northeast-1";
6216
+ "ap-northeast-2": "ap-northeast-2";
6217
+ "ap-northeast-3": "ap-northeast-3";
6218
+ "ap-south-1": "ap-south-1";
6219
+ "ap-south-2": "ap-south-2";
6220
+ "ap-southeast-1": "ap-southeast-1";
6221
+ "ap-southeast-2": "ap-southeast-2";
6222
+ "ap-southeast-3": "ap-southeast-3";
6223
+ "ap-southeast-4": "ap-southeast-4";
6224
+ "ca-central-1": "ca-central-1";
6225
+ "eu-central-1": "eu-central-1";
6226
+ "eu-central-2": "eu-central-2";
6227
+ "eu-north-1": "eu-north-1";
6228
+ "eu-south-1": "eu-south-1";
6229
+ "eu-south-2": "eu-south-2";
6230
+ "eu-west-1": "eu-west-1";
6231
+ "eu-west-2": "eu-west-2";
6232
+ "eu-west-3": "eu-west-3";
6233
+ "me-central-1": "me-central-1";
6234
+ "me-south-1": "me-south-1";
6235
+ "sa-east-1": "sa-east-1";
6236
+ "us-east-1": "us-east-1";
6237
+ "us-east-2": "us-east-2";
6238
+ "us-west-1": "us-west-1";
6239
+ "us-west-2": "us-west-2";
6240
+ }>;
6241
+ schedule: ZodOptional<ZodString>;
6242
+ retention: ZodOptional<ZodNumber>;
6243
+ }, $strip>>>;
6244
+ verify: ZodOptional<ZodObject<{
6245
+ deploymentTimeoutMs: ZodOptional<ZodNumber>;
6246
+ healthCheckPath: ZodOptional<ZodString>;
6247
+ healthyAfter: ZodOptional<ZodNumber>;
6248
+ intervalMs: ZodOptional<ZodNumber>;
6249
+ healthTimeoutMs: ZodOptional<ZodNumber>;
6250
+ }, $strip>>;
4835
6251
  }, $strip>>;
4836
- dns: ZodOptional<ZodUnion<readonly [ZodRecord<ZodString, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4837
- provider: ZodLiteral<"hostinger">;
4838
- ttl: ZodOptional<ZodNumber>;
4839
- }, $strip>, ZodObject<{
4840
- provider: ZodLiteral<"route53">;
6252
+ compose: ZodOptional<ZodObject<{
6253
+ proxy: ZodOptional<ZodUnion<readonly [ZodEnum<{
6254
+ caddy: "caddy";
6255
+ traefik: "traefik";
6256
+ }>, ZodRecord<ZodString, ZodEnum<{
6257
+ caddy: "caddy";
6258
+ traefik: "traefik";
6259
+ }>>]>>;
6260
+ tls: ZodOptional<ZodRecord<ZodString, ZodObject<{
6261
+ certFile: ZodString;
6262
+ keyFile: ZodString;
6263
+ caFile: ZodOptional<ZodString>;
6264
+ }, $strict>>>;
6265
+ server: ZodOptional<ZodRecord<ZodString, ZodObject<{
6266
+ user: ZodString;
6267
+ host: ZodOptional<ZodString>;
6268
+ port: ZodOptional<ZodNumber>;
6269
+ }, $strict>>>;
6270
+ }, $strict>>;
6271
+ telemetry: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodLiteral<false>, ZodLiteral<"self-hosted">, ZodObject<{
6272
+ provider: ZodLiteral<"self-hosted">;
6273
+ port: ZodOptional<ZodNumber>;
6274
+ retentionDays: ZodOptional<ZodNumber>;
6275
+ public: ZodOptional<ZodObject<{
6276
+ allow: ZodArray<ZodString>;
6277
+ }, $strip>>;
6278
+ sampleRate: ZodOptional<ZodNumber>;
6279
+ }, $strict>, ZodObject<{
6280
+ provider: ZodLiteral<"otlp">;
6281
+ endpoint: ZodString;
6282
+ headers: ZodOptional<ZodRecord<ZodString, ZodString>>;
6283
+ sampleRate: ZodOptional<ZodNumber>;
6284
+ }, $strict>]>>>;
6285
+ objects: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
6286
+ inbox: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
6287
+ backups: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
6288
+ }, $strip>>;
6289
+ stages: ZodObject<{
6290
+ local: ZodString;
6291
+ deployed: ZodArray<ZodString>;
6292
+ protected: ZodOptional<ZodArray<ZodString>>;
6293
+ }, $strip>;
6294
+ secrets: ZodOptional<ZodObject<{
6295
+ enabled: ZodOptional<ZodBoolean>;
6296
+ store: ZodOptional<ZodUnion<readonly [ZodLiteral<"file">, ZodObject<{
6297
+ provider: ZodLiteral<"s3">;
6298
+ bucket: ZodOptional<ZodString>;
4841
6299
  region: ZodOptional<ZodEnum<{
4842
- "us-east-1": "us-east-1";
4843
- "us-east-2": "us-east-2";
4844
- "us-west-1": "us-west-1";
4845
- "us-west-2": "us-west-2";
4846
6300
  "af-south-1": "af-south-1";
4847
6301
  "ap-east-1": "ap-east-1";
6302
+ "ap-northeast-1": "ap-northeast-1";
6303
+ "ap-northeast-2": "ap-northeast-2";
6304
+ "ap-northeast-3": "ap-northeast-3";
4848
6305
  "ap-south-1": "ap-south-1";
4849
6306
  "ap-south-2": "ap-south-2";
4850
6307
  "ap-southeast-1": "ap-southeast-1";
4851
6308
  "ap-southeast-2": "ap-southeast-2";
4852
6309
  "ap-southeast-3": "ap-southeast-3";
4853
6310
  "ap-southeast-4": "ap-southeast-4";
4854
- "ap-northeast-1": "ap-northeast-1";
4855
- "ap-northeast-2": "ap-northeast-2";
4856
- "ap-northeast-3": "ap-northeast-3";
4857
6311
  "ca-central-1": "ca-central-1";
4858
6312
  "eu-central-1": "eu-central-1";
4859
6313
  "eu-central-2": "eu-central-2";
6314
+ "eu-north-1": "eu-north-1";
6315
+ "eu-south-1": "eu-south-1";
6316
+ "eu-south-2": "eu-south-2";
4860
6317
  "eu-west-1": "eu-west-1";
4861
6318
  "eu-west-2": "eu-west-2";
4862
6319
  "eu-west-3": "eu-west-3";
4863
- "eu-south-1": "eu-south-1";
4864
- "eu-south-2": "eu-south-2";
4865
- "eu-north-1": "eu-north-1";
4866
- "me-south-1": "me-south-1";
4867
6320
  "me-central-1": "me-central-1";
6321
+ "me-south-1": "me-south-1";
4868
6322
  "sa-east-1": "sa-east-1";
4869
- }>>;
4870
- profile: ZodOptional<ZodString>;
4871
- hostedZoneId: ZodOptional<ZodString>;
4872
- ttl: ZodOptional<ZodNumber>;
4873
- }, $strip>, ZodObject<{
4874
- provider: ZodLiteral<"cloudflare">;
4875
- ttl: ZodOptional<ZodNumber>;
4876
- }, $strip>, ZodObject<{
4877
- provider: ZodLiteral<"manual">;
4878
- }, $strip>], "provider">, ZodObject<{
4879
- provider: ZodCustom<{
4880
- name: string;
4881
- getRecords: Function;
4882
- upsertRecords: Function;
4883
- }, {
4884
- name: string;
4885
- getRecords: Function;
4886
- upsertRecords: Function;
4887
- }>;
4888
- ttl: ZodOptional<ZodNumber>;
4889
- }, $strip>]>>, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4890
- provider: ZodLiteral<"hostinger">;
4891
- ttl: ZodOptional<ZodNumber>;
4892
- domain: ZodString;
4893
- }, $strip>, ZodObject<{
4894
- provider: ZodLiteral<"route53">;
4895
- region: ZodOptional<ZodEnum<{
4896
6323
  "us-east-1": "us-east-1";
4897
6324
  "us-east-2": "us-east-2";
4898
6325
  "us-west-1": "us-west-1";
4899
6326
  "us-west-2": "us-west-2";
6327
+ }>>;
6328
+ prefix: ZodOptional<ZodString>;
6329
+ }, $strict>, ZodObject<{
6330
+ provider: ZodLiteral<"ssm">;
6331
+ region: ZodEnum<{
4900
6332
  "af-south-1": "af-south-1";
4901
6333
  "ap-east-1": "ap-east-1";
6334
+ "ap-northeast-1": "ap-northeast-1";
6335
+ "ap-northeast-2": "ap-northeast-2";
6336
+ "ap-northeast-3": "ap-northeast-3";
4902
6337
  "ap-south-1": "ap-south-1";
4903
6338
  "ap-south-2": "ap-south-2";
4904
6339
  "ap-southeast-1": "ap-southeast-1";
4905
6340
  "ap-southeast-2": "ap-southeast-2";
4906
6341
  "ap-southeast-3": "ap-southeast-3";
4907
6342
  "ap-southeast-4": "ap-southeast-4";
4908
- "ap-northeast-1": "ap-northeast-1";
4909
- "ap-northeast-2": "ap-northeast-2";
4910
- "ap-northeast-3": "ap-northeast-3";
4911
6343
  "ca-central-1": "ca-central-1";
4912
6344
  "eu-central-1": "eu-central-1";
4913
6345
  "eu-central-2": "eu-central-2";
6346
+ "eu-north-1": "eu-north-1";
6347
+ "eu-south-1": "eu-south-1";
6348
+ "eu-south-2": "eu-south-2";
4914
6349
  "eu-west-1": "eu-west-1";
4915
6350
  "eu-west-2": "eu-west-2";
4916
6351
  "eu-west-3": "eu-west-3";
4917
- "eu-south-1": "eu-south-1";
4918
- "eu-south-2": "eu-south-2";
4919
- "eu-north-1": "eu-north-1";
4920
- "me-south-1": "me-south-1";
4921
6352
  "me-central-1": "me-central-1";
6353
+ "me-south-1": "me-south-1";
4922
6354
  "sa-east-1": "sa-east-1";
4923
- }>>;
4924
- profile: ZodOptional<ZodString>;
4925
- hostedZoneId: ZodOptional<ZodString>;
4926
- ttl: ZodOptional<ZodNumber>;
4927
- domain: ZodString;
4928
- }, $strip>, ZodObject<{
4929
- provider: ZodLiteral<"cloudflare">;
4930
- ttl: ZodOptional<ZodNumber>;
4931
- domain: ZodString;
4932
- }, $strip>, ZodObject<{
4933
- provider: ZodLiteral<"manual">;
4934
- domain: ZodString;
4935
- }, $strip>], "provider">, ZodObject<{
4936
- provider: ZodCustom<{
4937
- name: string;
4938
- getRecords: Function;
4939
- upsertRecords: Function;
4940
- }, {
4941
- name: string;
4942
- getRecords: Function;
4943
- upsertRecords: Function;
4944
- }>;
4945
- ttl: ZodOptional<ZodNumber>;
4946
- domain: ZodString;
4947
- }, $strip>]>]>>;
4948
- backups: ZodOptional<ZodObject<{
4949
- type: ZodLiteral<"s3">;
4950
- profile: ZodOptional<ZodString>;
4951
- region: ZodEnum<{
4952
6355
  "us-east-1": "us-east-1";
4953
6356
  "us-east-2": "us-east-2";
4954
6357
  "us-west-1": "us-west-1";
4955
6358
  "us-west-2": "us-west-2";
6359
+ }>;
6360
+ }, $strict>, ZodObject<{
6361
+ provider: ZodLiteral<"secrets-manager">;
6362
+ region: ZodEnum<{
4956
6363
  "af-south-1": "af-south-1";
4957
6364
  "ap-east-1": "ap-east-1";
6365
+ "ap-northeast-1": "ap-northeast-1";
6366
+ "ap-northeast-2": "ap-northeast-2";
6367
+ "ap-northeast-3": "ap-northeast-3";
4958
6368
  "ap-south-1": "ap-south-1";
4959
6369
  "ap-south-2": "ap-south-2";
4960
6370
  "ap-southeast-1": "ap-southeast-1";
4961
6371
  "ap-southeast-2": "ap-southeast-2";
4962
6372
  "ap-southeast-3": "ap-southeast-3";
4963
6373
  "ap-southeast-4": "ap-southeast-4";
4964
- "ap-northeast-1": "ap-northeast-1";
4965
- "ap-northeast-2": "ap-northeast-2";
4966
- "ap-northeast-3": "ap-northeast-3";
4967
6374
  "ca-central-1": "ca-central-1";
4968
6375
  "eu-central-1": "eu-central-1";
4969
6376
  "eu-central-2": "eu-central-2";
4970
- "eu-west-1": "eu-west-1";
4971
- "eu-west-2": "eu-west-2";
4972
- "eu-west-3": "eu-west-3";
6377
+ "eu-north-1": "eu-north-1";
4973
6378
  "eu-south-1": "eu-south-1";
4974
6379
  "eu-south-2": "eu-south-2";
4975
- "eu-north-1": "eu-north-1";
4976
- "me-south-1": "me-south-1";
6380
+ "eu-west-1": "eu-west-1";
6381
+ "eu-west-2": "eu-west-2";
6382
+ "eu-west-3": "eu-west-3";
4977
6383
  "me-central-1": "me-central-1";
6384
+ "me-south-1": "me-south-1";
4978
6385
  "sa-east-1": "sa-east-1";
6386
+ "us-east-1": "us-east-1";
6387
+ "us-east-2": "us-east-2";
6388
+ "us-west-1": "us-west-1";
6389
+ "us-west-2": "us-west-2";
4979
6390
  }>;
4980
- schedule: ZodOptional<ZodString>;
4981
- retention: ZodOptional<ZodNumber>;
4982
- }, $strip>>;
4983
- }, $strip>>;
4984
- stages: ZodObject<{
4985
- local: ZodString;
4986
- deployed: ZodArray<ZodString>;
4987
- protected: ZodOptional<ZodArray<ZodString>>;
4988
- }, $strip>;
4989
- secrets: ZodOptional<ZodObject<{
4990
- enabled: ZodOptional<ZodBoolean>;
6391
+ kmsKeyId: ZodOptional<ZodString>;
6392
+ }, $strict>, ZodObject<{
6393
+ provider: ZodCustom<{
6394
+ name: string;
6395
+ read: Function;
6396
+ write: Function;
6397
+ }, {
6398
+ name: string;
6399
+ read: Function;
6400
+ write: Function;
6401
+ }>;
6402
+ }, $strip>]>>;
4991
6403
  algorithm: ZodOptional<ZodString>;
4992
6404
  kdf: ZodOptional<ZodEnum<{
4993
- scrypt: "scrypt";
4994
6405
  pbkdf2: "pbkdf2";
6406
+ scrypt: "scrypt";
4995
6407
  }>>;
4996
6408
  }, $strip>>;
4997
6409
  state: ZodOptional<ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
@@ -4999,34 +6411,68 @@ declare const WorkspaceConfigSchema: ZodObject<{
4999
6411
  }, $strip>, ZodObject<{
5000
6412
  provider: ZodLiteral<"ssm">;
5001
6413
  region: ZodEnum<{
6414
+ "af-south-1": "af-south-1";
6415
+ "ap-east-1": "ap-east-1";
6416
+ "ap-northeast-1": "ap-northeast-1";
6417
+ "ap-northeast-2": "ap-northeast-2";
6418
+ "ap-northeast-3": "ap-northeast-3";
6419
+ "ap-south-1": "ap-south-1";
6420
+ "ap-south-2": "ap-south-2";
6421
+ "ap-southeast-1": "ap-southeast-1";
6422
+ "ap-southeast-2": "ap-southeast-2";
6423
+ "ap-southeast-3": "ap-southeast-3";
6424
+ "ap-southeast-4": "ap-southeast-4";
6425
+ "ca-central-1": "ca-central-1";
6426
+ "eu-central-1": "eu-central-1";
6427
+ "eu-central-2": "eu-central-2";
6428
+ "eu-north-1": "eu-north-1";
6429
+ "eu-south-1": "eu-south-1";
6430
+ "eu-south-2": "eu-south-2";
6431
+ "eu-west-1": "eu-west-1";
6432
+ "eu-west-2": "eu-west-2";
6433
+ "eu-west-3": "eu-west-3";
6434
+ "me-central-1": "me-central-1";
6435
+ "me-south-1": "me-south-1";
6436
+ "sa-east-1": "sa-east-1";
5002
6437
  "us-east-1": "us-east-1";
5003
6438
  "us-east-2": "us-east-2";
5004
6439
  "us-west-1": "us-west-1";
5005
6440
  "us-west-2": "us-west-2";
6441
+ }>;
6442
+ profile: ZodOptional<ZodString>;
6443
+ }, $strip>, ZodObject<{
6444
+ provider: ZodLiteral<"s3">;
6445
+ bucket: ZodOptional<ZodString>;
6446
+ region: ZodEnum<{
5006
6447
  "af-south-1": "af-south-1";
5007
6448
  "ap-east-1": "ap-east-1";
6449
+ "ap-northeast-1": "ap-northeast-1";
6450
+ "ap-northeast-2": "ap-northeast-2";
6451
+ "ap-northeast-3": "ap-northeast-3";
5008
6452
  "ap-south-1": "ap-south-1";
5009
6453
  "ap-south-2": "ap-south-2";
5010
6454
  "ap-southeast-1": "ap-southeast-1";
5011
6455
  "ap-southeast-2": "ap-southeast-2";
5012
6456
  "ap-southeast-3": "ap-southeast-3";
5013
6457
  "ap-southeast-4": "ap-southeast-4";
5014
- "ap-northeast-1": "ap-northeast-1";
5015
- "ap-northeast-2": "ap-northeast-2";
5016
- "ap-northeast-3": "ap-northeast-3";
5017
6458
  "ca-central-1": "ca-central-1";
5018
6459
  "eu-central-1": "eu-central-1";
5019
6460
  "eu-central-2": "eu-central-2";
6461
+ "eu-north-1": "eu-north-1";
6462
+ "eu-south-1": "eu-south-1";
6463
+ "eu-south-2": "eu-south-2";
5020
6464
  "eu-west-1": "eu-west-1";
5021
6465
  "eu-west-2": "eu-west-2";
5022
6466
  "eu-west-3": "eu-west-3";
5023
- "eu-south-1": "eu-south-1";
5024
- "eu-south-2": "eu-south-2";
5025
- "eu-north-1": "eu-north-1";
5026
- "me-south-1": "me-south-1";
5027
6467
  "me-central-1": "me-central-1";
6468
+ "me-south-1": "me-south-1";
5028
6469
  "sa-east-1": "sa-east-1";
6470
+ "us-east-1": "us-east-1";
6471
+ "us-east-2": "us-east-2";
6472
+ "us-west-1": "us-west-1";
6473
+ "us-west-2": "us-west-2";
5029
6474
  }>;
6475
+ prefix: ZodOptional<ZodString>;
5030
6476
  profile: ZodOptional<ZodString>;
5031
6477
  }, $strip>], "provider">, ZodObject<{
5032
6478
  provider: ZodCustom<{
@@ -5037,6 +6483,13 @@ declare const WorkspaceConfigSchema: ZodObject<{
5037
6483
  write: Function;
5038
6484
  }>;
5039
6485
  }, $strip>]>>;
6486
+ test: ZodOptional<ZodObject<{
6487
+ factories: ZodOptional<ZodString>;
6488
+ }, $strict>>;
6489
+ dev: ZodOptional<ZodObject<{
6490
+ allowedOrigins: ZodOptional<ZodArray<ZodURL>>;
6491
+ discoveryPort: ZodOptional<ZodNumber>;
6492
+ }, $strict>>;
5040
6493
  }, $strict>;
5041
6494
  /**
5042
6495
  * Validate workspace configuration.
@@ -5058,42 +6511,59 @@ declare function formatValidationErrors(error: ZodError): string;
5058
6511
  //#endregion
5059
6512
  //#region src/workspace/types.d.ts
5060
6513
  /**
5061
- * Deploy target for an app.
5062
- *
5063
- * Specifies where the app will be deployed.
6514
+ * Where a stage — or one app — deploys, by target name: a built-in
6515
+ * (`dokploy`, `sst`) or a key of `deploy.targets`.
5064
6516
  *
5065
6517
  * @example
5066
6518
  * ```ts
5067
- * // Currently supported
5068
6519
  * deploy: 'dokploy'
5069
- *
5070
- * // Future support (not yet implemented)
5071
- * deploy: 'vercel'
5072
- * deploy: 'cloudflare'
6520
+ * deploy: 'acme' // deploy: { targets: { acme: '@acme/gkm-target' } }
5073
6521
  * ```
5074
6522
  */
5075
- type DeployTarget = 'dokploy' | 'vercel' | 'cloudflare';
6523
+ type DeployTargetName = 'dokploy' | 'compose' | 'sst' | (string & {});
6524
+ /**
6525
+ * A per-stage map, typed from the workspace's deployed stages: a key that is
6526
+ * not one is a type error. Untyped (`string`) stages accept any key, which the
6527
+ * schema then checks at load.
6528
+ */
6529
+ type StageMap<S extends string, V> = string extends S ? Record<string, V> : Partial<Record<S, V>>;
5076
6530
  /**
5077
- * Stage-based domain configuration.
6531
+ * `domains: { <stage>: '<domain>' }` at the root of `defineWorkspace`, typed from
6532
+ * the deployed stages.
6533
+ */
6534
+ type DomainsInput<S extends string = string> = StageMap<S, string>;
6535
+ /** How one root domain's hosts point at a compose stage's server. */
6536
+ type DnsRecordsModeInput<S extends string = string> = 'a' | {
6537
+ mode: 'cname';
6538
+ target: string | StageMap<S, string>;
6539
+ };
6540
+ /** One root domain's DNS provider, its records mode typed from the stages. */
6541
+ type DnsDomainInput<S extends string = string> = DnsProvider extends (infer P) ? P extends unknown ? Omit<P, 'records'> & {
6542
+ records?: DnsRecordsModeInput<S>;
6543
+ } : never : never;
6544
+ /** `dns: { '<root domain>': { provider, … } }` at the root of `defineWorkspace`. */
6545
+ type DnsInput<S extends string = string> = Record<string, DnsDomainInput<S>>;
6546
+ /** Each root domain's DNS provider — `dns` at the root of the config. */
6547
+ type WorkspaceDnsConfig = Record<string, DnsProvider>;
6548
+ /**
6549
+ * Each deployed stage's base domain — `domains` at the root of the config.
5078
6550
  *
5079
- * Maps deployment stages to base domains. The main frontend app
5080
- * gets the base domain, other apps get `{appName}.{baseDomain}`.
6551
+ * A fact about the deployment rather than the platform, so every target reads
6552
+ * it. The root site answers on the base domain; every other surface on
6553
+ * `{subdomain}.{domain}`, where the subdomain is the construct's own
6554
+ * `subdomain`, or its id kebab-cased.
5081
6555
  *
5082
6556
  * @example
5083
6557
  * ```ts
5084
- * domains: {
5085
- * development: 'dev.myapp.com',
5086
- * staging: 'staging.myapp.com',
5087
- * production: 'myapp.com',
5088
- * }
6558
+ * domains: { production: 'myapp.com', staging: 'staging.myapp.com' },
5089
6559
  *
5090
- * // Result for production stage:
5091
- * // - web (main frontend): myapp.com
5092
- * // - api: api.myapp.com
5093
- * // - auth: auth.myapp.com
6560
+ * // production:
6561
+ * // - new StaticSite('Web', { root: true }) → myapp.com
6562
+ * // - new RestApi('Api', { subdomain: 'api' }) → api.myapp.com
6563
+ * // - new RestApi('Webhooks', { … }) → webhooks.myapp.com
5094
6564
  * ```
5095
6565
  */
5096
- type DokployDomainsConfig = Record<string, string>;
6566
+ type DomainsConfig = Record<string, string>;
5097
6567
  /**
5098
6568
  * Per-app domain override configuration.
5099
6569
  *
@@ -5125,9 +6595,9 @@ type AppDomainConfig = string | Record<string, string>;
5125
6595
  * ```ts
5126
6596
  * deploy: {
5127
6597
  * default: 'dokploy',
6598
+ * registry: 'ghcr.io/myorg',
5128
6599
  * dokploy: {
5129
6600
  * endpoint: 'https://dokploy.myserver.com',
5130
- * registry: 'ghcr.io/myorg',
5131
6601
  * },
5132
6602
  * }
5133
6603
  * ```
@@ -5136,12 +6606,12 @@ type AppDomainConfig = string | Record<string, string>;
5136
6606
  * ```ts
5137
6607
  * deploy: {
5138
6608
  * default: 'dokploy',
6609
+ * registry: 'ghcr.io/myorg',
5139
6610
  * dokploy: {
5140
6611
  * endpoints: {
5141
6612
  * development: 'https://dev-dokploy.myserver.com',
5142
6613
  * production: 'https://dokploy.myserver.com',
5143
6614
  * },
5144
- * registry: 'ghcr.io/myorg',
5145
6615
  * },
5146
6616
  * }
5147
6617
  * ```
@@ -5151,16 +6621,263 @@ interface DokployWorkspaceConfig {
5151
6621
  endpoint?: string;
5152
6622
  /** Per-stage Dokploy API endpoints (overrides endpoint) */
5153
6623
  endpoints?: Record<string, string>;
5154
- /** Container registry for Docker images (e.g., 'ghcr.io/myorg') */
5155
- registry?: string;
5156
6624
  /** Registry ID in Dokploy (auto-configured) */
5157
6625
  registryId?: string;
6626
+ /** Dokploy's own backup schedule for the stage's Postgres, to an S3 destination. */
6627
+ backups?: DokployBackupsConfig;
6628
+ /** How a release is waited for and checked before it counts as live. */
6629
+ verify?: DokployVerifyConfig;
6630
+ }
6631
+ /**
6632
+ * How a Dokploy release is waited for and checked.
6633
+ *
6634
+ * A release counts once Dokploy's deployment has finished and the app has
6635
+ * answered its health route `healthyAfter` times in a row. One that does not
6636
+ * is rolled back.
6637
+ */
6638
+ interface DokployVerifyConfig {
6639
+ /** How long Dokploy may take to finish a deployment. Default 10 minutes. */
6640
+ deploymentTimeoutMs?: number;
6641
+ /**
6642
+ * The path each backend is checked on, under its domain. Default
6643
+ * `/health`, which every production server build serves. A site is
6644
+ * checked at `/`.
6645
+ */
6646
+ healthCheckPath?: string;
6647
+ /** Consecutive 2xx answers that make an app healthy. Default 3. */
6648
+ healthyAfter?: number;
6649
+ /** Between health checks, and the first wait between polls. Default 2s. */
6650
+ intervalMs?: number;
6651
+ /** How long an app may take to become healthy. Default 5 minutes. */
6652
+ healthTimeoutMs?: number;
6653
+ }
6654
+ /**
6655
+ * The `compose` target's own settings — `deploy.compose`. Read by `gkm
6656
+ * compose` and `gkm deploy --target compose` only; the Dokploy target never
6657
+ * consults it.
6658
+ *
6659
+ * @example
6660
+ * ```ts
6661
+ * deploy: { compose: { proxy: 'traefik' } }
6662
+ * ```
6663
+ */
6664
+ interface ComposeWorkspaceConfig<S extends string = string> {
6665
+ /**
6666
+ * What serves a stage's stack: `'caddy'` (the default) — the stack's own
6667
+ * Caddy on 80/443 — or `'traefik'`, the machine's shared Traefik edge,
6668
+ * which every stack registers its routes with.
6669
+ *
6670
+ * One value applies to every deployed stage; the local stage stays on
6671
+ * Caddy then. A map sets each stage it names, the local stage included,
6672
+ * so the local stack runs behind a Traefik edge on this machine — the
6673
+ * path the deployed stages take — only when the map names it.
6674
+ *
6675
+ * ```ts
6676
+ * proxy: 'traefik' // every deployed stage; local stays on Caddy
6677
+ * proxy: { development: 'traefik', production: 'traefik' }
6678
+ * ```
6679
+ */
6680
+ proxy?: ComposeProxy | StageMap<S, ComposeProxy>;
6681
+ /**
6682
+ * A stage's own certificate, by stage: a PEM certificate (with its chain)
6683
+ * and its key, relative to the workspace root or absolute. Either proxy
6684
+ * serves it, on any stage. Without one, a deployed stage's comes from
6685
+ * Let's Encrypt and the local stage's from gkm's local CA (`gkm trust`).
6686
+ *
6687
+ * ```ts
6688
+ * tls: { production: { certFile: 'certs/origin.pem', keyFile: 'certs/origin.key' } }
6689
+ * tls: {
6690
+ * development: {
6691
+ * certFile: 'certs/dev.pem',
6692
+ * keyFile: 'certs/dev-key.pem',
6693
+ * caFile: 'certs/rootCA.pem',
6694
+ * },
6695
+ * }
6696
+ * ```
6697
+ */
6698
+ tls?: StageMap<S, ComposeTlsConfig>;
6699
+ /**
6700
+ * Each deployed stage's server: the SSH login gkm drives its Docker
6701
+ * engine with (`DOCKER_HOST=ssh://user@host`). gkm runs where the deploy
6702
+ * starts — a CI runner, a laptop — and never on the server, which holds
6703
+ * Docker and this login and no cloud credentials. The host defaults to
6704
+ * the stage's `GKM_SERVER_IPV4` secret. Every deployed stage needs one;
6705
+ * the local stage runs on this machine's Docker.
6706
+ *
6707
+ * ```ts
6708
+ * server: { production: { user: 'deploy' } }
6709
+ * server: { staging: { user: 'deploy', host: 'staging.example.com', port: 2222 } }
6710
+ * ```
6711
+ */
6712
+ server?: StageMap<S, ComposeServerConfig>;
6713
+ }
6714
+ /** A deployed stage's server — `deploy.compose.server.<stage>`. */
6715
+ interface ComposeServerConfig {
6716
+ /** The SSH user, in the server's `docker` group. */
6717
+ user: string;
6718
+ /** The host to SSH to. Default: the stage's `GKM_SERVER_IPV4` secret. */
6719
+ host?: string;
6720
+ /** The SSH port. Default 22. */
6721
+ port?: number;
6722
+ }
6723
+ /** The proxies a compose stack can be served by — `deploy.compose.proxy`. */
6724
+ type ComposeProxy = 'caddy' | 'traefik';
6725
+ /** A stage's own certificate — `deploy.compose.tls.<stage>`. */
6726
+ interface ComposeTlsConfig {
6727
+ certFile: string;
6728
+ keyFile: string;
6729
+ /**
6730
+ * The root the certificate chains to, PEM, when no public CA issued it —
6731
+ * an mkcert root, a company CA. gkm's check after a start trusts it; on
6732
+ * the local stage the stack's containers are handed it too
6733
+ * (`NODE_EXTRA_CA_CERTS`). Without it, the check trusts what Node does by
6734
+ * default: its bundled roots, and `NODE_EXTRA_CA_CERTS` where it is set.
6735
+ */
6736
+ caFile?: string;
6737
+ }
6738
+ /**
6739
+ * Where one stage's telemetry goes, and how much of it — `deploy.telemetry`,
6740
+ * by stage.
6741
+ *
6742
+ * What is emitted is the application's (the `Telemetry` construct); where it
6743
+ * goes is this. A server target runs the self-hosted provider when a stage
6744
+ * names nothing; AWS has none, so a deployed AWS stage that uses telemetry
6745
+ * names a provider. `false` sends nothing. The local stage ignores this: `gkm
6746
+ * dev` and `gkm compose` on it always run OpenObserve, at 100%.
6747
+ *
6748
+ * @example
6749
+ * ```ts
6750
+ * telemetry: {
6751
+ * staging: 'self-hosted',
6752
+ * production: { provider: 'self-hosted', retentionDays: 14, sampleRate: 0.1 },
6753
+ * preview: { provider: 'otlp', endpoint: 'https://otlp.example.com', sampleRate: 0.5 },
6754
+ * scratch: false,
6755
+ * }
6756
+ * ```
6757
+ */
6758
+ type StageTelemetryConfig = 'self-hosted' | SelfHostedTelemetryConfig | OtlpTelemetryConfig | false;
6759
+ /**
6760
+ * What backs one deployed stage's buckets — `deploy.objects`, by stage.
6761
+ *
6762
+ * - `'external'` (the default) — the stage's secrets hold each bucket's URL,
6763
+ * set by you: S3, R2, any S3-compatible store.
6764
+ * - `{ provider: 's3' }` — every deploy of the stage creates (or repairs)
6765
+ * each bucket, its IAM user and key in the stage's AWS account, and writes
6766
+ * the bucket's URL into the stage's secrets, before its checks.
6767
+ * - `false` — the stage has no object storage; a bucket on it is refused.
6768
+ *
6769
+ * The local stage ignores this: `gkm dev` runs MinIO for every bucket.
6770
+ *
6771
+ * @example
6772
+ * ```ts
6773
+ * objects: {
6774
+ * production: { provider: 's3', region: 'eu-west-1', versioning: true },
6775
+ * staging: 'external',
6776
+ * }
6777
+ * ```
6778
+ */
6779
+ type StageObjectsConfig = 'external' | S3ObjectsConfig | false;
6780
+ /**
6781
+ * What receives one deployed stage's inboxes — `deploy.inbox`, by stage:
6782
+ *
6783
+ * - `{ provider: 'ses' }` — the deploy creates each inbox in the stage's AWS
6784
+ * account: its own bucket and topic, the domain's SES identity and MX
6785
+ * records, and a receipt rule in the region's active rule set.
6786
+ * - `'external'` — the default: the stage's secrets hold each inbox's keys.
6787
+ * - `false` — the stage receives no mail; an inbox on it is refused.
6788
+ *
6789
+ * Every local stage receives through Mailpit, whatever this says.
6790
+ *
6791
+ * @example
6792
+ * ```ts
6793
+ * inbox: { production: { provider: 'ses', region: 'eu-west-1' } }
6794
+ * ```
6795
+ */
6796
+ type StageInboxConfig = 'external' | SesInboxConfig | false;
6797
+ /**
6798
+ * One deployed compose stage's backups — `deploy.backups`, by stage.
6799
+ *
6800
+ * A stage that runs Postgres is backed up whether it names one or not: every
6801
+ * day at 02:00 UTC, each backup kept 30 days, in the project bucket. An
6802
+ * entry changes when (`every`, or a five-field UTC `cron`, at most hourly)
6803
+ * and for how long (`keep`); `false` takes none, and deletes nothing.
6804
+ *
6805
+ * @example
6806
+ * ```ts
6807
+ * backups: {
6808
+ * production: { every: '6h', keep: '30d' },
6809
+ * staging: { cron: '30 3 * * *', keep: '7d' },
6810
+ * preview: false,
6811
+ * }
6812
+ * ```
6813
+ */
6814
+ type StageBackupsConfig = false | {
6815
+ /** `'6h'`, `'1d'` — counted from 02:00 UTC. At least `'1h'`. */
6816
+ every?: string;
6817
+ /** Five fields, in UTC: `'0 *\/6 * * *'`. */
6818
+ cron?: string;
6819
+ /** How long a backup is kept: `'30d'`. */
6820
+ keep?: string;
6821
+ };
6822
+ /** `objects: { provider: 's3' }` — a bucket per construct in the stage's account. */
6823
+ interface S3ObjectsConfig {
6824
+ provider: 's3';
6825
+ /**
6826
+ * Where the buckets are created. Defaults to the secrets store's region,
6827
+ * then `AWS_REGION`.
6828
+ */
6829
+ region?: string;
6830
+ /** Keep previous versions of every object. Defaults to the construct's own `versioned`. */
6831
+ versioning?: boolean;
6832
+ /**
6833
+ * Serve each file server through a CDN on `<fileserver>.<domain>`: a
6834
+ * CloudFront distribution reading the bucket, its certificate and its DNS
6835
+ * records, all created by the deploy. On by default, which needs the
6836
+ * stage to have a domain; `false` serves from the bucket's own endpoint.
6837
+ */
6838
+ cdn?: boolean;
6839
+ }
6840
+ /** Shared by every provider. */
6841
+ interface TelemetryProviderConfig {
6842
+ /**
6843
+ * The fraction of traces kept, decided where a trace starts and followed
6844
+ * by every service it reaches (`parentbased_traceidratio`). Logs are not
6845
+ * sampled. 0 to 1; default 1.
6846
+ */
6847
+ sampleRate?: number;
6848
+ }
6849
+ /**
6850
+ * The target runs the collector and its UI: OpenObserve, in a compose stack,
6851
+ * reached through an SSH tunnel by default.
6852
+ */
6853
+ interface SelfHostedTelemetryConfig extends TelemetryProviderConfig {
6854
+ provider: 'self-hosted';
6855
+ /**
6856
+ * The port it is published on, on 127.0.0.1 only — reached from another
6857
+ * machine through an SSH tunnel. Default 5080.
6858
+ */
6859
+ port?: number;
6860
+ /**
6861
+ * How many days of data it keeps (OpenObserve's
6862
+ * `ZO_COMPACT_DATA_RETENTION_DAYS`). At least 3; default 30.
6863
+ */
6864
+ retentionDays?: number;
5158
6865
  /**
5159
- * Stage-based domain configuration.
5160
- * The main frontend app gets the base domain.
5161
- * Other apps get {appName}.{baseDomain} by default.
6866
+ * Serve it on `logs.<stage domain>` through the stack's proxy, to these
6867
+ * addresses only (IPs or CIDRs), instead of on a loopback port. Every
6868
+ * other address is answered 403.
5162
6869
  */
5163
- domains?: DokployDomainsConfig;
6870
+ public?: {
6871
+ allow: string[];
6872
+ };
6873
+ }
6874
+ /** Any OTLP/HTTP endpoint — a collector, a vendor's ingest. */
6875
+ interface OtlpTelemetryConfig extends TelemetryProviderConfig {
6876
+ provider: 'otlp';
6877
+ /** The OTLP/HTTP base URL; `/v1/traces` and `/v1/logs` are added to it. */
6878
+ endpoint: string;
6879
+ /** Headers sent with every export — `{ 'x-team': 'shop' }`. */
6880
+ headers?: Record<string, string>;
5164
6881
  }
5165
6882
  /**
5166
6883
  * Deployment configuration for the workspace.
@@ -5172,37 +6889,79 @@ interface DokployWorkspaceConfig {
5172
6889
  * default: 'dokploy',
5173
6890
  * }
5174
6891
  *
5175
- * // Full configuration with DNS and backups
6892
+ * // Full configuration with backups (domains and dns are at the root)
5176
6893
  * deploy: {
5177
6894
  * default: 'dokploy',
6895
+ * registry: 'ghcr.io/myorg',
5178
6896
  * dokploy: {
5179
6897
  * endpoint: 'https://dokploy.myserver.com',
5180
6898
  * projectId: 'proj_abc123',
5181
- * registry: 'ghcr.io/myorg',
5182
- * domains: {
5183
- * production: 'myapp.com',
5184
- * },
5185
- * },
5186
- * dns: {
5187
- * provider: 'hostinger',
5188
- * domain: 'myapp.com',
5189
- * },
5190
- * backups: {
5191
- * type: 's3',
5192
- * region: 'us-east-1',
6899
+ * backups: { type: 's3', region: 'us-east-1' },
5193
6900
  * },
5194
6901
  * }
5195
6902
  * ```
5196
6903
  */
5197
- interface DeployConfig {
6904
+ interface DeployConfig<S extends string = string> {
5198
6905
  /** Default deploy target for all apps (default: 'dokploy') */
5199
- default?: DeployTarget;
6906
+ default?: DeployTargetName;
6907
+ /**
6908
+ * Targets that do not ship with the CLI, by the name `default` (or an
6909
+ * app's `deploy`) uses: a package whose default export is the target, a
6910
+ * target object, or either with its options.
6911
+ *
6912
+ * ```ts
6913
+ * targets: {
6914
+ * acme: '@acme/gkm-target',
6915
+ * fly: ['@acme/gkm-fly', { org: 'acme' }],
6916
+ * local: defineTarget({ … }),
6917
+ * }
6918
+ * ```
6919
+ *
6920
+ * A package is never guessed from a name: it is installed and listed here.
6921
+ * A built-in's name cannot be taken.
6922
+ */
6923
+ targets?: Record<string, DeployTargetEntry>;
6924
+ /**
6925
+ * Whose deploy this is, on a target shared with other workspaces — an
6926
+ * organisation or a team, lowercase `[a-z0-9-]`. Two workspaces with the
6927
+ * same name deploying to one Dokploy are kept apart by it: it is in the
6928
+ * project's ownership marker, the image path
6929
+ * (`<registry>/<namespace>/<project>-<app>`) and every resource name.
6930
+ *
6931
+ * Defaults to the kebab-cased workspace name, which adds nothing to the
6932
+ * names a workspace was already deployed under.
6933
+ */
6934
+ namespace?: string;
6935
+ /**
6936
+ * The container registry the apps' images are pushed to and pulled from,
6937
+ * whatever the target — `ghcr.io/myorg`. An image is
6938
+ * `<registry>/<namespace>/<project>-<app>:<tag>`.
6939
+ */
6940
+ registry?: string;
5200
6941
  /** Dokploy-specific configuration */
5201
6942
  dokploy?: DokployWorkspaceConfig;
5202
- /** DNS configuration for automatic record creation */
5203
- dns?: DnsConfig;
5204
- /** Backup destination configuration for database services */
5205
- backups?: BackupsConfig;
6943
+ /** What the `compose` target runs beside the apps — see {@link ComposeWorkspaceConfig}. */
6944
+ compose?: ComposeWorkspaceConfig<S>;
6945
+ /**
6946
+ * Where each deployed stage's telemetry goes — see
6947
+ * {@link StageTelemetryConfig}.
6948
+ */
6949
+ telemetry?: StageMap<S, StageTelemetryConfig>;
6950
+ /**
6951
+ * What backs each deployed stage's buckets — the `objects` kind that
6952
+ * `ObjectStorage` and `FileServer` produce. See {@link StageObjectsConfig}.
6953
+ */
6954
+ objects?: StageMap<S, StageObjectsConfig>;
6955
+ /**
6956
+ * What receives each deployed stage's inboxes — the `inbox` kind `Inbox`
6957
+ * produces. See {@link StageInboxConfig}.
6958
+ */
6959
+ inbox?: StageMap<S, StageInboxConfig>;
6960
+ /**
6961
+ * When each deployed compose stage's databases are backed up, and how
6962
+ * long a backup is kept — see {@link StageBackupsConfig}.
6963
+ */
6964
+ backups?: StageMap<S, StageBackupsConfig>;
5206
6965
  }
5207
6966
  /**
5208
6967
  * Models package configuration for shared schemas.
@@ -5288,7 +7047,7 @@ interface StagesConfig {
5288
7047
  *
5289
7048
  * Configures how secrets are encrypted for deployment.
5290
7049
  * Secrets are stored encrypted in `.gkm/secrets/{stage}.json`
5291
- * with keys stored separately in `~/.gkm/{project}/{stage}.key`.
7050
+ * with keys stored separately in `~/.gkm/keys/{namespace}/{project}/{stage}.key`.
5292
7051
  *
5293
7052
  * @example
5294
7053
  * ```ts
@@ -5302,6 +7061,19 @@ interface StagesConfig {
5302
7061
  interface SecretsConfig {
5303
7062
  /** Enable encrypted secrets (default: true) */
5304
7063
  enabled?: boolean;
7064
+ /**
7065
+ * Where deployed stages' secrets live, so a deploy can reach them from
7066
+ * anywhere: `'file'` (default — the encrypted `.gkm/secrets/<stage>.json`,
7067
+ * which cannot serve CI while `.gkm/` is gitignored), `{ provider: 's3',
7068
+ * region?, bucket?, prefix? }` (each stage's secrets in one object in the
7069
+ * project bucket beside the deploy state, SSE-S3 and versioned, no size
7070
+ * limit; region and prefix default to an S3 `state`'s), `{ provider: 'ssm',
7071
+ * region }` (each stage's secrets in an SSM parameter in its own AWS
7072
+ * account, up to 8 KB), `{ provider: 'secrets-manager', region, kmsKeyId? }`
7073
+ * (a Secrets Manager secret in its own account, up to 64 KB), or any object
7074
+ * implementing `SecretsStore`. The local stage always uses the file.
7075
+ */
7076
+ store?: SecretsStoreConfig;
5305
7077
  /** Encryption algorithm (default: 'aes-256-gcm') */
5306
7078
  algorithm?: string;
5307
7079
  /** Key derivation function (default: 'scrypt') */
@@ -5368,7 +7140,7 @@ interface AppConfigBase {
5368
7140
  * Overrides `deploy.default` for this specific app.
5369
7141
  * @example 'dokploy', 'vercel'
5370
7142
  */
5371
- deploy?: DeployTarget;
7143
+ deploy?: DeployTargetName;
5372
7144
  /**
5373
7145
  * Constructs glob pattern — one glob, every kind.
5374
7146
  *
@@ -5419,23 +7191,16 @@ interface AppConfigBase {
5419
7191
  * @example './src/config/logger'
5420
7192
  */
5421
7193
  logger?: string;
5422
- /** Provider configuration (AWS, Docker, etc.) */
5423
- providers?: ProvidersConfig;
5424
7194
  /**
5425
7195
  * Server lifecycle hooks.
5426
7196
  * @example { beforeSetup: './src/hooks/setup.ts' }
5427
7197
  */
5428
7198
  hooks?: HooksConfig;
5429
7199
  /**
5430
- * Telescope debugging dashboard configuration.
7200
+ * Telescope request recording configuration.
5431
7201
  * @example true, './src/config/telescope', { enabled: true, path: '/__telescope' }
5432
7202
  */
5433
7203
  telescope?: string | boolean | TelescopeConfig;
5434
- /**
5435
- * Studio admin panel configuration.
5436
- * @example true, './src/config/studio'
5437
- */
5438
- studio?: string | boolean | StudioConfig;
5439
7204
  /**
5440
7205
  * OpenAPI documentation configuration.
5441
7206
  * @example true, { output: './src/openapi.ts' }
@@ -5609,7 +7374,7 @@ type ConstrainedApps<TApps extends AppsRecord> = { [K in keyof TApps]: Omit<TApp
5609
7374
  * });
5610
7375
  * ```
5611
7376
  */
5612
- type WorkspaceInput<TApps extends AppsRecord> = {
7377
+ type WorkspaceInput<TApps extends AppsRecord, TDeployed extends string = string> = {
5613
7378
  /**
5614
7379
  * Where the workspace's own constructs live, relative to its root.
5615
7380
  *
@@ -5629,15 +7394,80 @@ type WorkspaceInput<TApps extends AppsRecord> = {
5629
7394
  apps?: ConstrainedApps<TApps>;
5630
7395
  /** Shared packages configuration */
5631
7396
  shared?: SharedConfig;
7397
+ /**
7398
+ * Each deployed stage's base domain — see {@link DomainsConfig}. A key that
7399
+ * is not a deployed stage is a type error.
7400
+ */
7401
+ domains?: DomainsInput<NoInfer<TDeployed>>;
7402
+ /**
7403
+ * Subdomains a wildcard site's tenants may never take, beyond every app's
7404
+ * own (which are derived from the constructs and never listed here): the
7405
+ * names no construct declares — `www`, `mail`, `status`, `docs`.
7406
+ *
7407
+ * Listing an app's own subdomain is refused at load: the construct
7408
+ * already protects it.
7409
+ */
7410
+ protectedSubdomains?: readonly string[];
7411
+ /**
7412
+ * Each root domain's DNS provider, and how its hosts are pointed at a
7413
+ * compose stage's server (`records`).
7414
+ */
7415
+ dns?: DnsInput<NoInfer<TDeployed>>;
5632
7416
  /** Deployment configuration */
5633
- deploy?: DeployConfig;
5634
- /** The project's stages: which one is local, which deploy */
5635
- stages: StagesConfig;
7417
+ deploy?: DeployConfig<NoInfer<TDeployed>>;
7418
+ /**
7419
+ * The project's stages: which one is local, which deploy. The deployed
7420
+ * stages type every per-stage map — `domains`, `deploy.objects`,
7421
+ * `deploy.telemetry`, `deploy.compose.proxy`/`tls`.
7422
+ */
7423
+ stages: StagesInput<TDeployed>;
5636
7424
  /** Encrypted secrets configuration */
5637
7425
  secrets?: SecretsConfig;
5638
7426
  /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
5639
7427
  state?: StateConfig;
7428
+ /** How `gkm dev` is reached: the discovery endpoint's port and origins */
7429
+ dev?: DevConfig;
5640
7430
  };
7431
+ /** `stages`, as `defineWorkspace` infers it: each deployed stage literally. */
7432
+ interface StagesInput<TDeployed extends string = string> {
7433
+ local: string;
7434
+ deployed: readonly TDeployed[];
7435
+ protected?: readonly NoInfer<TDeployed>[];
7436
+ }
7437
+ /**
7438
+ * How `gkm dev` is reached from outside the apps it runs.
7439
+ */
7440
+ interface DevConfig {
7441
+ /**
7442
+ * Browser origins allowed to read the discovery endpoint — and this
7443
+ * workspace in it — e.g. `['https://console.example.com']`.
7444
+ *
7445
+ * Empty by default: any page the developer visits can send requests to a
7446
+ * loopback port, so none is answered unless it is listed here. A request
7447
+ * with no `Origin` (curl, a local process) still needs the session token.
7448
+ */
7449
+ allowedOrigins?: string[];
7450
+ /**
7451
+ * The loopback port the discovery endpoint listens on. Defaults to 4983;
7452
+ * `GKM_DISCOVERY_PORT` overrides it.
7453
+ */
7454
+ discoveryPort?: number;
7455
+ }
7456
+ /**
7457
+ * How `gkm test` builds what a feature test is handed.
7458
+ */
7459
+ interface TestConfig {
7460
+ /**
7461
+ * The folder of test factories, relative to the root.
7462
+ *
7463
+ * Defaults to `test/factories`. A factory belongs to a database, not to an
7464
+ * app, so each file is named after one — `database.ts` for `Database`,
7465
+ * `auth-database.ts` for `AuthDatabase` — and exports `createFactory(db)`.
7466
+ * Every app's harness builds them on each test's transactions, and a test is
7467
+ * handed them as `factories`, keyed by service name.
7468
+ */
7469
+ factories?: string;
7470
+ }
5641
7471
  /**
5642
7472
  * Extract app names from apps record.
5643
7473
  */
@@ -5658,10 +7488,15 @@ type InferredWorkspaceConfig<TApps extends AppsRecord> = {
5658
7488
  dependencies?: InferAppNames<TApps>[];
5659
7489
  }; };
5660
7490
  shared?: SharedConfig;
7491
+ domains?: DomainsConfig;
7492
+ protectedSubdomains?: readonly string[];
7493
+ dns?: WorkspaceDnsConfig;
5661
7494
  deploy?: DeployConfig;
5662
7495
  stages: StagesConfig;
5663
7496
  secrets?: SecretsConfig;
5664
7497
  state?: StateConfig;
7498
+ test?: TestConfig;
7499
+ dev?: DevConfig;
5665
7500
  };
5666
7501
  /**
5667
7502
  * Workspace configuration for multi-app monorepos.
@@ -5708,17 +7543,20 @@ type InferredWorkspaceConfig<TApps extends AppsRecord> = {
5708
7543
  * },
5709
7544
  * },
5710
7545
  *
7546
+ * // Each deployed stage's base domain, and who hosts its DNS
7547
+ * domains: {
7548
+ * production: 'myapp.com',
7549
+ * staging: 'staging.myapp.com',
7550
+ * },
7551
+ * dns: { 'myapp.com': { provider: 'godaddy' } },
7552
+ *
5711
7553
  * // Deployment configuration
5712
7554
  * deploy: {
5713
7555
  * default: 'dokploy',
7556
+ * registry: 'ghcr.io/myorg',
5714
7557
  * dokploy: {
5715
7558
  * endpoint: 'https://dokploy.myserver.com',
5716
7559
  * projectId: 'proj_abc123',
5717
- * registry: 'ghcr.io/myorg',
5718
- * domains: {
5719
- * production: 'myapp.com',
5720
- * staging: 'staging.myapp.com',
5721
- * },
5722
7560
  * },
5723
7561
  * },
5724
7562
  *
@@ -5746,6 +7584,12 @@ interface WorkspaceConfig {
5746
7584
  apps?: Record<string, AppConfig>;
5747
7585
  /** Shared packages configuration */
5748
7586
  shared?: SharedConfig;
7587
+ /** Each deployed stage's base domain — see {@link DomainsConfig}. */
7588
+ domains?: DomainsConfig;
7589
+ /** Subdomains no tenant may take — see `WorkspaceInput`. */
7590
+ protectedSubdomains?: readonly string[];
7591
+ /** Each root domain's DNS provider — see {@link WorkspaceDnsConfig}. */
7592
+ dns?: WorkspaceDnsConfig;
5749
7593
  /** Default deployment configuration */
5750
7594
  deploy?: DeployConfig;
5751
7595
  /** The project's stages: which one is local, which deploy */
@@ -5754,6 +7598,10 @@ interface WorkspaceConfig {
5754
7598
  secrets?: SecretsConfig;
5755
7599
  /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
5756
7600
  state?: StateConfig;
7601
+ /** What `gkm test` hands a feature test: where the factories are. */
7602
+ test?: TestConfig;
7603
+ /** How `gkm dev` is reached: the discovery endpoint's port and origins. */
7604
+ dev?: DevConfig;
5757
7605
  }
5758
7606
  /**
5759
7607
  * Normalized app configuration with resolved defaults.
@@ -5770,6 +7618,11 @@ interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
5770
7618
  * and that is `domain`.
5771
7619
  */
5772
7620
  root?: boolean;
7621
+ /**
7622
+ * The label this app answers on under a stage's domain, carried from its
7623
+ * declaration — `api` for `api.myapp.com`. Absent, the app's own name.
7624
+ */
7625
+ subdomain?: string;
5773
7626
  /** App type (always defined after normalization) */
5774
7627
  type: 'backend' | 'web' | 'mobile';
5775
7628
  /** Path to the app */
@@ -5779,7 +7632,7 @@ interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
5779
7632
  /** Resolved dependencies array (empty array if none) */
5780
7633
  dependencies: string[];
5781
7634
  /** Resolved deploy target (app.deploy > deploy.default > 'dokploy') */
5782
- resolvedDeployTarget: DeployTarget;
7635
+ resolvedDeployTarget: DeployTargetName;
5783
7636
  /** Entry file path for non-gkm apps */
5784
7637
  entry?: string;
5785
7638
  /** Framework for the app */
@@ -5809,6 +7662,12 @@ interface NormalizedWorkspace {
5809
7662
  constructs?: Routes;
5810
7663
  /** Normalized app configurations */
5811
7664
  apps: Record<string, NormalizedAppConfig>;
7665
+ /** Each deployed stage's base domain */
7666
+ domains?: DomainsConfig;
7667
+ /** Subdomains no tenant may take, beyond every app's own */
7668
+ protectedSubdomains?: readonly string[];
7669
+ /** Each root domain's DNS provider */
7670
+ dns?: WorkspaceDnsConfig;
5812
7671
  /** Deploy configuration (empty object if not specified) */
5813
7672
  deploy: DeployConfig;
5814
7673
  /** Shared packages configuration (empty object if not specified) */
@@ -5819,6 +7678,10 @@ interface NormalizedWorkspace {
5819
7678
  secrets: SecretsConfig;
5820
7679
  /** State provider configuration (undefined = local filesystem) */
5821
7680
  state?: StateConfig;
7681
+ /** What `gkm test` hands a feature test (empty object if not specified) */
7682
+ test: TestConfig;
7683
+ /** How `gkm dev` is reached, when configured */
7684
+ dev?: DevConfig;
5822
7685
  }
5823
7686
  /**
5824
7687
  * Result of loading and processing a configuration.
@@ -5838,6 +7701,11 @@ interface LoadedConfig {
5838
7701
  * two chances to disagree. Absent when the workspace declares no constructs.
5839
7702
  */
5840
7703
  manifest?: ConstructManifest;
7704
+ /**
7705
+ * The files each Worker's crons, queues and subscribers are declared in,
7706
+ * read in the same discovery — what says which app a worker is built from.
7707
+ */
7708
+ background?: Record<string, string[]>;
5841
7709
  }
5842
7710
  /**
5843
7711
  * Type guard to check if a config is a WorkspaceConfig.
@@ -5854,43 +7722,7 @@ interface LoadedConfig {
5854
7722
  declare function isWorkspaceConfig(config: GkmConfig | WorkspaceConfig): config is WorkspaceConfig;
5855
7723
  //#endregion
5856
7724
  //#region src/types.d.ts
5857
- interface PartitionedRoutes {
5858
- paths: string | string[];
5859
- partition: (filepath: string) => string;
5860
- }
5861
- type Routes = string | string[] | PartitionedRoutes;
5862
- interface ProviderConfig {
5863
- enabled?: boolean;
5864
- outputDir?: string;
5865
- }
5866
- interface AWSApiGatewayConfig extends ProviderConfig {}
5867
- interface AWSLambdaConfig extends ProviderConfig {}
5868
- interface ProductionConfig {
5869
- /** Enable production mode (default: false) */
5870
- enabled?: boolean;
5871
- /** Bundle server into single file (default: true) */
5872
- bundle?: boolean;
5873
- /** Minify bundled output (default: true) */
5874
- minify?: boolean;
5875
- /** Health check endpoint path (default: '/health') */
5876
- healthCheck?: string;
5877
- /** Enable graceful shutdown handling (default: true) */
5878
- gracefulShutdown?: boolean;
5879
- /** Packages to exclude from bundling (default: []) */
5880
- external?: string[];
5881
- /** Include subscribers in production build (default: 'exclude' for serverless) */
5882
- subscribers?: 'include' | 'exclude';
5883
- /** Include OpenAPI spec in production (default: false) */
5884
- openapi?: boolean;
5885
- /**
5886
- * Enable build-time optimized handler generation (default: true)
5887
- * Generates specialized handlers based on endpoint tier:
5888
- * - minimal: Near-raw-Hono performance for simple endpoints
5889
- * - standard: Optimized handlers for auth/services
5890
- * - full: Uses HonoEndpoint.addRoutes for complex endpoints
5891
- */
5892
- optimizedHandlers?: boolean;
5893
- }
7725
+ type Routes = string | string[];
5894
7726
  /**
5895
7727
  * Where a declared cache actually lives.
5896
7728
  *
@@ -5907,8 +7739,12 @@ interface ProductionConfig {
5907
7739
  * - `db` — a table in the database the app already declared. No infrastructure
5908
7740
  * at all, and the same relationship pg-boss has to Postgres: it creates its
5909
7741
  * own table on first use and needs a declared database to live in.
7742
+ * - `redis` — a Redis the stack runs beside the apps, on its network. It holds
7743
+ * *every* declared cache, one declared from a database included, so the
7744
+ * cache never competes with the database for its connections. Only the
7745
+ * compose target selects it today (`gkm compose`).
5910
7746
  */
5911
- type CacheBackend = 'upstash' | 'elasticache' | 'db';
7747
+ type CacheBackend = 'upstash' | 'elasticache' | 'db' | 'redis';
5912
7748
  /**
5913
7749
  * Who delivers a declared app's mail.
5914
7750
  *
@@ -5935,17 +7771,11 @@ interface DockerConfig {
5935
7771
  registry?: string;
5936
7772
  /** Docker image name (default: derived from package.json name) */
5937
7773
  imageName?: string;
5938
- /** Base Docker image (default: 'node:22-alpine') */
7774
+ /** Base Docker image (default: 'node:22.23.4-alpine', a Node security release) */
5939
7775
  baseImage?: string;
5940
7776
  /** Container port (default: 3000) */
5941
7777
  port?: number;
5942
7778
  }
5943
- interface ServerConfig extends ProviderConfig {
5944
- enableOpenApi?: boolean;
5945
- port?: number;
5946
- /** Production build configuration */
5947
- production?: ProductionConfig;
5948
- }
5949
7779
  type Runtime = 'node' | 'bun';
5950
7780
  interface TelescopeConfig {
5951
7781
  /** Enable/disable telescope (default: true in development) */
@@ -5963,14 +7793,6 @@ interface TelescopeConfig {
5963
7793
  /** Enable WebSocket for real-time updates (default: true, requires @hono/node-ws for Node.js) */
5964
7794
  websocket?: boolean;
5965
7795
  }
5966
- interface StudioConfig {
5967
- /** Enable/disable studio (default: true in development) */
5968
- enabled?: boolean;
5969
- /** Path prefix for studio UI (default: /__studio) */
5970
- path?: string;
5971
- /** Schema to introspect (default: 'public') */
5972
- schema?: string;
5973
- }
5974
7796
  interface OpenApiConfig {
5975
7797
  /** Enable OpenAPI generation (default: true) */
5976
7798
  enabled?: boolean;
@@ -6008,34 +7830,6 @@ interface HooksConfig {
6008
7830
  */
6009
7831
  server?: string;
6010
7832
  }
6011
- /** Dokploy deployment configuration */
6012
- interface DokployProviderConfig {
6013
- /** Dokploy API endpoint (e.g., 'https://dokploy.example.com') */
6014
- endpoint: string;
6015
- /** Project ID in Dokploy */
6016
- projectId: string;
6017
- /** Application ID in Dokploy */
6018
- applicationId: string;
6019
- /** Container registry (overrides docker.registry if set) */
6020
- registry?: string;
6021
- /** Registry ID in Dokploy (recommended for private registries) */
6022
- registryId?: string;
6023
- }
6024
- interface ProvidersConfig {
6025
- aws?: {
6026
- apiGateway?: {
6027
- v1?: boolean | AWSApiGatewayConfig;
6028
- v2?: boolean | AWSApiGatewayConfig;
6029
- };
6030
- lambda?: {
6031
- functions?: boolean | AWSLambdaConfig;
6032
- crons?: boolean | AWSLambdaConfig;
6033
- };
6034
- };
6035
- server?: boolean | ServerConfig;
6036
- /** Dokploy deployment configuration */
6037
- dokploy?: boolean | DokployProviderConfig;
6038
- }
6039
7833
  interface GkmConfig {
6040
7834
  /**
6041
7835
  * What this app is called, and therefore how everything it declares is named.
@@ -6057,6 +7851,12 @@ interface GkmConfig {
6057
7851
  name?: string;
6058
7852
  /** The project's stages: which one is local, which deploy */
6059
7853
  stages: StagesConfig;
7854
+ /** Encrypted secrets, and where deployed stages' secrets are stored */
7855
+ secrets?: SecretsConfig;
7856
+ /** What `gkm test` hands a feature test: where the factories are. */
7857
+ test?: TestConfig;
7858
+ /** How `gkm dev` is reached: the discovery endpoint's port and origins. */
7859
+ dev?: DevConfig;
6060
7860
  /**
6061
7861
  * Constructs glob pattern — one glob, every kind.
6062
7862
  *
@@ -6068,7 +7868,6 @@ interface GkmConfig {
6068
7868
  * @example './src/**\/*.ts'
6069
7869
  */
6070
7870
  constructs: Routes;
6071
- providers?: ProvidersConfig;
6072
7871
  /**
6073
7872
  * Server lifecycle hooks for customizing the Hono app.
6074
7873
  * Allows adding custom routes, middleware, error handlers, etc.
@@ -6087,16 +7886,6 @@ interface GkmConfig {
6087
7886
  * - A TelescopeConfig object for inline configuration
6088
7887
  */
6089
7888
  telescope?: string | boolean | TelescopeConfig;
6090
- /**
6091
- * Studio configuration for database browsing.
6092
- * Can be:
6093
- * - A string path to a module that exports a Studio instance (recommended)
6094
- * - A boolean to enable/disable with defaults
6095
- * - A StudioConfig object for inline configuration
6096
- *
6097
- * Requires a database connection configured via services.
6098
- */
6099
- studio?: string | boolean | StudioConfig;
6100
7889
  /**
6101
7890
  * OpenAPI generation configuration.
6102
7891
  * Can be:
@@ -6159,7 +7948,11 @@ interface GkmConfig {
6159
7948
  * a rename rather than a rewrite.
6160
7949
  */
6161
7950
  deploy?: DeployConfig;
7951
+ /** Each deployed stage's base domain — the same field a workspace has. */
7952
+ domains?: DomainsConfig;
7953
+ /** Each root domain's DNS provider — the same field a workspace has. */
7954
+ dns?: WorkspaceDnsConfig;
6162
7955
  }
6163
7956
  //#endregion
6164
- export { SUPPORTED_DEPLOY_TARGETS as A, WorkspaceInput as C, FrontendFramework as D, Framework as E, isPhase2DeployTarget as F, safeValidateWorkspaceConfig as I, validateWorkspaceConfig as L, formatValidationErrors as M, getDeployTargetError as N, MobileFramework as O, isDeployTargetSupported as P, WorkspaceConfig as S, BackendFramework as T, ModelsConfig as _, Routes as a, SecretsConfig as b, AppInput as c, DeployConfig as d, DeployTarget as f, LoadedConfig as g, InferredWorkspaceConfig as h, OpenApiConfig as i, WorkspaceConfigSchema as j, PHASE_2_DEPLOY_TARGETS as k, AppsRecord as l, InferAppNames as m, EmailBackend as n, AppConfig as o, DokployWorkspaceConfig as p, GkmConfig as r, AppConfigInput as s, CacheBackend as t, ConstrainedApps as u, NormalizedAppConfig as v, isWorkspaceConfig as w, SharedConfig as x, NormalizedWorkspace as y };
6165
- //# sourceMappingURL=types-C5ZNpUad.d.cts.map
7957
+ export { TargetOptions as $, BackendFramework as A, ReleasedImage as At, isPhase2DeployTarget as B, SandboxExecOptions as Bt, SecretsConfig as C, DiscoverOptions as Ct, WorkspaceConfig as D, StateLocked as Dt, StageTelemetryConfig as E, LocalStateInCi as Et, SUPPORTED_DEPLOY_TARGETS as F, DeployIdentity as Ft, DeployPhaseContext as G, GkmError as Gt, validateWorkspaceConfig as H, SandboxResult as Ht, WorkspaceConfigSchema as I, deployIdentity as It, DeployTarget as J, DeployRuntime as K, formatValidationErrors as L, SECRETS_DIR_ENV as Lt, FrontendFramework as M, GithubActor as Mt, MobileFramework as N, LocalActor as Nt, WorkspaceInput as O, StateStore as Ot, PHASE_2_DEPLOY_TARGETS as P, StageSecrets as Pt, TargetEvent as Q, getDeployTargetError as R, Sandbox as Rt, OtlpTelemetryConfig as S, ConstructsNotSerializable as St, SharedConfig as T, isDeclarable as Tt, AnyDeployTarget as U, SecretNameInvalid as Ut, safeValidateWorkspaceConfig as V, SandboxOutput as Vt, DeployFailure as W, confineCwd as Wt, DeployTargetEntry as X, DeployTargetCapabilities as Y, DeployTargetLogger as Z, InferredWorkspaceConfig as _, StoredCredentialsOptions as _t, Routes as a, DeployPhase as at, NormalizedAppConfig as b, ProviderKind as bt, AppInput as c, AppDeployResult as ct, ConstrainedApps as d, Credential as dt, TargetOptionsIssue as et, DeployConfig as f, CredentialKind as ft, InferAppNames as g, MissingCredential as gt, DokployWorkspaceConfig as h, CredentialRequest as ht, OpenApiConfig as i, DeployEventType as it, Framework as j, Actor as jt, isWorkspaceConfig as k, StateVersionConflict as kt, AppsRecord as l, DeployResult as lt, DevConfig as m, CredentialProvider as mt, EmailBackend as n, DeployEvent as nt, AppConfig as o, ResourceChange as ot, DeployTargetName as p, CredentialKinds as pt, DeploySecrets as q, GkmConfig as r, DeployEventError as rt, AppConfigInput as s, ResourceVia as st, CacheBackend as t, TargetOptionsSchema as tt, ComposeWorkspaceConfig as u, AwsCredential as ut, LoadedConfig as v, chainCredentials as vt, SelfHostedTelemetryConfig as w, discover as wt, NormalizedWorkspace as x, ConstructDiscoveryFailed as xt, ModelsConfig as y, storedCredentials as yt, isDeployTargetSupported as z, SandboxCwdEscape as zt };
7958
+ //# sourceMappingURL=types-DwQYpd_0.d.mts.map