@geekmidas/cli 10.0.0-alpha.17 → 10.0.0-alpha.171

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 (452) hide show
  1. package/README.md +323 -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-C1h_wExz.cjs +1098 -0
  7. package/dist/EndpointGenerator-C1h_wExz.cjs.map +1 -0
  8. package/dist/EndpointGenerator-CSKhAD6W.mjs +1039 -0
  9. package/dist/EndpointGenerator-CSKhAD6W.mjs.map +1 -0
  10. package/dist/GoDaddyProvider-Cs32wo6I.cjs +412 -0
  11. package/dist/GoDaddyProvider-Cs32wo6I.cjs.map +1 -0
  12. package/dist/GoDaddyProvider-D7CTqN0f.mjs +412 -0
  13. package/dist/GoDaddyProvider-D7CTqN0f.mjs.map +1 -0
  14. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-B_3Qs9mT.mjs} +23 -9
  15. package/dist/HostingerProvider-B_3Qs9mT.mjs.map +1 -0
  16. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-D0515Stf.cjs} +23 -9
  17. package/dist/HostingerProvider-D0515Stf.cjs.map +1 -0
  18. package/dist/LegacyStateStore-Bv_2L86H.cjs +124 -0
  19. package/dist/LegacyStateStore-Bv_2L86H.cjs.map +1 -0
  20. package/dist/LegacyStateStore-CUjKKENQ.mjs +124 -0
  21. package/dist/LegacyStateStore-CUjKKENQ.mjs.map +1 -0
  22. package/dist/LocalStateStore-DXuj1BDq.mjs +167 -0
  23. package/dist/LocalStateStore-DXuj1BDq.mjs.map +1 -0
  24. package/dist/LocalStateStore-PQ2qJ5VF.cjs +178 -0
  25. package/dist/LocalStateStore-PQ2qJ5VF.cjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-5xPn-p65.mjs +534 -0
  27. package/dist/OpenApiTsGenerator-5xPn-p65.mjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-CzrLGzC0.cjs +539 -0
  29. package/dist/OpenApiTsGenerator-CzrLGzC0.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-BGnOwqUp.mjs +223 -0
  35. package/dist/S3StateStore-BGnOwqUp.mjs.map +1 -0
  36. package/dist/S3StateStore-cmS6iUZn.cjs +222 -0
  37. package/dist/S3StateStore-cmS6iUZn.cjs.map +1 -0
  38. package/dist/SSMStateStore-BqXzPBbu.mjs +205 -0
  39. package/dist/SSMStateStore-BqXzPBbu.mjs.map +1 -0
  40. package/dist/SSMStateStore-BtNGbg8Z.cjs +204 -0
  41. package/dist/SSMStateStore-BtNGbg8Z.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-CfZWX0lT.mjs +783 -0
  43. package/dist/SubscriberGenerator-CfZWX0lT.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-DMi4siph.cjs +848 -0
  45. package/dist/SubscriberGenerator-DMi4siph.cjs.map +1 -0
  46. package/dist/add-DW2KLCY0.mjs +711 -0
  47. package/dist/add-DW2KLCY0.mjs.map +1 -0
  48. package/dist/add-Dp5xRn-u.cjs +713 -0
  49. package/dist/add-Dp5xRn-u.cjs.map +1 -0
  50. package/dist/appPorts-BoXMwolc.mjs +249 -0
  51. package/dist/appPorts-BoXMwolc.mjs.map +1 -0
  52. package/dist/appPorts-IW-OZmRi.cjs +296 -0
  53. package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
  54. package/dist/apps-DYGKg5SP.cjs +5535 -0
  55. package/dist/apps-DYGKg5SP.cjs.map +1 -0
  56. package/dist/apps-DrXwv-0A.mjs +4986 -0
  57. package/dist/apps-DrXwv-0A.mjs.map +1 -0
  58. package/dist/aws-C5LAU_Ii.mjs +97 -0
  59. package/dist/aws-C5LAU_Ii.mjs.map +1 -0
  60. package/dist/aws-DKC2m3sT.cjs +108 -0
  61. package/dist/aws-DKC2m3sT.cjs.map +1 -0
  62. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  63. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  64. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  65. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  66. package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  67. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  68. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  69. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  70. package/dist/backups/runner.cjs +519 -0
  71. package/dist/backups/runner.cjs.map +1 -0
  72. package/dist/backups/runner.d.cts +102 -0
  73. package/dist/backups/runner.d.cts.map +1 -0
  74. package/dist/backups/runner.d.mts +102 -0
  75. package/dist/backups/runner.d.mts.map +1 -0
  76. package/dist/backups/runner.mjs +506 -0
  77. package/dist/backups/runner.mjs.map +1 -0
  78. package/dist/{bundler-mjqGAvu1.cjs → bundler-BIfEe05e.cjs} +59 -14
  79. package/dist/bundler-BIfEe05e.cjs.map +1 -0
  80. package/dist/{bundler-mwH7WOb1.mjs → bundler-Swt8wHG9.mjs} +59 -14
  81. package/dist/bundler-Swt8wHG9.mjs.map +1 -0
  82. package/dist/cli-C9wdKQy_.mjs +80 -0
  83. package/dist/cli-C9wdKQy_.mjs.map +1 -0
  84. package/dist/cli-ohJToj0E.cjs +80 -0
  85. package/dist/cli-ohJToj0E.cjs.map +1 -0
  86. package/dist/compose-BLOnkeaJ.mjs +2432 -0
  87. package/dist/compose-BLOnkeaJ.mjs.map +1 -0
  88. package/dist/compose-Br3SQ2bW.cjs +3293 -0
  89. package/dist/compose-Br3SQ2bW.cjs.map +1 -0
  90. package/dist/compose-SNYBstbO.cjs +2929 -0
  91. package/dist/compose-SNYBstbO.cjs.map +1 -0
  92. package/dist/compose-iUOeazjW.mjs +3192 -0
  93. package/dist/compose-iUOeazjW.mjs.map +1 -0
  94. package/dist/config-CsCYzlVO.d.mts +291 -0
  95. package/dist/config-CsCYzlVO.d.mts.map +1 -0
  96. package/dist/config-D-gHQXhi.d.cts +291 -0
  97. package/dist/config-D-gHQXhi.d.cts.map +1 -0
  98. package/dist/config.cjs +457 -9
  99. package/dist/config.cjs.map +1 -0
  100. package/dist/config.d.cts +4 -117
  101. package/dist/config.d.mts +4 -117
  102. package/dist/config.mjs +441 -3
  103. package/dist/config.mjs.map +1 -0
  104. package/dist/credentialSchemas-BzJiK1nQ.mjs +236 -0
  105. package/dist/credentialSchemas-BzJiK1nQ.mjs.map +1 -0
  106. package/dist/credentialSchemas-OVXofU-r.cjs +271 -0
  107. package/dist/credentialSchemas-OVXofU-r.cjs.map +1 -0
  108. package/dist/credentials-BdZhygvW.cjs +2293 -0
  109. package/dist/credentials-BdZhygvW.cjs.map +1 -0
  110. package/dist/credentials-C2VfI-uf.mjs +1838 -0
  111. package/dist/credentials-C2VfI-uf.mjs.map +1 -0
  112. package/dist/databases-CuTL1e7s.cjs +703 -0
  113. package/dist/databases-CuTL1e7s.cjs.map +1 -0
  114. package/dist/databases-zN-gEox0.mjs +588 -0
  115. package/dist/databases-zN-gEox0.mjs.map +1 -0
  116. package/dist/define-6poNqm5O.mjs +106 -0
  117. package/dist/define-6poNqm5O.mjs.map +1 -0
  118. package/dist/define-crmMcXFS.cjs +153 -0
  119. package/dist/define-crmMcXFS.cjs.map +1 -0
  120. package/dist/deploy/public.cjs +211 -0
  121. package/dist/deploy/public.cjs.map +1 -0
  122. package/dist/deploy/public.d.cts +658 -0
  123. package/dist/deploy/public.d.cts.map +1 -0
  124. package/dist/deploy/public.d.mts +658 -0
  125. package/dist/deploy/public.d.mts.map +1 -0
  126. package/dist/deploy/public.mjs +144 -0
  127. package/dist/deploy/public.mjs.map +1 -0
  128. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  129. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  130. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  131. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  132. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  133. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  134. package/dist/deploy/sniffer-hooks.cjs +1 -1
  135. package/dist/deploy/sniffer-hooks.mjs +1 -1
  136. package/dist/deploy/sniffer-loader.cjs +2 -2
  137. package/dist/deploy/sniffer-loader.mjs +1 -1
  138. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  139. package/dist/deploy/sniffer-routes-worker.mjs +1 -1
  140. package/dist/deploy-CYyf-Q8N.cjs +3902 -0
  141. package/dist/deploy-CYyf-Q8N.cjs.map +1 -0
  142. package/dist/deploy-DqH8QReb.mjs +3846 -0
  143. package/dist/deploy-DqH8QReb.mjs.map +1 -0
  144. package/dist/destroy-B9myEYFT.mjs +788 -0
  145. package/dist/destroy-B9myEYFT.mjs.map +1 -0
  146. package/dist/destroy-Bp5iHtLf.cjs +789 -0
  147. package/dist/destroy-Bp5iHtLf.cjs.map +1 -0
  148. package/dist/discover-39VKSE2i.cjs +1085 -0
  149. package/dist/discover-39VKSE2i.cjs.map +1 -0
  150. package/dist/discover-B_PDDaVj.mjs +940 -0
  151. package/dist/discover-B_PDDaVj.mjs.map +1 -0
  152. package/dist/docker-BezTRGxN.cjs +1520 -0
  153. package/dist/docker-BezTRGxN.cjs.map +1 -0
  154. package/dist/docker-De_-Ll-A.mjs +1413 -0
  155. package/dist/docker-De_-Ll-A.mjs.map +1 -0
  156. package/dist/dokploy-CWCIqro_.cjs +38 -0
  157. package/dist/dokploy-CWCIqro_.cjs.map +1 -0
  158. package/dist/dokploy-EsBgWO8W.mjs +38 -0
  159. package/dist/dokploy-EsBgWO8W.mjs.map +1 -0
  160. package/dist/drivers-BhdC9Efj.cjs +248 -0
  161. package/dist/drivers-BhdC9Efj.cjs.map +1 -0
  162. package/dist/drivers-wcDnzf7l.mjs +213 -0
  163. package/dist/drivers-wcDnzf7l.mjs.map +1 -0
  164. package/dist/eas-8t6PJRni.cjs +337 -0
  165. package/dist/eas-8t6PJRni.cjs.map +1 -0
  166. package/dist/eas-BalvsiH5.mjs +334 -0
  167. package/dist/eas-BalvsiH5.mjs.map +1 -0
  168. package/dist/emit-C4KSXOeS.mjs +153 -0
  169. package/dist/emit-C4KSXOeS.mjs.map +1 -0
  170. package/dist/emit-DiW0kbue.cjs +164 -0
  171. package/dist/emit-DiW0kbue.cjs.map +1 -0
  172. package/dist/encryption-B4mWxt4G.mjs +89 -0
  173. package/dist/encryption-B4mWxt4G.mjs.map +1 -0
  174. package/dist/encryption-CKBmU66R.cjs +90 -0
  175. package/dist/encryption-CKBmU66R.cjs.map +1 -0
  176. package/dist/engine-BTG46RG-.cjs +3329 -0
  177. package/dist/engine-BTG46RG-.cjs.map +1 -0
  178. package/dist/engine-y8iWIXuv.mjs +3216 -0
  179. package/dist/engine-y8iWIXuv.mjs.map +1 -0
  180. package/dist/errors-D8Gwp5kU.mjs +23 -0
  181. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  182. package/dist/errors-DMC4Umsb.cjs +34 -0
  183. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  184. package/dist/github-CeXlzWWA.cjs +978 -0
  185. package/dist/github-CeXlzWWA.cjs.map +1 -0
  186. package/dist/github-DvGoKoQO.mjs +977 -0
  187. package/dist/github-DvGoKoQO.mjs.map +1 -0
  188. package/dist/googlePlay-CfzG7jOJ.cjs +931 -0
  189. package/dist/googlePlay-CfzG7jOJ.cjs.map +1 -0
  190. package/dist/googlePlay-DWv6CUgM.mjs +931 -0
  191. package/dist/googlePlay-DWv6CUgM.mjs.map +1 -0
  192. package/dist/iam-BE0qX5Lb.mjs +442 -0
  193. package/dist/iam-BE0qX5Lb.mjs.map +1 -0
  194. package/dist/iam-FA95ku7l.cjs +521 -0
  195. package/dist/iam-FA95ku7l.cjs.map +1 -0
  196. package/dist/{index-RCUizGxL.d.cts → index-QxGYzGEN.d.mts} +38 -14
  197. package/dist/index-QxGYzGEN.d.mts.map +1 -0
  198. package/dist/{index-B4H4XF7A.d.mts → index-tFzoro1V.d.cts} +38 -14
  199. package/dist/index-tFzoro1V.d.cts.map +1 -0
  200. package/dist/index.cjs +15142 -13470
  201. package/dist/index.cjs.map +1 -1
  202. package/dist/index.mjs +14959 -13285
  203. package/dist/index.mjs.map +1 -1
  204. package/dist/local-CvRvfktv.mjs +224 -0
  205. package/dist/local-CvRvfktv.mjs.map +1 -0
  206. package/dist/local-DH9at_0c.cjs +241 -0
  207. package/dist/local-DH9at_0c.cjs.map +1 -0
  208. package/dist/migrate-B1lHo2K2.cjs +272 -0
  209. package/dist/migrate-B1lHo2K2.cjs.map +1 -0
  210. package/dist/migrate-D1iCmQgc.mjs +267 -0
  211. package/dist/migrate-D1iCmQgc.mjs.map +1 -0
  212. package/dist/migrate-DzOWCnRR.cjs +181 -0
  213. package/dist/migrate-DzOWCnRR.cjs.map +1 -0
  214. package/dist/migrate-NmW2Su8s.mjs +181 -0
  215. package/dist/migrate-NmW2Su8s.mjs.map +1 -0
  216. package/dist/next.cjs +59 -0
  217. package/dist/next.cjs.map +1 -0
  218. package/dist/next.d.cts +44 -0
  219. package/dist/next.d.cts.map +1 -0
  220. package/dist/next.d.mts +44 -0
  221. package/dist/next.d.mts.map +1 -0
  222. package/dist/next.mjs +58 -0
  223. package/dist/next.mjs.map +1 -0
  224. package/dist/notes-BdIY7IoB.mjs +409 -0
  225. package/dist/notes-BdIY7IoB.mjs.map +1 -0
  226. package/dist/notes-ikElBCC8.cjs +510 -0
  227. package/dist/notes-ikElBCC8.cjs.map +1 -0
  228. package/dist/openapi.cjs +213 -7
  229. package/dist/openapi.cjs.map +1 -0
  230. package/dist/openapi.d.cts +32 -8
  231. package/dist/openapi.d.cts.map +1 -1
  232. package/dist/openapi.d.mts +32 -8
  233. package/dist/openapi.d.mts.map +1 -1
  234. package/dist/openapi.mjs +208 -2
  235. package/dist/openapi.mjs.map +1 -0
  236. package/dist/projectBucket-C-FOIic4.mjs +222 -0
  237. package/dist/projectBucket-C-FOIic4.mjs.map +1 -0
  238. package/dist/projectBucket-uidxz03Q.cjs +263 -0
  239. package/dist/projectBucket-uidxz03Q.cjs.map +1 -0
  240. package/dist/provider-BqpjG9QM.cjs +57 -0
  241. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  242. package/dist/provider-CEOKk8NS.mjs +46 -0
  243. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  244. package/dist/publish-Ujng6o63.mjs +123 -0
  245. package/dist/publish-Ujng6o63.mjs.map +1 -0
  246. package/dist/publish-oO_8elIf.cjs +124 -0
  247. package/dist/publish-oO_8elIf.cjs.map +1 -0
  248. package/dist/ready-COJHr1Yi.mjs +375 -0
  249. package/dist/ready-COJHr1Yi.mjs.map +1 -0
  250. package/dist/ready-DcD0SCnV.cjs +404 -0
  251. package/dist/ready-DcD0SCnV.cjs.map +1 -0
  252. package/dist/reconcile/public.cjs +3 -5
  253. package/dist/reconcile/public.d.cts +33 -89
  254. package/dist/reconcile/public.d.cts.map +1 -1
  255. package/dist/reconcile/public.d.mts +33 -89
  256. package/dist/reconcile/public.d.mts.map +1 -1
  257. package/dist/reconcile/public.mjs +3 -3
  258. package/dist/reconcile--I7V4Klj.mjs +34 -0
  259. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  260. package/dist/reconcile-CuCQBa5-.cjs +34 -0
  261. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  262. package/dist/resolve-CTb1gsTO.cjs +316 -0
  263. package/dist/resolve-CTb1gsTO.cjs.map +1 -0
  264. package/dist/resolve-Lk7fd8Kb.mjs +263 -0
  265. package/dist/resolve-Lk7fd8Kb.mjs.map +1 -0
  266. package/dist/rollback-B2DhSX-I.mjs +136 -0
  267. package/dist/rollback-B2DhSX-I.mjs.map +1 -0
  268. package/dist/rollback-PK4pSOLd.cjs +165 -0
  269. package/dist/rollback-PK4pSOLd.cjs.map +1 -0
  270. package/dist/runtime-BpGIXfYr.d.mts +82 -0
  271. package/dist/runtime-BpGIXfYr.d.mts.map +1 -0
  272. package/dist/runtime-DLV0CNZ4.d.cts +82 -0
  273. package/dist/runtime-DLV0CNZ4.d.cts.map +1 -0
  274. package/dist/s3-BY5ry__M.mjs +240 -0
  275. package/dist/s3-BY5ry__M.mjs.map +1 -0
  276. package/dist/s3-FG9qIgEB.cjs +240 -0
  277. package/dist/s3-FG9qIgEB.cjs.map +1 -0
  278. package/dist/sandbox/config-worker.cjs +43 -0
  279. package/dist/sandbox/config-worker.cjs.map +1 -0
  280. package/dist/sandbox/config-worker.d.cts +1 -0
  281. package/dist/sandbox/config-worker.d.mts +1 -0
  282. package/dist/sandbox/config-worker.mjs +44 -0
  283. package/dist/sandbox/config-worker.mjs.map +1 -0
  284. package/dist/sandbox/credentials-worker.cjs +53 -0
  285. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  286. package/dist/sandbox/credentials-worker.d.cts +1 -0
  287. package/dist/sandbox/credentials-worker.d.mts +1 -0
  288. package/dist/sandbox/credentials-worker.mjs +54 -0
  289. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  290. package/dist/sandbox/discover-worker.cjs +47 -0
  291. package/dist/sandbox/discover-worker.cjs.map +1 -0
  292. package/dist/sandbox/discover-worker.d.cts +1 -0
  293. package/dist/sandbox/discover-worker.d.mts +1 -0
  294. package/dist/sandbox/discover-worker.mjs +48 -0
  295. package/dist/sandbox/discover-worker.mjs.map +1 -0
  296. package/dist/sandbox/migrate-worker.cjs +75 -0
  297. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  298. package/dist/sandbox/migrate-worker.d.cts +1 -0
  299. package/dist/sandbox/migrate-worker.d.mts +1 -0
  300. package/dist/sandbox/migrate-worker.mjs +76 -0
  301. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  302. package/dist/{workspace-B8NLb54N.cjs → schemas-BCwKKA42.mjs} +399 -1173
  303. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  304. package/dist/{workspace-DI-M3BnN.mjs → schemas-BQ_v0lEX.cjs} +487 -982
  305. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  306. package/dist/secretsManager-CJyxFcBH.mjs +113 -0
  307. package/dist/secretsManager-CJyxFcBH.mjs.map +1 -0
  308. package/dist/secretsManager-D8on44WI.cjs +124 -0
  309. package/dist/secretsManager-D8on44WI.cjs.map +1 -0
  310. package/dist/seeds-Bc3niNVb.cjs +382 -0
  311. package/dist/seeds-Bc3niNVb.cjs.map +1 -0
  312. package/dist/seeds-Ccn0Ru2T.mjs +299 -0
  313. package/dist/seeds-Ccn0Ru2T.mjs.map +1 -0
  314. package/dist/serverSetup-BL1sHzRr.mjs +685 -0
  315. package/dist/serverSetup-BL1sHzRr.mjs.map +1 -0
  316. package/dist/serverSetup-C7fDKGiN.cjs +685 -0
  317. package/dist/serverSetup-C7fDKGiN.cjs.map +1 -0
  318. package/dist/sniffer-BvhDRsgI.mjs +1824 -0
  319. package/dist/sniffer-BvhDRsgI.mjs.map +1 -0
  320. package/dist/sniffer-DJp9a2Pg.cjs +1997 -0
  321. package/dist/sniffer-DJp9a2Pg.cjs.map +1 -0
  322. package/dist/snsSubscriptions-7y2XBXde.mjs +1053 -0
  323. package/dist/snsSubscriptions-7y2XBXde.mjs.map +1 -0
  324. package/dist/snsSubscriptions-8t1XFvoc.cjs +1184 -0
  325. package/dist/snsSubscriptions-8t1XFvoc.cjs.map +1 -0
  326. package/dist/sst-8HZe83-M.cjs +501 -0
  327. package/dist/sst-8HZe83-M.cjs.map +1 -0
  328. package/dist/sst-CzFd-1om.mjs +478 -0
  329. package/dist/sst-CzFd-1om.mjs.map +1 -0
  330. package/dist/stack-3tvhk7SU.cjs +2568 -0
  331. package/dist/stack-3tvhk7SU.cjs.map +1 -0
  332. package/dist/stack-j2e8ddGl.mjs +2381 -0
  333. package/dist/stack-j2e8ddGl.mjs.map +1 -0
  334. package/dist/stage-DCSJii_y.cjs +313 -0
  335. package/dist/stage-DCSJii_y.cjs.map +1 -0
  336. package/dist/stage-DMv-IfSD.mjs +302 -0
  337. package/dist/stage-DMv-IfSD.mjs.map +1 -0
  338. package/dist/stages-CCAAe1tP.mjs +190 -0
  339. package/dist/stages-CCAAe1tP.mjs.map +1 -0
  340. package/dist/stages-D49CUpBY.cjs +190 -0
  341. package/dist/stages-D49CUpBY.cjs.map +1 -0
  342. package/dist/target/public.cjs +15 -0
  343. package/dist/target/public.d.cts +28 -0
  344. package/dist/target/public.d.cts.map +1 -0
  345. package/dist/target/public.d.mts +28 -0
  346. package/dist/target/public.d.mts.map +1 -0
  347. package/dist/target/public.mjs +4 -0
  348. package/dist/terminal-DIEj2Nap.cjs +85 -0
  349. package/dist/terminal-DIEj2Nap.cjs.map +1 -0
  350. package/dist/terminal-VLmWgL_N.mjs +85 -0
  351. package/dist/terminal-VLmWgL_N.mjs.map +1 -0
  352. package/dist/{types-N7c2O2m7.d.cts → types-Bj1A1wkS.d.mts} +2146 -428
  353. package/dist/types-Bj1A1wkS.d.mts.map +1 -0
  354. package/dist/types-Bl_CwZC9.cjs +90 -0
  355. package/dist/types-Bl_CwZC9.cjs.map +1 -0
  356. package/dist/{types-7R81hu0i.d.mts → types-CV4AzwC_.d.cts} +2148 -428
  357. package/dist/types-CV4AzwC_.d.cts.map +1 -0
  358. package/dist/types-Y1NfWlyG.mjs +61 -0
  359. package/dist/types-Y1NfWlyG.mjs.map +1 -0
  360. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  361. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  362. package/dist/utils-D_fxUqvU.mjs +156 -0
  363. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  364. package/dist/vitest.cjs +65 -0
  365. package/dist/vitest.cjs.map +1 -0
  366. package/dist/vitest.d.cts +29 -0
  367. package/dist/vitest.d.cts.map +1 -0
  368. package/dist/vitest.d.mts +29 -0
  369. package/dist/vitest.d.mts.map +1 -0
  370. package/dist/vitest.mjs +65 -0
  371. package/dist/vitest.mjs.map +1 -0
  372. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  373. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  374. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  375. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  376. package/dist/workspace/index.cjs +6 -2
  377. package/dist/workspace/index.d.cts +3 -3
  378. package/dist/workspace/index.d.mts +3 -3
  379. package/dist/workspace/index.mjs +2 -2
  380. package/dist/workspace-B0PI9k9p.mjs +3013 -0
  381. package/dist/workspace-B0PI9k9p.mjs.map +1 -0
  382. package/dist/workspace-LR9DFjU8.cjs +3563 -0
  383. package/dist/workspace-LR9DFjU8.cjs.map +1 -0
  384. package/package.json +75 -13
  385. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  386. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  387. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  388. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  389. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  390. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  391. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  392. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  393. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  394. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  395. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  396. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  397. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  398. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  399. package/dist/bundler-mjqGAvu1.cjs.map +0 -1
  400. package/dist/bundler-mwH7WOb1.mjs.map +0 -1
  401. package/dist/config-CdTMeMU_.cjs +0 -467
  402. package/dist/config-CdTMeMU_.cjs.map +0 -1
  403. package/dist/config-DPnPkWyH.mjs +0 -414
  404. package/dist/config-DPnPkWyH.mjs.map +0 -1
  405. package/dist/config.d.cts.map +0 -1
  406. package/dist/config.d.mts.map +0 -1
  407. package/dist/credentials-fJP5-fa1.mjs +0 -2780
  408. package/dist/credentials-fJP5-fa1.mjs.map +0 -1
  409. package/dist/credentials-tvyReUAd.cjs +0 -2917
  410. package/dist/credentials-tvyReUAd.cjs.map +0 -1
  411. package/dist/discover-BERGFg8v.cjs +0 -288
  412. package/dist/discover-BERGFg8v.cjs.map +0 -1
  413. package/dist/discover-CK-n3w6b.mjs +0 -244
  414. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  415. package/dist/emit-BdoPFjZf.cjs +0 -253
  416. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  417. package/dist/emit-Bzq7JsMP.mjs +0 -224
  418. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  419. package/dist/generator-LfZU7NlU.mjs +0 -247
  420. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  421. package/dist/generator-Wdfp0jCS.cjs +0 -282
  422. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  423. package/dist/github-CAfKyYPN.mjs +0 -216
  424. package/dist/github-CAfKyYPN.mjs.map +0 -1
  425. package/dist/github-DVE8Gg_F.cjs +0 -216
  426. package/dist/github-DVE8Gg_F.cjs.map +0 -1
  427. package/dist/index-B4H4XF7A.d.mts.map +0 -1
  428. package/dist/index-RCUizGxL.d.cts.map +0 -1
  429. package/dist/openapi-BeckoaP9.cjs +0 -2038
  430. package/dist/openapi-BeckoaP9.cjs.map +0 -1
  431. package/dist/openapi-DolhBm6r.mjs +0 -1991
  432. package/dist/openapi-DolhBm6r.mjs.map +0 -1
  433. package/dist/reconcile-Cq4cO83R.cjs +0 -136
  434. package/dist/reconcile-Cq4cO83R.cjs.map +0 -1
  435. package/dist/reconcile-fmoluZmZ.mjs +0 -113
  436. package/dist/reconcile-fmoluZmZ.mjs.map +0 -1
  437. package/dist/ssm-BKN1Cg4z.mjs +0 -60
  438. package/dist/ssm-BKN1Cg4z.mjs.map +0 -1
  439. package/dist/ssm-FxeSAt35.cjs +0 -60
  440. package/dist/ssm-FxeSAt35.cjs.map +0 -1
  441. package/dist/storage-DgypfSD6.cjs +0 -351
  442. package/dist/storage-DgypfSD6.cjs.map +0 -1
  443. package/dist/storage-TP0x118M.mjs +0 -304
  444. package/dist/storage-TP0x118M.mjs.map +0 -1
  445. package/dist/transfer-4A4S2hcw.mjs +0 -122
  446. package/dist/transfer-4A4S2hcw.mjs.map +0 -1
  447. package/dist/transfer-DdmtKLzi.cjs +0 -151
  448. package/dist/transfer-DdmtKLzi.cjs.map +0 -1
  449. package/dist/types-7R81hu0i.d.mts.map +0 -1
  450. package/dist/types-N7c2O2m7.d.cts.map +0 -1
  451. package/dist/workspace-B8NLb54N.cjs.map +0 -1
  452. package/dist/workspace-DI-M3BnN.mjs.map +0 -1
@@ -1,4 +1,158 @@
1
- import { ConstructManifest } from "@geekmidas/manifest";
1
+ import { ConstructManifest, Declaration } from "@geekmidas/manifest";
2
+ //#region src/errors.d.ts
3
+ /**
4
+ * The errors gkm raises on purpose.
5
+ *
6
+ * A {@link GkmError} is a failure gkm saw coming and explained: a stage
7
+ * missing a key, a config that names nothing, no AWS credentials. Its
8
+ * message is the whole answer — what went wrong and what to do — so the CLI
9
+ * prints `Name: message` and nothing else. A stack trace under it would point
10
+ * at gkm's own code, which is not where the fix is.
11
+ *
12
+ * Anything else that reaches the CLI — a TypeError, an SDK error nothing
13
+ * wrapped — is a failure nobody explained, and keeps its stack. `--debug` or
14
+ * `GKM_DEBUG=1` shows the stack of both.
15
+ */
16
+ declare class GkmError extends Error {}
17
+ //#endregion
18
+ //#region src/sandbox/sandbox.d.ts
19
+ /** Where a command's output goes. */
20
+ type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';
21
+ interface SandboxExecOptions {
22
+ /**
23
+ * Where the command runs: the project root or a directory below it, as an
24
+ * absolute path or relative to the root. Anywhere else is refused with
25
+ * {@link SandboxCwdEscape}.
26
+ */
27
+ cwd: string;
28
+ /**
29
+ * The command's whole environment. Nothing of the host's is added to it:
30
+ * start from {@link Sandbox.env} and add what the step needs.
31
+ */
32
+ env: Readonly<Record<string, string>>;
33
+ /**
34
+ * How long the command may run before it is killed. Required: a step that
35
+ * waits forever — a sniffed entry that opens a server, a build stuck on a
36
+ * prompt — would otherwise hold the deploy, and its lock, forever.
37
+ */
38
+ timeoutMs: number;
39
+ /**
40
+ * Files the command can read, by name. Mounted in a directory of their own
41
+ * — named by `GKM_SECRETS_DIR` in the command's environment — and removed
42
+ * when it exits. Never set as variables, which every child inherits, a
43
+ * crash report prints and `/proc/<pid>/environ` shows.
44
+ */
45
+ secrets?: Readonly<Record<string, string>>;
46
+ /**
47
+ * `capture` (the default) returns stdout and stderr in the result;
48
+ * `inherit` gives the command the host's terminal; `stderr` sends both
49
+ * streams to the host's stderr; `ignore` discards them.
50
+ */
51
+ output?: SandboxOutput;
52
+ /** Kills the command when aborted; `exec` rejects with the signal's reason. */
53
+ signal?: AbortSignal;
54
+ }
55
+ /** How a command ended. A non-zero exit is a result, not an error. */
56
+ interface SandboxResult {
57
+ exitCode: number | null;
58
+ signal: string | null;
59
+ /** What it wrote to stdout, when its output was captured. */
60
+ stdout: string;
61
+ /** What it wrote to stderr, when its output was captured. */
62
+ stderr: string;
63
+ }
64
+ /**
65
+ * Runs a command against the project, and nothing else of the host's.
66
+ *
67
+ * `exec` resolves with the result however the command exited. It rejects
68
+ * with {@link CommandTimedOut} once the timeout passes — after the command is
69
+ * gone — with {@link SandboxCwdEscape} for a directory outside the project,
70
+ * with the signal's reason when aborted, and with the spawn error when the
71
+ * program cannot be started.
72
+ */
73
+ interface Sandbox {
74
+ /** The project: the directory every command runs at or below. */
75
+ readonly root: string;
76
+ /**
77
+ * Whether the code it runs is kept from the host: its files, its
78
+ * processes, its memory.
79
+ *
80
+ * An isolating sandbox shares nothing but what crosses `exec`, so a config
81
+ * reaches the deploy as data — a live object in it (a custom state store,
82
+ * an inline target) cannot cross, and is refused with
83
+ * `ConfigObjectNotSerializable`. A non-isolating one, like
84
+ * {@link LocalSandbox}, runs on the host as the host's user; a project
85
+ * whose config holds live objects is then loaded in-process as before,
86
+ * because a project trusted to run there is trusted to do that.
87
+ */
88
+ readonly isolating: boolean;
89
+ /**
90
+ * The environment a command starts from: what any program needs to run
91
+ * here — `PATH`, `HOME`, the locale — and no credential.
92
+ */
93
+ readonly env: Readonly<Record<string, string>>;
94
+ exec(command: string, args: readonly string[], options: SandboxExecOptions): Promise<SandboxResult>;
95
+ }
96
+ /** The variable naming the directory a command's secrets are mounted in. */
97
+ declare const SECRETS_DIR_ENV = "GKM_SECRETS_DIR";
98
+ /** A command was asked to run outside the project. */
99
+ declare class SandboxCwdEscape extends GkmError {
100
+ readonly cwd: string;
101
+ readonly root: string;
102
+ constructor(cwd: string, root: string);
103
+ }
104
+ /**
105
+ * `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.
106
+ *
107
+ * Symlinks are resolved on both sides first, so a link inside the project
108
+ * that points out of it is an escape, and a project reached through a link
109
+ * (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call
110
+ * before it runs anything.
111
+ */
112
+ declare function confineCwd(root: string, cwd: string): string;
113
+ /** A secret's file name: one path segment, so it cannot be written elsewhere. */
114
+ declare class SecretNameInvalid extends GkmError {
115
+ readonly secretName: string;
116
+ constructor(secretName: string);
117
+ }
118
+ //#endregion
119
+ //#region src/deploy/identity.d.ts
120
+ interface DeployIdentity {
121
+ /**
122
+ * Whose deploy this is — an organisation, a team, a repository. Two
123
+ * workspaces with the same name are told apart by it. Defaults to the
124
+ * kebab-cased workspace name; set `deploy.namespace` to choose one.
125
+ */
126
+ readonly namespace: string;
127
+ /** The workspace name as the target spells it: lowercase, `[a-z0-9-]`. */
128
+ readonly project: string;
129
+ readonly stage: string;
130
+ /**
131
+ * `<namespace>/<project>`: what a Dokploy project is claimed by.
132
+ *
133
+ * The stage is not part of it because one Dokploy project holds every stage
134
+ * of a workspace, each as an environment — the key has to be the same from
135
+ * every stage that deploys into it.
136
+ */
137
+ readonly key: string;
138
+ /**
139
+ * The prefix every name on the target carries: the project alone in the
140
+ * default namespace, `<namespace>-<project>` in any other.
141
+ *
142
+ * The default adds nothing so that a workspace that never set a namespace
143
+ * keeps the names it was already deployed under — a Postgres is found by
144
+ * its name, and a new name would be a new, empty database.
145
+ */
146
+ readonly scope: string;
147
+ }
148
+ /** What an identity is derived from: a workspace's name and namespace. */
149
+ interface IdentitySource {
150
+ name: string;
151
+ deploy?: {
152
+ namespace?: string;
153
+ };
154
+ }
155
+ declare function deployIdentity(workspace: IdentitySource, stage: string): DeployIdentity;
2
156
  //#endregion
3
157
  //#region src/secrets/types.d.ts
4
158
  /** Credentials for a specific service */
@@ -9,8 +163,6 @@ interface ServiceCredentials {
9
163
  password: string;
10
164
  /** Database name (for postgres) */
11
165
  database?: string;
12
- /** Virtual host (for rabbitmq) */
13
- vhost?: string;
14
166
  /** Bucket name (for minio) */
15
167
  bucket?: string;
16
168
  /** Access key ID (for localstack) */
@@ -26,45 +178,91 @@ interface StageSecrets {
26
178
  createdAt: string;
27
179
  /** ISO timestamp when secrets were last updated */
28
180
  updatedAt: string;
29
- /** Event backend type (if events are enabled) */
30
- eventsBackend?: EventsBackend;
31
181
  /** Service-specific credentials */
32
182
  services: {
33
183
  postgres?: ServiceCredentials;
34
184
  redis?: ServiceCredentials;
35
- rabbitmq?: ServiceCredentials;
36
185
  minio?: ServiceCredentials;
37
186
  mailpit?: ServiceCredentials;
38
187
  localstack?: ServiceCredentials;
39
- pgboss?: ServiceCredentials;
40
188
  };
41
189
  /** Generated connection URLs */
42
190
  urls: {
43
191
  DATABASE_URL?: string;
44
192
  REDIS_URL?: string;
45
- RABBITMQ_URL?: string;
46
193
  STORAGE_ENDPOINT?: string;
47
194
  SMTP_HOST?: string;
48
195
  SMTP_PORT?: string;
49
- EVENT_PUBLISHER_CONNECTION_STRING?: string;
50
- EVENT_SUBSCRIBER_CONNECTION_STRING?: string;
51
196
  };
52
- /** Custom user-defined secrets */
197
+ /**
198
+ * Values injected by key: those set with `gkm secrets:set` — a third
199
+ * party's credentials — and those generated once for the stage, such as an
200
+ * auth server's signing secret.
201
+ */
53
202
  custom: Record<string, string>;
203
+ /**
204
+ * Random, generated once per stage: what every password a deploy derives
205
+ * is salted with. Without it a derived password is a function of the
206
+ * project and stage names, which anyone reading the repo has.
207
+ */
208
+ seed?: string;
54
209
  }
55
210
  //#endregion
56
211
  //#region src/secrets/store.d.ts
57
212
  interface SecretsStore {
58
- /** The stage's secrets, or null if the store holds none for it. */
59
- pull(stage: string): Promise<StageSecrets | null>;
60
- /** Replace the stage's secrets in the store. */
61
- push(stage: string, secrets: StageSecrets): Promise<void>;
213
+ /**
214
+ * Which kind of store this is — `'file'`, `'s3'`, `'ssm'`,
215
+ * `'secrets-manager'`, or a custom one's.
216
+ */
217
+ readonly name: string;
218
+ /** The stage's secrets, or null when it has none here. */
219
+ read(stage: string): Promise<StageSecrets | null>;
220
+ /** Replace the stage's secrets. */
221
+ write(stage: string, secrets: StageSecrets): Promise<void>;
222
+ /**
223
+ * Delete the stage's secrets, every kept version of them included — what
224
+ * `gkm compose --destroy --secrets` does. Optional for a custom store; one
225
+ * without it cannot have its stage's secrets destroyed by gkm.
226
+ */
227
+ delete?(stage: string): Promise<void>;
62
228
  }
63
229
  /** Secrets in SSM Parameter Store, in the account of the active credentials. */
64
230
  interface SsmSecretsStoreConfig {
65
231
  provider: 'ssm';
66
232
  region: string;
67
233
  }
234
+ /**
235
+ * Secrets in AWS Secrets Manager, in the account of the active credentials:
236
+ * one secret per stage, `gkm/<project>/<stage>/secrets`. Up to 64 KB where
237
+ * SSM holds 8 KB, at a monthly price per secret.
238
+ */
239
+ interface SecretsManagerSecretsStoreConfig {
240
+ provider: 'secrets-manager';
241
+ region: string;
242
+ /**
243
+ * The KMS key (id, ARN or alias) a stage's secret is created with. Unset,
244
+ * it is the account's AWS-managed `aws/secretsmanager` key.
245
+ */
246
+ kmsKeyId?: string;
247
+ }
248
+ /**
249
+ * Secrets in S3, one object per stage —
250
+ * `<prefix>/<project>/<stage>/secrets.json` — in the project bucket beside the
251
+ * deploy state and backups, or in a bucket that exists. Encrypted with SSE-S3,
252
+ * every past document kept by the bucket's versioning, and no size limit.
253
+ */
254
+ interface S3SecretsStoreConfig {
255
+ provider: 's3';
256
+ /**
257
+ * A bucket that already exists. Omitted, the project bucket —
258
+ * `gkm-<project>-<account id>`, created by the first write.
259
+ */
260
+ bucket?: string;
261
+ /** The bucket's region. Omitted, the deploy state's, when it is in S3. */
262
+ region?: string;
263
+ /** Key prefix inside the bucket. Omitted, the S3 state's, else `gkm`. */
264
+ prefix?: string;
265
+ }
68
266
  /** Any other backend: an object implementing {@link SecretsStore}. */
69
267
  interface CustomSecretsStoreConfig {
70
268
  provider: SecretsStore;
@@ -73,18 +271,39 @@ interface CustomSecretsStoreConfig {
73
271
  * `secrets.store` in gkm.config.ts.
74
272
  *
75
273
  * `'file'` — the default — keeps each stage's secrets in the encrypted
76
- * `.gkm/secrets/<stage>.json` beside its key in `~/.gkm/`. It cannot serve a
77
- * deploy from CI while `.gkm/` is gitignored; `ssm` or a custom store can.
274
+ * `.gkm/secrets/<stage>.json`, its key in the CLI's home (`GKM_HOME`, else
275
+ * `~/.gkm`). It cannot serve a
276
+ * deploy from CI while `.gkm/` is gitignored; `s3`, `ssm`, `secrets-manager`
277
+ * or a custom store can.
78
278
  */
79
- type SecretsStoreConfig = 'file' | SsmSecretsStoreConfig | CustomSecretsStoreConfig;
279
+ type SecretsStoreConfig = 'file' | S3SecretsStoreConfig | SsmSecretsStoreConfig | SecretsManagerSecretsStoreConfig | CustomSecretsStoreConfig;
80
280
  //#endregion
81
- //#region src/deploy/state.d.ts
281
+ //#region src/deploy/actor.d.ts
82
282
  /**
83
- * Deploy state management for Dokploy deployments
84
- *
85
- * Stores resource IDs (applications, services) per stage to avoid
86
- * re-creating resources on subsequent deploys.
283
+ * Who wrote a stage's deploy state: a GitHub Actions run, or a person at a
284
+ * machine. Recorded on every state write (`updatedBy`), on every resource
285
+ * record and on every release (`releasedBy`), so "who put this here" has an
286
+ * answer that does not depend on anyone's memory.
87
287
  */
288
+ /** A GitHub Actions run: the account that triggered it and the run's page. */
289
+ interface GithubActor {
290
+ kind: 'github';
291
+ /** `GITHUB_ACTOR` — the account that triggered the run. */
292
+ actor: string;
293
+ /** `<server>/<repository>/actions/runs/<run id>` */
294
+ run: string;
295
+ /** `GITHUB_WORKFLOW` — the workflow's name. */
296
+ workflow?: string;
297
+ }
298
+ /** A person at a machine. */
299
+ interface LocalActor {
300
+ kind: 'local';
301
+ user: string;
302
+ host: string;
303
+ }
304
+ type Actor = GithubActor | LocalActor;
305
+ //#endregion
306
+ //#region src/deploy/state.d.ts
88
307
  /**
89
308
  * Per-app database credentials
90
309
  */
@@ -139,12 +358,30 @@ interface BackupState {
139
358
  /** Timestamp when backup was configured */
140
359
  createdAt: string;
141
360
  }
361
+ /** What every target's state for a stage holds. */
362
+ interface StageStateCore {
363
+ stage: string;
364
+ lastDeployedAt: string;
365
+ /**
366
+ * The deploy identity's key (`<namespace>/<project>`) that last deployed
367
+ * this stage — what the project's ownership marker says.
368
+ */
369
+ identity?: string;
370
+ /**
371
+ * Each app's releases, keyed by app name: what runs now, what ran before
372
+ * it — which `gkm deploy:rollback` restores — and the history behind both.
373
+ */
374
+ releases?: Record<string, AppReleases>;
375
+ }
376
+ /** A compose stage's state: the core, and nothing Dokploy-specific. */
377
+ interface ComposeStageState extends StageStateCore {
378
+ provider: 'compose';
379
+ }
142
380
  /**
143
381
  * State for a single stage deployment
144
382
  */
145
- interface DokployStageState {
383
+ interface DokployStageState extends StageStateCore {
146
384
  provider: 'dokploy';
147
- stage: string;
148
385
  /** Dokploy project ID - created on first deploy */
149
386
  projectId: string;
150
387
  environmentId: string;
@@ -163,7 +400,169 @@ interface DokployStageState {
163
400
  dnsRecords?: Record<string, CreatedDnsRecord>;
164
401
  /** Backup destination state */
165
402
  backups?: BackupState;
166
- lastDeployedAt: string;
403
+ /**
404
+ * The Dokploy registry the stage's images are pulled through. Kept per
405
+ * stage rather than once per machine, so a stage keeps the registry it was
406
+ * deployed with whoever deploys it next.
407
+ */
408
+ registryId?: string;
409
+ }
410
+ /** A stage's state, whichever target wrote it. */
411
+ type StageState = DokployStageState | ComposeStageState;
412
+ /** An image a stage runs: the ref it was pushed as, and what it resolved to. */
413
+ interface DeployedImage {
414
+ ref: string;
415
+ /**
416
+ * The tag it was released under — a site's carries its stage
417
+ * (`v1.4.0-production`). Recorded by targets that pull a release by tag.
418
+ */
419
+ tag?: string;
420
+ /** The registry's digest, `sha256:…` — absent if it could not be read. */
421
+ digest?: string;
422
+ }
423
+ /** An image that went live, and when. */
424
+ interface ReleasedImage extends DeployedImage {
425
+ /** The image tag the deploy released under. */
426
+ tag?: string;
427
+ releasedAt: string;
428
+ /** Who released it — absent on a release recorded before it was kept. */
429
+ releasedBy?: Actor;
430
+ /** Set when a rollback replaced it: it is never rolled back *to*. */
431
+ rolledBack?: true;
432
+ }
433
+ /** An app's releases: what runs, what ran before it, and what ran before that. */
434
+ interface AppReleases {
435
+ current: ReleasedImage;
436
+ /** What a rollback restores; absent until a second release. */
437
+ previous?: ReleasedImage;
438
+ /** Every release, newest first, at most {@link RELEASE_HISTORY} of them. */
439
+ history: ReleasedImage[];
440
+ }
441
+ //#endregion
442
+ //#region src/deploy/StateStore.d.ts
443
+ /** Opaque: a file hash, an SSM parameter version or an S3 ETag. */
444
+ type StateVersion = string;
445
+ /**
446
+ * `pending` is written before the call that creates the resource, `ready`
447
+ * once the target has returned its id. A run that finds a `pending` record
448
+ * knows a previous run may have created the resource and should look for it
449
+ * before creating another.
450
+ */
451
+ type ResourceStatus = 'pending' | 'ready';
452
+ interface ResourceRecord {
453
+ /** Unique within the stage, `<type>:<name>` — e.g. `application:api`. */
454
+ key: string;
455
+ /** What kind of resource it is — e.g. `application`, `postgres`. */
456
+ type: string;
457
+ /** The id the target gave it. Absent while `pending`. */
458
+ id?: string;
459
+ status: ResourceStatus;
460
+ /** Whatever the target needs to adopt the resource on a later run. */
461
+ data?: Record<string, unknown>;
462
+ updatedAt: string;
463
+ /** Who wrote the record — absent on one written before it was kept. */
464
+ updatedBy?: Actor;
465
+ }
466
+ /** A resource as a caller hands it to `putResource`; the store stamps it. */
467
+ type ResourceInput = Omit<ResourceRecord, 'updatedAt' | 'updatedBy'>;
468
+ /** One write of a stage's state: which, when, by whom, doing what. */
469
+ interface HistoryEntry {
470
+ serial: number;
471
+ at: string;
472
+ by: Actor;
473
+ /** The lock's operation — `deploy`, `rollback`, `setup`, `state:push` … */
474
+ operation: string;
475
+ }
476
+ interface StoredStageState {
477
+ state: StageState;
478
+ resources: Record<string, ResourceRecord>;
479
+ /** The latest writes, newest first. */
480
+ history: HistoryEntry[];
481
+ /** Pass back as `expectedVersion` to write on top of exactly this read. */
482
+ version: StateVersion;
483
+ }
484
+ interface WriteOptions {
485
+ /**
486
+ * The version this write is based on — `null` to create state that must
487
+ * not exist yet.
488
+ */
489
+ expectedVersion: StateVersion | null;
490
+ }
491
+ interface ResourceWriteOptions {
492
+ /**
493
+ * Omitted, the record is applied on top of whatever is stored now (still
494
+ * conditionally, so a concurrent write raises rather than being lost).
495
+ */
496
+ expectedVersion?: StateVersion;
497
+ }
498
+ interface LockHolder {
499
+ /** Unique per acquisition, so a release never removes someone else's lock. */
500
+ id: string;
501
+ owner: string;
502
+ host: string;
503
+ pid: number;
504
+ acquiredAt: string;
505
+ /** What the holder is doing, e.g. `deploy`. */
506
+ operation?: string;
507
+ }
508
+ interface LockOptions {
509
+ operation?: string;
510
+ }
511
+ interface StateLock {
512
+ readonly stage: string;
513
+ readonly holder: LockHolder;
514
+ /** Removes the lock if it is still this one; safe to call twice. */
515
+ release(): Promise<void>;
516
+ }
517
+ interface StateStore {
518
+ /** Takes the stage's lock, or raises `StateLocked` naming its holder. */
519
+ lock(stage: string, options?: LockOptions): Promise<StateLock>;
520
+ /**
521
+ * Removes the stage's lock whoever holds it, for a run that crashed with
522
+ * it held. Returns the holder it removed, or `null` if there was none.
523
+ */
524
+ forceUnlock(stage: string): Promise<LockHolder | null>;
525
+ read(stage: string): Promise<StoredStageState | null>;
526
+ /** Replaces the stage's state, keeping its resource records. */
527
+ write(stage: string, state: StageState, options: WriteOptions): Promise<StateVersion>;
528
+ putResource(stage: string, record: ResourceInput, options?: ResourceWriteOptions): Promise<StateVersion>;
529
+ deleteResource(stage: string, key: string, options?: ResourceWriteOptions): Promise<StateVersion>;
530
+ /**
531
+ * How big the stage's document is as this store would write it, against
532
+ * the most it can hold — for a store with a limit (SSM). `null` when the
533
+ * stage has no state yet.
534
+ */
535
+ capacity?(stage: string): Promise<StateCapacity | null>;
536
+ }
537
+ /** A stored document's size against the store's limit, in bytes. */
538
+ interface StateCapacity {
539
+ bytes: number;
540
+ limit: number;
541
+ location: string;
542
+ /** The store's AWS region, for the message that suggests S3. */
543
+ region?: string;
544
+ }
545
+ declare class StateLocked extends GkmError {
546
+ readonly stage: string;
547
+ readonly holder: LockHolder | null;
548
+ readonly location: string;
549
+ constructor(stage: string, holder: LockHolder | null, location: string);
550
+ }
551
+ declare class StateVersionConflict extends GkmError {
552
+ readonly stage: string;
553
+ readonly expectedVersion: StateVersion | null;
554
+ readonly actualVersion: StateVersion | null;
555
+ constructor(stage: string, expectedVersion: StateVersion | null, actualVersion: StateVersion | null);
556
+ }
557
+ /**
558
+ * A deploy, setup or rollback of a stage in CI, with the stage's state kept on
559
+ * the runner — which is discarded when the job ends.
560
+ */
561
+ declare class LocalStateInCi extends GkmError {
562
+ readonly stage: string;
563
+ readonly operation: string;
564
+ readonly region: string;
565
+ constructor(stage: string, operation: string, region: string);
167
566
  }
168
567
  //#endregion
169
568
  //#region src/deploy/StateProvider.d.ts
@@ -181,14 +580,14 @@ interface StateProvider {
181
580
  * @param stage - The deployment stage (e.g., 'development', 'production')
182
581
  * @returns The state object or null if not found
183
582
  */
184
- read(stage: string): Promise<DokployStageState | null>;
583
+ read(stage: string): Promise<StageState | null>;
185
584
  /**
186
585
  * Write deployment state for a stage.
187
586
  *
188
587
  * @param stage - The deployment stage
189
588
  * @param state - The state object to persist
190
589
  */
191
- write(stage: string, state: DokployStageState): Promise<void>;
590
+ write(stage: string, state: StageState): Promise<void>;
192
591
  }
193
592
  /**
194
593
  * Valid AWS regions.
@@ -210,17 +609,929 @@ interface SSMStateConfig {
210
609
  /** AWS profile name (optional - uses default credential chain if not provided) */
211
610
  profile?: string;
212
611
  }
612
+ /**
613
+ * S3 state config: one object per stage, written with conditional puts
614
+ * (`If-Match` / `If-None-Match`), and a lock object beside it.
615
+ *
616
+ * Keys: `<prefix>/<workspace name>/<stage>/state.json` and `lock.json`.
617
+ */
618
+ interface S3StateConfig {
619
+ provider: 's3';
620
+ /**
621
+ * Bucket the state lives in; it must already exist. Omitted, the project
622
+ * bucket — `gkm-<project>-<account id>`, created by the first deploy.
623
+ */
624
+ bucket?: string;
625
+ /** AWS region of the bucket */
626
+ region: AwsRegion;
627
+ /** Key prefix inside the bucket (default: `gkm`) */
628
+ prefix?: string;
629
+ /** AWS profile name (optional - uses default credential chain if not provided) */
630
+ profile?: string;
631
+ }
213
632
  /**
214
633
  * Custom state provider config.
215
634
  */
216
635
  interface CustomStateConfig {
217
- /** Custom StateProvider implementation */
218
- provider: StateProvider;
636
+ /**
637
+ * Custom implementation. A `StateStore` is used as is; a `StateProvider`
638
+ * still works, but cannot lock — deploy warns `StateStoreWithoutLocking`.
639
+ */
640
+ provider: StateProvider | StateStore;
219
641
  }
220
642
  /**
221
643
  * State configuration types.
222
644
  */
223
- type StateConfig = LocalStateConfig | SSMStateConfig | CustomStateConfig;
645
+ type StateConfig = LocalStateConfig | SSMStateConfig | S3StateConfig | CustomStateConfig;
646
+ //#endregion
647
+ //#region src/reconcile/discover.d.ts
648
+ /** The construct face discovery needs: an id, and the ability to declare. */
649
+ interface Declarable {
650
+ id: string;
651
+ declare(): Declaration[];
652
+ }
653
+ /**
654
+ * Whether a module export is a construct.
655
+ *
656
+ * Deliberately loose about what else it carries — a construct that also has a
657
+ * `service` is still a construct, and requiring one would exclude the kinds that
658
+ * own no address.
659
+ */
660
+ declare function isDeclarable(value: unknown): value is Declarable;
661
+ interface DiscoverOptions {
662
+ /** The glob(s) to search. One pattern, not one per kind. */
663
+ patterns: string | readonly string[];
664
+ cwd?: string;
665
+ /**
666
+ * Re-import changed modules, for the dev watcher.
667
+ *
668
+ * A single glob makes discovery more central, not less: a new construct file
669
+ * has to be picked up on `add`, not only on `change`.
670
+ */
671
+ bustCache?: boolean;
672
+ /**
673
+ * Filled in with where each construct was found, when provided.
674
+ *
675
+ * Discovery is the only thing that knows: it globbed the files and imported
676
+ * them. Everything downstream that needs to *write* an import — the build,
677
+ * generating a server entry that reads a surface's logger — would otherwise
678
+ * have to be told the path in config, which is the string this removes.
679
+ *
680
+ * An out-parameter rather than a second return value so that every existing
681
+ * caller, which wants the manifest and nothing else, is unchanged.
682
+ */
683
+ sources?: Record<string, ConstructSource>;
684
+ /**
685
+ * Filled in, when provided, with the files each worker's background work is
686
+ * declared in — its crons, queue consumers and topic subscribers — keyed by
687
+ * the worker.
688
+ *
689
+ * What says which app's build carries a worker's entry: the one whose
690
+ * directory holds its work. A worker declares no path of its own.
691
+ */
692
+ background?: Record<string, string[]>;
693
+ /**
694
+ * Filled in, when provided, with the files that export something built
695
+ * from each surface — an endpoint, a WebSocket route — keyed by the
696
+ * surface. What a surface that serves itself imports its routes from.
697
+ */
698
+ served?: Record<string, string[]>;
699
+ /**
700
+ * Filled in, when provided, with each worker's subscribers — by the export
701
+ * a push route is named after, and the key its deliveries come from: its
702
+ * topic's, or its bucket's events — keyed by the worker.
703
+ *
704
+ * What says which worker SNS pushes to, and on which paths: a build bound
705
+ * for a server records no subscriber in the manifest, because none has a
706
+ * handler of its own there.
707
+ */
708
+ subscribers?: Record<string, BoundSubscriber[]>;
709
+ /**
710
+ * Import the construct modules in this sandbox rather than in this
711
+ * process. Defaults to the run's own (`withSandbox`), so a deploy's every
712
+ * discovery — the engine's included — happens there; with neither, they
713
+ * are imported here, as before.
714
+ */
715
+ sandbox?: Sandbox;
716
+ }
717
+ /** A worker's subscriber — to a topic or to a bucket — as discovery found it. */
718
+ interface BoundSubscriber {
719
+ /** Its export — what its push route is named after. */
720
+ name: string;
721
+ /**
722
+ * The env key its deliveries come from: its topic's publisher connection
723
+ * string, or its bucket's events connection string. An `sns://` value is
724
+ * what makes SNS push to it.
725
+ */
726
+ connectionKey: string;
727
+ /**
728
+ * The event types a topic subscriber names — its SNS subscription's filter
729
+ * on the `type` attribute the topic's publisher sets. Absent for a
730
+ * bucket's subscriber: S3 sets no such attribute, and the subscriber's own
731
+ * filter decides.
732
+ */
733
+ events?: readonly string[];
734
+ }
735
+ /** Importing a construct module, or declaring one, threw in the sandbox. */
736
+ declare class ConstructDiscoveryFailed extends Error {
737
+ readonly errorName: string;
738
+ readonly detail: string;
739
+ constructor(errorName: string, detail: string);
740
+ }
741
+ /**
742
+ * The constructs' declarations hold something that is not data, and the
743
+ * sandbox they were discovered in hands the deploy nothing but data.
744
+ */
745
+ declare class ConstructsNotSerializable extends Error {
746
+ readonly paths: readonly string[];
747
+ constructor(paths: readonly string[]);
748
+ }
749
+ /** Where a construct was declared, and under what name. */
750
+ interface ConstructSource {
751
+ /** Absolute path to the module that exported it. */
752
+ file: string;
753
+ /** The name it was exported as — what an import statement has to say. */
754
+ exportName: string;
755
+ /**
756
+ * The exported construct itself.
757
+ *
758
+ * What a declaration cannot say — whether it serves itself — the object can
759
+ * be asked, and discovery already imported it.
760
+ */
761
+ construct: unknown;
762
+ }
763
+ /**
764
+ * Build the construct manifest for a project.
765
+ *
766
+ * Runs the manifest's own validation before returning, so an app is wrong here
767
+ * — where the error names a file — rather than at deploy.
768
+ *
769
+ * @throws {DuplicateConstruct} when two exports claim one id.
770
+ */
771
+ declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
772
+ //#endregion
773
+ //#region src/providers/types.d.ts
774
+ /** The manifest kinds a stage can name a provider for. */
775
+ declare const PROVIDER_KINDS: readonly ['objects', 'inbox', 'email'];
776
+ type ProviderKind = (typeof PROVIDER_KINDS)[number];
777
+ //#endregion
778
+ //#region src/providers/ses/config.d.ts
779
+ /** `inbox: { provider: 'ses' }` — each inbox received by SES in the stage's account. */
780
+ interface SesInboxConfig {
781
+ provider: 'ses';
782
+ /**
783
+ * Where mail is received, and the inbox's bucket and topic live. Defaults
784
+ * to the secrets store's region, then `AWS_REGION` — and must be one SES
785
+ * receives mail in.
786
+ */
787
+ region?: string;
788
+ }
789
+ /**
790
+ * `email: { provider: 'ses' }` — each mail construct sends through SES's SMTP
791
+ * interface in the stage's account.
792
+ */
793
+ interface SesEmailConfig {
794
+ provider: 'ses';
795
+ /**
796
+ * Where mail is sent from: the identity, and the SMTP endpoint the URL
797
+ * names. Defaults to the secrets store's region, then `AWS_REGION`.
798
+ */
799
+ region?: string;
800
+ /**
801
+ * The address mail is sent from — what `<ID>_FROM` holds. Its domain is
802
+ * the SES identity the deploy verifies. Defaults to `noreply@` the
803
+ * stage's domain.
804
+ */
805
+ from?: string;
806
+ }
807
+ //#endregion
808
+ //#region src/deploy/credentials.d.ts
809
+ /**
810
+ * What each kind of credential is asked for with, and what it is.
811
+ *
812
+ * A target that needs a kind the CLI does not know declares it by augmenting
813
+ * this interface, and lists it in its `credentials`:
814
+ *
815
+ * ```ts
816
+ * declare module '@geekmidas/cli/target' {
817
+ * interface CredentialKinds {
818
+ * fly: { request: { org: string }; value: { token: string } };
819
+ * }
820
+ * }
821
+ * ```
822
+ */
823
+ interface CredentialKinds {
824
+ /** The Dokploy API a stage deploys through. */
825
+ dokploy: {
826
+ /** `deploy.dokploy.endpoint`, when the config names one. */
827
+ request: {
828
+ endpoint?: string;
829
+ };
830
+ value: {
831
+ endpoint: string;
832
+ token: string;
833
+ };
834
+ };
835
+ /**
836
+ * A container registry login, for Dokploy to pull with. Asked for only when
837
+ * Dokploy has no registry for `deploy.registry` and one has to be
838
+ * created.
839
+ */
840
+ registry: {
841
+ /** `deploy.registry`. */
842
+ request: {
843
+ url: string;
844
+ };
845
+ value: {
846
+ username: string;
847
+ password: string;
848
+ };
849
+ };
850
+ /**
851
+ * The AWS account a stage deploys to, for the SST target's `sst deploy`.
852
+ * Handed to that one command's environment and to nothing else.
853
+ */
854
+ aws: {
855
+ /** The stage, for a provider that keeps one account per stage. */
856
+ request: {
857
+ stage: string;
858
+ };
859
+ value: AwsCredential;
860
+ };
861
+ /**
862
+ * A GoDaddy Personal Access Token, for a `dns` domain whose provider is
863
+ * `godaddy`. Read on the machine that writes the records — never the
864
+ * server's.
865
+ */
866
+ godaddy: {
867
+ request: Record<never, never>;
868
+ value: GoDaddyCredential;
869
+ };
870
+ /**
871
+ * A Hostinger API token, for a `dns` domain whose provider is
872
+ * `hostinger`. Like GoDaddy's, read where the records are written.
873
+ */
874
+ hostinger: {
875
+ request: Record<never, never>;
876
+ value: HostingerCredential;
877
+ };
878
+ }
879
+ /** A Hostinger API token, from hpanel.hostinger.com/profile/api. */
880
+ interface HostingerCredential {
881
+ token: string;
882
+ }
883
+ /** A GoDaddy Personal Access Token, sent as `Authorization: Bearer <token>`. */
884
+ interface GoDaddyCredential {
885
+ token: string;
886
+ }
887
+ /**
888
+ * Who to act as on AWS: a named profile, or keys.
889
+ *
890
+ * Never both. Given both, every AWS SDK takes the keys and ignores the
891
+ * profile, so `--profile prod` with staging's keys still exported would deploy
892
+ * production's stack into staging's account — the reason `secretsStoreFor`
893
+ * resolves a named profile on its own, and why this cannot express the mix.
894
+ */
895
+ type AwsCredential = {
896
+ /** A profile in `~/.aws/config` — keys, SSO, an assumed role. */
897
+ profile: string;
898
+ region?: string;
899
+ } | {
900
+ accessKeyId: string;
901
+ secretAccessKey: string;
902
+ /** Present for temporary keys: an assumed role, GitHub's OIDC. */
903
+ sessionToken?: string;
904
+ region?: string;
905
+ };
906
+ type CredentialKind = keyof CredentialKinds;
907
+ /** What a deploy asks a provider for. */
908
+ type CredentialRequest<K extends CredentialKind = CredentialKind> = { [P in K]: {
909
+ kind: P;
910
+ } & CredentialKinds[P]['request']; }[K];
911
+ /** What a provider answers with. */
912
+ type Credential<K extends CredentialKind> = CredentialKinds[K]['value'];
913
+ interface CredentialProvider {
914
+ /**
915
+ * The credential `request` asks for, or `undefined` when this provider has
916
+ * none — the deploy then raises {@link MissingCredential}.
917
+ */
918
+ get<K extends CredentialKind>(request: CredentialRequest<K>, options?: {
919
+ signal?: AbortSignal;
920
+ }): Promise<Credential<K> | undefined>;
921
+ }
922
+ /** A deploy needed a credential, and its provider had none. */
923
+ declare class MissingCredential extends GkmError {
924
+ readonly kind: CredentialKind;
925
+ /** What it was for: the Dokploy endpoint or the registry URL. */
926
+ readonly target: string | undefined;
927
+ /** How to supply it. */
928
+ readonly howToProvide: string;
929
+ constructor(kind: CredentialKind,
930
+ /** What it was for: the Dokploy endpoint or the registry URL. */
931
+ target: string | undefined,
932
+ /** How to supply it. */
933
+ howToProvide?: string);
934
+ }
935
+ /** Whatever was asked for, from the first provider that has it. */
936
+ declare function chainCredentials(...providers: CredentialProvider[]): CredentialProvider;
937
+ interface StoredCredentialsOptions {
938
+ /** Where to read the variables from. Defaults to `process.env`. */
939
+ env?: NodeJS.ProcessEnv;
940
+ /**
941
+ * The CLI's home, whose `credentials.json` holds stored logins. Defaults
942
+ * to `GKM_HOME`, else `~/.gkm`.
943
+ */
944
+ home?: string;
945
+ }
946
+ /**
947
+ * Credentials from the environment, then from what `gkm login` stored. What
948
+ * `deploy()` uses when it is handed no provider.
949
+ *
950
+ * - Dokploy: `DOKPLOY_API_TOKEN` / `DOKPLOY_ENDPOINT`, each falling back to
951
+ * the stored login, and the endpoint finally to `deploy.dokploy.endpoint`.
952
+ * Each half is read on its own: a token is a secret and belongs in the
953
+ * environment, an endpoint is configuration and belongs in the config.
954
+ * - Registry: `DOCKER_REGISTRY_USERNAME` / `DOCKER_REGISTRY_PASSWORD`.
955
+ * - AWS: `AWS_PROFILE` when it is set, and then nothing else; otherwise
956
+ * `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`. The
957
+ * profile winning is `secretsStoreFor`'s rule: a profile is a choice of
958
+ * account someone made, exported keys may be left over from another.
959
+ * Read here, by name, and handed only to the command that deploys — the
960
+ * sandbox every other step runs in passes no `AWS_*` on.
961
+ */
962
+ declare function storedCredentials(options?: StoredCredentialsOptions): CredentialProvider;
963
+ //#endregion
964
+ //#region src/deploy/types.d.ts
965
+ /** Result for a single app deployment in workspace mode */
966
+ interface AppDeployResult {
967
+ /** App name */
968
+ appName: string;
969
+ /** App type */
970
+ type: 'backend' | 'web' | 'mobile';
971
+ /** Whether deployment succeeded */
972
+ success: boolean;
973
+ /** Dokploy application ID */
974
+ applicationId?: string;
975
+ /** Docker image reference */
976
+ imageRef?: string;
977
+ /** The registry's digest for the image, `sha256:…`, once pushed */
978
+ digest?: string;
979
+ /** Deployment URL */
980
+ url?: string;
981
+ /** Error message if failed */
982
+ error?: string;
983
+ }
984
+ /** Result from workspace deployment */
985
+ interface WorkspaceDeployResult {
986
+ /** Results for each app */
987
+ apps: AppDeployResult[];
988
+ /** Dokploy project ID */
989
+ projectId: string;
990
+ /** Total number of successful deployments */
991
+ successCount: number;
992
+ /** Total number of failed deployments */
993
+ failedCount: number;
994
+ }
995
+ /**
996
+ * What a deploy did — or, for a dry run, would do. Plain JSON, so it can be
997
+ * written out as is (`gkm deploy --json` ends with it).
998
+ */
999
+ interface DeployResult extends WorkspaceDeployResult {
1000
+ stage: string;
1001
+ /** `<namespace>/<project>`. */
1002
+ identity: string;
1003
+ /** The image tag every app was built with. */
1004
+ tag: string;
1005
+ /** Whether this was a dry run: nothing was created, built or pushed. */
1006
+ dryRun: boolean;
1007
+ /** Dokploy's environment for the stage; empty when a dry run would create it. */
1008
+ environmentId: string;
1009
+ /** Apps left out, and why — a mobile app, another deploy target. */
1010
+ skipped: {
1011
+ app: string;
1012
+ reason: string;
1013
+ }[];
1014
+ /** Each deployed app's public URL. */
1015
+ urls: Record<string, string>;
1016
+ /**
1017
+ * Every resource the run touched, in order: what it applied, or for a dry
1018
+ * run, what it would.
1019
+ */
1020
+ changes: ResourceChange[];
1021
+ }
1022
+ //#endregion
1023
+ //#region src/deploy/events.d.ts
1024
+ /**
1025
+ * The stretch of a deploy an event belongs to.
1026
+ *
1027
+ * - `validate`: the config, the target, the stage, the apps, the lock, the
1028
+ * stage's secrets and what each app reads from its environment
1029
+ * - `plan`: a dry run's lookups — what would be created and what reused
1030
+ * - `provision`: what the apps run on — for Dokploy the project, environment
1031
+ * and registry — and the declared constructs
1032
+ * - `build`: each app's artifact, built without changing anything live
1033
+ * - `release`: the artifacts put live. Dokploy applies the stage's
1034
+ * migrations and runs its seeds, then builds and pushes each image here, beside its
1035
+ * application, because a site's build args are resolved per app — and
1036
+ * checks each backend before any site is released
1037
+ * - `verify`: what was released answers — for Dokploy, each site's DNS
1038
+ * records and health
1039
+ * - `rollback`: the previous release restored, after `release` or `verify`
1040
+ * failed, on a target that can
1041
+ */
1042
+ type DeployPhase = 'validate' | 'plan' | 'provision' | 'build' | 'release' | 'verify' | 'rollback';
1043
+ /** An error, as an event carries it. */
1044
+ interface DeployEventError {
1045
+ /** The error's class name — `MissingCredential`, `StateLocked`. */
1046
+ name: string;
1047
+ message: string;
1048
+ }
1049
+ /**
1050
+ * How a resource came to be used:
1051
+ * - `recorded`: the id the stage's state holds still resolves
1052
+ * - `resumed`: a run that died after creating it is picked up
1053
+ * - `found`: it existed and was looked up
1054
+ * - `created`: this run created it
1055
+ */
1056
+ type ResourceVia = 'recorded' | 'resumed' | 'found' | 'created';
1057
+ /** One resource a deploy touches, planned or applied. */
1058
+ interface ResourceChange {
1059
+ /** `<type>:<name>`, unique within the stage — `application:api`. */
1060
+ key: string;
1061
+ /** `project`, `environment`, `registry`, `application`, `domain`, `image`, or a construct's kind. */
1062
+ resourceType: string;
1063
+ /**
1064
+ * For a plan: whether the run would create it, reuse what exists, or
1065
+ * ensure it (look it up, and create it if missing). For an applied change:
1066
+ * what was done.
1067
+ */
1068
+ action: 'create' | 'reuse' | 'ensure' | 'build';
1069
+ /** The target's id, once there is one. */
1070
+ id?: string;
1071
+ }
1072
+ type DeployEvent = {
1073
+ type: 'deploy.started';
1074
+ stage: string;
1075
+ /** The target the run deploys through, by the name it was given. */
1076
+ target: string;
1077
+ /** `<namespace>/<project>`. */
1078
+ identity: string;
1079
+ tag: string;
1080
+ /** The apps this run deploys, in order. */
1081
+ apps: string[];
1082
+ dryRun: boolean;
1083
+ } | {
1084
+ type: 'phase.started';
1085
+ phase: DeployPhase;
1086
+ } | {
1087
+ type: 'phase.finished';
1088
+ phase: DeployPhase;
1089
+ } |
1090
+ /** A phase threw; `deploy.failed` follows (after a rollback, if any). */
1091
+ {
1092
+ type: 'phase.failed';
1093
+ phase: DeployPhase;
1094
+ error: DeployEventError;
1095
+ } |
1096
+ /**
1097
+ * A progress line, exactly as `gkm deploy` prints it — leading newline and
1098
+ * indentation included, so a terminal renderer prints `message` as is.
1099
+ */
1100
+ {
1101
+ type: 'log';
1102
+ level: 'info' | 'warn' | 'error';
1103
+ message: string;
1104
+ } | {
1105
+ type: 'app.skipped';
1106
+ app: string;
1107
+ reason: string;
1108
+ } | ({
1109
+ type: 'resource.planned';
1110
+ } & ResourceChange) | ({
1111
+ type: 'resource.applied';
1112
+ via: ResourceVia;
1113
+ } & ResourceChange & {
1114
+ id: string;
1115
+ }) | {
1116
+ type: 'artifact.built';
1117
+ app: string;
1118
+ imageRef: string;
1119
+ /** The registry's digest, `sha256:…`, once pushed. */
1120
+ digest?: string;
1121
+ } | {
1122
+ type: 'app.deployed';
1123
+ app: string;
1124
+ applicationId: string;
1125
+ imageRef: string;
1126
+ url: string;
1127
+ } | {
1128
+ type: 'app.failed';
1129
+ app: string;
1130
+ error: DeployEventError;
1131
+ } |
1132
+ /** One check of whether a released app answers. */
1133
+ {
1134
+ type: 'health.checked';
1135
+ app: string;
1136
+ /** What was asked: a URL, or the target's own status check. */
1137
+ url: string;
1138
+ healthy: boolean;
1139
+ /** The HTTP status, when the check was a request. */
1140
+ status?: number;
1141
+ /** 1 for the first check of the app in this run. */
1142
+ attempt: number;
1143
+ } |
1144
+ /**
1145
+ * A deployed stage runs a dev service — `--allow-dev-services` — in place
1146
+ * of real mail or object storage: Mailpit delivers no mail, MinIO keeps
1147
+ * every object on one container's disk. A warning, every run.
1148
+ */
1149
+ {
1150
+ type: 'dev-service.used';
1151
+ service: 'minio' | 'mailpit';
1152
+ stage: string;
1153
+ /** The constructs it stands in for. */
1154
+ constructs: string[];
1155
+ } |
1156
+ /**
1157
+ * The stack's log UI (`deploy.compose.logs`) is up and answering: where
1158
+ * it is and how it is reached — through an SSH tunnel to a loopback
1159
+ * port, or publicly on a host that allows only some addresses.
1160
+ */
1161
+ {
1162
+ type: 'logs.ready';
1163
+ service: 'openobserve';
1164
+ access: 'tunnel' | 'public';
1165
+ /** Where a browser opens it: the tunnel's end, or its public host. */
1166
+ url: string;
1167
+ /** The loopback port it is published on, for a tunnel. */
1168
+ port?: number;
1169
+ /** The addresses a public host answers. */
1170
+ allow?: string[];
1171
+ email: string;
1172
+ } |
1173
+ /**
1174
+ * One construct's migrations applied by the deploy, before any app
1175
+ * started. Only for a construct that had one to apply.
1176
+ */
1177
+ {
1178
+ type: 'migration.applied';
1179
+ /** The construct, by id: `Database`. */
1180
+ construct: string;
1181
+ /** Its folder: `db/database/migrations`. */
1182
+ folder: string;
1183
+ /** The migrations applied, in order. */
1184
+ applied: string[];
1185
+ } |
1186
+ /**
1187
+ * One construct's seeds run by the deploy — after its migrations, before
1188
+ * any app started, every one of them on every deploy. Only for a
1189
+ * construct that has seeds.
1190
+ */
1191
+ {
1192
+ type: 'seed.ran';
1193
+ /** The construct, by id: `Database`. */
1194
+ construct: string;
1195
+ /** Its folder: `db/database/seeds`. */
1196
+ folder: string;
1197
+ /** The seeds run, in order. */
1198
+ seeded: string[];
1199
+ } | {
1200
+ type: 'deploy.finished';
1201
+ result: DeployResult;
1202
+ } | {
1203
+ type: 'deploy.failed';
1204
+ error: DeployEventError;
1205
+ };
1206
+ /** Every `type` a deploy event can have. */
1207
+ type DeployEventType = DeployEvent['type'];
1208
+ //#endregion
1209
+ //#region src/target/types.d.ts
1210
+ /**
1211
+ * Which family of defaults a target's deploys belong to.
1212
+ *
1213
+ * - `server`: the target runs containers the project controls, so a cache can
1214
+ * live in the database and events go through pg-boss.
1215
+ * - `aws`: the target runs on managed AWS services, so the defaults are
1216
+ * Upstash, S3 and SNS/SQS.
1217
+ *
1218
+ * `gkm dev` and `gkm build` choose backends by it, which is why a target from
1219
+ * a package declares it in its `package.json` too: they read it without
1220
+ * importing the target.
1221
+ */
1222
+ type DeployRuntime = 'server' | 'aws';
1223
+ /** What a target can do, beyond the phases every target has. */
1224
+ interface DeployTargetCapabilities {
1225
+ /**
1226
+ * Whether `rollback` restores the previous release. When it does, a failed
1227
+ * `release` or `verify` is rolled back before the deploy reports failure.
1228
+ */
1229
+ rollback: boolean;
1230
+ /**
1231
+ * Who applies database migrations: the target, as part of `release`, or
1232
+ * the app itself when it starts.
1233
+ */
1234
+ migrations: 'target' | 'app';
1235
+ /**
1236
+ * Whether the target builds container images — and so needs Docker where
1237
+ * the deploy runs, and a registry to push to.
1238
+ */
1239
+ images: boolean;
1240
+ /**
1241
+ * Whether it can also run the project's local stage — `gkm deploy --stage
1242
+ * <local>`. Only a target that runs on this machine can: a stack started
1243
+ * here is the local stage's, while one on a server is shared, and the local
1244
+ * stage's secrets are a developer's. Absent, a deploy refuses the local
1245
+ * stage with `UndeclaredStage`.
1246
+ */
1247
+ localStage?: boolean;
1248
+ /**
1249
+ * Whether it runs telemetry's self-hosted provider — OpenObserve beside
1250
+ * the apps — for a stage whose `deploy.telemetry` asks for it, or names
1251
+ * nothing. Absent, a stage that uses a `Telemetry` construct names a
1252
+ * provider of its own (`otlp`) or opts out with `false`.
1253
+ */
1254
+ selfHostedTelemetry?: boolean;
1255
+ }
1256
+ /** A failed validation of a target's options, issue by issue. */
1257
+ interface TargetOptionsIssue {
1258
+ readonly message: string;
1259
+ readonly path?: ReadonlyArray<PropertyKey | {
1260
+ readonly key: PropertyKey;
1261
+ }>;
1262
+ }
1263
+ type TargetOptionsResult<Output> = {
1264
+ readonly value: Output;
1265
+ readonly issues?: undefined;
1266
+ } | {
1267
+ readonly issues: ReadonlyArray<TargetOptionsIssue>;
1268
+ };
1269
+ /**
1270
+ * The schema a target's options are validated with: any Standard Schema —
1271
+ * a Zod, Valibot or ArkType schema is one.
1272
+ *
1273
+ * The interface is the Standard Schema spec's own, copied as the spec asks,
1274
+ * so a target's types do not depend on a package the CLI does not ship.
1275
+ */
1276
+ interface TargetOptionsSchema<Output = unknown> {
1277
+ readonly '~standard': {
1278
+ readonly version: 1;
1279
+ readonly vendor: string;
1280
+ readonly validate: (value: unknown) => TargetOptionsResult<Output> | Promise<TargetOptionsResult<Output>>;
1281
+ readonly types?: {
1282
+ readonly input: unknown;
1283
+ readonly output: Output;
1284
+ } | undefined;
1285
+ };
1286
+ }
1287
+ /**
1288
+ * The stage's secrets, as a target reads and writes them.
1289
+ *
1290
+ * Every secret value read through here is masked: a progress line that
1291
+ * would print one prints `***` instead, in the terminal and in the events.
1292
+ */
1293
+ interface DeploySecrets {
1294
+ /** Which kind of store holds them — `'file'`, `'s3'`, `'ssm'`, `'secrets-manager'`, or
1295
+ * a custom one's. */
1296
+ readonly store: string;
1297
+ /** The stage's secrets, or null when it has none yet. */
1298
+ read(): Promise<StageSecrets | null>;
1299
+ /** Replace the stage's secrets. */
1300
+ write(secrets: StageSecrets): Promise<void>;
1301
+ /** Mask `value` in everything this run prints or emits from now on. */
1302
+ mask(value: string): void;
1303
+ }
1304
+ /** Where a target's progress lines go: `log` events of the run. */
1305
+ interface DeployTargetLogger {
1306
+ info(message: string): void;
1307
+ warn(message: string): void;
1308
+ error(message: string): void;
1309
+ }
1310
+ /**
1311
+ * The events a target reports. The run's own — `deploy.*` and `phase.*` —
1312
+ * are the CLI's, which emits them around each phase it calls.
1313
+ */
1314
+ type TargetEvent = Exclude<DeployEvent, {
1315
+ type: 'deploy.started' | 'deploy.finished' | 'deploy.failed' | 'phase.started' | 'phase.finished' | 'phase.failed';
1316
+ }>;
1317
+ /** Everything a phase is handed. The same object for every phase of a run. */
1318
+ interface DeployPhaseContext<Options = undefined> {
1319
+ /** The name the target was resolved by — `deploy.default`, `--target`. */
1320
+ readonly target: string;
1321
+ /**
1322
+ * The workspace root. Never `process.cwd()`: a host deploys projects
1323
+ * that are not where it runs.
1324
+ */
1325
+ readonly cwd: string;
1326
+ readonly stage: string;
1327
+ /** The image tag, or whatever version label the target releases under. */
1328
+ readonly tag: string;
1329
+ /**
1330
+ * Whether `tag` was asked for (`--tag`) rather than made up for this run
1331
+ * — by the target's own `tag()`, else `<stage>-<timestamp>`. A target that
1332
+ * releases what CI already pushed when given one tells the two apart here.
1333
+ */
1334
+ readonly tagGiven: boolean;
1335
+ /**
1336
+ * The apps this target deploys, in dependency order: those asked for that
1337
+ * deploy here. Apps that deploy elsewhere are already in `skipped`.
1338
+ */
1339
+ readonly apps: readonly string[];
1340
+ /** The apps the run leaves out, and why. */
1341
+ readonly skipped: readonly {
1342
+ app: string;
1343
+ reason: string;
1344
+ }[];
1345
+ /** Who the deploy is, for naming and claiming what it creates. */
1346
+ readonly identity: DeployIdentity;
1347
+ /** The workspace, with its apps derived from the manifest. */
1348
+ readonly workspace: NormalizedWorkspace;
1349
+ /** What the workspace declares. */
1350
+ readonly manifest: ConstructManifest;
1351
+ /**
1352
+ * Where each Worker's crons, queues and subscribers are declared, from the
1353
+ * same discovery: which workers have work to run, and which app each is
1354
+ * built from (`workerUnits`).
1355
+ */
1356
+ readonly background?: Readonly<Record<string, readonly string[]>>;
1357
+ /**
1358
+ * Each Worker's subscribers, from the same discovery — by export, and the
1359
+ * key its deliveries come from: which of them SNS pushes to.
1360
+ */
1361
+ readonly subscribers?: Readonly<Record<string, readonly BoundSubscriber[]>>;
1362
+ /**
1363
+ * The DNS records the stage's providers asked for on this run, as
1364
+ * `dns-record` keys — set once they have run. A record a provider asked
1365
+ * for on an earlier deploy and not on this one is stale, and pruned with
1366
+ * the stack's. Unset when the providers did not run: then none of theirs
1367
+ * is pruned.
1368
+ */
1369
+ providerDns?: readonly string[];
1370
+ /** The target's options, as its `options` schema parsed them. */
1371
+ readonly options: Options;
1372
+ /**
1373
+ * Look everything up and report what would happen — as `resource.planned`
1374
+ * events — without changing anything. Only `validate` and `plan` run.
1375
+ */
1376
+ readonly dryRun: boolean;
1377
+ /**
1378
+ * When `release` or `verify` fails, roll back every app the run released
1379
+ * rather than only those that failed — for apps that must move together,
1380
+ * an API and the site built against it. Only a target that can roll back
1381
+ * reads it.
1382
+ */
1383
+ readonly atomic: boolean;
1384
+ /**
1385
+ * `--allow-dev-services`: a deployed stage runs the dev service for every
1386
+ * bucket and mail it does not account for — no key in its secrets, no
1387
+ * provider backing the kind. Off by default: a deployed stage's mail and
1388
+ * buckets come from its secrets or its providers, and a server target
1389
+ * refuses one that lacks them. The local stage ignores it — it always
1390
+ * runs both.
1391
+ */
1392
+ readonly allowDevServices: boolean;
1393
+ /**
1394
+ * `--skip-dns`: a server target neither writes its public hosts' DNS
1395
+ * records nor checks that they point at the stage's server — for a CDN or
1396
+ * proxy in front of it, or records written by another step.
1397
+ */
1398
+ readonly skipDns?: boolean;
1399
+ /** Where every credential comes from. Nothing prompts. */
1400
+ readonly credentials: CredentialProvider;
1401
+ /**
1402
+ * The stage's deploy state. A real run holds the stage's lock for every
1403
+ * phase; a dry run holds none and must write nothing.
1404
+ */
1405
+ readonly state: StateStore;
1406
+ readonly secrets: DeploySecrets;
1407
+ readonly logger: DeployTargetLogger;
1408
+ /** Fires when the run is stopped; every phase stops what it is doing. */
1409
+ readonly signal: AbortSignal;
1410
+ /**
1411
+ * Where the output of what a phase spawns goes: the host's terminal, its
1412
+ * stderr (so stdout carries only events), or nowhere.
1413
+ */
1414
+ readonly childOutput: 'inherit' | 'stderr' | 'ignore';
1415
+ /** Report progress. */
1416
+ emit(event: TargetEvent): void;
1417
+ /** Leave an app out of this run, with the reason a person will read. */
1418
+ skip(app: string, reason: string): void;
1419
+ /**
1420
+ * What a resource is called on the target: scoped by the stage and the
1421
+ * identity exactly as the constructs are — `name('api')` is
1422
+ * `production-shop-api`. Two workspaces, or two stages, never share one.
1423
+ */
1424
+ name(resource: string): string;
1425
+ }
1426
+ /** Why `rollback` was called: the phase that failed, and its error. */
1427
+ interface DeployFailure {
1428
+ readonly phase: 'release' | 'verify';
1429
+ readonly error: unknown;
1430
+ }
1431
+ /**
1432
+ * A deploy target.
1433
+ *
1434
+ * The CLI calls the phases in order — `validate`, then `plan` for a dry run,
1435
+ * or `provision → build → release → verify` for a real one — emitting
1436
+ * `phase.started`/`phase.finished` around each. Every phase must be safe to
1437
+ * run again: a deploy stopped part way is finished by deploying again, so a
1438
+ * phase finds what an earlier run made (through `state`) before making it.
1439
+ *
1440
+ * `Run` is whatever the target carries from one phase to the next within a
1441
+ * run — `validate` makes it, every later phase is handed it.
1442
+ *
1443
+ * ```ts
1444
+ * import { defineTarget } from '@geekmidas/cli/target';
1445
+ * import { z } from 'zod';
1446
+ *
1447
+ * export default defineTarget({
1448
+ * name: 'fly',
1449
+ * runtime: 'server',
1450
+ * capabilities: { rollback: true, migrations: 'target', images: true },
1451
+ * options: z.object({ org: z.string(), region: z.string().default('ams') }),
1452
+ * async validate(ctx) {
1453
+ * return { org: ctx.options.org, region: ctx.options.region };
1454
+ * },
1455
+ * async plan(ctx, run) { … },
1456
+ * async release(ctx, run) { … },
1457
+ * async rollback(ctx, run, failure) { … },
1458
+ * result(ctx, run) { … },
1459
+ * });
1460
+ * ```
1461
+ */
1462
+ interface DeployTarget<Options = undefined, Run = unknown> {
1463
+ /** The target's own name, for messages. Config refers to it by its key. */
1464
+ readonly name: string;
1465
+ readonly runtime: DeployRuntime;
1466
+ readonly capabilities: DeployTargetCapabilities;
1467
+ /**
1468
+ * What `deploy.targets` may pass it — `[package, options]` — validated
1469
+ * before any phase runs. Without one, the target takes no options.
1470
+ */
1471
+ readonly options?: TargetOptionsSchema<Options>;
1472
+ /**
1473
+ * The kinds of credential it asks the run's `CredentialProvider` for, so a
1474
+ * host or `gkm login` can collect them up front.
1475
+ */
1476
+ readonly credentials?: readonly CredentialKind[];
1477
+ /**
1478
+ * The tag a run releases under when none is asked for. Without one it is
1479
+ * `<stage>-<timestamp>`; a target that builds from the checkout can name
1480
+ * its images after the commit instead.
1481
+ */
1482
+ tag?(where: {
1483
+ readonly cwd: string;
1484
+ readonly stage: string;
1485
+ }): Promise<string>;
1486
+ /**
1487
+ * What the run is — the apps, the images, what each runs with — checked
1488
+ * before anything changes. A build-only run calls it too, so it checks
1489
+ * what building needs; what only a deploy needs is `ready`'s.
1490
+ */
1491
+ validate(ctx: DeployPhaseContext<Options>): Promise<Run>;
1492
+ /**
1493
+ * What only this target checks before a deploy changes anything — compose's
1494
+ * server address and its hosts' DNS. Run after `validate` and the stage's
1495
+ * own readiness check (every key it needs, after its providers wrote
1496
+ * theirs), on a deploy and its dry run. A build-only run never calls it:
1497
+ * an image needs none of it.
1498
+ */
1499
+ ready?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1500
+ /** A dry run: emit `resource.planned` for what a real run would do. */
1501
+ plan(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1502
+ /** Create or find what the apps run on, and what they declare. */
1503
+ provision?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1504
+ /** Build each app's artifact (`artifact.built`), changing nothing live. */
1505
+ build?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1506
+ /** Put the built artifacts live (`app.deployed`). */
1507
+ release(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1508
+ /** Check what was released answers (`health.checked`). */
1509
+ verify?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
1510
+ /**
1511
+ * Restore the previous release, after `release` or `verify` failed. Called
1512
+ * only when `capabilities.rollback` is true.
1513
+ */
1514
+ rollback?(ctx: DeployPhaseContext<Options>, run: Run, failure: DeployFailure): Promise<void>;
1515
+ /** What the run did, once its last phase has finished. */
1516
+ result(ctx: DeployPhaseContext<Options>, run: Run): DeployResult | Promise<DeployResult>;
1517
+ }
1518
+ /**
1519
+ * A target of any options and run state — what the CLI holds once a target
1520
+ * is resolved, its types left behind in the config that named it. The phases
1521
+ * are methods, so their parameters are compared bivariantly and every
1522
+ * `DeployTarget<O, R>` is one.
1523
+ */
1524
+ type AnyDeployTarget = DeployTarget<unknown, unknown>;
1525
+ /** A target's options type, from the target. */
1526
+ type TargetOptions<T> = T extends DeployTarget<infer O, infer _Run> ? O : never;
1527
+ /**
1528
+ * One `deploy.targets` entry:
1529
+ *
1530
+ * - `'@acme/gkm-target'` — a package, its default export the target
1531
+ * - a target object, from `defineTarget` or a package's factory
1532
+ * - `['@acme/gkm-target', { region: 'ams' }]` — either, with options
1533
+ */
1534
+ type DeployTargetEntry = string | AnyDeployTarget | readonly [string | AnyDeployTarget, unknown];
224
1535
  declare namespace json_schema_d_exports {
225
1536
  export { ArraySchema, BaseSchema, BooleanSchema, IntegerSchema, JSONSchema, NullSchema, NumberSchema, ObjectSchema, Schema$1 as Schema, SchemaType, StringSchema, _JSONSchema };
226
1537
  }
@@ -4612,17 +5923,18 @@ declare const FrameworkSchema: ZodUnion<readonly [ZodEnum<{
4612
5923
  */
4613
5924
  type Framework = output$1<typeof FrameworkSchema>;
4614
5925
  /**
4615
- * Supported deploy targets (Phase 1).
4616
- */
4617
- declare const SUPPORTED_DEPLOY_TARGETS: readonly ['dokploy'];
4618
- /**
4619
- * Phase 2 deploy targets (not yet implemented).
5926
+ * The built-in targets a config may name, both deployed by `gkm deploy`:
5927
+ * `dokploy`, and `sst`, which runs `sst deploy` on the manifest `gkm build`
5928
+ * writes.
4620
5929
  */
4621
- declare const PHASE_2_DEPLOY_TARGETS: readonly ['vercel', 'cloudflare'];
5930
+ declare const SUPPORTED_DEPLOY_TARGETS: string[];
5931
+ /** Built-in names reserved for targets that do not exist yet. */
5932
+ declare const PHASE_2_DEPLOY_TARGETS: string[];
4622
5933
  /**
4623
- * Check if a deploy target is supported.
5934
+ * Whether a config may name `target`: a usable built-in, or one of its own
5935
+ * `deploy.targets`.
4624
5936
  */
4625
- declare function isDeployTargetSupported(target: string): boolean;
5937
+ declare function isDeployTargetSupported(target: string, targets?: Record<string, unknown>): boolean;
4626
5938
  /**
4627
5939
  * Check if a deploy target is planned for Phase 2.
4628
5940
  */
@@ -4632,13 +5944,21 @@ declare function isPhase2DeployTarget(target: string): boolean;
4632
5944
  */
4633
5945
  declare function getDeployTargetError(target: string, appName?: string): string;
4634
5946
  /**
4635
- * Combined DNS config that supports both new multi-domain and legacy single-domain formats.
5947
+ * Single DNS provider config (for one domain).
4636
5948
  */
4637
- declare const DnsConfigWithLegacySchema: ZodUnion<readonly [ZodRecord<ZodString, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
5949
+ declare const DnsProviderSchema: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4638
5950
  provider: ZodLiteral<"hostinger">;
5951
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5952
+ mode: ZodLiteral<"cname">;
5953
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5954
+ }, $strict>]>>;
4639
5955
  ttl: ZodOptional<ZodNumber>;
4640
5956
  }, $strip>, ZodObject<{
4641
5957
  provider: ZodLiteral<"route53">;
5958
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5959
+ mode: ZodLiteral<"cname">;
5960
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5961
+ }, $strict>]>>;
4642
5962
  region: ZodOptional<ZodEnum<{
4643
5963
  "af-south-1": "af-south-1";
4644
5964
  "ap-east-1": "ap-east-1";
@@ -4672,67 +5992,25 @@ declare const DnsConfigWithLegacySchema: ZodUnion<readonly [ZodRecord<ZodString,
4672
5992
  hostedZoneId: ZodOptional<ZodString>;
4673
5993
  ttl: ZodOptional<ZodNumber>;
4674
5994
  }, $strip>, ZodObject<{
4675
- provider: ZodLiteral<"cloudflare">;
5995
+ provider: ZodLiteral<"godaddy">;
5996
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
5997
+ mode: ZodLiteral<"cname">;
5998
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
5999
+ }, $strict>]>>;
4676
6000
  ttl: ZodOptional<ZodNumber>;
4677
- }, $strip>, ZodObject<{
4678
- provider: ZodLiteral<"manual">;
4679
- }, $strip>], "provider">, ZodObject<{
4680
- provider: ZodCustom<{
4681
- name: string;
4682
- getRecords: Function;
4683
- upsertRecords: Function;
4684
- }, {
4685
- name: string;
4686
- getRecords: Function;
4687
- upsertRecords: Function;
4688
- }>;
4689
- ttl: ZodOptional<ZodNumber>;
4690
- }, $strip>]>>, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4691
- provider: ZodLiteral<"hostinger">;
4692
- ttl: ZodOptional<ZodNumber>;
4693
- domain: ZodString;
4694
- }, $strip>, ZodObject<{
4695
- provider: ZodLiteral<"route53">;
4696
- region: ZodOptional<ZodEnum<{
4697
- "af-south-1": "af-south-1";
4698
- "ap-east-1": "ap-east-1";
4699
- "ap-northeast-1": "ap-northeast-1";
4700
- "ap-northeast-2": "ap-northeast-2";
4701
- "ap-northeast-3": "ap-northeast-3";
4702
- "ap-south-1": "ap-south-1";
4703
- "ap-south-2": "ap-south-2";
4704
- "ap-southeast-1": "ap-southeast-1";
4705
- "ap-southeast-2": "ap-southeast-2";
4706
- "ap-southeast-3": "ap-southeast-3";
4707
- "ap-southeast-4": "ap-southeast-4";
4708
- "ca-central-1": "ca-central-1";
4709
- "eu-central-1": "eu-central-1";
4710
- "eu-central-2": "eu-central-2";
4711
- "eu-north-1": "eu-north-1";
4712
- "eu-south-1": "eu-south-1";
4713
- "eu-south-2": "eu-south-2";
4714
- "eu-west-1": "eu-west-1";
4715
- "eu-west-2": "eu-west-2";
4716
- "eu-west-3": "eu-west-3";
4717
- "me-central-1": "me-central-1";
4718
- "me-south-1": "me-south-1";
4719
- "sa-east-1": "sa-east-1";
4720
- "us-east-1": "us-east-1";
4721
- "us-east-2": "us-east-2";
4722
- "us-west-1": "us-west-1";
4723
- "us-west-2": "us-west-2";
4724
- }>>;
4725
- profile: ZodOptional<ZodString>;
4726
- hostedZoneId: ZodOptional<ZodString>;
4727
- ttl: ZodOptional<ZodNumber>;
4728
- domain: ZodString;
4729
6001
  }, $strip>, ZodObject<{
4730
6002
  provider: ZodLiteral<"cloudflare">;
6003
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6004
+ mode: ZodLiteral<"cname">;
6005
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6006
+ }, $strict>]>>;
4731
6007
  ttl: ZodOptional<ZodNumber>;
4732
- domain: ZodString;
4733
6008
  }, $strip>, ZodObject<{
4734
6009
  provider: ZodLiteral<"manual">;
4735
- domain: ZodString;
6010
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6011
+ mode: ZodLiteral<"cname">;
6012
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6013
+ }, $strict>]>>;
4736
6014
  }, $strip>], "provider">, ZodObject<{
4737
6015
  provider: ZodCustom<{
4738
6016
  name: string;
@@ -4743,17 +6021,20 @@ declare const DnsConfigWithLegacySchema: ZodUnion<readonly [ZodRecord<ZodString,
4743
6021
  getRecords: Function;
4744
6022
  upsertRecords: Function;
4745
6023
  }>;
6024
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6025
+ mode: ZodLiteral<"cname">;
6026
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6027
+ }, $strict>]>>;
4746
6028
  ttl: ZodOptional<ZodNumber>;
4747
- domain: ZodString;
4748
- }, $strip>]>]>;
4749
- type DnsConfig = output$1<typeof DnsConfigWithLegacySchema>;
6029
+ }, $strip>]>;
6030
+ type DnsProvider = output$1<typeof DnsProviderSchema>;
4750
6031
  /**
4751
6032
  * Backups configuration schema.
4752
6033
  *
4753
6034
  * Configures automatic backup destinations for database services.
4754
6035
  * On first deploy, creates S3 bucket with unique name and IAM credentials.
4755
6036
  */
4756
- declare const BackupsConfigSchema: ZodObject<{
6037
+ declare const DokployBackupsConfigSchema: ZodObject<{
4757
6038
  type: ZodLiteral<"s3">;
4758
6039
  profile: ZodOptional<ZodString>;
4759
6040
  region: ZodEnum<{
@@ -4788,16 +6069,13 @@ declare const BackupsConfigSchema: ZodObject<{
4788
6069
  schedule: ZodOptional<ZodString>;
4789
6070
  retention: ZodOptional<ZodNumber>;
4790
6071
  }, $strip>;
4791
- type BackupsConfig = output$1<typeof BackupsConfigSchema>;
6072
+ type DokployBackupsConfig = output$1<typeof DokployBackupsConfigSchema>;
4792
6073
  /**
4793
6074
  * Workspace configuration schema.
4794
6075
  */
4795
6076
  declare const WorkspaceConfigSchema: ZodObject<{
4796
6077
  name: ZodOptional<ZodString>;
4797
- constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4798
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4799
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4800
- }, $strip>]>>;
6078
+ constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
4801
6079
  apps: ZodOptional<ZodRecord<ZodString, ZodObject<{
4802
6080
  type: ZodDefault<ZodOptional<ZodEnum<{
4803
6081
  backend: "backend";
@@ -4807,39 +6085,14 @@ declare const WorkspaceConfigSchema: ZodObject<{
4807
6085
  path: ZodString;
4808
6086
  port: ZodNumber;
4809
6087
  dependencies: ZodOptional<ZodArray<ZodString>>;
4810
- deploy: ZodOptional<ZodEnum<{
4811
- cloudflare: "cloudflare";
4812
- dokploy: "dokploy";
4813
- vercel: "vercel";
4814
- }>>;
4815
- constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4816
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4817
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4818
- }, $strip>]>>;
4819
- routes: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4820
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4821
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4822
- }, $strip>]>>;
4823
- functions: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4824
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4825
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4826
- }, $strip>]>>;
4827
- crons: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4828
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4829
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4830
- }, $strip>]>>;
4831
- queues: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4832
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4833
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4834
- }, $strip>]>>;
4835
- topics: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4836
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4837
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4838
- }, $strip>]>>;
4839
- subscribers: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
4840
- paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
4841
- partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
4842
- }, $strip>]>>;
6088
+ deploy: ZodOptional<ZodString>;
6089
+ constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6090
+ routes: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6091
+ functions: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6092
+ crons: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6093
+ queues: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6094
+ topics: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
6095
+ subscribers: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
4843
6096
  envParser: ZodOptional<ZodString>;
4844
6097
  logger: ZodOptional<ZodString>;
4845
6098
  hooks: ZodOptional<ZodObject<{
@@ -4854,11 +6107,6 @@ declare const WorkspaceConfigSchema: ZodObject<{
4854
6107
  maxEntries: ZodOptional<ZodNumber>;
4855
6108
  websocket: ZodOptional<ZodBoolean>;
4856
6109
  }, $strip>]>>;
4857
- studio: ZodOptional<ZodUnion<readonly [ZodString, ZodBoolean, ZodObject<{
4858
- enabled: ZodOptional<ZodBoolean>;
4859
- path: ZodOptional<ZodString>;
4860
- schema: ZodOptional<ZodString>;
4861
- }, $strip>]>>;
4862
6110
  openapi: ZodOptional<ZodUnion<readonly [ZodBoolean, ZodObject<{
4863
6111
  enabled: ZodOptional<ZodBoolean>;
4864
6112
  title: ZodOptional<ZodString>;
@@ -4898,78 +6146,189 @@ declare const WorkspaceConfigSchema: ZodObject<{
4898
6146
  }>>;
4899
6147
  }, $strip>>;
4900
6148
  }, $strip>>;
4901
- deploy: ZodOptional<ZodObject<{
4902
- default: ZodOptional<ZodEnum<{
4903
- cloudflare: "cloudflare";
4904
- dokploy: "dokploy";
4905
- vercel: "vercel";
6149
+ domains: ZodOptional<ZodRecord<ZodString, ZodString>>;
6150
+ protectedSubdomains: ZodOptional<ZodArray<ZodString>>;
6151
+ dns: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
6152
+ provider: ZodLiteral<"hostinger">;
6153
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6154
+ mode: ZodLiteral<"cname">;
6155
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6156
+ }, $strict>]>>;
6157
+ ttl: ZodOptional<ZodNumber>;
6158
+ }, $strip>, ZodObject<{
6159
+ provider: ZodLiteral<"route53">;
6160
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6161
+ mode: ZodLiteral<"cname">;
6162
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6163
+ }, $strict>]>>;
6164
+ region: ZodOptional<ZodEnum<{
6165
+ "af-south-1": "af-south-1";
6166
+ "ap-east-1": "ap-east-1";
6167
+ "ap-northeast-1": "ap-northeast-1";
6168
+ "ap-northeast-2": "ap-northeast-2";
6169
+ "ap-northeast-3": "ap-northeast-3";
6170
+ "ap-south-1": "ap-south-1";
6171
+ "ap-south-2": "ap-south-2";
6172
+ "ap-southeast-1": "ap-southeast-1";
6173
+ "ap-southeast-2": "ap-southeast-2";
6174
+ "ap-southeast-3": "ap-southeast-3";
6175
+ "ap-southeast-4": "ap-southeast-4";
6176
+ "ca-central-1": "ca-central-1";
6177
+ "eu-central-1": "eu-central-1";
6178
+ "eu-central-2": "eu-central-2";
6179
+ "eu-north-1": "eu-north-1";
6180
+ "eu-south-1": "eu-south-1";
6181
+ "eu-south-2": "eu-south-2";
6182
+ "eu-west-1": "eu-west-1";
6183
+ "eu-west-2": "eu-west-2";
6184
+ "eu-west-3": "eu-west-3";
6185
+ "me-central-1": "me-central-1";
6186
+ "me-south-1": "me-south-1";
6187
+ "sa-east-1": "sa-east-1";
6188
+ "us-east-1": "us-east-1";
6189
+ "us-east-2": "us-east-2";
6190
+ "us-west-1": "us-west-1";
6191
+ "us-west-2": "us-west-2";
4906
6192
  }>>;
6193
+ profile: ZodOptional<ZodString>;
6194
+ hostedZoneId: ZodOptional<ZodString>;
6195
+ ttl: ZodOptional<ZodNumber>;
6196
+ }, $strip>, ZodObject<{
6197
+ provider: ZodLiteral<"godaddy">;
6198
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6199
+ mode: ZodLiteral<"cname">;
6200
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6201
+ }, $strict>]>>;
6202
+ ttl: ZodOptional<ZodNumber>;
6203
+ }, $strip>, ZodObject<{
6204
+ provider: ZodLiteral<"cloudflare">;
6205
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6206
+ mode: ZodLiteral<"cname">;
6207
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6208
+ }, $strict>]>>;
6209
+ ttl: ZodOptional<ZodNumber>;
6210
+ }, $strip>, ZodObject<{
6211
+ provider: ZodLiteral<"manual">;
6212
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6213
+ mode: ZodLiteral<"cname">;
6214
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6215
+ }, $strict>]>>;
6216
+ }, $strip>], "provider">, ZodObject<{
6217
+ provider: ZodCustom<{
6218
+ name: string;
6219
+ getRecords: Function;
6220
+ upsertRecords: Function;
6221
+ }, {
6222
+ name: string;
6223
+ getRecords: Function;
6224
+ upsertRecords: Function;
6225
+ }>;
6226
+ records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
6227
+ mode: ZodLiteral<"cname">;
6228
+ target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
6229
+ }, $strict>]>>;
6230
+ ttl: ZodOptional<ZodNumber>;
6231
+ }, $strip>]>>>;
6232
+ deploy: ZodOptional<ZodObject<{
6233
+ default: ZodOptional<ZodString>;
6234
+ targets: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodCustom<unknown, unknown>, ZodTuple<[ZodUnion<readonly [ZodString, ZodCustom<unknown, unknown>]>, ZodUnknown], null>]>>>;
6235
+ namespace: ZodOptional<ZodString>;
6236
+ registry: ZodOptional<ZodString>;
4907
6237
  dokploy: ZodOptional<ZodObject<{
4908
6238
  endpoint: ZodOptional<ZodURL>;
4909
6239
  endpoints: ZodOptional<ZodRecord<ZodString, ZodURL>>;
4910
- registry: ZodOptional<ZodString>;
4911
6240
  registryId: ZodOptional<ZodString>;
4912
- domains: ZodOptional<ZodRecord<ZodString, ZodString>>;
6241
+ backups: ZodOptional<ZodLazy<ZodObject<{
6242
+ type: ZodLiteral<"s3">;
6243
+ profile: ZodOptional<ZodString>;
6244
+ region: ZodEnum<{
6245
+ "af-south-1": "af-south-1";
6246
+ "ap-east-1": "ap-east-1";
6247
+ "ap-northeast-1": "ap-northeast-1";
6248
+ "ap-northeast-2": "ap-northeast-2";
6249
+ "ap-northeast-3": "ap-northeast-3";
6250
+ "ap-south-1": "ap-south-1";
6251
+ "ap-south-2": "ap-south-2";
6252
+ "ap-southeast-1": "ap-southeast-1";
6253
+ "ap-southeast-2": "ap-southeast-2";
6254
+ "ap-southeast-3": "ap-southeast-3";
6255
+ "ap-southeast-4": "ap-southeast-4";
6256
+ "ca-central-1": "ca-central-1";
6257
+ "eu-central-1": "eu-central-1";
6258
+ "eu-central-2": "eu-central-2";
6259
+ "eu-north-1": "eu-north-1";
6260
+ "eu-south-1": "eu-south-1";
6261
+ "eu-south-2": "eu-south-2";
6262
+ "eu-west-1": "eu-west-1";
6263
+ "eu-west-2": "eu-west-2";
6264
+ "eu-west-3": "eu-west-3";
6265
+ "me-central-1": "me-central-1";
6266
+ "me-south-1": "me-south-1";
6267
+ "sa-east-1": "sa-east-1";
6268
+ "us-east-1": "us-east-1";
6269
+ "us-east-2": "us-east-2";
6270
+ "us-west-1": "us-west-1";
6271
+ "us-west-2": "us-west-2";
6272
+ }>;
6273
+ schedule: ZodOptional<ZodString>;
6274
+ retention: ZodOptional<ZodNumber>;
6275
+ }, $strip>>>;
6276
+ verify: ZodOptional<ZodObject<{
6277
+ deploymentTimeoutMs: ZodOptional<ZodNumber>;
6278
+ healthCheckPath: ZodOptional<ZodString>;
6279
+ healthyAfter: ZodOptional<ZodNumber>;
6280
+ intervalMs: ZodOptional<ZodNumber>;
6281
+ healthTimeoutMs: ZodOptional<ZodNumber>;
6282
+ }, $strip>>;
4913
6283
  }, $strip>>;
4914
- dns: ZodOptional<ZodUnion<readonly [ZodRecord<ZodString, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4915
- provider: ZodLiteral<"hostinger">;
4916
- ttl: ZodOptional<ZodNumber>;
4917
- }, $strip>, ZodObject<{
4918
- provider: ZodLiteral<"route53">;
4919
- region: ZodOptional<ZodEnum<{
4920
- "af-south-1": "af-south-1";
4921
- "ap-east-1": "ap-east-1";
4922
- "ap-northeast-1": "ap-northeast-1";
4923
- "ap-northeast-2": "ap-northeast-2";
4924
- "ap-northeast-3": "ap-northeast-3";
4925
- "ap-south-1": "ap-south-1";
4926
- "ap-south-2": "ap-south-2";
4927
- "ap-southeast-1": "ap-southeast-1";
4928
- "ap-southeast-2": "ap-southeast-2";
4929
- "ap-southeast-3": "ap-southeast-3";
4930
- "ap-southeast-4": "ap-southeast-4";
4931
- "ca-central-1": "ca-central-1";
4932
- "eu-central-1": "eu-central-1";
4933
- "eu-central-2": "eu-central-2";
4934
- "eu-north-1": "eu-north-1";
4935
- "eu-south-1": "eu-south-1";
4936
- "eu-south-2": "eu-south-2";
4937
- "eu-west-1": "eu-west-1";
4938
- "eu-west-2": "eu-west-2";
4939
- "eu-west-3": "eu-west-3";
4940
- "me-central-1": "me-central-1";
4941
- "me-south-1": "me-south-1";
4942
- "sa-east-1": "sa-east-1";
4943
- "us-east-1": "us-east-1";
4944
- "us-east-2": "us-east-2";
4945
- "us-west-1": "us-west-1";
4946
- "us-west-2": "us-west-2";
4947
- }>>;
4948
- profile: ZodOptional<ZodString>;
4949
- hostedZoneId: ZodOptional<ZodString>;
4950
- ttl: ZodOptional<ZodNumber>;
4951
- }, $strip>, ZodObject<{
4952
- provider: ZodLiteral<"cloudflare">;
4953
- ttl: ZodOptional<ZodNumber>;
4954
- }, $strip>, ZodObject<{
4955
- provider: ZodLiteral<"manual">;
4956
- }, $strip>], "provider">, ZodObject<{
4957
- provider: ZodCustom<{
4958
- name: string;
4959
- getRecords: Function;
4960
- upsertRecords: Function;
4961
- }, {
4962
- name: string;
4963
- getRecords: Function;
4964
- upsertRecords: Function;
4965
- }>;
4966
- ttl: ZodOptional<ZodNumber>;
4967
- }, $strip>]>>, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
4968
- provider: ZodLiteral<"hostinger">;
4969
- ttl: ZodOptional<ZodNumber>;
4970
- domain: ZodString;
4971
- }, $strip>, ZodObject<{
4972
- provider: ZodLiteral<"route53">;
6284
+ compose: ZodOptional<ZodObject<{
6285
+ proxy: ZodOptional<ZodUnion<readonly [ZodEnum<{
6286
+ caddy: "caddy";
6287
+ traefik: "traefik";
6288
+ }>, ZodRecord<ZodString, ZodEnum<{
6289
+ caddy: "caddy";
6290
+ traefik: "traefik";
6291
+ }>>]>>;
6292
+ tls: ZodOptional<ZodRecord<ZodString, ZodObject<{
6293
+ certFile: ZodString;
6294
+ keyFile: ZodString;
6295
+ caFile: ZodOptional<ZodString>;
6296
+ }, $strict>>>;
6297
+ server: ZodOptional<ZodRecord<ZodString, ZodObject<{
6298
+ user: ZodString;
6299
+ host: ZodOptional<ZodString>;
6300
+ port: ZodOptional<ZodNumber>;
6301
+ }, $strict>>>;
6302
+ }, $strict>>;
6303
+ telemetry: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodLiteral<false>, ZodLiteral<"self-hosted">, ZodObject<{
6304
+ provider: ZodLiteral<"self-hosted">;
6305
+ port: ZodOptional<ZodNumber>;
6306
+ retentionDays: ZodOptional<ZodNumber>;
6307
+ public: ZodOptional<ZodObject<{
6308
+ allow: ZodArray<ZodString>;
6309
+ }, $strip>>;
6310
+ sampleRate: ZodOptional<ZodNumber>;
6311
+ }, $strict>, ZodObject<{
6312
+ provider: ZodLiteral<"otlp">;
6313
+ endpoint: ZodString;
6314
+ headers: ZodOptional<ZodRecord<ZodString, ZodString>>;
6315
+ sampleRate: ZodOptional<ZodNumber>;
6316
+ }, $strict>]>>>;
6317
+ objects: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
6318
+ inbox: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
6319
+ email: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
6320
+ backups: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
6321
+ }, $strip>>;
6322
+ stages: ZodObject<{
6323
+ local: ZodString;
6324
+ deployed: ZodArray<ZodString>;
6325
+ protected: ZodOptional<ZodArray<ZodString>>;
6326
+ }, $strip>;
6327
+ secrets: ZodOptional<ZodObject<{
6328
+ enabled: ZodOptional<ZodBoolean>;
6329
+ store: ZodOptional<ZodUnion<readonly [ZodLiteral<"file">, ZodObject<{
6330
+ provider: ZodLiteral<"s3">;
6331
+ bucket: ZodOptional<ZodString>;
4973
6332
  region: ZodOptional<ZodEnum<{
4974
6333
  "af-south-1": "af-south-1";
4975
6334
  "ap-east-1": "ap-east-1";
@@ -4999,33 +6358,9 @@ declare const WorkspaceConfigSchema: ZodObject<{
4999
6358
  "us-west-1": "us-west-1";
5000
6359
  "us-west-2": "us-west-2";
5001
6360
  }>>;
5002
- profile: ZodOptional<ZodString>;
5003
- hostedZoneId: ZodOptional<ZodString>;
5004
- ttl: ZodOptional<ZodNumber>;
5005
- domain: ZodString;
5006
- }, $strip>, ZodObject<{
5007
- provider: ZodLiteral<"cloudflare">;
5008
- ttl: ZodOptional<ZodNumber>;
5009
- domain: ZodString;
5010
- }, $strip>, ZodObject<{
5011
- provider: ZodLiteral<"manual">;
5012
- domain: ZodString;
5013
- }, $strip>], "provider">, ZodObject<{
5014
- provider: ZodCustom<{
5015
- name: string;
5016
- getRecords: Function;
5017
- upsertRecords: Function;
5018
- }, {
5019
- name: string;
5020
- getRecords: Function;
5021
- upsertRecords: Function;
5022
- }>;
5023
- ttl: ZodOptional<ZodNumber>;
5024
- domain: ZodString;
5025
- }, $strip>]>]>>;
5026
- backups: ZodOptional<ZodObject<{
5027
- type: ZodLiteral<"s3">;
5028
- profile: ZodOptional<ZodString>;
6361
+ prefix: ZodOptional<ZodString>;
6362
+ }, $strict>, ZodObject<{
6363
+ provider: ZodLiteral<"ssm">;
5029
6364
  region: ZodEnum<{
5030
6365
  "af-south-1": "af-south-1";
5031
6366
  "ap-east-1": "ap-east-1";
@@ -5055,19 +6390,8 @@ declare const WorkspaceConfigSchema: ZodObject<{
5055
6390
  "us-west-1": "us-west-1";
5056
6391
  "us-west-2": "us-west-2";
5057
6392
  }>;
5058
- schedule: ZodOptional<ZodString>;
5059
- retention: ZodOptional<ZodNumber>;
5060
- }, $strip>>;
5061
- }, $strip>>;
5062
- stages: ZodObject<{
5063
- local: ZodString;
5064
- deployed: ZodArray<ZodString>;
5065
- protected: ZodOptional<ZodArray<ZodString>>;
5066
- }, $strip>;
5067
- secrets: ZodOptional<ZodObject<{
5068
- enabled: ZodOptional<ZodBoolean>;
5069
- store: ZodOptional<ZodUnion<readonly [ZodLiteral<"file">, ZodObject<{
5070
- provider: ZodLiteral<"ssm">;
6393
+ }, $strict>, ZodObject<{
6394
+ provider: ZodLiteral<"secrets-manager">;
5071
6395
  region: ZodEnum<{
5072
6396
  "af-south-1": "af-south-1";
5073
6397
  "ap-east-1": "ap-east-1";
@@ -5097,13 +6421,16 @@ declare const WorkspaceConfigSchema: ZodObject<{
5097
6421
  "us-west-1": "us-west-1";
5098
6422
  "us-west-2": "us-west-2";
5099
6423
  }>;
6424
+ kmsKeyId: ZodOptional<ZodString>;
5100
6425
  }, $strict>, ZodObject<{
5101
6426
  provider: ZodCustom<{
5102
- pull: Function;
5103
- push: Function;
6427
+ name: string;
6428
+ read: Function;
6429
+ write: Function;
5104
6430
  }, {
5105
- pull: Function;
5106
- push: Function;
6431
+ name: string;
6432
+ read: Function;
6433
+ write: Function;
5107
6434
  }>;
5108
6435
  }, $strip>]>>;
5109
6436
  algorithm: ZodOptional<ZodString>;
@@ -5146,6 +6473,40 @@ declare const WorkspaceConfigSchema: ZodObject<{
5146
6473
  "us-west-2": "us-west-2";
5147
6474
  }>;
5148
6475
  profile: ZodOptional<ZodString>;
6476
+ }, $strip>, ZodObject<{
6477
+ provider: ZodLiteral<"s3">;
6478
+ bucket: ZodOptional<ZodString>;
6479
+ region: ZodEnum<{
6480
+ "af-south-1": "af-south-1";
6481
+ "ap-east-1": "ap-east-1";
6482
+ "ap-northeast-1": "ap-northeast-1";
6483
+ "ap-northeast-2": "ap-northeast-2";
6484
+ "ap-northeast-3": "ap-northeast-3";
6485
+ "ap-south-1": "ap-south-1";
6486
+ "ap-south-2": "ap-south-2";
6487
+ "ap-southeast-1": "ap-southeast-1";
6488
+ "ap-southeast-2": "ap-southeast-2";
6489
+ "ap-southeast-3": "ap-southeast-3";
6490
+ "ap-southeast-4": "ap-southeast-4";
6491
+ "ca-central-1": "ca-central-1";
6492
+ "eu-central-1": "eu-central-1";
6493
+ "eu-central-2": "eu-central-2";
6494
+ "eu-north-1": "eu-north-1";
6495
+ "eu-south-1": "eu-south-1";
6496
+ "eu-south-2": "eu-south-2";
6497
+ "eu-west-1": "eu-west-1";
6498
+ "eu-west-2": "eu-west-2";
6499
+ "eu-west-3": "eu-west-3";
6500
+ "me-central-1": "me-central-1";
6501
+ "me-south-1": "me-south-1";
6502
+ "sa-east-1": "sa-east-1";
6503
+ "us-east-1": "us-east-1";
6504
+ "us-east-2": "us-east-2";
6505
+ "us-west-1": "us-west-1";
6506
+ "us-west-2": "us-west-2";
6507
+ }>;
6508
+ prefix: ZodOptional<ZodString>;
6509
+ profile: ZodOptional<ZodString>;
5149
6510
  }, $strip>], "provider">, ZodObject<{
5150
6511
  provider: ZodCustom<{
5151
6512
  read: Function;
@@ -5155,6 +6516,13 @@ declare const WorkspaceConfigSchema: ZodObject<{
5155
6516
  write: Function;
5156
6517
  }>;
5157
6518
  }, $strip>]>>;
6519
+ test: ZodOptional<ZodObject<{
6520
+ factories: ZodOptional<ZodString>;
6521
+ }, $strict>>;
6522
+ dev: ZodOptional<ZodObject<{
6523
+ allowedOrigins: ZodOptional<ZodArray<ZodURL>>;
6524
+ discoveryPort: ZodOptional<ZodNumber>;
6525
+ }, $strict>>;
5158
6526
  }, $strict>;
5159
6527
  /**
5160
6528
  * Validate workspace configuration.
@@ -5176,42 +6544,59 @@ declare function formatValidationErrors(error: ZodError): string;
5176
6544
  //#endregion
5177
6545
  //#region src/workspace/types.d.ts
5178
6546
  /**
5179
- * Deploy target for an app.
5180
- *
5181
- * Specifies where the app will be deployed.
6547
+ * Where a stage — or one app — deploys, by target name: a built-in
6548
+ * (`dokploy`, `sst`) or a key of `deploy.targets`.
5182
6549
  *
5183
6550
  * @example
5184
6551
  * ```ts
5185
- * // Currently supported
5186
6552
  * deploy: 'dokploy'
5187
- *
5188
- * // Future support (not yet implemented)
5189
- * deploy: 'vercel'
5190
- * deploy: 'cloudflare'
6553
+ * deploy: 'acme' // deploy: { targets: { acme: '@acme/gkm-target' } }
5191
6554
  * ```
5192
6555
  */
5193
- type DeployTarget = 'dokploy' | 'vercel' | 'cloudflare';
6556
+ type DeployTargetName = 'dokploy' | 'compose' | 'sst' | (string & {});
6557
+ /**
6558
+ * A per-stage map, typed from the workspace's deployed stages: a key that is
6559
+ * not one is a type error. Untyped (`string`) stages accept any key, which the
6560
+ * schema then checks at load.
6561
+ */
6562
+ type StageMap<S extends string, V> = string extends S ? Record<string, V> : Partial<Record<S, V>>;
6563
+ /**
6564
+ * `domains: { <stage>: '<domain>' }` at the root of `defineWorkspace`, typed from
6565
+ * the deployed stages.
6566
+ */
6567
+ type DomainsInput<S extends string = string> = StageMap<S, string>;
6568
+ /** How one root domain's hosts point at a compose stage's server. */
6569
+ type DnsRecordsModeInput<S extends string = string> = 'a' | {
6570
+ mode: 'cname';
6571
+ target: string | StageMap<S, string>;
6572
+ };
6573
+ /** One root domain's DNS provider, its records mode typed from the stages. */
6574
+ type DnsDomainInput<S extends string = string> = DnsProvider extends (infer P) ? P extends unknown ? Omit<P, 'records'> & {
6575
+ records?: DnsRecordsModeInput<S>;
6576
+ } : never : never;
6577
+ /** `dns: { '<root domain>': { provider, … } }` at the root of `defineWorkspace`. */
6578
+ type DnsInput<S extends string = string> = Record<string, DnsDomainInput<S>>;
6579
+ /** Each root domain's DNS provider — `dns` at the root of the config. */
6580
+ type WorkspaceDnsConfig = Record<string, DnsProvider>;
5194
6581
  /**
5195
- * Stage-based domain configuration.
6582
+ * Each deployed stage's base domain — `domains` at the root of the config.
5196
6583
  *
5197
- * Maps deployment stages to base domains. The main frontend app
5198
- * gets the base domain, other apps get `{appName}.{baseDomain}`.
6584
+ * A fact about the deployment rather than the platform, so every target reads
6585
+ * it. The root site answers on the base domain; every other surface on
6586
+ * `{subdomain}.{domain}`, where the subdomain is the construct's own
6587
+ * `subdomain`, or its id kebab-cased.
5199
6588
  *
5200
6589
  * @example
5201
6590
  * ```ts
5202
- * domains: {
5203
- * development: 'dev.myapp.com',
5204
- * staging: 'staging.myapp.com',
5205
- * production: 'myapp.com',
5206
- * }
6591
+ * domains: { production: 'myapp.com', staging: 'staging.myapp.com' },
5207
6592
  *
5208
- * // Result for production stage:
5209
- * // - web (main frontend): myapp.com
5210
- * // - api: api.myapp.com
5211
- * // - auth: auth.myapp.com
6593
+ * // production:
6594
+ * // - new StaticSite('Web', { root: true }) → myapp.com
6595
+ * // - new RestApi('Api', { subdomain: 'api' }) → api.myapp.com
6596
+ * // - new RestApi('Webhooks', { … }) → webhooks.myapp.com
5212
6597
  * ```
5213
6598
  */
5214
- type DokployDomainsConfig = Record<string, string>;
6599
+ type DomainsConfig = Record<string, string>;
5215
6600
  /**
5216
6601
  * Per-app domain override configuration.
5217
6602
  *
@@ -5243,9 +6628,9 @@ type AppDomainConfig = string | Record<string, string>;
5243
6628
  * ```ts
5244
6629
  * deploy: {
5245
6630
  * default: 'dokploy',
6631
+ * registry: 'ghcr.io/myorg',
5246
6632
  * dokploy: {
5247
6633
  * endpoint: 'https://dokploy.myserver.com',
5248
- * registry: 'ghcr.io/myorg',
5249
6634
  * },
5250
6635
  * }
5251
6636
  * ```
@@ -5254,12 +6639,12 @@ type AppDomainConfig = string | Record<string, string>;
5254
6639
  * ```ts
5255
6640
  * deploy: {
5256
6641
  * default: 'dokploy',
6642
+ * registry: 'ghcr.io/myorg',
5257
6643
  * dokploy: {
5258
6644
  * endpoints: {
5259
6645
  * development: 'https://dev-dokploy.myserver.com',
5260
6646
  * production: 'https://dokploy.myserver.com',
5261
6647
  * },
5262
- * registry: 'ghcr.io/myorg',
5263
6648
  * },
5264
6649
  * }
5265
6650
  * ```
@@ -5269,16 +6654,288 @@ interface DokployWorkspaceConfig {
5269
6654
  endpoint?: string;
5270
6655
  /** Per-stage Dokploy API endpoints (overrides endpoint) */
5271
6656
  endpoints?: Record<string, string>;
5272
- /** Container registry for Docker images (e.g., 'ghcr.io/myorg') */
5273
- registry?: string;
5274
6657
  /** Registry ID in Dokploy (auto-configured) */
5275
6658
  registryId?: string;
6659
+ /** Dokploy's own backup schedule for the stage's Postgres, to an S3 destination. */
6660
+ backups?: DokployBackupsConfig;
6661
+ /** How a release is waited for and checked before it counts as live. */
6662
+ verify?: DokployVerifyConfig;
6663
+ }
6664
+ /**
6665
+ * How a Dokploy release is waited for and checked.
6666
+ *
6667
+ * A release counts once Dokploy's deployment has finished and the app has
6668
+ * answered its health route `healthyAfter` times in a row. One that does not
6669
+ * is rolled back.
6670
+ */
6671
+ interface DokployVerifyConfig {
6672
+ /** How long Dokploy may take to finish a deployment. Default 10 minutes. */
6673
+ deploymentTimeoutMs?: number;
6674
+ /**
6675
+ * The path each backend is checked on, under its domain. Default
6676
+ * `/health`, which every production server build serves. A site is
6677
+ * checked at `/`.
6678
+ */
6679
+ healthCheckPath?: string;
6680
+ /** Consecutive 2xx answers that make an app healthy. Default 3. */
6681
+ healthyAfter?: number;
6682
+ /** Between health checks, and the first wait between polls. Default 2s. */
6683
+ intervalMs?: number;
6684
+ /** How long an app may take to become healthy. Default 5 minutes. */
6685
+ healthTimeoutMs?: number;
6686
+ }
6687
+ /**
6688
+ * The `compose` target's own settings — `deploy.compose`. Read by `gkm
6689
+ * compose` and `gkm deploy --target compose` only; the Dokploy target never
6690
+ * consults it.
6691
+ *
6692
+ * @example
6693
+ * ```ts
6694
+ * deploy: { compose: { proxy: 'traefik' } }
6695
+ * ```
6696
+ */
6697
+ interface ComposeWorkspaceConfig<S extends string = string> {
6698
+ /**
6699
+ * What serves a stage's stack: `'caddy'` (the default) — the stack's own
6700
+ * Caddy on 80/443 — or `'traefik'`, the machine's shared Traefik edge,
6701
+ * which every stack registers its routes with.
6702
+ *
6703
+ * One value applies to every deployed stage; the local stage stays on
6704
+ * Caddy then. A map sets each stage it names, the local stage included,
6705
+ * so the local stack runs behind a Traefik edge on this machine — the
6706
+ * path the deployed stages take — only when the map names it.
6707
+ *
6708
+ * ```ts
6709
+ * proxy: 'traefik' // every deployed stage; local stays on Caddy
6710
+ * proxy: { development: 'traefik', production: 'traefik' }
6711
+ * ```
6712
+ */
6713
+ proxy?: ComposeProxy | StageMap<S, ComposeProxy>;
6714
+ /**
6715
+ * A stage's own certificate, by stage: a PEM certificate (with its chain)
6716
+ * and its key, relative to the workspace root or absolute. Either proxy
6717
+ * serves it, on any stage. Without one, a deployed stage's comes from
6718
+ * Let's Encrypt and the local stage's from gkm's local CA (`gkm trust`).
6719
+ *
6720
+ * ```ts
6721
+ * tls: { production: { certFile: 'certs/origin.pem', keyFile: 'certs/origin.key' } }
6722
+ * tls: {
6723
+ * development: {
6724
+ * certFile: 'certs/dev.pem',
6725
+ * keyFile: 'certs/dev-key.pem',
6726
+ * caFile: 'certs/rootCA.pem',
6727
+ * },
6728
+ * }
6729
+ * ```
6730
+ */
6731
+ tls?: StageMap<S, ComposeTlsConfig>;
6732
+ /**
6733
+ * Each deployed stage's server: the SSH login gkm drives its Docker
6734
+ * engine with (`DOCKER_HOST=ssh://user@host`). gkm runs where the deploy
6735
+ * starts — a CI runner, a laptop — and never on the server, which holds
6736
+ * Docker and this login and no cloud credentials. The host defaults to
6737
+ * the stage's `GKM_SERVER_IPV4` secret. Every deployed stage needs one;
6738
+ * the local stage runs on this machine's Docker.
6739
+ *
6740
+ * ```ts
6741
+ * server: { production: { user: 'deploy' } }
6742
+ * server: { staging: { user: 'deploy', host: 'staging.example.com', port: 2222 } }
6743
+ * ```
6744
+ */
6745
+ server?: StageMap<S, ComposeServerConfig>;
6746
+ }
6747
+ /** A deployed stage's server — `deploy.compose.server.<stage>`. */
6748
+ interface ComposeServerConfig {
6749
+ /** The SSH user, in the server's `docker` group. */
6750
+ user: string;
6751
+ /** The host to SSH to. Default: the stage's `GKM_SERVER_IPV4` secret. */
6752
+ host?: string;
6753
+ /** The SSH port. Default 22. */
6754
+ port?: number;
6755
+ }
6756
+ /** The proxies a compose stack can be served by — `deploy.compose.proxy`. */
6757
+ type ComposeProxy = 'caddy' | 'traefik';
6758
+ /** A stage's own certificate — `deploy.compose.tls.<stage>`. */
6759
+ interface ComposeTlsConfig {
6760
+ certFile: string;
6761
+ keyFile: string;
6762
+ /**
6763
+ * The root the certificate chains to, PEM, when no public CA issued it —
6764
+ * an mkcert root, a company CA. gkm's check after a start trusts it; on
6765
+ * the local stage the stack's containers are handed it too
6766
+ * (`NODE_EXTRA_CA_CERTS`). Without it, the check trusts what Node does by
6767
+ * default: its bundled roots, and `NODE_EXTRA_CA_CERTS` where it is set.
6768
+ */
6769
+ caFile?: string;
6770
+ }
6771
+ /**
6772
+ * Where one stage's telemetry goes, and how much of it — `deploy.telemetry`,
6773
+ * by stage.
6774
+ *
6775
+ * What is emitted is the application's (the `Telemetry` construct); where it
6776
+ * goes is this. A server target runs the self-hosted provider when a stage
6777
+ * names nothing; AWS has none, so a deployed AWS stage that uses telemetry
6778
+ * names a provider. `false` sends nothing. The local stage ignores this: `gkm
6779
+ * dev` and `gkm compose` on it always run OpenObserve, at 100%.
6780
+ *
6781
+ * @example
6782
+ * ```ts
6783
+ * telemetry: {
6784
+ * staging: 'self-hosted',
6785
+ * production: { provider: 'self-hosted', retentionDays: 14, sampleRate: 0.1 },
6786
+ * preview: { provider: 'otlp', endpoint: 'https://otlp.example.com', sampleRate: 0.5 },
6787
+ * scratch: false,
6788
+ * }
6789
+ * ```
6790
+ */
6791
+ type StageTelemetryConfig = 'self-hosted' | SelfHostedTelemetryConfig | OtlpTelemetryConfig | false;
6792
+ /**
6793
+ * What backs one deployed stage's buckets — `deploy.objects`, by stage.
6794
+ *
6795
+ * - `'external'` (the default) — the stage's secrets hold each bucket's URL,
6796
+ * set by you: S3, R2, any S3-compatible store.
6797
+ * - `{ provider: 's3' }` — every deploy of the stage creates (or repairs)
6798
+ * each bucket, its IAM user and key in the stage's AWS account, and writes
6799
+ * the bucket's URL into the stage's secrets, before its checks.
6800
+ * - `false` — the stage has no object storage; a bucket on it is refused.
6801
+ *
6802
+ * The local stage ignores this: `gkm dev` runs MinIO for every bucket.
6803
+ *
6804
+ * @example
6805
+ * ```ts
6806
+ * objects: {
6807
+ * production: { provider: 's3', region: 'eu-west-1', versioning: true },
6808
+ * staging: 'external',
6809
+ * }
6810
+ * ```
6811
+ */
6812
+ type StageObjectsConfig = 'external' | S3ObjectsConfig | false;
6813
+ /**
6814
+ * What receives one deployed stage's inboxes — `deploy.inbox`, by stage:
6815
+ *
6816
+ * - `{ provider: 'ses' }` — the deploy creates each inbox in the stage's AWS
6817
+ * account: its own bucket and topic, the domain's SES identity and MX
6818
+ * records, and a receipt rule in the region's active rule set.
6819
+ * - `'external'` — the default: the stage's secrets hold each inbox's keys.
6820
+ * - `false` — the stage receives no mail; an inbox on it is refused.
6821
+ *
6822
+ * Every local stage receives through Mailpit, whatever this says.
6823
+ *
6824
+ * @example
6825
+ * ```ts
6826
+ * inbox: { production: { provider: 'ses', region: 'eu-west-1' } }
6827
+ * ```
6828
+ */
6829
+ type StageInboxConfig = 'external' | SesInboxConfig | false;
6830
+ /**
6831
+ * What sends one deployed stage's mail — `deploy.email`, by stage:
6832
+ *
6833
+ * - `{ provider: 'ses' }` — the deploy creates what each `Email` construct
6834
+ * sends with in the stage's AWS account: the sender's domain as an SES
6835
+ * identity (its DKIM records through `dns`), an IAM user allowed only to
6836
+ * send as it, and its key — written as `<ID>_URL`, an `smtp://` URL with
6837
+ * the SMTP password derived from the key — and `<ID>_FROM`. A `<ID>_URL`
6838
+ * the stage's secrets already hold wins, and nothing is created for it.
6839
+ * - `'external'` — the default: the stage's secrets hold each construct's
6840
+ * `<ID>_URL` and `<ID>_FROM`, set by you.
6841
+ * - `false` — the stage sends no mail; an `Email` on it is refused.
6842
+ *
6843
+ * Every local stage sends to Mailpit, whatever this says.
6844
+ *
6845
+ * @example
6846
+ * ```ts
6847
+ * email: {
6848
+ * production: { provider: 'ses', region: 'eu-west-1' },
6849
+ * staging: 'external',
6850
+ * }
6851
+ * ```
6852
+ */
6853
+ type StageEmailConfig = 'external' | SesEmailConfig | false;
6854
+ /**
6855
+ * One deployed compose stage's backups — `deploy.backups`, by stage.
6856
+ *
6857
+ * A stage that runs Postgres is backed up whether it names one or not: every
6858
+ * day at 02:00 UTC, each backup kept 30 days, in the project bucket. An
6859
+ * entry changes when (`every`, or a five-field UTC `cron`, at most hourly)
6860
+ * and for how long (`keep`); `false` takes none, and deletes nothing.
6861
+ *
6862
+ * @example
6863
+ * ```ts
6864
+ * backups: {
6865
+ * production: { every: '6h', keep: '30d' },
6866
+ * staging: { cron: '30 3 * * *', keep: '7d' },
6867
+ * preview: false,
6868
+ * }
6869
+ * ```
6870
+ */
6871
+ type StageBackupsConfig = false | {
6872
+ /** `'6h'`, `'1d'` — counted from 02:00 UTC. At least `'1h'`. */
6873
+ every?: string;
6874
+ /** Five fields, in UTC: `'0 *\/6 * * *'`. */
6875
+ cron?: string;
6876
+ /** How long a backup is kept: `'30d'`. */
6877
+ keep?: string;
6878
+ };
6879
+ /** `objects: { provider: 's3' }` — a bucket per construct in the stage's account. */
6880
+ interface S3ObjectsConfig {
6881
+ provider: 's3';
6882
+ /**
6883
+ * Where the buckets are created. Defaults to the secrets store's region,
6884
+ * then `AWS_REGION`.
6885
+ */
6886
+ region?: string;
6887
+ /** Keep previous versions of every object. Defaults to the construct's own `versioned`. */
6888
+ versioning?: boolean;
6889
+ /**
6890
+ * Serve each file server through a CDN on `<fileserver>.<domain>`: a
6891
+ * CloudFront distribution reading the bucket, its certificate and its DNS
6892
+ * records, all created by the deploy. On by default, which needs the
6893
+ * stage to have a domain; `false` serves from the bucket's own endpoint.
6894
+ */
6895
+ cdn?: boolean;
6896
+ }
6897
+ /** Shared by every provider. */
6898
+ interface TelemetryProviderConfig {
6899
+ /**
6900
+ * The fraction of traces kept, decided where a trace starts and followed
6901
+ * by every service it reaches (`parentbased_traceidratio`). Logs are not
6902
+ * sampled. 0 to 1; default 1.
6903
+ */
6904
+ sampleRate?: number;
6905
+ }
6906
+ /**
6907
+ * The target runs the collector and its UI: OpenObserve, in a compose stack,
6908
+ * reached through an SSH tunnel by default.
6909
+ */
6910
+ interface SelfHostedTelemetryConfig extends TelemetryProviderConfig {
6911
+ provider: 'self-hosted';
6912
+ /**
6913
+ * The port it is published on, on 127.0.0.1 only — reached from another
6914
+ * machine through an SSH tunnel. Default 5080.
6915
+ */
6916
+ port?: number;
5276
6917
  /**
5277
- * Stage-based domain configuration.
5278
- * The main frontend app gets the base domain.
5279
- * Other apps get {appName}.{baseDomain} by default.
6918
+ * How many days of data it keeps (OpenObserve's
6919
+ * `ZO_COMPACT_DATA_RETENTION_DAYS`). At least 3; default 30.
5280
6920
  */
5281
- domains?: DokployDomainsConfig;
6921
+ retentionDays?: number;
6922
+ /**
6923
+ * Serve it on the `Telemetry` construct's label under the stage's domain —
6924
+ * `telemetry.<stage domain>` by default — through the stack's proxy, to these
6925
+ * addresses only (IPs or CIDRs), instead of on a loopback port. Every
6926
+ * other address is answered 403.
6927
+ */
6928
+ public?: {
6929
+ allow: string[];
6930
+ };
6931
+ }
6932
+ /** Any OTLP/HTTP endpoint — a collector, a vendor's ingest. */
6933
+ interface OtlpTelemetryConfig extends TelemetryProviderConfig {
6934
+ provider: 'otlp';
6935
+ /** The OTLP/HTTP base URL; `/v1/traces` and `/v1/logs` are added to it. */
6936
+ endpoint: string;
6937
+ /** Headers sent with every export — `{ 'x-team': 'shop' }`. */
6938
+ headers?: Record<string, string>;
5282
6939
  }
5283
6940
  /**
5284
6941
  * Deployment configuration for the workspace.
@@ -5290,37 +6947,84 @@ interface DokployWorkspaceConfig {
5290
6947
  * default: 'dokploy',
5291
6948
  * }
5292
6949
  *
5293
- * // Full configuration with DNS and backups
6950
+ * // Full configuration with backups (domains and dns are at the root)
5294
6951
  * deploy: {
5295
6952
  * default: 'dokploy',
6953
+ * registry: 'ghcr.io/myorg',
5296
6954
  * dokploy: {
5297
6955
  * endpoint: 'https://dokploy.myserver.com',
5298
6956
  * projectId: 'proj_abc123',
5299
- * registry: 'ghcr.io/myorg',
5300
- * domains: {
5301
- * production: 'myapp.com',
5302
- * },
5303
- * },
5304
- * dns: {
5305
- * provider: 'hostinger',
5306
- * domain: 'myapp.com',
5307
- * },
5308
- * backups: {
5309
- * type: 's3',
5310
- * region: 'us-east-1',
6957
+ * backups: { type: 's3', region: 'us-east-1' },
5311
6958
  * },
5312
6959
  * }
5313
6960
  * ```
5314
6961
  */
5315
- interface DeployConfig {
6962
+ interface DeployConfig<S extends string = string> {
5316
6963
  /** Default deploy target for all apps (default: 'dokploy') */
5317
- default?: DeployTarget;
6964
+ default?: DeployTargetName;
6965
+ /**
6966
+ * Targets that do not ship with the CLI, by the name `default` (or an
6967
+ * app's `deploy`) uses: a package whose default export is the target, a
6968
+ * target object, or either with its options.
6969
+ *
6970
+ * ```ts
6971
+ * targets: {
6972
+ * acme: '@acme/gkm-target',
6973
+ * fly: ['@acme/gkm-fly', { org: 'acme' }],
6974
+ * local: defineTarget({ … }),
6975
+ * }
6976
+ * ```
6977
+ *
6978
+ * A package is never guessed from a name: it is installed and listed here.
6979
+ * A built-in's name cannot be taken.
6980
+ */
6981
+ targets?: Record<string, DeployTargetEntry>;
6982
+ /**
6983
+ * Whose deploy this is, on a target shared with other workspaces — an
6984
+ * organisation or a team, lowercase `[a-z0-9-]`. Two workspaces with the
6985
+ * same name deploying to one Dokploy are kept apart by it: it is in the
6986
+ * project's ownership marker, the image path
6987
+ * (`<registry>/<namespace>/<project>-<app>`) and every resource name.
6988
+ *
6989
+ * Defaults to the kebab-cased workspace name, which adds nothing to the
6990
+ * names a workspace was already deployed under.
6991
+ */
6992
+ namespace?: string;
6993
+ /**
6994
+ * The container registry the apps' images are pushed to and pulled from,
6995
+ * whatever the target — `ghcr.io/myorg`. An image is
6996
+ * `<registry>/<namespace>/<project>-<app>:<tag>`.
6997
+ */
6998
+ registry?: string;
5318
6999
  /** Dokploy-specific configuration */
5319
7000
  dokploy?: DokployWorkspaceConfig;
5320
- /** DNS configuration for automatic record creation */
5321
- dns?: DnsConfig;
5322
- /** Backup destination configuration for database services */
5323
- backups?: BackupsConfig;
7001
+ /** What the `compose` target runs beside the apps — see {@link ComposeWorkspaceConfig}. */
7002
+ compose?: ComposeWorkspaceConfig<S>;
7003
+ /**
7004
+ * Where each deployed stage's telemetry goes — see
7005
+ * {@link StageTelemetryConfig}.
7006
+ */
7007
+ telemetry?: StageMap<S, StageTelemetryConfig>;
7008
+ /**
7009
+ * What backs each deployed stage's buckets — the `objects` kind that
7010
+ * `ObjectStorage` and `FileServer` produce. See {@link StageObjectsConfig}.
7011
+ */
7012
+ objects?: StageMap<S, StageObjectsConfig>;
7013
+ /**
7014
+ * What receives each deployed stage's inboxes — the `inbox` kind `Inbox`
7015
+ * produces. See {@link StageInboxConfig}.
7016
+ */
7017
+ inbox?: StageMap<S, StageInboxConfig>;
7018
+ /**
7019
+ * What sends each deployed stage's mail — the `email` kind `Email`
7020
+ * produces. See {@link StageEmailConfig}.
7021
+ */
7022
+ email?: StageMap<S, StageEmailConfig>;
7023
+ /**
7024
+ * When each deployed compose stage's databases are backed up, and how
7025
+ * long a backup is kept — see {@link StageBackupsConfig}.
7026
+ */
7027
+ backups?: StageMap<S, StageBackupsConfig>;
5324
7028
  }
5325
7029
  /**
5326
7030
  * Models package configuration for shared schemas.
@@ -5406,7 +7110,7 @@ interface StagesConfig {
5406
7110
  *
5407
7111
  * Configures how secrets are encrypted for deployment.
5408
7112
  * Secrets are stored encrypted in `.gkm/secrets/{stage}.json`
5409
- * with keys stored separately in `~/.gkm/{project}/{stage}.key`.
7113
+ * with keys stored separately in `~/.gkm/keys/{namespace}/{project}/{stage}.key`.
5410
7114
  *
5411
7115
  * @example
5412
7116
  * ```ts
@@ -5423,8 +7127,13 @@ interface SecretsConfig {
5423
7127
  /**
5424
7128
  * Where deployed stages' secrets live, so a deploy can reach them from
5425
7129
  * anywhere: `'file'` (default — the encrypted `.gkm/secrets/<stage>.json`,
5426
- * which cannot serve CI while `.gkm/` is gitignored), `{ provider: 'ssm',
5427
- * region }` (each stage's secrets in its own AWS account), or any object
7130
+ * which cannot serve CI while `.gkm/` is gitignored), `{ provider: 's3',
7131
+ * region?, bucket?, prefix? }` (each stage's secrets in one object in the
7132
+ * project bucket beside the deploy state, SSE-S3 and versioned, no size
7133
+ * limit; region and prefix default to an S3 `state`'s), `{ provider: 'ssm',
7134
+ * region }` (each stage's secrets in an SSM parameter in its own AWS
7135
+ * account, up to 8 KB), `{ provider: 'secrets-manager', region, kmsKeyId? }`
7136
+ * (a Secrets Manager secret in its own account, up to 64 KB), or any object
5428
7137
  * implementing `SecretsStore`. The local stage always uses the file.
5429
7138
  */
5430
7139
  store?: SecretsStoreConfig;
@@ -5494,7 +7203,7 @@ interface AppConfigBase {
5494
7203
  * Overrides `deploy.default` for this specific app.
5495
7204
  * @example 'dokploy', 'vercel'
5496
7205
  */
5497
- deploy?: DeployTarget;
7206
+ deploy?: DeployTargetName;
5498
7207
  /**
5499
7208
  * Constructs glob pattern — one glob, every kind.
5500
7209
  *
@@ -5545,23 +7254,16 @@ interface AppConfigBase {
5545
7254
  * @example './src/config/logger'
5546
7255
  */
5547
7256
  logger?: string;
5548
- /** Provider configuration (AWS, Docker, etc.) */
5549
- providers?: ProvidersConfig;
5550
7257
  /**
5551
7258
  * Server lifecycle hooks.
5552
7259
  * @example { beforeSetup: './src/hooks/setup.ts' }
5553
7260
  */
5554
7261
  hooks?: HooksConfig;
5555
7262
  /**
5556
- * Telescope debugging dashboard configuration.
7263
+ * Telescope request recording configuration.
5557
7264
  * @example true, './src/config/telescope', { enabled: true, path: '/__telescope' }
5558
7265
  */
5559
7266
  telescope?: string | boolean | TelescopeConfig;
5560
- /**
5561
- * Studio admin panel configuration.
5562
- * @example true, './src/config/studio'
5563
- */
5564
- studio?: string | boolean | StudioConfig;
5565
7267
  /**
5566
7268
  * OpenAPI documentation configuration.
5567
7269
  * @example true, { output: './src/openapi.ts' }
@@ -5735,7 +7437,7 @@ type ConstrainedApps<TApps extends AppsRecord> = { [K in keyof TApps]: Omit<TApp
5735
7437
  * });
5736
7438
  * ```
5737
7439
  */
5738
- type WorkspaceInput<TApps extends AppsRecord> = {
7440
+ type WorkspaceInput<TApps extends AppsRecord, TDeployed extends string = string> = {
5739
7441
  /**
5740
7442
  * Where the workspace's own constructs live, relative to its root.
5741
7443
  *
@@ -5755,15 +7457,80 @@ type WorkspaceInput<TApps extends AppsRecord> = {
5755
7457
  apps?: ConstrainedApps<TApps>;
5756
7458
  /** Shared packages configuration */
5757
7459
  shared?: SharedConfig;
7460
+ /**
7461
+ * Each deployed stage's base domain — see {@link DomainsConfig}. A key that
7462
+ * is not a deployed stage is a type error.
7463
+ */
7464
+ domains?: DomainsInput<NoInfer<TDeployed>>;
7465
+ /**
7466
+ * Subdomains a wildcard site's tenants may never take, beyond every app's
7467
+ * own (which are derived from the constructs and never listed here): the
7468
+ * names no construct declares — `www`, `mail`, `status`, `docs`.
7469
+ *
7470
+ * Listing an app's own subdomain is refused at load: the construct
7471
+ * already protects it.
7472
+ */
7473
+ protectedSubdomains?: readonly string[];
7474
+ /**
7475
+ * Each root domain's DNS provider, and how its hosts are pointed at a
7476
+ * compose stage's server (`records`).
7477
+ */
7478
+ dns?: DnsInput<NoInfer<TDeployed>>;
5758
7479
  /** Deployment configuration */
5759
- deploy?: DeployConfig;
5760
- /** The project's stages: which one is local, which deploy */
5761
- stages: StagesConfig;
7480
+ deploy?: DeployConfig<NoInfer<TDeployed>>;
7481
+ /**
7482
+ * The project's stages: which one is local, which deploy. The deployed
7483
+ * stages type every per-stage map — `domains`, `deploy.objects`,
7484
+ * `deploy.telemetry`, `deploy.compose.proxy`/`tls`.
7485
+ */
7486
+ stages: StagesInput<TDeployed>;
5762
7487
  /** Encrypted secrets configuration */
5763
7488
  secrets?: SecretsConfig;
5764
7489
  /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
5765
7490
  state?: StateConfig;
7491
+ /** How `gkm dev` is reached: the discovery endpoint's port and origins */
7492
+ dev?: DevConfig;
5766
7493
  };
7494
+ /** `stages`, as `defineWorkspace` infers it: each deployed stage literally. */
7495
+ interface StagesInput<TDeployed extends string = string> {
7496
+ local: string;
7497
+ deployed: readonly TDeployed[];
7498
+ protected?: readonly NoInfer<TDeployed>[];
7499
+ }
7500
+ /**
7501
+ * How `gkm dev` is reached from outside the apps it runs.
7502
+ */
7503
+ interface DevConfig {
7504
+ /**
7505
+ * Browser origins allowed to read the discovery endpoint — and this
7506
+ * workspace in it — e.g. `['https://console.example.com']`.
7507
+ *
7508
+ * Empty by default: any page the developer visits can send requests to a
7509
+ * loopback port, so none is answered unless it is listed here. A request
7510
+ * with no `Origin` (curl, a local process) still needs the session token.
7511
+ */
7512
+ allowedOrigins?: string[];
7513
+ /**
7514
+ * The loopback port the discovery endpoint listens on. Defaults to 4983;
7515
+ * `GKM_DISCOVERY_PORT` overrides it.
7516
+ */
7517
+ discoveryPort?: number;
7518
+ }
7519
+ /**
7520
+ * How `gkm test` builds what a feature test is handed.
7521
+ */
7522
+ interface TestConfig {
7523
+ /**
7524
+ * The folder of test factories, relative to the root.
7525
+ *
7526
+ * Defaults to `test/factories`. A factory belongs to a database, not to an
7527
+ * app, so each file is named after one — `database.ts` for `Database`,
7528
+ * `auth-database.ts` for `AuthDatabase` — and exports `createFactory(db)`.
7529
+ * Every app's harness builds them on each test's transactions, and a test is
7530
+ * handed them as `factories`, keyed by service name.
7531
+ */
7532
+ factories?: string;
7533
+ }
5767
7534
  /**
5768
7535
  * Extract app names from apps record.
5769
7536
  */
@@ -5784,10 +7551,15 @@ type InferredWorkspaceConfig<TApps extends AppsRecord> = {
5784
7551
  dependencies?: InferAppNames<TApps>[];
5785
7552
  }; };
5786
7553
  shared?: SharedConfig;
7554
+ domains?: DomainsConfig;
7555
+ protectedSubdomains?: readonly string[];
7556
+ dns?: WorkspaceDnsConfig;
5787
7557
  deploy?: DeployConfig;
5788
7558
  stages: StagesConfig;
5789
7559
  secrets?: SecretsConfig;
5790
7560
  state?: StateConfig;
7561
+ test?: TestConfig;
7562
+ dev?: DevConfig;
5791
7563
  };
5792
7564
  /**
5793
7565
  * Workspace configuration for multi-app monorepos.
@@ -5834,17 +7606,20 @@ type InferredWorkspaceConfig<TApps extends AppsRecord> = {
5834
7606
  * },
5835
7607
  * },
5836
7608
  *
7609
+ * // Each deployed stage's base domain, and who hosts its DNS
7610
+ * domains: {
7611
+ * production: 'myapp.com',
7612
+ * staging: 'staging.myapp.com',
7613
+ * },
7614
+ * dns: { 'myapp.com': { provider: 'godaddy' } },
7615
+ *
5837
7616
  * // Deployment configuration
5838
7617
  * deploy: {
5839
7618
  * default: 'dokploy',
7619
+ * registry: 'ghcr.io/myorg',
5840
7620
  * dokploy: {
5841
7621
  * endpoint: 'https://dokploy.myserver.com',
5842
7622
  * projectId: 'proj_abc123',
5843
- * registry: 'ghcr.io/myorg',
5844
- * domains: {
5845
- * production: 'myapp.com',
5846
- * staging: 'staging.myapp.com',
5847
- * },
5848
7623
  * },
5849
7624
  * },
5850
7625
  *
@@ -5872,6 +7647,12 @@ interface WorkspaceConfig {
5872
7647
  apps?: Record<string, AppConfig>;
5873
7648
  /** Shared packages configuration */
5874
7649
  shared?: SharedConfig;
7650
+ /** Each deployed stage's base domain — see {@link DomainsConfig}. */
7651
+ domains?: DomainsConfig;
7652
+ /** Subdomains no tenant may take — see `WorkspaceInput`. */
7653
+ protectedSubdomains?: readonly string[];
7654
+ /** Each root domain's DNS provider — see {@link WorkspaceDnsConfig}. */
7655
+ dns?: WorkspaceDnsConfig;
5875
7656
  /** Default deployment configuration */
5876
7657
  deploy?: DeployConfig;
5877
7658
  /** The project's stages: which one is local, which deploy */
@@ -5880,6 +7661,10 @@ interface WorkspaceConfig {
5880
7661
  secrets?: SecretsConfig;
5881
7662
  /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
5882
7663
  state?: StateConfig;
7664
+ /** What `gkm test` hands a feature test: where the factories are. */
7665
+ test?: TestConfig;
7666
+ /** How `gkm dev` is reached: the discovery endpoint's port and origins. */
7667
+ dev?: DevConfig;
5883
7668
  }
5884
7669
  /**
5885
7670
  * Normalized app configuration with resolved defaults.
@@ -5896,6 +7681,11 @@ interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
5896
7681
  * and that is `domain`.
5897
7682
  */
5898
7683
  root?: boolean;
7684
+ /**
7685
+ * The label this app answers on under a stage's domain, carried from its
7686
+ * declaration — `api` for `api.myapp.com`. Absent, the app's own name.
7687
+ */
7688
+ subdomain?: string;
5899
7689
  /** App type (always defined after normalization) */
5900
7690
  type: 'backend' | 'web' | 'mobile';
5901
7691
  /** Path to the app */
@@ -5905,7 +7695,7 @@ interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
5905
7695
  /** Resolved dependencies array (empty array if none) */
5906
7696
  dependencies: string[];
5907
7697
  /** Resolved deploy target (app.deploy > deploy.default > 'dokploy') */
5908
- resolvedDeployTarget: DeployTarget;
7698
+ resolvedDeployTarget: DeployTargetName;
5909
7699
  /** Entry file path for non-gkm apps */
5910
7700
  entry?: string;
5911
7701
  /** Framework for the app */
@@ -5935,6 +7725,12 @@ interface NormalizedWorkspace {
5935
7725
  constructs?: Routes;
5936
7726
  /** Normalized app configurations */
5937
7727
  apps: Record<string, NormalizedAppConfig>;
7728
+ /** Each deployed stage's base domain */
7729
+ domains?: DomainsConfig;
7730
+ /** Subdomains no tenant may take, beyond every app's own */
7731
+ protectedSubdomains?: readonly string[];
7732
+ /** Each root domain's DNS provider */
7733
+ dns?: WorkspaceDnsConfig;
5938
7734
  /** Deploy configuration (empty object if not specified) */
5939
7735
  deploy: DeployConfig;
5940
7736
  /** Shared packages configuration (empty object if not specified) */
@@ -5945,6 +7741,10 @@ interface NormalizedWorkspace {
5945
7741
  secrets: SecretsConfig;
5946
7742
  /** State provider configuration (undefined = local filesystem) */
5947
7743
  state?: StateConfig;
7744
+ /** What `gkm test` hands a feature test (empty object if not specified) */
7745
+ test: TestConfig;
7746
+ /** How `gkm dev` is reached, when configured */
7747
+ dev?: DevConfig;
5948
7748
  }
5949
7749
  /**
5950
7750
  * Result of loading and processing a configuration.
@@ -5964,6 +7764,11 @@ interface LoadedConfig {
5964
7764
  * two chances to disagree. Absent when the workspace declares no constructs.
5965
7765
  */
5966
7766
  manifest?: ConstructManifest;
7767
+ /**
7768
+ * The files each Worker's crons, queues and subscribers are declared in,
7769
+ * read in the same discovery — what says which app a worker is built from.
7770
+ */
7771
+ background?: Record<string, string[]>;
5967
7772
  }
5968
7773
  /**
5969
7774
  * Type guard to check if a config is a WorkspaceConfig.
@@ -5980,53 +7785,7 @@ interface LoadedConfig {
5980
7785
  declare function isWorkspaceConfig(config: GkmConfig | WorkspaceConfig): config is WorkspaceConfig;
5981
7786
  //#endregion
5982
7787
  //#region src/types.d.ts
5983
- interface PartitionedRoutes {
5984
- paths: string | string[];
5985
- partition: (filepath: string) => string;
5986
- }
5987
- type Routes = string | string[] | PartitionedRoutes;
5988
- interface ProviderConfig {
5989
- enabled?: boolean;
5990
- outputDir?: string;
5991
- }
5992
- interface AWSApiGatewayConfig extends ProviderConfig {}
5993
- interface AWSLambdaConfig extends ProviderConfig {}
5994
- interface ProductionConfig {
5995
- /** Enable production mode (default: false) */
5996
- enabled?: boolean;
5997
- /** Bundle server into single file (default: true) */
5998
- bundle?: boolean;
5999
- /** Minify bundled output (default: true) */
6000
- minify?: boolean;
6001
- /** Health check endpoint path (default: '/health') */
6002
- healthCheck?: string;
6003
- /** Enable graceful shutdown handling (default: true) */
6004
- gracefulShutdown?: boolean;
6005
- /** Packages to exclude from bundling (default: []) */
6006
- external?: string[];
6007
- /** Include subscribers in production build (default: 'exclude' for serverless) */
6008
- subscribers?: 'include' | 'exclude';
6009
- /** Include OpenAPI spec in production (default: false) */
6010
- openapi?: boolean;
6011
- /**
6012
- * Enable build-time optimized handler generation (default: true)
6013
- * Generates specialized handlers based on endpoint tier:
6014
- * - minimal: Near-raw-Hono performance for simple endpoints
6015
- * - standard: Optimized handlers for auth/services
6016
- * - full: Uses HonoEndpoint.addRoutes for complex endpoints
6017
- */
6018
- optimizedHandlers?: boolean;
6019
- }
6020
- /**
6021
- * Supported event backend types.
6022
- *
6023
- * - `pgboss`: Reuses PostgreSQL with a dedicated user/schema. Auto-enables db service.
6024
- * - `sns`: Adds LocalStack container with SNS+SQS services.
6025
- * - `rabbitmq`: Adds RabbitMQ container.
6026
- *
6027
- * All backends generate EVENT_PUBLISHER_CONNECTION_STRING and EVENT_SUBSCRIBER_CONNECTION_STRING.
6028
- */
6029
- type EventsBackend = 'pgboss' | 'sns' | 'rabbitmq';
7788
+ type Routes = string | string[];
6030
7789
  /**
6031
7790
  * Where a declared cache actually lives.
6032
7791
  *
@@ -6043,8 +7802,12 @@ type EventsBackend = 'pgboss' | 'sns' | 'rabbitmq';
6043
7802
  * - `db` — a table in the database the app already declared. No infrastructure
6044
7803
  * at all, and the same relationship pg-boss has to Postgres: it creates its
6045
7804
  * own table on first use and needs a declared database to live in.
7805
+ * - `redis` — a Redis the stack runs beside the apps, on its network. It holds
7806
+ * *every* declared cache, one declared from a database included, so the
7807
+ * cache never competes with the database for its connections. Only the
7808
+ * compose target selects it today (`gkm compose`).
6046
7809
  */
6047
- type CacheBackend = 'upstash' | 'elasticache' | 'db';
7810
+ type CacheBackend = 'upstash' | 'elasticache' | 'db' | 'redis';
6048
7811
  /**
6049
7812
  * Who delivers a declared app's mail.
6050
7813
  *
@@ -6071,17 +7834,11 @@ interface DockerConfig {
6071
7834
  registry?: string;
6072
7835
  /** Docker image name (default: derived from package.json name) */
6073
7836
  imageName?: string;
6074
- /** Base Docker image (default: 'node:22-alpine') */
7837
+ /** Base Docker image (default: 'node:22.23.4-alpine', a Node security release) */
6075
7838
  baseImage?: string;
6076
7839
  /** Container port (default: 3000) */
6077
7840
  port?: number;
6078
7841
  }
6079
- interface ServerConfig extends ProviderConfig {
6080
- enableOpenApi?: boolean;
6081
- port?: number;
6082
- /** Production build configuration */
6083
- production?: ProductionConfig;
6084
- }
6085
7842
  type Runtime = 'node' | 'bun';
6086
7843
  interface TelescopeConfig {
6087
7844
  /** Enable/disable telescope (default: true in development) */
@@ -6099,14 +7856,6 @@ interface TelescopeConfig {
6099
7856
  /** Enable WebSocket for real-time updates (default: true, requires @hono/node-ws for Node.js) */
6100
7857
  websocket?: boolean;
6101
7858
  }
6102
- interface StudioConfig {
6103
- /** Enable/disable studio (default: true in development) */
6104
- enabled?: boolean;
6105
- /** Path prefix for studio UI (default: /__studio) */
6106
- path?: string;
6107
- /** Schema to introspect (default: 'public') */
6108
- schema?: string;
6109
- }
6110
7859
  interface OpenApiConfig {
6111
7860
  /** Enable OpenAPI generation (default: true) */
6112
7861
  enabled?: boolean;
@@ -6144,34 +7893,6 @@ interface HooksConfig {
6144
7893
  */
6145
7894
  server?: string;
6146
7895
  }
6147
- /** Dokploy deployment configuration */
6148
- interface DokployProviderConfig {
6149
- /** Dokploy API endpoint (e.g., 'https://dokploy.example.com') */
6150
- endpoint: string;
6151
- /** Project ID in Dokploy */
6152
- projectId: string;
6153
- /** Application ID in Dokploy */
6154
- applicationId: string;
6155
- /** Container registry (overrides docker.registry if set) */
6156
- registry?: string;
6157
- /** Registry ID in Dokploy (recommended for private registries) */
6158
- registryId?: string;
6159
- }
6160
- interface ProvidersConfig {
6161
- aws?: {
6162
- apiGateway?: {
6163
- v1?: boolean | AWSApiGatewayConfig;
6164
- v2?: boolean | AWSApiGatewayConfig;
6165
- };
6166
- lambda?: {
6167
- functions?: boolean | AWSLambdaConfig;
6168
- crons?: boolean | AWSLambdaConfig;
6169
- };
6170
- };
6171
- server?: boolean | ServerConfig;
6172
- /** Dokploy deployment configuration */
6173
- dokploy?: boolean | DokployProviderConfig;
6174
- }
6175
7896
  interface GkmConfig {
6176
7897
  /**
6177
7898
  * What this app is called, and therefore how everything it declares is named.
@@ -6195,6 +7916,10 @@ interface GkmConfig {
6195
7916
  stages: StagesConfig;
6196
7917
  /** Encrypted secrets, and where deployed stages' secrets are stored */
6197
7918
  secrets?: SecretsConfig;
7919
+ /** What `gkm test` hands a feature test: where the factories are. */
7920
+ test?: TestConfig;
7921
+ /** How `gkm dev` is reached: the discovery endpoint's port and origins. */
7922
+ dev?: DevConfig;
6198
7923
  /**
6199
7924
  * Constructs glob pattern — one glob, every kind.
6200
7925
  *
@@ -6206,7 +7931,6 @@ interface GkmConfig {
6206
7931
  * @example './src/**\/*.ts'
6207
7932
  */
6208
7933
  constructs: Routes;
6209
- providers?: ProvidersConfig;
6210
7934
  /**
6211
7935
  * Server lifecycle hooks for customizing the Hono app.
6212
7936
  * Allows adding custom routes, middleware, error handlers, etc.
@@ -6225,16 +7949,6 @@ interface GkmConfig {
6225
7949
  * - A TelescopeConfig object for inline configuration
6226
7950
  */
6227
7951
  telescope?: string | boolean | TelescopeConfig;
6228
- /**
6229
- * Studio configuration for database browsing.
6230
- * Can be:
6231
- * - A string path to a module that exports a Studio instance (recommended)
6232
- * - A boolean to enable/disable with defaults
6233
- * - A StudioConfig object for inline configuration
6234
- *
6235
- * Requires a database connection configured via services.
6236
- */
6237
- studio?: string | boolean | StudioConfig;
6238
7952
  /**
6239
7953
  * OpenAPI generation configuration.
6240
7954
  * Can be:
@@ -6297,7 +8011,11 @@ interface GkmConfig {
6297
8011
  * a rename rather than a rewrite.
6298
8012
  */
6299
8013
  deploy?: DeployConfig;
8014
+ /** Each deployed stage's base domain — the same field a workspace has. */
8015
+ domains?: DomainsConfig;
8016
+ /** Each root domain's DNS provider — the same field a workspace has. */
8017
+ dns?: WorkspaceDnsConfig;
6300
8018
  }
6301
8019
  //#endregion
6302
- 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 };
6303
- //# sourceMappingURL=types-N7c2O2m7.d.cts.map
8020
+ 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 };
8021
+ //# sourceMappingURL=types-Bj1A1wkS.d.mts.map