@geekmidas/cli 10.0.0-alpha.92 → 10.0.0-alpha.94

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 (206) hide show
  1. package/dist/{GoDaddyProvider-BqYGk9XT.mjs → GoDaddyProvider-BRZUWD8z.mjs} +3 -3
  2. package/dist/{GoDaddyProvider-BqYGk9XT.mjs.map → GoDaddyProvider-BRZUWD8z.mjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-CJwg2r_9.cjs → GoDaddyProvider-DzguxU_a.cjs} +3 -3
  4. package/dist/{GoDaddyProvider-CJwg2r_9.cjs.map → GoDaddyProvider-DzguxU_a.cjs.map} +1 -1
  5. package/dist/{HostingerProvider-1mqD6aG8.mjs → HostingerProvider-Cjh_2Ml6.mjs} +9 -4
  6. package/dist/{HostingerProvider-1mqD6aG8.mjs.map → HostingerProvider-Cjh_2Ml6.mjs.map} +1 -1
  7. package/dist/{HostingerProvider-C6t-PSNe.cjs → HostingerProvider-OdQmKXE3.cjs} +9 -4
  8. package/dist/HostingerProvider-OdQmKXE3.cjs.map +1 -0
  9. package/dist/LegacyStateStore-BQZb6-j2.mjs +124 -0
  10. package/dist/LegacyStateStore-BQZb6-j2.mjs.map +1 -0
  11. package/dist/LegacyStateStore-D50dgUPc.cjs +124 -0
  12. package/dist/LegacyStateStore-D50dgUPc.cjs.map +1 -0
  13. package/dist/{LocalStateStore-Y8XHdoCR.mjs → LocalStateStore-BSaS2535.mjs} +2 -2
  14. package/dist/{LocalStateStore-Y8XHdoCR.mjs.map → LocalStateStore-BSaS2535.mjs.map} +1 -1
  15. package/dist/{LocalStateStore-BMfseje2.cjs → LocalStateStore-EFBUjuMX.cjs} +8 -8
  16. package/dist/{LocalStateStore-BMfseje2.cjs.map → LocalStateStore-EFBUjuMX.cjs.map} +1 -1
  17. package/dist/{S3StateStore-BmMt2HhW.cjs → S3StateStore-C5mv8To3.cjs} +5 -5
  18. package/dist/{S3StateStore-BmMt2HhW.cjs.map → S3StateStore-C5mv8To3.cjs.map} +1 -1
  19. package/dist/{S3StateStore-BfoY4MvD.mjs → S3StateStore-CrFq4UZU.mjs} +2 -2
  20. package/dist/{S3StateStore-BfoY4MvD.mjs.map → S3StateStore-CrFq4UZU.mjs.map} +1 -1
  21. package/dist/{SSMStateStore-Bdyw_0Jj.mjs → SSMStateStore-D3Z6mZnA.mjs} +2 -2
  22. package/dist/{SSMStateStore-Bdyw_0Jj.mjs.map → SSMStateStore-D3Z6mZnA.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-D9K62wM4.cjs → SSMStateStore-DuZCH7_v.cjs} +9 -9
  24. package/dist/{SSMStateStore-D9K62wM4.cjs.map → SSMStateStore-DuZCH7_v.cjs.map} +1 -1
  25. package/dist/{add-2Opn2VVE.mjs → add-C85isXFl.mjs} +4 -5
  26. package/dist/add-C85isXFl.mjs.map +1 -0
  27. package/dist/{add-oN0b18HN.cjs → add-DsVDdvon.cjs} +5 -6
  28. package/dist/add-DsVDdvon.cjs.map +1 -0
  29. package/dist/{bundler-CXQDrhzN.cjs → bundler-BEgUKc4j.cjs} +5 -5
  30. package/dist/{bundler-CXQDrhzN.cjs.map → bundler-BEgUKc4j.cjs.map} +1 -1
  31. package/dist/{bundler-C-AdesaG.mjs → bundler-BSHog8CH.mjs} +5 -5
  32. package/dist/{bundler-C-AdesaG.mjs.map → bundler-BSHog8CH.mjs.map} +1 -1
  33. package/dist/{cli-BjhaVObS.mjs → cli-BsFenyaf.mjs} +10 -6
  34. package/dist/cli-BsFenyaf.mjs.map +1 -0
  35. package/dist/{cli-BRZFYvdb.cjs → cli-BvBdv660.cjs} +9 -5
  36. package/dist/cli-BvBdv660.cjs.map +1 -0
  37. package/dist/compose-Cd09gW-n.cjs +1562 -0
  38. package/dist/compose-Cd09gW-n.cjs.map +1 -0
  39. package/dist/compose-D2RFYd_f.mjs +1515 -0
  40. package/dist/compose-D2RFYd_f.mjs.map +1 -0
  41. package/dist/{config-C9zx7KsX.d.cts → config-DvHNMoOp.d.cts} +4 -4
  42. package/dist/{config-BJo8Wggp.d.mts.map → config-DvHNMoOp.d.cts.map} +1 -1
  43. package/dist/{config-BJo8Wggp.d.mts → config-Ngesg4O8.d.mts} +4 -4
  44. package/dist/{config-C9zx7KsX.d.cts.map → config-Ngesg4O8.d.mts.map} +1 -1
  45. package/dist/config.cjs +1 -1
  46. package/dist/config.d.cts +3 -3
  47. package/dist/config.d.mts +3 -3
  48. package/dist/config.mjs +1 -1
  49. package/dist/{credentials-QBu7VgaQ.cjs → credentials-D7XJypNd.cjs} +9 -3
  50. package/dist/{credentials-QBu7VgaQ.cjs.map → credentials-D7XJypNd.cjs.map} +1 -1
  51. package/dist/{credentials-C4KII3PD.mjs → credentials-DpfnUvIR.mjs} +9 -3
  52. package/dist/{credentials-C4KII3PD.mjs.map → credentials-DpfnUvIR.mjs.map} +1 -1
  53. package/dist/deploy/public.cjs +13 -12
  54. package/dist/deploy/public.d.cts +25 -10
  55. package/dist/deploy/public.d.cts.map +1 -1
  56. package/dist/deploy/public.d.mts +25 -10
  57. package/dist/deploy/public.d.mts.map +1 -1
  58. package/dist/deploy/public.mjs +11 -11
  59. package/dist/{deploy-6ToUHJmM.cjs → deploy-C911Akkn.cjs} +125 -10
  60. package/dist/deploy-C911Akkn.cjs.map +1 -0
  61. package/dist/{deploy-yuJHlkY0.mjs → deploy-CeJ5D0xn.mjs} +124 -9
  62. package/dist/deploy-CeJ5D0xn.mjs.map +1 -0
  63. package/dist/{discover-G76EQ4vY.d.mts → discover-CTzOSGUF.d.cts} +2 -2
  64. package/dist/{discover-CRMhvHG9.d.cts.map → discover-CTzOSGUF.d.cts.map} +1 -1
  65. package/dist/{discover-CRMhvHG9.d.cts → discover-CihAtaoj.d.mts} +2 -2
  66. package/dist/{discover-G76EQ4vY.d.mts.map → discover-CihAtaoj.d.mts.map} +1 -1
  67. package/dist/{dokploy-Bvvfj2qe.cjs → dokploy-CV7GcobZ.cjs} +2 -2
  68. package/dist/{dokploy-Bvvfj2qe.cjs.map → dokploy-CV7GcobZ.cjs.map} +1 -1
  69. package/dist/{dokploy-BvbJ_A4Q.mjs → dokploy-D_aat2Xj.mjs} +2 -2
  70. package/dist/{dokploy-BvbJ_A4Q.mjs.map → dokploy-D_aat2Xj.mjs.map} +1 -1
  71. package/dist/{encryption-CgW167LO.cjs → encryption-DFcivJaO.cjs} +3 -3
  72. package/dist/{encryption-CgW167LO.cjs.map → encryption-DFcivJaO.cjs.map} +1 -1
  73. package/dist/{encryption-C9Jm9dfn.mjs → encryption-_4qKqtTx.mjs} +3 -3
  74. package/dist/{encryption-C9Jm9dfn.mjs.map → encryption-_4qKqtTx.mjs.map} +1 -1
  75. package/dist/{engine-Dj7ZKO8H.cjs → engine-Bv-LZpmj.cjs} +13 -11
  76. package/dist/engine-Bv-LZpmj.cjs.map +1 -0
  77. package/dist/{engine-C8Ye9MUm.mjs → engine-DPMHThkg.mjs} +11 -9
  78. package/dist/engine-DPMHThkg.mjs.map +1 -0
  79. package/dist/{github-BD051KZZ.cjs → github-Br42NMrW.cjs} +94 -6
  80. package/dist/github-Br42NMrW.cjs.map +1 -0
  81. package/dist/{github-B1k42hIt.mjs → github-xsDT19im.mjs} +94 -6
  82. package/dist/github-xsDT19im.mjs.map +1 -0
  83. package/dist/{index-D1pHwqkK.d.mts → index-BlpcClwM.d.mts} +2 -2
  84. package/dist/{index-B5uuwx-Y.d.cts.map → index-BlpcClwM.d.mts.map} +1 -1
  85. package/dist/{index-B5uuwx-Y.d.cts → index-CwLvFqtH.d.cts} +2 -2
  86. package/dist/{index-D1pHwqkK.d.mts.map → index-CwLvFqtH.d.cts.map} +1 -1
  87. package/dist/index.cjs +240 -250
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.mjs +234 -243
  90. package/dist/index.mjs.map +1 -1
  91. package/dist/{local-Otp74ak0.mjs → local-B7Zv1NoA.mjs} +2 -2
  92. package/dist/{local-Otp74ak0.mjs.map → local-B7Zv1NoA.mjs.map} +1 -1
  93. package/dist/{local-B61kUh0w.cjs → local-OPC9BCZt.cjs} +2 -2
  94. package/dist/{local-B61kUh0w.cjs.map → local-OPC9BCZt.cjs.map} +1 -1
  95. package/dist/{migrate-IZsYyZ5F.mjs → migrate-B7evHv7O.mjs} +3 -3
  96. package/dist/{migrate-IZsYyZ5F.mjs.map → migrate-B7evHv7O.mjs.map} +1 -1
  97. package/dist/{migrate-D3VVsiHp.cjs → migrate-D5jUz20_.cjs} +3 -3
  98. package/dist/{migrate-D3VVsiHp.cjs.map → migrate-D5jUz20_.cjs.map} +1 -1
  99. package/dist/{migrate-BSbZ7-9n.mjs → migrate-DhvFPGLi.mjs} +4 -4
  100. package/dist/{migrate-BSbZ7-9n.mjs.map → migrate-DhvFPGLi.mjs.map} +1 -1
  101. package/dist/{migrate-f6JDjyCp.cjs → migrate-SkWJotn5.cjs} +3 -3
  102. package/dist/{migrate-f6JDjyCp.cjs.map → migrate-SkWJotn5.cjs.map} +1 -1
  103. package/dist/openapi.cjs +1 -1
  104. package/dist/openapi.d.cts +1 -1
  105. package/dist/openapi.d.mts +1 -1
  106. package/dist/openapi.mjs +1 -1
  107. package/dist/providers-BFeP_mYw.cjs +1098 -0
  108. package/dist/providers-BFeP_mYw.cjs.map +1 -0
  109. package/dist/providers-sTj-BG0S.mjs +1079 -0
  110. package/dist/providers-sTj-BG0S.mjs.map +1 -0
  111. package/dist/reconcile/public.d.cts +2 -2
  112. package/dist/reconcile/public.d.mts +2 -2
  113. package/dist/{reconcile-Dh1Jk7WE.mjs → reconcile--I7V4Klj.mjs} +2 -2
  114. package/dist/{reconcile-Dh1Jk7WE.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  115. package/dist/{resolve-DUp65SnJ.cjs → resolve-CFEOtRsl.cjs} +4 -4
  116. package/dist/{resolve-DUp65SnJ.cjs.map → resolve-CFEOtRsl.cjs.map} +1 -1
  117. package/dist/{resolve-Be4bF1w4.mjs → resolve-Dyd1S2wn.mjs} +4 -4
  118. package/dist/{resolve-Be4bF1w4.mjs.map → resolve-Dyd1S2wn.mjs.map} +1 -1
  119. package/dist/{rollback-DDHtd0GJ.cjs → rollback-D720SFhV.cjs} +11 -8
  120. package/dist/rollback-D720SFhV.cjs.map +1 -0
  121. package/dist/{rollback-D1d-fW0r.mjs → rollback-NroNbGC0.mjs} +10 -7
  122. package/dist/rollback-NroNbGC0.mjs.map +1 -0
  123. package/dist/{runtime-Es1V4e9M.d.mts → runtime-BRCq6dQ7.d.mts} +2 -2
  124. package/dist/{runtime-DDrHlYe5.d.cts.map → runtime-BRCq6dQ7.d.mts.map} +1 -1
  125. package/dist/{runtime-DDrHlYe5.d.cts → runtime-VktAo_8B.d.cts} +2 -2
  126. package/dist/{runtime-Es1V4e9M.d.mts.map → runtime-VktAo_8B.d.cts.map} +1 -1
  127. package/dist/{sandbox-MaxSeU92.d.cts → sandbox-D1gd0iDz.d.cts} +2 -2
  128. package/dist/{sandbox-C3WsTa5m.d.mts.map → sandbox-D1gd0iDz.d.cts.map} +1 -1
  129. package/dist/{sandbox-C3WsTa5m.d.mts → sandbox-zHnRLCj0.d.mts} +2 -2
  130. package/dist/{sandbox-MaxSeU92.d.cts.map → sandbox-zHnRLCj0.d.mts.map} +1 -1
  131. package/dist/secrets-CwLauUB_.mjs +36 -0
  132. package/dist/secrets-CwLauUB_.mjs.map +1 -0
  133. package/dist/secrets-DAvi_O9g.cjs +47 -0
  134. package/dist/secrets-DAvi_O9g.cjs.map +1 -0
  135. package/dist/{seeds-BKoJYsE7.cjs → seeds-BCg8X36S.cjs} +1732 -2300
  136. package/dist/seeds-BCg8X36S.cjs.map +1 -0
  137. package/dist/{seeds-CvGQJnPO.mjs → seeds-CTxTZa-R.mjs} +1637 -2270
  138. package/dist/seeds-CTxTZa-R.mjs.map +1 -0
  139. package/dist/{sniffer-Dq5BS98f.cjs → sniffer-C0z3NB2A.cjs} +572 -3
  140. package/dist/sniffer-C0z3NB2A.cjs.map +1 -0
  141. package/dist/{sniffer-BTtGAtm3.mjs → sniffer-DCcuzHz_.mjs} +496 -5
  142. package/dist/sniffer-DCcuzHz_.mjs.map +1 -0
  143. package/dist/{sst-CnKY-CSh.cjs → sst-DKNH243z.cjs} +3 -3
  144. package/dist/{sst-CnKY-CSh.cjs.map → sst-DKNH243z.cjs.map} +1 -1
  145. package/dist/{sst-BaRXp2Dd.mjs → sst-DRDSDwOk.mjs} +3 -3
  146. package/dist/{sst-BaRXp2Dd.mjs.map → sst-DRDSDwOk.mjs.map} +1 -1
  147. package/dist/stack-B3fPDTBg.cjs +1346 -0
  148. package/dist/stack-B3fPDTBg.cjs.map +1 -0
  149. package/dist/stack-NrdH5ngX.mjs +1239 -0
  150. package/dist/stack-NrdH5ngX.mjs.map +1 -0
  151. package/dist/{stages-BI8JvPzI.cjs → stages-CkqP1N4S.cjs} +16 -3
  152. package/dist/stages-CkqP1N4S.cjs.map +1 -0
  153. package/dist/{stages-DY-fQKmo.mjs → stages-veC4TcQe.mjs} +16 -3
  154. package/dist/stages-veC4TcQe.mjs.map +1 -0
  155. package/dist/target/public.cjs +1 -1
  156. package/dist/target/public.d.cts +2 -2
  157. package/dist/target/public.d.mts +2 -2
  158. package/dist/target/public.mjs +1 -1
  159. package/dist/{terminal-8XngdSTo.cjs → terminal-CkUYuAPd.cjs} +2 -2
  160. package/dist/{terminal-8XngdSTo.cjs.map → terminal-CkUYuAPd.cjs.map} +1 -1
  161. package/dist/{terminal-Dtd6BZX9.mjs → terminal-DAHs2Zko.mjs} +3 -3
  162. package/dist/{terminal-Dtd6BZX9.mjs.map → terminal-DAHs2Zko.mjs.map} +1 -1
  163. package/dist/{types-Bk9st2cd.d.cts → types-DMoaFrjg.d.mts} +108 -33
  164. package/dist/types-DMoaFrjg.d.mts.map +1 -0
  165. package/dist/{types-B3Gqs175.d.mts → types-DXyaSmqu.d.cts} +109 -32
  166. package/dist/types-DXyaSmqu.d.cts.map +1 -0
  167. package/dist/workspace/index.cjs +1 -1
  168. package/dist/workspace/index.d.cts +2 -2
  169. package/dist/workspace/index.d.mts +2 -2
  170. package/dist/workspace/index.mjs +1 -1
  171. package/dist/{workspace-Bzw7Zs82.mjs → workspace-DWK1PTXP.mjs} +4 -4
  172. package/dist/workspace-DWK1PTXP.mjs.map +1 -0
  173. package/dist/{workspace-CHOB2Xg3.cjs → workspace-cSyi5nb1.cjs} +4 -4
  174. package/dist/workspace-cSyi5nb1.cjs.map +1 -0
  175. package/package.json +15 -15
  176. package/dist/HostingerProvider-C6t-PSNe.cjs.map +0 -1
  177. package/dist/LegacyStateStore-CeEwayMB.cjs +0 -89
  178. package/dist/LegacyStateStore-CeEwayMB.cjs.map +0 -1
  179. package/dist/LegacyStateStore-DdJ1bCRV.mjs +0 -89
  180. package/dist/LegacyStateStore-DdJ1bCRV.mjs.map +0 -1
  181. package/dist/add-2Opn2VVE.mjs.map +0 -1
  182. package/dist/add-oN0b18HN.cjs.map +0 -1
  183. package/dist/cli-BRZFYvdb.cjs.map +0 -1
  184. package/dist/cli-BjhaVObS.mjs.map +0 -1
  185. package/dist/compose-CTdVeeVk.mjs +0 -3151
  186. package/dist/compose-CTdVeeVk.mjs.map +0 -1
  187. package/dist/compose-fnYmPk_c.cjs +0 -3276
  188. package/dist/compose-fnYmPk_c.cjs.map +0 -1
  189. package/dist/deploy-6ToUHJmM.cjs.map +0 -1
  190. package/dist/deploy-yuJHlkY0.mjs.map +0 -1
  191. package/dist/engine-C8Ye9MUm.mjs.map +0 -1
  192. package/dist/engine-Dj7ZKO8H.cjs.map +0 -1
  193. package/dist/github-B1k42hIt.mjs.map +0 -1
  194. package/dist/github-BD051KZZ.cjs.map +0 -1
  195. package/dist/rollback-D1d-fW0r.mjs.map +0 -1
  196. package/dist/rollback-DDHtd0GJ.cjs.map +0 -1
  197. package/dist/seeds-BKoJYsE7.cjs.map +0 -1
  198. package/dist/seeds-CvGQJnPO.mjs.map +0 -1
  199. package/dist/sniffer-BTtGAtm3.mjs.map +0 -1
  200. package/dist/sniffer-Dq5BS98f.cjs.map +0 -1
  201. package/dist/stages-BI8JvPzI.cjs.map +0 -1
  202. package/dist/stages-DY-fQKmo.mjs.map +0 -1
  203. package/dist/types-B3Gqs175.d.mts.map +0 -1
  204. package/dist/types-Bk9st2cd.d.cts.map +0 -1
  205. package/dist/workspace-Bzw7Zs82.mjs.map +0 -1
  206. package/dist/workspace-CHOB2Xg3.cjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  import { n as __require, t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
3
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, t as MissingCredential, u as getDokployCredentials, v as storeGoDaddyToken, y as storeHostingerToken } from "./credentials-C4KII3PD.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-DpfnUvIR.mjs";
5
5
  import { l as withOwningTsconfigJsx, r as discover, u as ConstructGenerator } from "./discover-qjFapetL.mjs";
6
6
  import { t as appKey } from "./derive-B4vDpzgP.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
+ 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-DWK1PTXP.mjs";
8
8
  import { ConfigNotFound, NotABackendApp, NotInAnApp, loadAppConfig, loadConfig, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig } from "./config.mjs";
9
- 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-CvGQJnPO.mjs";
9
+ import { Bn as prepareEntryCredentials, Cn as scopeTelemetryEnv, Ct as derivedContainers, Fn as findAvailablePort, Gn as FileSecretsStore, Gt as quoteIdentifier, Hn as secretsStoreFor, In as isPortAvailable, Jn as projectKey, Kn as getKeyPath, Ln as loadEnvFiles, Lt as LOCAL_CA_PATH, Mn as primaryPortKey, Nn as createCredentialsPreload, On as describeServices, Pn as createEntryWrapper, Rn as loadPortState, Rt as forgetState, St as constructGlobs, Tn as telemetryOf, Ut as postgresDatabaseNames, Yt as pgClient, Zn as deployIdentity, _ as describeActor, _n as TELEMETRY_CONTAINER, _t as workerEntryDir, ar as maskPassword, bt as FAKE_ENV, c as dockerCommand, cn as imageBuildCredentials, cr as withCustomSecret, dn as eventsBackendFor, fn as providerOf, gt as workerBundleName, ht as WorkerGenerator, jn as portsOf, kn as fakeKey, kt as readLocalCredentials, ln as isImageBuild, lr as LOCAL_LOGS_EMAIL, m as dnsResources, mn as CLUSTER_DATABASE, mt as workerUnits, sr as toEmbeddableSecrets, un as cacheBackendFor, vt as QueueGenerator, w as assertDevServicesFlag, wn as surfaceClientTraced, wt as reconcileWorkspace, xn as appTelemetry, xt as backendsOf$1, yt as CronGenerator, zn as loadSecretsForApp } from "./seeds-CTxTZa-R.mjs";
10
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";
11
11
  import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
12
12
  import { s as isCacheBackend, t as SubscriberGenerator } from "./SubscriberGenerator-CyN2VF5X.mjs";
13
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";
14
14
  import { n as driversFor, r as eventsBackendsIn, t as cacheBackendsIn } from "./drivers-CTaWrA_L.mjs";
15
15
  import { n as withCompute, r as withRoutes, t as manifestModule } from "./emit-C1e8qD08.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-yuJHlkY0.mjs";
19
- 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-CTdVeeVk.mjs";
16
+ import { t as LocalSandbox } from "./local-B7Zv1NoA.mjs";
17
+ import { T as keyFingerprint, n as sniffAppEnvironment, o as DokployApi, y as createStateStore } from "./sniffer-DCcuzHz_.mjs";
18
+ import { t as deploy$1 } from "./deploy-CeJ5D0xn.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-D2RFYd_f.mjs";
20
+ import { d as parseDigests, h as EDGE_PROJECT, i as composeProject, p as pinnedRef, s as stackDir } from "./stack-NrdH5ngX.mjs";
20
21
  import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-BJFvfkaz.mjs";
21
- import { t as LocalStateStore } from "./LocalStateStore-Y8XHdoCR.mjs";
22
+ import { t as LocalStateStore } from "./LocalStateStore-BSaS2535.mjs";
22
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";
23
- import "./awsStore-BWa1KNY-.mjs";
24
24
  import { a as writeTestHarness, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, t as TEST_READY_ENV } from "./ready-naOSJpeJ.mjs";
25
25
  import { createRequire } from "node:module";
26
26
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -49,7 +49,7 @@ import crypto from "crypto";
49
49
  import { Function } from "@geekmidas/constructs/functions";
50
50
  import { Topic } from "@geekmidas/constructs/topic";
51
51
  //#region package.json
52
- var version = "10.0.0-alpha.92";
52
+ var version = "10.0.0-alpha.94";
53
53
  //#endregion
54
54
  //#region src/prompt.ts
55
55
  /**
@@ -132,7 +132,7 @@ const logger$8 = console;
132
132
  * Validate Dokploy token by making a test API call
133
133
  */
134
134
  async function validateDokployToken(endpoint, token) {
135
- const { DokployApi } = await import("./sniffer-BTtGAtm3.mjs").then((n) => n.c);
135
+ const { DokployApi } = await import("./sniffer-DCcuzHz_.mjs").then((n) => n.c);
136
136
  return new DokployApi({
137
137
  baseUrl: endpoint,
138
138
  token
@@ -208,7 +208,7 @@ async function loginCommand(options) {
208
208
  * Store a GoDaddy Personal Access Token. Not validated: the only call that
209
209
  * proves a token without a domain is an account call (`GET /v1/domains`),
210
210
  * which a token scoped to `domains.dns:update` alone may not make — the first
211
- * `gkm setup` that writes a record is where a bad token reports itself.
211
+ * deploy that writes a record is where a bad token reports itself.
212
212
  */
213
213
  async function loginGoDaddy(options) {
214
214
  logger$8.log("\n🔐 Logging in to GoDaddy...\n");
@@ -229,7 +229,7 @@ async function loginGoDaddy(options) {
229
229
  logger$8.log("\n✓ GoDaddy token stored.");
230
230
  logger$8.log(` Token: ${maskToken(token)}`);
231
231
  logger$8.log(` Credentials stored in: ${getCredentialsPath(where)}`);
232
- logger$8.log(" Not validated here: proving a token without a domain needs an account\n scope a DNS-only token does not have, so the first gkm setup that\n writes a record is where a bad token reports itself.");
232
+ logger$8.log(" Not validated here: proving a token without a domain needs an account\n scope a DNS-only token does not have, so the first deploy that\n writes a record is where a bad token reports itself.");
233
233
  logger$8.log("\nYou can now use it as a DNS provider without setting GODADDY_API_TOKEN.");
234
234
  }
235
235
  /**
@@ -2326,9 +2326,9 @@ async function workspaceDevCommand(configured, options) {
2326
2326
  for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
2327
2327
  logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
2328
2328
  if (options.migrate || options.seed) {
2329
- const { prepareDevDatabases } = await import("./migrate-BSbZ7-9n.mjs");
2329
+ const { prepareDevDatabases } = await import("./migrate-DhvFPGLi.mjs");
2330
2330
  await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
2331
- } else await import("./migrate-BSbZ7-9n.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2331
+ } else await import("./migrate-DhvFPGLi.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2332
2332
  logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
2333
2333
  });
2334
2334
  const appUrls = {};
@@ -3381,7 +3381,7 @@ async function buildApp(input) {
3381
3381
  ...production,
3382
3382
  ...telemetry ? { telemetry } : {}
3383
3383
  });
3384
- const { bundleServer } = await import("./bundler-C-AdesaG.mjs");
3384
+ const { bundleServer } = await import("./bundler-BSHog8CH.mjs");
3385
3385
  await bundleServer({
3386
3386
  entryPoint,
3387
3387
  outputDir: join(outputDir, "dist"),
@@ -3526,7 +3526,7 @@ async function buildWorkers(input) {
3526
3526
  });
3527
3527
  logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
3528
3528
  if (!input.bundle) continue;
3529
- const { bundleServer } = await import("./bundler-C-AdesaG.mjs");
3529
+ const { bundleServer } = await import("./bundler-BSHog8CH.mjs");
3530
3530
  const outfile = workerBundleName(worker.id);
3531
3531
  await bundleServer({
3532
3532
  entryPoint,
@@ -3612,7 +3612,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
3612
3612
  let masterKey;
3613
3613
  if (context.production?.bundle && !skipBundle) {
3614
3614
  logger$4.log(`\n📦 Bundling production server...`);
3615
- const { bundleServer } = await import("./bundler-C-AdesaG.mjs");
3615
+ const { bundleServer } = await import("./bundler-BSHog8CH.mjs");
3616
3616
  const allConstructs = [
3617
3617
  ...endpoints.map((e) => e.construct),
3618
3618
  ...functions.map((f) => f.construct),
@@ -3906,7 +3906,11 @@ async function composeCommand(options, deps = {}) {
3906
3906
  ...options.dryRun ? { dryRun: true } : {},
3907
3907
  ...options.push ? { buildOnly: true } : {},
3908
3908
  ...options.allowDevServices ? { allowDevServices: true } : {},
3909
- ...options.skipDnsCheck ? { skipDnsCheck: true } : {},
3909
+ ...options.skipDns ? { skipDns: true } : {},
3910
+ ...options.resourcesOnly ? { resourcesOnly: true } : {},
3911
+ ...options.skipResources ? { skipResources: true } : {},
3912
+ ...options.rotateKeys ? { rotateKeys: true } : {},
3913
+ ...options.retireOldKeys ? { retireOldKeys: true } : {},
3910
3914
  logger: {
3911
3915
  info: (message) => console.log(message),
3912
3916
  warn: (message) => console.warn(message),
@@ -4133,6 +4137,7 @@ const MASKED = "********";
4133
4137
  */
4134
4138
  function maskStateSecrets(state) {
4135
4139
  const masked = structuredClone(state);
4140
+ if (masked.provider !== "dokploy") return masked;
4136
4141
  for (const credentials of Object.values(masked.appCredentials ?? {})) credentials.dbPassword = MASKED;
4137
4142
  for (const secrets of Object.values(masked.generatedSecrets ?? {})) for (const name of Object.keys(secrets)) secrets[name] = MASKED;
4138
4143
  if (masked.backups) {
@@ -4188,6 +4193,7 @@ async function stateShowCommand(options) {
4188
4193
  if (options.json) console.log(JSON.stringify(state, null, 2));
4189
4194
  else {
4190
4195
  printStateDetails(state);
4196
+ printDnsRecords(stored.resources);
4191
4197
  printUnfinished(stored.resources);
4192
4198
  }
4193
4199
  }
@@ -4232,8 +4238,8 @@ async function stateDiffCommand(options) {
4232
4238
  if (!remote) console.log("Remote: (none)");
4233
4239
  else console.log(`Remote: Last deployed ${remote.lastDeployedAt}`);
4234
4240
  console.log("");
4235
- const localApps = local?.applications ?? {};
4236
- const remoteApps = remote?.applications ?? {};
4241
+ const localApps = dokploy(local)?.applications ?? {};
4242
+ const remoteApps = dokploy(remote)?.applications ?? {};
4237
4243
  const allApps = /* @__PURE__ */ new Set([...Object.keys(localApps), ...Object.keys(remoteApps)]);
4238
4244
  if (allApps.size > 0) {
4239
4245
  console.log("Applications:");
@@ -4246,8 +4252,8 @@ async function stateDiffCommand(options) {
4246
4252
  else console.log(` ${app}: ${localId} (local) != ${remoteId} (remote) [MISMATCH]`);
4247
4253
  }
4248
4254
  }
4249
- const localServices = local?.services ?? {};
4250
- const remoteServices = remote?.services ?? {};
4255
+ const localServices = dokploy(local)?.services ?? {};
4256
+ const remoteServices = dokploy(remote)?.services ?? {};
4251
4257
  if (Object.keys(localServices).length > 0 || Object.keys(remoteServices).length > 0) {
4252
4258
  console.log("\nServices:");
4253
4259
  const serviceKeys = /* @__PURE__ */ new Set([...Object.keys(localServices), ...Object.keys(remoteServices)]);
@@ -4312,6 +4318,10 @@ async function copyStage(from, to, stage) {
4312
4318
  for (const { updatedAt: _stamped, ...record } of Object.values(source.resources)) version = await to.putResource(stage, record, { expectedVersion: version });
4313
4319
  return source;
4314
4320
  }
4321
+ /** `state` if Dokploy wrote it — the only shape with ids of its own. */
4322
+ function dokploy(state) {
4323
+ return state?.provider === "dokploy" ? state : null;
4324
+ }
4315
4325
  function describeRecord(record) {
4316
4326
  if (!record) return "(none)";
4317
4327
  return record.id ? `${record.status} ${record.id}` : record.status;
@@ -4325,6 +4335,12 @@ function printUnfinished(resources) {
4325
4335
  for (const record of pending) console.log(` ${record.key}`);
4326
4336
  }
4327
4337
  function printStateSummary(state) {
4338
+ if (state.provider !== "dokploy") {
4339
+ console.log(` Stage: ${state.stage} (${state.provider})`);
4340
+ console.log(` Apps released: ${Object.keys(state.releases ?? {}).length}`);
4341
+ console.log(` Last deployed: ${state.lastDeployedAt}`);
4342
+ return;
4343
+ }
4328
4344
  const appCount = Object.keys(state.applications).length;
4329
4345
  const hasPostgres = !!state.services.postgresId;
4330
4346
  const hasRedis = !!state.services.redisId;
@@ -4335,6 +4351,14 @@ function printStateSummary(state) {
4335
4351
  console.log(` Last deployed: ${state.lastDeployedAt}`);
4336
4352
  }
4337
4353
  function printStateDetails(state) {
4354
+ if (state.provider !== "dokploy") {
4355
+ console.log(`Stage: ${state.stage} (${state.provider})`);
4356
+ console.log(`Last Deployed: ${state.lastDeployedAt}`);
4357
+ if (state.identity) console.log(`Identity: ${state.identity}`);
4358
+ console.log("");
4359
+ printReleases(state.releases);
4360
+ return;
4361
+ }
4338
4362
  console.log(`Stage: ${state.stage}`);
4339
4363
  console.log(`Environment ID: ${state.environmentId}`);
4340
4364
  console.log(`Last Deployed: ${state.lastDeployedAt}`);
@@ -4376,6 +4400,62 @@ function printStateDetails(state) {
4376
4400
  for (const [hostname, info] of Object.entries(state.dnsVerified)) console.log(` ${hostname}: ${info.serverIp} (${info.verifiedAt})`);
4377
4401
  }
4378
4402
  }
4403
+ /** Each app's current release, and who released it. */
4404
+ function printReleases(releases) {
4405
+ console.log("Releases:");
4406
+ const apps = Object.entries(releases ?? {});
4407
+ if (apps.length === 0) {
4408
+ console.log(" (none)");
4409
+ return;
4410
+ }
4411
+ for (const [app, { current }] of apps) console.log(` ${app}: ${describeRelease(current)}`);
4412
+ }
4413
+ /** `ghcr.io/acme/api:v2 (sha256:…) · 2026-… · ada@laptop` */
4414
+ function describeRelease(release) {
4415
+ return [
4416
+ `${release.ref}${release.digest ? ` (${release.digest})` : ""}`,
4417
+ release.releasedAt,
4418
+ describeActor(release.releasedBy)
4419
+ ].join(" · ");
4420
+ }
4421
+ /** The DNS records gkm wrote for the stage. */
4422
+ function printDnsRecords(resources) {
4423
+ const records = dnsResources(resources);
4424
+ if (records.length === 0) return;
4425
+ console.log("");
4426
+ console.log("DNS Records:");
4427
+ for (const record of records) console.log(` ${record.fqdn} ${record.type} ${record.value} (TTL ${record.ttl}${record.provider ? `, ${record.provider}` : ""})`);
4428
+ }
4429
+ /**
4430
+ * Who wrote a stage's state, newest first, and what each app runs.
4431
+ * `gkm state:history --stage=<stage>`
4432
+ */
4433
+ async function stateHistoryCommand(options) {
4434
+ const { workspace } = await loadWorkspaceConfig();
4435
+ const stored = await (await createStateStore({
4436
+ config: workspace.state,
4437
+ workspaceRoot: workspace.root,
4438
+ workspaceName: workspace.name
4439
+ })).read(options.stage);
4440
+ if (!stored) {
4441
+ console.log(`No state found for stage: ${options.stage}`);
4442
+ return;
4443
+ }
4444
+ const history = {
4445
+ stage: options.stage,
4446
+ history: stored.history,
4447
+ releases: Object.fromEntries(Object.entries(stored.state.releases ?? {}).map(([app, releases]) => [app, releases.current]))
4448
+ };
4449
+ if (options.json) {
4450
+ console.log(JSON.stringify(history, null, 2));
4451
+ return;
4452
+ }
4453
+ console.log(`History of stage ${options.stage} (newest first):`);
4454
+ if (history.history.length === 0) console.log(" (none recorded)");
4455
+ for (const entry of history.history) console.log(` ${entry.serial} · ${entry.at} · ${describeActor(entry.by)} · ${entry.operation}`);
4456
+ console.log("");
4457
+ printReleases(stored.state.releases);
4458
+ }
4379
4459
  //#endregion
4380
4460
  //#region src/secrets/generator.ts
4381
4461
  /**
@@ -5347,25 +5427,25 @@ function loadPackageJson() {
5347
5427
  * Run: pnpm --filter @geekmidas/cli sync-versions
5348
5428
  */
5349
5429
  const GEEKMIDAS_VERSIONS = {
5350
- "@geekmidas/audit": "~10.0.0-alpha.92",
5351
- "@geekmidas/auth": "~10.0.0-alpha.92",
5352
- "@geekmidas/cache": "~10.0.0-alpha.92",
5353
- "@geekmidas/client": "~10.0.0-alpha.92",
5354
- "@geekmidas/cloud": "~10.0.0-alpha.92",
5355
- "@geekmidas/constructs": "~10.0.0-alpha.92",
5356
- "@geekmidas/db": "~10.0.0-alpha.92",
5357
- "@geekmidas/emailkit": "~10.0.0-alpha.92",
5358
- "@geekmidas/envkit": "~10.0.0-alpha.92",
5359
- "@geekmidas/errors": "~10.0.0-alpha.92",
5360
- "@geekmidas/events": "~10.0.0-alpha.92",
5361
- "@geekmidas/logger": "~10.0.0-alpha.92",
5362
- "@geekmidas/manifest": "~10.0.0-alpha.92",
5363
- "@geekmidas/rate-limit": "~10.0.0-alpha.92",
5364
- "@geekmidas/schema": "~10.0.0-alpha.92",
5365
- "@geekmidas/services": "~10.0.0-alpha.92",
5366
- "@geekmidas/storage": "~10.0.0-alpha.92",
5367
- "@geekmidas/telescope": "~10.0.0-alpha.92",
5368
- "@geekmidas/testkit": "~10.0.0-alpha.92",
5430
+ "@geekmidas/audit": "~10.0.0-alpha.94",
5431
+ "@geekmidas/auth": "~10.0.0-alpha.94",
5432
+ "@geekmidas/cache": "~10.0.0-alpha.94",
5433
+ "@geekmidas/client": "~10.0.0-alpha.94",
5434
+ "@geekmidas/cloud": "~10.0.0-alpha.94",
5435
+ "@geekmidas/constructs": "~10.0.0-alpha.94",
5436
+ "@geekmidas/db": "~10.0.0-alpha.94",
5437
+ "@geekmidas/emailkit": "~10.0.0-alpha.94",
5438
+ "@geekmidas/envkit": "~10.0.0-alpha.94",
5439
+ "@geekmidas/errors": "~10.0.0-alpha.94",
5440
+ "@geekmidas/events": "~10.0.0-alpha.94",
5441
+ "@geekmidas/logger": "~10.0.0-alpha.94",
5442
+ "@geekmidas/manifest": "~10.0.0-alpha.94",
5443
+ "@geekmidas/rate-limit": "~10.0.0-alpha.94",
5444
+ "@geekmidas/schema": "~10.0.0-alpha.94",
5445
+ "@geekmidas/services": "~10.0.0-alpha.94",
5446
+ "@geekmidas/storage": "~10.0.0-alpha.94",
5447
+ "@geekmidas/telescope": "~10.0.0-alpha.94",
5448
+ "@geekmidas/testkit": "~10.0.0-alpha.94",
5369
5449
  "@geekmidas/cli": `~${loadPackageJson().version}`
5370
5450
  };
5371
5451
  //#endregion
@@ -5766,7 +5846,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
5766
5846
  * The `uses:` value for the stages action, with a comment saying which CLI
5767
5847
  * release the pinned commit is.
5768
5848
  */
5769
- function stagesActionUses(commit = "446c06603533dd304ee5655661784b7a4f07e2b7", version = cliVersion()) {
5849
+ function stagesActionUses(commit = "dcab6fe1ee033518c7901452ee9c49102749c9ed", version = cliVersion()) {
5770
5850
  return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
5771
5851
  }
5772
5852
  //#endregion
@@ -6018,6 +6098,7 @@ function stagesJob(options) {
6018
6098
  has-build: \${{ steps.stages.outputs.has-build }}
6019
6099
  has-deploy: \${{ steps.stages.outputs.has-deploy }}
6020
6100
  aws-region: \${{ steps.stages.outputs.aws-region }}
6101
+ resources: \${{ steps.stages.outputs.resources }}
6021
6102
  steps:
6022
6103
  - uses: actions/checkout@v4
6023
6104
 
@@ -6035,6 +6116,10 @@ ${pm.setup}
6035
6116
  stage: \${{ inputs.stage }}
6036
6117
  `;
6037
6118
  }
6119
+ /** Every step in `steps` run only when `condition` holds. */
6120
+ function onlyIf(steps, condition) {
6121
+ return steps.replace(/^ {6}- /gm, ` - if: ${condition}\n `);
6122
+ }
6038
6123
  /**
6039
6124
  * The registry login a compose build pushes with: GitHub's own token on
6040
6125
  * ghcr.io, otherwise a username variable and a password secret.
@@ -6059,6 +6144,11 @@ function registryLogin(registry) {
6059
6144
  * `ref` — then that commit's push build, whose digests pin each image. Over
6060
6145
  * SSH, with a pinned host key, the server checks the commit out and runs
6061
6146
  * `gkm compose` on exactly those images.
6147
+ * - Resources: where the stage has some the deploy creates — a provider's
6148
+ * bucket and key, DNS records through a provider — the runner creates them
6149
+ * first (`gkm deploy --resources-only`) with the stage's role and the DNS
6150
+ * token from its environment, and the server deploys with
6151
+ * `--skip-resources`: neither credential reaches the server.
6062
6152
  */
6063
6153
  function composeDeploy(options) {
6064
6154
  const pm = tooling(options);
@@ -6134,6 +6224,13 @@ ${registryLogin(registry)}
6134
6224
  permissions:
6135
6225
  contents: read
6136
6226
  actions: read
6227
+ id-token: write
6228
+ env:
6229
+ # Whether the stage has resources the deploy creates — a provider's
6230
+ # bucket and key (deploy.<kind>.<stage>), DNS records through a provider
6231
+ # in dns: the runner creates them with the stage's role and DNS token,
6232
+ # so neither reaches the server, which deploys with --skip-resources.
6233
+ RESOURCES_ON_RUNNER: \${{ contains(fromJSON(needs.stages.outputs.resources || '[]'), matrix.stage) }}
6137
6234
  steps:
6138
6235
  # A release deploys its tag's commit, never its target_commitish — the
6139
6236
  # branch it was drafted against, which has moved on since.
@@ -6156,6 +6253,40 @@ ${registryLogin(registry)}
6156
6253
  REF: \${{ inputs.ref }}
6157
6254
  SHA: \${{ github.sha }}
6158
6255
 
6256
+ # The deploy's resources, here on the runner: each provider's bucket
6257
+ # and key (written into the stage's secrets store), and every public
6258
+ # host's DNS record — a new app's included, one per host, never a
6259
+ # wildcard — written through the provider where it is missing or out of
6260
+ # date and read back from it. The stage's secrets (GKM_SERVER_IPV4
6261
+ # among them) are read with the stage's role; the DNS token is a secret
6262
+ # on this stage's environment. A missing credential fails here, before
6263
+ # anything is deployed.
6264
+ - name: Check out the commit
6265
+ if: env.RESOURCES_ON_RUNNER == 'true'
6266
+ uses: actions/checkout@v4
6267
+ with:
6268
+ ref: \${{ steps.commit.outputs.sha }}
6269
+
6270
+ ${onlyIf(pm.setup, "env.RESOURCES_ON_RUNNER == 'true'")}
6271
+ - name: Install
6272
+ if: env.RESOURCES_ON_RUNNER == 'true'
6273
+ run: ${pm.install}
6274
+
6275
+ - name: Assume the stage's AWS role
6276
+ if: env.RESOURCES_ON_RUNNER == 'true' && needs.stages.outputs.aws-region != ''
6277
+ uses: aws-actions/configure-aws-credentials@v4
6278
+ with:
6279
+ role-to-assume: \${{ vars.AWS_ROLE_ARN }}
6280
+ aws-region: \${{ needs.stages.outputs.aws-region }}
6281
+
6282
+ - name: Create the stage's resources
6283
+ if: env.RESOURCES_ON_RUNNER == 'true'
6284
+ run: ${pm.exec} gkm deploy --stage "$STAGE" --resources-only
6285
+ env:
6286
+ STAGE: \${{ matrix.stage }}
6287
+ GODADDY_API_TOKEN: \${{ secrets.GODADDY_API_TOKEN }}
6288
+ HOSTINGER_API_TOKEN: \${{ secrets.HOSTINGER_API_TOKEN }}
6289
+
6159
6290
  # The push run of this workflow that built the commit for this stage:
6160
6291
  # this run on a push, the newest one with the stage's digests otherwise.
6161
6292
  - name: Find the commit's push build
@@ -6217,9 +6348,9 @@ ${registryLogin(registry)}
6217
6348
  if [ -f digests.json ]; then digests=$(base64 -w0 < digests.json); fi
6218
6349
  ssh -i ~/.ssh/deploy_key -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes \\
6219
6350
  "$DEPLOY_USER@$DEPLOY_HOST" \\
6220
- "bash -s -- $(printf '%q ' "$STAGE" "$SHA" "$DEPLOY_PATH" "$digests")" <<'REMOTE'
6351
+ "bash -s -- $(printf '%q ' "$STAGE" "$SHA" "$DEPLOY_PATH" "$digests" "$RESOURCES_ON_RUNNER")" <<'REMOTE'
6221
6352
  set -euo pipefail
6222
- stage=$1 sha=$2 dir=$3 digests=$4
6353
+ stage=$1 sha=$2 dir=$3 digests=$4 resources_on_runner=$5
6223
6354
  cd "$dir"
6224
6355
  git fetch --quiet origin
6225
6356
  git checkout --quiet --detach "$sha"
@@ -6230,6 +6361,8 @@ ${registryLogin(registry)}
6230
6361
  printf '%s' "$digests" | base64 -d > ".gkm/digests-$stage.json"
6231
6362
  args+=(--digests-file ".gkm/digests-$stage.json")
6232
6363
  fi
6364
+ # Created and confirmed from the runner already.
6365
+ if [ "$resources_on_runner" = true ]; then args+=(--skip-resources); fi
6233
6366
  ${pm.exec} gkm compose "\${args[@]}"
6234
6367
  REMOTE
6235
6368
  env:
@@ -6278,7 +6411,9 @@ function targetDeploy(options) {
6278
6411
  `;
6279
6412
  const deployEnv = sst ? "" : `
6280
6413
  DOKPLOY_API_TOKEN: \${{ secrets.DOKPLOY_API_TOKEN }}
6281
- DOKPLOY_ENDPOINT: \${{ vars.DOKPLOY_ENDPOINT }}`;
6414
+ DOKPLOY_ENDPOINT: \${{ vars.DOKPLOY_ENDPOINT }}
6415
+ GODADDY_API_TOKEN: \${{ secrets.GODADDY_API_TOKEN }}
6416
+ HOSTINGER_API_TOKEN: \${{ secrets.HOSTINGER_API_TOKEN }}`;
6282
6417
  return `${deployHeader(false)}
6283
6418
  jobs:
6284
6419
  ${stagesJob(options)}
@@ -11048,137 +11183,9 @@ function maskUrl(url) {
11048
11183
  }
11049
11184
  }
11050
11185
  //#endregion
11051
- //#region src/providers/dns.ts
11052
- /** Whether the workspace deploys through the compose target. */
11053
- function deploysWithCompose(workspace) {
11054
- return workspace.deploy?.default === "compose" || Object.values(workspace.apps).some((app) => app.resolvedDeployTarget === "compose");
11055
- }
11056
- /**
11057
- * A compose stage that serves a domain has its server's address in its
11058
- * secrets — checked before `gkm setup --stage` does anything else.
11059
- *
11060
- * @throws {ServerAddressMissing} for a compose stage with a domain and none
11061
- * @throws {ServerAddressInvalid} for a value that is not an address
11062
- */
11063
- function assertStageServer(workspace, stage, secrets) {
11064
- if (stage === workspace.stages.local) return void 0;
11065
- if (!deploysWithCompose(workspace)) return serverAddress(stage, secrets?.custom);
11066
- return requiredServerAddress(stage, workspace.domains?.[stage], secrets?.custom);
11067
- }
11068
- /**
11069
- * The hosts a compose stage serves: its stack composed as a deploy would —
11070
- * with the secrets it would generate made up in memory, never written — and
11071
- * every route's host read off it.
11072
- */
11073
- async function composeStageHosts(options) {
11074
- const { workspace, stage } = options;
11075
- const runnables = options.runnables ?? {};
11076
- const background = options.background ?? {};
11077
- const manifest = options.manifest ?? await discover({
11078
- patterns: constructGlobs(workspace),
11079
- cwd: workspace.root,
11080
- runnables,
11081
- background
11082
- });
11083
- const stored = await (await secretsStoreFor(workspace, stage, {
11084
- ...options.profile ? { profile: options.profile } : {},
11085
- ...options.home ? { home: options.home } : {}
11086
- })).read(stage);
11087
- const { deployedStackSecrets } = await import("./compose-CTdVeeVk.mjs").then((n) => n.l);
11088
- const { composeStack } = await import("./compose-CTdVeeVk.mjs").then((n) => n.c);
11089
- const { secrets } = deployedStackSecrets(workspace, stage, stored, manifest);
11090
- const stack = composeStack({
11091
- workspace,
11092
- manifest,
11093
- runnables,
11094
- background,
11095
- stage,
11096
- identity: deployIdentity(workspace, stage),
11097
- images: {
11098
- mode: "pull",
11099
- tag: "dns",
11100
- ...workspace.deploy?.registry ? { registry: workspace.deploy.registry } : {}
11101
- },
11102
- secrets,
11103
- buildOnly: true,
11104
- allowDevServices: true
11105
- });
11106
- return stackHosts(stack);
11107
- }
11108
- /**
11109
- * `GKM_SERVER_IPV4` from the stage's secrets and `dns`: each public host's
11110
- * records, created or corrected. A dry run reads and prints, and writes
11111
- * nothing.
11112
- */
11113
- async function provisionStageDns(options) {
11114
- const { workspace, stage } = options;
11115
- const log = options.log ?? ((line) => console.log(line));
11116
- if (stage === workspace.stages.local || !workspace.dns || !deploysWithCompose(workspace)) return {
11117
- mode: "none",
11118
- hosts: [],
11119
- changes: []
11120
- };
11121
- const store = await secretsStoreFor(workspace, stage, {
11122
- ...options.profile ? { profile: options.profile } : {},
11123
- ...options.home ? { home: options.home } : {}
11124
- });
11125
- const server = serverAddress(stage, (await store.read(stage))?.custom);
11126
- if (!server) {
11127
- log(`\n🌐 DNS for '${stage}': no GKM_SERVER_IPV4 in its secrets, so no records — ${serverAddressHint(stage)}`);
11128
- return {
11129
- mode: "none",
11130
- hosts: [],
11131
- changes: []
11132
- };
11133
- }
11134
- const hosts = [...options.hosts ?? await composeStageHosts({
11135
- workspace,
11136
- stage,
11137
- ...options.profile ? { profile: options.profile } : {},
11138
- ...options.home ? { home: options.home } : {},
11139
- ...options.manifest ? { manifest: options.manifest } : {},
11140
- ...options.runnables ? { runnables: options.runnables } : {},
11141
- ...options.background ? { background: options.background } : {}
11142
- })];
11143
- log(`\n🌐 DNS for '${stage}' → ${server.ipv4}${server.ipv6 ? ` / ${server.ipv6}` : ""}${options.dryRun ? " (dry run — nothing is written)" : ""}`);
11144
- const plan = planStackDns({
11145
- stage,
11146
- hosts,
11147
- server,
11148
- dns: workspace.dns
11149
- });
11150
- try {
11151
- return {
11152
- mode: "records",
11153
- hosts,
11154
- changes: await applyStackDns(plan, {
11155
- ...options.dryRun ? { dryRun: true } : {},
11156
- log,
11157
- credentials: {
11158
- env: options.env ?? process.env,
11159
- ...options.home ? { home: options.home } : {},
11160
- log
11161
- },
11162
- ...options.providerFor ? { providerFor: options.providerFor } : {}
11163
- })
11164
- };
11165
- } catch (error) {
11166
- if (error instanceof MissingCredential) {
11167
- log(` ⚠ ${error.message}`);
11168
- log(" Until then, create these records yourself:");
11169
- 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})`);
11170
- return {
11171
- mode: "records",
11172
- hosts,
11173
- changes: []
11174
- };
11175
- }
11176
- throw error;
11177
- }
11178
- }
11179
- //#endregion
11180
11186
  //#region src/setup/index.ts
11181
11187
  var setup_exports = /* @__PURE__ */ __exportAll({
11188
+ SetupIsLocal: () => SetupIsLocal,
11182
11189
  createFreshWorkspaceSecrets: () => createFreshWorkspaceSecrets,
11183
11190
  ensureStageSecrets: () => ensureStageSecrets,
11184
11191
  reconcileSecrets: () => reconcileSecrets,
@@ -11186,14 +11193,21 @@ var setup_exports = /* @__PURE__ */ __exportAll({
11186
11193
  });
11187
11194
  const logger$1 = console;
11188
11195
  /**
11189
- * Converge a stage on what its constructs declare.
11190
- *
11191
- * The local stage: its secrets (local → the stage's store → generated) and
11192
- * the containers on this machine. A deployed stage: its secrets, and then
11193
- * every provider `deploy.<kind>.<stage>` names — the bucket, user and key an
11194
- * `objects: { provider: 's3' }` stage is backed by — created or repaired in
11195
- * the stage's own account. A deployed stage's infrastructure is not on this
11196
- * machine, so no container is started for one.
11196
+ * `gkm setup --stage <deployed stage>`: setup is this machine's, done once,
11197
+ * and creates nothing for a deployed stage — the deploy does.
11198
+ */
11199
+ var SetupIsLocal = class extends GkmError {
11200
+ stage;
11201
+ constructor(stage) {
11202
+ super(`gkm setup sets up this machine — its secrets and its containers — and '${stage}' is a deployed stage: nothing of it is set up from here. The deploy creates what '${stage}' needs — its buckets and keys, its DNS records — every time it runs: gkm deploy --stage ${stage} (gkm compose --stage ${stage} is the same deploy). Its --dry-run prints what it would create.`);
11203
+ this.stage = stage;
11204
+ this.name = "SetupIsLocal";
11205
+ }
11206
+ };
11207
+ /**
11208
+ * Set this machine up for the workspace, once: the local stage's secrets
11209
+ * (local → the stage's store → generated) and its containers. A deployed
11210
+ * stage is refused with {@link SetupIsLocal}: its resources are the deploy's.
11197
11211
  */
11198
11212
  async function setupCommand(options = {}) {
11199
11213
  let loadedConfig;
@@ -11205,24 +11219,15 @@ async function setupCommand(options = {}) {
11205
11219
  }
11206
11220
  const stage = options.stage ?? loadedConfig.workspace.stages.local;
11207
11221
  const { workspace } = loadedConfig;
11208
- const local = stage === workspace.stages.local;
11209
- logger$1.log(local ? "\n🔧 Setting up the local environment...\n" : `\n☁️ Provisioning the '${stage}' stage${options.dryRun ? " (dry run)" : ""}...\n`);
11222
+ if (workspace.stages.deployed.includes(stage)) throw new SetupIsLocal(stage);
11223
+ logger$1.log("\n🔧 Setting up the local environment...\n");
11210
11224
  logger$1.log(`📦 Workspace: ${workspace.name}`);
11211
11225
  logger$1.log(`📱 Apps: ${Object.keys(workspace.apps).join(", ")}`);
11212
11226
  logger$1.log(`🔑 Stage: ${stage}\n`);
11213
- if (!local) assertStageServer(workspace, stage, await (await secretsStoreFor(workspace, stage, { ...options.profile ? { profile: options.profile } : {} })).read(stage));
11214
- if (!local && options.dryRun) {
11215
- await provisionDeployed(workspace, stage, options);
11216
- return;
11217
- }
11218
11227
  if (!await resolveSecrets(stage, workspace, options)) {
11219
11228
  logger$1.error("❌ Failed to resolve secrets. Exiting.");
11220
11229
  process.exit(1);
11221
11230
  }
11222
- if (!local) {
11223
- await provisionDeployed(workspace, stage, options);
11224
- return;
11225
- }
11226
11231
  if (!options.skipDocker) {
11227
11232
  logger$1.log("");
11228
11233
  await reconcileLocal(workspace, stage, options);
@@ -11230,33 +11235,6 @@ async function setupCommand(options = {}) {
11230
11235
  printSummary(workspace, stage);
11231
11236
  }
11232
11237
  /**
11233
- * A deployed stage's providers: each one's `ensure()`, in the stage's own
11234
- * account, its keys written into the stage's secrets.
11235
- */
11236
- async function provisionDeployed(workspace, stage, options) {
11237
- logger$1.log(options.dryRun ? `\n☁️ Providers for '${stage}' (dry run — nothing is created or written)` : `\n☁️ Providers for '${stage}'`);
11238
- const configured = (await provisionStage({
11239
- workspace,
11240
- stage,
11241
- ...options.dryRun ? { dryRun: true } : {},
11242
- ...options.profile ? { profile: options.profile } : {},
11243
- ...options.rotateKeys ? { rotateKeys: true } : {},
11244
- ...options.retireOldKeys ? { retireOldKeys: true } : {},
11245
- log: (line) => logger$1.log(line)
11246
- })).filter((r) => r.mode === "provider");
11247
- if (configured.length === 0) logger$1.log(` None configured: '${stage}' takes every key from its secrets (gkm secrets:add --stage ${stage}). Name one in gkm.config.ts — deploy: { objects: { ${stage}: { provider: 's3' } } } — to have ${provisionCommand(stage)} create it.`);
11248
- const dns = await provisionStageDns({
11249
- workspace,
11250
- stage,
11251
- ...options.dryRun ? { dryRun: true } : {},
11252
- ...options.profile ? { profile: options.profile } : {},
11253
- log: (line) => logger$1.log(line)
11254
- });
11255
- const changes = configured.reduce((n, r) => n + r.actions.length, 0) + dns.changes.filter((c) => c.action !== "unchanged" && c.action !== "manual").length;
11256
- if (configured.length === 0 && dns.mode === "none") return;
11257
- logger$1.log(options.dryRun ? `\n${changes === 0 ? "✅ Nothing to change" : `📋 ${changes} change${changes === 1 ? "" : "s"} planned`}` : `\n✅ '${stage}' provisioned${changes === 0 ? " — already up to date" : ` (${changes} change${changes === 1 ? "" : "s"})`}`);
11258
- }
11259
- /**
11260
11238
  * Converge this machine on what the manifest declares.
11261
11239
  *
11262
11240
  * Says what it did in one line and stays silent when it did nothing, because
@@ -11281,7 +11259,7 @@ async function reconcileLocal(workspace, stage, options) {
11281
11259
  /**
11282
11260
  * Resolve secrets with priority:
11283
11261
  * 1. Local secrets exist → use them (preserves manual additions)
11284
- * 2. A deployed stage whose store has secrets → pull and use
11262
+ * 2. The stage's store has secrets → use them
11285
11263
  * 3. Neither → generate fresh secrets
11286
11264
  *
11287
11265
  * --force skips checks 1 and 2 and always regenerates.
@@ -11608,7 +11586,7 @@ function testDatabases(reconciled) {
11608
11586
  * starts without the reference data the app needs.
11609
11587
  */
11610
11588
  async function migrateTestStage(workspace, env) {
11611
- const { migrateAndSeed } = await import("./migrate-BSbZ7-9n.mjs");
11589
+ const { migrateAndSeed } = await import("./migrate-DhvFPGLi.mjs");
11612
11590
  const { discover } = await import("./discover-qjFapetL.mjs").then((n) => n.i);
11613
11591
  const sources = {};
11614
11592
  const manifest = await discover({
@@ -11962,7 +11940,7 @@ program.command("trust").description("Trust the local edge's certificate authori
11962
11940
  exitWithError(error);
11963
11941
  }
11964
11942
  });
11965
- 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) => {
11943
+ program.command("setup").description("Set this machine up for the workspace, once: the local stage's secrets and containers. A deployed stage's resources are created by its deploy").option("--stage <stage>", "Stage name (default: stages.local); never a deployed stage").option("--force", "Regenerate secrets even if they exist").option("--skip-docker", "Skip starting Docker services").option("-y, --yes", "Skip prompts").action(async (options) => {
11966
11944
  try {
11967
11945
  const globalOptions = program.opts();
11968
11946
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
@@ -12044,7 +12022,7 @@ program.command("migrate").description("Apply each database construct's migratio
12044
12022
  try {
12045
12023
  const globalOptions = program.opts();
12046
12024
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12047
- const { migrateCommand } = await import("./migrate-BSbZ7-9n.mjs");
12025
+ const { migrateCommand } = await import("./migrate-DhvFPGLi.mjs");
12048
12026
  await migrateCommand({
12049
12027
  ...options,
12050
12028
  ...construct ? { construct } : {}
@@ -12057,7 +12035,7 @@ program.command("seed").description("Migrate, then run each database construct's
12057
12035
  try {
12058
12036
  const globalOptions = program.opts();
12059
12037
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12060
- const { seedCommand } = await import("./migrate-BSbZ7-9n.mjs");
12038
+ const { seedCommand } = await import("./migrate-DhvFPGLi.mjs");
12061
12039
  await seedCommand({
12062
12040
  ...options,
12063
12041
  ...construct ? { construct } : {}
@@ -12070,7 +12048,7 @@ program.command("migration").description("Write a construct's next migration: an
12070
12048
  try {
12071
12049
  const globalOptions = program.opts();
12072
12050
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12073
- const { migrationCommand } = await import("./migrate-BSbZ7-9n.mjs");
12051
+ const { migrationCommand } = await import("./migrate-DhvFPGLi.mjs");
12074
12052
  await migrationCommand({
12075
12053
  construct,
12076
12054
  ...name ? { name } : {}
@@ -12116,7 +12094,7 @@ program.command("docker").description("Generate Docker deployment files").option
12116
12094
  exitWithError(error);
12117
12095
  }
12118
12096
  });
12119
- 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) => {
12097
+ 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", "Deployed stage: neither write the public hosts' DNS records nor check they point at GKM_SERVER_IPV4 (a CDN or proxy in front, or records written elsewhere)").option("--resources-only", "Deployed stage: create its resources — deploy.<kind>.<stage> providers' buckets and keys, and its DNS records — and nothing else (a CI runner, before the server deploys)").option("--skip-resources", "Deployed stage: an earlier --resources-only run created its resources; run no provider and write or check no DNS record").option("--rotate-keys", "Deployed stage: each provider issues its runtime keys a successor (the old one is deleted by the next deploy)").option("--retire-old-keys", "Deployed stage: delete a rotated-out key now instead of on the next deploy").action(async (options) => {
12120
12098
  try {
12121
12099
  const globalOptions = program.opts();
12122
12100
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
@@ -12170,7 +12148,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
12170
12148
  try {
12171
12149
  const globalOptions = program.opts();
12172
12150
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12173
- const { secretsAddCommand } = await import("./add-2Opn2VVE.mjs");
12151
+ const { secretsAddCommand } = await import("./add-C85isXFl.mjs");
12174
12152
  await secretsAddCommand(options);
12175
12153
  } catch (error) {
12176
12154
  exitWithError(error);
@@ -12180,7 +12158,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
12180
12158
  try {
12181
12159
  const globalOptions = program.opts();
12182
12160
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12183
- const { encryptionRotateCommand } = await import("./encryption-C9Jm9dfn.mjs");
12161
+ const { encryptionRotateCommand } = await import("./encryption-_4qKqtTx.mjs");
12184
12162
  await encryptionRotateCommand(construct, options);
12185
12163
  } catch (error) {
12186
12164
  exitWithError(error);
@@ -12190,7 +12168,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
12190
12168
  try {
12191
12169
  const globalOptions = program.opts();
12192
12170
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12193
- const { encryptionRetireCommand } = await import("./encryption-C9Jm9dfn.mjs");
12171
+ const { encryptionRetireCommand } = await import("./encryption-_4qKqtTx.mjs");
12194
12172
  await encryptionRetireCommand(construct, key, options);
12195
12173
  } catch (error) {
12196
12174
  exitWithError(error);
@@ -12228,8 +12206,8 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12228
12206
  const globalOptions = program.opts();
12229
12207
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12230
12208
  const { loadWorkspaceConfig } = await import("./config.mjs");
12231
- const { reconcileMissingSecrets } = await import("./reconcile-Dh1Jk7WE.mjs");
12232
- const { secretsStoreFor } = await import("./seeds-CvGQJnPO.mjs").then((n) => n.Pn);
12209
+ const { reconcileMissingSecrets } = await import("./reconcile--I7V4Klj.mjs");
12210
+ const { secretsStoreFor } = await import("./seeds-CTxTZa-R.mjs").then((n) => n.Wn);
12233
12211
  const { workspace } = await loadWorkspaceConfig();
12234
12212
  const stage = options.stage ?? workspace.stages.local;
12235
12213
  const store = await secretsStoreFor(workspace, stage);
@@ -12238,7 +12216,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
12238
12216
  console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
12239
12217
  process.exit(1);
12240
12218
  }
12241
- const { derivedContainers } = await import("./seeds-CvGQJnPO.mjs").then((n) => n.ht);
12219
+ const { derivedContainers } = await import("./seeds-CTxTZa-R.mjs").then((n) => n.Tt);
12242
12220
  const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
12243
12221
  if (!result) {
12244
12222
  console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
@@ -12255,14 +12233,14 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
12255
12233
  try {
12256
12234
  const globalOptions = program.opts();
12257
12235
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12258
- const { secretsMigrateCommand } = await import("./migrate-IZsYyZ5F.mjs");
12236
+ const { secretsMigrateCommand } = await import("./migrate-B7evHv7O.mjs");
12259
12237
  await secretsMigrateCommand(options);
12260
12238
  } catch (error) {
12261
12239
  exitWithError(error);
12262
12240
  }
12263
12241
  });
12264
- 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) => {
12265
- const { deployCli } = await import("./cli-BjhaVObS.mjs");
12242
+ 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", "Compose: neither write the public hosts' DNS records nor check they point at GKM_SERVER_IPV4 (a CDN or proxy in front, or records written elsewhere)").option("--resources-only", "Deployed stage: create its resources — deploy.<kind>.<stage> providers' buckets and keys, and its DNS records — and nothing else (a CI runner, before the server deploys)").option("--skip-resources", "Deployed stage: an earlier --resources-only run created its resources; run no provider and write or check no DNS record").option("--rotate-keys", "Deployed stage: each provider issues its runtime keys a successor (the old one is deleted by the next deploy)").option("--retire-old-keys", "Deployed stage: delete a rotated-out key now instead of on the next deploy").action(async (options) => {
12243
+ const { deployCli } = await import("./cli-BsFenyaf.mjs");
12266
12244
  const globalOptions = program.opts();
12267
12245
  const code = await deployCli({
12268
12246
  cwd: resolve(globalOptions.cwd ?? process.cwd()),
@@ -12274,14 +12252,18 @@ program.command("deploy").description("Deploy a stage through its target").optio
12274
12252
  ...options.dryRun ? { dryRun: true } : {},
12275
12253
  ...options.atomic ? { atomic: true } : {},
12276
12254
  ...options.allowDevServices ? { allowDevServices: true } : {},
12277
- ...options.skipDnsCheck ? { skipDnsCheck: true } : {}
12255
+ ...options.skipDns ? { skipDns: true } : {},
12256
+ ...options.resourcesOnly ? { resourcesOnly: true } : {},
12257
+ ...options.skipResources ? { skipResources: true } : {},
12258
+ ...options.rotateKeys ? { rotateKeys: true } : {},
12259
+ ...options.retireOldKeys ? { retireOldKeys: true } : {}
12278
12260
  });
12279
12261
  if (code !== 0) process.exit(code);
12280
12262
  });
12281
12263
  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) => {
12282
12264
  try {
12283
- const { rollbackStage } = await import("./rollback-D1d-fW0r.mjs").then((n) => n.a);
12284
- const { terminalCredentials } = await import("./terminal-Dtd6BZX9.mjs");
12265
+ const { rollbackStage } = await import("./rollback-NroNbGC0.mjs").then((n) => n.a);
12266
+ const { terminalCredentials } = await import("./terminal-DAHs2Zko.mjs");
12285
12267
  const globalOptions = program.opts();
12286
12268
  await rollbackStage({
12287
12269
  cwd: resolve(globalOptions.cwd ?? process.cwd()),
@@ -12314,7 +12296,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
12314
12296
  try {
12315
12297
  const globalOptions = program.opts();
12316
12298
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12317
- const { deployGithubCommand } = await import("./github-B1k42hIt.mjs");
12299
+ const { deployGithubCommand } = await import("./github-xsDT19im.mjs");
12318
12300
  await deployGithubCommand(options);
12319
12301
  } catch (error) {
12320
12302
  exitWithError(error);
@@ -12324,7 +12306,7 @@ program.command("stages").description("The workspace's stages from gkm.config.ts
12324
12306
  try {
12325
12307
  const globalOptions = program.opts();
12326
12308
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12327
- const { stagesCommand } = await import("./stages-DY-fQKmo.mjs");
12309
+ const { stagesCommand } = await import("./stages-veC4TcQe.mjs");
12328
12310
  await stagesCommand(options);
12329
12311
  } catch (error) {
12330
12312
  exitWithError(error);
@@ -12423,6 +12405,15 @@ program.command("state:show").description("Show deployment state for a stage").r
12423
12405
  exitWithError(error);
12424
12406
  }
12425
12407
  });
12408
+ 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) => {
12409
+ try {
12410
+ const globalOptions = program.opts();
12411
+ if (globalOptions.cwd) process.chdir(globalOptions.cwd);
12412
+ await stateHistoryCommand(options);
12413
+ } catch (error) {
12414
+ exitWithError(error);
12415
+ }
12416
+ });
12426
12417
  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) => {
12427
12418
  try {
12428
12419
  const globalOptions = program.opts();
@@ -12457,6 +12448,6 @@ try {
12457
12448
  }
12458
12449
  program.parse();
12459
12450
  //#endregion
12460
- 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 };
12451
+ export { validateDokployToken as a, formatError as i, slug as n, canPrompt as o, stamp as r, prompt as s, generateFullstackCustomSecrets as t };
12461
12452
 
12462
12453
  //# sourceMappingURL=index.mjs.map