@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.mjs CHANGED
@@ -1,25 +1,28 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  import { n as __require, t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
3
- import { _ as storeDokployCredentials, d as getDokployRegistryId, f as getDokployToken, g as removeGoDaddyCredentials, h as removeDokployCredentials, i as CommandFailed, l as getCredentialsPath, m as readCredentials, o as DEFAULT_TIMEOUT_MS, t as MissingCredential, u as getDokployCredentials, v as storeGoDaddyToken, y as storeHostingerToken } from "./credentials-CnVqoXMb.mjs";
4
- import { l as withOwningTsconfigJsx, r as discover, u as ConstructGenerator } from "./discover-BPelzeGW.mjs";
3
+ import { n as isGkmError, t as GkmError } from "./errors-D8Gwp5kU.mjs";
4
+ import { _ as storeDokployCredentials, d as getDokployRegistryId, f as getDokployToken, g as removeGoDaddyCredentials, h as removeDokployCredentials, i as CommandFailed, l as getCredentialsPath, m as readCredentials, o as DEFAULT_TIMEOUT_MS, u as getDokployCredentials, v as storeGoDaddyToken, y as storeHostingerToken } from "./credentials-C4KII3PD.mjs";
5
+ import { l as withOwningTsconfigJsx, r as discover, u as ConstructGenerator } from "./discover-qjFapetL.mjs";
5
6
  import { t as appKey } from "./derive-B4vDpzgP.mjs";
6
- import { A as InvalidStages, F as stageProblems, P as deployedProblems, R as stageSampleRate, a as allConstructGlobs, d as getAppGkmConfig, j as TEST_STAGE, u as getAppBuildOrder } from "./workspace-CJ0lKFq-.mjs";
7
+ import { A as InvalidStages, F as stageProblems, P as deployedProblems, R as stageSampleRate, a as allConstructGlobs, d as getAppGkmConfig, j as TEST_STAGE, u as getAppBuildOrder } from "./workspace-Bzw7Zs82.mjs";
7
8
  import { ConfigNotFound, NotABackendApp, NotInAnApp, loadAppConfig, loadConfig, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig } from "./config.mjs";
8
- import { $n as LOCAL_LOGS_EMAIL, $t as isImageBuild, An as prepareEntryCredentials, Cn as createCredentialsPreload, Dn as loadEnvFiles, Dt as LOCAL_CA_PATH, En as isPortAvailable, Fn as FileSecretsStore, Ft as quoteIdentifier, In as getKeyPath, Mn as secretsStoreFor, Nt as postgresDatabaseNames, On as loadPortState, Ot as forgetState, Qn as withCustomSecret, Qt as imageBuildCredentials, Rn as projectKey, Sn as primaryPortKey, Tn as findAvailablePort, U as createStateStore, Vn as deployIdentity, X as assertDevServicesFlag, Yn as maskPassword, Zn as toEmbeddableSecrets, a as provisionStage, at as WorkerGenerator, ct as QueueGenerator, dn as appTelemetry, dt as backendsOf$1, en as cacheBackendFor, ft as constructGlobs, h as dockerCommand, hn as telemetryOf, in as CLUSTER_DATABASE, it as workerUnits, kn as loadSecretsForApp, lt as CronGenerator, mn as surfaceClientTraced, mt as reconcileWorkspace, nn as providerOf, ot as workerBundleName, pn as scopeTelemetryEnv, pt as derivedContainers, sn as TELEMETRY_CONTAINER, st as workerEntryDir, tn as eventsBackendFor, u as provisionCommand, ut as FAKE_ENV, vn as describeServices, wn as createEntryWrapper, xn as portsOf, yn as fakeKey, yt as readLocalCredentials, zt as pgClient } from "./seeds-odfgSCmu.mjs";
9
- import { c as startTelemetryCode, l as telemetryFor, n as runtimeFor, o as mountRequestSpansCode, r as parseTelemetryFlag, s as routeTelemetry, t as EndpointGenerator, u as writeTelemetryModule } from "./EndpointGenerator-CVc6Oi1Y.mjs";
9
+ import { $n as projectKey, An as telemetryOf, Bn as findAvailablePort, Ct as QueueGenerator, Dt as constructGlobs, En as appTelemetry, Et as backendsOf$1, Gn as prepareEntryCredentials, Hn as loadEnvFiles, Ht as LOCAL_CA_PATH, In as portsOf, Jt as postgresDatabaseNames, Ln as primaryPortKey, Nn as describeServices, On as scopeTelemetryEnv, Ot as derivedContainers, Pn as fakeKey, Pt as readLocalCredentials, Rn as createCredentialsPreload, Sn as TELEMETRY_CONTAINER, St as workerEntryDir, Tt as FAKE_ENV, Un as loadPortState, Ut as forgetState, Vn as isPortAvailable, Wn as loadSecretsForApp, Xn as FileSecretsStore, Xt as quoteIdentifier, Zn as getKeyPath, _n as providerOf, a as provisionStage, at as describeActor, bt as WorkerGenerator, dt as assertDevServicesFlag, en as pgClient, et as createStateStore, fr as toEmbeddableSecrets, gn as eventsBackendFor, hn as cacheBackendFor, kn as surfaceClientTraced, kt as reconcileWorkspace, l as provisionStageDns, mn as isImageBuild, mr as LOCAL_LOGS_EMAIL, nr as deployIdentity, p as provisionCommand, pn as imageBuildCredentials, pr as withCustomSecret, qn as secretsStoreFor, rt as dnsResources, s as assertStageServer, ur as maskPassword, v as dockerCommand, wt as CronGenerator, xt as workerBundleName, yn as CLUSTER_DATABASE, yt as workerUnits, zn as createEntryWrapper } from "./seeds-BSL55F6q.mjs";
10
+ import { c as startTelemetryCode, l as telemetryFor, n as runtimeFor, o as mountRequestSpansCode, r as parseTelemetryFlag, s as routeTelemetry, t as EndpointGenerator, u as writeTelemetryModule } from "./EndpointGenerator-Bor2tZCm.mjs";
10
11
  import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
11
- import { s as isCacheBackend, t as SubscriberGenerator } from "./SubscriberGenerator-BPqQf8fB.mjs";
12
+ import { s as isCacheBackend, t as SubscriberGenerator } from "./SubscriberGenerator-CyN2VF5X.mjs";
12
13
  import { a as describeHolder, i as assignAppPorts, o as holderOf, r as appTag, s as withAppPorts, t as APP_TAG_ENV } from "./appPorts-C9z9Pzn9.mjs";
13
- import { n as driversFor, r as eventsBackendsIn, t as cacheBackendsIn } from "./drivers-DTZzxeIl.mjs";
14
+ import { n as driversFor, r as eventsBackendsIn, t as cacheBackendsIn } from "./drivers-CTaWrA_L.mjs";
14
15
  import { n as withCompute, r as withRoutes, t as manifestModule } from "./emit-C1e8qD08.mjs";
15
- import { t as LocalSandbox } from "./local-IuoIF3CT.mjs";
16
- import { f as keyFingerprint, n as sniffAppEnvironment, o as DokployApi } from "./sniffer-BTtX3NUM.mjs";
17
- import { t as deploy$1 } from "./deploy-QNtx_eWR.mjs";
18
- import { _ as planStackDns, a as stackOverrideFile, b as serverAddressHint, d as pinnedRef, f as edgeDir, g as applyStackDns, h as dockerCompose, i as ComposePushNeedsBuild, m as EDGE_PROJECT, o as composeProject, p as removeEdgeRoutes, r as ComposePinNeedsPull, s as stackDir, t as composeTarget, u as parseDigests, v as requiredServerAddress, x as stackHosts, y as serverAddress } from "./compose-Bhmf0n4o.mjs";
19
- import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-BJqRJNK4.mjs";
20
- import { t as LocalStateStore } from "./LocalStateStore-CU-O0SBp.mjs";
16
+ import { t as LocalSandbox } from "./local-Otp74ak0.mjs";
17
+ import { f as keyFingerprint, n as sniffAppEnvironment, o as DokployApi } from "./sniffer-BTtGAtm3.mjs";
18
+ import { t as deploy$1 } from "./deploy-DYIyIUYd.mjs";
19
+ import { a as stackOverrideFile, c as dockerCompose, i as ComposePushNeedsBuild, o as edgeDir, r as ComposePinNeedsPull, s as removeEdgeRoutes, t as composeTarget } from "./compose-DrEB_4F-.mjs";
20
+ import { d as parseDigests, h as EDGE_PROJECT, i as composeProject, p as pinnedRef, s as stackDir } from "./stack-Co4uZkAo.mjs";
21
+ import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-BJFvfkaz.mjs";
22
+ import { t as LocalStateStore } from "./LocalStateStore-D40_SDmJ.mjs";
21
23
  import { a as getExecCommand, c as validateProjectName, i as findWorkspaceRoot, n as detectPackageManager$1, o as getInstallCommand, r as findWorkspacePackages, s as getRunCommand, t as checkDirectoryExists } from "./utils-D_fxUqvU.mjs";
22
- import { a as writeTestHarness, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, t as TEST_READY_ENV } from "./ready-b6vm0-W-.mjs";
24
+ import "./awsStore-BWa1KNY-.mjs";
25
+ import { a as writeTestHarness, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, t as TEST_READY_ENV } from "./ready-naOSJpeJ.mjs";
23
26
  import { createRequire } from "node:module";
24
27
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
25
28
  import { Command, Option } from "commander";
@@ -47,7 +50,7 @@ import crypto from "crypto";
47
50
  import { Function } from "@geekmidas/constructs/functions";
48
51
  import { Topic } from "@geekmidas/constructs/topic";
49
52
  //#region package.json
50
- var version = "10.0.0-alpha.91";
53
+ var version = "10.0.0-alpha.93";
51
54
  //#endregion
52
55
  //#region src/prompt.ts
53
56
  /**
@@ -58,7 +61,7 @@ var version = "10.0.0-alpha.91";
58
61
  * named error instead, and the command decides whether to ask.
59
62
  */
60
63
  /** A prompt was needed with no terminal to ask at. */
61
- var PromptNeedsTerminal = class extends Error {
64
+ var PromptNeedsTerminal = class extends GkmError {
62
65
  question;
63
66
  instead;
64
67
  constructor(question, instead) {
@@ -130,7 +133,7 @@ const logger$8 = console;
130
133
  * Validate Dokploy token by making a test API call
131
134
  */
132
135
  async function validateDokployToken(endpoint, token) {
133
- const { DokployApi } = await import("./sniffer-BTtX3NUM.mjs").then((n) => n.c);
136
+ const { DokployApi } = await import("./sniffer-BTtGAtm3.mjs").then((n) => n.c);
134
137
  return new DokployApi({
135
138
  baseUrl: endpoint,
136
139
  token
@@ -514,7 +517,7 @@ async function isTrusted(url) {
514
517
  }
515
518
  }
516
519
  /** The edge has not run, so there is no authority to trust yet. */
517
- var NoLocalAuthority = class extends Error {
520
+ var NoLocalAuthority = class extends GkmError {
518
521
  path;
519
522
  constructor(path) {
520
523
  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.`);
@@ -523,7 +526,7 @@ var NoLocalAuthority = class extends Error {
523
526
  }
524
527
  };
525
528
  /** A platform with no trust store this knows how to write to. */
526
- var UnsupportedPlatform = class extends Error {
529
+ var UnsupportedPlatform = class extends GkmError {
527
530
  platform;
528
531
  certificate;
529
532
  constructor(platform, certificate) {
@@ -608,7 +611,7 @@ const SIGNED_IN = [
608
611
  "localstack"
609
612
  ];
610
613
  /** Nothing has generated this workspace's local logins yet. */
611
- var NoLocalCredentials = class extends Error {
614
+ var NoLocalCredentials = class extends GkmError {
612
615
  workspace;
613
616
  constructor(workspace) {
614
617
  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.`);
@@ -658,7 +661,7 @@ const DISCOVERY_QUIET_ENV = "GKM_DISCOVERY_QUIET";
658
661
  /** The route everything is served under. */
659
662
  const BASE = "/__gkm";
660
663
  /** `GKM_DISCOVERY_PORT` is set to something that is not a port. */
661
- var InvalidDiscoveryPort = class extends Error {
664
+ var InvalidDiscoveryPort = class extends GkmError {
662
665
  value;
663
666
  constructor(value) {
664
667
  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.`);
@@ -1748,7 +1751,7 @@ function closeFakes(served) {
1748
1751
  //#region src/exec/index.ts
1749
1752
  const logger$6 = console;
1750
1753
  /** `gkm exec` was given nothing to run. */
1751
- var NoCommandSpecified = class extends Error {
1754
+ var NoCommandSpecified = class extends GkmError {
1752
1755
  constructor() {
1753
1756
  super("No command specified. Usage: gkm exec -- <command>");
1754
1757
  this.name = "NoCommandSpecified";
@@ -2324,9 +2327,9 @@ async function workspaceDevCommand(configured, options) {
2324
2327
  for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
2325
2328
  logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
2326
2329
  if (options.migrate || options.seed) {
2327
- const { prepareDevDatabases } = await import("./migrate-DbtcuOr_.mjs");
2330
+ const { prepareDevDatabases } = await import("./migrate-CsBZKALY.mjs");
2328
2331
  await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
2329
- } else await import("./migrate-DbtcuOr_.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2332
+ } else await import("./migrate-CsBZKALY.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2330
2333
  logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
2331
2334
  });
2332
2335
  const appUrls = {};
@@ -2736,7 +2739,7 @@ function tsxCommand(appRoot, args) {
2736
2739
  }
2737
2740
  }
2738
2741
  /** A port this app must serve on is held by something else. */
2739
- var DevPortInUse = class extends Error {
2742
+ var DevPortInUse = class extends GkmError {
2740
2743
  port;
2741
2744
  holder;
2742
2745
  constructor(port, holder) {
@@ -2753,7 +2756,7 @@ var DevPortInUse = class extends Error {
2753
2756
  * Only these are refused: a port another project holds is moved off instead
2754
2757
  * (see `assignAppPorts`), but moving off our own would start a second copy.
2755
2758
  */
2756
- var WorkspacePortsInUse = class extends Error {
2759
+ var WorkspacePortsInUse = class extends GkmError {
2757
2760
  held;
2758
2761
  constructor(held) {
2759
2762
  super(`This workspace's apps are already running:\n${held.map(({ app, port, holder }) => ` ${app}: ${port} — ${describeHolder(holder)}`).join("\n")}\nA previous \`gkm dev\` left them behind. Stop them (kill the pids above) and start again. Nothing was started.`);
@@ -3210,7 +3213,7 @@ const SUPERSEDED_OUTPUT = [
3210
3213
  function isMainProvider(value) {
3211
3214
  return value === "aws" || value === "server";
3212
3215
  }
3213
- var UnknownBuildProvider = class extends Error {
3216
+ var UnknownBuildProvider = class extends GkmError {
3214
3217
  provider;
3215
3218
  constructor(provider) {
3216
3219
  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.`);
@@ -3219,7 +3222,7 @@ var UnknownBuildProvider = class extends Error {
3219
3222
  }
3220
3223
  };
3221
3224
  /** `--cache` named something that is not a cache backend. */
3222
- var UnknownCacheBackend = class extends Error {
3225
+ var UnknownCacheBackend = class extends GkmError {
3223
3226
  backend;
3224
3227
  constructor(backend) {
3225
3228
  super(`'${backend}' is not a cache backend. Pass --cache upstash, elasticache, db or redis, or leave it out to register the deploy target's.`);
@@ -3379,7 +3382,7 @@ async function buildApp(input) {
3379
3382
  ...production,
3380
3383
  ...telemetry ? { telemetry } : {}
3381
3384
  });
3382
- const { bundleServer } = await import("./bundler-D6eBfVkl.mjs");
3385
+ const { bundleServer } = await import("./bundler-BWrh-AJH.mjs");
3383
3386
  await bundleServer({
3384
3387
  entryPoint,
3385
3388
  outputDir: join(outputDir, "dist"),
@@ -3524,7 +3527,7 @@ async function buildWorkers(input) {
3524
3527
  });
3525
3528
  logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
3526
3529
  if (!input.bundle) continue;
3527
- const { bundleServer } = await import("./bundler-D6eBfVkl.mjs");
3530
+ const { bundleServer } = await import("./bundler-BWrh-AJH.mjs");
3528
3531
  const outfile = workerBundleName(worker.id);
3529
3532
  await bundleServer({
3530
3533
  entryPoint,
@@ -3610,7 +3613,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
3610
3613
  let masterKey;
3611
3614
  if (context.production?.bundle && !skipBundle) {
3612
3615
  logger$4.log(`\n📦 Bundling production server...`);
3613
- const { bundleServer } = await import("./bundler-D6eBfVkl.mjs");
3616
+ const { bundleServer } = await import("./bundler-BWrh-AJH.mjs");
3614
3617
  const allConstructs = [
3615
3618
  ...endpoints.map((e) => e.construct),
3616
3619
  ...functions.map((f) => f.construct),
@@ -3848,7 +3851,7 @@ function formatRoutes(routes) {
3848
3851
  * `deploy()` as any other target, so there is one way a stack comes up.
3849
3852
  */
3850
3853
  /** `--build` and `--pull` together ask for two different things. */
3851
- var ComposeModeConflict = class extends Error {
3854
+ var ComposeModeConflict = class extends GkmError {
3852
3855
  constructor() {
3853
3856
  super("--build and --pull ask for opposite things: build images from this checkout, or pull a tag CI pushed. Pass one of them.");
3854
3857
  this.name = "ComposeModeConflict";
@@ -3930,12 +3933,37 @@ async function composeCommand(options, deps = {}) {
3930
3933
  deploy: result
3931
3934
  };
3932
3935
  }
3936
+ //#endregion
3937
+ //#region src/debug.ts
3938
+ let _debug = false;
3939
+ /**
3940
+ * Enable debug mode globally.
3941
+ * When enabled, verbose error details are shown everywhere.
3942
+ */
3943
+ function enableDebug() {
3944
+ _debug = true;
3945
+ }
3946
+ /**
3947
+ * Check if debug mode is active.
3948
+ * Activated by `--debug` flag or `GKM_DEBUG=1` env var.
3949
+ */
3950
+ function isDebug() {
3951
+ return _debug || process.env.GKM_DEBUG === "1";
3952
+ }
3933
3953
  /**
3934
3954
  * Format a fatal error for display.
3935
- * Always includes the full stack trace since these are process-ending errors.
3955
+ *
3956
+ * An error gkm raised on purpose ({@link isGkmError}) is `Name: message` —
3957
+ * its message is the answer, and a stack would only point into gkm. Anything
3958
+ * else is unexpected, and prints its stack and every cause beneath it. Debug
3959
+ * mode prints the stack of both.
3936
3960
  */
3937
3961
  function formatError(error) {
3938
3962
  if (!(error instanceof Error)) return String(error);
3963
+ if (isGkmError(error) && !isDebug()) {
3964
+ const cause = error.cause;
3965
+ return cause === void 0 ? `${error.name}: ${error.message}` : `${error.name}: ${error.message}\n\nCaused by: ${cause instanceof Error ? `${cause.name}: ${cause.message}` : String(cause)}`;
3966
+ }
3939
3967
  let output = error.stack ?? error.message;
3940
3968
  let cause = error.cause;
3941
3969
  while (cause) if (cause instanceof Error) {
@@ -3947,6 +3975,14 @@ function formatError(error) {
3947
3975
  }
3948
3976
  return output;
3949
3977
  }
3978
+ /**
3979
+ * End a command that failed: print the error ({@link formatError}) on stderr
3980
+ * and exit 1. What every command's action does with what it throws.
3981
+ */
3982
+ function exitWithError(error) {
3983
+ console.error(formatError(error));
3984
+ process.exit(1);
3985
+ }
3950
3986
  //#endregion
3951
3987
  //#region src/deploy/init.ts
3952
3988
  const logger$3 = console;
@@ -4098,6 +4134,7 @@ const MASKED = "********";
4098
4134
  */
4099
4135
  function maskStateSecrets(state) {
4100
4136
  const masked = structuredClone(state);
4137
+ if (masked.provider !== "dokploy") return masked;
4101
4138
  for (const credentials of Object.values(masked.appCredentials ?? {})) credentials.dbPassword = MASKED;
4102
4139
  for (const secrets of Object.values(masked.generatedSecrets ?? {})) for (const name of Object.keys(secrets)) secrets[name] = MASKED;
4103
4140
  if (masked.backups) {
@@ -4153,6 +4190,7 @@ async function stateShowCommand(options) {
4153
4190
  if (options.json) console.log(JSON.stringify(state, null, 2));
4154
4191
  else {
4155
4192
  printStateDetails(state);
4193
+ printDnsRecords(stored.resources);
4156
4194
  printUnfinished(stored.resources);
4157
4195
  }
4158
4196
  }
@@ -4197,8 +4235,8 @@ async function stateDiffCommand(options) {
4197
4235
  if (!remote) console.log("Remote: (none)");
4198
4236
  else console.log(`Remote: Last deployed ${remote.lastDeployedAt}`);
4199
4237
  console.log("");
4200
- const localApps = local?.applications ?? {};
4201
- const remoteApps = remote?.applications ?? {};
4238
+ const localApps = dokploy(local)?.applications ?? {};
4239
+ const remoteApps = dokploy(remote)?.applications ?? {};
4202
4240
  const allApps = /* @__PURE__ */ new Set([...Object.keys(localApps), ...Object.keys(remoteApps)]);
4203
4241
  if (allApps.size > 0) {
4204
4242
  console.log("Applications:");
@@ -4211,8 +4249,8 @@ async function stateDiffCommand(options) {
4211
4249
  else console.log(` ${app}: ${localId} (local) != ${remoteId} (remote) [MISMATCH]`);
4212
4250
  }
4213
4251
  }
4214
- const localServices = local?.services ?? {};
4215
- const remoteServices = remote?.services ?? {};
4252
+ const localServices = dokploy(local)?.services ?? {};
4253
+ const remoteServices = dokploy(remote)?.services ?? {};
4216
4254
  if (Object.keys(localServices).length > 0 || Object.keys(remoteServices).length > 0) {
4217
4255
  console.log("\nServices:");
4218
4256
  const serviceKeys = /* @__PURE__ */ new Set([...Object.keys(localServices), ...Object.keys(remoteServices)]);
@@ -4277,6 +4315,10 @@ async function copyStage(from, to, stage) {
4277
4315
  for (const { updatedAt: _stamped, ...record } of Object.values(source.resources)) version = await to.putResource(stage, record, { expectedVersion: version });
4278
4316
  return source;
4279
4317
  }
4318
+ /** `state` if Dokploy wrote it — the only shape with ids of its own. */
4319
+ function dokploy(state) {
4320
+ return state?.provider === "dokploy" ? state : null;
4321
+ }
4280
4322
  function describeRecord(record) {
4281
4323
  if (!record) return "(none)";
4282
4324
  return record.id ? `${record.status} ${record.id}` : record.status;
@@ -4290,6 +4332,12 @@ function printUnfinished(resources) {
4290
4332
  for (const record of pending) console.log(` ${record.key}`);
4291
4333
  }
4292
4334
  function printStateSummary(state) {
4335
+ if (state.provider !== "dokploy") {
4336
+ console.log(` Stage: ${state.stage} (${state.provider})`);
4337
+ console.log(` Apps released: ${Object.keys(state.releases ?? {}).length}`);
4338
+ console.log(` Last deployed: ${state.lastDeployedAt}`);
4339
+ return;
4340
+ }
4293
4341
  const appCount = Object.keys(state.applications).length;
4294
4342
  const hasPostgres = !!state.services.postgresId;
4295
4343
  const hasRedis = !!state.services.redisId;
@@ -4300,6 +4348,14 @@ function printStateSummary(state) {
4300
4348
  console.log(` Last deployed: ${state.lastDeployedAt}`);
4301
4349
  }
4302
4350
  function printStateDetails(state) {
4351
+ if (state.provider !== "dokploy") {
4352
+ console.log(`Stage: ${state.stage} (${state.provider})`);
4353
+ console.log(`Last Deployed: ${state.lastDeployedAt}`);
4354
+ if (state.identity) console.log(`Identity: ${state.identity}`);
4355
+ console.log("");
4356
+ printReleases(state.releases);
4357
+ return;
4358
+ }
4303
4359
  console.log(`Stage: ${state.stage}`);
4304
4360
  console.log(`Environment ID: ${state.environmentId}`);
4305
4361
  console.log(`Last Deployed: ${state.lastDeployedAt}`);
@@ -4341,6 +4397,62 @@ function printStateDetails(state) {
4341
4397
  for (const [hostname, info] of Object.entries(state.dnsVerified)) console.log(` ${hostname}: ${info.serverIp} (${info.verifiedAt})`);
4342
4398
  }
4343
4399
  }
4400
+ /** Each app's current release, and who released it. */
4401
+ function printReleases(releases) {
4402
+ console.log("Releases:");
4403
+ const apps = Object.entries(releases ?? {});
4404
+ if (apps.length === 0) {
4405
+ console.log(" (none)");
4406
+ return;
4407
+ }
4408
+ for (const [app, { current }] of apps) console.log(` ${app}: ${describeRelease(current)}`);
4409
+ }
4410
+ /** `ghcr.io/acme/api:v2 (sha256:…) · 2026-… · ada@laptop` */
4411
+ function describeRelease(release) {
4412
+ return [
4413
+ `${release.ref}${release.digest ? ` (${release.digest})` : ""}`,
4414
+ release.releasedAt,
4415
+ describeActor(release.releasedBy)
4416
+ ].join(" · ");
4417
+ }
4418
+ /** The DNS records gkm wrote for the stage. */
4419
+ function printDnsRecords(resources) {
4420
+ const records = dnsResources(resources);
4421
+ if (records.length === 0) return;
4422
+ console.log("");
4423
+ console.log("DNS Records:");
4424
+ for (const record of records) console.log(` ${record.fqdn} ${record.type} ${record.value} (TTL ${record.ttl}${record.provider ? `, ${record.provider}` : ""})`);
4425
+ }
4426
+ /**
4427
+ * Who wrote a stage's state, newest first, and what each app runs.
4428
+ * `gkm state:history --stage=<stage>`
4429
+ */
4430
+ async function stateHistoryCommand(options) {
4431
+ const { workspace } = await loadWorkspaceConfig();
4432
+ const stored = await (await createStateStore({
4433
+ config: workspace.state,
4434
+ workspaceRoot: workspace.root,
4435
+ workspaceName: workspace.name
4436
+ })).read(options.stage);
4437
+ if (!stored) {
4438
+ console.log(`No state found for stage: ${options.stage}`);
4439
+ return;
4440
+ }
4441
+ const history = {
4442
+ stage: options.stage,
4443
+ history: stored.history,
4444
+ releases: Object.fromEntries(Object.entries(stored.state.releases ?? {}).map(([app, releases]) => [app, releases.current]))
4445
+ };
4446
+ if (options.json) {
4447
+ console.log(JSON.stringify(history, null, 2));
4448
+ return;
4449
+ }
4450
+ console.log(`History of stage ${options.stage} (newest first):`);
4451
+ if (history.history.length === 0) console.log(" (none recorded)");
4452
+ for (const entry of history.history) console.log(` ${entry.serial} · ${entry.at} · ${describeActor(entry.by)} · ${entry.operation}`);
4453
+ console.log("");
4454
+ printReleases(stored.state.releases);
4455
+ }
4344
4456
  //#endregion
4345
4457
  //#region src/secrets/generator.ts
4346
4458
  /**
@@ -5312,25 +5424,25 @@ function loadPackageJson() {
5312
5424
  * Run: pnpm --filter @geekmidas/cli sync-versions
5313
5425
  */
5314
5426
  const GEEKMIDAS_VERSIONS = {
5315
- "@geekmidas/audit": "~10.0.0-alpha.91",
5316
- "@geekmidas/auth": "~10.0.0-alpha.91",
5317
- "@geekmidas/cache": "~10.0.0-alpha.91",
5318
- "@geekmidas/client": "~10.0.0-alpha.91",
5319
- "@geekmidas/cloud": "~10.0.0-alpha.91",
5320
- "@geekmidas/constructs": "~10.0.0-alpha.91",
5321
- "@geekmidas/db": "~10.0.0-alpha.91",
5322
- "@geekmidas/emailkit": "~10.0.0-alpha.91",
5323
- "@geekmidas/envkit": "~10.0.0-alpha.91",
5324
- "@geekmidas/errors": "~10.0.0-alpha.91",
5325
- "@geekmidas/events": "~10.0.0-alpha.91",
5326
- "@geekmidas/logger": "~10.0.0-alpha.91",
5327
- "@geekmidas/manifest": "~10.0.0-alpha.91",
5328
- "@geekmidas/rate-limit": "~10.0.0-alpha.91",
5329
- "@geekmidas/schema": "~10.0.0-alpha.91",
5330
- "@geekmidas/services": "~10.0.0-alpha.91",
5331
- "@geekmidas/storage": "~10.0.0-alpha.91",
5332
- "@geekmidas/telescope": "~10.0.0-alpha.91",
5333
- "@geekmidas/testkit": "~10.0.0-alpha.91",
5427
+ "@geekmidas/audit": "~10.0.0-alpha.93",
5428
+ "@geekmidas/auth": "~10.0.0-alpha.93",
5429
+ "@geekmidas/cache": "~10.0.0-alpha.93",
5430
+ "@geekmidas/client": "~10.0.0-alpha.93",
5431
+ "@geekmidas/cloud": "~10.0.0-alpha.93",
5432
+ "@geekmidas/constructs": "~10.0.0-alpha.93",
5433
+ "@geekmidas/db": "~10.0.0-alpha.93",
5434
+ "@geekmidas/emailkit": "~10.0.0-alpha.93",
5435
+ "@geekmidas/envkit": "~10.0.0-alpha.93",
5436
+ "@geekmidas/errors": "~10.0.0-alpha.93",
5437
+ "@geekmidas/events": "~10.0.0-alpha.93",
5438
+ "@geekmidas/logger": "~10.0.0-alpha.93",
5439
+ "@geekmidas/manifest": "~10.0.0-alpha.93",
5440
+ "@geekmidas/rate-limit": "~10.0.0-alpha.93",
5441
+ "@geekmidas/schema": "~10.0.0-alpha.93",
5442
+ "@geekmidas/services": "~10.0.0-alpha.93",
5443
+ "@geekmidas/storage": "~10.0.0-alpha.93",
5444
+ "@geekmidas/telescope": "~10.0.0-alpha.93",
5445
+ "@geekmidas/testkit": "~10.0.0-alpha.93",
5334
5446
  "@geekmidas/cli": `~${loadPackageJson().version}`
5335
5447
  };
5336
5448
  //#endregion
@@ -5731,7 +5843,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
5731
5843
  * The `uses:` value for the stages action, with a comment saying which CLI
5732
5844
  * release the pinned commit is.
5733
5845
  */
5734
- function stagesActionUses(commit = "b0922ee71407fefc3e94a0352793ef5e78c1bdea", version = cliVersion()) {
5846
+ function stagesActionUses(commit = "a619ff213e362417b184dff08c8175a86f5d9d07", version = cliVersion()) {
5735
5847
  return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
5736
5848
  }
5737
5849
  //#endregion
@@ -7242,7 +7354,7 @@ ${inputs.join("\n")}
7242
7354
  * An SST scaffold asked for without a region. `init` always resolves one —
7243
7355
  * asked, `--region`, or eu-west-1 under `--yes` — so this is a caller's bug.
7244
7356
  */
7245
- var SstNeedsRegion = class extends Error {
7357
+ var SstNeedsRegion = class extends GkmError {
7246
7358
  constructor() {
7247
7359
  super("An SST deploy needs a region: pass --region, e.g. eu-west-1.");
7248
7360
  this.name = "SstNeedsRegion";
@@ -10682,7 +10794,7 @@ function resolveStages(options, answers) {
10682
10794
  return stages;
10683
10795
  }
10684
10796
  /** `--deploy` naming a target init has no scaffold for. */
10685
- var UnknownDeployTarget = class extends Error {
10797
+ var UnknownDeployTarget = class extends GkmError {
10686
10798
  target;
10687
10799
  known;
10688
10800
  constructor(target, known) {
@@ -10701,7 +10813,7 @@ function defaultRegistry(name) {
10701
10813
  return `ghcr.io/${(name ?? "my-org").toLowerCase()}`;
10702
10814
  }
10703
10815
  /** `--region` that is not shaped like one, e.g. `europe` for `eu-west-1`. */
10704
- var NotAnAwsRegion = class extends Error {
10816
+ var NotAnAwsRegion = class extends GkmError {
10705
10817
  region;
10706
10818
  constructor(region) {
10707
10819
  super(`"${region}" is not an AWS region. Use one like eu-west-1.`);
@@ -10831,7 +10943,7 @@ async function secretsSetCommand(key, value, options) {
10831
10943
  logger$2.log(`\n✓ Secret "${key}" set for stage "${stage}" (${store.name})`);
10832
10944
  }
10833
10945
  /** `gkm secrets:unset` for a key the stage does not hold. */
10834
- var SecretNotSet = class extends Error {
10946
+ var SecretNotSet = class extends GkmError {
10835
10947
  key;
10836
10948
  stage;
10837
10949
  constructor(key, stage) {
@@ -10842,7 +10954,7 @@ var SecretNotSet = class extends Error {
10842
10954
  }
10843
10955
  };
10844
10956
  /** `gkm secrets:unset` on a stage that has no secrets at all. */
10845
- var StageSecretsNotFound = class extends Error {
10957
+ var StageSecretsNotFound = class extends GkmError {
10846
10958
  stage;
10847
10959
  constructor(stage) {
10848
10960
  super(`The stage '${stage}' has no secrets, so there is nothing to remove.`);
@@ -11013,138 +11125,8 @@ function maskUrl(url) {
11013
11125
  }
11014
11126
  }
11015
11127
  //#endregion
11016
- //#region src/providers/dns.ts
11017
- /** Whether the workspace deploys through the compose target. */
11018
- function deploysWithCompose(workspace) {
11019
- return workspace.deploy?.default === "compose" || Object.values(workspace.apps).some((app) => app.resolvedDeployTarget === "compose");
11020
- }
11021
- /**
11022
- * A compose stage that serves a domain has its server's address in its
11023
- * secrets — checked before `gkm setup --stage` does anything else.
11024
- *
11025
- * @throws {ServerAddressMissing} for a compose stage with a domain and none
11026
- * @throws {ServerAddressInvalid} for a value that is not an address
11027
- */
11028
- function assertStageServer(workspace, stage, secrets) {
11029
- if (stage === workspace.stages.local) return void 0;
11030
- if (!deploysWithCompose(workspace)) return serverAddress(stage, secrets?.custom);
11031
- return requiredServerAddress(stage, workspace.domains?.[stage], secrets?.custom);
11032
- }
11033
- /**
11034
- * The hosts a compose stage serves: its stack composed as a deploy would —
11035
- * with the secrets it would generate made up in memory, never written — and
11036
- * every route's host read off it.
11037
- */
11038
- async function composeStageHosts(options) {
11039
- const { workspace, stage } = options;
11040
- const runnables = options.runnables ?? {};
11041
- const background = options.background ?? {};
11042
- const manifest = options.manifest ?? await discover({
11043
- patterns: constructGlobs(workspace),
11044
- cwd: workspace.root,
11045
- runnables,
11046
- background
11047
- });
11048
- const stored = await (await secretsStoreFor(workspace, stage, {
11049
- ...options.profile ? { profile: options.profile } : {},
11050
- ...options.home ? { home: options.home } : {}
11051
- })).read(stage);
11052
- const { deployedStackSecrets } = await import("./compose-Bhmf0n4o.mjs").then((n) => n.l);
11053
- const { composeStack } = await import("./compose-Bhmf0n4o.mjs").then((n) => n.c);
11054
- const { secrets } = deployedStackSecrets(workspace, stage, stored, manifest);
11055
- const stack = composeStack({
11056
- workspace,
11057
- manifest,
11058
- runnables,
11059
- background,
11060
- stage,
11061
- identity: deployIdentity(workspace, stage),
11062
- images: {
11063
- mode: "pull",
11064
- tag: "dns",
11065
- ...workspace.deploy?.registry ? { registry: workspace.deploy.registry } : {}
11066
- },
11067
- secrets,
11068
- buildOnly: true,
11069
- allowDevServices: true
11070
- });
11071
- return stackHosts(stack);
11072
- }
11073
- /**
11074
- * `GKM_SERVER_IPV4` from the stage's secrets and `dns`: each public host's
11075
- * records, created or corrected. A dry run reads and prints, and writes
11076
- * nothing.
11077
- */
11078
- async function provisionStageDns(options) {
11079
- const { workspace, stage } = options;
11080
- const log = options.log ?? ((line) => console.log(line));
11081
- if (stage === workspace.stages.local || !workspace.dns || !deploysWithCompose(workspace)) return {
11082
- mode: "none",
11083
- hosts: [],
11084
- changes: []
11085
- };
11086
- const store = await secretsStoreFor(workspace, stage, {
11087
- ...options.profile ? { profile: options.profile } : {},
11088
- ...options.home ? { home: options.home } : {}
11089
- });
11090
- const server = serverAddress(stage, (await store.read(stage))?.custom);
11091
- if (!server) {
11092
- log(`\n🌐 DNS for '${stage}': no GKM_SERVER_IPV4 in its secrets, so no records — ${serverAddressHint(stage)}`);
11093
- return {
11094
- mode: "none",
11095
- hosts: [],
11096
- changes: []
11097
- };
11098
- }
11099
- const hosts = [...options.hosts ?? await composeStageHosts({
11100
- workspace,
11101
- stage,
11102
- ...options.profile ? { profile: options.profile } : {},
11103
- ...options.home ? { home: options.home } : {},
11104
- ...options.manifest ? { manifest: options.manifest } : {},
11105
- ...options.runnables ? { runnables: options.runnables } : {},
11106
- ...options.background ? { background: options.background } : {}
11107
- })];
11108
- log(`\n🌐 DNS for '${stage}' → ${server.ipv4}${server.ipv6 ? ` / ${server.ipv6}` : ""}${options.dryRun ? " (dry run — nothing is written)" : ""}`);
11109
- const plan = planStackDns({
11110
- stage,
11111
- hosts,
11112
- server,
11113
- dns: workspace.dns
11114
- });
11115
- try {
11116
- return {
11117
- mode: "records",
11118
- hosts,
11119
- changes: await applyStackDns(plan, {
11120
- ...options.dryRun ? { dryRun: true } : {},
11121
- log,
11122
- credentials: {
11123
- env: options.env ?? process.env,
11124
- ...options.home ? { home: options.home } : {},
11125
- log
11126
- },
11127
- ...options.providerFor ? { providerFor: options.providerFor } : {}
11128
- })
11129
- };
11130
- } catch (error) {
11131
- if (error instanceof MissingCredential) {
11132
- log(` ⚠ ${error.message}`);
11133
- log(" Until then, create these records yourself:");
11134
- 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})`);
11135
- return {
11136
- mode: "records",
11137
- hosts,
11138
- changes: []
11139
- };
11140
- }
11141
- throw error;
11142
- }
11143
- }
11144
- //#endregion
11145
11128
  //#region src/setup/index.ts
11146
11129
  var setup_exports = /* @__PURE__ */ __exportAll({
11147
- StageSecretsUnreadable: () => StageSecretsUnreadable,
11148
11130
  createFreshWorkspaceSecrets: () => createFreshWorkspaceSecrets,
11149
11131
  ensureStageSecrets: () => ensureStageSecrets,
11150
11132
  reconcileSecrets: () => reconcileSecrets,
@@ -11176,7 +11158,10 @@ async function setupCommand(options = {}) {
11176
11158
  logger$1.log(`📦 Workspace: ${workspace.name}`);
11177
11159
  logger$1.log(`📱 Apps: ${Object.keys(workspace.apps).join(", ")}`);
11178
11160
  logger$1.log(`🔑 Stage: ${stage}\n`);
11179
- if (!local) assertStageServer(workspace, stage, await readStageSecrets(await secretsStoreFor(workspace, stage, { ...options.profile ? { profile: options.profile } : {} }), stage, options));
11161
+ if (!local) {
11162
+ const store = await secretsStoreFor(workspace, stage, { ...options.profile ? { profile: options.profile } : {} });
11163
+ assertStageServer(workspace, stage, await store.read(stage));
11164
+ }
11180
11165
  if (!local && options.dryRun) {
11181
11166
  await provisionDeployed(workspace, stage, options);
11182
11167
  return;
@@ -11195,48 +11180,6 @@ async function setupCommand(options = {}) {
11195
11180
  }
11196
11181
  printSummary(workspace, stage);
11197
11182
  }
11198
- /** Where each AWS store keeps a stage's secrets, as a person reads it. */
11199
- const AWS_STORES = {
11200
- ssm: "SSM Parameter Store",
11201
- "secrets-manager": "Secrets Manager"
11202
- };
11203
- /**
11204
- * A deployed stage's secrets are kept in its AWS account, and no AWS
11205
- * credentials were found to read them with.
11206
- *
11207
- * Raised before any provider runs: even a dry run reads the stage's secrets,
11208
- * since its plan needs the server they name (`GKM_SERVER_IPV4`).
11209
- */
11210
- var StageSecretsUnreadable = class extends Error {
11211
- stage;
11212
- store;
11213
- profile;
11214
- dryRun;
11215
- constructor(stage, store, profile, dryRun, cause) {
11216
- const where = AWS_STORES[store] ?? `the '${store}' store`;
11217
- const command = `gkm setup --stage ${stage}${dryRun ? " --dry-run" : ""}`;
11218
- 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 });
11219
- this.stage = stage;
11220
- this.store = store;
11221
- this.profile = profile;
11222
- this.dryRun = dryRun;
11223
- this.name = "StageSecretsUnreadable";
11224
- }
11225
- };
11226
- /**
11227
- * The stage's secrets from its store, refused with
11228
- * {@link StageSecretsUnreadable} when there are no AWS credentials to read
11229
- * them — matched by the SDK's error name, its message being free to change.
11230
- * Any other failure is the store's own, and passes through.
11231
- */
11232
- async function readStageSecrets(store, stage, options) {
11233
- try {
11234
- return await store.read(stage);
11235
- } catch (error) {
11236
- if (error?.name === "CredentialsProviderError") throw new StageSecretsUnreadable(stage, store.name, options.profile, options.dryRun === true, error);
11237
- throw error;
11238
- }
11239
- }
11240
11183
  /**
11241
11184
  * A deployed stage's providers: each one's `ensure()`, in the stage's own
11242
11185
  * account, its keys written into the stage's secrets.
@@ -11479,7 +11422,7 @@ async function readReady(path) {
11479
11422
  }
11480
11423
  }
11481
11424
  /** A name recorded for the test stage without the test stage's suffix. */
11482
- var NotATestDatabase = class extends Error {
11425
+ var NotATestDatabase = class extends GkmError {
11483
11426
  database;
11484
11427
  constructor(database) {
11485
11428
  super(`Refusing to drop '${database}': only the test stage's databases (named '…_${TEST_STAGE}') are dropped after a suite. Delete ${TEST_READY_FILE} if it was edited by hand.`);
@@ -11616,8 +11559,8 @@ function testDatabases(reconciled) {
11616
11559
  * starts without the reference data the app needs.
11617
11560
  */
11618
11561
  async function migrateTestStage(workspace, env) {
11619
- const { migrateAndSeed } = await import("./migrate-DbtcuOr_.mjs");
11620
- const { discover } = await import("./discover-BPelzeGW.mjs").then((n) => n.i);
11562
+ const { migrateAndSeed } = await import("./migrate-CsBZKALY.mjs");
11563
+ const { discover } = await import("./discover-qjFapetL.mjs").then((n) => n.i);
11621
11564
  const sources = {};
11622
11565
  const manifest = await discover({
11623
11566
  patterns: constructGlobs(workspace),
@@ -11635,7 +11578,7 @@ async function migrateTestStage(workspace, env) {
11635
11578
  for (const { target, seeded } of seeds) if (seeded.length > 0) console.log(` 🌱 ${target.seeds}: ran ${seeded.join(", ")}`);
11636
11579
  }
11637
11580
  /** `gkm test` outside a project that declares stages, with none named. */
11638
- var NoStageToTest = class extends Error {
11581
+ var NoStageToTest = class extends GkmError {
11639
11582
  constructor() {
11640
11583
  super("No stage to test with: add `stages` to gkm.config.ts, or pass --stage.");
11641
11584
  this.name = "NoStageToTest";
@@ -11903,7 +11846,7 @@ function install(pm, cwd) {
11903
11846
  }
11904
11847
  }
11905
11848
  /** npm did not answer for a package, so there is no version to compare. */
11906
- var RegistryUnavailable = class extends Error {
11849
+ var RegistryUnavailable = class extends GkmError {
11907
11850
  packageName;
11908
11851
  status;
11909
11852
  constructor(packageName, status) {
@@ -11914,7 +11857,7 @@ var RegistryUnavailable = class extends Error {
11914
11857
  }
11915
11858
  };
11916
11859
  /** A dist-tag npm does not have, e.g. `--tag beta` before any beta. */
11917
- var NoReleaseOnTag = class extends Error {
11860
+ var NoReleaseOnTag = class extends GkmError {
11918
11861
  tag;
11919
11862
  tags;
11920
11863
  constructor(tag, tags) {
@@ -11925,7 +11868,7 @@ var NoReleaseOnTag = class extends Error {
11925
11868
  }
11926
11869
  };
11927
11870
  /** The line asked for is behind what is installed; upgrade never goes back. */
11928
- var WouldDowngrade = class extends Error {
11871
+ var WouldDowngrade = class extends GkmError {
11929
11872
  installed;
11930
11873
  tag;
11931
11874
  target;
@@ -11950,7 +11893,7 @@ var InstallFailed = class extends Error {
11950
11893
  //#region src/index.ts
11951
11894
  const program = new Command();
11952
11895
  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", () => {
11953
- if (program.opts().debug);
11896
+ if (program.opts().debug) enableDebug();
11954
11897
  });
11955
11898
  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) => {
11956
11899
  try {
@@ -11958,8 +11901,7 @@ program.command("init").description("Scaffold a new project").argument("[name]",
11958
11901
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
11959
11902
  await initCommand(name, options);
11960
11903
  } catch (error) {
11961
- console.error(formatError(error));
11962
- process.exit(1);
11904
+ exitWithError(error);
11963
11905
  }
11964
11906
  });
11965
11907
  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) => {
@@ -11968,8 +11910,7 @@ program.command("trust").description("Trust the local edge's certificate authori
11968
11910
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
11969
11911
  await trustCommand(options);
11970
11912
  } catch (error) {
11971
- console.error(formatError(error));
11972
- process.exit(1);
11913
+ exitWithError(error);
11973
11914
  }
11974
11915
  });
11975
11916
  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) => {
@@ -11978,8 +11919,7 @@ program.command("setup").description("Reconcile declared constructs — locally,
11978
11919
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
11979
11920
  await setupCommand(options);
11980
11921
  } catch (error) {
11981
- console.error(formatError(error));
11982
- process.exit(1);
11922
+ exitWithError(error);
11983
11923
  }
11984
11924
  });
11985
11925
  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 Option("--cache <backend>", "Register the drivers for this cache backend rather than the target default").hideHelp()).action(async (options) => {
@@ -11998,8 +11938,7 @@ program.command("build").description("Build handlers and the manifest from decla
11998
11938
  markOptional: options.markOptional || false
11999
11939
  });
12000
11940
  } catch (error) {
12001
- console.error(formatError(error));
12002
- process.exit(1);
11941
+ exitWithError(error);
12003
11942
  }
12004
11943
  });
12005
11944
  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) => {
@@ -12018,8 +11957,7 @@ program.command("dev").description("Reconcile constructs and start the dev serve
12018
11957
  subscribers: options.subscribers
12019
11958
  });
12020
11959
  } catch (error) {
12021
- console.error(formatError(error));
12022
- process.exit(1);
11960
+ exitWithError(error);
12023
11961
  }
12024
11962
  });
12025
11963
  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) => {
@@ -12029,8 +11967,7 @@ program.command("dev:credentials").description("Print each local service's addre
12029
11967
  const { devCredentialsCommand } = await Promise.resolve().then(() => credentials_exports);
12030
11968
  await devCredentialsCommand(options);
12031
11969
  } catch (error) {
12032
- console.error(formatError(error));
12033
- process.exit(1);
11970
+ exitWithError(error);
12034
11971
  }
12035
11972
  });
12036
11973
  program.command("exec").description("Run a command with secrets injected into Credentials").argument("<command...>", "Command to run (use -- before command)").action(async (commandArgs) => {
@@ -12039,8 +11976,7 @@ program.command("exec").description("Run a command with secrets injected into Cr
12039
11976
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12040
11977
  await execCommand(commandArgs);
12041
11978
  } catch (error) {
12042
- console.error(formatError(error));
12043
- process.exit(1);
11979
+ exitWithError(error);
12044
11980
  }
12045
11981
  });
12046
11982
  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) => {
@@ -12052,50 +11988,46 @@ program.command("test").description("Run tests with secrets loaded from environm
12052
11988
  pattern
12053
11989
  });
12054
11990
  } catch (error) {
12055
- console.error(formatError(error));
12056
- process.exit(1);
11991
+ exitWithError(error);
12057
11992
  }
12058
11993
  });
12059
11994
  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) => {
12060
11995
  try {
12061
11996
  const globalOptions = program.opts();
12062
11997
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12063
- const { migrateCommand } = await import("./migrate-DbtcuOr_.mjs");
11998
+ const { migrateCommand } = await import("./migrate-CsBZKALY.mjs");
12064
11999
  await migrateCommand({
12065
12000
  ...options,
12066
12001
  ...construct ? { construct } : {}
12067
12002
  });
12068
12003
  } catch (error) {
12069
- console.error(formatError(error));
12070
- process.exit(1);
12004
+ exitWithError(error);
12071
12005
  }
12072
12006
  });
12073
12007
  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) => {
12074
12008
  try {
12075
12009
  const globalOptions = program.opts();
12076
12010
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12077
- const { seedCommand } = await import("./migrate-DbtcuOr_.mjs");
12011
+ const { seedCommand } = await import("./migrate-CsBZKALY.mjs");
12078
12012
  await seedCommand({
12079
12013
  ...options,
12080
12014
  ...construct ? { construct } : {}
12081
12015
  });
12082
12016
  } catch (error) {
12083
- console.error(formatError(error));
12084
- process.exit(1);
12017
+ exitWithError(error);
12085
12018
  }
12086
12019
  });
12087
12020
  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) => {
12088
12021
  try {
12089
12022
  const globalOptions = program.opts();
12090
12023
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12091
- const { migrationCommand } = await import("./migrate-DbtcuOr_.mjs");
12024
+ const { migrationCommand } = await import("./migrate-CsBZKALY.mjs");
12092
12025
  await migrationCommand({
12093
12026
  construct,
12094
12027
  ...name ? { name } : {}
12095
12028
  });
12096
12029
  } catch (error) {
12097
- console.error(formatError(error));
12098
- process.exit(1);
12030
+ exitWithError(error);
12099
12031
  }
12100
12032
  });
12101
12033
  program.command("cron").description("Manage cron jobs").action(() => {
@@ -12123,8 +12055,7 @@ program.command("openapi").description("Generate OpenAPI specification from endp
12123
12055
  ...telemetry !== void 0 ? { telemetry } : {}
12124
12056
  });
12125
12057
  } catch (error) {
12126
- console.error(formatError(error));
12127
- process.exit(1);
12058
+ exitWithError(error);
12128
12059
  }
12129
12060
  });
12130
12061
  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) => {
@@ -12133,8 +12064,7 @@ program.command("docker").description("Generate Docker deployment files").option
12133
12064
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12134
12065
  await dockerCommand(options);
12135
12066
  } catch (error) {
12136
- console.error(formatError(error));
12137
- process.exit(1);
12067
+ exitWithError(error);
12138
12068
  }
12139
12069
  });
12140
12070
  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) => {
@@ -12143,8 +12073,7 @@ program.command("compose").description("Run the workspace's APIs and sites for a
12143
12073
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12144
12074
  await composeCommand(options);
12145
12075
  } catch (error) {
12146
- console.error(formatError(error));
12147
- process.exit(1);
12076
+ exitWithError(error);
12148
12077
  }
12149
12078
  });
12150
12079
  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) => {
@@ -12158,8 +12087,7 @@ program.command("prepack").description("Generate Docker files for production dep
12158
12087
  registry: options.registry
12159
12088
  });
12160
12089
  } catch (error) {
12161
- console.error(formatError(error));
12162
- process.exit(1);
12090
+ exitWithError(error);
12163
12091
  }
12164
12092
  });
12165
12093
  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) => {
@@ -12168,8 +12096,7 @@ program.command("secrets:init").description("Initialize secrets for a deployment
12168
12096
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12169
12097
  await secretsInitCommand(options);
12170
12098
  } catch (error) {
12171
- console.error(formatError(error));
12172
- process.exit(1);
12099
+ exitWithError(error);
12173
12100
  }
12174
12101
  });
12175
12102
  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) => {
@@ -12178,8 +12105,7 @@ program.command("secrets:set").description("Set a custom secret for a stage").ar
12178
12105
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12179
12106
  await secretsSetCommand(key, value, options);
12180
12107
  } catch (error) {
12181
- console.error(formatError(error));
12182
- process.exit(1);
12108
+ exitWithError(error);
12183
12109
  }
12184
12110
  });
12185
12111
  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) => {
@@ -12188,41 +12114,37 @@ program.command("secrets:unset").description("Remove a custom secret from a stag
12188
12114
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12189
12115
  await secretsUnsetCommand(key, options);
12190
12116
  } catch (error) {
12191
- console.error(formatError(error));
12192
- process.exit(1);
12117
+ exitWithError(error);
12193
12118
  }
12194
12119
  });
12195
12120
  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) => {
12196
12121
  try {
12197
12122
  const globalOptions = program.opts();
12198
12123
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12199
- const { secretsAddCommand } = await import("./add-BSHk5Ngn.mjs");
12124
+ const { secretsAddCommand } = await import("./add-CP1podDH.mjs");
12200
12125
  await secretsAddCommand(options);
12201
12126
  } catch (error) {
12202
- console.error(formatError(error));
12203
- process.exit(1);
12127
+ exitWithError(error);
12204
12128
  }
12205
12129
  });
12206
12130
  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) => {
12207
12131
  try {
12208
12132
  const globalOptions = program.opts();
12209
12133
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12210
- const { encryptionRotateCommand } = await import("./encryption-BrEef7Jk.mjs");
12134
+ const { encryptionRotateCommand } = await import("./encryption-B6ilrT7p.mjs");
12211
12135
  await encryptionRotateCommand(construct, options);
12212
12136
  } catch (error) {
12213
- console.error(formatError(error));
12214
- process.exit(1);
12137
+ exitWithError(error);
12215
12138
  }
12216
12139
  });
12217
12140
  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) => {
12218
12141
  try {
12219
12142
  const globalOptions = program.opts();
12220
12143
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12221
- const { encryptionRetireCommand } = await import("./encryption-BrEef7Jk.mjs");
12144
+ const { encryptionRetireCommand } = await import("./encryption-B6ilrT7p.mjs");
12222
12145
  await encryptionRetireCommand(construct, key, options);
12223
12146
  } catch (error) {
12224
- console.error(formatError(error));
12225
- process.exit(1);
12147
+ exitWithError(error);
12226
12148
  }
12227
12149
  });
12228
12150
  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) => {
@@ -12231,8 +12153,7 @@ program.command("secrets:show").description("Show secrets for a stage").required
12231
12153
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12232
12154
  await secretsShowCommand(options);
12233
12155
  } catch (error) {
12234
- console.error(formatError(error));
12235
- process.exit(1);
12156
+ exitWithError(error);
12236
12157
  }
12237
12158
  });
12238
12159
  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) => {
@@ -12241,8 +12162,7 @@ program.command("secrets:rotate").description("Rotate service passwords").requir
12241
12162
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12242
12163
  await secretsRotateCommand(options);
12243
12164
  } catch (error) {
12244
- console.error(formatError(error));
12245
- process.exit(1);
12165
+ exitWithError(error);
12246
12166
  }
12247
12167
  });
12248
12168
  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) => {
@@ -12251,8 +12171,7 @@ program.command("secrets:import").description("Import secrets from a JSON file")
12251
12171
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12252
12172
  await secretsImportCommand(file, options);
12253
12173
  } catch (error) {
12254
- console.error(formatError(error));
12255
- process.exit(1);
12174
+ exitWithError(error);
12256
12175
  }
12257
12176
  });
12258
12177
  program.command("secrets:reconcile").description("Backfill missing custom secrets from workspace config").option("--stage <stage>", "Stage name (default: stages.local)").action(async (options) => {
@@ -12260,8 +12179,8 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12260
12179
  const globalOptions = program.opts();
12261
12180
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12262
12181
  const { loadWorkspaceConfig } = await import("./config.mjs");
12263
- const { reconcileMissingSecrets } = await import("./reconcile-Dh1Jk7WE.mjs");
12264
- const { secretsStoreFor } = await import("./seeds-odfgSCmu.mjs").then((n) => n.Pn);
12182
+ const { reconcileMissingSecrets } = await import("./reconcile--I7V4Klj.mjs");
12183
+ const { secretsStoreFor } = await import("./seeds-BSL55F6q.mjs").then((n) => n.Yn);
12265
12184
  const { workspace } = await loadWorkspaceConfig();
12266
12185
  const stage = options.stage ?? workspace.stages.local;
12267
12186
  const store = await secretsStoreFor(workspace, stage);
@@ -12270,7 +12189,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12270
12189
  console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
12271
12190
  process.exit(1);
12272
12191
  }
12273
- const { derivedContainers } = await import("./seeds-odfgSCmu.mjs").then((n) => n.ht);
12192
+ const { derivedContainers } = await import("./seeds-BSL55F6q.mjs").then((n) => n.At);
12274
12193
  const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
12275
12194
  if (!result) {
12276
12195
  console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
@@ -12280,23 +12199,21 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12280
12199
  console.log(`\n✓ Reconciled ${result.addedKeys.length} missing secret(s) for stage "${stage}":`);
12281
12200
  for (const key of result.addedKeys) console.log(` + ${key}`);
12282
12201
  } catch (error) {
12283
- console.error(formatError(error));
12284
- process.exit(1);
12202
+ exitWithError(error);
12285
12203
  }
12286
12204
  });
12287
12205
  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) => {
12288
12206
  try {
12289
12207
  const globalOptions = program.opts();
12290
12208
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12291
- const { secretsMigrateCommand } = await import("./migrate-DWZz9kah.mjs");
12209
+ const { secretsMigrateCommand } = await import("./migrate-BaC4w0sb.mjs");
12292
12210
  await secretsMigrateCommand(options);
12293
12211
  } catch (error) {
12294
- console.error(formatError(error));
12295
- process.exit(1);
12212
+ exitWithError(error);
12296
12213
  }
12297
12214
  });
12298
12215
  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) => {
12299
- const { deployCli } = await import("./cli-DD-Yk-I5.mjs");
12216
+ const { deployCli } = await import("./cli-B8otnZfX.mjs");
12300
12217
  const globalOptions = program.opts();
12301
12218
  const code = await deployCli({
12302
12219
  cwd: resolve(globalOptions.cwd ?? process.cwd()),
@@ -12314,8 +12231,8 @@ program.command("deploy").description("Deploy a stage through its target").optio
12314
12231
  });
12315
12232
  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) => {
12316
12233
  try {
12317
- const { rollbackStage } = await import("./rollback-CFrNLmxs.mjs").then((n) => n.a);
12318
- const { terminalCredentials } = await import("./terminal-D8TPK7o9.mjs");
12234
+ const { rollbackStage } = await import("./rollback-Drbg0OeR.mjs").then((n) => n.a);
12235
+ const { terminalCredentials } = await import("./terminal-C4XRdwnU.mjs");
12319
12236
  const globalOptions = program.opts();
12320
12237
  await rollbackStage({
12321
12238
  cwd: resolve(globalOptions.cwd ?? process.cwd()),
@@ -12326,8 +12243,7 @@ program.command("deploy:rollback").description("Put a stage's app back on its pr
12326
12243
  log: (line) => console.log(line)
12327
12244
  });
12328
12245
  } catch (error) {
12329
- console.error(formatError(error));
12330
- process.exit(1);
12246
+ exitWithError(error);
12331
12247
  }
12332
12248
  });
12333
12249
  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) => {
@@ -12342,30 +12258,27 @@ program.command("deploy:init").description("Initialize Dokploy deployment (creat
12342
12258
  registryId: options.registryId
12343
12259
  });
12344
12260
  } catch (error) {
12345
- console.error(formatError(error));
12346
- process.exit(1);
12261
+ exitWithError(error);
12347
12262
  }
12348
12263
  });
12349
12264
  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) => {
12350
12265
  try {
12351
12266
  const globalOptions = program.opts();
12352
12267
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12353
- const { deployGithubCommand } = await import("./github-BCDF6xVH.mjs");
12268
+ const { deployGithubCommand } = await import("./github-CzBbs43W.mjs");
12354
12269
  await deployGithubCommand(options);
12355
12270
  } catch (error) {
12356
- console.error(formatError(error));
12357
- process.exit(1);
12271
+ exitWithError(error);
12358
12272
  }
12359
12273
  });
12360
12274
  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) => {
12361
12275
  try {
12362
12276
  const globalOptions = program.opts();
12363
12277
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12364
- const { stagesCommand } = await import("./stages-CnZRYmkI.mjs");
12278
+ const { stagesCommand } = await import("./stages-DY-fQKmo.mjs");
12365
12279
  await stagesCommand(options);
12366
12280
  } catch (error) {
12367
- console.error(formatError(error));
12368
- process.exit(1);
12281
+ exitWithError(error);
12369
12282
  }
12370
12283
  });
12371
12284
  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) => {
@@ -12391,8 +12304,7 @@ program.command("deploy:list").description("List Dokploy resources (projects, re
12391
12304
  });
12392
12305
  }
12393
12306
  } catch (error) {
12394
- console.error(formatError(error));
12395
- process.exit(1);
12307
+ exitWithError(error);
12396
12308
  }
12397
12309
  });
12398
12310
  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) => {
@@ -12414,8 +12326,7 @@ program.command("login").description("Authenticate with a deployment or DNS prov
12414
12326
  endpoint: options.endpoint
12415
12327
  });
12416
12328
  } catch (error) {
12417
- console.error(formatError(error));
12418
- process.exit(1);
12329
+ exitWithError(error);
12419
12330
  }
12420
12331
  });
12421
12332
  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) => {
@@ -12424,8 +12335,7 @@ program.command("logout").description("Remove stored credentials").option("--pro
12424
12335
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12425
12336
  await logoutCommand({ provider: options.service ?? options.provider });
12426
12337
  } catch (error) {
12427
- console.error(formatError(error));
12428
- process.exit(1);
12338
+ exitWithError(error);
12429
12339
  }
12430
12340
  });
12431
12341
  program.command("whoami").description("Show current authentication status").action(async () => {
@@ -12434,8 +12344,7 @@ program.command("whoami").description("Show current authentication status").acti
12434
12344
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12435
12345
  await whoamiCommand();
12436
12346
  } catch (error) {
12437
- console.error(formatError(error));
12438
- process.exit(1);
12347
+ exitWithError(error);
12439
12348
  }
12440
12349
  });
12441
12350
  program.command("state:pull").description("Pull deployment state from remote to local").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").action(async (options) => {
@@ -12444,8 +12353,7 @@ program.command("state:pull").description("Pull deployment state from remote to
12444
12353
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12445
12354
  await statePullCommand(options);
12446
12355
  } catch (error) {
12447
- console.error(formatError(error));
12448
- process.exit(1);
12356
+ exitWithError(error);
12449
12357
  }
12450
12358
  });
12451
12359
  program.command("state:push").description("Push deployment state from local to remote").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").action(async (options) => {
@@ -12454,8 +12362,7 @@ program.command("state:push").description("Push deployment state from local to r
12454
12362
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12455
12363
  await statePushCommand(options);
12456
12364
  } catch (error) {
12457
- console.error(formatError(error));
12458
- process.exit(1);
12365
+ exitWithError(error);
12459
12366
  }
12460
12367
  });
12461
12368
  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) => {
@@ -12464,8 +12371,16 @@ program.command("state:show").description("Show deployment state for a stage").r
12464
12371
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12465
12372
  await stateShowCommand(options);
12466
12373
  } catch (error) {
12467
- console.error(formatError(error));
12468
- process.exit(1);
12374
+ exitWithError(error);
12375
+ }
12376
+ });
12377
+ 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) => {
12378
+ try {
12379
+ const globalOptions = program.opts();
12380
+ if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12381
+ await stateHistoryCommand(options);
12382
+ } catch (error) {
12383
+ exitWithError(error);
12469
12384
  }
12470
12385
  });
12471
12386
  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) => {
@@ -12474,8 +12389,7 @@ program.command("state:unlock").description("Release a stage deploy lock left be
12474
12389
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12475
12390
  await stateUnlockCommand(options);
12476
12391
  } catch (error) {
12477
- console.error(formatError(error));
12478
- process.exit(1);
12392
+ exitWithError(error);
12479
12393
  }
12480
12394
  });
12481
12395
  program.command("state:diff").description("Compare local and remote deployment state").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").action(async (options) => {
@@ -12484,8 +12398,7 @@ program.command("state:diff").description("Compare local and remote deployment s
12484
12398
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12485
12399
  await stateDiffCommand(options);
12486
12400
  } catch (error) {
12487
- console.error(formatError(error));
12488
- process.exit(1);
12401
+ exitWithError(error);
12489
12402
  }
12490
12403
  });
12491
12404
  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) => {
@@ -12494,18 +12407,16 @@ program.command("upgrade").description("Upgrade @geekmidas/cli (with --all, ever
12494
12407
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12495
12408
  await upgradeCommand(options);
12496
12409
  } catch (error) {
12497
- console.error(formatError(error));
12498
- process.exit(1);
12410
+ exitWithError(error);
12499
12411
  }
12500
12412
  });
12501
12413
  try {
12502
12414
  assertDevServicesFlag(process.argv.slice(2));
12503
12415
  } catch (error) {
12504
- console.error(formatError(error));
12505
- process.exit(1);
12416
+ exitWithError(error);
12506
12417
  }
12507
12418
  program.parse();
12508
12419
  //#endregion
12509
- export { formatError as a, prompt as c, stamp as i, generateFullstackCustomSecrets as n, validateDokployToken as o, slug as r, canPrompt as s, deploysWithCompose as t };
12420
+ export { validateDokployToken as a, formatError as i, slug as n, canPrompt as o, stamp as r, prompt as s, generateFullstackCustomSecrets as t };
12510
12421
 
12511
12422
  //# sourceMappingURL=index.mjs.map