@geekmidas/cli 10.0.0-alpha.14 → 10.0.0-alpha.140

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