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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/{GoDaddyProvider-DK9_Jw9d.cjs → GoDaddyProvider-Cs32wo6I.cjs} +2 -2
  2. package/dist/{GoDaddyProvider-DK9_Jw9d.cjs.map → GoDaddyProvider-Cs32wo6I.cjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-Cf4MIuaD.mjs → GoDaddyProvider-D7CTqN0f.mjs} +2 -2
  4. package/dist/{GoDaddyProvider-Cf4MIuaD.mjs.map → GoDaddyProvider-D7CTqN0f.mjs.map} +1 -1
  5. package/dist/{HostingerProvider-CQebZrz3.mjs → HostingerProvider-B_3Qs9mT.mjs} +2 -2
  6. package/dist/{HostingerProvider-CQebZrz3.mjs.map → HostingerProvider-B_3Qs9mT.mjs.map} +1 -1
  7. package/dist/{HostingerProvider-qQzo4MYp.cjs → HostingerProvider-D0515Stf.cjs} +2 -2
  8. package/dist/{HostingerProvider-qQzo4MYp.cjs.map → HostingerProvider-D0515Stf.cjs.map} +1 -1
  9. package/dist/{LegacyStateStore-BeMRGXRi.cjs → LegacyStateStore-Bv_2L86H.cjs} +2 -2
  10. package/dist/{LegacyStateStore-BeMRGXRi.cjs.map → LegacyStateStore-Bv_2L86H.cjs.map} +1 -1
  11. package/dist/{LegacyStateStore-DXPHKdMk.mjs → LegacyStateStore-CUjKKENQ.mjs} +2 -2
  12. package/dist/{LegacyStateStore-DXPHKdMk.mjs.map → LegacyStateStore-CUjKKENQ.mjs.map} +1 -1
  13. package/dist/{LocalStateStore-BYQ9lPje.mjs → LocalStateStore-DXuj1BDq.mjs} +2 -2
  14. package/dist/{LocalStateStore-BYQ9lPje.mjs.map → LocalStateStore-DXuj1BDq.mjs.map} +1 -1
  15. package/dist/{LocalStateStore-E_sa5GR2.cjs → LocalStateStore-PQ2qJ5VF.cjs} +2 -2
  16. package/dist/{LocalStateStore-E_sa5GR2.cjs.map → LocalStateStore-PQ2qJ5VF.cjs.map} +1 -1
  17. package/dist/{S3StateStore-BQaGVNRf.mjs → S3StateStore-BGnOwqUp.mjs} +4 -4
  18. package/dist/{S3StateStore-BQaGVNRf.mjs.map → S3StateStore-BGnOwqUp.mjs.map} +1 -1
  19. package/dist/{S3StateStore-Cjr4Rtsf.cjs → S3StateStore-cmS6iUZn.cjs} +4 -4
  20. package/dist/{S3StateStore-Cjr4Rtsf.cjs.map → S3StateStore-cmS6iUZn.cjs.map} +1 -1
  21. package/dist/{SSMStateStore-Bq_S7x5_.mjs → SSMStateStore-BqXzPBbu.mjs} +2 -2
  22. package/dist/{SSMStateStore-Bq_S7x5_.mjs.map → SSMStateStore-BqXzPBbu.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-Cnfwdlme.cjs → SSMStateStore-BtNGbg8Z.cjs} +2 -2
  24. package/dist/{SSMStateStore-Cnfwdlme.cjs.map → SSMStateStore-BtNGbg8Z.cjs.map} +1 -1
  25. package/dist/{add-CNQFnG0C.mjs → add-DW2KLCY0.mjs} +5 -5
  26. package/dist/{add-CNQFnG0C.mjs.map → add-DW2KLCY0.mjs.map} +1 -1
  27. package/dist/{add-3_IHpF5F.cjs → add-Dp5xRn-u.cjs} +5 -5
  28. package/dist/{add-3_IHpF5F.cjs.map → add-Dp5xRn-u.cjs.map} +1 -1
  29. package/dist/{apps-BGu47YRF.cjs → apps-DYGKg5SP.cjs} +28 -897
  30. package/dist/apps-DYGKg5SP.cjs.map +1 -0
  31. package/dist/{apps-DGod3aS9.mjs → apps-DrXwv-0A.mjs} +16 -795
  32. package/dist/apps-DrXwv-0A.mjs.map +1 -0
  33. package/dist/{bundler-DWGxNGSB.cjs → bundler-BIfEe05e.cjs} +6 -6
  34. package/dist/{bundler-DWGxNGSB.cjs.map → bundler-BIfEe05e.cjs.map} +1 -1
  35. package/dist/{bundler-Dm0mB7EK.mjs → bundler-Swt8wHG9.mjs} +6 -6
  36. package/dist/{bundler-Dm0mB7EK.mjs.map → bundler-Swt8wHG9.mjs.map} +1 -1
  37. package/dist/{cli-Qm-8tG46.mjs → cli-C9wdKQy_.mjs} +4 -4
  38. package/dist/{cli-Qm-8tG46.mjs.map → cli-C9wdKQy_.mjs.map} +1 -1
  39. package/dist/{cli-CYeZF85I.cjs → cli-ohJToj0E.cjs} +4 -4
  40. package/dist/{cli-CYeZF85I.cjs.map → cli-ohJToj0E.cjs.map} +1 -1
  41. package/dist/{compose-CXgwCuqv.mjs → compose-BLOnkeaJ.mjs} +887 -15
  42. package/dist/compose-BLOnkeaJ.mjs.map +1 -0
  43. package/dist/{compose-IsvqY6iX.cjs → compose-Br3SQ2bW.cjs} +62 -9
  44. package/dist/compose-Br3SQ2bW.cjs.map +1 -0
  45. package/dist/{compose-CshnO-Th.cjs → compose-SNYBstbO.cjs} +1025 -15
  46. package/dist/compose-SNYBstbO.cjs.map +1 -0
  47. package/dist/{compose-BVeevJO_.mjs → compose-iUOeazjW.mjs} +61 -8
  48. package/dist/compose-iUOeazjW.mjs.map +1 -0
  49. package/dist/{config-u5XdE1Cq.d.cts → config-CsCYzlVO.d.mts} +3 -3
  50. package/dist/{config-B8gSu59v.d.mts.map → config-CsCYzlVO.d.mts.map} +1 -1
  51. package/dist/{config-B8gSu59v.d.mts → config-D-gHQXhi.d.cts} +3 -3
  52. package/dist/{config-u5XdE1Cq.d.cts.map → config-D-gHQXhi.d.cts.map} +1 -1
  53. package/dist/config.cjs +1 -1
  54. package/dist/config.d.cts +3 -3
  55. package/dist/config.d.mts +3 -3
  56. package/dist/config.mjs +1 -1
  57. package/dist/{credentials-DzR2j8h1.cjs → credentials-BdZhygvW.cjs} +6 -6
  58. package/dist/{credentials-DzR2j8h1.cjs.map → credentials-BdZhygvW.cjs.map} +1 -1
  59. package/dist/{credentials-CKIeLL7T.mjs → credentials-C2VfI-uf.mjs} +6 -6
  60. package/dist/{credentials-CKIeLL7T.mjs.map → credentials-C2VfI-uf.mjs.map} +1 -1
  61. package/dist/deploy/public.cjs +11 -11
  62. package/dist/deploy/public.d.cts +4 -4
  63. package/dist/deploy/public.d.mts +4 -4
  64. package/dist/deploy/public.mjs +11 -11
  65. package/dist/{deploy-DQjEjUfB.cjs → deploy-CYyf-Q8N.cjs} +24 -26
  66. package/dist/deploy-CYyf-Q8N.cjs.map +1 -0
  67. package/dist/{deploy-CjubyZlP.mjs → deploy-DqH8QReb.mjs} +23 -25
  68. package/dist/deploy-DqH8QReb.mjs.map +1 -0
  69. package/dist/{destroy-D4m5aO9k.mjs → destroy-B9myEYFT.mjs} +9 -9
  70. package/dist/{destroy-D4m5aO9k.mjs.map → destroy-B9myEYFT.mjs.map} +1 -1
  71. package/dist/{destroy-D1375m8C.cjs → destroy-Bp5iHtLf.cjs} +9 -9
  72. package/dist/{destroy-D1375m8C.cjs.map → destroy-Bp5iHtLf.cjs.map} +1 -1
  73. package/dist/{docker-CSEAKwFr.cjs → docker-BezTRGxN.cjs} +9 -9
  74. package/dist/{docker-CSEAKwFr.cjs.map → docker-BezTRGxN.cjs.map} +1 -1
  75. package/dist/{docker-C27YUUMQ.mjs → docker-De_-Ll-A.mjs} +5 -5
  76. package/dist/{docker-C27YUUMQ.mjs.map → docker-De_-Ll-A.mjs.map} +1 -1
  77. package/dist/{dokploy-DJDdiFz6.cjs → dokploy-CWCIqro_.cjs} +2 -2
  78. package/dist/{dokploy-DJDdiFz6.cjs.map → dokploy-CWCIqro_.cjs.map} +1 -1
  79. package/dist/{dokploy-CSqDsvY-.mjs → dokploy-EsBgWO8W.mjs} +2 -2
  80. package/dist/{dokploy-CSqDsvY-.mjs.map → dokploy-EsBgWO8W.mjs.map} +1 -1
  81. package/dist/{eas-DryGYjFk.cjs → eas-8t6PJRni.cjs} +3 -3
  82. package/dist/{eas-DryGYjFk.cjs.map → eas-8t6PJRni.cjs.map} +1 -1
  83. package/dist/{eas-DC3F8cy0.mjs → eas-BalvsiH5.mjs} +3 -3
  84. package/dist/{eas-DC3F8cy0.mjs.map → eas-BalvsiH5.mjs.map} +1 -1
  85. package/dist/{encryption-C8Y8Ly6n.mjs → encryption-B4mWxt4G.mjs} +3 -3
  86. package/dist/{encryption-C8Y8Ly6n.mjs.map → encryption-B4mWxt4G.mjs.map} +1 -1
  87. package/dist/{encryption-8qZGm15p.cjs → encryption-CKBmU66R.cjs} +3 -3
  88. package/dist/{encryption-8qZGm15p.cjs.map → encryption-CKBmU66R.cjs.map} +1 -1
  89. package/dist/{engine-DI7JAyiD.cjs → engine-BTG46RG-.cjs} +19 -19
  90. package/dist/{engine-DI7JAyiD.cjs.map → engine-BTG46RG-.cjs.map} +1 -1
  91. package/dist/{engine-C9E0MeLm.mjs → engine-y8iWIXuv.mjs} +9 -9
  92. package/dist/{engine-C9E0MeLm.mjs.map → engine-y8iWIXuv.mjs.map} +1 -1
  93. package/dist/{github-g3nRZlli.cjs → github-CeXlzWWA.cjs} +7 -7
  94. package/dist/{github-g3nRZlli.cjs.map → github-CeXlzWWA.cjs.map} +1 -1
  95. package/dist/{github-DdaV-Gll.mjs → github-DvGoKoQO.mjs} +7 -7
  96. package/dist/{github-DdaV-Gll.mjs.map → github-DvGoKoQO.mjs.map} +1 -1
  97. package/dist/{googlePlay-BHJ_iThq.cjs → googlePlay-CfzG7jOJ.cjs} +4 -4
  98. package/dist/{googlePlay-BHJ_iThq.cjs.map → googlePlay-CfzG7jOJ.cjs.map} +1 -1
  99. package/dist/{googlePlay-BmeR1kY4.mjs → googlePlay-DWv6CUgM.mjs} +4 -4
  100. package/dist/{googlePlay-BmeR1kY4.mjs.map → googlePlay-DWv6CUgM.mjs.map} +1 -1
  101. package/dist/{iam-ra1_Y405.mjs → iam-BE0qX5Lb.mjs} +2 -2
  102. package/dist/{iam-ra1_Y405.mjs.map → iam-BE0qX5Lb.mjs.map} +1 -1
  103. package/dist/{iam-BoYPPNdM.cjs → iam-FA95ku7l.cjs} +2 -2
  104. package/dist/{iam-BoYPPNdM.cjs.map → iam-FA95ku7l.cjs.map} +1 -1
  105. package/dist/{index-DFZ0SMwN.d.mts → index-QxGYzGEN.d.mts} +2 -2
  106. package/dist/{index-1H93w_H6.d.cts.map → index-QxGYzGEN.d.mts.map} +1 -1
  107. package/dist/{index-1H93w_H6.d.cts → index-tFzoro1V.d.cts} +2 -2
  108. package/dist/{index-DFZ0SMwN.d.mts.map → index-tFzoro1V.d.cts.map} +1 -1
  109. package/dist/index.cjs +72 -72
  110. package/dist/index.cjs.map +1 -1
  111. package/dist/index.mjs +63 -63
  112. package/dist/index.mjs.map +1 -1
  113. package/dist/{local-Bkv-e8uM.mjs → local-CvRvfktv.mjs} +2 -2
  114. package/dist/{local-Bkv-e8uM.mjs.map → local-CvRvfktv.mjs.map} +1 -1
  115. package/dist/{local-DTidpa-a.cjs → local-DH9at_0c.cjs} +2 -2
  116. package/dist/{local-DTidpa-a.cjs.map → local-DH9at_0c.cjs.map} +1 -1
  117. package/dist/{migrate-CXLhrHwu.cjs → migrate-B1lHo2K2.cjs} +5 -5
  118. package/dist/{migrate-CXLhrHwu.cjs.map → migrate-B1lHo2K2.cjs.map} +1 -1
  119. package/dist/{migrate-DNOI23QA.mjs → migrate-D1iCmQgc.mjs} +5 -5
  120. package/dist/{migrate-DNOI23QA.mjs.map → migrate-D1iCmQgc.mjs.map} +1 -1
  121. package/dist/{migrate-DU4MtKxz.cjs → migrate-DzOWCnRR.cjs} +3 -3
  122. package/dist/{migrate-DU4MtKxz.cjs.map → migrate-DzOWCnRR.cjs.map} +1 -1
  123. package/dist/{migrate-BZRsJwni.mjs → migrate-NmW2Su8s.mjs} +3 -3
  124. package/dist/{migrate-BZRsJwni.mjs.map → migrate-NmW2Su8s.mjs.map} +1 -1
  125. package/dist/{notes-1TM_Vzi7.mjs → notes-BdIY7IoB.mjs} +4 -3
  126. package/dist/notes-BdIY7IoB.mjs.map +1 -0
  127. package/dist/{notes-BpaXOAkA.cjs → notes-ikElBCC8.cjs} +4 -3
  128. package/dist/{notes-1TM_Vzi7.mjs.map → notes-ikElBCC8.cjs.map} +1 -1
  129. package/dist/openapi.cjs +1 -1
  130. package/dist/openapi.d.cts +1 -1
  131. package/dist/openapi.d.mts +1 -1
  132. package/dist/openapi.mjs +1 -1
  133. package/dist/{projectBucket-BRgsSv2P.mjs → projectBucket-C-FOIic4.mjs} +2 -2
  134. package/dist/{projectBucket-BRgsSv2P.mjs.map → projectBucket-C-FOIic4.mjs.map} +1 -1
  135. package/dist/{projectBucket-DbEWuLGX.cjs → projectBucket-uidxz03Q.cjs} +2 -2
  136. package/dist/{projectBucket-DbEWuLGX.cjs.map → projectBucket-uidxz03Q.cjs.map} +1 -1
  137. package/dist/{publish-DjFgxu2v.mjs → publish-Ujng6o63.mjs} +2 -2
  138. package/dist/{publish-DjFgxu2v.mjs.map → publish-Ujng6o63.mjs.map} +1 -1
  139. package/dist/{publish-BN1l3tPF.cjs → publish-oO_8elIf.cjs} +2 -2
  140. package/dist/{publish-BN1l3tPF.cjs.map → publish-oO_8elIf.cjs.map} +1 -1
  141. package/dist/reconcile/public.d.cts +1 -1
  142. package/dist/reconcile/public.d.mts +1 -1
  143. package/dist/{resolve-BHVyg4Hg.cjs → resolve-CTb1gsTO.cjs} +4 -4
  144. package/dist/{resolve-BHVyg4Hg.cjs.map → resolve-CTb1gsTO.cjs.map} +1 -1
  145. package/dist/{resolve-NEKsqNAw.mjs → resolve-Lk7fd8Kb.mjs} +4 -4
  146. package/dist/{resolve-NEKsqNAw.mjs.map → resolve-Lk7fd8Kb.mjs.map} +1 -1
  147. package/dist/{rollback-BVgyLE7B.mjs → rollback-B2DhSX-I.mjs} +6 -6
  148. package/dist/{rollback-BVgyLE7B.mjs.map → rollback-B2DhSX-I.mjs.map} +1 -1
  149. package/dist/{rollback-CUjvOIDE.cjs → rollback-PK4pSOLd.cjs} +6 -6
  150. package/dist/{rollback-CUjvOIDE.cjs.map → rollback-PK4pSOLd.cjs.map} +1 -1
  151. package/dist/{runtime-CKOkIrw0.d.cts → runtime-BpGIXfYr.d.mts} +2 -2
  152. package/dist/{runtime-CKOkIrw0.d.cts.map → runtime-BpGIXfYr.d.mts.map} +1 -1
  153. package/dist/{runtime-Cdvv8SfU.d.mts → runtime-DLV0CNZ4.d.cts} +2 -2
  154. package/dist/{runtime-Cdvv8SfU.d.mts.map → runtime-DLV0CNZ4.d.cts.map} +1 -1
  155. package/dist/{s3-BO4yr61G.mjs → s3-BY5ry__M.mjs} +3 -3
  156. package/dist/{s3-BO4yr61G.mjs.map → s3-BY5ry__M.mjs.map} +1 -1
  157. package/dist/{s3-DnPbDfQN.cjs → s3-FG9qIgEB.cjs} +3 -3
  158. package/dist/{s3-DnPbDfQN.cjs.map → s3-FG9qIgEB.cjs.map} +1 -1
  159. package/dist/{serverSetup-BxnCM11A.mjs → serverSetup-BL1sHzRr.mjs} +6 -6
  160. package/dist/{serverSetup-BxnCM11A.mjs.map → serverSetup-BL1sHzRr.mjs.map} +1 -1
  161. package/dist/{serverSetup-DScJ7tQs.cjs → serverSetup-C7fDKGiN.cjs} +6 -6
  162. package/dist/{serverSetup-DScJ7tQs.cjs.map → serverSetup-C7fDKGiN.cjs.map} +1 -1
  163. package/dist/{sniffer-9smKtb86.mjs → sniffer-BvhDRsgI.mjs} +7 -7
  164. package/dist/{sniffer-9smKtb86.mjs.map → sniffer-BvhDRsgI.mjs.map} +1 -1
  165. package/dist/{sniffer-DHcxlSJF.cjs → sniffer-DJp9a2Pg.cjs} +7 -7
  166. package/dist/{sniffer-DHcxlSJF.cjs.map → sniffer-DJp9a2Pg.cjs.map} +1 -1
  167. package/dist/{snsSubscriptions-CygsiXhb.mjs → snsSubscriptions-7y2XBXde.mjs} +4 -4
  168. package/dist/{snsSubscriptions-CygsiXhb.mjs.map → snsSubscriptions-7y2XBXde.mjs.map} +1 -1
  169. package/dist/{snsSubscriptions-B8TYeAM-.cjs → snsSubscriptions-8t1XFvoc.cjs} +4 -4
  170. package/dist/{snsSubscriptions-B8TYeAM-.cjs.map → snsSubscriptions-8t1XFvoc.cjs.map} +1 -1
  171. package/dist/{sst-DiHVSku5.cjs → sst-8HZe83-M.cjs} +5 -5
  172. package/dist/{sst-DiHVSku5.cjs.map → sst-8HZe83-M.cjs.map} +1 -1
  173. package/dist/{sst-Bgb3WWEl.mjs → sst-CzFd-1om.mjs} +5 -5
  174. package/dist/{sst-Bgb3WWEl.mjs.map → sst-CzFd-1om.mjs.map} +1 -1
  175. package/dist/{stack-A3evQgbk.cjs → stack-3tvhk7SU.cjs} +80 -24
  176. package/dist/stack-3tvhk7SU.cjs.map +1 -0
  177. package/dist/{stack-Cy2FwO3Z.mjs → stack-j2e8ddGl.mjs} +62 -12
  178. package/dist/stack-j2e8ddGl.mjs.map +1 -0
  179. package/dist/{stage-Bm1x9Anp.cjs → stage-DCSJii_y.cjs} +6 -6
  180. package/dist/{stage-Bm1x9Anp.cjs.map → stage-DCSJii_y.cjs.map} +1 -1
  181. package/dist/{stage-Dgy08WVL.mjs → stage-DMv-IfSD.mjs} +6 -6
  182. package/dist/{stage-Dgy08WVL.mjs.map → stage-DMv-IfSD.mjs.map} +1 -1
  183. package/dist/{stages-COiipV8N.mjs → stages-CCAAe1tP.mjs} +2 -2
  184. package/dist/{stages-COiipV8N.mjs.map → stages-CCAAe1tP.mjs.map} +1 -1
  185. package/dist/{stages-BWg3NU3J.cjs → stages-D49CUpBY.cjs} +2 -2
  186. package/dist/{stages-BWg3NU3J.cjs.map → stages-D49CUpBY.cjs.map} +1 -1
  187. package/dist/target/public.cjs +1 -1
  188. package/dist/target/public.d.cts +2 -2
  189. package/dist/target/public.d.mts +2 -2
  190. package/dist/target/public.mjs +1 -1
  191. package/dist/{terminal-BDRxzEZD.cjs → terminal-DIEj2Nap.cjs} +2 -2
  192. package/dist/{terminal-BDRxzEZD.cjs.map → terminal-DIEj2Nap.cjs.map} +1 -1
  193. package/dist/{terminal-BRAIvH83.mjs → terminal-VLmWgL_N.mjs} +2 -2
  194. package/dist/{terminal-BRAIvH83.mjs.map → terminal-VLmWgL_N.mjs.map} +1 -1
  195. package/dist/{types-DEmuMHsS.d.cts → types-Bj1A1wkS.d.mts} +3 -3
  196. package/dist/{types-g_S0_RAi.d.mts.map → types-Bj1A1wkS.d.mts.map} +1 -1
  197. package/dist/{types-g_S0_RAi.d.mts → types-CV4AzwC_.d.cts} +4 -2
  198. package/dist/{types-DEmuMHsS.d.cts.map → types-CV4AzwC_.d.cts.map} +1 -1
  199. package/dist/workspace/index.cjs +1 -1
  200. package/dist/workspace/index.d.cts +2 -2
  201. package/dist/workspace/index.d.mts +2 -2
  202. package/dist/workspace/index.mjs +1 -1
  203. package/dist/{workspace-_aoe8v6u.mjs → workspace-B0PI9k9p.mjs} +28 -5
  204. package/dist/workspace-B0PI9k9p.mjs.map +1 -0
  205. package/dist/{workspace-CEpojAus.cjs → workspace-LR9DFjU8.cjs} +39 -4
  206. package/dist/workspace-LR9DFjU8.cjs.map +1 -0
  207. package/package.json +15 -15
  208. package/dist/apps-BGu47YRF.cjs.map +0 -1
  209. package/dist/apps-DGod3aS9.mjs.map +0 -1
  210. package/dist/compose-BVeevJO_.mjs.map +0 -1
  211. package/dist/compose-CXgwCuqv.mjs.map +0 -1
  212. package/dist/compose-CshnO-Th.cjs.map +0 -1
  213. package/dist/compose-IsvqY6iX.cjs.map +0 -1
  214. package/dist/deploy-CjubyZlP.mjs.map +0 -1
  215. package/dist/deploy-DQjEjUfB.cjs.map +0 -1
  216. package/dist/notes-BpaXOAkA.cjs.map +0 -1
  217. package/dist/stack-A3evQgbk.cjs.map +0 -1
  218. package/dist/stack-Cy2FwO3Z.mjs.map +0 -1
  219. package/dist/workspace-CEpojAus.cjs.map +0 -1
  220. package/dist/workspace-_aoe8v6u.mjs.map +0 -1
@@ -1,13 +1,14 @@
1
1
  import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
2
- import { B as FileSecretsStore, F as toEmbeddableSecrets, G as getOrCreateKey, H as encrypt, J as readKey, K as keystoreProject, V as decrypt, W as getKeystoreDir, bt as gkmHome, k as secretsStoreFor } from "./credentials-CKIeLL7T.mjs";
3
- import { B as LOGS_PORT, v as getPublicEnvPrefix } from "./workspace-_aoe8v6u.mjs";
2
+ import { B as FileSecretsStore, F as toEmbeddableSecrets, G as getOrCreateKey, H as encrypt, J as readKey, K as keystoreProject, V as decrypt, W as getKeystoreDir, bt as gkmHome, k as secretsStoreFor } from "./credentials-C2VfI-uf.mjs";
3
+ import { B as LOGS_PORT, R as stageSampleRate, ct as protectedSubdomains, dt as fileServerLabel, ot as appKey, v as getPublicEnvPrefix } from "./workspace-B0PI9k9p.mjs";
4
+ import { i as holdsEveryCache, t as DEFAULT_CACHE } from "./types-Y1NfWlyG.mjs";
4
5
  import { ConfigNotFound, NotInAnApp, loadWorkspaceAppInfo, loadWorkspaceConfig } from "./config.mjs";
5
6
  import { dirname, join, resolve } from "node:path";
6
7
  import { existsSync } from "node:fs";
7
8
  import { mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
8
9
  import { createServer } from "node:net";
9
10
  import { createHash, randomBytes, randomInt } from "node:crypto";
10
- import { DEFAULT_POSTGRES_VERSION, WILDCARD_SUBDOMAIN, drawSecret, kebabCase, providedKeyFor } from "@geekmidas/manifest";
11
+ import { CLIENT_IP_HEADER, DEFAULT_POSTGRES_VERSION, EDGE_TOKEN_HEADER, IMAGE_ORIGINS_KEY, PUBLIC_PREFIX, TELEMETRY_KEYS, WILDCARD_SUBDOMAIN, bucketExpiry, dependentsOf, drawSecret, hostLabels, imageOriginSources, isHostedDeclaration, isPublicDeclaration, isWildcardSite, kebabCase, providedKeyFor, publicEnvFor } from "@geekmidas/manifest";
11
12
  import { generateKeyring } from "@geekmidas/constructs/encryption";
12
13
  import { config } from "dotenv";
13
14
  import { stringify } from "yaml";
@@ -126,13 +127,15 @@ function getPublicUrlArgNames(app) {
126
127
  * It is reached, by default, through an SSH tunnel: published on 127.0.0.1
127
128
  * only, because a port Docker publishes on every interface is opened in the
128
129
  * firewall by Docker itself, past ufw's rules. Served publicly, it is a host
129
- * on the stack's Caddy that refuses every address not allowed.
130
+ * on the stack's edge — the `Telemetry` construct's label under the stage's
131
+ * domain — that refuses every address not allowed.
130
132
  *
131
133
  * Pure: the stack decides it, and the phases print and check it.
132
134
  */
133
135
  /**
134
- * The image, pinned. A log store's on-disk format is the thing that must not
135
- * move under a running stack, so a new version is a change to this line.
136
+ * The image, pinned — unless the `Telemetry` construct names its own. A log
137
+ * store's on-disk format is the thing that must not move under a running
138
+ * stack, so a new version is a change to this line, or to the construct's.
136
139
  */
137
140
  const OPENOBSERVE_IMAGE = "public.ecr.aws/zinclabs/openobserve:v1.0.4";
138
141
  /** Its compose service name — the host the apps send to. */
@@ -156,6 +159,24 @@ var LogsPasswordWeak = class extends GkmError {
156
159
  this.name = "LogsPasswordWeak";
157
160
  }
158
161
  };
162
+ /**
163
+ * The loopback port a stage's OpenObserve is published on is held by another
164
+ * stack on its server — two stages on one machine, both on `5080`.
165
+ */
166
+ var LogsPortTaken = class extends GkmError {
167
+ stage;
168
+ port;
169
+ holder;
170
+ named;
171
+ constructor(stage, port, holder, named) {
172
+ super(named ? `deploy.telemetry.${stage}.port is ${port}, and '${holder}' already publishes ${port} on this server. Give the stage another: deploy.telemetry.${stage}.port = ${port + 1}, or remove port to have a free one picked.` : `No loopback port from ${port} up is free for the stage '${stage}'s OpenObserve on this server ('${holder}' holds the last one tried). Set one: deploy.telemetry.${stage}.port = <free port>.`);
173
+ this.stage = stage;
174
+ this.port = port;
175
+ this.holder = holder;
176
+ this.named = named;
177
+ this.name = "LogsPortTaken";
178
+ }
179
+ };
159
180
  /** A deployed stage with logs on and no root password generated yet. */
160
181
  var LogsPasswordMissing = class extends GkmError {
161
182
  stage;
@@ -217,8 +238,9 @@ function stackLogs(options) {
217
238
  const password = set ?? (local ? options.localLogin?.password : void 0);
218
239
  if (!password) throw new LogsPasswordMissing(stage);
219
240
  if (!isStrongLogsPassword(password)) throw new LogsPasswordWeak(stage);
220
- const host = config.public ? local ? `logs.${options.project}.localhost` : `logs.${options.domain}` : void 0;
221
- const url = host ? `https://${host}${local && options.https !== 443 ? `:${options.https}` : ""}` : `http://localhost:${config.port}`;
241
+ const { label } = options.telemetry;
242
+ const host = config.public ? local ? `${label}.${options.project}.localhost` : `${label}.${options.domain}` : void 0;
243
+ const url = host ? `https://${host}${local && options.https !== 443 ? `:${options.https}` : ""}` : loopbackUrl(config.port);
222
244
  return {
223
245
  ...config,
224
246
  email,
@@ -226,6 +248,7 @@ function stackLogs(options) {
226
248
  passwordFromSecrets: Boolean(set),
227
249
  url,
228
250
  ...host ? { host } : {},
251
+ image: options.telemetry.image ?? "public.ecr.aws/zinclabs/openobserve:v1.0.4",
229
252
  env: {
230
253
  [LOGS_EMAIL_KEY]: email,
231
254
  [LOGS_PASSWORD_KEY]: password,
@@ -239,6 +262,31 @@ function stackLogs(options) {
239
262
  }
240
263
  };
241
264
  }
265
+ /** Where a browser opens a loopback-published OpenObserve: the tunnel's end. */
266
+ function loopbackUrl(port) {
267
+ return `http://localhost:${port}`;
268
+ }
269
+ /**
270
+ * The stack's OpenObserve published on another loopback port — the one the
271
+ * server has free for it (`logsPortOnServer`). Served publicly, it publishes
272
+ * none, and is returned as it is.
273
+ */
274
+ function logsOnPort(logs, port) {
275
+ if (logs.public || logs.port === port) return logs;
276
+ return {
277
+ ...logs,
278
+ port,
279
+ url: loopbackUrl(port)
280
+ };
281
+ }
282
+ /**
283
+ * What OpenObserve's service publishes: its port on the server's loopback
284
+ * only — Docker opens a port it publishes on every interface in the firewall
285
+ * itself, past ufw — and nothing when it is served through the edge.
286
+ */
287
+ function logsPorts(logs) {
288
+ return logs.public ? {} : { ports: [`127.0.0.1:${logs.port}:${LOGS_PORT}`] };
289
+ }
242
290
  /**
243
291
  * OpenObserve's service. The image has no shell, `wget` or `curl`, so its
244
292
  * health check is its own binary asking the running server for its status —
@@ -246,14 +294,14 @@ function stackLogs(options) {
246
294
  */
247
295
  function logsService(logs) {
248
296
  return {
249
- image: OPENOBSERVE_IMAGE,
297
+ image: logs.image,
250
298
  restart: "unless-stopped",
251
299
  env_file: [{
252
300
  path: `./${LOGS_SERVICE}.env`,
253
301
  format: "raw"
254
302
  }],
255
303
  volumes: ["openobserve-data:/data"],
256
- ...logs.public ? {} : { ports: [`127.0.0.1:${logs.port}:${LOGS_PORT}`] },
304
+ ...logsPorts(logs),
257
305
  healthcheck: {
258
306
  test: [
259
307
  "CMD",
@@ -466,6 +514,364 @@ function volumeOf(container) {
466
514
  }[container];
467
515
  }
468
516
  //#endregion
517
+ //#region src/generators/processorRoute.ts
518
+ /**
519
+ * Where `gkm dev` serves a file server's processors, on the dev server of the
520
+ * app holding them: named after the file server.
521
+ *
522
+ * One definition for both sides — the dev server mounts it, and the local
523
+ * edge rewrites each processor pattern on the file server's host onto it — so
524
+ * the path the edge sends and the path the server answers cannot drift.
525
+ */
526
+ const PROCESSORS_DEV_PREFIX = "/__gkm/processors/";
527
+ /** The base a file server's processors answer under, in `gkm dev`. */
528
+ function processorsDevRoute(fileServerId) {
529
+ return `${PROCESSORS_DEV_PREFIX}${fileServerId}`;
530
+ }
531
+ //#endregion
532
+ //#region src/reconcile/caddyfile.ts
533
+ /**
534
+ * The Caddy configuration a plan implies.
535
+ *
536
+ * A file server is a *domain that serves a bucket*, and locally it had neither:
537
+ * `UPLOADS_URL` resolved to MinIO's path-style address, which works and
538
+ * is not the deployed shape. MinIO's own virtual-host mode cannot fix that —
539
+ * it reads the leading label *as the bucket name*, so it produces the right
540
+ * shape only when the server's id and the bucket's happen to agree, and never
541
+ * for a server fronting two buckets.
542
+ *
543
+ * So the mapping lives in front of MinIO instead: one host per file server,
544
+ * rewriting the bucket in as a path prefix. That is the whole of it — no
545
+ * caching, because caching is not what is missing locally, and a caching proxy
546
+ * would add an invalidation story a local stack has no use for.
547
+ *
548
+ * What it buys beyond the shape is a certificate: gkm's local authority
549
+ * (`trust/authority.ts`) issues one for the stage's hosts, which the edge
550
+ * serves the way a deployed edge serves the stage's own, so a local address is
551
+ * `https://` like the deployed one, and
552
+ * everything downstream of that — `Secure` cookies, `SameSite`, a cookie domain
553
+ * with more than one host under it — starts behaving the way it will in
554
+ * production rather than the way `http://localhost` allows.
555
+ *
556
+ * Pure, like `composeFor`: what should exist is data, and rendering it is one
557
+ * line at the edge.
558
+ */
559
+ /**
560
+ * The kinds the edge serves.
561
+ *
562
+ * Everything that owns a *public address*. Deployed, each of these has a real
563
+ * hostname and a certificate, so this is what makes the local shape the same
564
+ * one rather than a near-enough one — and the application is indifferent
565
+ * either way, because it reads whichever address was injected and never
566
+ * composes one.
567
+ *
568
+ * Adding a kind here is the whole of adding it to the edge.
569
+ */
570
+ const EDGE_KINDS = {
571
+ "file-server": true,
572
+ "rest-api": true,
573
+ "websocket-api": true,
574
+ site: true
575
+ };
576
+ /**
577
+ * How the edge reaches the host, from inside its container.
578
+ *
579
+ * A surface and a site are served by processes `gkm dev` starts on the host,
580
+ * not by containers — so the edge has to leave Docker's network to reach them.
581
+ * Docker Desktop resolves this name already; on Linux the compose definition
582
+ * maps it to the host gateway.
583
+ */
584
+ const HOST_GATEWAY$1 = "host.docker.internal";
585
+ /** Where the edge's container reads `.gkm/caddy-sites/` — routes and certificates. */
586
+ const CADDY_SITES_IN_CONTAINER = "/etc/caddy/sites";
587
+ /**
588
+ * The suffix every local host shares.
589
+ *
590
+ * `.localhost` rather than a made-up TLD because it resolves to loopback
591
+ * without touching `/etc/hosts` — macOS and systemd-resolved both answer for
592
+ * subdomains of it.
593
+ */
594
+ const LOCAL_TLD = "localhost";
595
+ /**
596
+ * The sites a plan implies, one per file server.
597
+ *
598
+ * The leading label is the *server's* stage-scoped name rather than the
599
+ * bucket's, which is the difference that matters: two servers over one bucket
600
+ * are a legitimate arrangement — two cache behaviours, one origin — and naming
601
+ * the host after the bucket would make them collide.
602
+ */
603
+ function sitesFor(plan, project, addresses = {}, processorAddresses = {}) {
604
+ const byId = new Map(plan.resources.map((r) => [r.id, r]));
605
+ const sites = [];
606
+ for (const resource of plan.resources) {
607
+ if (!EDGE_KINDS[resource.kind]) continue;
608
+ const host = hostFor(resource, project);
609
+ if (resource.kind === "file-server") {
610
+ const origin = resource.of ? byId.get(resource.of) : void 0;
611
+ if (!origin) continue;
612
+ const address = processorAddresses[resource.id];
613
+ const port = address ? portOf(address) : void 0;
614
+ sites.push({
615
+ host,
616
+ upstream: "http://minio:9000",
617
+ rewrite: `/${origin.name}{uri}`,
618
+ ...resource.processors?.length && port ? { processors: {
619
+ prefixes: resource.processors,
620
+ upstream: `http://${HOST_GATEWAY$1}:${port}`,
621
+ under: processorsDevRoute(resource.id)
622
+ } } : {}
623
+ });
624
+ continue;
625
+ }
626
+ const address = addresses[resource.id];
627
+ if (!address) continue;
628
+ const port = portOf(address);
629
+ if (!port) continue;
630
+ const upstream = `http://${HOST_GATEWAY$1}:${port}`;
631
+ if (resource.subdomain === WILDCARD_SUBDOMAIN) {
632
+ sites.push({
633
+ host,
634
+ upstream,
635
+ tenants: tenantsOf(resource, host, addresses)
636
+ });
637
+ continue;
638
+ }
639
+ const { aliases, redirects } = hostsFor(resource, project);
640
+ sites.push({
641
+ host,
642
+ upstream,
643
+ ...aliases.length ? { aliases } : {},
644
+ ...redirects.length ? { redirects } : {}
645
+ });
646
+ }
647
+ return sites;
648
+ }
649
+ /**
650
+ * What stands between a wildcard site and a host that is not a tenant.
651
+ *
652
+ * Caddy already prefers a named host to the `*`, so `api.shop.localhost`
653
+ * reaches the API whatever the wildcard says. What it cannot know is the
654
+ * labels nothing is running on: `www`, or an app this stage has not started.
655
+ * Those are refused here, so no slug that a deploy would protect is ever
656
+ * served locally either.
657
+ *
658
+ * The `hosts` route is asked through `forward_auth`, which is a deployed
659
+ * edge's check in miniature: a `2xx` lets the request through, and any other
660
+ * answer — the app's own `404` — is what the browser gets, so a mistyped
661
+ * slug fails here and not first in production. Without an address for the
662
+ * surface serving it there is nothing to ask, and every host is served.
663
+ */
664
+ function tenantsOf(resource, host, addresses) {
665
+ const domain = host.slice(`${WILDCARD_SUBDOMAIN}.`.length);
666
+ const surface = resource.hosts ? addresses[resource.hosts.surface] : void 0;
667
+ const port = surface ? portOf(surface) : void 0;
668
+ return {
669
+ protected: (resource.protectedSubdomains ?? []).map((label) => `${label}.${domain}`),
670
+ ...resource.hosts && port ? { hosts: {
671
+ upstream: `http://${HOST_GATEWAY$1}:${port}`,
672
+ uri: `${resource.hosts.path}?domain={host}`
673
+ } } : {}
674
+ };
675
+ }
676
+ /** The port a local address answers on, defaulting by scheme. */
677
+ function portOf(address) {
678
+ try {
679
+ const { port, protocol } = new URL(address);
680
+ return port || (protocol === "https:" ? "443" : "80");
681
+ } catch {
682
+ return;
683
+ }
684
+ }
685
+ /**
686
+ * Where one file server answers, including the stage its name carries.
687
+ *
688
+ * The project is a label rather than a decoration: it is what keeps two
689
+ * checkouts from answering on one address. Omitted when there is no project to
690
+ * name, because an empty label makes `uploads..localhost` — a host nothing
691
+ * resolves and no certificate can be issued for.
692
+ */
693
+ function hostFor(resource, project) {
694
+ const label = resource.root && project ? stageOf(resource) : labelOf(resource);
695
+ if (resource.subdomain === WILDCARD_SUBDOMAIN) return [
696
+ WILDCARD_SUBDOMAIN,
697
+ stageOf(resource),
698
+ project,
699
+ LOCAL_TLD
700
+ ].filter(Boolean).join(".");
701
+ return [
702
+ label,
703
+ project,
704
+ LOCAL_TLD
705
+ ].filter(Boolean).join(".");
706
+ }
707
+ /**
708
+ * Where a resource answers, every host of it: {@link hostFor}'s, and each
709
+ * alias and redirect label under the project, carrying the stage as its own
710
+ * label does — `www-test.shop.localhost` for `gkm test`.
711
+ */
712
+ function hostsFor(resource, project) {
713
+ const stage = stageOf(resource);
714
+ const under = (label) => [
715
+ stage ? `${label}-${stage}` : label,
716
+ project,
717
+ LOCAL_TLD
718
+ ].filter(Boolean).join(".");
719
+ return {
720
+ host: hostFor(resource, project),
721
+ aliases: (resource.aliases ?? []).map(under),
722
+ redirects: (resource.redirects ?? []).map(under)
723
+ };
724
+ }
725
+ /**
726
+ * A resource's own label: its `subdomain` where it declared one, and a file
727
+ * server's own name — the label a deploy uses too — with the stage it carries
728
+ * kept, so `gkm test` and `gkm dev` still answer on different hosts.
729
+ */
730
+ function labelOf(resource) {
731
+ const own = resource.kind === "file-server" ? fileServerLabel(resource.id) : resource.subdomain;
732
+ if (!own) return resource.name;
733
+ const stage = stageOf(resource);
734
+ return stage ? `${own}-${stage}` : own;
735
+ }
736
+ /** The stage a resource's name carries, or nothing for the local stage's. */
737
+ function stageOf(resource) {
738
+ const base = resource.id.toLowerCase();
739
+ return resource.name === base ? void 0 : resource.name.slice(base.length + 1);
740
+ }
741
+ /**
742
+ * The static root config, which only ever imports.
743
+ *
744
+ * Written once and identical for every stage, because the *sites* are what
745
+ * differ and they live in their own files. That split is not tidiness: one
746
+ * container serves every stage — the same way one Postgres holds `orders` and
747
+ * `orders_test` — so a single Caddyfile would mean `gkm test` deleting the
748
+ * routes `gkm dev` is serving, and each command silently breaking the other.
749
+ */
750
+ function caddyfileRoot() {
751
+ return `${GENERATED}
752
+ {
753
+ # No ACME, no public DNS: each stage's certificate is gkm's, beside its
754
+ # routes, and the names are local.
755
+ auto_https disable_redirects
756
+ }
757
+
758
+ # One file per stage, so two stages share this edge the way they already share
759
+ # one Postgres and one MinIO.
760
+ import ${CADDY_SITES_IN_CONTAINER}/*.caddy
761
+ `;
762
+ }
763
+ /**
764
+ * One stage's sites, as the file imported above.
765
+ *
766
+ * `rewrite` rather than a path prefix on the address: the bucket is the
767
+ * origin's business, and the client asks for the key it stored.
768
+ *
769
+ * `header_up Host {upstream_hostport}` matters more than it looks. MinIO routes
770
+ * and signs on the Host header, so forwarding the requested hostname would make
771
+ * it look for a bucket named after the domain.
772
+ */
773
+ function toCaddyfile(sites, options) {
774
+ if (sites.length === 0) return `${GENERATED}
775
+ # No file server is declared in this stage, so it routes nothing.
776
+ `;
777
+ const port = options.port && options.port !== 443 ? `:${options.port}` : "";
778
+ const blocks = sites.map(({ host, upstream, rewrite, processors, tenants, aliases, redirects }) => {
779
+ const proxy = `reverse_proxy ${upstream} {${rewrite ? `
780
+ rewrite ${rewrite}
781
+ # MinIO routes and signs on the Host header, so forwarding the requested
782
+ # hostname would make it look for a bucket named after the domain.
783
+ header_up Host {upstream_hostport}` : `
784
+ # The application reads whatever address was injected, so it has to see
785
+ # the one a caller used — that is what makes a redirect, a cookie domain
786
+ # and a generated link point back here rather than at the upstream.
787
+ header_up Host {host}
788
+ header_up X-Forwarded-Proto {scheme}`}
789
+ }`;
790
+ const redirectBlocks = (redirects ?? []).map((from) => `
791
+ https://${from} {
792
+ tls ${options.certificate} ${options.certificate}
793
+
794
+ redir https://${host}${port}{uri} permanent
795
+ }`).join("");
796
+ return `
797
+ ${[host, ...aliases ?? []].map((name) => `https://${name}`).join(", ")} {
798
+ tls ${options.certificate} ${options.certificate}
799
+
800
+ ${clientIpRule(options.edgeToken)}
801
+ ${processors ? `
802
+ # Its processors' patterns, to the dev server holding them — under the
803
+ # route it mounts them on. Answered there, so the bucket below never is.
804
+ @processors path ${processors.prefixes.map((prefix) => `${prefix}*`).join(" ")}
805
+ handle @processors {
806
+ reverse_proxy ${processors.upstream} {
807
+ rewrite ${processors.under}{uri}
808
+ header_up Host {host}
809
+ }
810
+ }
811
+ ` : ""}${tenants ? tenantBlock(tenants, proxy) : ` ${proxy}`}
812
+ }${redirectBlocks}`;
813
+ });
814
+ return `${GENERATED}${blocks.join("\n")}\n`;
815
+ }
816
+ /**
817
+ * A wildcard site's routes: a protected host refused, every other host asked
818
+ * about before it is proxied. `handle` blocks rather than bare directives,
819
+ * because Caddy orders directives itself and would proxy before it refused.
820
+ */
821
+ function tenantBlock(tenants, proxy) {
822
+ return `${tenants.protected.length ? `
823
+ # Labels an app answers on, or that the workspace protects: never a
824
+ # tenant's, whether or not anything is running on them.
825
+ @protected host ${tenants.protected.join(" ")}
826
+ handle @protected {
827
+ respond 404
828
+ }
829
+ ` : ""}
830
+ handle {${tenants.hosts ? `
831
+ # Which hosts are tenants is the app's to say: its \`hosts\` route
832
+ # answers 200 to serve this one, and anything else goes back as is.
833
+ forward_auth ${tenants.hosts.upstream} {
834
+ uri ${tenants.hosts.uri}
835
+ }
836
+ ` : ""}
837
+ ${proxy.replaceAll("\n", "\n ")}
838
+ }`;
839
+ }
840
+ const GENERATED = `# Generated by gkm from the construct manifest — do not edit.
841
+ #
842
+ # One host per declared file server, in front of the object store that holds its
843
+ # objects. This is the shape a file server has deployed — a domain serving a
844
+ # bucket — which MinIO alone cannot produce: its virtual-host mode reads the
845
+ # leading label as the bucket name.
846
+ #
847
+ # Certificates come from gkm's local CA. "gkm dev" and "gkm test" point Node at
848
+ # its root, so nothing has to be installed to use these URLs from code; a
849
+ # browser needs the root trusted once ("gkm trust").
850
+ `;
851
+ /**
852
+ * The lines every site block of an edge opens with, for gkm's own
853
+ * `x-gkm-client-ip` — the client address the auth server rate-limits by.
854
+ *
855
+ * Only a service of this stack may send it. One that calls a sibling at its
856
+ * public address comes through this edge, and proves where it comes from with
857
+ * the stack's token (`x-gkm-edge-token`), derived from the stage's seed and
858
+ * handed to every process of the stack — never to a browser. A request
859
+ * without it has the header removed, so nobody outside can choose the address
860
+ * they are rate-limited by. Without a token, it is removed from every request.
861
+ */
862
+ function clientIpRule(edgeToken) {
863
+ if (!edgeToken) return `
864
+ # gkm's own header, which only a service of this stack may send: the auth
865
+ # server rate-limits by the client address it carries.
866
+ request_header -${CLIENT_IP_HEADER}`;
867
+ return `
868
+ # gkm's own header, which only a service of this stack may send — proven by
869
+ # the stack's token: the auth server rate-limits by the client address it
870
+ # carries. Removed from every other request.
871
+ @gkm_outside not header ${EDGE_TOKEN_HEADER} ${edgeToken}
872
+ request_header @gkm_outside -${CLIENT_IP_HEADER}`;
873
+ }
874
+ //#endregion
469
875
  //#region src/reconcile/emulator.ts
470
876
  /**
471
877
  * The AWS emulator (floci, LocalStack-compatible) the `sns` backend runs on
@@ -600,6 +1006,465 @@ function watchedBuckets(manifest, subscribers) {
600
1006
  return watched;
601
1007
  }
602
1008
  //#endregion
1009
+ //#region src/telemetry/edges.ts
1010
+ /**
1011
+ * Which processes use a `Telemetry` node — read off the manifest's edges.
1012
+ *
1013
+ * A process uses telemetry when its own declaration names the node: a
1014
+ * surface's `telemetry`, a worker's. A surface's process runs its own
1015
+ * endpoints, so a worker's edge never counts for it.
1016
+ *
1017
+ * A site's edge is recorded and never followed here: a site is handed none of
1018
+ * the node's keys (see `PUBLIC.telemetry`).
1019
+ */
1020
+ /** The `OTEL_*` keys a `Telemetry` node provides. */
1021
+ const TELEMETRY_ENV_KEYS = TELEMETRY_KEYS;
1022
+ /** Whether `key` is one of the keys a `Telemetry` node provides. */
1023
+ function isTelemetryKey(key) {
1024
+ return TELEMETRY_ENV_KEYS.includes(key);
1025
+ }
1026
+ /** The node a declaration's `telemetry` edge names, when it names one. */
1027
+ function nodeOf(manifest, id) {
1028
+ if (!id) return void 0;
1029
+ const node = manifest[id];
1030
+ return node?.kind === "telemetry" ? node : void 0;
1031
+ }
1032
+ /**
1033
+ * The `Telemetry` node the process for `id` — a surface, a worker, or a file
1034
+ * server's processor unit, by construct id — emits through, or undefined
1035
+ * when it has no edge to one.
1036
+ */
1037
+ function telemetryOf(manifest, id) {
1038
+ const declaration = manifest[id];
1039
+ if (!declaration) return void 0;
1040
+ if (declaration.kind === "worker" || declaration.kind === "file-server") return nodeOf(manifest, declaration.telemetry);
1041
+ if (declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") return void 0;
1042
+ return nodeOf(manifest, declaration.telemetry);
1043
+ }
1044
+ /**
1045
+ * The `Telemetry` node the app `appName` emits through — its surface's, or
1046
+ * undefined for a site, an app without one, or one with no edge.
1047
+ */
1048
+ function appTelemetry(manifest, appName) {
1049
+ const id = Object.entries(manifest).find(([id, d]) => (d.kind === "rest-api" || d.kind === "websocket-api") && appKey(id) === appName)?.[0];
1050
+ return id ? telemetryOf(manifest, id) : void 0;
1051
+ }
1052
+ /** Whether any process in the manifest emits through a `Telemetry` node. */
1053
+ function usesTelemetry(manifest) {
1054
+ return Object.entries(manifest).some(([id, d]) => (d.kind === "rest-api" || d.kind === "websocket-api" || d.kind === "worker" || d.kind === "file-server") && telemetryOf(manifest, id) !== void 0);
1055
+ }
1056
+ /**
1057
+ * One process's share of the telemetry keys a stage resolved: all of them,
1058
+ * named for the process, when it has an edge to the node — and none
1059
+ * otherwise.
1060
+ *
1061
+ * `env` is everything else the process is handed; its `OTEL_*` keys are
1062
+ * replaced, never merged, so a process without the edge cannot inherit them.
1063
+ */
1064
+ function scopeTelemetryEnv(env, options) {
1065
+ const scoped = Object.fromEntries(Object.entries(env).filter(([key]) => !isTelemetryKey(key)));
1066
+ if (!options.uses || !options.telemetry) return scoped;
1067
+ const values = Object.fromEntries(Object.entries(options.telemetry).filter(([key]) => isTelemetryKey(key)));
1068
+ if (!values.OTEL_EXPORTER_OTLP_ENDPOINT) return scoped;
1069
+ return {
1070
+ ...scoped,
1071
+ ...values,
1072
+ OTEL_SERVICE_NAME: options.serviceName
1073
+ };
1074
+ }
1075
+ /** Whether the site `siteId` has an edge to a `Telemetry` node. */
1076
+ function siteUsesTelemetry(manifest, siteId) {
1077
+ const site = manifest[siteId];
1078
+ return site?.kind === "site" && nodeOf(manifest, site.telemetry) !== void 0;
1079
+ }
1080
+ /**
1081
+ * Whether the client of the surface `surfaceId` propagates trace context:
1082
+ * when a site that calls it has an edge to a `Telemetry` node. One client
1083
+ * serves every site that calls the surface on the host, so one with the
1084
+ * edge turns it on; a site's image generates its own, from its own edge.
1085
+ */
1086
+ function surfaceClientTraced(manifest, surfaceId) {
1087
+ return Object.entries(manifest).some(([id, d]) => d.kind === "site" && siteUsesTelemetry(manifest, id) && d.dependencies.some((edge) => edge.target === surfaceId));
1088
+ }
1089
+ /**
1090
+ * Whether the site app `appName`'s clients propagate trace context, and at
1091
+ * what rate: when the site has an edge to a `Telemetry` construct, at the
1092
+ * stage's sample rate — a public value, every trace locally — and not at all
1093
+ * for a stage that sends no telemetry.
1094
+ */
1095
+ function siteClientTelemetry(manifest, appName, workspace, stage) {
1096
+ const id = Object.entries(manifest).find(([id, d]) => d.kind === "site" && appKey(id) === appName)?.[0];
1097
+ if (!id || !siteUsesTelemetry(manifest, id)) return void 0;
1098
+ const sampleRate = stageSampleRate(workspace.deploy?.telemetry, stage ?? workspace.stages.local, !stage || stage === workspace.stages.local);
1099
+ return sampleRate === void 0 ? void 0 : { sampleRate };
1100
+ }
1101
+ /** The label a log UI answers on when the workspace declares no `Telemetry`. */
1102
+ const DEFAULT_TELEMETRY_ID = "Telemetry";
1103
+ /**
1104
+ * Two `Telemetry` nodes declare different labels or images for the one
1105
+ * OpenObserve a stack runs.
1106
+ */
1107
+ var TelemetryNodesDisagree = class extends GkmError {
1108
+ field;
1109
+ ids;
1110
+ constructor(field, ids) {
1111
+ super(`A stack runs one OpenObserve for every Telemetry node, and ${ids.join(", ")} give it different ${field === "subdomain" ? "labels" : "images"}. Give each the same ${field}${field === "subdomain" ? " (each defaults to its id kebab-cased)" : ""}.`);
1112
+ this.field = field;
1113
+ this.ids = ids;
1114
+ this.name = "TelemetryNodesDisagree";
1115
+ }
1116
+ };
1117
+ /**
1118
+ * The stack's one OpenObserve, as the workspace's `Telemetry` nodes declare
1119
+ * it: the label its UI answers on (`hostLabels`: `subdomain`, else the id
1120
+ * kebab-cased) and the image it runs, where a node names one.
1121
+ *
1122
+ * @throws {TelemetryNodesDisagree} when two nodes declare different ones
1123
+ */
1124
+ function stackTelemetry(manifest) {
1125
+ const nodes = Object.values(manifest).filter((d) => d.kind === "telemetry").sort((a, b) => a.id.localeCompare(b.id));
1126
+ const labels = [...new Set((nodes.length ? nodes : [{ id: DEFAULT_TELEMETRY_ID }]).map((node) => hostLabels(node).primary))];
1127
+ if (labels.length > 1) throw new TelemetryNodesDisagree("subdomain", nodes.map((node) => node.id));
1128
+ const images = [...new Set(nodes.flatMap((node) => node.image ?? []))];
1129
+ if (images.length > 1) throw new TelemetryNodesDisagree("image", nodes.filter((node) => node.image).map((node) => node.id));
1130
+ return {
1131
+ label: labels[0],
1132
+ ...images[0] ? { image: images[0] } : {}
1133
+ };
1134
+ }
1135
+ //#endregion
1136
+ //#region src/reconcile/plan.ts
1137
+ /**
1138
+ * The reconcile plan — what a manifest wants to exist, for one stage.
1139
+ *
1140
+ * Pure. Turning the plan into running containers and provisioned resources is
1141
+ * the applier's job; deciding *what* should exist is this, so the decisions can
1142
+ * be asserted as data rather than by starting Docker.
1143
+ *
1144
+ * One plan serves every stage. `gkm dev` reconciles `development` and `gkm test`
1145
+ * reconciles `test`; they differ only in what the resources are called, never in
1146
+ * what infrastructure exists. Roles are cluster-scoped in Postgres while grants
1147
+ * are per-object, so one container and one role pair serve both.
1148
+ */
1149
+ /**
1150
+ * Which container serves a kind.
1151
+ *
1152
+ * Derived kinds map to the same container as their parent — a schema tenant
1153
+ * lives in its parent's Postgres — so the set is deduplicated rather than
1154
+ * counted.
1155
+ */
1156
+ const CONTAINERS = {
1157
+ database: "postgres",
1158
+ "database-reader": "postgres",
1159
+ "database-schema": "postgres",
1160
+ objects: "minio",
1161
+ "file-server": "caddy",
1162
+ email: "mailpit",
1163
+ inbox: "mailpit",
1164
+ "websocket-api": "redis"
1165
+ };
1166
+ /**
1167
+ * The container a cache backend needs locally.
1168
+ *
1169
+ * Each one matches the protocol its deployed form speaks, which is the property
1170
+ * worth having: a cache that behaves differently in the two places is worse than
1171
+ * a slower one.
1172
+ *
1173
+ * `db` is deliberately absent, the same way `pgboss` is absent from
1174
+ * `EVENT_CONTAINERS`: the cache is a table in a database the manifest already
1175
+ * declares, so mapping it here would start a container for a project that needs
1176
+ * none.
1177
+ */
1178
+ const CACHE_CONTAINERS = {
1179
+ upstash: "redis-http",
1180
+ elasticache: "redis",
1181
+ redis: "redis"
1182
+ };
1183
+ /**
1184
+ * Kinds that resolve a value without anything running.
1185
+ *
1186
+ * A secret is the case: it has no address, so there is nothing to start and
1187
+ * nothing to connect to — but it still appears in the plan, because the target
1188
+ * still has to resolve it.
1189
+ */
1190
+ const CONTAINERLESS = {
1191
+ secret: true,
1192
+ credential: true,
1193
+ encryption: true,
1194
+ "rest-api": true,
1195
+ site: true,
1196
+ "mobile-app": true,
1197
+ "external-api": true,
1198
+ telemetry: true
1199
+ };
1200
+ /** The container that collects telemetry locally, and serves its UI. */
1201
+ const TELEMETRY_CONTAINER = "openobserve";
1202
+ /**
1203
+ * Containers that cannot run alone.
1204
+ *
1205
+ * The one case is the cache: `serverless-redis-http` is a proxy and needs the
1206
+ * Redis it proxies. Kept here rather than in the compose definition so the plan
1207
+ * -- which is what decides what must be running -- still names everything.
1208
+ */
1209
+ const REQUIRES = { "redis-http": ["redis"] };
1210
+ /**
1211
+ * The role each kind's one key plays, where it is not a URL.
1212
+ *
1213
+ * The twin of `ProvidesByKind` in `@geekmidas/manifest`: that is what a
1214
+ * construct declares, this is what the local target resolves, and both derive
1215
+ * the key from the same `providedKeyFor` so they cannot disagree.
1216
+ */
1217
+ const ROLES = {
1218
+ queue: "publisherConnectionString",
1219
+ topic: "publisherConnectionString",
1220
+ credential: "credentials",
1221
+ "mobile-app": "scheme",
1222
+ objects: "connectionString"
1223
+ };
1224
+ /** The kinds whose container is the events backend's rather than their own. */
1225
+ const EVENT_KINDS = {
1226
+ queue: true,
1227
+ topic: true
1228
+ };
1229
+ /**
1230
+ * Which kinds provision something *inside* their container.
1231
+ *
1232
+ * A database creates a database, a bucket creates a bucket; mail creates
1233
+ * nothing — Mailpit accepts whatever is sent to it and has no per-stage object
1234
+ * to name. Both still appear in the plan, because both still resolve a URL; the
1235
+ * flag is the difference between "must be running" and "must be created".
1236
+ */
1237
+ const PROVISIONS = {
1238
+ database: true,
1239
+ "database-reader": true,
1240
+ "database-schema": true,
1241
+ objects: true,
1242
+ cache: true,
1243
+ "file-server": true
1244
+ };
1245
+ /**
1246
+ * The container each events backend needs, where it needs one of its own.
1247
+ *
1248
+ * `pgboss` is deliberately absent rather than mapped to `postgres`: it is a
1249
+ * schema tenant in a database the manifest already declares, so mapping it here
1250
+ * would start a Postgres for a project that declared no database at all.
1251
+ *
1252
+ * This one comes from config rather than from a declaration because there are
1253
+ * no `topic` or `queue` kinds yet. When they land the mapping moves to
1254
+ * {@link CONTAINERS} keyed by kind, and this constant goes with them.
1255
+ */
1256
+ const EVENT_CONTAINERS = {
1257
+ sns: "localstack",
1258
+ rabbitmq: "rabbitmq"
1259
+ };
1260
+ /** The backend a project gets when it declares queues or topics and says nothing. */
1261
+ const DEFAULT_EVENTS = "pgboss";
1262
+ /**
1263
+ * How a resource of each kind separates its stage suffix.
1264
+ *
1265
+ * Postgres identifiers are snake_case and a hyphen would need quoting
1266
+ * everywhere; buckets and queues are kebab and disallow underscores in some
1267
+ * providers. The suffix is the same word either way.
1268
+ */
1269
+ const SEPARATORS = {
1270
+ database: "_",
1271
+ "database-reader": "_",
1272
+ "database-schema": "_",
1273
+ objects: "-"
1274
+ };
1275
+ /**
1276
+ * The stage-scoped name for a resource.
1277
+ *
1278
+ * The local stage carries no suffix, so `gkm dev` keeps using `orders` and a
1279
+ * developer's psql history, saved connections, and muscle memory survive a
1280
+ * change of stage name. Every other stage is suffixed.
1281
+ */
1282
+ function resourceName(id, kind, stage, localStage) {
1283
+ const base = id.toLowerCase();
1284
+ if (stage === localStage) return base;
1285
+ return `${base}${SEPARATORS[kind] ?? "-"}${stage}`;
1286
+ }
1287
+ /**
1288
+ * The container a kind needs, or `undefined` if it needs none.
1289
+ *
1290
+ * Queues and topics have no container of their own — they live in whichever
1291
+ * broker the project selected, which is why the backend is an argument here
1292
+ * rather than a second pass that adds containers after the fact.
1293
+ */
1294
+ function containerFor(kind, events = DEFAULT_EVENTS, cache = DEFAULT_CACHE.aws, derived = false, edge = true) {
1295
+ if (EVENT_KINDS[kind]) return EVENT_CONTAINERS[events] ?? CONTAINERS.database;
1296
+ if (kind === "file-server") return edge ? "caddy" : CONTAINERS.objects;
1297
+ if (kind === "cache") {
1298
+ if (derived && !holdsEveryCache(cache)) return CONTAINERS.database;
1299
+ return CACHE_CONTAINERS[cache] ?? CONTAINERS.database;
1300
+ }
1301
+ return CONTAINERS[kind];
1302
+ }
1303
+ /**
1304
+ * Build the plan for a manifest and stage.
1305
+ *
1306
+ * `order` is the caller's provisioning order — parents before children — which
1307
+ * `provisionOrder` produces from the manifest. Passing it in keeps this
1308
+ * function free of the traversal and makes the ordering assertable on its own.
1309
+ */
1310
+ function planFor(manifest, stage, order, options = {}) {
1311
+ const containers = /* @__PURE__ */ new Set();
1312
+ const resources = [];
1313
+ const fakes = {};
1314
+ const events = options.events ?? "pgboss";
1315
+ const cache = options.cache ?? DEFAULT_CACHE.aws;
1316
+ for (const id of order) {
1317
+ const declaration = manifest[id];
1318
+ if (!declaration) continue;
1319
+ const local = declaration.kind === "external-api" ? options.fakes?.[id] : void 0;
1320
+ const fake = local && {
1321
+ key: fakeKey(id),
1322
+ ...local
1323
+ };
1324
+ if (fake) fakes[fake.key] = {
1325
+ id,
1326
+ ...fake.image ? {
1327
+ image: fake.image,
1328
+ port: fake.port
1329
+ } : {}
1330
+ };
1331
+ const detached = declaration.kind === "cache" && holdsEveryCache(cache);
1332
+ const container = fake?.image ? fake.key : declaration.kind === "telemetry" ? usesTelemetry(manifest) ? TELEMETRY_CONTAINER : void 0 : containerFor(declaration.kind, events, cache, "of" in declaration && typeof declaration.of === "string", options.edge !== false);
1333
+ if (!container && !CONTAINERLESS[declaration.kind]) continue;
1334
+ if (container) {
1335
+ containers.add(container);
1336
+ for (const required of REQUIRES[container] ?? []) containers.add(required);
1337
+ }
1338
+ resources.push({
1339
+ id,
1340
+ kind: declaration.kind,
1341
+ ...container ? { container } : {},
1342
+ name: resourceName(id, declaration.kind, stage, options.localStage),
1343
+ envKey: providedKeyFor(id, declaration.kind, ROLES[declaration.kind] ?? "url"),
1344
+ provisions: PROVISIONS[declaration.kind] === true,
1345
+ ...declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "objects" || declaration.kind === "file-server" ? { callers: dependentsOf(manifest, id) } : {},
1346
+ ...declaration.kind === "site" ? { publicEnv: publicEnvFor(declaration, manifest) } : {},
1347
+ ...isPublicDeclaration(declaration) && imageOriginSources(declaration, manifest).length > 0 ? { imageOrigins: {
1348
+ key: `${PUBLIC_PREFIX[declaration.variant]}${IMAGE_ORIGINS_KEY}`,
1349
+ sources: imageOriginSources(declaration, manifest)
1350
+ } } : {},
1351
+ ...declaration.kind === "mobile-app" ? {
1352
+ publicEnv: publicEnvFor(declaration, manifest),
1353
+ ...declaration.scheme ? { scheme: declaration.scheme } : {}
1354
+ } : {},
1355
+ ...declaration.kind === "file-server" && declaration.open?.length ? { open: declaration.open } : {},
1356
+ ...declaration.kind === "file-server" && declaration.processors?.length ? { processors: [...new Set(declaration.processors.map((p) => p.prefix))].sort() } : {},
1357
+ ...declaration.kind === "email" && declaration.from ? { from: declaration.from } : {},
1358
+ ...declaration.kind === "inbox" ? { inbox: {
1359
+ addresses: declaration.addresses,
1360
+ subdomains: declaration.subdomains === true,
1361
+ topic: declaration.topic
1362
+ } } : {},
1363
+ ...declaration.kind === "objects" && bucketExpiry(manifest, id) ? { expire: bucketExpiry(manifest, id) } : {},
1364
+ ...(declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
1365
+ ...isHostedDeclaration(declaration) && hostLabels(declaration).aliases.length ? { aliases: [...hostLabels(declaration).aliases] } : {},
1366
+ ...isHostedDeclaration(declaration) && hostLabels(declaration).redirects.length ? { redirects: [...hostLabels(declaration).redirects] } : {},
1367
+ ...isWildcardSite(declaration) ? {
1368
+ protectedSubdomains: protectedSubdomains(manifest, options.protectedSubdomains),
1369
+ ...declaration.hosts ? { hosts: declaration.hosts } : {}
1370
+ } : {},
1371
+ ...fake ? { fake: {
1372
+ key: fake.key,
1373
+ credentials: fake.credentials
1374
+ } } : {},
1375
+ ...declaration.kind === "external-api" && !fake ? { url: declaration.url } : {},
1376
+ ...declaration.kind === "credential" && options.credentialFakes?.[id] !== void 0 ? { fakeCredentials: options.credentialFakes[id] } : {},
1377
+ ...declaration.kind === "secret" && (declaration.length !== void 0 || declaration.symbols !== void 0) ? { format: {
1378
+ ...declaration.length !== void 0 ? { length: declaration.length } : {},
1379
+ ...declaration.symbols !== void 0 ? { symbols: declaration.symbols } : {}
1380
+ } } : {},
1381
+ ..."of" in declaration && !detached ? { of: declaration.of } : {},
1382
+ ..."schema" in declaration && declaration.schema ? { schema: declaration.schema } : {},
1383
+ ..."version" in declaration && declaration.version ? { version: declaration.version } : {},
1384
+ ..."image" in declaration && declaration.image ? { image: declaration.image } : {},
1385
+ ..."extensions" in declaration && declaration.extensions?.length ? { extensions: declaration.extensions } : {},
1386
+ ..."roles" in declaration && declaration.roles === false ? { roles: false } : {},
1387
+ ..."table" in declaration && declaration.table && !detached ? { table: declaration.table } : {}
1388
+ });
1389
+ }
1390
+ if (options.edge !== false && resources.some((r) => EDGE_KINDS[r.kind] === true)) containers.add("caddy");
1391
+ for (const extra of options.extraContainers ?? []) containers.add(extra);
1392
+ if (events === "pgboss" && resources.some((r) => EVENT_KINDS[r.kind]) && !resources.some((r) => r.kind === "database")) throw new PgBossNeedsDatabase(resources.filter((r) => EVENT_KINDS[r.kind]).map((r) => r.id));
1393
+ if (cache === "db") {
1394
+ const placeless = resources.filter((r) => r.kind === "cache" && !r.of);
1395
+ if (placeless.length > 0) {
1396
+ const databases = resources.filter((r) => r.kind === "database");
1397
+ const [only] = databases;
1398
+ if (!only) throw new CacheNeedsDatabase(resources.filter((r) => r.kind === "cache").map((r) => r.id));
1399
+ if (databases.length > 1) throw new CacheIsAmbiguous(placeless.map((r) => r.id), databases.map((r) => r.id));
1400
+ for (const resource of placeless) resource.of = only.id;
1401
+ }
1402
+ }
1403
+ const sites = resources.filter((r) => r.kind === "site" && r.subdomain !== WILDCARD_SUBDOMAIN);
1404
+ const root = rootSite(sites.map((r) => {
1405
+ const declared = manifest[r.id];
1406
+ return {
1407
+ name: appKey(r.id),
1408
+ ...declared?.kind === "site" && declared.root ? { root: true } : {}
1409
+ };
1410
+ }));
1411
+ for (const site of sites) if (appKey(site.id) === root) site.root = true;
1412
+ const workerBroker = events === "pgboss" && Object.values(manifest).some((d) => d?.kind === "worker") && resources.some((r) => r.kind === "database");
1413
+ return {
1414
+ stage,
1415
+ events,
1416
+ cache,
1417
+ containers: [...containers],
1418
+ resources,
1419
+ ...Object.keys(fakes).length ? { fakes } : {},
1420
+ ...workerBroker ? { workerBroker: true } : {}
1421
+ };
1422
+ }
1423
+ /**
1424
+ * Queues or topics were declared with pg-boss and no database to hold them.
1425
+ *
1426
+ * Not a reconcile failure but a manifest one: the fix is a line of application
1427
+ * code either way — declare a database, or select a backend that brings its own
1428
+ * broker.
1429
+ */
1430
+ var CacheNeedsDatabase = class extends GkmError {
1431
+ ids;
1432
+ constructor(ids) {
1433
+ super(`A cache backed by the database needs a declared database, and none was declared, and on this deploy target that is where a cache lives. Declare one. Caches affected: ${ids.join(", ")}.`);
1434
+ this.ids = ids;
1435
+ this.name = "CacheNeedsDatabase";
1436
+ }
1437
+ };
1438
+ /**
1439
+ * A `'db'` cache — a server target's default — in an app that declares more
1440
+ * than one database.
1441
+ *
1442
+ * The target says *a* database and the graph offers several, so there is no
1443
+ * answer to give — and the wrong kind of failure would be to pick one, since a
1444
+ * cache silently landing in the wrong database is a bug that surfaces as
1445
+ * missing rows much later. The fix is a stronger statement in application code:
1446
+ * `orders.cache('Sessions')` names the database, which is a fact about the
1447
+ * application rather than a deployment choice.
1448
+ */
1449
+ var CacheIsAmbiguous = class extends GkmError {
1450
+ ids;
1451
+ databases;
1452
+ constructor(ids, databases) {
1453
+ super(`A cache backed by the database needs to know which one, and this app declares ${databases.length}: ${databases.join(", ")}. Declare the cache from its database — e.g. ${databases[0]}.cache('Sessions') — rather than as a bare new Cache(). Caches affected: ${ids.join(", ")}.`);
1454
+ this.ids = ids;
1455
+ this.databases = databases;
1456
+ this.name = "CacheIsAmbiguous";
1457
+ }
1458
+ };
1459
+ var PgBossNeedsDatabase = class extends GkmError {
1460
+ ids;
1461
+ constructor(ids) {
1462
+ super(`pg-boss keeps its queues in a declared database, and none was declared. Declare one: on this deploy target, events are carried by pg-boss. Queues and topics affected: ${ids.join(", ")}.`);
1463
+ this.ids = ids;
1464
+ this.name = "PgBossNeedsDatabase";
1465
+ }
1466
+ };
1467
+ //#endregion
603
1468
  //#region src/compose/redis.ts
604
1469
  /**
605
1470
  * The stack's Redis: what every declared cache lives in when a workspace runs
@@ -1178,14 +2043,14 @@ async function prepareEntryCredentials(options) {
1178
2043
  const declaredKeys = [];
1179
2044
  let reconciled;
1180
2045
  if (workspace) {
1181
- const { reconcileWorkspace } = await import("./apps-DGod3aS9.mjs").then((n) => n.h);
2046
+ const { reconcileWorkspace } = await import("./apps-DrXwv-0A.mjs").then((n) => n.h);
1182
2047
  const result = await reconcileWorkspace(workspace, {
1183
2048
  stage: options.reconcileStage ?? workspace.stages.local,
1184
2049
  start: options.startDocker ?? false
1185
2050
  });
1186
2051
  reconciled = result;
1187
2052
  if (options.scoped && appName) {
1188
- const { appProcess, processEnv } = await import("./apps-DGod3aS9.mjs").then((n) => n.r);
2053
+ const { appProcess, processEnv } = await import("./apps-DrXwv-0A.mjs").then((n) => n.r);
1189
2054
  const own = processEnv(result.manifest, appProcess(workspace, result.manifest, result.background, appName), { ...credentials }, result.env);
1190
2055
  for (const key of Object.keys(credentials)) delete credentials[key];
1191
2056
  Object.assign(credentials, own);
@@ -1241,7 +2106,7 @@ function composeFor(plan, options) {
1241
2106
  const volumes = {};
1242
2107
  for (const container of [...plan.containers].sort()) {
1243
2108
  const declared = container === "postgres" ? plan.resources.find((r) => r.version)?.version : void 0;
1244
- const named = container === "postgres" ? declaredPostgresImage(plan) : void 0;
2109
+ const named = container === "postgres" ? declaredPostgresImage(plan) : container === "openobserve" ? declaredTelemetryImage(plan) : void 0;
1245
2110
  const fake = plan.fakes?.[container];
1246
2111
  const image = named ?? (declared ? postgresImage(declared) : fake?.image ?? DEFAULT_IMAGES[container]);
1247
2112
  if (!image) throw new UnknownContainer(container);
@@ -1307,6 +2172,13 @@ function declaredPostgresImage(plan) {
1307
2172
  })));
1308
2173
  return images[0];
1309
2174
  }
2175
+ /**
2176
+ * The image a `Telemetry` node named for OpenObserve, if one did — the same
2177
+ * one the stack runs (`stackTelemetry` refuses two that disagree).
2178
+ */
2179
+ function declaredTelemetryImage(plan) {
2180
+ return plan.resources.filter((r) => r.kind === "telemetry" && r.image).sort((a, b) => a.id.localeCompare(b.id))[0]?.image;
2181
+ }
1310
2182
  /** Two databases on the one local cluster named different images for it. */
1311
2183
  var ConflictingPostgresImages = class extends Error {
1312
2184
  databases;
@@ -1555,6 +2427,6 @@ var UnassignedPort = class extends Error {
1555
2427
  }
1556
2428
  };
1557
2429
  //#endregion
1558
- export { otlpHeaders as $, minioWebhookEnv as A, fakeKey as B, redisService as C, HOST_GATEWAY as D, withRedisPassword as E, emulatorEndpoint as F, serviceAddresses as G, portsOf as H, emulatorQueueUrl as I, LOGS_ORG as J, LOCAL_LOGS_EMAIL as K, emulatorTopicArn as L, watchedBuckets as M, EMULATOR_ACCESS_KEY_ID as N, NOTIFICATION_RULE_PREFIX as O, EMULATOR_REGION as P, logsService as Q, DEFAULT_IMAGES as R, STACK_CACHE as S, stackRedis as T, postgresImage as U, portKeys as V, primaryPortKey as W, LOGS_SERVICE as X, LOGS_PASSWORD_KEY as Y, logsAccess as Z, readLocalCredentials as _, createEntryWrapper as a, resolveHost as at, REDIS_PASSWORD_KEY as b, loadEnvFiles as c, prepareEntryCredentials as d, stackLogs as et, savePortState as f, postgresSuperuser as g, postgresRoleSlug as h, createCredentialsPreload as i, isMainFrontendApp as it, objectsWebhookToken as j, minioNotificationRule as k, loadPortState as l, loadLocalCredentials as m, composeFor as n, NoDomainForStage as nt, findAvailablePort as o, rootSite as ot, LOCAL_RABBITMQ_USER as p, LOGS_EMAIL_KEY as q, toYaml as r, getPublicUrlArgNames as rt, isPortAvailable as s, CLUSTER_DATABASE as t, withLogsPassword as tt, loadSecretsForApp as u, saveLocalCredentials as v, runsRedis as w, REDIS_SERVICE as x, withGeneratedSecrets as y, describeServices as z };
2430
+ export { clientIpRule as $, resourceName as A, NOTIFICATION_RULE_PREFIX as B, redisService as C, otlpHeaders as Ct, PgBossNeedsDatabase as D, getPublicUrlArgNames as Dt, withRedisPassword as E, NoDomainForStage as Et, stackTelemetry as F, EMULATOR_ACCESS_KEY_ID as G, minioWebhookEnv as H, surfaceClientTraced as I, emulatorQueueUrl as J, EMULATOR_REGION as K, telemetryOf as L, isTelemetryKey as M, scopeTelemetryEnv as N, TELEMETRY_CONTAINER as O, isMainFrontendApp as Ot, siteClientTelemetry as P, caddyfileRoot as Q, usesTelemetry as R, STACK_CACHE as S, logsService as St, stackRedis as T, withLogsPassword as Tt, objectsWebhookToken as U, minioNotificationRule as V, watchedBuckets as W, CADDY_SITES_IN_CONTAINER as X, emulatorTopicArn as Y, LOCAL_TLD as Z, readLocalCredentials as _, LOGS_SERVICE as _t, createEntryWrapper as a, DEFAULT_IMAGES as at, REDIS_PASSWORD_KEY as b, logsOnPort as bt, loadEnvFiles as c, portKeys as ct, prepareEntryCredentials as d, primaryPortKey as dt, hostFor as et, savePortState as f, serviceAddresses as ft, postgresSuperuser as g, LOGS_PASSWORD_KEY as gt, postgresRoleSlug as h, LOGS_ORG as ht, createCredentialsPreload as i, PROCESSORS_DEV_PREFIX as it, appTelemetry as j, planFor as k, resolveHost as kt, loadPortState as l, portsOf as lt, loadLocalCredentials as m, LOGS_EMAIL_KEY as mt, composeFor as n, sitesFor as nt, findAvailablePort as o, describeServices as ot, LOCAL_RABBITMQ_USER as p, LOCAL_LOGS_EMAIL as pt, emulatorEndpoint as q, toYaml as r, toCaddyfile as rt, isPortAvailable as s, fakeKey as st, CLUSTER_DATABASE as t, hostsFor as tt, loadSecretsForApp as u, postgresImage as ut, saveLocalCredentials as v, LogsPortTaken as vt, runsRedis as w, stackLogs as wt, REDIS_SERVICE as x, logsPorts as xt, withGeneratedSecrets as y, logsAccess as yt, HOST_GATEWAY as z };
1559
2431
 
1560
- //# sourceMappingURL=compose-CXgwCuqv.mjs.map
2432
+ //# sourceMappingURL=compose-BLOnkeaJ.mjs.map