@geekmidas/cli 10.0.0-alpha.13 → 10.0.0-alpha.130

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