@geekmidas/cli 10.0.0-alpha.91 → 10.0.0-alpha.93

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 (318) hide show
  1. package/dist/{EndpointGenerator-CVc6Oi1Y.mjs → EndpointGenerator-Bor2tZCm.mjs} +14 -4
  2. package/dist/EndpointGenerator-Bor2tZCm.mjs.map +1 -0
  3. package/dist/{EndpointGenerator-CwLjBCFE.cjs → EndpointGenerator-De03t1hd.cjs} +14 -4
  4. package/dist/EndpointGenerator-De03t1hd.cjs.map +1 -0
  5. package/dist/{GoDaddyProvider-DqZ1qD_F.cjs → GoDaddyProvider-BZb-V14e.cjs} +11 -10
  6. package/dist/GoDaddyProvider-BZb-V14e.cjs.map +1 -0
  7. package/dist/{GoDaddyProvider-DSStJVAv.mjs → GoDaddyProvider-Mi3vptSR.mjs} +11 -10
  8. package/dist/GoDaddyProvider-Mi3vptSR.mjs.map +1 -0
  9. package/dist/{HostingerProvider-BI6J7oJr.mjs → HostingerProvider-1mqD6aG8.mjs} +2 -2
  10. package/dist/{HostingerProvider-BI6J7oJr.mjs.map → HostingerProvider-1mqD6aG8.mjs.map} +1 -1
  11. package/dist/{HostingerProvider-CyTpG_jy.cjs → HostingerProvider-C6t-PSNe.cjs} +2 -2
  12. package/dist/{HostingerProvider-CyTpG_jy.cjs.map → HostingerProvider-C6t-PSNe.cjs.map} +1 -1
  13. package/dist/{LegacyStateStore-DXmNA7hy.cjs → LegacyStateStore-BlYXQQSE.cjs} +44 -10
  14. package/dist/LegacyStateStore-BlYXQQSE.cjs.map +1 -0
  15. package/dist/LegacyStateStore-CtwO7fwy.mjs +123 -0
  16. package/dist/LegacyStateStore-CtwO7fwy.mjs.map +1 -0
  17. package/dist/{LocalStateStore-CU-O0SBp.mjs → LocalStateStore-D40_SDmJ.mjs} +2 -2
  18. package/dist/{LocalStateStore-CU-O0SBp.mjs.map → LocalStateStore-D40_SDmJ.mjs.map} +1 -1
  19. package/dist/{LocalStateStore-BBeTlRTH.cjs → LocalStateStore-oX_zxj9V.cjs} +2 -2
  20. package/dist/{LocalStateStore-BBeTlRTH.cjs.map → LocalStateStore-oX_zxj9V.cjs.map} +1 -1
  21. package/dist/{OpenApiTsGenerator-B--HV-sW.cjs → OpenApiTsGenerator-CS_RtWOz.cjs} +2 -2
  22. package/dist/{OpenApiTsGenerator-B--HV-sW.cjs.map → OpenApiTsGenerator-CS_RtWOz.cjs.map} +1 -1
  23. package/dist/{OpenApiTsGenerator-CkvsPdgg.mjs → OpenApiTsGenerator-DWAF-7Fu.mjs} +2 -2
  24. package/dist/{OpenApiTsGenerator-CkvsPdgg.mjs.map → OpenApiTsGenerator-DWAF-7Fu.mjs.map} +1 -1
  25. package/dist/{S3StateStore-bwxcI_wQ.mjs → S3StateStore-BzS0IeSt.mjs} +2 -2
  26. package/dist/{S3StateStore-bwxcI_wQ.mjs.map → S3StateStore-BzS0IeSt.mjs.map} +1 -1
  27. package/dist/{S3StateStore-Br8VMY22.cjs → S3StateStore-DeI7jtvi.cjs} +2 -2
  28. package/dist/{S3StateStore-Br8VMY22.cjs.map → S3StateStore-DeI7jtvi.cjs.map} +1 -1
  29. package/dist/{SSMStateStore-DoZE1Wi1.cjs → SSMStateStore-CaCtrzFL.cjs} +2 -2
  30. package/dist/{SSMStateStore-DoZE1Wi1.cjs.map → SSMStateStore-CaCtrzFL.cjs.map} +1 -1
  31. package/dist/{SSMStateStore-CsOS0W1y.mjs → SSMStateStore-k_Ew7TWx.mjs} +2 -2
  32. package/dist/{SSMStateStore-CsOS0W1y.mjs.map → SSMStateStore-k_Ew7TWx.mjs.map} +1 -1
  33. package/dist/{SubscriberGenerator-BPqQf8fB.mjs → SubscriberGenerator-CyN2VF5X.mjs} +6 -5
  34. package/dist/SubscriberGenerator-CyN2VF5X.mjs.map +1 -0
  35. package/dist/{SubscriberGenerator-BVn7cQ-2.cjs → SubscriberGenerator-Dvz7EzqK.cjs} +6 -5
  36. package/dist/SubscriberGenerator-Dvz7EzqK.cjs.map +1 -0
  37. package/dist/{add-BSHk5Ngn.mjs → add-CP1podDH.mjs} +7 -7
  38. package/dist/add-CP1podDH.mjs.map +1 -0
  39. package/dist/{add-DmmBDV2e.cjs → add-VcyJnsPX.cjs} +8 -8
  40. package/dist/add-VcyJnsPX.cjs.map +1 -0
  41. package/dist/{aws-BTawF0F-.cjs → aws-BTReGjpY.cjs} +24 -6
  42. package/dist/aws-BTReGjpY.cjs.map +1 -0
  43. package/dist/{aws-B-6uEhgP.mjs → aws-Dz2bYxK1.mjs} +24 -6
  44. package/dist/aws-Dz2bYxK1.mjs.map +1 -0
  45. package/dist/awsStore-B5We7bMg.cjs +136 -0
  46. package/dist/awsStore-B5We7bMg.cjs.map +1 -0
  47. package/dist/awsStore-BWa1KNY-.mjs +119 -0
  48. package/dist/awsStore-BWa1KNY-.mjs.map +1 -0
  49. package/dist/{bundler-D6eBfVkl.mjs → bundler-BWrh-AJH.mjs} +5 -5
  50. package/dist/{bundler-D6eBfVkl.mjs.map → bundler-BWrh-AJH.mjs.map} +1 -1
  51. package/dist/{bundler-BQJiB7Ub.cjs → bundler-Dfsr6KXU.cjs} +5 -5
  52. package/dist/{bundler-BQJiB7Ub.cjs.map → bundler-Dfsr6KXU.cjs.map} +1 -1
  53. package/dist/{cli-DD-Yk-I5.mjs → cli-B8otnZfX.mjs} +6 -6
  54. package/dist/{cli-DD-Yk-I5.mjs.map → cli-B8otnZfX.mjs.map} +1 -1
  55. package/dist/{cli-BE9mqeX8.cjs → cli-DL19w4OE.cjs} +5 -5
  56. package/dist/{cli-BE9mqeX8.cjs.map → cli-DL19w4OE.cjs.map} +1 -1
  57. package/dist/compose-BHVKLluX.cjs +1523 -0
  58. package/dist/compose-BHVKLluX.cjs.map +1 -0
  59. package/dist/compose-DrEB_4F-.mjs +1476 -0
  60. package/dist/compose-DrEB_4F-.mjs.map +1 -0
  61. package/dist/{config-pST7E0CS.d.cts → config-CHX5GOo3.d.mts} +8 -8
  62. package/dist/{config-CdEcTrjG.d.mts.map → config-CHX5GOo3.d.mts.map} +1 -1
  63. package/dist/{config-CdEcTrjG.d.mts → config-DCCcrOSo.d.cts} +8 -8
  64. package/dist/{config-pST7E0CS.d.cts.map → config-DCCcrOSo.d.cts.map} +1 -1
  65. package/dist/config.cjs +8 -7
  66. package/dist/config.cjs.map +1 -1
  67. package/dist/config.d.cts +3 -3
  68. package/dist/config.d.mts +3 -3
  69. package/dist/config.mjs +8 -7
  70. package/dist/config.mjs.map +1 -1
  71. package/dist/{credentialSchemas-BJqRJNK4.mjs → credentialSchemas-BJFvfkaz.mjs} +5 -4
  72. package/dist/credentialSchemas-BJFvfkaz.mjs.map +1 -0
  73. package/dist/{credentialSchemas-DCR4Wd1W.cjs → credentialSchemas-CAPKFkrG.cjs} +5 -4
  74. package/dist/credentialSchemas-CAPKFkrG.cjs.map +1 -0
  75. package/dist/{credentials-CnVqoXMb.mjs → credentials-C4KII3PD.mjs} +3 -2
  76. package/dist/{credentials-CnVqoXMb.mjs.map → credentials-C4KII3PD.mjs.map} +1 -1
  77. package/dist/{credentials-BKfIugu2.cjs → credentials-QBu7VgaQ.cjs} +3 -2
  78. package/dist/credentials-QBu7VgaQ.cjs.map +1 -0
  79. package/dist/{databases-CzszQV0N.mjs → databases-BeGP5eDh.mjs} +11 -10
  80. package/dist/databases-BeGP5eDh.mjs.map +1 -0
  81. package/dist/{databases-BY-pEImp.cjs → databases-DGALFDG3.cjs} +11 -10
  82. package/dist/databases-DGALFDG3.cjs.map +1 -0
  83. package/dist/{define-DR8xGYfL.mjs → define-6poNqm5O.mjs} +12 -3
  84. package/dist/define-6poNqm5O.mjs.map +1 -0
  85. package/dist/{define-DzRz8FgH.cjs → define-crmMcXFS.cjs} +12 -3
  86. package/dist/define-crmMcXFS.cjs.map +1 -0
  87. package/dist/deploy/public.cjs +18 -16
  88. package/dist/deploy/public.cjs.map +1 -1
  89. package/dist/deploy/public.d.cts +31 -31
  90. package/dist/deploy/public.d.cts.map +1 -1
  91. package/dist/deploy/public.d.mts +31 -31
  92. package/dist/deploy/public.d.mts.map +1 -1
  93. package/dist/deploy/public.mjs +18 -17
  94. package/dist/deploy/public.mjs.map +1 -1
  95. package/dist/{deploy-CuHasEA4.cjs → deploy-C3Mhnmus.cjs} +15 -13
  96. package/dist/deploy-C3Mhnmus.cjs.map +1 -0
  97. package/dist/{deploy-QNtx_eWR.mjs → deploy-DYIyIUYd.mjs} +15 -13
  98. package/dist/deploy-DYIyIUYd.mjs.map +1 -0
  99. package/dist/{discover-D1It5r_h.cjs → discover-DPgu-ScS.cjs} +4 -3
  100. package/dist/discover-DPgu-ScS.cjs.map +1 -0
  101. package/dist/{discover-CU0paUyH.d.cts → discover-DqwlBVyY.d.mts} +2 -2
  102. package/dist/{discover-CU0paUyH.d.cts.map → discover-DqwlBVyY.d.mts.map} +1 -1
  103. package/dist/{discover-BPelzeGW.mjs → discover-qjFapetL.mjs} +4 -3
  104. package/dist/discover-qjFapetL.mjs.map +1 -0
  105. package/dist/{discover-DFiJxwfv.d.mts → discover-vk2r5giK.d.cts} +2 -2
  106. package/dist/{discover-DFiJxwfv.d.mts.map → discover-vk2r5giK.d.cts.map} +1 -1
  107. package/dist/{dokploy-CYcMLh9-.mjs → dokploy-o4I6vb9W.mjs} +3 -3
  108. package/dist/{dokploy-CYcMLh9-.mjs.map → dokploy-o4I6vb9W.mjs.map} +1 -1
  109. package/dist/{dokploy-DIowwyIB.cjs → dokploy-rivb1RFt.cjs} +3 -3
  110. package/dist/{dokploy-DIowwyIB.cjs.map → dokploy-rivb1RFt.cjs.map} +1 -1
  111. package/dist/{drivers-DTZzxeIl.mjs → drivers-CTaWrA_L.mjs} +2 -2
  112. package/dist/{drivers-DTZzxeIl.mjs.map → drivers-CTaWrA_L.mjs.map} +1 -1
  113. package/dist/{drivers-LYSdQDmd.cjs → drivers-DDojgzz0.cjs} +2 -2
  114. package/dist/{drivers-LYSdQDmd.cjs.map → drivers-DDojgzz0.cjs.map} +1 -1
  115. package/dist/{encryption-BrEef7Jk.mjs → encryption-B6ilrT7p.mjs} +7 -6
  116. package/dist/encryption-B6ilrT7p.mjs.map +1 -0
  117. package/dist/{encryption-CjYdUb2s.cjs → encryption-D7zmwzWz.cjs} +7 -6
  118. package/dist/encryption-D7zmwzWz.cjs.map +1 -0
  119. package/dist/{engine-BhJ7ZP9K.cjs → engine-Cfx8fEZU.cjs} +40 -28
  120. package/dist/engine-Cfx8fEZU.cjs.map +1 -0
  121. package/dist/{engine-2h4k5ICq.mjs → engine-DjEcovm-.mjs} +40 -28
  122. package/dist/engine-DjEcovm-.mjs.map +1 -0
  123. package/dist/errors-D8Gwp5kU.mjs +23 -0
  124. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  125. package/dist/errors-DMC4Umsb.cjs +34 -0
  126. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  127. package/dist/{github-BCDF6xVH.mjs → github-CzBbs43W.mjs} +31 -9
  128. package/dist/github-CzBbs43W.mjs.map +1 -0
  129. package/dist/{github-B5Bw4HIu.cjs → github-zneTMvnO.cjs} +31 -9
  130. package/dist/github-zneTMvnO.cjs.map +1 -0
  131. package/dist/{index-YFNxR5Ns.d.mts → index-BiYU7cUl.d.mts} +6 -6
  132. package/dist/{index-D-F_hTDz.d.cts.map → index-BiYU7cUl.d.mts.map} +1 -1
  133. package/dist/{index-D-F_hTDz.d.cts → index-Dm6V9bwh.d.cts} +6 -6
  134. package/dist/{index-YFNxR5Ns.d.mts.map → index-Dm6V9bwh.d.cts.map} +1 -1
  135. package/dist/index.cjs +256 -346
  136. package/dist/index.cjs.map +1 -1
  137. package/dist/index.mjs +252 -341
  138. package/dist/index.mjs.map +1 -1
  139. package/dist/{local-BjxDfPvy.cjs → local-B61kUh0w.cjs} +3 -3
  140. package/dist/{local-BjxDfPvy.cjs.map → local-B61kUh0w.cjs.map} +1 -1
  141. package/dist/{local-IuoIF3CT.mjs → local-Otp74ak0.mjs} +3 -3
  142. package/dist/{local-IuoIF3CT.mjs.map → local-Otp74ak0.mjs.map} +1 -1
  143. package/dist/{migrate-DWZz9kah.mjs → migrate-BaC4w0sb.mjs} +8 -7
  144. package/dist/migrate-BaC4w0sb.mjs.map +1 -0
  145. package/dist/{migrate-q2YYLJLE.cjs → migrate-C8wTpakT.cjs} +8 -7
  146. package/dist/migrate-C8wTpakT.cjs.map +1 -0
  147. package/dist/{migrate-DbtcuOr_.mjs → migrate-CsBZKALY.mjs} +9 -8
  148. package/dist/migrate-CsBZKALY.mjs.map +1 -0
  149. package/dist/{migrate-CGaancHY.cjs → migrate-DFjbGnSr.cjs} +8 -7
  150. package/dist/migrate-DFjbGnSr.cjs.map +1 -0
  151. package/dist/openapi.cjs +3 -3
  152. package/dist/openapi.d.cts +1 -10
  153. package/dist/openapi.d.cts.map +1 -1
  154. package/dist/openapi.d.mts +1 -10
  155. package/dist/openapi.d.mts.map +1 -1
  156. package/dist/openapi.mjs +3 -3
  157. package/dist/{provider-C9_-45d5.cjs → provider-BqpjG9QM.cjs} +4 -3
  158. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  159. package/dist/{provider-q4lsYzYG.mjs → provider-CEOKk8NS.mjs} +4 -3
  160. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  161. package/dist/{ready-BpNbORRB.cjs → ready-D3PIjx3S.cjs} +9 -8
  162. package/dist/ready-D3PIjx3S.cjs.map +1 -0
  163. package/dist/{ready-b6vm0-W-.mjs → ready-naOSJpeJ.mjs} +9 -8
  164. package/dist/ready-naOSJpeJ.mjs.map +1 -0
  165. package/dist/reconcile/public.cjs +1 -1
  166. package/dist/reconcile/public.d.cts +2 -2
  167. package/dist/reconcile/public.d.mts +2 -2
  168. package/dist/reconcile/public.mjs +1 -1
  169. package/dist/{reconcile-Dh1Jk7WE.mjs → reconcile--I7V4Klj.mjs} +2 -2
  170. package/dist/{reconcile-Dh1Jk7WE.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  171. package/dist/{resolve-DNg0icnh.mjs → resolve-Ccjlpnd9.mjs} +12 -11
  172. package/dist/resolve-Ccjlpnd9.mjs.map +1 -0
  173. package/dist/{resolve-Cns0v6dN.cjs → resolve-g8htuR80.cjs} +12 -11
  174. package/dist/resolve-g8htuR80.cjs.map +1 -0
  175. package/dist/{rollback-UIjS25F1.cjs → rollback--ympG9ss.cjs} +13 -11
  176. package/dist/rollback--ympG9ss.cjs.map +1 -0
  177. package/dist/{rollback-CFrNLmxs.mjs → rollback-Drbg0OeR.mjs} +13 -11
  178. package/dist/rollback-Drbg0OeR.mjs.map +1 -0
  179. package/dist/{runtime-CN_kmqxo.d.cts → runtime-D_J3ExJn.d.cts} +11 -19
  180. package/dist/runtime-D_J3ExJn.d.cts.map +1 -0
  181. package/dist/{runtime-Cjvon3oj.d.mts → runtime-_wEVtshH.d.mts} +11 -19
  182. package/dist/runtime-_wEVtshH.d.mts.map +1 -0
  183. package/dist/sandbox/credentials-worker.cjs +3 -3
  184. package/dist/sandbox/credentials-worker.mjs +3 -3
  185. package/dist/sandbox/discover-worker.cjs +1 -1
  186. package/dist/sandbox/discover-worker.mjs +1 -1
  187. package/dist/sandbox/migrate-worker.cjs +3 -3
  188. package/dist/sandbox/migrate-worker.mjs +3 -3
  189. package/dist/{sandbox-CL--ZDui.cjs → sandbox-CHv3OYXg.cjs} +4 -3
  190. package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
  191. package/dist/{sandbox-M8UnLhXE.d.cts → sandbox-CPJq1Kia.d.mts} +4 -26
  192. package/dist/sandbox-CPJq1Kia.d.mts.map +1 -0
  193. package/dist/{sandbox-Dm247NGx.mjs → sandbox-CbVB7uOD.mjs} +4 -3
  194. package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
  195. package/dist/{sandbox-M8UnLhXE.d.mts → sandbox-JwuPAl7I.d.cts} +4 -26
  196. package/dist/sandbox-JwuPAl7I.d.cts.map +1 -0
  197. package/dist/secrets-DJteijZo.cjs +47 -0
  198. package/dist/secrets-DJteijZo.cjs.map +1 -0
  199. package/dist/secrets-DbPmAS4k.mjs +36 -0
  200. package/dist/secrets-DbPmAS4k.mjs.map +1 -0
  201. package/dist/{secretsManager-Chs9VV2r.mjs → secretsManager-C6wm-9uZ.mjs} +24 -3
  202. package/dist/secretsManager-C6wm-9uZ.mjs.map +1 -0
  203. package/dist/{secretsManager-DcMlHnRC.cjs → secretsManager-Cwwgs81g.cjs} +24 -3
  204. package/dist/secretsManager-Cwwgs81g.cjs.map +1 -0
  205. package/dist/{seeds-odfgSCmu.mjs → seeds-BSL55F6q.mjs} +946 -107
  206. package/dist/seeds-BSL55F6q.mjs.map +1 -0
  207. package/dist/{seeds-CkIPFGNO.cjs → seeds-c-ByX9je.cjs} +1065 -130
  208. package/dist/seeds-c-ByX9je.cjs.map +1 -0
  209. package/dist/{sniffer-BTtX3NUM.mjs → sniffer-BTtGAtm3.mjs} +14 -8
  210. package/dist/sniffer-BTtGAtm3.mjs.map +1 -0
  211. package/dist/{sniffer-IAQEpsQb.cjs → sniffer-Dq5BS98f.cjs} +14 -8
  212. package/dist/{sniffer-IAQEpsQb.cjs.map → sniffer-Dq5BS98f.cjs.map} +1 -1
  213. package/dist/{sst-CJzvyrEz.mjs → sst-BaRXp2Dd.mjs} +18 -8
  214. package/dist/sst-BaRXp2Dd.mjs.map +1 -0
  215. package/dist/{sst-BgcOsaBi.cjs → sst-CnKY-CSh.cjs} +18 -8
  216. package/dist/sst-CnKY-CSh.cjs.map +1 -0
  217. package/dist/stack-1PeLJS2j.cjs +1346 -0
  218. package/dist/stack-1PeLJS2j.cjs.map +1 -0
  219. package/dist/stack-Co4uZkAo.mjs +1239 -0
  220. package/dist/stack-Co4uZkAo.mjs.map +1 -0
  221. package/dist/{stages-CUn6gvXL.cjs → stages-BI8JvPzI.cjs} +6 -5
  222. package/dist/stages-BI8JvPzI.cjs.map +1 -0
  223. package/dist/{stages-CnZRYmkI.mjs → stages-DY-fQKmo.mjs} +6 -5
  224. package/dist/stages-DY-fQKmo.mjs.map +1 -0
  225. package/dist/target/public.cjs +3 -3
  226. package/dist/target/public.d.cts +2 -2
  227. package/dist/target/public.d.mts +2 -2
  228. package/dist/target/public.mjs +3 -3
  229. package/dist/{terminal-DuapRxh6.cjs → terminal-8XngdSTo.cjs} +6 -5
  230. package/dist/terminal-8XngdSTo.cjs.map +1 -0
  231. package/dist/{terminal-D8TPK7o9.mjs → terminal-C4XRdwnU.mjs} +7 -6
  232. package/dist/terminal-C4XRdwnU.mjs.map +1 -0
  233. package/dist/{types-NqX1Hz4P.d.cts → types-B6lmD3en.d.mts} +94 -47
  234. package/dist/types-B6lmD3en.d.mts.map +1 -0
  235. package/dist/{types-ZHuZ89hv.d.mts → types-BibpiHKB.d.cts} +95 -46
  236. package/dist/types-BibpiHKB.d.cts.map +1 -0
  237. package/dist/vitest.cjs +1 -1
  238. package/dist/vitest.mjs +1 -1
  239. package/dist/workspace/index.cjs +1 -1
  240. package/dist/workspace/index.d.cts +2 -2
  241. package/dist/workspace/index.d.mts +2 -2
  242. package/dist/workspace/index.mjs +1 -1
  243. package/dist/{workspace-CJ0lKFq-.mjs → workspace-Bzw7Zs82.mjs} +34 -33
  244. package/dist/workspace-Bzw7Zs82.mjs.map +1 -0
  245. package/dist/{workspace-CwW3Gkru.cjs → workspace-CHOB2Xg3.cjs} +34 -33
  246. package/dist/workspace-CHOB2Xg3.cjs.map +1 -0
  247. package/package.json +15 -15
  248. package/dist/EndpointGenerator-CVc6Oi1Y.mjs.map +0 -1
  249. package/dist/EndpointGenerator-CwLjBCFE.cjs.map +0 -1
  250. package/dist/GoDaddyProvider-DSStJVAv.mjs.map +0 -1
  251. package/dist/GoDaddyProvider-DqZ1qD_F.cjs.map +0 -1
  252. package/dist/LegacyStateStore-DXmNA7hy.cjs.map +0 -1
  253. package/dist/LegacyStateStore-ZkdmiUFZ.mjs +0 -89
  254. package/dist/LegacyStateStore-ZkdmiUFZ.mjs.map +0 -1
  255. package/dist/SubscriberGenerator-BPqQf8fB.mjs.map +0 -1
  256. package/dist/SubscriberGenerator-BVn7cQ-2.cjs.map +0 -1
  257. package/dist/add-BSHk5Ngn.mjs.map +0 -1
  258. package/dist/add-DmmBDV2e.cjs.map +0 -1
  259. package/dist/aws-B-6uEhgP.mjs.map +0 -1
  260. package/dist/aws-BTawF0F-.cjs.map +0 -1
  261. package/dist/awsStore-7VmS_cZR.cjs +0 -54
  262. package/dist/awsStore-7VmS_cZR.cjs.map +0 -1
  263. package/dist/awsStore-B529csle.mjs +0 -43
  264. package/dist/awsStore-B529csle.mjs.map +0 -1
  265. package/dist/compose-Bhmf0n4o.mjs +0 -3140
  266. package/dist/compose-Bhmf0n4o.mjs.map +0 -1
  267. package/dist/compose-CvpU6ooi.cjs +0 -3265
  268. package/dist/compose-CvpU6ooi.cjs.map +0 -1
  269. package/dist/credentialSchemas-BJqRJNK4.mjs.map +0 -1
  270. package/dist/credentialSchemas-DCR4Wd1W.cjs.map +0 -1
  271. package/dist/credentials-BKfIugu2.cjs.map +0 -1
  272. package/dist/databases-BY-pEImp.cjs.map +0 -1
  273. package/dist/databases-CzszQV0N.mjs.map +0 -1
  274. package/dist/define-DR8xGYfL.mjs.map +0 -1
  275. package/dist/define-DzRz8FgH.cjs.map +0 -1
  276. package/dist/deploy-CuHasEA4.cjs.map +0 -1
  277. package/dist/deploy-QNtx_eWR.mjs.map +0 -1
  278. package/dist/discover-BPelzeGW.mjs.map +0 -1
  279. package/dist/discover-D1It5r_h.cjs.map +0 -1
  280. package/dist/encryption-BrEef7Jk.mjs.map +0 -1
  281. package/dist/encryption-CjYdUb2s.cjs.map +0 -1
  282. package/dist/engine-2h4k5ICq.mjs.map +0 -1
  283. package/dist/engine-BhJ7ZP9K.cjs.map +0 -1
  284. package/dist/github-B5Bw4HIu.cjs.map +0 -1
  285. package/dist/github-BCDF6xVH.mjs.map +0 -1
  286. package/dist/migrate-CGaancHY.cjs.map +0 -1
  287. package/dist/migrate-DWZz9kah.mjs.map +0 -1
  288. package/dist/migrate-DbtcuOr_.mjs.map +0 -1
  289. package/dist/migrate-q2YYLJLE.cjs.map +0 -1
  290. package/dist/provider-C9_-45d5.cjs.map +0 -1
  291. package/dist/provider-q4lsYzYG.mjs.map +0 -1
  292. package/dist/ready-BpNbORRB.cjs.map +0 -1
  293. package/dist/ready-b6vm0-W-.mjs.map +0 -1
  294. package/dist/resolve-Cns0v6dN.cjs.map +0 -1
  295. package/dist/resolve-DNg0icnh.mjs.map +0 -1
  296. package/dist/rollback-CFrNLmxs.mjs.map +0 -1
  297. package/dist/rollback-UIjS25F1.cjs.map +0 -1
  298. package/dist/runtime-CN_kmqxo.d.cts.map +0 -1
  299. package/dist/runtime-Cjvon3oj.d.mts.map +0 -1
  300. package/dist/sandbox-CL--ZDui.cjs.map +0 -1
  301. package/dist/sandbox-Dm247NGx.mjs.map +0 -1
  302. package/dist/sandbox-M8UnLhXE.d.cts.map +0 -1
  303. package/dist/sandbox-M8UnLhXE.d.mts.map +0 -1
  304. package/dist/secretsManager-Chs9VV2r.mjs.map +0 -1
  305. package/dist/secretsManager-DcMlHnRC.cjs.map +0 -1
  306. package/dist/seeds-CkIPFGNO.cjs.map +0 -1
  307. package/dist/seeds-odfgSCmu.mjs.map +0 -1
  308. package/dist/sniffer-BTtX3NUM.mjs.map +0 -1
  309. package/dist/sst-BgcOsaBi.cjs.map +0 -1
  310. package/dist/sst-CJzvyrEz.mjs.map +0 -1
  311. package/dist/stages-CUn6gvXL.cjs.map +0 -1
  312. package/dist/stages-CnZRYmkI.mjs.map +0 -1
  313. package/dist/terminal-D8TPK7o9.mjs.map +0 -1
  314. package/dist/terminal-DuapRxh6.cjs.map +0 -1
  315. package/dist/types-NqX1Hz4P.d.cts.map +0 -1
  316. package/dist/types-ZHuZ89hv.d.mts.map +0 -1
  317. package/dist/workspace-CJ0lKFq-.mjs.map +0 -1
  318. package/dist/workspace-CwW3Gkru.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,26 +1,29 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
4
- const require_credentials = require("./credentials-BKfIugu2.cjs");
5
- const require_discover = require("./discover-D1It5r_h.cjs");
4
+ const require_errors = require("./errors-DMC4Umsb.cjs");
5
+ const require_credentials = require("./credentials-QBu7VgaQ.cjs");
6
+ const require_discover = require("./discover-DPgu-ScS.cjs");
6
7
  const require_derive = require("./derive-DAbo49sm.cjs");
7
- const require_workspace = require("./workspace-CwW3Gkru.cjs");
8
+ const require_workspace = require("./workspace-CHOB2Xg3.cjs");
8
9
  const require_config = require("./config.cjs");
9
- const require_seeds = require("./seeds-CkIPFGNO.cjs");
10
- const require_EndpointGenerator = require("./EndpointGenerator-CwLjBCFE.cjs");
10
+ const require_seeds = require("./seeds-c-ByX9je.cjs");
11
+ const require_EndpointGenerator = require("./EndpointGenerator-De03t1hd.cjs");
11
12
  const require_openapi = require("./openapi.cjs");
12
- const require_SubscriberGenerator = require("./SubscriberGenerator-BVn7cQ-2.cjs");
13
+ const require_SubscriberGenerator = require("./SubscriberGenerator-Dvz7EzqK.cjs");
13
14
  const require_appPorts = require("./appPorts-Cu79hJF6.cjs");
14
- const require_drivers = require("./drivers-LYSdQDmd.cjs");
15
+ const require_drivers = require("./drivers-DDojgzz0.cjs");
15
16
  const require_emit = require("./emit-Dmc1nvdS.cjs");
16
- const require_local = require("./local-BjxDfPvy.cjs");
17
- const require_sniffer = require("./sniffer-IAQEpsQb.cjs");
18
- const require_deploy = require("./deploy-CuHasEA4.cjs");
19
- const require_compose = require("./compose-CvpU6ooi.cjs");
20
- const require_credentialSchemas = require("./credentialSchemas-DCR4Wd1W.cjs");
21
- const require_LocalStateStore = require("./LocalStateStore-BBeTlRTH.cjs");
17
+ const require_local = require("./local-B61kUh0w.cjs");
18
+ const require_sniffer = require("./sniffer-Dq5BS98f.cjs");
19
+ const require_deploy = require("./deploy-C3Mhnmus.cjs");
20
+ const require_compose = require("./compose-BHVKLluX.cjs");
21
+ const require_stack = require("./stack-1PeLJS2j.cjs");
22
+ const require_credentialSchemas = require("./credentialSchemas-CAPKFkrG.cjs");
23
+ const require_LocalStateStore = require("./LocalStateStore-oX_zxj9V.cjs");
22
24
  const require_utils = require("./utils-D2Nk1Nv2.cjs");
23
- const require_ready = require("./ready-BpNbORRB.cjs");
25
+ require("./awsStore-B5We7bMg.cjs");
26
+ const require_ready = require("./ready-D3PIjx3S.cjs");
24
27
  let node_path = require("node:path");
25
28
  let commander = require("commander");
26
29
  let node_process = require("node:process");
@@ -53,7 +56,7 @@ crypto = require_rolldown_runtime.__toESM(crypto, 1);
53
56
  let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
54
57
  let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
55
58
  //#region package.json
56
- var version = "10.0.0-alpha.91";
59
+ var version = "10.0.0-alpha.93";
57
60
  //#endregion
58
61
  //#region src/prompt.ts
59
62
  /**
@@ -64,7 +67,7 @@ var version = "10.0.0-alpha.91";
64
67
  * named error instead, and the command decides whether to ask.
65
68
  */
66
69
  /** A prompt was needed with no terminal to ask at. */
67
- var PromptNeedsTerminal = class extends Error {
70
+ var PromptNeedsTerminal = class extends require_errors.GkmError {
68
71
  question;
69
72
  instead;
70
73
  constructor(question, instead) {
@@ -136,7 +139,7 @@ const logger$8 = console;
136
139
  * Validate Dokploy token by making a test API call
137
140
  */
138
141
  async function validateDokployToken(endpoint, token) {
139
- const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-IAQEpsQb.cjs")).then((n) => n.dokploy_api_exports);
142
+ const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-Dq5BS98f.cjs")).then((n) => n.dokploy_api_exports);
140
143
  return new DokployApi({
141
144
  baseUrl: endpoint,
142
145
  token
@@ -520,7 +523,7 @@ async function isTrusted(url) {
520
523
  }
521
524
  }
522
525
  /** The edge has not run, so there is no authority to trust yet. */
523
- var NoLocalAuthority = class extends Error {
526
+ var NoLocalAuthority = class extends require_errors.GkmError {
524
527
  path;
525
528
  constructor(path) {
526
529
  super(`No local certificate authority at ${path}. It is generated the first time the edge starts, so run "gkm setup" (or "gkm dev") once — and if this project declares no file server, nothing needs one.`);
@@ -529,7 +532,7 @@ var NoLocalAuthority = class extends Error {
529
532
  }
530
533
  };
531
534
  /** A platform with no trust store this knows how to write to. */
532
- var UnsupportedPlatform = class extends Error {
535
+ var UnsupportedPlatform = class extends require_errors.GkmError {
533
536
  platform;
534
537
  certificate;
535
538
  constructor(platform, certificate) {
@@ -614,7 +617,7 @@ const SIGNED_IN = [
614
617
  "localstack"
615
618
  ];
616
619
  /** Nothing has generated this workspace's local logins yet. */
617
- var NoLocalCredentials = class extends Error {
620
+ var NoLocalCredentials = class extends require_errors.GkmError {
618
621
  workspace;
619
622
  constructor(workspace) {
620
623
  super(`'${workspace}' has no local logins on this machine yet: they are generated the first time gkm dev, gkm test or gkm setup starts its services. Run one of them, then this again.`);
@@ -664,7 +667,7 @@ const DISCOVERY_QUIET_ENV = "GKM_DISCOVERY_QUIET";
664
667
  /** The route everything is served under. */
665
668
  const BASE = "/__gkm";
666
669
  /** `GKM_DISCOVERY_PORT` is set to something that is not a port. */
667
- var InvalidDiscoveryPort = class extends Error {
670
+ var InvalidDiscoveryPort = class extends require_errors.GkmError {
668
671
  value;
669
672
  constructor(value) {
670
673
  super(`${DISCOVERY_PORT_ENV}=${value} is not a port. Set it to a number from 0 to 65535 (0 serves discovery on a free port of its own), or unset it to use dev.discoveryPort.`);
@@ -1754,7 +1757,7 @@ function closeFakes(served) {
1754
1757
  //#region src/exec/index.ts
1755
1758
  const logger$6 = console;
1756
1759
  /** `gkm exec` was given nothing to run. */
1757
- var NoCommandSpecified = class extends Error {
1760
+ var NoCommandSpecified = class extends require_errors.GkmError {
1758
1761
  constructor() {
1759
1762
  super("No command specified. Usage: gkm exec -- <command>");
1760
1763
  this.name = "NoCommandSpecified";
@@ -2330,9 +2333,9 @@ async function workspaceDevCommand(configured, options) {
2330
2333
  for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
2331
2334
  logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
2332
2335
  if (options.migrate || options.seed) {
2333
- const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-q2YYLJLE.cjs"));
2336
+ const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-C8wTpakT.cjs"));
2334
2337
  await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
2335
- } else await Promise.resolve().then(() => require("./migrate-q2YYLJLE.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2338
+ } else await Promise.resolve().then(() => require("./migrate-C8wTpakT.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2336
2339
  logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
2337
2340
  });
2338
2341
  const appUrls = {};
@@ -2742,7 +2745,7 @@ function tsxCommand(appRoot, args) {
2742
2745
  }
2743
2746
  }
2744
2747
  /** A port this app must serve on is held by something else. */
2745
- var DevPortInUse = class extends Error {
2748
+ var DevPortInUse = class extends require_errors.GkmError {
2746
2749
  port;
2747
2750
  holder;
2748
2751
  constructor(port, holder) {
@@ -2759,7 +2762,7 @@ var DevPortInUse = class extends Error {
2759
2762
  * Only these are refused: a port another project holds is moved off instead
2760
2763
  * (see `assignAppPorts`), but moving off our own would start a second copy.
2761
2764
  */
2762
- var WorkspacePortsInUse = class extends Error {
2765
+ var WorkspacePortsInUse = class extends require_errors.GkmError {
2763
2766
  held;
2764
2767
  constructor(held) {
2765
2768
  super(`This workspace's apps are already running:\n${held.map(({ app, port, holder }) => ` ${app}: ${port} — ${require_appPorts.describeHolder(holder)}`).join("\n")}\nA previous \`gkm dev\` left them behind. Stop them (kill the pids above) and start again. Nothing was started.`);
@@ -3216,7 +3219,7 @@ const SUPERSEDED_OUTPUT = [
3216
3219
  function isMainProvider(value) {
3217
3220
  return value === "aws" || value === "server";
3218
3221
  }
3219
- var UnknownBuildProvider = class extends Error {
3222
+ var UnknownBuildProvider = class extends require_errors.GkmError {
3220
3223
  provider;
3221
3224
  constructor(provider) {
3222
3225
  super(`'${provider}' is not a build target. Pass --provider aws or --provider server, or leave it out to build for where gkm.config.ts deploys.`);
@@ -3225,7 +3228,7 @@ var UnknownBuildProvider = class extends Error {
3225
3228
  }
3226
3229
  };
3227
3230
  /** `--cache` named something that is not a cache backend. */
3228
- var UnknownCacheBackend = class extends Error {
3231
+ var UnknownCacheBackend = class extends require_errors.GkmError {
3229
3232
  backend;
3230
3233
  constructor(backend) {
3231
3234
  super(`'${backend}' is not a cache backend. Pass --cache upstash, elasticache, db or redis, or leave it out to register the deploy target's.`);
@@ -3385,7 +3388,7 @@ async function buildApp(input) {
3385
3388
  ...production,
3386
3389
  ...telemetry ? { telemetry } : {}
3387
3390
  });
3388
- const { bundleServer } = await Promise.resolve().then(() => require("./bundler-BQJiB7Ub.cjs"));
3391
+ const { bundleServer } = await Promise.resolve().then(() => require("./bundler-Dfsr6KXU.cjs"));
3389
3392
  await bundleServer({
3390
3393
  entryPoint,
3391
3394
  outputDir: (0, node_path.join)(outputDir, "dist"),
@@ -3530,7 +3533,7 @@ async function buildWorkers(input) {
3530
3533
  });
3531
3534
  logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
3532
3535
  if (!input.bundle) continue;
3533
- const { bundleServer } = await Promise.resolve().then(() => require("./bundler-BQJiB7Ub.cjs"));
3536
+ const { bundleServer } = await Promise.resolve().then(() => require("./bundler-Dfsr6KXU.cjs"));
3534
3537
  const outfile = require_seeds.workerBundleName(worker.id);
3535
3538
  await bundleServer({
3536
3539
  entryPoint,
@@ -3616,7 +3619,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
3616
3619
  let masterKey;
3617
3620
  if (context.production?.bundle && !skipBundle) {
3618
3621
  logger$4.log(`\n📦 Bundling production server...`);
3619
- const { bundleServer } = await Promise.resolve().then(() => require("./bundler-BQJiB7Ub.cjs"));
3622
+ const { bundleServer } = await Promise.resolve().then(() => require("./bundler-Dfsr6KXU.cjs"));
3620
3623
  const allConstructs = [
3621
3624
  ...endpoints.map((e) => e.construct),
3622
3625
  ...functions.map((f) => f.construct),
@@ -3854,7 +3857,7 @@ function formatRoutes(routes) {
3854
3857
  * `deploy()` as any other target, so there is one way a stack comes up.
3855
3858
  */
3856
3859
  /** `--build` and `--pull` together ask for two different things. */
3857
- var ComposeModeConflict = class extends Error {
3860
+ var ComposeModeConflict = class extends require_errors.GkmError {
3858
3861
  constructor() {
3859
3862
  super("--build and --pull ask for opposite things: build images from this checkout, or pull a tag CI pushed. Pass one of them.");
3860
3863
  this.name = "ComposeModeConflict";
@@ -3862,7 +3865,7 @@ var ComposeModeConflict = class extends Error {
3862
3865
  };
3863
3866
  /** Each pushed image as `<ref>@sha256:…`, by app. */
3864
3867
  function pushedDigests(run) {
3865
- return Object.fromEntries(Object.entries(run.images).filter(([, image]) => image.digest).sort(([a], [b]) => a.localeCompare(b)).map(([app, image]) => [app, require_compose.pinnedRef(image.ref, image.digest)]));
3868
+ return Object.fromEntries(Object.entries(run.images).filter(([, image]) => image.digest).sort(([a], [b]) => a.localeCompare(b)).map(([app, image]) => [app, require_stack.pinnedRef(image.ref, image.digest)]));
3866
3869
  }
3867
3870
  /** `gkm compose`. */
3868
3871
  async function composeCommand(options, deps = {}) {
@@ -3876,12 +3879,12 @@ async function composeCommand(options, deps = {}) {
3876
3879
  if (options.down) {
3877
3880
  const override = require_compose.stackOverrideFile(workspace.root, stage);
3878
3881
  const ref = {
3879
- project: require_compose.composeProject(require_seeds.deployIdentity(workspace, stage)),
3880
- file: (0, node_path.join)(workspace.root, require_compose.stackDir(stage), "docker-compose.yml"),
3882
+ project: require_stack.composeProject(require_seeds.deployIdentity(workspace, stage)),
3883
+ file: (0, node_path.join)(workspace.root, require_stack.stackDir(stage), "docker-compose.yml"),
3881
3884
  ...(0, node_fs.existsSync)(override) ? { overrides: [override] } : {},
3882
3885
  cwd: workspace.root
3883
3886
  };
3884
- if (await require_compose.removeEdgeRoutes(require_compose.edgeDir(deps.env ?? process.env), ref.project)) console.log(`🌐 Removed ${ref.project}'s routes from ${require_compose.EDGE_PROJECT}.`);
3887
+ if (await require_compose.removeEdgeRoutes(require_compose.edgeDir(deps.env ?? process.env), ref.project)) console.log(`🌐 Removed ${ref.project}'s routes from ${require_stack.EDGE_PROJECT}.`);
3885
3888
  await (deps.docker ?? require_compose.dockerCompose).down(ref);
3886
3889
  console.log(`🛑 Stopped ${ref.project}. Its volumes are kept.`);
3887
3890
  return;
@@ -3891,7 +3894,7 @@ async function composeCommand(options, deps = {}) {
3891
3894
  const tag = options.tag ?? (options.pull ? "latest" : void 0);
3892
3895
  const pin = options.digestsFile && pulls ? {
3893
3896
  file: options.digestsFile,
3894
- digests: require_compose.parseDigests(options.digestsFile, await (0, node_fs_promises.readFile)((0, node_path.resolve)(cwd, options.digestsFile), "utf-8"))
3897
+ digests: require_stack.parseDigests(options.digestsFile, await (0, node_fs_promises.readFile)((0, node_path.resolve)(cwd, options.digestsFile), "utf-8"))
3895
3898
  } : void 0;
3896
3899
  const result = await require_deploy.deploy({
3897
3900
  cwd,
@@ -3936,12 +3939,37 @@ async function composeCommand(options, deps = {}) {
3936
3939
  deploy: result
3937
3940
  };
3938
3941
  }
3942
+ //#endregion
3943
+ //#region src/debug.ts
3944
+ let _debug = false;
3945
+ /**
3946
+ * Enable debug mode globally.
3947
+ * When enabled, verbose error details are shown everywhere.
3948
+ */
3949
+ function enableDebug() {
3950
+ _debug = true;
3951
+ }
3952
+ /**
3953
+ * Check if debug mode is active.
3954
+ * Activated by `--debug` flag or `GKM_DEBUG=1` env var.
3955
+ */
3956
+ function isDebug() {
3957
+ return _debug || process.env.GKM_DEBUG === "1";
3958
+ }
3939
3959
  /**
3940
3960
  * Format a fatal error for display.
3941
- * Always includes the full stack trace since these are process-ending errors.
3961
+ *
3962
+ * An error gkm raised on purpose ({@link isGkmError}) is `Name: message` —
3963
+ * its message is the answer, and a stack would only point into gkm. Anything
3964
+ * else is unexpected, and prints its stack and every cause beneath it. Debug
3965
+ * mode prints the stack of both.
3942
3966
  */
3943
3967
  function formatError(error) {
3944
3968
  if (!(error instanceof Error)) return String(error);
3969
+ if (require_errors.isGkmError(error) && !isDebug()) {
3970
+ const cause = error.cause;
3971
+ return cause === void 0 ? `${error.name}: ${error.message}` : `${error.name}: ${error.message}\n\nCaused by: ${cause instanceof Error ? `${cause.name}: ${cause.message}` : String(cause)}`;
3972
+ }
3945
3973
  let output = error.stack ?? error.message;
3946
3974
  let cause = error.cause;
3947
3975
  while (cause) if (cause instanceof Error) {
@@ -3953,6 +3981,14 @@ function formatError(error) {
3953
3981
  }
3954
3982
  return output;
3955
3983
  }
3984
+ /**
3985
+ * End a command that failed: print the error ({@link formatError}) on stderr
3986
+ * and exit 1. What every command's action does with what it throws.
3987
+ */
3988
+ function exitWithError(error) {
3989
+ console.error(formatError(error));
3990
+ process.exit(1);
3991
+ }
3956
3992
  //#endregion
3957
3993
  //#region src/deploy/init.ts
3958
3994
  const logger$3 = console;
@@ -4104,6 +4140,7 @@ const MASKED = "********";
4104
4140
  */
4105
4141
  function maskStateSecrets(state) {
4106
4142
  const masked = structuredClone(state);
4143
+ if (masked.provider !== "dokploy") return masked;
4107
4144
  for (const credentials of Object.values(masked.appCredentials ?? {})) credentials.dbPassword = MASKED;
4108
4145
  for (const secrets of Object.values(masked.generatedSecrets ?? {})) for (const name of Object.keys(secrets)) secrets[name] = MASKED;
4109
4146
  if (masked.backups) {
@@ -4159,6 +4196,7 @@ async function stateShowCommand(options) {
4159
4196
  if (options.json) console.log(JSON.stringify(state, null, 2));
4160
4197
  else {
4161
4198
  printStateDetails(state);
4199
+ printDnsRecords(stored.resources);
4162
4200
  printUnfinished(stored.resources);
4163
4201
  }
4164
4202
  }
@@ -4203,8 +4241,8 @@ async function stateDiffCommand(options) {
4203
4241
  if (!remote) console.log("Remote: (none)");
4204
4242
  else console.log(`Remote: Last deployed ${remote.lastDeployedAt}`);
4205
4243
  console.log("");
4206
- const localApps = local?.applications ?? {};
4207
- const remoteApps = remote?.applications ?? {};
4244
+ const localApps = dokploy(local)?.applications ?? {};
4245
+ const remoteApps = dokploy(remote)?.applications ?? {};
4208
4246
  const allApps = /* @__PURE__ */ new Set([...Object.keys(localApps), ...Object.keys(remoteApps)]);
4209
4247
  if (allApps.size > 0) {
4210
4248
  console.log("Applications:");
@@ -4217,8 +4255,8 @@ async function stateDiffCommand(options) {
4217
4255
  else console.log(` ${app}: ${localId} (local) != ${remoteId} (remote) [MISMATCH]`);
4218
4256
  }
4219
4257
  }
4220
- const localServices = local?.services ?? {};
4221
- const remoteServices = remote?.services ?? {};
4258
+ const localServices = dokploy(local)?.services ?? {};
4259
+ const remoteServices = dokploy(remote)?.services ?? {};
4222
4260
  if (Object.keys(localServices).length > 0 || Object.keys(remoteServices).length > 0) {
4223
4261
  console.log("\nServices:");
4224
4262
  const serviceKeys = /* @__PURE__ */ new Set([...Object.keys(localServices), ...Object.keys(remoteServices)]);
@@ -4283,6 +4321,10 @@ async function copyStage(from, to, stage) {
4283
4321
  for (const { updatedAt: _stamped, ...record } of Object.values(source.resources)) version = await to.putResource(stage, record, { expectedVersion: version });
4284
4322
  return source;
4285
4323
  }
4324
+ /** `state` if Dokploy wrote it — the only shape with ids of its own. */
4325
+ function dokploy(state) {
4326
+ return state?.provider === "dokploy" ? state : null;
4327
+ }
4286
4328
  function describeRecord(record) {
4287
4329
  if (!record) return "(none)";
4288
4330
  return record.id ? `${record.status} ${record.id}` : record.status;
@@ -4296,6 +4338,12 @@ function printUnfinished(resources) {
4296
4338
  for (const record of pending) console.log(` ${record.key}`);
4297
4339
  }
4298
4340
  function printStateSummary(state) {
4341
+ if (state.provider !== "dokploy") {
4342
+ console.log(` Stage: ${state.stage} (${state.provider})`);
4343
+ console.log(` Apps released: ${Object.keys(state.releases ?? {}).length}`);
4344
+ console.log(` Last deployed: ${state.lastDeployedAt}`);
4345
+ return;
4346
+ }
4299
4347
  const appCount = Object.keys(state.applications).length;
4300
4348
  const hasPostgres = !!state.services.postgresId;
4301
4349
  const hasRedis = !!state.services.redisId;
@@ -4306,6 +4354,14 @@ function printStateSummary(state) {
4306
4354
  console.log(` Last deployed: ${state.lastDeployedAt}`);
4307
4355
  }
4308
4356
  function printStateDetails(state) {
4357
+ if (state.provider !== "dokploy") {
4358
+ console.log(`Stage: ${state.stage} (${state.provider})`);
4359
+ console.log(`Last Deployed: ${state.lastDeployedAt}`);
4360
+ if (state.identity) console.log(`Identity: ${state.identity}`);
4361
+ console.log("");
4362
+ printReleases(state.releases);
4363
+ return;
4364
+ }
4309
4365
  console.log(`Stage: ${state.stage}`);
4310
4366
  console.log(`Environment ID: ${state.environmentId}`);
4311
4367
  console.log(`Last Deployed: ${state.lastDeployedAt}`);
@@ -4347,6 +4403,62 @@ function printStateDetails(state) {
4347
4403
  for (const [hostname, info] of Object.entries(state.dnsVerified)) console.log(` ${hostname}: ${info.serverIp} (${info.verifiedAt})`);
4348
4404
  }
4349
4405
  }
4406
+ /** Each app's current release, and who released it. */
4407
+ function printReleases(releases) {
4408
+ console.log("Releases:");
4409
+ const apps = Object.entries(releases ?? {});
4410
+ if (apps.length === 0) {
4411
+ console.log(" (none)");
4412
+ return;
4413
+ }
4414
+ for (const [app, { current }] of apps) console.log(` ${app}: ${describeRelease(current)}`);
4415
+ }
4416
+ /** `ghcr.io/acme/api:v2 (sha256:…) · 2026-… · ada@laptop` */
4417
+ function describeRelease(release) {
4418
+ return [
4419
+ `${release.ref}${release.digest ? ` (${release.digest})` : ""}`,
4420
+ release.releasedAt,
4421
+ require_seeds.describeActor(release.releasedBy)
4422
+ ].join(" · ");
4423
+ }
4424
+ /** The DNS records gkm wrote for the stage. */
4425
+ function printDnsRecords(resources) {
4426
+ const records = require_seeds.dnsResources(resources);
4427
+ if (records.length === 0) return;
4428
+ console.log("");
4429
+ console.log("DNS Records:");
4430
+ for (const record of records) console.log(` ${record.fqdn} ${record.type} ${record.value} (TTL ${record.ttl}${record.provider ? `, ${record.provider}` : ""})`);
4431
+ }
4432
+ /**
4433
+ * Who wrote a stage's state, newest first, and what each app runs.
4434
+ * `gkm state:history --stage=<stage>`
4435
+ */
4436
+ async function stateHistoryCommand(options) {
4437
+ const { workspace } = await require_config.loadWorkspaceConfig();
4438
+ const stored = await (await require_seeds.createStateStore({
4439
+ config: workspace.state,
4440
+ workspaceRoot: workspace.root,
4441
+ workspaceName: workspace.name
4442
+ })).read(options.stage);
4443
+ if (!stored) {
4444
+ console.log(`No state found for stage: ${options.stage}`);
4445
+ return;
4446
+ }
4447
+ const history = {
4448
+ stage: options.stage,
4449
+ history: stored.history,
4450
+ releases: Object.fromEntries(Object.entries(stored.state.releases ?? {}).map(([app, releases]) => [app, releases.current]))
4451
+ };
4452
+ if (options.json) {
4453
+ console.log(JSON.stringify(history, null, 2));
4454
+ return;
4455
+ }
4456
+ console.log(`History of stage ${options.stage} (newest first):`);
4457
+ if (history.history.length === 0) console.log(" (none recorded)");
4458
+ for (const entry of history.history) console.log(` ${entry.serial} · ${entry.at} · ${require_seeds.describeActor(entry.by)} · ${entry.operation}`);
4459
+ console.log("");
4460
+ printReleases(stored.state.releases);
4461
+ }
4350
4462
  //#endregion
4351
4463
  //#region src/secrets/generator.ts
4352
4464
  /**
@@ -5318,25 +5430,25 @@ function loadPackageJson() {
5318
5430
  * Run: pnpm --filter @geekmidas/cli sync-versions
5319
5431
  */
5320
5432
  const GEEKMIDAS_VERSIONS = {
5321
- "@geekmidas/audit": "~10.0.0-alpha.91",
5322
- "@geekmidas/auth": "~10.0.0-alpha.91",
5323
- "@geekmidas/cache": "~10.0.0-alpha.91",
5324
- "@geekmidas/client": "~10.0.0-alpha.91",
5325
- "@geekmidas/cloud": "~10.0.0-alpha.91",
5326
- "@geekmidas/constructs": "~10.0.0-alpha.91",
5327
- "@geekmidas/db": "~10.0.0-alpha.91",
5328
- "@geekmidas/emailkit": "~10.0.0-alpha.91",
5329
- "@geekmidas/envkit": "~10.0.0-alpha.91",
5330
- "@geekmidas/errors": "~10.0.0-alpha.91",
5331
- "@geekmidas/events": "~10.0.0-alpha.91",
5332
- "@geekmidas/logger": "~10.0.0-alpha.91",
5333
- "@geekmidas/manifest": "~10.0.0-alpha.91",
5334
- "@geekmidas/rate-limit": "~10.0.0-alpha.91",
5335
- "@geekmidas/schema": "~10.0.0-alpha.91",
5336
- "@geekmidas/services": "~10.0.0-alpha.91",
5337
- "@geekmidas/storage": "~10.0.0-alpha.91",
5338
- "@geekmidas/telescope": "~10.0.0-alpha.91",
5339
- "@geekmidas/testkit": "~10.0.0-alpha.91",
5433
+ "@geekmidas/audit": "~10.0.0-alpha.93",
5434
+ "@geekmidas/auth": "~10.0.0-alpha.93",
5435
+ "@geekmidas/cache": "~10.0.0-alpha.93",
5436
+ "@geekmidas/client": "~10.0.0-alpha.93",
5437
+ "@geekmidas/cloud": "~10.0.0-alpha.93",
5438
+ "@geekmidas/constructs": "~10.0.0-alpha.93",
5439
+ "@geekmidas/db": "~10.0.0-alpha.93",
5440
+ "@geekmidas/emailkit": "~10.0.0-alpha.93",
5441
+ "@geekmidas/envkit": "~10.0.0-alpha.93",
5442
+ "@geekmidas/errors": "~10.0.0-alpha.93",
5443
+ "@geekmidas/events": "~10.0.0-alpha.93",
5444
+ "@geekmidas/logger": "~10.0.0-alpha.93",
5445
+ "@geekmidas/manifest": "~10.0.0-alpha.93",
5446
+ "@geekmidas/rate-limit": "~10.0.0-alpha.93",
5447
+ "@geekmidas/schema": "~10.0.0-alpha.93",
5448
+ "@geekmidas/services": "~10.0.0-alpha.93",
5449
+ "@geekmidas/storage": "~10.0.0-alpha.93",
5450
+ "@geekmidas/telescope": "~10.0.0-alpha.93",
5451
+ "@geekmidas/testkit": "~10.0.0-alpha.93",
5340
5452
  "@geekmidas/cli": `~${loadPackageJson().version}`
5341
5453
  };
5342
5454
  //#endregion
@@ -5737,7 +5849,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
5737
5849
  * The `uses:` value for the stages action, with a comment saying which CLI
5738
5850
  * release the pinned commit is.
5739
5851
  */
5740
- function stagesActionUses(commit = "b0922ee71407fefc3e94a0352793ef5e78c1bdea", version = cliVersion()) {
5852
+ function stagesActionUses(commit = "a619ff213e362417b184dff08c8175a86f5d9d07", version = cliVersion()) {
5741
5853
  return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
5742
5854
  }
5743
5855
  //#endregion
@@ -7248,7 +7360,7 @@ ${inputs.join("\n")}
7248
7360
  * An SST scaffold asked for without a region. `init` always resolves one —
7249
7361
  * asked, `--region`, or eu-west-1 under `--yes` — so this is a caller's bug.
7250
7362
  */
7251
- var SstNeedsRegion = class extends Error {
7363
+ var SstNeedsRegion = class extends require_errors.GkmError {
7252
7364
  constructor() {
7253
7365
  super("An SST deploy needs a region: pass --region, e.g. eu-west-1.");
7254
7366
  this.name = "SstNeedsRegion";
@@ -10688,7 +10800,7 @@ function resolveStages(options, answers) {
10688
10800
  return stages;
10689
10801
  }
10690
10802
  /** `--deploy` naming a target init has no scaffold for. */
10691
- var UnknownDeployTarget = class extends Error {
10803
+ var UnknownDeployTarget = class extends require_errors.GkmError {
10692
10804
  target;
10693
10805
  known;
10694
10806
  constructor(target, known) {
@@ -10707,7 +10819,7 @@ function defaultRegistry(name) {
10707
10819
  return `ghcr.io/${(name ?? "my-org").toLowerCase()}`;
10708
10820
  }
10709
10821
  /** `--region` that is not shaped like one, e.g. `europe` for `eu-west-1`. */
10710
- var NotAnAwsRegion = class extends Error {
10822
+ var NotAnAwsRegion = class extends require_errors.GkmError {
10711
10823
  region;
10712
10824
  constructor(region) {
10713
10825
  super(`"${region}" is not an AWS region. Use one like eu-west-1.`);
@@ -10837,7 +10949,7 @@ async function secretsSetCommand(key, value, options) {
10837
10949
  logger$2.log(`\n✓ Secret "${key}" set for stage "${stage}" (${store.name})`);
10838
10950
  }
10839
10951
  /** `gkm secrets:unset` for a key the stage does not hold. */
10840
- var SecretNotSet = class extends Error {
10952
+ var SecretNotSet = class extends require_errors.GkmError {
10841
10953
  key;
10842
10954
  stage;
10843
10955
  constructor(key, stage) {
@@ -10848,7 +10960,7 @@ var SecretNotSet = class extends Error {
10848
10960
  }
10849
10961
  };
10850
10962
  /** `gkm secrets:unset` on a stage that has no secrets at all. */
10851
- var StageSecretsNotFound = class extends Error {
10963
+ var StageSecretsNotFound = class extends require_errors.GkmError {
10852
10964
  stage;
10853
10965
  constructor(stage) {
10854
10966
  super(`The stage '${stage}' has no secrets, so there is nothing to remove.`);
@@ -11019,138 +11131,8 @@ function maskUrl(url) {
11019
11131
  }
11020
11132
  }
11021
11133
  //#endregion
11022
- //#region src/providers/dns.ts
11023
- /** Whether the workspace deploys through the compose target. */
11024
- function deploysWithCompose(workspace) {
11025
- return workspace.deploy?.default === "compose" || Object.values(workspace.apps).some((app) => app.resolvedDeployTarget === "compose");
11026
- }
11027
- /**
11028
- * A compose stage that serves a domain has its server's address in its
11029
- * secrets — checked before `gkm setup --stage` does anything else.
11030
- *
11031
- * @throws {ServerAddressMissing} for a compose stage with a domain and none
11032
- * @throws {ServerAddressInvalid} for a value that is not an address
11033
- */
11034
- function assertStageServer(workspace, stage, secrets) {
11035
- if (stage === workspace.stages.local) return void 0;
11036
- if (!deploysWithCompose(workspace)) return require_compose.serverAddress(stage, secrets?.custom);
11037
- return require_compose.requiredServerAddress(stage, workspace.domains?.[stage], secrets?.custom);
11038
- }
11039
- /**
11040
- * The hosts a compose stage serves: its stack composed as a deploy would —
11041
- * with the secrets it would generate made up in memory, never written — and
11042
- * every route's host read off it.
11043
- */
11044
- async function composeStageHosts(options) {
11045
- const { workspace, stage } = options;
11046
- const runnables = options.runnables ?? {};
11047
- const background = options.background ?? {};
11048
- const manifest = options.manifest ?? await require_discover.discover({
11049
- patterns: require_seeds.constructGlobs(workspace),
11050
- cwd: workspace.root,
11051
- runnables,
11052
- background
11053
- });
11054
- const stored = await (await require_seeds.secretsStoreFor(workspace, stage, {
11055
- ...options.profile ? { profile: options.profile } : {},
11056
- ...options.home ? { home: options.home } : {}
11057
- })).read(stage);
11058
- const { deployedStackSecrets } = await Promise.resolve().then(() => require("./compose-CvpU6ooi.cjs")).then((n) => n.secrets_exports);
11059
- const { composeStack } = await Promise.resolve().then(() => require("./compose-CvpU6ooi.cjs")).then((n) => n.stack_exports);
11060
- const { secrets } = deployedStackSecrets(workspace, stage, stored, manifest);
11061
- const stack = composeStack({
11062
- workspace,
11063
- manifest,
11064
- runnables,
11065
- background,
11066
- stage,
11067
- identity: require_seeds.deployIdentity(workspace, stage),
11068
- images: {
11069
- mode: "pull",
11070
- tag: "dns",
11071
- ...workspace.deploy?.registry ? { registry: workspace.deploy.registry } : {}
11072
- },
11073
- secrets,
11074
- buildOnly: true,
11075
- allowDevServices: true
11076
- });
11077
- return require_compose.stackHosts(stack);
11078
- }
11079
- /**
11080
- * `GKM_SERVER_IPV4` from the stage's secrets and `dns`: each public host's
11081
- * records, created or corrected. A dry run reads and prints, and writes
11082
- * nothing.
11083
- */
11084
- async function provisionStageDns(options) {
11085
- const { workspace, stage } = options;
11086
- const log = options.log ?? ((line) => console.log(line));
11087
- if (stage === workspace.stages.local || !workspace.dns || !deploysWithCompose(workspace)) return {
11088
- mode: "none",
11089
- hosts: [],
11090
- changes: []
11091
- };
11092
- const store = await require_seeds.secretsStoreFor(workspace, stage, {
11093
- ...options.profile ? { profile: options.profile } : {},
11094
- ...options.home ? { home: options.home } : {}
11095
- });
11096
- const server = require_compose.serverAddress(stage, (await store.read(stage))?.custom);
11097
- if (!server) {
11098
- log(`\n🌐 DNS for '${stage}': no GKM_SERVER_IPV4 in its secrets, so no records — ${require_compose.serverAddressHint(stage)}`);
11099
- return {
11100
- mode: "none",
11101
- hosts: [],
11102
- changes: []
11103
- };
11104
- }
11105
- const hosts = [...options.hosts ?? await composeStageHosts({
11106
- workspace,
11107
- stage,
11108
- ...options.profile ? { profile: options.profile } : {},
11109
- ...options.home ? { home: options.home } : {},
11110
- ...options.manifest ? { manifest: options.manifest } : {},
11111
- ...options.runnables ? { runnables: options.runnables } : {},
11112
- ...options.background ? { background: options.background } : {}
11113
- })];
11114
- log(`\n🌐 DNS for '${stage}' → ${server.ipv4}${server.ipv6 ? ` / ${server.ipv6}` : ""}${options.dryRun ? " (dry run — nothing is written)" : ""}`);
11115
- const plan = require_compose.planStackDns({
11116
- stage,
11117
- hosts,
11118
- server,
11119
- dns: workspace.dns
11120
- });
11121
- try {
11122
- return {
11123
- mode: "records",
11124
- hosts,
11125
- changes: await require_compose.applyStackDns(plan, {
11126
- ...options.dryRun ? { dryRun: true } : {},
11127
- log,
11128
- credentials: {
11129
- env: options.env ?? process.env,
11130
- ...options.home ? { home: options.home } : {},
11131
- log
11132
- },
11133
- ...options.providerFor ? { providerFor: options.providerFor } : {}
11134
- })
11135
- };
11136
- } catch (error) {
11137
- if (error instanceof require_credentials.MissingCredential) {
11138
- log(` ⚠ ${error.message}`);
11139
- log(" Until then, create these records yourself:");
11140
- for (const domain of plan.domains) for (const r of domain.records) log(` ${r.host.padEnd(32)} ${r.type.padEnd(5)} ${r.value} (TTL ${r.ttl})`);
11141
- return {
11142
- mode: "records",
11143
- hosts,
11144
- changes: []
11145
- };
11146
- }
11147
- throw error;
11148
- }
11149
- }
11150
- //#endregion
11151
11134
  //#region src/setup/index.ts
11152
11135
  var setup_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
11153
- StageSecretsUnreadable: () => StageSecretsUnreadable,
11154
11136
  createFreshWorkspaceSecrets: () => createFreshWorkspaceSecrets,
11155
11137
  ensureStageSecrets: () => ensureStageSecrets,
11156
11138
  reconcileSecrets: () => reconcileSecrets,
@@ -11182,7 +11164,10 @@ async function setupCommand(options = {}) {
11182
11164
  logger$1.log(`📦 Workspace: ${workspace.name}`);
11183
11165
  logger$1.log(`📱 Apps: ${Object.keys(workspace.apps).join(", ")}`);
11184
11166
  logger$1.log(`🔑 Stage: ${stage}\n`);
11185
- if (!local) assertStageServer(workspace, stage, await readStageSecrets(await require_seeds.secretsStoreFor(workspace, stage, { ...options.profile ? { profile: options.profile } : {} }), stage, options));
11167
+ if (!local) {
11168
+ const store = await require_seeds.secretsStoreFor(workspace, stage, { ...options.profile ? { profile: options.profile } : {} });
11169
+ require_seeds.assertStageServer(workspace, stage, await store.read(stage));
11170
+ }
11186
11171
  if (!local && options.dryRun) {
11187
11172
  await provisionDeployed(workspace, stage, options);
11188
11173
  return;
@@ -11201,48 +11186,6 @@ async function setupCommand(options = {}) {
11201
11186
  }
11202
11187
  printSummary(workspace, stage);
11203
11188
  }
11204
- /** Where each AWS store keeps a stage's secrets, as a person reads it. */
11205
- const AWS_STORES = {
11206
- ssm: "SSM Parameter Store",
11207
- "secrets-manager": "Secrets Manager"
11208
- };
11209
- /**
11210
- * A deployed stage's secrets are kept in its AWS account, and no AWS
11211
- * credentials were found to read them with.
11212
- *
11213
- * Raised before any provider runs: even a dry run reads the stage's secrets,
11214
- * since its plan needs the server they name (`GKM_SERVER_IPV4`).
11215
- */
11216
- var StageSecretsUnreadable = class extends Error {
11217
- stage;
11218
- store;
11219
- profile;
11220
- dryRun;
11221
- constructor(stage, store, profile, dryRun, cause) {
11222
- const where = AWS_STORES[store] ?? `the '${store}' store`;
11223
- const command = `gkm setup --stage ${stage}${dryRun ? " --dry-run" : ""}`;
11224
- super(`The '${stage}' stage's secrets are kept in ${where}, in the stage's AWS account, and ` + (profile ? `the AWS profile '${profile}' has no credentials to read them with. Sign in to it (aws sso login --profile ${profile}) or name another: ${command} --profile <profile>.` : `no AWS credentials were found to read them with. Name the account's profile: ${command} --profile <profile>, or AWS_PROFILE=<profile> ${command}.`) + (dryRun ? " A dry run still reads them: its plan needs the server the stage names (GKM_SERVER_IPV4)." : ""), { cause });
11225
- this.stage = stage;
11226
- this.store = store;
11227
- this.profile = profile;
11228
- this.dryRun = dryRun;
11229
- this.name = "StageSecretsUnreadable";
11230
- }
11231
- };
11232
- /**
11233
- * The stage's secrets from its store, refused with
11234
- * {@link StageSecretsUnreadable} when there are no AWS credentials to read
11235
- * them — matched by the SDK's error name, its message being free to change.
11236
- * Any other failure is the store's own, and passes through.
11237
- */
11238
- async function readStageSecrets(store, stage, options) {
11239
- try {
11240
- return await store.read(stage);
11241
- } catch (error) {
11242
- if (error?.name === "CredentialsProviderError") throw new StageSecretsUnreadable(stage, store.name, options.profile, options.dryRun === true, error);
11243
- throw error;
11244
- }
11245
- }
11246
11189
  /**
11247
11190
  * A deployed stage's providers: each one's `ensure()`, in the stage's own
11248
11191
  * account, its keys written into the stage's secrets.
@@ -11259,7 +11202,7 @@ async function provisionDeployed(workspace, stage, options) {
11259
11202
  log: (line) => logger$1.log(line)
11260
11203
  })).filter((r) => r.mode === "provider");
11261
11204
  if (configured.length === 0) logger$1.log(` None configured: '${stage}' takes every key from its secrets (gkm secrets:add --stage ${stage}). Name one in gkm.config.ts — deploy: { objects: { ${stage}: { provider: 's3' } } } — to have ${require_seeds.provisionCommand(stage)} create it.`);
11262
- const dns = await provisionStageDns({
11205
+ const dns = await require_seeds.provisionStageDns({
11263
11206
  workspace,
11264
11207
  stage,
11265
11208
  ...options.dryRun ? { dryRun: true } : {},
@@ -11485,7 +11428,7 @@ async function readReady(path) {
11485
11428
  }
11486
11429
  }
11487
11430
  /** A name recorded for the test stage without the test stage's suffix. */
11488
- var NotATestDatabase = class extends Error {
11431
+ var NotATestDatabase = class extends require_errors.GkmError {
11489
11432
  database;
11490
11433
  constructor(database) {
11491
11434
  super(`Refusing to drop '${database}': only the test stage's databases (named '…_${require_workspace.TEST_STAGE}') are dropped after a suite. Delete ${require_ready.TEST_READY_FILE} if it was edited by hand.`);
@@ -11622,8 +11565,8 @@ function testDatabases(reconciled) {
11622
11565
  * starts without the reference data the app needs.
11623
11566
  */
11624
11567
  async function migrateTestStage(workspace, env) {
11625
- const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-q2YYLJLE.cjs"));
11626
- const { discover } = await Promise.resolve().then(() => require("./discover-D1It5r_h.cjs")).then((n) => n.discover_exports);
11568
+ const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-C8wTpakT.cjs"));
11569
+ const { discover } = await Promise.resolve().then(() => require("./discover-DPgu-ScS.cjs")).then((n) => n.discover_exports);
11627
11570
  const sources = {};
11628
11571
  const manifest = await discover({
11629
11572
  patterns: require_seeds.constructGlobs(workspace),
@@ -11641,7 +11584,7 @@ async function migrateTestStage(workspace, env) {
11641
11584
  for (const { target, seeded } of seeds) if (seeded.length > 0) console.log(` 🌱 ${target.seeds}: ran ${seeded.join(", ")}`);
11642
11585
  }
11643
11586
  /** `gkm test` outside a project that declares stages, with none named. */
11644
- var NoStageToTest = class extends Error {
11587
+ var NoStageToTest = class extends require_errors.GkmError {
11645
11588
  constructor() {
11646
11589
  super("No stage to test with: add `stages` to gkm.config.ts, or pass --stage.");
11647
11590
  this.name = "NoStageToTest";
@@ -11909,7 +11852,7 @@ function install(pm, cwd) {
11909
11852
  }
11910
11853
  }
11911
11854
  /** npm did not answer for a package, so there is no version to compare. */
11912
- var RegistryUnavailable = class extends Error {
11855
+ var RegistryUnavailable = class extends require_errors.GkmError {
11913
11856
  packageName;
11914
11857
  status;
11915
11858
  constructor(packageName, status) {
@@ -11920,7 +11863,7 @@ var RegistryUnavailable = class extends Error {
11920
11863
  }
11921
11864
  };
11922
11865
  /** A dist-tag npm does not have, e.g. `--tag beta` before any beta. */
11923
- var NoReleaseOnTag = class extends Error {
11866
+ var NoReleaseOnTag = class extends require_errors.GkmError {
11924
11867
  tag;
11925
11868
  tags;
11926
11869
  constructor(tag, tags) {
@@ -11931,7 +11874,7 @@ var NoReleaseOnTag = class extends Error {
11931
11874
  }
11932
11875
  };
11933
11876
  /** The line asked for is behind what is installed; upgrade never goes back. */
11934
- var WouldDowngrade = class extends Error {
11877
+ var WouldDowngrade = class extends require_errors.GkmError {
11935
11878
  installed;
11936
11879
  tag;
11937
11880
  target;
@@ -11956,7 +11899,7 @@ var InstallFailed = class extends Error {
11956
11899
  //#region src/index.ts
11957
11900
  const program = new commander.Command();
11958
11901
  program.name("gkm").description("GeekMidas backend framework CLI").version(version).option("--cwd <path>", "Change working directory").option("--debug", "Enable debug mode (verbose errors with stack traces)").hook("preAction", () => {
11959
- if (program.opts().debug);
11902
+ if (program.opts().debug) enableDebug();
11960
11903
  });
11961
11904
  program.command("init").description("Scaffold a new project").argument("[name]", "Project name").option("--template <template>", "Project template (minimal, api, serverless, worker)").option("--skip-install", "Skip dependency installation", false).option("-y, --yes", "Skip prompts, use defaults", false).option("--monorepo", "Setup as monorepo with packages/models", false).option("--api-path <path>", "API app path in monorepo (default: apps/api)").option("--pm <manager>", "Package manager (pnpm, npm, yarn, bun)").option("--deploy <target>", "Where it deploys (dokploy, compose, sst, none)").option("--region <region>", "AWS region for an SST deploy (e.g. eu-west-1)").option("--registry <registry>", "Container registry for a compose deploy (e.g. ghcr.io/acme)").option("--stages <names>", "Deployed stages, comma-separated (e.g. staging,prod)").option("--protected-stage <name>", "Which deployed stage is production").option("--local-stage <name>", "What gkm dev runs as (e.g. dev)").action(async (name, options) => {
11962
11905
  try {
@@ -11964,8 +11907,7 @@ program.command("init").description("Scaffold a new project").argument("[name]",
11964
11907
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
11965
11908
  await initCommand(name, options);
11966
11909
  } catch (error) {
11967
- console.error(formatError(error));
11968
- process.exit(1);
11910
+ exitWithError(error);
11969
11911
  }
11970
11912
  });
11971
11913
  program.command("trust").description("Trust the local edge's certificate authority, so a browser accepts https").option("--dry-run", "Print the commands instead of running them").action(async (options) => {
@@ -11974,8 +11916,7 @@ program.command("trust").description("Trust the local edge's certificate authori
11974
11916
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
11975
11917
  await trustCommand(options);
11976
11918
  } catch (error) {
11977
- console.error(formatError(error));
11978
- process.exit(1);
11919
+ exitWithError(error);
11979
11920
  }
11980
11921
  });
11981
11922
  program.command("setup").description("Reconcile declared constructs — locally, containers and secrets; on a deployed stage, its providers (deploy.objects)").option("--stage <stage>", "Stage name (default: stages.local)").option("--force", "Regenerate secrets even if they exist").option("--skip-docker", "Skip starting Docker services").option("-y, --yes", "Skip prompts").option("--dry-run", "A deployed stage: print what its providers would create or change, and write nothing").option("--profile <profile>", "AWS profile for the stage's account").option("--rotate-keys", "A deployed stage: issue each provisioned key a successor (the old one is deleted after the next deploy)").option("--retire-old-keys", "A deployed stage: delete a rotated-out key now instead of after the next deploy").action(async (options) => {
@@ -11984,8 +11925,7 @@ program.command("setup").description("Reconcile declared constructs — locally,
11984
11925
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
11985
11926
  await setupCommand(options);
11986
11927
  } catch (error) {
11987
- console.error(formatError(error));
11988
- process.exit(1);
11928
+ exitWithError(error);
11989
11929
  }
11990
11930
  });
11991
11931
  program.command("build").description("Build handlers and the manifest from declared constructs").option("--provider <provider>", "Build for aws or server (default: where gkm.config.ts deploys)").option("--enable-openapi", "Enable OpenAPI documentation generation for server builds").option("--production", "Build for production (no dev tools, bundled output)").option("--skip-bundle", "Skip bundling step in production build").option("--stage <stage>", "Inject encrypted secrets for deployment stage").option("--mark-optional", "Suffix optional env vars with ? in manifest envVars field (e.g. PORT?)").addOption(new commander.Option("--cache <backend>", "Register the drivers for this cache backend rather than the target default").hideHelp()).action(async (options) => {
@@ -12004,8 +11944,7 @@ program.command("build").description("Build handlers and the manifest from decla
12004
11944
  markOptional: options.markOptional || false
12005
11945
  });
12006
11946
  } catch (error) {
12007
- console.error(formatError(error));
12008
- process.exit(1);
11947
+ exitWithError(error);
12009
11948
  }
12010
11949
  });
12011
11950
  program.command("dev").description("Reconcile constructs and start the dev server with automatic reload").option("-p, --port <port>", "Port to run the development server on").option("--entry <file>", "Entry file to run (bypasses gkm config)").option("--watch", "Watch for file changes (default: true with --entry)").option("--no-watch", "Disable file watching").option("--enable-openapi", "Enable OpenAPI documentation for development server", true).option("--migrate", "Apply pending migrations before the apps start").option("--seed", "Migrate, then run the seeds, before the apps start").option("--fake", "Call each external API’s fake (test/fakes/<id>.ts) instead of the provider").option("--no-subscribers", "Run no topic subscribers: nothing is subscribed, polled or pushed to").action(async (options) => {
@@ -12024,8 +11963,7 @@ program.command("dev").description("Reconcile constructs and start the dev serve
12024
11963
  subscribers: options.subscribers
12025
11964
  });
12026
11965
  } catch (error) {
12027
- console.error(formatError(error));
12028
- process.exit(1);
11966
+ exitWithError(error);
12029
11967
  }
12030
11968
  });
12031
11969
  program.command("dev:credentials").description("Print each local service's address and login — Postgres, MinIO, Mailpit, Redis, … — without starting anything").option("--json", "Print them as JSON, for a script").action(async (options) => {
@@ -12035,8 +11973,7 @@ program.command("dev:credentials").description("Print each local service's addre
12035
11973
  const { devCredentialsCommand } = await Promise.resolve().then(() => credentials_exports);
12036
11974
  await devCredentialsCommand(options);
12037
11975
  } catch (error) {
12038
- console.error(formatError(error));
12039
- process.exit(1);
11976
+ exitWithError(error);
12040
11977
  }
12041
11978
  });
12042
11979
  program.command("exec").description("Run a command with secrets injected into Credentials").argument("<command...>", "Command to run (use -- before command)").action(async (commandArgs) => {
@@ -12045,8 +11982,7 @@ program.command("exec").description("Run a command with secrets injected into Cr
12045
11982
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12046
11983
  await execCommand(commandArgs);
12047
11984
  } catch (error) {
12048
- console.error(formatError(error));
12049
- process.exit(1);
11985
+ exitWithError(error);
12050
11986
  }
12051
11987
  });
12052
11988
  program.command("test").description("Run tests with secrets loaded from environment").option("--stage <stage>", "Stage to load secrets from (default: stages.local)").option("--run", "Run tests once without watch mode").option("--watch", "Enable watch mode").option("--coverage", "Generate coverage report").option("--ui", "Open Vitest UI").option("--auto-setup", "Generate a fresh stage (secrets + key) from the workspace config when none exists (for CI; also via GKM_AUTO_SETUP)").option("--prepare", "Write the test manifest and #test harness, then stop — for a typecheck that runs before the suite").option("--setup", "Reconcile, migrate and seed the test stage and write the harness, then stop — what @geekmidas/cli/vitest runs").option("--teardown", "Drop the test stage's databases the last setup created, then stop — what @geekmidas/cli/vitest runs when the suite ends").argument("[pattern]", "Pattern to filter tests").action(async (pattern, options) => {
@@ -12058,50 +11994,46 @@ program.command("test").description("Run tests with secrets loaded from environm
12058
11994
  pattern
12059
11995
  });
12060
11996
  } catch (error) {
12061
- console.error(formatError(error));
12062
- process.exit(1);
11997
+ exitWithError(error);
12063
11998
  }
12064
11999
  });
12065
12000
  program.command("migrate").description("Apply each database construct's migrations from db/<construct>/migrations/, as its owner").argument("[construct]", "Only this construct, by name").option("--stage <stage>", "The local stage (default) or test — a deploy migrates its own stage").action(async (construct, options) => {
12066
12001
  try {
12067
12002
  const globalOptions = program.opts();
12068
12003
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12069
- const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-q2YYLJLE.cjs"));
12004
+ const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-C8wTpakT.cjs"));
12070
12005
  await migrateCommand({
12071
12006
  ...options,
12072
12007
  ...construct ? { construct } : {}
12073
12008
  });
12074
12009
  } catch (error) {
12075
- console.error(formatError(error));
12076
- process.exit(1);
12010
+ exitWithError(error);
12077
12011
  }
12078
12012
  });
12079
12013
  program.command("seed").description("Migrate, then run each database construct's seeds from db/<construct>/seeds/, as its owner").argument("[construct]", "Only this construct, by name").option("--stage <stage>", "The local stage (default) or test — a deploy seeds its own stage").action(async (construct, options) => {
12080
12014
  try {
12081
12015
  const globalOptions = program.opts();
12082
12016
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12083
- const { seedCommand } = await Promise.resolve().then(() => require("./migrate-q2YYLJLE.cjs"));
12017
+ const { seedCommand } = await Promise.resolve().then(() => require("./migrate-C8wTpakT.cjs"));
12084
12018
  await seedCommand({
12085
12019
  ...options,
12086
12020
  ...construct ? { construct } : {}
12087
12021
  });
12088
12022
  } catch (error) {
12089
- console.error(formatError(error));
12090
- process.exit(1);
12023
+ exitWithError(error);
12091
12024
  }
12092
12025
  });
12093
12026
  program.command("migration").description("Write a construct's next migration: an empty one for a database, the schema change for an auth server").argument("<construct>", "The construct, by name").argument("[name]", "What the migration is called").action(async (construct, name) => {
12094
12027
  try {
12095
12028
  const globalOptions = program.opts();
12096
12029
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12097
- const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-q2YYLJLE.cjs"));
12030
+ const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-C8wTpakT.cjs"));
12098
12031
  await migrationCommand({
12099
12032
  construct,
12100
12033
  ...name ? { name } : {}
12101
12034
  });
12102
12035
  } catch (error) {
12103
- console.error(formatError(error));
12104
- process.exit(1);
12036
+ exitWithError(error);
12105
12037
  }
12106
12038
  });
12107
12039
  program.command("cron").description("Manage cron jobs").action(() => {
@@ -12129,8 +12061,7 @@ program.command("openapi").description("Generate OpenAPI specification from endp
12129
12061
  ...telemetry !== void 0 ? { telemetry } : {}
12130
12062
  });
12131
12063
  } catch (error) {
12132
- console.error(formatError(error));
12133
- process.exit(1);
12064
+ exitWithError(error);
12134
12065
  }
12135
12066
  });
12136
12067
  program.command("docker").description("Generate Docker deployment files").option("--build", "Build Docker image after generating files").option("--push", "Push image to registry after building").option("--tag <tag>", "Image tag", "latest").option("--registry <registry>", "Container registry URL").action(async (options) => {
@@ -12139,8 +12070,7 @@ program.command("docker").description("Generate Docker deployment files").option
12139
12070
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12140
12071
  await require_seeds.dockerCommand(options);
12141
12072
  } catch (error) {
12142
- console.error(formatError(error));
12143
- process.exit(1);
12073
+ exitWithError(error);
12144
12074
  }
12145
12075
  });
12146
12076
  program.command("compose").description("Run the workspace's APIs and sites for a stage as one Docker Compose stack behind Caddy").requiredOption("--stage <stage>", "Stage to run — always named, so a stack is never a deployed stage by accident").option("--tag <tag>", "Run the images CI pushed at this tag (sites: <tag>-<stage>); nothing is built").option("--build", "Build images from this checkout, tagged with the commit").option("--pull", "Pull images (at --tag, or latest) rather than build them").option("--push", "With --build: push every image to deploy.registry and start nothing (for CI)").option("--digests-file <path>", "With --push: write each image as <ref>@sha256:… (JSON). With --tag: run the images at those digests").option("--dry-run", "Write the files and print the plan; start nothing").option("--down", "Stop the stage's stack (its volumes are kept)").option("--allow-dev-services", "Deployed stage: run the dev service (MinIO, Mailpit) for every bucket and mail the stage doesn't account for. Not production-grade").option("--skip-dns-check", "Deployed stage: do not check that each public host resolves to GKM_SERVER_IPV4 in the stage secrets before starting (a CDN or proxy in front)").action(async (options) => {
@@ -12149,8 +12079,7 @@ program.command("compose").description("Run the workspace's APIs and sites for a
12149
12079
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12150
12080
  await composeCommand(options);
12151
12081
  } catch (error) {
12152
- console.error(formatError(error));
12153
- process.exit(1);
12082
+ exitWithError(error);
12154
12083
  }
12155
12084
  });
12156
12085
  program.command("prepack").description("Generate Docker files for production deployment").option("--build", "Build Docker image after generating files").option("--push", "Push image to registry after building").option("--tag <tag>", "Image tag", "latest").option("--registry <registry>", "Container registry URL").action(async (options) => {
@@ -12164,8 +12093,7 @@ program.command("prepack").description("Generate Docker files for production dep
12164
12093
  registry: options.registry
12165
12094
  });
12166
12095
  } catch (error) {
12167
- console.error(formatError(error));
12168
- process.exit(1);
12096
+ exitWithError(error);
12169
12097
  }
12170
12098
  });
12171
12099
  program.command("secrets:init").description("Initialize secrets for a deployment stage").requiredOption("--stage <stage>", "Stage name (e.g., production, staging)").option("--force", "Overwrite existing secrets").action(async (options) => {
@@ -12174,8 +12102,7 @@ program.command("secrets:init").description("Initialize secrets for a deployment
12174
12102
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12175
12103
  await secretsInitCommand(options);
12176
12104
  } catch (error) {
12177
- console.error(formatError(error));
12178
- process.exit(1);
12105
+ exitWithError(error);
12179
12106
  }
12180
12107
  });
12181
12108
  program.command("secrets:set").description("Set a custom secret for a stage").argument("<key>", "Secret key (e.g., API_KEY)").argument("[value]", "Secret value (reads from stdin if omitted)").requiredOption("--stage <stage>", "Stage name").action(async (key, value, options) => {
@@ -12184,8 +12111,7 @@ program.command("secrets:set").description("Set a custom secret for a stage").ar
12184
12111
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12185
12112
  await secretsSetCommand(key, value, options);
12186
12113
  } catch (error) {
12187
- console.error(formatError(error));
12188
- process.exit(1);
12114
+ exitWithError(error);
12189
12115
  }
12190
12116
  });
12191
12117
  program.command("secrets:unset").description("Remove a custom secret from a stage").argument("<key>", "Secret key (e.g., API_KEY)").requiredOption("--stage <stage>", "Stage name").action(async (key, options) => {
@@ -12194,41 +12120,37 @@ program.command("secrets:unset").description("Remove a custom secret from a stag
12194
12120
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12195
12121
  await secretsUnsetCommand(key, options);
12196
12122
  } catch (error) {
12197
- console.error(formatError(error));
12198
- process.exit(1);
12123
+ exitWithError(error);
12199
12124
  }
12200
12125
  });
12201
12126
  program.command("secrets:add").description("Build the keys a stage must be given — buckets, mail, file servers, third parties' credentials — across every app").requiredOption("--stage <stage>", "Stage name").option("--missing", "Only the keys the stage has not set").option("--json", "Print the keys as JSON and ask nothing").action(async (options) => {
12202
12127
  try {
12203
12128
  const globalOptions = program.opts();
12204
12129
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12205
- const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-DmmBDV2e.cjs"));
12130
+ const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-VcyJnsPX.cjs"));
12206
12131
  await secretsAddCommand(options);
12207
12132
  } catch (error) {
12208
- console.error(formatError(error));
12209
- process.exit(1);
12133
+ exitWithError(error);
12210
12134
  }
12211
12135
  });
12212
12136
  program.command("encryption:rotate").description("Add a new current key to an Encryption construct's keyring on a server stage").argument("<construct>", "The Encryption construct (e.g. Pii)").requiredOption("--stage <stage>", "A deployed stage").action(async (construct, options) => {
12213
12137
  try {
12214
12138
  const globalOptions = program.opts();
12215
12139
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12216
- const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-CjYdUb2s.cjs"));
12140
+ const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-D7zmwzWz.cjs"));
12217
12141
  await encryptionRotateCommand(construct, options);
12218
12142
  } catch (error) {
12219
- console.error(formatError(error));
12220
- process.exit(1);
12143
+ exitWithError(error);
12221
12144
  }
12222
12145
  });
12223
12146
  program.command("encryption:retire").description("Remove an old key from an Encryption construct's keyring, once nothing is under it").argument("<construct>", "The Encryption construct (e.g. Pii)").argument("<key>", "The key to retire (e.g. k1)").requiredOption("--stage <stage>", "A deployed stage").action(async (construct, key, options) => {
12224
12147
  try {
12225
12148
  const globalOptions = program.opts();
12226
12149
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12227
- const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-CjYdUb2s.cjs"));
12150
+ const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-D7zmwzWz.cjs"));
12228
12151
  await encryptionRetireCommand(construct, key, options);
12229
12152
  } catch (error) {
12230
- console.error(formatError(error));
12231
- process.exit(1);
12153
+ exitWithError(error);
12232
12154
  }
12233
12155
  });
12234
12156
  program.command("secrets:show").description("Show secrets for a stage").requiredOption("--stage <stage>", "Stage name").option("--reveal", "Show actual secret values (not masked)").action(async (options) => {
@@ -12237,8 +12159,7 @@ program.command("secrets:show").description("Show secrets for a stage").required
12237
12159
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12238
12160
  await secretsShowCommand(options);
12239
12161
  } catch (error) {
12240
- console.error(formatError(error));
12241
- process.exit(1);
12162
+ exitWithError(error);
12242
12163
  }
12243
12164
  });
12244
12165
  program.command("secrets:rotate").description("Rotate service passwords").requiredOption("--stage <stage>", "Stage name").option("--service <service>", "Specific service to rotate (postgres, redis, minio, …)").action(async (options) => {
@@ -12247,8 +12168,7 @@ program.command("secrets:rotate").description("Rotate service passwords").requir
12247
12168
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12248
12169
  await secretsRotateCommand(options);
12249
12170
  } catch (error) {
12250
- console.error(formatError(error));
12251
- process.exit(1);
12171
+ exitWithError(error);
12252
12172
  }
12253
12173
  });
12254
12174
  program.command("secrets:import").description("Import secrets from a JSON file").argument("<file>", "JSON file path (e.g., secrets.json)").requiredOption("--stage <stage>", "Stage name").option("--no-merge", "Replace all custom secrets instead of merging").action(async (file, options) => {
@@ -12257,8 +12177,7 @@ program.command("secrets:import").description("Import secrets from a JSON file")
12257
12177
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12258
12178
  await secretsImportCommand(file, options);
12259
12179
  } catch (error) {
12260
- console.error(formatError(error));
12261
- process.exit(1);
12180
+ exitWithError(error);
12262
12181
  }
12263
12182
  });
12264
12183
  program.command("secrets:reconcile").description("Backfill missing custom secrets from workspace config").option("--stage <stage>", "Stage name (default: stages.local)").action(async (options) => {
@@ -12267,7 +12186,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12267
12186
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12268
12187
  const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
12269
12188
  const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
12270
- const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-CkIPFGNO.cjs")).then((n) => n.store_exports);
12189
+ const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-c-ByX9je.cjs")).then((n) => n.store_exports);
12271
12190
  const { workspace } = await loadWorkspaceConfig();
12272
12191
  const stage = options.stage ?? workspace.stages.local;
12273
12192
  const store = await secretsStoreFor(workspace, stage);
@@ -12276,7 +12195,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12276
12195
  console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
12277
12196
  process.exit(1);
12278
12197
  }
12279
- const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-CkIPFGNO.cjs")).then((n) => n.workspace_exports);
12198
+ const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-c-ByX9je.cjs")).then((n) => n.workspace_exports);
12280
12199
  const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
12281
12200
  if (!result) {
12282
12201
  console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
@@ -12286,23 +12205,21 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12286
12205
  console.log(`\n✓ Reconciled ${result.addedKeys.length} missing secret(s) for stage "${stage}":`);
12287
12206
  for (const key of result.addedKeys) console.log(` + ${key}`);
12288
12207
  } catch (error) {
12289
- console.error(formatError(error));
12290
- process.exit(1);
12208
+ exitWithError(error);
12291
12209
  }
12292
12210
  });
12293
12211
  program.command("secrets:migrate").description("Copy a deployed stage's secrets from the configured store to another (file, ssm, secrets-manager)").requiredOption("--stage <stage>", "A deployed stage").requiredOption("--to <provider>", "file, ssm or secrets-manager").option("--region <region>", "The target's AWS region (default: the configured store's)").option("--profile <profile>", "AWS profile for the stage's account").option("--force", "Replace a stage the target already holds").action(async (options) => {
12294
12212
  try {
12295
12213
  const globalOptions = program.opts();
12296
12214
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12297
- const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-CGaancHY.cjs"));
12215
+ const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-DFjbGnSr.cjs"));
12298
12216
  await secretsMigrateCommand(options);
12299
12217
  } catch (error) {
12300
- console.error(formatError(error));
12301
- process.exit(1);
12218
+ exitWithError(error);
12302
12219
  }
12303
12220
  });
12304
12221
  program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, compose, sst, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Image tag (default: stage-timestamp; compose: the commit). Compose pulls a given tag").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").option("--atomic", "If the release fails, roll back every app it released, not only the failed ones").option("--allow-dev-services", "Server targets: run the dev service (MinIO, Mailpit) for every bucket and mail the stage doesn't account for. Not production-grade").option("--skip-dns-check", "Compose: do not check that each public host resolves to GKM_SERVER_IPV4 in the stage secrets before starting (a CDN or proxy in front)").action(async (options) => {
12305
- const { deployCli } = await Promise.resolve().then(() => require("./cli-BE9mqeX8.cjs"));
12222
+ const { deployCli } = await Promise.resolve().then(() => require("./cli-DL19w4OE.cjs"));
12306
12223
  const globalOptions = program.opts();
12307
12224
  const code = await deployCli({
12308
12225
  cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
@@ -12320,8 +12237,8 @@ program.command("deploy").description("Deploy a stage through its target").optio
12320
12237
  });
12321
12238
  program.command("deploy:rollback").description("Put a stage's app back on its previous release (Dokploy): one app with --app, every app with --atomic").requiredOption("--stage <stage>", "A deployed stage").option("--app <app>", "The app to roll back").option("--atomic", "Roll back every app that has an earlier release").action(async (options) => {
12322
12239
  try {
12323
- const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-UIjS25F1.cjs")).then((n) => n.rollback_exports);
12324
- const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-DuapRxh6.cjs"));
12240
+ const { rollbackStage } = await Promise.resolve().then(() => require("./rollback--ympG9ss.cjs")).then((n) => n.rollback_exports);
12241
+ const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-8XngdSTo.cjs"));
12325
12242
  const globalOptions = program.opts();
12326
12243
  await rollbackStage({
12327
12244
  cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
@@ -12332,8 +12249,7 @@ program.command("deploy:rollback").description("Put a stage's app back on its pr
12332
12249
  log: (line) => console.log(line)
12333
12250
  });
12334
12251
  } catch (error) {
12335
- console.error(formatError(error));
12336
- process.exit(1);
12252
+ exitWithError(error);
12337
12253
  }
12338
12254
  });
12339
12255
  program.command("deploy:init").description("Initialize Dokploy deployment (create project and application)").option("--endpoint <url>", "Dokploy server URL (uses stored credentials if logged in)").requiredOption("--project <name>", "Project name (creates if not exists)").requiredOption("--app <name>", "Application name").option("--project-id <id>", "Use existing project ID instead of creating").option("--registry-id <id>", "Configure registry for the application").action(async (options) => {
@@ -12348,30 +12264,27 @@ program.command("deploy:init").description("Initialize Dokploy deployment (creat
12348
12264
  registryId: options.registryId
12349
12265
  });
12350
12266
  } catch (error) {
12351
- console.error(formatError(error));
12352
- process.exit(1);
12267
+ exitWithError(error);
12353
12268
  }
12354
12269
  });
12355
12270
  program.command("deploy:github").description("Let GitHub Actions deploy a stage: OIDC role in the stage's AWS account, and the GitHub environment the deploy workflow uses").requiredOption("--stage <stage>", "A deployed stage from gkm.config.ts").option("--profile <profile>", "AWS profile for the stage's account").option("--repo <owner/name>", "GitHub repository (default: this one)").option("--policy-arn <arn>", "Policy for the deploy role (default: AdministratorAccess)").option("--dry-run", "Show the plan without changing AWS or GitHub").action(async (options) => {
12356
12271
  try {
12357
12272
  const globalOptions = program.opts();
12358
12273
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12359
- const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-B5Bw4HIu.cjs"));
12274
+ const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-zneTMvnO.cjs"));
12360
12275
  await deployGithubCommand(options);
12361
12276
  } catch (error) {
12362
- console.error(formatError(error));
12363
- process.exit(1);
12277
+ exitWithError(error);
12364
12278
  }
12365
12279
  });
12366
12280
  program.command("stages").description("The workspace's stages from gkm.config.ts: local, deployed and protected").option("--json", "Print them as JSON").option("--github-output", "Write the stages, and which this workflow run builds and deploys, to $GITHUB_OUTPUT").option("--event <name>", "The event to plan for (default: $GITHUB_EVENT_NAME)").option("--stage <stage>", "The stage a workflow_dispatch deploys").action(async (options) => {
12367
12281
  try {
12368
12282
  const globalOptions = program.opts();
12369
12283
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12370
- const { stagesCommand } = await Promise.resolve().then(() => require("./stages-CUn6gvXL.cjs"));
12284
+ const { stagesCommand } = await Promise.resolve().then(() => require("./stages-BI8JvPzI.cjs"));
12371
12285
  await stagesCommand(options);
12372
12286
  } catch (error) {
12373
- console.error(formatError(error));
12374
- process.exit(1);
12287
+ exitWithError(error);
12375
12288
  }
12376
12289
  });
12377
12290
  program.command("deploy:list").description("List Dokploy resources (projects, registries)").option("--endpoint <url>", "Dokploy server URL (uses stored credentials if logged in)").option("--projects", "List projects").option("--registries", "List registries").action(async (options) => {
@@ -12397,8 +12310,7 @@ program.command("deploy:list").description("List Dokploy resources (projects, re
12397
12310
  });
12398
12311
  }
12399
12312
  } catch (error) {
12400
- console.error(formatError(error));
12401
- process.exit(1);
12313
+ exitWithError(error);
12402
12314
  }
12403
12315
  });
12404
12316
  program.command("login").description("Authenticate with a deployment or DNS provider").option("--provider <provider>", "Provider to log in to (dokploy, hostinger, godaddy)", "dokploy").option("--service <provider>", "[DEPRECATED] Use --provider instead").option("--token <token>", "API token (will prompt if not provided)").option("--endpoint <url>", "Service endpoint URL").action(async (options) => {
@@ -12420,8 +12332,7 @@ program.command("login").description("Authenticate with a deployment or DNS prov
12420
12332
  endpoint: options.endpoint
12421
12333
  });
12422
12334
  } catch (error) {
12423
- console.error(formatError(error));
12424
- process.exit(1);
12335
+ exitWithError(error);
12425
12336
  }
12426
12337
  });
12427
12338
  program.command("logout").description("Remove stored credentials").option("--provider <provider>", "Whose credentials to remove (dokploy, godaddy, all)", "dokploy").option("--service <provider>", "[DEPRECATED] Use --provider instead").action(async (options) => {
@@ -12430,8 +12341,7 @@ program.command("logout").description("Remove stored credentials").option("--pro
12430
12341
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12431
12342
  await logoutCommand({ provider: options.service ?? options.provider });
12432
12343
  } catch (error) {
12433
- console.error(formatError(error));
12434
- process.exit(1);
12344
+ exitWithError(error);
12435
12345
  }
12436
12346
  });
12437
12347
  program.command("whoami").description("Show current authentication status").action(async () => {
@@ -12440,8 +12350,7 @@ program.command("whoami").description("Show current authentication status").acti
12440
12350
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12441
12351
  await whoamiCommand();
12442
12352
  } catch (error) {
12443
- console.error(formatError(error));
12444
- process.exit(1);
12353
+ exitWithError(error);
12445
12354
  }
12446
12355
  });
12447
12356
  program.command("state:pull").description("Pull deployment state from remote to local").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").action(async (options) => {
@@ -12450,8 +12359,7 @@ program.command("state:pull").description("Pull deployment state from remote to
12450
12359
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12451
12360
  await statePullCommand(options);
12452
12361
  } catch (error) {
12453
- console.error(formatError(error));
12454
- process.exit(1);
12362
+ exitWithError(error);
12455
12363
  }
12456
12364
  });
12457
12365
  program.command("state:push").description("Push deployment state from local to remote").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").action(async (options) => {
@@ -12460,8 +12368,7 @@ program.command("state:push").description("Push deployment state from local to r
12460
12368
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12461
12369
  await statePushCommand(options);
12462
12370
  } catch (error) {
12463
- console.error(formatError(error));
12464
- process.exit(1);
12371
+ exitWithError(error);
12465
12372
  }
12466
12373
  });
12467
12374
  program.command("state:show").description("Show deployment state for a stage").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--json", "Output as JSON").action(async (options) => {
@@ -12470,8 +12377,16 @@ program.command("state:show").description("Show deployment state for a stage").r
12470
12377
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12471
12378
  await stateShowCommand(options);
12472
12379
  } catch (error) {
12473
- console.error(formatError(error));
12474
- process.exit(1);
12380
+ exitWithError(error);
12381
+ }
12382
+ });
12383
+ program.command("state:history").description("Show who wrote a stage's deploy state, newest first, and what each app runs").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--json", "Output as JSON").action(async (options) => {
12384
+ try {
12385
+ const globalOptions = program.opts();
12386
+ if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12387
+ await stateHistoryCommand(options);
12388
+ } catch (error) {
12389
+ exitWithError(error);
12475
12390
  }
12476
12391
  });
12477
12392
  program.command("state:unlock").description("Release a stage deploy lock left behind by a run that crashed").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").action(async (options) => {
@@ -12480,8 +12395,7 @@ program.command("state:unlock").description("Release a stage deploy lock left be
12480
12395
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12481
12396
  await stateUnlockCommand(options);
12482
12397
  } catch (error) {
12483
- console.error(formatError(error));
12484
- process.exit(1);
12398
+ exitWithError(error);
12485
12399
  }
12486
12400
  });
12487
12401
  program.command("state:diff").description("Compare local and remote deployment state").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").action(async (options) => {
@@ -12490,8 +12404,7 @@ program.command("state:diff").description("Compare local and remote deployment s
12490
12404
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12491
12405
  await stateDiffCommand(options);
12492
12406
  } catch (error) {
12493
- console.error(formatError(error));
12494
- process.exit(1);
12407
+ exitWithError(error);
12495
12408
  }
12496
12409
  });
12497
12410
  program.command("upgrade").description("Upgrade @geekmidas/cli (with --all, every @geekmidas package) along the release line the project is on").option("--dry-run", "Show what would be upgraded without making changes").option("--all", "Every @geekmidas package, and the third-party packages their peers require").option("--tag <tag>", "npm dist-tag to follow (default: the line you are on)").action(async (options) => {
@@ -12500,20 +12413,17 @@ program.command("upgrade").description("Upgrade @geekmidas/cli (with --all, ever
12500
12413
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12501
12414
  await upgradeCommand(options);
12502
12415
  } catch (error) {
12503
- console.error(formatError(error));
12504
- process.exit(1);
12416
+ exitWithError(error);
12505
12417
  }
12506
12418
  });
12507
12419
  try {
12508
12420
  require_seeds.assertDevServicesFlag(process.argv.slice(2));
12509
12421
  } catch (error) {
12510
- console.error(formatError(error));
12511
- process.exit(1);
12422
+ exitWithError(error);
12512
12423
  }
12513
12424
  program.parse();
12514
12425
  //#endregion
12515
12426
  exports.canPrompt = canPrompt;
12516
- exports.deploysWithCompose = deploysWithCompose;
12517
12427
  exports.formatError = formatError;
12518
12428
  exports.generateFullstackCustomSecrets = generateFullstackCustomSecrets;
12519
12429
  exports.prompt = prompt;