@geekmidas/cli 10.0.0-alpha.122 → 10.0.0-alpha.124

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 (263) hide show
  1. package/dist/{EndpointGenerator-BDa6pPgE.cjs → EndpointGenerator-B2MUa4M2.cjs} +2 -2
  2. package/dist/{EndpointGenerator-BDa6pPgE.cjs.map → EndpointGenerator-B2MUa4M2.cjs.map} +1 -1
  3. package/dist/{EndpointGenerator-CP_z_E3e.mjs → EndpointGenerator-Z_BUTocT.mjs} +2 -2
  4. package/dist/{EndpointGenerator-CP_z_E3e.mjs.map → EndpointGenerator-Z_BUTocT.mjs.map} +1 -1
  5. package/dist/{GoDaddyProvider-BJ9j9mR7.cjs → GoDaddyProvider-0z5RAN1k.cjs} +3 -3
  6. package/dist/{GoDaddyProvider-BJ9j9mR7.cjs.map → GoDaddyProvider-0z5RAN1k.cjs.map} +1 -1
  7. package/dist/{GoDaddyProvider-wIKYdm7V.mjs → GoDaddyProvider-55x4o-4z.mjs} +3 -3
  8. package/dist/{GoDaddyProvider-wIKYdm7V.mjs.map → GoDaddyProvider-55x4o-4z.mjs.map} +1 -1
  9. package/dist/{HostingerProvider-BNpS9aRJ.mjs → HostingerProvider-Cjh_2Ml6.mjs} +2 -2
  10. package/dist/{HostingerProvider-BNpS9aRJ.mjs.map → HostingerProvider-Cjh_2Ml6.mjs.map} +1 -1
  11. package/dist/{HostingerProvider-DR1iws1P.cjs → HostingerProvider-OdQmKXE3.cjs} +2 -2
  12. package/dist/{HostingerProvider-DR1iws1P.cjs.map → HostingerProvider-OdQmKXE3.cjs.map} +1 -1
  13. package/dist/{LegacyStateStore-CkXUJP7i.mjs → LegacyStateStore-C-vumKSN.mjs} +3 -3
  14. package/dist/{LegacyStateStore-CkXUJP7i.mjs.map → LegacyStateStore-C-vumKSN.mjs.map} +1 -1
  15. package/dist/{LegacyStateStore-D1S87I_B.cjs → LegacyStateStore-DRpB-yC5.cjs} +3 -3
  16. package/dist/{LegacyStateStore-D1S87I_B.cjs.map → LegacyStateStore-DRpB-yC5.cjs.map} +1 -1
  17. package/dist/{LocalStateStore-DmXfpvu4.cjs → LocalStateStore-C3ummuDT.cjs} +2 -2
  18. package/dist/{LocalStateStore-DmXfpvu4.cjs.map → LocalStateStore-C3ummuDT.cjs.map} +1 -1
  19. package/dist/{LocalStateStore-BWoWeSq0.mjs → LocalStateStore-CtOjpV1w.mjs} +2 -2
  20. package/dist/{LocalStateStore-BWoWeSq0.mjs.map → LocalStateStore-CtOjpV1w.mjs.map} +1 -1
  21. package/dist/{OpenApiTsGenerator-CsrukCE-.mjs → OpenApiTsGenerator-MtnMQL_g.mjs} +2 -2
  22. package/dist/{OpenApiTsGenerator-CsrukCE-.mjs.map → OpenApiTsGenerator-MtnMQL_g.mjs.map} +1 -1
  23. package/dist/{OpenApiTsGenerator-FNhY7Ssz.cjs → OpenApiTsGenerator-t3_E98Fi.cjs} +2 -2
  24. package/dist/{OpenApiTsGenerator-FNhY7Ssz.cjs.map → OpenApiTsGenerator-t3_E98Fi.cjs.map} +1 -1
  25. package/dist/{S3StateStore-D19JSGE9.mjs → S3StateStore-BC4Jm3Tw.mjs} +2 -2
  26. package/dist/{S3StateStore-D19JSGE9.mjs.map → S3StateStore-BC4Jm3Tw.mjs.map} +1 -1
  27. package/dist/{S3StateStore-BEdsjjP4.cjs → S3StateStore-BeArp0aF.cjs} +2 -2
  28. package/dist/{S3StateStore-BEdsjjP4.cjs.map → S3StateStore-BeArp0aF.cjs.map} +1 -1
  29. package/dist/{SSMStateStore-7xKw0Zz9.mjs → SSMStateStore-Crl76aYZ.mjs} +2 -2
  30. package/dist/{SSMStateStore-7xKw0Zz9.mjs.map → SSMStateStore-Crl76aYZ.mjs.map} +1 -1
  31. package/dist/{SSMStateStore--2bcxoiH.cjs → SSMStateStore-DcstR6cW.cjs} +2 -2
  32. package/dist/{SSMStateStore--2bcxoiH.cjs.map → SSMStateStore-DcstR6cW.cjs.map} +1 -1
  33. package/dist/{SubscriberGenerator-C8CPxrCK.cjs → SubscriberGenerator-C3QTae-R.cjs} +237 -54
  34. package/dist/SubscriberGenerator-C3QTae-R.cjs.map +1 -0
  35. package/dist/{SubscriberGenerator-y3pncae_.mjs → SubscriberGenerator-COAVPgM-.mjs} +227 -56
  36. package/dist/SubscriberGenerator-COAVPgM-.mjs.map +1 -0
  37. package/dist/{add-DlFUKdjX.cjs → add-BFjb6mMq.cjs} +7 -7
  38. package/dist/{add-DlFUKdjX.cjs.map → add-BFjb6mMq.cjs.map} +1 -1
  39. package/dist/{add-Bu6FkaTn.mjs → add-CIjmgzkb.mjs} +6 -6
  40. package/dist/{add-Bu6FkaTn.mjs.map → add-CIjmgzkb.mjs.map} +1 -1
  41. package/dist/{bundler-Bg0lPDoi.cjs → bundler-CiUoIsku.cjs} +5 -5
  42. package/dist/{bundler-Bg0lPDoi.cjs.map → bundler-CiUoIsku.cjs.map} +1 -1
  43. package/dist/{bundler-CgE5XTyr.mjs → bundler-D6KFNpQk.mjs} +5 -5
  44. package/dist/{bundler-CgE5XTyr.mjs.map → bundler-D6KFNpQk.mjs.map} +1 -1
  45. package/dist/{cli-z5S3bHyK.mjs → cli-DNtSTtMc.mjs} +4 -4
  46. package/dist/{cli-z5S3bHyK.mjs.map → cli-DNtSTtMc.mjs.map} +1 -1
  47. package/dist/{cli-Cvjlnpon.cjs → cli-r4eUr98C.cjs} +4 -4
  48. package/dist/{cli-Cvjlnpon.cjs.map → cli-r4eUr98C.cjs.map} +1 -1
  49. package/dist/{compose-bKLAtHLj.cjs → compose-BfXXWJSp.cjs} +362 -59
  50. package/dist/compose-BfXXWJSp.cjs.map +1 -0
  51. package/dist/{compose-CgBPA44v.mjs → compose-DJvvmF3X.mjs} +336 -33
  52. package/dist/compose-DJvvmF3X.mjs.map +1 -0
  53. package/dist/{config-D48erO2j.d.mts → config-IgK6YaGp.d.cts} +3 -4
  54. package/dist/config-IgK6YaGp.d.cts.map +1 -0
  55. package/dist/{config-DHDtsQrB.d.cts → config-kE-p5hxq.d.mts} +3 -4
  56. package/dist/config-kE-p5hxq.d.mts.map +1 -0
  57. package/dist/config.cjs +2 -2
  58. package/dist/config.d.cts +3 -3
  59. package/dist/config.d.mts +3 -3
  60. package/dist/config.mjs +2 -2
  61. package/dist/{credentialSchemas-B67WJOOm.cjs → credentialSchemas-AhIBuQxQ.cjs} +2 -2
  62. package/dist/{credentialSchemas-B67WJOOm.cjs.map → credentialSchemas-AhIBuQxQ.cjs.map} +1 -1
  63. package/dist/{credentialSchemas-DDOLRCLF.mjs → credentialSchemas-DLKbxYBy.mjs} +2 -2
  64. package/dist/{credentialSchemas-DDOLRCLF.mjs.map → credentialSchemas-DLKbxYBy.mjs.map} +1 -1
  65. package/dist/{credentials-Zqr3QQYB.cjs → credentials-D7XJypNd.cjs} +173 -3
  66. package/dist/credentials-D7XJypNd.cjs.map +1 -0
  67. package/dist/{credentials-B5N5yKk6.mjs → credentials-DpfnUvIR.mjs} +132 -4
  68. package/dist/credentials-DpfnUvIR.mjs.map +1 -0
  69. package/dist/deploy/public.cjs +16 -17
  70. package/dist/deploy/public.cjs.map +1 -1
  71. package/dist/deploy/public.d.cts +3 -5
  72. package/dist/deploy/public.d.cts.map +1 -1
  73. package/dist/deploy/public.d.mts +3 -5
  74. package/dist/deploy/public.d.mts.map +1 -1
  75. package/dist/deploy/public.mjs +11 -12
  76. package/dist/deploy/public.mjs.map +1 -1
  77. package/dist/{deploy-CI85F6dr.cjs → deploy-BbI1UMh3.cjs} +477 -156
  78. package/dist/deploy-BbI1UMh3.cjs.map +1 -0
  79. package/dist/{deploy-Ddy8UBoE.mjs → deploy-CiRYwFmr.mjs} +456 -117
  80. package/dist/deploy-CiRYwFmr.mjs.map +1 -0
  81. package/dist/{discover-C5roJuc9.mjs → discover-BvJOVsYG.mjs} +66 -14
  82. package/dist/discover-BvJOVsYG.mjs.map +1 -0
  83. package/dist/{discover-DozUKs8f.cjs → discover-ojkcbxHw.cjs} +88 -12
  84. package/dist/discover-ojkcbxHw.cjs.map +1 -0
  85. package/dist/{dokploy-CiozgdKO.cjs → dokploy-C0aQrCgs.cjs} +2 -2
  86. package/dist/{dokploy-CiozgdKO.cjs.map → dokploy-C0aQrCgs.cjs.map} +1 -1
  87. package/dist/{dokploy-Boj1NSHV.mjs → dokploy-MM7c3IE0.mjs} +2 -2
  88. package/dist/{dokploy-Boj1NSHV.mjs.map → dokploy-MM7c3IE0.mjs.map} +1 -1
  89. package/dist/{drivers-DbjiYpW6.cjs → drivers-CQ32PB5w.cjs} +2 -2
  90. package/dist/{drivers-DbjiYpW6.cjs.map → drivers-CQ32PB5w.cjs.map} +1 -1
  91. package/dist/{drivers-BjGDYfnC.mjs → drivers-Chb5Akov.mjs} +2 -2
  92. package/dist/{drivers-BjGDYfnC.mjs.map → drivers-Chb5Akov.mjs.map} +1 -1
  93. package/dist/{eas-DCg41jKK.mjs → eas-1Ee6kql0.mjs} +2 -2
  94. package/dist/{eas-DCg41jKK.mjs.map → eas-1Ee6kql0.mjs.map} +1 -1
  95. package/dist/{eas-BmBjIFf_.cjs → eas-CJoys9yh.cjs} +2 -2
  96. package/dist/{eas-BmBjIFf_.cjs.map → eas-CJoys9yh.cjs.map} +1 -1
  97. package/dist/{emit-C1e8qD08.mjs → emit-CNpuV_6Q.mjs} +17 -1
  98. package/dist/emit-CNpuV_6Q.mjs.map +1 -0
  99. package/dist/{emit-Dmc1nvdS.cjs → emit-qvHxMV9b.cjs} +17 -1
  100. package/dist/emit-qvHxMV9b.cjs.map +1 -0
  101. package/dist/{encryption-QOQbGXgV.mjs → encryption-B8Bk1Mvu.mjs} +3 -3
  102. package/dist/{encryption-QOQbGXgV.mjs.map → encryption-B8Bk1Mvu.mjs.map} +1 -1
  103. package/dist/{encryption-CwLWV2ig.cjs → encryption-Bo9VlRnl.cjs} +3 -3
  104. package/dist/{encryption-CwLWV2ig.cjs.map → encryption-Bo9VlRnl.cjs.map} +1 -1
  105. package/dist/{engine-HVqo3mQu.mjs → engine-BuinpJfS.mjs} +7 -8
  106. package/dist/{engine-HVqo3mQu.mjs.map → engine-BuinpJfS.mjs.map} +1 -1
  107. package/dist/{engine-D7YNY3v7.cjs → engine-esxTxcIx.cjs} +10 -11
  108. package/dist/{engine-D7YNY3v7.cjs.map → engine-esxTxcIx.cjs.map} +1 -1
  109. package/dist/{github-CO8W9SDs.cjs → github-BEA4K3_X.cjs} +80 -47
  110. package/dist/github-BEA4K3_X.cjs.map +1 -0
  111. package/dist/{github-CQt3xc3o.mjs → github-BUlKJfOV.mjs} +78 -45
  112. package/dist/github-BUlKJfOV.mjs.map +1 -0
  113. package/dist/{googlePlay-Cfu17aEp.mjs → googlePlay-CK05QiTq.mjs} +4 -4
  114. package/dist/{googlePlay-Cfu17aEp.mjs.map → googlePlay-CK05QiTq.mjs.map} +1 -1
  115. package/dist/{googlePlay-DSuF6jbF.cjs → googlePlay-CiqAS2ma.cjs} +5 -5
  116. package/dist/{googlePlay-DSuF6jbF.cjs.map → googlePlay-CiqAS2ma.cjs.map} +1 -1
  117. package/dist/{index-8OfpOtSI.d.cts → index-4CO0HD27.d.cts} +2 -2
  118. package/dist/{index-8OfpOtSI.d.cts.map → index-4CO0HD27.d.cts.map} +1 -1
  119. package/dist/{index-Dpji6Bxq.d.mts → index-DhUf0B0m.d.mts} +2 -2
  120. package/dist/{index-Dpji6Bxq.d.mts.map → index-DhUf0B0m.d.mts.map} +1 -1
  121. package/dist/index.cjs +81 -82
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.mjs +64 -65
  124. package/dist/index.mjs.map +1 -1
  125. package/dist/{local-BwC2v2Y8.mjs → local-B7Zv1NoA.mjs} +2 -2
  126. package/dist/{local-BwC2v2Y8.mjs.map → local-B7Zv1NoA.mjs.map} +1 -1
  127. package/dist/{local-DNhnkugT.cjs → local-OPC9BCZt.cjs} +3 -3
  128. package/dist/{local-DNhnkugT.cjs.map → local-OPC9BCZt.cjs.map} +1 -1
  129. package/dist/{migrate-CGkir5LM.mjs → migrate-BzCHT9qs.mjs} +3 -3
  130. package/dist/{migrate-CGkir5LM.mjs.map → migrate-BzCHT9qs.mjs.map} +1 -1
  131. package/dist/{migrate-CXsMaHbb.cjs → migrate-C-hmbjpG.cjs} +3 -3
  132. package/dist/{migrate-CXsMaHbb.cjs.map → migrate-C-hmbjpG.cjs.map} +1 -1
  133. package/dist/{migrate-Bkz8BGaZ.mjs → migrate-CnbvrVag.mjs} +4 -4
  134. package/dist/{migrate-Bkz8BGaZ.mjs.map → migrate-CnbvrVag.mjs.map} +1 -1
  135. package/dist/{migrate-dbAI2XF8.cjs → migrate-DeQJBexh.cjs} +4 -4
  136. package/dist/{migrate-dbAI2XF8.cjs.map → migrate-DeQJBexh.cjs.map} +1 -1
  137. package/dist/openapi.cjs +3 -3
  138. package/dist/openapi.d.cts +1 -1
  139. package/dist/openapi.d.mts +1 -1
  140. package/dist/openapi.mjs +3 -3
  141. package/dist/{publish-eUcWvSdP.mjs → publish-BISBrrqR.mjs} +2 -2
  142. package/dist/{publish-eUcWvSdP.mjs.map → publish-BISBrrqR.mjs.map} +1 -1
  143. package/dist/{publish-Bbd-2PI2.cjs → publish-DtSIB-hZ.cjs} +2 -2
  144. package/dist/{publish-Bbd-2PI2.cjs.map → publish-DtSIB-hZ.cjs.map} +1 -1
  145. package/dist/{ready-BOfogqzr.mjs → ready-DqsyadOs.mjs} +6 -6
  146. package/dist/{ready-BOfogqzr.mjs.map → ready-DqsyadOs.mjs.map} +1 -1
  147. package/dist/{ready-BFFP838V.cjs → ready-IVGu-q18.cjs} +6 -6
  148. package/dist/{ready-BFFP838V.cjs.map → ready-IVGu-q18.cjs.map} +1 -1
  149. package/dist/reconcile/public.cjs +2 -2
  150. package/dist/reconcile/public.d.cts +1 -2
  151. package/dist/reconcile/public.d.cts.map +1 -1
  152. package/dist/reconcile/public.d.mts +1 -2
  153. package/dist/reconcile/public.d.mts.map +1 -1
  154. package/dist/reconcile/public.mjs +2 -2
  155. package/dist/{resolve-DSilYpzm.mjs → resolve-BT7fkPN5.mjs} +4 -4
  156. package/dist/{resolve-DSilYpzm.mjs.map → resolve-BT7fkPN5.mjs.map} +1 -1
  157. package/dist/{resolve-CyprRcQo.cjs → resolve-C7GKQcE4.cjs} +4 -4
  158. package/dist/{resolve-CyprRcQo.cjs.map → resolve-C7GKQcE4.cjs.map} +1 -1
  159. package/dist/{rollback-DfwsnwGO.cjs → rollback-BEiB-Pje.cjs} +7 -7
  160. package/dist/{rollback-DfwsnwGO.cjs.map → rollback-BEiB-Pje.cjs.map} +1 -1
  161. package/dist/{rollback-C4ri3h7i.mjs → rollback-DbP0KuDw.mjs} +7 -7
  162. package/dist/{rollback-C4ri3h7i.mjs.map → rollback-DbP0KuDw.mjs.map} +1 -1
  163. package/dist/{runtime-ACdfK59n.d.cts → runtime-BFJQNqwd.d.mts} +2 -2
  164. package/dist/{runtime-ACdfK59n.d.cts.map → runtime-BFJQNqwd.d.mts.map} +1 -1
  165. package/dist/{runtime-YyQuekxi.d.mts → runtime-BJO-FFef.d.cts} +2 -2
  166. package/dist/{runtime-YyQuekxi.d.mts.map → runtime-BJO-FFef.d.cts.map} +1 -1
  167. package/dist/{s3-DQXZdmCM.mjs → s3-B4FTQQkV.mjs} +2 -2
  168. package/dist/{s3-DQXZdmCM.mjs.map → s3-B4FTQQkV.mjs.map} +1 -1
  169. package/dist/{s3-CrPoA89T.cjs → s3-DwKLXwUT.cjs} +2 -2
  170. package/dist/{s3-CrPoA89T.cjs.map → s3-DwKLXwUT.cjs.map} +1 -1
  171. package/dist/sandbox/credentials-worker.cjs +2 -2
  172. package/dist/sandbox/credentials-worker.mjs +2 -2
  173. package/dist/sandbox/discover-worker.cjs +1 -1
  174. package/dist/sandbox/discover-worker.mjs +1 -1
  175. package/dist/sandbox/migrate-worker.cjs +1 -1
  176. package/dist/sandbox/migrate-worker.mjs +1 -1
  177. package/dist/{seeds-CFG-f24B.cjs → seeds-DOfxmDRO.cjs} +362 -34
  178. package/dist/seeds-DOfxmDRO.cjs.map +1 -0
  179. package/dist/{seeds-oY0qDqui.mjs → seeds-rG-Evfz9.mjs} +341 -31
  180. package/dist/seeds-rG-Evfz9.mjs.map +1 -0
  181. package/dist/{serverSetup-CQZt0OT6.cjs → serverSetup-CWWVcU6Y.cjs} +6 -6
  182. package/dist/{serverSetup-CQZt0OT6.cjs.map → serverSetup-CWWVcU6Y.cjs.map} +1 -1
  183. package/dist/{serverSetup-D8nngcNL.mjs → serverSetup-xGw1fxuZ.mjs} +6 -6
  184. package/dist/{serverSetup-D8nngcNL.mjs.map → serverSetup-xGw1fxuZ.mjs.map} +1 -1
  185. package/dist/{sniffer-BAmtXzou.cjs → sniffer-C7O9Pna_.cjs} +9 -9
  186. package/dist/{sniffer-BAmtXzou.cjs.map → sniffer-C7O9Pna_.cjs.map} +1 -1
  187. package/dist/{sniffer-Cgx608Tl.mjs → sniffer-DVPgfyHr.mjs} +9 -9
  188. package/dist/{sniffer-Cgx608Tl.mjs.map → sniffer-DVPgfyHr.mjs.map} +1 -1
  189. package/dist/{dns-CfEZHt7r.cjs → snsSubscriptions-CSkteK2J.cjs} +520 -3
  190. package/dist/snsSubscriptions-CSkteK2J.cjs.map +1 -0
  191. package/dist/{dns-BgxvvcQa.mjs → snsSubscriptions-CvBIGGp0.mjs} +431 -6
  192. package/dist/snsSubscriptions-CvBIGGp0.mjs.map +1 -0
  193. package/dist/{sst-C1pxbFEd.mjs → sst-CTqZZl1_.mjs} +3 -4
  194. package/dist/{sst-C1pxbFEd.mjs.map → sst-CTqZZl1_.mjs.map} +1 -1
  195. package/dist/{sst-B-Uz4cvm.cjs → sst-lEkBwzGc.cjs} +4 -5
  196. package/dist/{sst-B-Uz4cvm.cjs.map → sst-lEkBwzGc.cjs.map} +1 -1
  197. package/dist/{stage-BKDdQm65.mjs → stage-2EKpzPQ1.mjs} +6 -6
  198. package/dist/{stage-BKDdQm65.mjs.map → stage-2EKpzPQ1.mjs.map} +1 -1
  199. package/dist/{stage-CJysBXWB.cjs → stage-fRfFtLwj.cjs} +7 -7
  200. package/dist/{stage-CJysBXWB.cjs.map → stage-fRfFtLwj.cjs.map} +1 -1
  201. package/dist/{stages-D4SnG5yl.cjs → stages-B7mCWI_R.cjs} +2 -2
  202. package/dist/{stages-D4SnG5yl.cjs.map → stages-B7mCWI_R.cjs.map} +1 -1
  203. package/dist/{stages-Cb9rqRbN.mjs → stages-DSltTW2d.mjs} +2 -2
  204. package/dist/{stages-Cb9rqRbN.mjs.map → stages-DSltTW2d.mjs.map} +1 -1
  205. package/dist/target/public.cjs +1 -1
  206. package/dist/target/public.d.cts +2 -2
  207. package/dist/target/public.d.mts +2 -2
  208. package/dist/target/public.mjs +1 -1
  209. package/dist/{terminal-CW_dWeTe.mjs → terminal-BAVrDhhN.mjs} +3 -3
  210. package/dist/{terminal-CW_dWeTe.mjs.map → terminal-BAVrDhhN.mjs.map} +1 -1
  211. package/dist/{terminal-DJlqcW_U.cjs → terminal-D1aeTkgv.cjs} +3 -3
  212. package/dist/{terminal-DJlqcW_U.cjs.map → terminal-D1aeTkgv.cjs.map} +1 -1
  213. package/dist/{types-HqVPddRK.d.mts → types-CFU2uvrz.d.cts} +263 -4
  214. package/dist/types-CFU2uvrz.d.cts.map +1 -0
  215. package/dist/{types-B6UXlEkf.d.cts → types-D3BeGucy.d.mts} +262 -5
  216. package/dist/types-D3BeGucy.d.mts.map +1 -0
  217. package/dist/vitest.cjs +1 -1
  218. package/dist/vitest.mjs +1 -1
  219. package/dist/workspace/index.cjs +1 -1
  220. package/dist/workspace/index.d.cts +2 -2
  221. package/dist/workspace/index.d.mts +2 -2
  222. package/dist/workspace/index.mjs +1 -1
  223. package/dist/{workspace-BwqQnool.cjs → workspace-C82GLPnf.cjs} +8 -2
  224. package/dist/workspace-C82GLPnf.cjs.map +1 -0
  225. package/dist/{workspace-D1QbNd55.mjs → workspace-DUnnVjqC.mjs} +8 -2
  226. package/dist/workspace-DUnnVjqC.mjs.map +1 -0
  227. package/package.json +17 -16
  228. package/dist/SubscriberGenerator-C8CPxrCK.cjs.map +0 -1
  229. package/dist/SubscriberGenerator-y3pncae_.mjs.map +0 -1
  230. package/dist/compose-CgBPA44v.mjs.map +0 -1
  231. package/dist/compose-bKLAtHLj.cjs.map +0 -1
  232. package/dist/config-D48erO2j.d.mts.map +0 -1
  233. package/dist/config-DHDtsQrB.d.cts.map +0 -1
  234. package/dist/credentials-B5N5yKk6.mjs.map +0 -1
  235. package/dist/credentials-Zqr3QQYB.cjs.map +0 -1
  236. package/dist/deploy-CI85F6dr.cjs.map +0 -1
  237. package/dist/deploy-Ddy8UBoE.mjs.map +0 -1
  238. package/dist/discover-C5roJuc9.mjs.map +0 -1
  239. package/dist/discover-CSW_BMWa.d.cts +0 -125
  240. package/dist/discover-CSW_BMWa.d.cts.map +0 -1
  241. package/dist/discover-DozUKs8f.cjs.map +0 -1
  242. package/dist/discover-xtT7fgWg.d.mts +0 -125
  243. package/dist/discover-xtT7fgWg.d.mts.map +0 -1
  244. package/dist/dns-BgxvvcQa.mjs.map +0 -1
  245. package/dist/dns-CfEZHt7r.cjs.map +0 -1
  246. package/dist/emit-C1e8qD08.mjs.map +0 -1
  247. package/dist/emit-Dmc1nvdS.cjs.map +0 -1
  248. package/dist/github-CO8W9SDs.cjs.map +0 -1
  249. package/dist/github-CQt3xc3o.mjs.map +0 -1
  250. package/dist/run-BJLIerMM.mjs +0 -133
  251. package/dist/run-BJLIerMM.mjs.map +0 -1
  252. package/dist/run-fVZ-rLnc.cjs +0 -174
  253. package/dist/run-fVZ-rLnc.cjs.map +0 -1
  254. package/dist/sandbox-C4g1eG31.d.mts +0 -104
  255. package/dist/sandbox-C4g1eG31.d.mts.map +0 -1
  256. package/dist/sandbox-CdKgQ3XU.d.cts +0 -104
  257. package/dist/sandbox-CdKgQ3XU.d.cts.map +0 -1
  258. package/dist/seeds-CFG-f24B.cjs.map +0 -1
  259. package/dist/seeds-oY0qDqui.mjs.map +0 -1
  260. package/dist/types-B6UXlEkf.d.cts.map +0 -1
  261. package/dist/types-HqVPddRK.d.mts.map +0 -1
  262. package/dist/workspace-BwqQnool.cjs.map +0 -1
  263. package/dist/workspace-D1QbNd55.mjs.map +0 -1
@@ -6,7 +6,7 @@ import { t as WORKER_RESULT_MARKER } from "./workerRuntime-CsOyBRx2.mjs";
6
6
  import { createRequire } from "node:module";
7
7
  import { dirname, join, relative } from "node:path";
8
8
  import { existsSync } from "node:fs";
9
- import { assertDerivations, canonicalId } from "@geekmidas/manifest";
9
+ import { assertDerivations, canonicalId, provideKey } from "@geekmidas/manifest";
10
10
  import { fileURLToPath, pathToFileURL } from "node:url";
11
11
  import { AsyncLocalStorage } from "node:async_hooks";
12
12
  import { format } from "node:util";
@@ -15,6 +15,40 @@ import { Queue } from "@geekmidas/constructs/queue";
15
15
  import { Subscriber } from "@geekmidas/constructs/subscribers";
16
16
  import fg from "fast-glob";
17
17
  import kebabCase$1 from "lodash.kebabcase";
18
+ //#region src/reconcile/edges.ts
19
+ /**
20
+ * Edges a process records for what its runnables consume, beyond the
21
+ * construct ids `.dependsOn()` names.
22
+ */
23
+ const EVENTS_SUFFIX = "#events";
24
+ /**
25
+ * A bucket's events, as an edge: what a process running one of the bucket's
26
+ * subscribers consumes. Not the bucket's id — binding to a bucket's changes
27
+ * is not reading its objects, so the process is handed the events key alone.
28
+ */
29
+ function eventsEdge(bucketId) {
30
+ return `${bucketId}${EVENTS_SUFFIX}`;
31
+ }
32
+ /** The bucket an events edge names, or nothing for any other edge. */
33
+ function eventsEdgeBucket(edge) {
34
+ return edge.endsWith(EVENTS_SUFFIX) ? edge.slice(0, -7) : void 0;
35
+ }
36
+ /**
37
+ * The env key a subscriber's deliveries come from: its topic's publisher
38
+ * connection string, or its bucket's events connection string.
39
+ */
40
+ function subscriberConnectionKey(construct) {
41
+ if (construct.bucketName) return provideKey(canonicalId(construct.bucketName), "eventsConnectionString");
42
+ if (construct.topicName) return provideKey(canonicalId(construct.topicName), "publisherConnectionString");
43
+ }
44
+ /**
45
+ * The key a bucket's relay token is read from, by the process that runs the
46
+ * bucket's subscribers — beside its events connection string.
47
+ */
48
+ function subscriberTokenKey(construct) {
49
+ return construct.bucketName ? provideKey(canonicalId(construct.bucketName), "eventsToken") : void 0;
50
+ }
51
+ //#endregion
18
52
  //#region src/output.ts
19
53
  /**
20
54
  * Where the CLI's progress lines go.
@@ -295,7 +329,8 @@ const DiscoverAnswer = discriminatedUnion("reason", [
295
329
  background: record(string(), array(string())).optional(),
296
330
  subscribers: record(string(), array(object({
297
331
  name: string(),
298
- topic: string()
332
+ connectionKey: string(),
333
+ events: array(string()).optional()
299
334
  }))).optional()
300
335
  }),
301
336
  object({
@@ -472,21 +507,26 @@ function recordBackground(background, exported, file) {
472
507
  if (!files.includes(file)) files.push(file);
473
508
  }
474
509
  /**
475
- * Record a topic subscriber under the worker that runs it, by its export.
476
- * Once per name: a file reached twice through a re-export finds it again.
510
+ * Record a subscriber — to a topic or to a bucket — under the worker that
511
+ * runs it, by its export. Once per name: a file reached twice through a
512
+ * re-export finds it again.
477
513
  */
478
514
  function recordSubscriber(subscribers, exported, exportName) {
479
515
  if (!Subscriber.isSubscriber(exported)) return;
480
- const { owner, topicName } = exported;
481
- if (typeof owner !== "string" || typeof topicName !== "string") return;
516
+ const owner = exported.owner;
517
+ const connectionKey = subscriberConnectionKey(exported);
518
+ if (typeof owner !== "string" || !connectionKey) return;
482
519
  const key = canonicalId(owner);
483
520
  const bound = subscribers[key] ?? [];
484
521
  subscribers[key] = bound;
485
- const topic = canonicalId(topicName);
486
- if (!bound.some((s) => s.topic === topic && s.name === exportName)) bound.push({
487
- name: exportName,
488
- topic
489
- });
522
+ if (!bound.some((s) => s.connectionKey === connectionKey && s.name === exportName)) {
523
+ const events = exported.topicName ? exported.subscribedEvents : void 0;
524
+ bound.push({
525
+ name: exportName,
526
+ connectionKey,
527
+ ...events ? { events: [...events] } : {}
528
+ });
529
+ }
490
530
  }
491
531
  /**
492
532
  * What a runnable consumes, by id: a queue's consumer drains that queue, a
@@ -495,9 +535,20 @@ function recordSubscriber(subscribers, exported, exportName) {
495
535
  function consumedBy(runnable) {
496
536
  if (Queue.isQueue(runnable)) return [runnable.id];
497
537
  if (Subscriber.isSubscriber(runnable) && runnable.topicName) return [canonicalId(runnable.topicName)];
538
+ if (Subscriber.isSubscriber(runnable) && runnable.bucketName) return [canonicalId(runnable.bucketName)];
498
539
  return [];
499
540
  }
500
541
  /**
542
+ * The edges a runnable's process records for what it consumes. A bucket's
543
+ * subscriber consumes the bucket's *events*, not the bucket: binding to its
544
+ * changes is not reading its objects, so its process is handed the events
545
+ * key and not the bucket's URL — that still takes `.dependsOn([bucket])`.
546
+ */
547
+ function consumedEdges(runnable) {
548
+ if (Subscriber.isSubscriber(runnable) && runnable.bucketName) return [eventsEdge(canonicalId(runnable.bucketName))];
549
+ return consumedBy(runnable);
550
+ }
551
+ /**
501
552
  * Record a runnable's edges under the construct that owns it — the surface an
502
553
  * endpoint was built from, or the worker a cron or subscriber was. Anything
503
554
  * with no owner, or that is not a runnable at all, is left alone.
@@ -510,11 +561,12 @@ function recordRunnable(runnables, exported) {
510
561
  const key = canonicalId(owner);
511
562
  const edges = runnables[key] ?? [];
512
563
  runnables[key] = edges;
513
- for (const id of [...runnable.constructs, ...consumedBy(exported)]) {
564
+ for (const id of runnable.constructs) {
514
565
  if (typeof id !== "string") continue;
515
566
  const target = canonicalId(id);
516
567
  if (!edges.includes(target)) edges.push(target);
517
568
  }
569
+ for (const edge of consumedEdges(exported)) if (!edges.includes(edge)) edges.push(edge);
518
570
  }
519
571
  /**
520
572
  * Say so when a glob was configured and found nothing.
@@ -555,6 +607,6 @@ var DuplicateConstruct = class extends GkmError {
555
607
  }
556
608
  };
557
609
  //#endregion
558
- export { discover_exports as a, nodeWithTsx as c, ConstructGenerator as d, output as f, discover as i, runWorker as l, ConstructsNotSerializable as n, isDeclarable as o, withOutput as p, consumedBy as r, SandboxWorkerFailed as s, ConstructDiscoveryFailed as t, withOwningTsconfigJsx as u };
610
+ export { subscriberTokenKey as _, discover_exports as a, nodeWithTsx as c, ConstructGenerator as d, output as f, subscriberConnectionKey as g, eventsEdgeBucket as h, discover as i, runWorker as l, eventsEdge as m, ConstructsNotSerializable as n, isDeclarable as o, withOutput as p, consumedBy as r, SandboxWorkerFailed as s, ConstructDiscoveryFailed as t, withOwningTsconfigJsx as u };
559
611
 
560
- //# sourceMappingURL=discover-C5roJuc9.mjs.map
612
+ //# sourceMappingURL=discover-BvJOVsYG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover-BvJOVsYG.mjs","names":["kebabCase","z.discriminatedUnion","z.object","z.literal","z.record","z.string","z.array","z\n\t\t\t.record","z\n\t\t\t.object"],"sources":["../src/reconcile/edges.ts","../src/output.ts","../src/generators/Generator.ts","../src/owningTsconfigJsx.ts","../src/sandbox/worker.ts","../src/reconcile/discover.ts"],"sourcesContent":["/**\n * Edges a process records for what its runnables consume, beyond the\n * construct ids `.dependsOn()` names.\n */\n\nimport { canonicalId, provideKey } from '@geekmidas/manifest';\n\nconst EVENTS_SUFFIX = '#events';\n\n/**\n * A bucket's events, as an edge: what a process running one of the bucket's\n * subscribers consumes. Not the bucket's id — binding to a bucket's changes\n * is not reading its objects, so the process is handed the events key alone.\n */\nexport function eventsEdge(bucketId: string): string {\n\treturn `${bucketId}${EVENTS_SUFFIX}`;\n}\n\n/** The bucket an events edge names, or nothing for any other edge. */\nexport function eventsEdgeBucket(edge: string): string | undefined {\n\treturn edge.endsWith(EVENTS_SUFFIX)\n\t\t? edge.slice(0, -EVENTS_SUFFIX.length)\n\t\t: undefined;\n}\n\n/**\n * The env key a subscriber's deliveries come from: its topic's publisher\n * connection string, or its bucket's events connection string.\n */\nexport function subscriberConnectionKey(construct: {\n\ttopicName?: string;\n\tbucketName?: string;\n}): string | undefined {\n\tif (construct.bucketName) {\n\t\treturn provideKey(\n\t\t\tcanonicalId(construct.bucketName),\n\t\t\t'eventsConnectionString',\n\t\t);\n\t}\n\tif (construct.topicName) {\n\t\treturn provideKey(\n\t\t\tcanonicalId(construct.topicName),\n\t\t\t'publisherConnectionString',\n\t\t);\n\t}\n\treturn undefined;\n}\n\n/**\n * The key a bucket's relay token is read from, by the process that runs the\n * bucket's subscribers — beside its events connection string.\n */\nexport function subscriberTokenKey(construct: {\n\tbucketName?: string;\n}): string | undefined {\n\treturn construct.bucketName\n\t\t? provideKey(canonicalId(construct.bucketName), 'eventsToken')\n\t\t: undefined;\n}\n","/**\n * Where the CLI's progress lines go.\n *\n * Commands write their progress through `output` rather than `console`. Run\n * from the terminal that is the same thing. Run inside `deploy()`, each line\n * goes to the run that wrote it instead — as an event its caller can iterate,\n * and to the logger it was handed — so a deploy embedded in another program\n * does not print over that program's own output.\n *\n * Carried by `AsyncLocalStorage` rather than passed down, because the lines\n * come from everywhere a deploy reaches — the Dockerfile generator, the env\n * sniffer, construct discovery — and two deploys running in one process must\n * not hear each other.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { format } from 'node:util';\n\n/** How loud a line is. */\nexport type OutputLevel = 'info' | 'warn' | 'error';\n\n/** Receives each line written while it is the current sink. */\nexport type OutputSink = (level: OutputLevel, message: string) => void;\n\nconst current = new AsyncLocalStorage<OutputSink>();\n\n/** Runs `fn` with every line written through `output` sent to `sink`. */\nexport function withOutput<T>(sink: OutputSink, fn: () => T): T {\n\treturn current.run(sink, fn);\n}\n\nfunction write(\n\tlevel: OutputLevel,\n\tfallback: (...args: unknown[]) => void,\n): (...args: unknown[]) => void {\n\treturn (...args) => {\n\t\tconst sink = current.getStore();\n\t\tif (sink) sink(level, format(...args));\n\t\telse fallback(...args);\n\t};\n}\n\n/**\n * `console`, for the methods the CLI logs through — routed to the current\n * run's sink when there is one.\n */\nexport const output = {\n\tlog: write('info', (...args) => console.log(...args)),\n\tinfo: write('info', (...args) => console.info(...args)),\n\twarn: write('warn', (...args) => console.warn(...args)),\n\terror: write('error', (...args) => console.error(...args)),\n};\n","import { relative } from 'node:path';\nimport type { Construct } from '@geekmidas/constructs';\nimport fg from 'fast-glob';\nimport kebabCase from 'lodash.kebabcase';\nimport type { BuildContext } from '../build/types';\nimport type { MainProvider, Routes } from '../types';\n\n/**\n * Zod v4 maintains a process-wide registry of schemas registered via\n * `.meta({ id })`. When we cache-bust user module imports (by appending a\n * `?t=timestamp` query), those modules re-execute and try to register the\n * same ids again, which throws `ID X already exists in the registry`.\n *\n * Clearing the registry in the CLI process is safe: the user's running\n * server lives in a subprocess and has its own isolated registry.\n *\n * Exported for tests.\n */\nexport function clearZodGlobalRegistry(): void {\n\tconst registry = (\n\t\tglobalThis as { __zod_globalRegistry?: { clear?: () => void } }\n\t).__zod_globalRegistry;\n\tif (registry && typeof registry.clear === 'function') {\n\t\tregistry.clear();\n\t}\n}\n\nexport interface GeneratorOptions {\n\t/** Where the build deploys: one Lambda per construct, or one process. */\n\ttarget?: MainProvider;\n\t/**\n\t * What a handler path in the manifest is relative to — the workspace root,\n\t * which is where `sst.config.ts` runs and resolves it from.\n\t */\n\troot?: string;\n\t[key: string]: any;\n}\n\nexport abstract class ConstructGenerator<T extends Construct, R = void> {\n\tabstract isConstruct(value: any): value is T;\n\n\tstatic async build<T extends Construct, R = void>(\n\t\tcontext: BuildContext,\n\t\toutputDir: string,\n\t\tgenerator: ConstructGenerator<T, R>,\n\t\tpatterns?: Routes,\n\t\toptions?: GeneratorOptions,\n\t): Promise<R> {\n\t\tconst constructs = await generator.load(patterns);\n\t\treturn generator.build(context, constructs, outputDir, options);\n\t}\n\n\tabstract build(\n\t\tcontext: BuildContext,\n\t\tconstructs: GeneratedConstruct<T>[],\n\t\toutputDir: string,\n\t\toptions?: GeneratorOptions,\n\t): Promise<R>;\n\n\tasync load(\n\t\tpatterns?: Routes,\n\t\tcwd = process.cwd(),\n\t\tbustCache = false,\n\t): Promise<GeneratedConstruct<T>[]> {\n\t\tconst logger = console;\n\n\t\tconst globPatterns = Array.isArray(patterns)\n\t\t\t? patterns\n\t\t\t: patterns\n\t\t\t\t? [patterns]\n\t\t\t\t: [];\n\n\t\t// Find all files\n\t\tconst files = fg.stream(globPatterns, {\n\t\t\tcwd,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Cache-busted re-imports re-execute user modules, which would try to\n\t\t// re-register Zod schemas with the same `.meta({ id })`. Clear the\n\t\t// global registry once per load to prevent duplicate-id errors.\n\t\tif (bustCache) {\n\t\t\tclearZodGlobalRegistry();\n\t\t}\n\n\t\t// Load constructs\n\t\tconst constructs: GeneratedConstruct<T>[] = [];\n\n\t\tfor await (const f of files) {\n\t\t\ttry {\n\t\t\t\tconst file = f.toString();\n\t\t\t\t// Append cache-busting query param to force re-import of changed modules\n\t\t\t\tconst importPath = bustCache ? `${file}?t=${Date.now()}` : file;\n\t\t\t\tconst module = await import(importPath);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [key, construct] of Object.entries(module)) {\n\t\t\t\t\tif (this.isConstruct(construct)) {\n\t\t\t\t\t\tconstructs.push({\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tname: kebabCase(key),\n\t\t\t\t\t\t\tconstruct,\n\t\t\t\t\t\t\tpath: {\n\t\t\t\t\t\t\t\tabsolute: file,\n\t\t\t\t\t\t\t\trelative: relative(process.cwd(), file),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconst err = error as Error;\n\t\t\t\tlogger.error(`Failed to load ${f}: ${err.message}`);\n\t\t\t\tif (err.stack) {\n\t\t\t\t\tlogger.error(err.stack);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\treturn constructs;\n\t}\n}\n\nexport interface GeneratedConstruct<T extends Construct> {\n\tkey: string;\n\tname: string;\n\tconstruct: T;\n\tpath: {\n\t\tabsolute: string;\n\t\trelative: string;\n\t};\n}\n","import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nconst REGISTER = 'owning-tsconfig-jsx-register.mjs';\n\n/** The CLI's `bin/` was not found above the module looking for it. */\nexport class OwningTsconfigJsxHookMissing extends Error {\n\tconstructor(readonly from: string) {\n\t\tsuper(\n\t\t\t`Could not find bin/${REGISTER} in any directory above '${from}'. ` +\n\t\t\t\t'It ships with @geekmidas/cli beside bin/gkm.mjs; reinstall the ' +\n\t\t\t\t'package if it is missing.',\n\t\t);\n\t\tthis.name = 'OwningTsconfigJsxHookMissing';\n\t}\n}\n\n/**\n * The CLI's `bin/owning-tsconfig-jsx-register.mjs`, as a file URL. Searched\n * upward because this module runs from `src/` in the repo and from a chunk in\n * `dist/` once built, and `bin/` sits beside both.\n */\nfunction registerUrl(): string {\n\tconst from = dirname(fileURLToPath(import.meta.url));\n\tfor (let dir = from; ; dir = dirname(dir)) {\n\t\tconst candidate = join(dir, 'bin', REGISTER);\n\t\tif (existsSync(candidate)) return pathToFileURL(candidate).href;\n\t\tif (dirname(dir) === dir) throw new OwningTsconfigJsxHookMissing(from);\n\t}\n}\n\n/**\n * `NODE_OPTIONS` for a process that runs app code through tsx, with the hook\n * that compiles each `.tsx` with its own tsconfig's JSX settings (see\n * `bin/owning-tsconfig-jsx.mjs`) put in front of every other `--import`, so it\n * is registered before tsx and reads the source on tsx's behalf.\n *\n * `bin/gkm.mjs` already starts the CLI this way, and its children inherit it;\n * this is for those that set `NODE_OPTIONS` themselves, or whose CLI was\n * started with tsx already imported.\n */\nexport function withOwningTsconfigJsx(nodeOptions = ''): string {\n\tif (nodeOptions.includes(REGISTER)) return nodeOptions;\n\treturn [`--import=${registerUrl()}`, nodeOptions].filter(Boolean).join(' ');\n}\n","/**\n * Running one of the CLI's own worker scripts inside a sandbox, and reading\n * back the one JSON value it answers with.\n *\n * The worker imports the project's TypeScript — `gkm.config.ts`, construct\n * modules, an app's entry — so it starts with the CLI's own tsx and the two\n * hooks `gkm` itself runs with (JSX by the owning tsconfig, path aliases by\n * the adjacent one). The host process needs none of them loaded: a program\n * calling `deploy()` without `--import tsx` still loads a TypeScript config.\n */\n\nimport { existsSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport type { z } from 'zod';\nimport { withOwningTsconfigJsx } from '../owningTsconfigJsx';\nimport { oncePerRun, type Sandbox } from './sandbox';\nimport { WORKER_RESULT_MARKER } from './workerRuntime';\n\nconst here = dirname(fileURLToPath(import.meta.url));\n\n/**\n * A worker's file: `dist/sandbox/<name>.mjs` once built — whether this module\n * was bundled into `dist/` or sits beside it — or the `.ts` source under tsx.\n */\nexport function workerFile(name: string): string {\n\tconst candidates = [\n\t\tjoin(here, 'sandbox', `${name}.mjs`),\n\t\tjoin(here, `${name}.mjs`),\n\t\tjoin(here, '..', 'sandbox', `${name}.mjs`),\n\t\tjoin(here, `${name}.ts`),\n\t];\n\treturn (\n\t\tcandidates.find((path) => existsSync(path)) ?? join(here, `${name}.ts`)\n\t);\n}\n\n/** tsx, from the CLI's own dependencies — never the project's. */\nexport function tsxUrl(): string {\n\treturn pathToFileURL(createRequire(import.meta.url).resolve('tsx')).href;\n}\n\n/**\n * `node`'s arguments for `script`: the CLI's TypeScript loaders, then any\n * further `imports`, then the script and its `args` — an argument array, so\n * nothing about a path is read by a shell.\n */\nexport function nodeWithTsx(\n\tscript: string,\n\targs: readonly string[],\n\timports: readonly string[] = [],\n): string[] {\n\treturn [\n\t\t...withOwningTsconfigJsx(`--import=${tsxUrl()}`).split(' '),\n\t\t...imports.map((path) => `--import=${pathToFileURL(path).href}`),\n\t\tscript,\n\t\t...args,\n\t];\n}\n\n/** A worker ended without the answer it exists to give. */\nexport class SandboxWorkerFailed extends Error {\n\tconstructor(\n\t\treadonly step: string,\n\t\treadonly exitCode: number | null,\n\t\treadonly stderr: string,\n\t) {\n\t\tsuper(\n\t\t\t`The sandboxed ${step} ended (exit code ${exitCode}) without an ` +\n\t\t\t\t`answer.${stderr.trim() ? `\\n${stderr.trim()}` : ''}\\nIts output ` +\n\t\t\t\t'above says why; the sandbox must be able to run `node` with the ' +\n\t\t\t\t\"CLI's own files at the paths they have here.\",\n\t\t);\n\t\tthis.name = 'SandboxWorkerFailed';\n\t}\n}\n\nexport interface WorkerRun<T> {\n\t/** What the worker answered, as the schema reads it. */\n\tvalue: T;\n\t/** What it wrote to stderr: warnings a caller may pass on. */\n\tstderr: string;\n}\n\n/**\n * Run worker `name` in `sandbox`, and parse its answer with `schema`.\n *\n * The answer is the last marked line on stdout. Anything else the project's\n * code printed is ignored, and an answer the schema refuses is a failure\n * rather than data — a worker in an isolating sandbox runs code the host does\n * not trust.\n *\n * Within a run (`withSandbox`), the same worker asked the same question is\n * started once; every ask gets its own copy of the answer, and its stderr, as\n * though it had run again.\n */\nexport async function runWorker<S extends z.ZodType>(\n\tsandbox: Sandbox,\n\tstep: string,\n\toptions: WorkerOptions<S>,\n): Promise<WorkerRun<z.infer<S>>> {\n\t// A step handed secrets acts on something — a database it migrates — and\n\t// is not a question whose answer can be reused; nor do its secrets belong\n\t// in a cache key.\n\tif (options.secrets) return startWorker(sandbox, step, options);\n\n\tconst key = JSON.stringify([\n\t\toptions.name,\n\t\toptions.cwd,\n\t\toptions.args,\n\t\toptions.env ?? {},\n\t]);\n\tconst answer = await oncePerRun(sandbox, key, () =>\n\t\tstartWorker(sandbox, step, options),\n\t);\n\treturn structuredClone(answer);\n}\n\ninterface WorkerOptions<S extends z.ZodType> {\n\tname: string;\n\targs: readonly string[];\n\tcwd: string;\n\ttimeoutMs: number;\n\tenv?: Readonly<Record<string, string>>;\n\t/** Mounted as files, named by `GKM_SECRETS_DIR` — never variables. */\n\tsecrets?: Readonly<Record<string, string>>;\n\tsignal?: AbortSignal;\n\tschema: S;\n}\n\nasync function startWorker<S extends z.ZodType>(\n\tsandbox: Sandbox,\n\tstep: string,\n\toptions: WorkerOptions<S>,\n): Promise<WorkerRun<z.infer<S>>> {\n\tconst result = await sandbox.exec(\n\t\t'node',\n\t\tnodeWithTsx(workerFile(options.name), options.args),\n\t\t{\n\t\t\tcwd: options.cwd,\n\t\t\tenv: { ...sandbox.env, ...options.env },\n\t\t\ttimeoutMs: options.timeoutMs,\n\t\t\toutput: 'capture',\n\t\t\t...(options.secrets ? { secrets: options.secrets } : {}),\n\t\t\t...(options.signal ? { signal: options.signal } : {}),\n\t\t},\n\t);\n\n\tconst line = result.stdout\n\t\t.split('\\n')\n\t\t.reverse()\n\t\t.find((l) => l.startsWith(WORKER_RESULT_MARKER));\n\tif (line) {\n\t\ttry {\n\t\t\tconst parsed = options.schema.safeParse(\n\t\t\t\tJSON.parse(line.slice(WORKER_RESULT_MARKER.length)),\n\t\t\t);\n\t\t\tif (parsed.success) return { value: parsed.data, stderr: result.stderr };\n\t\t} catch {\n\t\t\t// Not JSON: as good as no answer.\n\t\t}\n\t}\n\n\tthrow new SandboxWorkerFailed(step, result.exitCode, result.stderr);\n}\n","/**\n * Discovery — one glob, one structural test.\n *\n * A glob per kind is the same specialness the construct model removes, and\n * resources have no kind to be listed under: a declared `ObjectStorage` would\n * never be found by `routes:` or `crons:`. So there is one `constructs` glob,\n * every export of every matching module is inspected, and the per-kind\n * `isConstruct` checks collapse into a single question — does it have an id and\n * can it declare?\n *\n * Structural rather than `instanceof` on purpose. A construct from a different\n * copy of `@geekmidas/constructs` — a linked workspace, two versions in a\n * lockfile — is still a construct, and `instanceof` is exactly the check that\n * says otherwise.\n */\n\nimport { relative } from 'node:path';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Queue } from '@geekmidas/constructs/queue';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport {\n\tassertDerivations,\n\ttype ConstructManifest,\n\tcanonicalId,\n\ttype Declaration,\n} from '@geekmidas/manifest';\nimport fg from 'fast-glob';\nimport { z } from 'zod';\nimport { GkmError } from '../errors';\nimport { clearZodGlobalRegistry } from '../generators/Generator';\nimport { output } from '../output';\nimport { activeSandbox, type Sandbox } from '../sandbox/sandbox';\nimport { runWorker } from '../sandbox/worker';\nimport { eventsEdge, subscriberConnectionKey } from './edges';\n\n/** `console`, or the deploy run discovering the manifest. */\nconst logger = output;\n\n/** The construct face discovery needs: an id, and the ability to declare. */\ninterface Declarable {\n\tid: string;\n\tdeclare(): Declaration[];\n}\n\n/**\n * Whether a module export is a construct.\n *\n * Deliberately loose about what else it carries — a construct that also has a\n * `service` is still a construct, and requiring one would exclude the kinds that\n * own no address.\n */\nexport function isDeclarable(value: unknown): value is Declarable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Declarable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\tcandidate.id.length > 0 &&\n\t\ttypeof candidate.declare === 'function'\n\t);\n}\n\nexport interface DiscoverOptions {\n\t/** The glob(s) to search. One pattern, not one per kind. */\n\tpatterns: string | readonly string[];\n\tcwd?: string;\n\t/**\n\t * Re-import changed modules, for the dev watcher.\n\t *\n\t * A single glob makes discovery more central, not less: a new construct file\n\t * has to be picked up on `add`, not only on `change`.\n\t */\n\tbustCache?: boolean;\n\t/**\n\t * Filled in with where each construct was found, when provided.\n\t *\n\t * Discovery is the only thing that knows: it globbed the files and imported\n\t * them. Everything downstream that needs to *write* an import — the build,\n\t * generating a server entry that reads a surface's logger — would otherwise\n\t * have to be told the path in config, which is the string this removes.\n\t *\n\t * An out-parameter rather than a second return value so that every existing\n\t * caller, which wants the manifest and nothing else, is unchanged.\n\t */\n\tsources?: Record<string, ConstructSource>;\n\t/**\n\t * Filled in, when provided, with the ids each owner's runnables declared an\n\t * edge to — keyed by the surface an endpoint was built from, or the worker\n\t * a cron or subscriber was.\n\t *\n\t * A runnable is not a declaration: a surface's endpoints are found by the\n\t * glob, not listed by the surface, so its node says `endpoints: []` until a\n\t * build folds the routes in. Anything deciding what an app's process reaches\n\t * — which keys its container is given — needs those edges before any build,\n\t * and discovery is already importing the files they are in.\n\t */\n\trunnables?: Record<string, string[]>;\n\t/**\n\t * Filled in, when provided, with the files each worker's background work is\n\t * declared in — its crons, queue consumers and topic subscribers — keyed by\n\t * the worker.\n\t *\n\t * What says which app's build carries a worker's entry: the one whose\n\t * directory holds its work. A worker declares no path of its own.\n\t */\n\tbackground?: Record<string, string[]>;\n\t/**\n\t * Filled in, when provided, with each worker's subscribers — by the export\n\t * a push route is named after, and the key its deliveries come from: its\n\t * topic's, or its bucket's events — keyed by the worker.\n\t *\n\t * What says which worker SNS pushes to, and on which paths: a build bound\n\t * for a server records no subscriber in the manifest, because none has a\n\t * handler of its own there.\n\t */\n\tsubscribers?: Record<string, BoundSubscriber[]>;\n\t/**\n\t * Import the construct modules in this sandbox rather than in this\n\t * process. Defaults to the run's own (`withSandbox`), so a deploy's every\n\t * discovery — the engine's included — happens there; with neither, they\n\t * are imported here, as before.\n\t */\n\tsandbox?: Sandbox;\n}\n\n/** A worker's subscriber — to a topic or to a bucket — as discovery found it. */\nexport interface BoundSubscriber {\n\t/** Its export — what its push route is named after. */\n\tname: string;\n\t/**\n\t * The env key its deliveries come from: its topic's publisher connection\n\t * string, or its bucket's events connection string. An `sns://` value is\n\t * what makes SNS push to it.\n\t */\n\tconnectionKey: string;\n\t/**\n\t * The event types a topic subscriber names — its SNS subscription's filter\n\t * on the `type` attribute the topic's publisher sets. Absent for a\n\t * bucket's subscriber: S3 sets no such attribute, and the subscriber's own\n\t * filter decides.\n\t */\n\tevents?: readonly string[];\n}\n\n/** What the discovery worker answers. Checked: the worker ran project code. */\nconst DiscoverAnswer = z.discriminatedUnion('reason', [\n\tz.object({\n\t\treason: z.literal('discovered'),\n\t\tmanifest: z.record(\n\t\t\tz.string(),\n\t\t\tz.object({ id: z.string(), kind: z.string() }).loose(),\n\t\t),\n\t\trunnables: z.record(z.string(), z.array(z.string())),\n\t\tbackground: z.record(z.string(), z.array(z.string())).optional(),\n\t\tsubscribers: z\n\t\t\t.record(\n\t\t\t\tz.string(),\n\t\t\t\tz.array(\n\t\t\t\t\tz.object({\n\t\t\t\t\t\tname: z.string(),\n\t\t\t\t\t\tconnectionKey: z.string(),\n\t\t\t\t\t\tevents: z.array(z.string()).optional(),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)\n\t\t\t.optional(),\n\t}),\n\tz.object({ reason: z.literal('live'), paths: z.array(z.string()) }),\n\tz.object({\n\t\treason: z.literal('failed'),\n\t\terror: z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\tmessage: z.string(),\n\t\t\t\tid: z.string().optional(),\n\t\t\t\tsources: z.array(z.string()).optional(),\n\t\t\t})\n\t\t\t.loose(),\n\t}),\n]);\n\n/**\n * The manifest, discovered in `sandbox` and handed back as JSON — or\n * `undefined` when it holds something JSON cannot carry and the sandbox is\n * not isolating, for the caller to discover here as before.\n */\nasync function discoverInSandbox(\n\tsandbox: Sandbox,\n\toptions: DiscoverOptions,\n): Promise<ConstructManifest | undefined> {\n\tconst cwd = options.cwd ?? sandbox.root;\n\tconst patterns =\n\t\ttypeof options.patterns === 'string'\n\t\t\t? [options.patterns]\n\t\t\t: [...options.patterns];\n\n\tconst { value, stderr } = await runWorker(sandbox, 'construct discovery', {\n\t\tname: 'discover-worker',\n\t\targs: [JSON.stringify({ patterns, cwd })],\n\t\tcwd,\n\t\ttimeoutMs: DISCOVER_TIMEOUT_MS,\n\t\tschema: DiscoverAnswer,\n\t});\n\n\t// Discovery's own warnings — a glob that matched nothing — are the\n\t// run's, as they would be had it discovered in-process: as written, one\n\t// message, less the newline the worker's `console.warn` ended it with.\n\tif (stderr.trim()) logger.warn(stderr.replace(/\\n$/, ''));\n\n\tswitch (value.reason) {\n\t\tcase 'discovered':\n\t\t\tif (options.runnables) {\n\t\t\t\tfor (const [owner, edges] of Object.entries(value.runnables)) {\n\t\t\t\t\toptions.runnables[owner] = edges;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (options.background) {\n\t\t\t\tfor (const [owner, files] of Object.entries(value.background ?? {})) {\n\t\t\t\t\toptions.background[owner] = files;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (options.subscribers) {\n\t\t\t\tfor (const [owner, bound] of Object.entries(value.subscribers ?? {})) {\n\t\t\t\t\toptions.subscribers[owner] = bound;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn value.manifest as unknown as ConstructManifest;\n\t\tcase 'failed':\n\t\t\tif (value.error.name === 'DuplicateConstruct' && value.error.id) {\n\t\t\t\tthrow new DuplicateConstruct(value.error.id, value.error.sources ?? []);\n\t\t\t}\n\t\t\tthrow new ConstructDiscoveryFailed(value.error.name, value.error.message);\n\t\tcase 'live':\n\t\t\tif (sandbox.isolating) throw new ConstructsNotSerializable(value.paths);\n\t\t\treturn undefined;\n\t}\n}\n\n/**\n * A caller asked for the construct objects (`sources`) or a watcher's\n * re-import under an isolating sandbox, where only data comes back.\n */\nexport class LiveConstructsUnavailable extends Error {\n\tconstructor() {\n\t\tsuper(\n\t\t\t'Discovery was asked for the construct objects themselves under an ' +\n\t\t\t\t'isolating sandbox, which hands back only data. Run this step ' +\n\t\t\t\t'without one, or ask only for the manifest.',\n\t\t);\n\t\tthis.name = 'LiveConstructsUnavailable';\n\t}\n}\n\n/** How long discovering a project's constructs may take in a sandbox. */\nconst DISCOVER_TIMEOUT_MS = 60_000;\n\n/** Importing a construct module, or declaring one, threw in the sandbox. */\nexport class ConstructDiscoveryFailed extends Error {\n\tconstructor(\n\t\treadonly errorName: string,\n\t\treadonly detail: string,\n\t) {\n\t\tsuper(`Discovering constructs failed (${errorName}): ${detail}`);\n\t\tthis.name = 'ConstructDiscoveryFailed';\n\t}\n}\n\n/**\n * The constructs' declarations hold something that is not data, and the\n * sandbox they were discovered in hands the deploy nothing but data.\n */\nexport class ConstructsNotSerializable extends Error {\n\tconstructor(readonly paths: readonly string[]) {\n\t\tsuper(\n\t\t\t`The construct manifest holds values that are not plain data at: ` +\n\t\t\t\t`${paths.join(', ')}. Under an isolating sandbox the deploy only ` +\n\t\t\t\t'receives what JSON can carry; deploy with a sandbox that is not ' +\n\t\t\t\t'isolating if the host trusts this project.',\n\t\t);\n\t\tthis.name = 'ConstructsNotSerializable';\n\t}\n}\n\n/** Where a construct was declared, and under what name. */\nexport interface ConstructSource {\n\t/** Absolute path to the module that exported it. */\n\tfile: string;\n\t/** The name it was exported as — what an import statement has to say. */\n\texportName: string;\n\t/**\n\t * The exported construct itself.\n\t *\n\t * What a declaration cannot say — whether it serves itself — the object can\n\t * be asked, and discovery already imported it.\n\t */\n\tconstruct: unknown;\n}\n\n/**\n * Build the construct manifest for a project.\n *\n * Runs the manifest's own validation before returning, so an app is wrong here\n * — where the error names a file — rather than at deploy.\n *\n * @throws {DuplicateConstruct} when two exports claim one id.\n */\nexport async function discover(\n\toptions: DiscoverOptions,\n): Promise<ConstructManifest> {\n\tconst sandbox = options.sandbox ?? activeSandbox();\n\tif (sandbox) {\n\t\tif (!options.sources && !options.bustCache) {\n\t\t\tconst sandboxed = await discoverInSandbox(sandbox, options);\n\t\t\tif (sandboxed) return sandboxed;\n\t\t} else if (sandbox.isolating) {\n\t\t\t// The construct objects themselves, or a re-import for the watcher:\n\t\t\t// neither can cross a sandbox that hands back only data.\n\t\t\tthrow new LiveConstructsUnavailable();\n\t\t}\n\t}\n\n\tconst {\n\t\tpatterns,\n\t\tcwd = process.cwd(),\n\t\tbustCache = false,\n\t\tsources: out,\n\t} = options;\n\n\t// Re-importing user modules re-executes them, and Zod v4 throws on a\n\t// re-registered `.meta({ id })`. Same reason the generators clear it.\n\tif (bustCache) clearZodGlobalRegistry();\n\n\tconst manifest: Record<string, Declaration> = {};\n\t/** Which file declared each id, for the error when two of them do. */\n\tconst sources: Record<string, string> = {};\n\t/**\n\t * Constructs already seen, by identity.\n\t *\n\t * A re-export is the *same object* reached through a second file — ESM\n\t * bindings are live, so `export * from './database.js'` hands back the\n\t * binding rather than a copy. Without this, a barrel file made every\n\t * construct in it appear declared twice, and `constructs/index.ts` is the\n\t * first thing anyone writes in a shared folder.\n\t *\n\t * Identity rather than file is also the more honest rule: what may not\n\t * happen twice is two *different* constructs claiming one id, and that is\n\t * still an error below.\n\t */\n\tconst seen = new WeakSet<object>();\n\n\tconst globs = Array.isArray(patterns) ? [...patterns] : [patterns as string];\n\tconst files = fg.stream(globs, { cwd, absolute: true });\n\n\t/** Matched files, for the diagnostic below. */\n\tlet matched = 0;\n\n\tfor await (const found of files) {\n\t\tmatched++;\n\t\tconst file = found.toString();\n\t\tconst module = await import(bustCache ? `${file}?t=${Date.now()}` : file);\n\n\t\tfor (const [exportName, exported] of Object.entries(module)) {\n\t\t\tif (options.background)\n\t\t\t\trecordBackground(options.background, exported, file);\n\t\t\tif (options.subscribers)\n\t\t\t\trecordSubscriber(options.subscribers, exported, exportName);\n\t\t\tif (!isDeclarable(exported)) {\n\t\t\t\tif (options.runnables) recordRunnable(options.runnables, exported);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// The same construct, reached again through a re-export. Skipped\n\t\t\t// rather than re-declared: it has already claimed its id, from the\n\t\t\t// file that defined it.\n\t\t\tif (seen.has(exported as object)) continue;\n\t\t\tseen.add(exported as object);\n\n\t\t\t// A construct that is also something a process runs — a queue and its\n\t\t\t// consumer, built from a worker — reaches what it depends on through\n\t\t\t// that process, exactly as an endpoint or a cron does.\n\t\t\tif (\n\t\t\t\toptions.runnables &&\n\t\t\t\ttypeof (exported as { owner?: unknown }).owner === 'string'\n\t\t\t) {\n\t\t\t\trecordRunnable(options.runnables, exported);\n\t\t\t}\n\n\t\t\tfor (const declaration of exported.declare()) {\n\t\t\t\t// Canonicalise here too: a construct built by hand rather than through\n\t\t\t\t// a constructor is still subject to the same identity rule.\n\t\t\t\tconst id = canonicalId(declaration.id);\n\t\t\t\tconst source = relative(cwd, file);\n\n\t\t\t\tconst claimed = sources[id];\n\t\t\t\tif (claimed !== undefined && claimed !== source) {\n\t\t\t\t\tthrow new DuplicateConstruct(id, [claimed, source]);\n\t\t\t\t}\n\n\t\t\t\tmanifest[id] = { ...declaration, id };\n\t\t\t\tsources[id] = source;\n\t\t\t\tif (out) out[id] = { file, exportName, construct: exported };\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reference integrity before anyone reads it — a schema tenant naming a\n\t// database that was deleted is a manifest error, not a reconcile failure.\n\tassertDerivations(manifest);\n\n\twarnIfNothingFound(globs, matched, Object.keys(manifest).length);\n\n\treturn manifest;\n}\n\n/**\n * Record where a worker's background work is declared: a cron, a queue\n * consumer or a topic subscriber, under the worker that owns it.\n */\nfunction recordBackground(\n\tbackground: Record<string, string[]>,\n\texported: unknown,\n\tfile: string,\n): void {\n\tif (\n\t\t!Cron.isCron(exported) &&\n\t\t!Queue.isQueue(exported) &&\n\t\t!Subscriber.isSubscriber(exported)\n\t) {\n\t\treturn;\n\t}\n\tconst owner = (exported as { owner?: unknown }).owner;\n\tif (typeof owner !== 'string') return;\n\n\tconst key = canonicalId(owner);\n\tconst files = background[key] ?? [];\n\tbackground[key] = files;\n\tif (!files.includes(file)) files.push(file);\n}\n\n/**\n * Record a subscriber — to a topic or to a bucket — under the worker that\n * runs it, by its export. Once per name: a file reached twice through a\n * re-export finds it again.\n */\nfunction recordSubscriber(\n\tsubscribers: Record<string, BoundSubscriber[]>,\n\texported: unknown,\n\texportName: string,\n): void {\n\tif (!Subscriber.isSubscriber(exported)) return;\n\tconst owner = (exported as { owner?: unknown }).owner;\n\tconst connectionKey = subscriberConnectionKey(exported);\n\tif (typeof owner !== 'string' || !connectionKey) return;\n\n\tconst key = canonicalId(owner);\n\tconst bound = subscribers[key] ?? [];\n\tsubscribers[key] = bound;\n\tif (\n\t\t!bound.some(\n\t\t\t(s) => s.connectionKey === connectionKey && s.name === exportName,\n\t\t)\n\t) {\n\t\tconst events = exported.topicName ? exported.subscribedEvents : undefined;\n\t\tbound.push({\n\t\t\tname: exportName,\n\t\t\tconnectionKey,\n\t\t\t...(events ? { events: [...events] } : {}),\n\t\t});\n\t}\n}\n\n/**\n * What a runnable consumes, by id: a queue's consumer drains that queue, a\n * subscriber its topic. Nothing for anything else.\n */\nexport function consumedBy(runnable: unknown): string[] {\n\tif (Queue.isQueue(runnable)) return [runnable.id];\n\tif (Subscriber.isSubscriber(runnable) && runnable.topicName) {\n\t\treturn [canonicalId(runnable.topicName)];\n\t}\n\tif (Subscriber.isSubscriber(runnable) && runnable.bucketName) {\n\t\treturn [canonicalId(runnable.bucketName)];\n\t}\n\treturn [];\n}\n\n/**\n * The edges a runnable's process records for what it consumes. A bucket's\n * subscriber consumes the bucket's *events*, not the bucket: binding to its\n * changes is not reading its objects, so its process is handed the events\n * key and not the bucket's URL — that still takes `.dependsOn([bucket])`.\n */\nfunction consumedEdges(runnable: unknown): string[] {\n\tif (Subscriber.isSubscriber(runnable) && runnable.bucketName) {\n\t\treturn [eventsEdge(canonicalId(runnable.bucketName))];\n\t}\n\treturn consumedBy(runnable);\n}\n\n/**\n * Record a runnable's edges under the construct that owns it — the surface an\n * endpoint was built from, or the worker a cron or subscriber was. Anything\n * with no owner, or that is not a runnable at all, is left alone.\n */\nfunction recordRunnable(\n\trunnables: Record<string, string[]>,\n\texported: unknown,\n): void {\n\tif (typeof exported !== 'object' || exported === null) return;\n\n\tconst runnable = exported as {\n\t\tsurface?: { id?: unknown };\n\t\towner?: unknown;\n\t\tconstructs?: unknown;\n\t};\n\tconst owner =\n\t\ttypeof runnable.surface?.id === 'string'\n\t\t\t? runnable.surface.id\n\t\t\t: typeof runnable.owner === 'string'\n\t\t\t\t? runnable.owner\n\t\t\t\t: undefined;\n\tif (!owner || !Array.isArray(runnable.constructs)) return;\n\n\tconst key = canonicalId(owner);\n\tconst edges = runnables[key] ?? [];\n\trunnables[key] = edges;\n\t// What it consumes is an edge of its process too, so a worker is handed\n\t// the carriers its own work is bound to and no other.\n\tfor (const id of runnable.constructs) {\n\t\tif (typeof id !== 'string') continue;\n\t\tconst target = canonicalId(id);\n\t\tif (!edges.includes(target)) edges.push(target);\n\t}\n\tfor (const edge of consumedEdges(exported)) {\n\t\tif (!edges.includes(edge)) edges.push(edge);\n\t}\n}\n\n/**\n * Say so when a glob was configured and found nothing.\n *\n * The glob is not a filter over declarations already known — it is *how they\n * are found*, by importing what it matches. So a file it misses is a\n * declaration that does not exist, and every symptom of that appears somewhere\n * other than the cause: no container starts, no env key is written, and the\n * application fails on first use against a resource it can see in its own\n * source.\n *\n * Nothing reported it before, because an unmatched file is indistinguishable\n * from a file nobody wrote. These two cases are the ones that are *not*\n * ambiguous — a glob was configured, so something was expected.\n *\n * Silent when no glob is configured at all: that is a project which has not\n * adopted constructs, and has nothing to be missing.\n */\nfunction warnIfNothingFound(\n\tglobs: readonly string[],\n\tmatched: number,\n\tdeclared: number,\n): void {\n\tif (globs.length === 0) return;\n\n\tif (matched === 0) {\n\t\tlogger.warn(\n\t\t\t`\\n⚠️ The constructs glob matched no files, so nothing was declared.\\n` +\n\t\t\t\t` Patterns: ${globs.join(', ')}\\n` +\n\t\t\t\t` Nothing will be provisioned — no containers, no env keys, no ` +\n\t\t\t\t`resources.\\n` +\n\t\t\t\t` A common cause is depth: '*.ts' matches one level, '**/*.ts' ` +\n\t\t\t\t`matches any.`,\n\t\t);\n\t\treturn;\n\t}\n\n\tif (declared === 0) {\n\t\tlogger.warn(\n\t\t\t`\\n⚠️ The constructs glob matched ${matched} file(s) but none declared ` +\n\t\t\t\t`anything.\\n` +\n\t\t\t\t` Patterns: ${globs.join(', ')}\\n` +\n\t\t\t\t` Discovery keeps exports with an 'id' that can 'declare()'. A ` +\n\t\t\t\t`construct that is\\n` +\n\t\t\t\t` built but never exported is invisible to it.`,\n\t\t);\n\t}\n}\n\n/** Two constructs claiming one id. */\nexport class DuplicateConstruct extends GkmError {\n\t/** The id claimed twice. */\n\treadonly id: string;\n\t/** The files that claimed it. */\n\treadonly sources: readonly string[];\n\n\tconstructor(id: string, sources: readonly string[]) {\n\t\tsuper('Two constructs declare the same id');\n\t\tthis.name = 'DuplicateConstruct';\n\t\tthis.id = id;\n\t\tthis.sources = sources;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,gB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AE5C;;;;;;;;;;;;;;;;;;AAmBA,SAAS,mBACR,OACA,SACA,UACO;CACP,IAAI,MAAM,WAAW,GAAG;CAExB,IAAI,YAAY,GAAG;EAClB,OAAO,KACN,sFACiB,MAAM,KAAK,IAAI,EAAE,2JAKnC;EACA;CACD;CAEA,IAAI,aAAa,GAChB,OAAO,KACN,qCAAqC,QAAQ,qDAE5B,MAAM,KAAK,IAAI,EAAE,qIAInC;AAEF;;AAGA,IAAa,qBAAb,cAAwC,SAAS;;CAEhD;;CAEA;CAEA,YAAY,IAAY,SAA4B;EACnD,MAAM,oCAAoC;EAC1C,KAAK,OAAO;EACZ,KAAK,KAAK;EACV,KAAK,UAAU;CAChB;AACD"}
@@ -17,6 +17,40 @@ let fast_glob = require("fast-glob");
17
17
  fast_glob = require_rolldown_runtime.__toESM(fast_glob, 1);
18
18
  let lodash_kebabcase = require("lodash.kebabcase");
19
19
  lodash_kebabcase = require_rolldown_runtime.__toESM(lodash_kebabcase, 1);
20
+ //#region src/reconcile/edges.ts
21
+ /**
22
+ * Edges a process records for what its runnables consume, beyond the
23
+ * construct ids `.dependsOn()` names.
24
+ */
25
+ const EVENTS_SUFFIX = "#events";
26
+ /**
27
+ * A bucket's events, as an edge: what a process running one of the bucket's
28
+ * subscribers consumes. Not the bucket's id — binding to a bucket's changes
29
+ * is not reading its objects, so the process is handed the events key alone.
30
+ */
31
+ function eventsEdge(bucketId) {
32
+ return `${bucketId}${EVENTS_SUFFIX}`;
33
+ }
34
+ /** The bucket an events edge names, or nothing for any other edge. */
35
+ function eventsEdgeBucket(edge) {
36
+ return edge.endsWith(EVENTS_SUFFIX) ? edge.slice(0, -7) : void 0;
37
+ }
38
+ /**
39
+ * The env key a subscriber's deliveries come from: its topic's publisher
40
+ * connection string, or its bucket's events connection string.
41
+ */
42
+ function subscriberConnectionKey(construct) {
43
+ if (construct.bucketName) return (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.bucketName), "eventsConnectionString");
44
+ if (construct.topicName) return (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.topicName), "publisherConnectionString");
45
+ }
46
+ /**
47
+ * The key a bucket's relay token is read from, by the process that runs the
48
+ * bucket's subscribers — beside its events connection string.
49
+ */
50
+ function subscriberTokenKey(construct) {
51
+ return construct.bucketName ? (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.bucketName), "eventsToken") : void 0;
52
+ }
53
+ //#endregion
20
54
  //#region src/output.ts
21
55
  /**
22
56
  * Where the CLI's progress lines go.
@@ -297,7 +331,8 @@ const DiscoverAnswer = require_schemas.discriminatedUnion("reason", [
297
331
  background: require_schemas.record(require_schemas.string(), require_schemas.array(require_schemas.string())).optional(),
298
332
  subscribers: require_schemas.record(require_schemas.string(), require_schemas.array(require_schemas.object({
299
333
  name: require_schemas.string(),
300
- topic: require_schemas.string()
334
+ connectionKey: require_schemas.string(),
335
+ events: require_schemas.array(require_schemas.string()).optional()
301
336
  }))).optional()
302
337
  }),
303
338
  require_schemas.object({
@@ -474,21 +509,26 @@ function recordBackground(background, exported, file) {
474
509
  if (!files.includes(file)) files.push(file);
475
510
  }
476
511
  /**
477
- * Record a topic subscriber under the worker that runs it, by its export.
478
- * Once per name: a file reached twice through a re-export finds it again.
512
+ * Record a subscriber — to a topic or to a bucket — under the worker that
513
+ * runs it, by its export. Once per name: a file reached twice through a
514
+ * re-export finds it again.
479
515
  */
480
516
  function recordSubscriber(subscribers, exported, exportName) {
481
517
  if (!_geekmidas_constructs_subscribers.Subscriber.isSubscriber(exported)) return;
482
- const { owner, topicName } = exported;
483
- if (typeof owner !== "string" || typeof topicName !== "string") return;
518
+ const owner = exported.owner;
519
+ const connectionKey = subscriberConnectionKey(exported);
520
+ if (typeof owner !== "string" || !connectionKey) return;
484
521
  const key = (0, _geekmidas_manifest.canonicalId)(owner);
485
522
  const bound = subscribers[key] ?? [];
486
523
  subscribers[key] = bound;
487
- const topic = (0, _geekmidas_manifest.canonicalId)(topicName);
488
- if (!bound.some((s) => s.topic === topic && s.name === exportName)) bound.push({
489
- name: exportName,
490
- topic
491
- });
524
+ if (!bound.some((s) => s.connectionKey === connectionKey && s.name === exportName)) {
525
+ const events = exported.topicName ? exported.subscribedEvents : void 0;
526
+ bound.push({
527
+ name: exportName,
528
+ connectionKey,
529
+ ...events ? { events: [...events] } : {}
530
+ });
531
+ }
492
532
  }
493
533
  /**
494
534
  * What a runnable consumes, by id: a queue's consumer drains that queue, a
@@ -497,9 +537,20 @@ function recordSubscriber(subscribers, exported, exportName) {
497
537
  function consumedBy(runnable) {
498
538
  if (_geekmidas_constructs_queue.Queue.isQueue(runnable)) return [runnable.id];
499
539
  if (_geekmidas_constructs_subscribers.Subscriber.isSubscriber(runnable) && runnable.topicName) return [(0, _geekmidas_manifest.canonicalId)(runnable.topicName)];
540
+ if (_geekmidas_constructs_subscribers.Subscriber.isSubscriber(runnable) && runnable.bucketName) return [(0, _geekmidas_manifest.canonicalId)(runnable.bucketName)];
500
541
  return [];
501
542
  }
502
543
  /**
544
+ * The edges a runnable's process records for what it consumes. A bucket's
545
+ * subscriber consumes the bucket's *events*, not the bucket: binding to its
546
+ * changes is not reading its objects, so its process is handed the events
547
+ * key and not the bucket's URL — that still takes `.dependsOn([bucket])`.
548
+ */
549
+ function consumedEdges(runnable) {
550
+ if (_geekmidas_constructs_subscribers.Subscriber.isSubscriber(runnable) && runnable.bucketName) return [eventsEdge((0, _geekmidas_manifest.canonicalId)(runnable.bucketName))];
551
+ return consumedBy(runnable);
552
+ }
553
+ /**
503
554
  * Record a runnable's edges under the construct that owns it — the surface an
504
555
  * endpoint was built from, or the worker a cron or subscriber was. Anything
505
556
  * with no owner, or that is not a runnable at all, is left alone.
@@ -512,11 +563,12 @@ function recordRunnable(runnables, exported) {
512
563
  const key = (0, _geekmidas_manifest.canonicalId)(owner);
513
564
  const edges = runnables[key] ?? [];
514
565
  runnables[key] = edges;
515
- for (const id of [...runnable.constructs, ...consumedBy(exported)]) {
566
+ for (const id of runnable.constructs) {
516
567
  if (typeof id !== "string") continue;
517
568
  const target = (0, _geekmidas_manifest.canonicalId)(id);
518
569
  if (!edges.includes(target)) edges.push(target);
519
570
  }
571
+ for (const edge of consumedEdges(exported)) if (!edges.includes(edge)) edges.push(edge);
520
572
  }
521
573
  /**
522
574
  * Say so when a glob was configured and found nothing.
@@ -599,6 +651,18 @@ Object.defineProperty(exports, "discover_exports", {
599
651
  return discover_exports;
600
652
  }
601
653
  });
654
+ Object.defineProperty(exports, "eventsEdge", {
655
+ enumerable: true,
656
+ get: function() {
657
+ return eventsEdge;
658
+ }
659
+ });
660
+ Object.defineProperty(exports, "eventsEdgeBucket", {
661
+ enumerable: true,
662
+ get: function() {
663
+ return eventsEdgeBucket;
664
+ }
665
+ });
602
666
  Object.defineProperty(exports, "isDeclarable", {
603
667
  enumerable: true,
604
668
  get: function() {
@@ -623,6 +687,18 @@ Object.defineProperty(exports, "runWorker", {
623
687
  return runWorker;
624
688
  }
625
689
  });
690
+ Object.defineProperty(exports, "subscriberConnectionKey", {
691
+ enumerable: true,
692
+ get: function() {
693
+ return subscriberConnectionKey;
694
+ }
695
+ });
696
+ Object.defineProperty(exports, "subscriberTokenKey", {
697
+ enumerable: true,
698
+ get: function() {
699
+ return subscriberTokenKey;
700
+ }
701
+ });
626
702
  Object.defineProperty(exports, "withOutput", {
627
703
  enumerable: true,
628
704
  get: function() {
@@ -636,4 +712,4 @@ Object.defineProperty(exports, "withOwningTsconfigJsx", {
636
712
  }
637
713
  });
638
714
 
639
- //# sourceMappingURL=discover-DozUKs8f.cjs.map
715
+ //# sourceMappingURL=discover-ojkcbxHw.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover-ojkcbxHw.cjs","names":["provideKey","canonicalId","AsyncLocalStorage","format","fg","kebabCase","relative","dirname","fileURLToPath","join","existsSync","pathToFileURL","dirname","fileURLToPath","join","existsSync","pathToFileURL","createRequire","oncePerRun","WORKER_RESULT_MARKER","activeSandbox","fg","canonicalId","relative","Cron","Queue","Subscriber","GkmError"],"sources":["../src/reconcile/edges.ts","../src/output.ts","../src/generators/Generator.ts","../src/owningTsconfigJsx.ts","../src/sandbox/worker.ts","../src/reconcile/discover.ts"],"sourcesContent":["/**\n * Edges a process records for what its runnables consume, beyond the\n * construct ids `.dependsOn()` names.\n */\n\nimport { canonicalId, provideKey } from '@geekmidas/manifest';\n\nconst EVENTS_SUFFIX = '#events';\n\n/**\n * A bucket's events, as an edge: what a process running one of the bucket's\n * subscribers consumes. Not the bucket's id — binding to a bucket's changes\n * is not reading its objects, so the process is handed the events key alone.\n */\nexport function eventsEdge(bucketId: string): string {\n\treturn `${bucketId}${EVENTS_SUFFIX}`;\n}\n\n/** The bucket an events edge names, or nothing for any other edge. */\nexport function eventsEdgeBucket(edge: string): string | undefined {\n\treturn edge.endsWith(EVENTS_SUFFIX)\n\t\t? edge.slice(0, -EVENTS_SUFFIX.length)\n\t\t: undefined;\n}\n\n/**\n * The env key a subscriber's deliveries come from: its topic's publisher\n * connection string, or its bucket's events connection string.\n */\nexport function subscriberConnectionKey(construct: {\n\ttopicName?: string;\n\tbucketName?: string;\n}): string | undefined {\n\tif (construct.bucketName) {\n\t\treturn provideKey(\n\t\t\tcanonicalId(construct.bucketName),\n\t\t\t'eventsConnectionString',\n\t\t);\n\t}\n\tif (construct.topicName) {\n\t\treturn provideKey(\n\t\t\tcanonicalId(construct.topicName),\n\t\t\t'publisherConnectionString',\n\t\t);\n\t}\n\treturn undefined;\n}\n\n/**\n * The key a bucket's relay token is read from, by the process that runs the\n * bucket's subscribers — beside its events connection string.\n */\nexport function subscriberTokenKey(construct: {\n\tbucketName?: string;\n}): string | undefined {\n\treturn construct.bucketName\n\t\t? provideKey(canonicalId(construct.bucketName), 'eventsToken')\n\t\t: undefined;\n}\n","/**\n * Where the CLI's progress lines go.\n *\n * Commands write their progress through `output` rather than `console`. Run\n * from the terminal that is the same thing. Run inside `deploy()`, each line\n * goes to the run that wrote it instead — as an event its caller can iterate,\n * and to the logger it was handed — so a deploy embedded in another program\n * does not print over that program's own output.\n *\n * Carried by `AsyncLocalStorage` rather than passed down, because the lines\n * come from everywhere a deploy reaches — the Dockerfile generator, the env\n * sniffer, construct discovery — and two deploys running in one process must\n * not hear each other.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { format } from 'node:util';\n\n/** How loud a line is. */\nexport type OutputLevel = 'info' | 'warn' | 'error';\n\n/** Receives each line written while it is the current sink. */\nexport type OutputSink = (level: OutputLevel, message: string) => void;\n\nconst current = new AsyncLocalStorage<OutputSink>();\n\n/** Runs `fn` with every line written through `output` sent to `sink`. */\nexport function withOutput<T>(sink: OutputSink, fn: () => T): T {\n\treturn current.run(sink, fn);\n}\n\nfunction write(\n\tlevel: OutputLevel,\n\tfallback: (...args: unknown[]) => void,\n): (...args: unknown[]) => void {\n\treturn (...args) => {\n\t\tconst sink = current.getStore();\n\t\tif (sink) sink(level, format(...args));\n\t\telse fallback(...args);\n\t};\n}\n\n/**\n * `console`, for the methods the CLI logs through — routed to the current\n * run's sink when there is one.\n */\nexport const output = {\n\tlog: write('info', (...args) => console.log(...args)),\n\tinfo: write('info', (...args) => console.info(...args)),\n\twarn: write('warn', (...args) => console.warn(...args)),\n\terror: write('error', (...args) => console.error(...args)),\n};\n","import { relative } from 'node:path';\nimport type { Construct } from '@geekmidas/constructs';\nimport fg from 'fast-glob';\nimport kebabCase from 'lodash.kebabcase';\nimport type { BuildContext } from '../build/types';\nimport type { MainProvider, Routes } from '../types';\n\n/**\n * Zod v4 maintains a process-wide registry of schemas registered via\n * `.meta({ id })`. When we cache-bust user module imports (by appending a\n * `?t=timestamp` query), those modules re-execute and try to register the\n * same ids again, which throws `ID X already exists in the registry`.\n *\n * Clearing the registry in the CLI process is safe: the user's running\n * server lives in a subprocess and has its own isolated registry.\n *\n * Exported for tests.\n */\nexport function clearZodGlobalRegistry(): void {\n\tconst registry = (\n\t\tglobalThis as { __zod_globalRegistry?: { clear?: () => void } }\n\t).__zod_globalRegistry;\n\tif (registry && typeof registry.clear === 'function') {\n\t\tregistry.clear();\n\t}\n}\n\nexport interface GeneratorOptions {\n\t/** Where the build deploys: one Lambda per construct, or one process. */\n\ttarget?: MainProvider;\n\t/**\n\t * What a handler path in the manifest is relative to — the workspace root,\n\t * which is where `sst.config.ts` runs and resolves it from.\n\t */\n\troot?: string;\n\t[key: string]: any;\n}\n\nexport abstract class ConstructGenerator<T extends Construct, R = void> {\n\tabstract isConstruct(value: any): value is T;\n\n\tstatic async build<T extends Construct, R = void>(\n\t\tcontext: BuildContext,\n\t\toutputDir: string,\n\t\tgenerator: ConstructGenerator<T, R>,\n\t\tpatterns?: Routes,\n\t\toptions?: GeneratorOptions,\n\t): Promise<R> {\n\t\tconst constructs = await generator.load(patterns);\n\t\treturn generator.build(context, constructs, outputDir, options);\n\t}\n\n\tabstract build(\n\t\tcontext: BuildContext,\n\t\tconstructs: GeneratedConstruct<T>[],\n\t\toutputDir: string,\n\t\toptions?: GeneratorOptions,\n\t): Promise<R>;\n\n\tasync load(\n\t\tpatterns?: Routes,\n\t\tcwd = process.cwd(),\n\t\tbustCache = false,\n\t): Promise<GeneratedConstruct<T>[]> {\n\t\tconst logger = console;\n\n\t\tconst globPatterns = Array.isArray(patterns)\n\t\t\t? patterns\n\t\t\t: patterns\n\t\t\t\t? [patterns]\n\t\t\t\t: [];\n\n\t\t// Find all files\n\t\tconst files = fg.stream(globPatterns, {\n\t\t\tcwd,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Cache-busted re-imports re-execute user modules, which would try to\n\t\t// re-register Zod schemas with the same `.meta({ id })`. Clear the\n\t\t// global registry once per load to prevent duplicate-id errors.\n\t\tif (bustCache) {\n\t\t\tclearZodGlobalRegistry();\n\t\t}\n\n\t\t// Load constructs\n\t\tconst constructs: GeneratedConstruct<T>[] = [];\n\n\t\tfor await (const f of files) {\n\t\t\ttry {\n\t\t\t\tconst file = f.toString();\n\t\t\t\t// Append cache-busting query param to force re-import of changed modules\n\t\t\t\tconst importPath = bustCache ? `${file}?t=${Date.now()}` : file;\n\t\t\t\tconst module = await import(importPath);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [key, construct] of Object.entries(module)) {\n\t\t\t\t\tif (this.isConstruct(construct)) {\n\t\t\t\t\t\tconstructs.push({\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tname: kebabCase(key),\n\t\t\t\t\t\t\tconstruct,\n\t\t\t\t\t\t\tpath: {\n\t\t\t\t\t\t\t\tabsolute: file,\n\t\t\t\t\t\t\t\trelative: relative(process.cwd(), file),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconst err = error as Error;\n\t\t\t\tlogger.error(`Failed to load ${f}: ${err.message}`);\n\t\t\t\tif (err.stack) {\n\t\t\t\t\tlogger.error(err.stack);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\treturn constructs;\n\t}\n}\n\nexport interface GeneratedConstruct<T extends Construct> {\n\tkey: string;\n\tname: string;\n\tconstruct: T;\n\tpath: {\n\t\tabsolute: string;\n\t\trelative: string;\n\t};\n}\n","import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nconst REGISTER = 'owning-tsconfig-jsx-register.mjs';\n\n/** The CLI's `bin/` was not found above the module looking for it. */\nexport class OwningTsconfigJsxHookMissing extends Error {\n\tconstructor(readonly from: string) {\n\t\tsuper(\n\t\t\t`Could not find bin/${REGISTER} in any directory above '${from}'. ` +\n\t\t\t\t'It ships with @geekmidas/cli beside bin/gkm.mjs; reinstall the ' +\n\t\t\t\t'package if it is missing.',\n\t\t);\n\t\tthis.name = 'OwningTsconfigJsxHookMissing';\n\t}\n}\n\n/**\n * The CLI's `bin/owning-tsconfig-jsx-register.mjs`, as a file URL. Searched\n * upward because this module runs from `src/` in the repo and from a chunk in\n * `dist/` once built, and `bin/` sits beside both.\n */\nfunction registerUrl(): string {\n\tconst from = dirname(fileURLToPath(import.meta.url));\n\tfor (let dir = from; ; dir = dirname(dir)) {\n\t\tconst candidate = join(dir, 'bin', REGISTER);\n\t\tif (existsSync(candidate)) return pathToFileURL(candidate).href;\n\t\tif (dirname(dir) === dir) throw new OwningTsconfigJsxHookMissing(from);\n\t}\n}\n\n/**\n * `NODE_OPTIONS` for a process that runs app code through tsx, with the hook\n * that compiles each `.tsx` with its own tsconfig's JSX settings (see\n * `bin/owning-tsconfig-jsx.mjs`) put in front of every other `--import`, so it\n * is registered before tsx and reads the source on tsx's behalf.\n *\n * `bin/gkm.mjs` already starts the CLI this way, and its children inherit it;\n * this is for those that set `NODE_OPTIONS` themselves, or whose CLI was\n * started with tsx already imported.\n */\nexport function withOwningTsconfigJsx(nodeOptions = ''): string {\n\tif (nodeOptions.includes(REGISTER)) return nodeOptions;\n\treturn [`--import=${registerUrl()}`, nodeOptions].filter(Boolean).join(' ');\n}\n","/**\n * Running one of the CLI's own worker scripts inside a sandbox, and reading\n * back the one JSON value it answers with.\n *\n * The worker imports the project's TypeScript — `gkm.config.ts`, construct\n * modules, an app's entry — so it starts with the CLI's own tsx and the two\n * hooks `gkm` itself runs with (JSX by the owning tsconfig, path aliases by\n * the adjacent one). The host process needs none of them loaded: a program\n * calling `deploy()` without `--import tsx` still loads a TypeScript config.\n */\n\nimport { existsSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport type { z } from 'zod';\nimport { withOwningTsconfigJsx } from '../owningTsconfigJsx';\nimport { oncePerRun, type Sandbox } from './sandbox';\nimport { WORKER_RESULT_MARKER } from './workerRuntime';\n\nconst here = dirname(fileURLToPath(import.meta.url));\n\n/**\n * A worker's file: `dist/sandbox/<name>.mjs` once built — whether this module\n * was bundled into `dist/` or sits beside it — or the `.ts` source under tsx.\n */\nexport function workerFile(name: string): string {\n\tconst candidates = [\n\t\tjoin(here, 'sandbox', `${name}.mjs`),\n\t\tjoin(here, `${name}.mjs`),\n\t\tjoin(here, '..', 'sandbox', `${name}.mjs`),\n\t\tjoin(here, `${name}.ts`),\n\t];\n\treturn (\n\t\tcandidates.find((path) => existsSync(path)) ?? join(here, `${name}.ts`)\n\t);\n}\n\n/** tsx, from the CLI's own dependencies — never the project's. */\nexport function tsxUrl(): string {\n\treturn pathToFileURL(createRequire(import.meta.url).resolve('tsx')).href;\n}\n\n/**\n * `node`'s arguments for `script`: the CLI's TypeScript loaders, then any\n * further `imports`, then the script and its `args` — an argument array, so\n * nothing about a path is read by a shell.\n */\nexport function nodeWithTsx(\n\tscript: string,\n\targs: readonly string[],\n\timports: readonly string[] = [],\n): string[] {\n\treturn [\n\t\t...withOwningTsconfigJsx(`--import=${tsxUrl()}`).split(' '),\n\t\t...imports.map((path) => `--import=${pathToFileURL(path).href}`),\n\t\tscript,\n\t\t...args,\n\t];\n}\n\n/** A worker ended without the answer it exists to give. */\nexport class SandboxWorkerFailed extends Error {\n\tconstructor(\n\t\treadonly step: string,\n\t\treadonly exitCode: number | null,\n\t\treadonly stderr: string,\n\t) {\n\t\tsuper(\n\t\t\t`The sandboxed ${step} ended (exit code ${exitCode}) without an ` +\n\t\t\t\t`answer.${stderr.trim() ? `\\n${stderr.trim()}` : ''}\\nIts output ` +\n\t\t\t\t'above says why; the sandbox must be able to run `node` with the ' +\n\t\t\t\t\"CLI's own files at the paths they have here.\",\n\t\t);\n\t\tthis.name = 'SandboxWorkerFailed';\n\t}\n}\n\nexport interface WorkerRun<T> {\n\t/** What the worker answered, as the schema reads it. */\n\tvalue: T;\n\t/** What it wrote to stderr: warnings a caller may pass on. */\n\tstderr: string;\n}\n\n/**\n * Run worker `name` in `sandbox`, and parse its answer with `schema`.\n *\n * The answer is the last marked line on stdout. Anything else the project's\n * code printed is ignored, and an answer the schema refuses is a failure\n * rather than data — a worker in an isolating sandbox runs code the host does\n * not trust.\n *\n * Within a run (`withSandbox`), the same worker asked the same question is\n * started once; every ask gets its own copy of the answer, and its stderr, as\n * though it had run again.\n */\nexport async function runWorker<S extends z.ZodType>(\n\tsandbox: Sandbox,\n\tstep: string,\n\toptions: WorkerOptions<S>,\n): Promise<WorkerRun<z.infer<S>>> {\n\t// A step handed secrets acts on something — a database it migrates — and\n\t// is not a question whose answer can be reused; nor do its secrets belong\n\t// in a cache key.\n\tif (options.secrets) return startWorker(sandbox, step, options);\n\n\tconst key = JSON.stringify([\n\t\toptions.name,\n\t\toptions.cwd,\n\t\toptions.args,\n\t\toptions.env ?? {},\n\t]);\n\tconst answer = await oncePerRun(sandbox, key, () =>\n\t\tstartWorker(sandbox, step, options),\n\t);\n\treturn structuredClone(answer);\n}\n\ninterface WorkerOptions<S extends z.ZodType> {\n\tname: string;\n\targs: readonly string[];\n\tcwd: string;\n\ttimeoutMs: number;\n\tenv?: Readonly<Record<string, string>>;\n\t/** Mounted as files, named by `GKM_SECRETS_DIR` — never variables. */\n\tsecrets?: Readonly<Record<string, string>>;\n\tsignal?: AbortSignal;\n\tschema: S;\n}\n\nasync function startWorker<S extends z.ZodType>(\n\tsandbox: Sandbox,\n\tstep: string,\n\toptions: WorkerOptions<S>,\n): Promise<WorkerRun<z.infer<S>>> {\n\tconst result = await sandbox.exec(\n\t\t'node',\n\t\tnodeWithTsx(workerFile(options.name), options.args),\n\t\t{\n\t\t\tcwd: options.cwd,\n\t\t\tenv: { ...sandbox.env, ...options.env },\n\t\t\ttimeoutMs: options.timeoutMs,\n\t\t\toutput: 'capture',\n\t\t\t...(options.secrets ? { secrets: options.secrets } : {}),\n\t\t\t...(options.signal ? { signal: options.signal } : {}),\n\t\t},\n\t);\n\n\tconst line = result.stdout\n\t\t.split('\\n')\n\t\t.reverse()\n\t\t.find((l) => l.startsWith(WORKER_RESULT_MARKER));\n\tif (line) {\n\t\ttry {\n\t\t\tconst parsed = options.schema.safeParse(\n\t\t\t\tJSON.parse(line.slice(WORKER_RESULT_MARKER.length)),\n\t\t\t);\n\t\t\tif (parsed.success) return { value: parsed.data, stderr: result.stderr };\n\t\t} catch {\n\t\t\t// Not JSON: as good as no answer.\n\t\t}\n\t}\n\n\tthrow new SandboxWorkerFailed(step, result.exitCode, result.stderr);\n}\n","/**\n * Discovery — one glob, one structural test.\n *\n * A glob per kind is the same specialness the construct model removes, and\n * resources have no kind to be listed under: a declared `ObjectStorage` would\n * never be found by `routes:` or `crons:`. So there is one `constructs` glob,\n * every export of every matching module is inspected, and the per-kind\n * `isConstruct` checks collapse into a single question — does it have an id and\n * can it declare?\n *\n * Structural rather than `instanceof` on purpose. A construct from a different\n * copy of `@geekmidas/constructs` — a linked workspace, two versions in a\n * lockfile — is still a construct, and `instanceof` is exactly the check that\n * says otherwise.\n */\n\nimport { relative } from 'node:path';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Queue } from '@geekmidas/constructs/queue';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport {\n\tassertDerivations,\n\ttype ConstructManifest,\n\tcanonicalId,\n\ttype Declaration,\n} from '@geekmidas/manifest';\nimport fg from 'fast-glob';\nimport { z } from 'zod';\nimport { GkmError } from '../errors';\nimport { clearZodGlobalRegistry } from '../generators/Generator';\nimport { output } from '../output';\nimport { activeSandbox, type Sandbox } from '../sandbox/sandbox';\nimport { runWorker } from '../sandbox/worker';\nimport { eventsEdge, subscriberConnectionKey } from './edges';\n\n/** `console`, or the deploy run discovering the manifest. */\nconst logger = output;\n\n/** The construct face discovery needs: an id, and the ability to declare. */\ninterface Declarable {\n\tid: string;\n\tdeclare(): Declaration[];\n}\n\n/**\n * Whether a module export is a construct.\n *\n * Deliberately loose about what else it carries — a construct that also has a\n * `service` is still a construct, and requiring one would exclude the kinds that\n * own no address.\n */\nexport function isDeclarable(value: unknown): value is Declarable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Declarable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\tcandidate.id.length > 0 &&\n\t\ttypeof candidate.declare === 'function'\n\t);\n}\n\nexport interface DiscoverOptions {\n\t/** The glob(s) to search. One pattern, not one per kind. */\n\tpatterns: string | readonly string[];\n\tcwd?: string;\n\t/**\n\t * Re-import changed modules, for the dev watcher.\n\t *\n\t * A single glob makes discovery more central, not less: a new construct file\n\t * has to be picked up on `add`, not only on `change`.\n\t */\n\tbustCache?: boolean;\n\t/**\n\t * Filled in with where each construct was found, when provided.\n\t *\n\t * Discovery is the only thing that knows: it globbed the files and imported\n\t * them. Everything downstream that needs to *write* an import — the build,\n\t * generating a server entry that reads a surface's logger — would otherwise\n\t * have to be told the path in config, which is the string this removes.\n\t *\n\t * An out-parameter rather than a second return value so that every existing\n\t * caller, which wants the manifest and nothing else, is unchanged.\n\t */\n\tsources?: Record<string, ConstructSource>;\n\t/**\n\t * Filled in, when provided, with the ids each owner's runnables declared an\n\t * edge to — keyed by the surface an endpoint was built from, or the worker\n\t * a cron or subscriber was.\n\t *\n\t * A runnable is not a declaration: a surface's endpoints are found by the\n\t * glob, not listed by the surface, so its node says `endpoints: []` until a\n\t * build folds the routes in. Anything deciding what an app's process reaches\n\t * — which keys its container is given — needs those edges before any build,\n\t * and discovery is already importing the files they are in.\n\t */\n\trunnables?: Record<string, string[]>;\n\t/**\n\t * Filled in, when provided, with the files each worker's background work is\n\t * declared in — its crons, queue consumers and topic subscribers — keyed by\n\t * the worker.\n\t *\n\t * What says which app's build carries a worker's entry: the one whose\n\t * directory holds its work. A worker declares no path of its own.\n\t */\n\tbackground?: Record<string, string[]>;\n\t/**\n\t * Filled in, when provided, with each worker's subscribers — by the export\n\t * a push route is named after, and the key its deliveries come from: its\n\t * topic's, or its bucket's events — keyed by the worker.\n\t *\n\t * What says which worker SNS pushes to, and on which paths: a build bound\n\t * for a server records no subscriber in the manifest, because none has a\n\t * handler of its own there.\n\t */\n\tsubscribers?: Record<string, BoundSubscriber[]>;\n\t/**\n\t * Import the construct modules in this sandbox rather than in this\n\t * process. Defaults to the run's own (`withSandbox`), so a deploy's every\n\t * discovery — the engine's included — happens there; with neither, they\n\t * are imported here, as before.\n\t */\n\tsandbox?: Sandbox;\n}\n\n/** A worker's subscriber — to a topic or to a bucket — as discovery found it. */\nexport interface BoundSubscriber {\n\t/** Its export — what its push route is named after. */\n\tname: string;\n\t/**\n\t * The env key its deliveries come from: its topic's publisher connection\n\t * string, or its bucket's events connection string. An `sns://` value is\n\t * what makes SNS push to it.\n\t */\n\tconnectionKey: string;\n\t/**\n\t * The event types a topic subscriber names — its SNS subscription's filter\n\t * on the `type` attribute the topic's publisher sets. Absent for a\n\t * bucket's subscriber: S3 sets no such attribute, and the subscriber's own\n\t * filter decides.\n\t */\n\tevents?: readonly string[];\n}\n\n/** What the discovery worker answers. Checked: the worker ran project code. */\nconst DiscoverAnswer = z.discriminatedUnion('reason', [\n\tz.object({\n\t\treason: z.literal('discovered'),\n\t\tmanifest: z.record(\n\t\t\tz.string(),\n\t\t\tz.object({ id: z.string(), kind: z.string() }).loose(),\n\t\t),\n\t\trunnables: z.record(z.string(), z.array(z.string())),\n\t\tbackground: z.record(z.string(), z.array(z.string())).optional(),\n\t\tsubscribers: z\n\t\t\t.record(\n\t\t\t\tz.string(),\n\t\t\t\tz.array(\n\t\t\t\t\tz.object({\n\t\t\t\t\t\tname: z.string(),\n\t\t\t\t\t\tconnectionKey: z.string(),\n\t\t\t\t\t\tevents: z.array(z.string()).optional(),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)\n\t\t\t.optional(),\n\t}),\n\tz.object({ reason: z.literal('live'), paths: z.array(z.string()) }),\n\tz.object({\n\t\treason: z.literal('failed'),\n\t\terror: z\n\t\t\t.object({\n\t\t\t\tname: z.string(),\n\t\t\t\tmessage: z.string(),\n\t\t\t\tid: z.string().optional(),\n\t\t\t\tsources: z.array(z.string()).optional(),\n\t\t\t})\n\t\t\t.loose(),\n\t}),\n]);\n\n/**\n * The manifest, discovered in `sandbox` and handed back as JSON — or\n * `undefined` when it holds something JSON cannot carry and the sandbox is\n * not isolating, for the caller to discover here as before.\n */\nasync function discoverInSandbox(\n\tsandbox: Sandbox,\n\toptions: DiscoverOptions,\n): Promise<ConstructManifest | undefined> {\n\tconst cwd = options.cwd ?? sandbox.root;\n\tconst patterns =\n\t\ttypeof options.patterns === 'string'\n\t\t\t? [options.patterns]\n\t\t\t: [...options.patterns];\n\n\tconst { value, stderr } = await runWorker(sandbox, 'construct discovery', {\n\t\tname: 'discover-worker',\n\t\targs: [JSON.stringify({ patterns, cwd })],\n\t\tcwd,\n\t\ttimeoutMs: DISCOVER_TIMEOUT_MS,\n\t\tschema: DiscoverAnswer,\n\t});\n\n\t// Discovery's own warnings — a glob that matched nothing — are the\n\t// run's, as they would be had it discovered in-process: as written, one\n\t// message, less the newline the worker's `console.warn` ended it with.\n\tif (stderr.trim()) logger.warn(stderr.replace(/\\n$/, ''));\n\n\tswitch (value.reason) {\n\t\tcase 'discovered':\n\t\t\tif (options.runnables) {\n\t\t\t\tfor (const [owner, edges] of Object.entries(value.runnables)) {\n\t\t\t\t\toptions.runnables[owner] = edges;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (options.background) {\n\t\t\t\tfor (const [owner, files] of Object.entries(value.background ?? {})) {\n\t\t\t\t\toptions.background[owner] = files;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (options.subscribers) {\n\t\t\t\tfor (const [owner, bound] of Object.entries(value.subscribers ?? {})) {\n\t\t\t\t\toptions.subscribers[owner] = bound;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn value.manifest as unknown as ConstructManifest;\n\t\tcase 'failed':\n\t\t\tif (value.error.name === 'DuplicateConstruct' && value.error.id) {\n\t\t\t\tthrow new DuplicateConstruct(value.error.id, value.error.sources ?? []);\n\t\t\t}\n\t\t\tthrow new ConstructDiscoveryFailed(value.error.name, value.error.message);\n\t\tcase 'live':\n\t\t\tif (sandbox.isolating) throw new ConstructsNotSerializable(value.paths);\n\t\t\treturn undefined;\n\t}\n}\n\n/**\n * A caller asked for the construct objects (`sources`) or a watcher's\n * re-import under an isolating sandbox, where only data comes back.\n */\nexport class LiveConstructsUnavailable extends Error {\n\tconstructor() {\n\t\tsuper(\n\t\t\t'Discovery was asked for the construct objects themselves under an ' +\n\t\t\t\t'isolating sandbox, which hands back only data. Run this step ' +\n\t\t\t\t'without one, or ask only for the manifest.',\n\t\t);\n\t\tthis.name = 'LiveConstructsUnavailable';\n\t}\n}\n\n/** How long discovering a project's constructs may take in a sandbox. */\nconst DISCOVER_TIMEOUT_MS = 60_000;\n\n/** Importing a construct module, or declaring one, threw in the sandbox. */\nexport class ConstructDiscoveryFailed extends Error {\n\tconstructor(\n\t\treadonly errorName: string,\n\t\treadonly detail: string,\n\t) {\n\t\tsuper(`Discovering constructs failed (${errorName}): ${detail}`);\n\t\tthis.name = 'ConstructDiscoveryFailed';\n\t}\n}\n\n/**\n * The constructs' declarations hold something that is not data, and the\n * sandbox they were discovered in hands the deploy nothing but data.\n */\nexport class ConstructsNotSerializable extends Error {\n\tconstructor(readonly paths: readonly string[]) {\n\t\tsuper(\n\t\t\t`The construct manifest holds values that are not plain data at: ` +\n\t\t\t\t`${paths.join(', ')}. Under an isolating sandbox the deploy only ` +\n\t\t\t\t'receives what JSON can carry; deploy with a sandbox that is not ' +\n\t\t\t\t'isolating if the host trusts this project.',\n\t\t);\n\t\tthis.name = 'ConstructsNotSerializable';\n\t}\n}\n\n/** Where a construct was declared, and under what name. */\nexport interface ConstructSource {\n\t/** Absolute path to the module that exported it. */\n\tfile: string;\n\t/** The name it was exported as — what an import statement has to say. */\n\texportName: string;\n\t/**\n\t * The exported construct itself.\n\t *\n\t * What a declaration cannot say — whether it serves itself — the object can\n\t * be asked, and discovery already imported it.\n\t */\n\tconstruct: unknown;\n}\n\n/**\n * Build the construct manifest for a project.\n *\n * Runs the manifest's own validation before returning, so an app is wrong here\n * — where the error names a file — rather than at deploy.\n *\n * @throws {DuplicateConstruct} when two exports claim one id.\n */\nexport async function discover(\n\toptions: DiscoverOptions,\n): Promise<ConstructManifest> {\n\tconst sandbox = options.sandbox ?? activeSandbox();\n\tif (sandbox) {\n\t\tif (!options.sources && !options.bustCache) {\n\t\t\tconst sandboxed = await discoverInSandbox(sandbox, options);\n\t\t\tif (sandboxed) return sandboxed;\n\t\t} else if (sandbox.isolating) {\n\t\t\t// The construct objects themselves, or a re-import for the watcher:\n\t\t\t// neither can cross a sandbox that hands back only data.\n\t\t\tthrow new LiveConstructsUnavailable();\n\t\t}\n\t}\n\n\tconst {\n\t\tpatterns,\n\t\tcwd = process.cwd(),\n\t\tbustCache = false,\n\t\tsources: out,\n\t} = options;\n\n\t// Re-importing user modules re-executes them, and Zod v4 throws on a\n\t// re-registered `.meta({ id })`. Same reason the generators clear it.\n\tif (bustCache) clearZodGlobalRegistry();\n\n\tconst manifest: Record<string, Declaration> = {};\n\t/** Which file declared each id, for the error when two of them do. */\n\tconst sources: Record<string, string> = {};\n\t/**\n\t * Constructs already seen, by identity.\n\t *\n\t * A re-export is the *same object* reached through a second file — ESM\n\t * bindings are live, so `export * from './database.js'` hands back the\n\t * binding rather than a copy. Without this, a barrel file made every\n\t * construct in it appear declared twice, and `constructs/index.ts` is the\n\t * first thing anyone writes in a shared folder.\n\t *\n\t * Identity rather than file is also the more honest rule: what may not\n\t * happen twice is two *different* constructs claiming one id, and that is\n\t * still an error below.\n\t */\n\tconst seen = new WeakSet<object>();\n\n\tconst globs = Array.isArray(patterns) ? [...patterns] : [patterns as string];\n\tconst files = fg.stream(globs, { cwd, absolute: true });\n\n\t/** Matched files, for the diagnostic below. */\n\tlet matched = 0;\n\n\tfor await (const found of files) {\n\t\tmatched++;\n\t\tconst file = found.toString();\n\t\tconst module = await import(bustCache ? `${file}?t=${Date.now()}` : file);\n\n\t\tfor (const [exportName, exported] of Object.entries(module)) {\n\t\t\tif (options.background)\n\t\t\t\trecordBackground(options.background, exported, file);\n\t\t\tif (options.subscribers)\n\t\t\t\trecordSubscriber(options.subscribers, exported, exportName);\n\t\t\tif (!isDeclarable(exported)) {\n\t\t\t\tif (options.runnables) recordRunnable(options.runnables, exported);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// The same construct, reached again through a re-export. Skipped\n\t\t\t// rather than re-declared: it has already claimed its id, from the\n\t\t\t// file that defined it.\n\t\t\tif (seen.has(exported as object)) continue;\n\t\t\tseen.add(exported as object);\n\n\t\t\t// A construct that is also something a process runs — a queue and its\n\t\t\t// consumer, built from a worker — reaches what it depends on through\n\t\t\t// that process, exactly as an endpoint or a cron does.\n\t\t\tif (\n\t\t\t\toptions.runnables &&\n\t\t\t\ttypeof (exported as { owner?: unknown }).owner === 'string'\n\t\t\t) {\n\t\t\t\trecordRunnable(options.runnables, exported);\n\t\t\t}\n\n\t\t\tfor (const declaration of exported.declare()) {\n\t\t\t\t// Canonicalise here too: a construct built by hand rather than through\n\t\t\t\t// a constructor is still subject to the same identity rule.\n\t\t\t\tconst id = canonicalId(declaration.id);\n\t\t\t\tconst source = relative(cwd, file);\n\n\t\t\t\tconst claimed = sources[id];\n\t\t\t\tif (claimed !== undefined && claimed !== source) {\n\t\t\t\t\tthrow new DuplicateConstruct(id, [claimed, source]);\n\t\t\t\t}\n\n\t\t\t\tmanifest[id] = { ...declaration, id };\n\t\t\t\tsources[id] = source;\n\t\t\t\tif (out) out[id] = { file, exportName, construct: exported };\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reference integrity before anyone reads it — a schema tenant naming a\n\t// database that was deleted is a manifest error, not a reconcile failure.\n\tassertDerivations(manifest);\n\n\twarnIfNothingFound(globs, matched, Object.keys(manifest).length);\n\n\treturn manifest;\n}\n\n/**\n * Record where a worker's background work is declared: a cron, a queue\n * consumer or a topic subscriber, under the worker that owns it.\n */\nfunction recordBackground(\n\tbackground: Record<string, string[]>,\n\texported: unknown,\n\tfile: string,\n): void {\n\tif (\n\t\t!Cron.isCron(exported) &&\n\t\t!Queue.isQueue(exported) &&\n\t\t!Subscriber.isSubscriber(exported)\n\t) {\n\t\treturn;\n\t}\n\tconst owner = (exported as { owner?: unknown }).owner;\n\tif (typeof owner !== 'string') return;\n\n\tconst key = canonicalId(owner);\n\tconst files = background[key] ?? [];\n\tbackground[key] = files;\n\tif (!files.includes(file)) files.push(file);\n}\n\n/**\n * Record a subscriber — to a topic or to a bucket — under the worker that\n * runs it, by its export. Once per name: a file reached twice through a\n * re-export finds it again.\n */\nfunction recordSubscriber(\n\tsubscribers: Record<string, BoundSubscriber[]>,\n\texported: unknown,\n\texportName: string,\n): void {\n\tif (!Subscriber.isSubscriber(exported)) return;\n\tconst owner = (exported as { owner?: unknown }).owner;\n\tconst connectionKey = subscriberConnectionKey(exported);\n\tif (typeof owner !== 'string' || !connectionKey) return;\n\n\tconst key = canonicalId(owner);\n\tconst bound = subscribers[key] ?? [];\n\tsubscribers[key] = bound;\n\tif (\n\t\t!bound.some(\n\t\t\t(s) => s.connectionKey === connectionKey && s.name === exportName,\n\t\t)\n\t) {\n\t\tconst events = exported.topicName ? exported.subscribedEvents : undefined;\n\t\tbound.push({\n\t\t\tname: exportName,\n\t\t\tconnectionKey,\n\t\t\t...(events ? { events: [...events] } : {}),\n\t\t});\n\t}\n}\n\n/**\n * What a runnable consumes, by id: a queue's consumer drains that queue, a\n * subscriber its topic. Nothing for anything else.\n */\nexport function consumedBy(runnable: unknown): string[] {\n\tif (Queue.isQueue(runnable)) return [runnable.id];\n\tif (Subscriber.isSubscriber(runnable) && runnable.topicName) {\n\t\treturn [canonicalId(runnable.topicName)];\n\t}\n\tif (Subscriber.isSubscriber(runnable) && runnable.bucketName) {\n\t\treturn [canonicalId(runnable.bucketName)];\n\t}\n\treturn [];\n}\n\n/**\n * The edges a runnable's process records for what it consumes. A bucket's\n * subscriber consumes the bucket's *events*, not the bucket: binding to its\n * changes is not reading its objects, so its process is handed the events\n * key and not the bucket's URL — that still takes `.dependsOn([bucket])`.\n */\nfunction consumedEdges(runnable: unknown): string[] {\n\tif (Subscriber.isSubscriber(runnable) && runnable.bucketName) {\n\t\treturn [eventsEdge(canonicalId(runnable.bucketName))];\n\t}\n\treturn consumedBy(runnable);\n}\n\n/**\n * Record a runnable's edges under the construct that owns it — the surface an\n * endpoint was built from, or the worker a cron or subscriber was. Anything\n * with no owner, or that is not a runnable at all, is left alone.\n */\nfunction recordRunnable(\n\trunnables: Record<string, string[]>,\n\texported: unknown,\n): void {\n\tif (typeof exported !== 'object' || exported === null) return;\n\n\tconst runnable = exported as {\n\t\tsurface?: { id?: unknown };\n\t\towner?: unknown;\n\t\tconstructs?: unknown;\n\t};\n\tconst owner =\n\t\ttypeof runnable.surface?.id === 'string'\n\t\t\t? runnable.surface.id\n\t\t\t: typeof runnable.owner === 'string'\n\t\t\t\t? runnable.owner\n\t\t\t\t: undefined;\n\tif (!owner || !Array.isArray(runnable.constructs)) return;\n\n\tconst key = canonicalId(owner);\n\tconst edges = runnables[key] ?? [];\n\trunnables[key] = edges;\n\t// What it consumes is an edge of its process too, so a worker is handed\n\t// the carriers its own work is bound to and no other.\n\tfor (const id of runnable.constructs) {\n\t\tif (typeof id !== 'string') continue;\n\t\tconst target = canonicalId(id);\n\t\tif (!edges.includes(target)) edges.push(target);\n\t}\n\tfor (const edge of consumedEdges(exported)) {\n\t\tif (!edges.includes(edge)) edges.push(edge);\n\t}\n}\n\n/**\n * Say so when a glob was configured and found nothing.\n *\n * The glob is not a filter over declarations already known — it is *how they\n * are found*, by importing what it matches. So a file it misses is a\n * declaration that does not exist, and every symptom of that appears somewhere\n * other than the cause: no container starts, no env key is written, and the\n * application fails on first use against a resource it can see in its own\n * source.\n *\n * Nothing reported it before, because an unmatched file is indistinguishable\n * from a file nobody wrote. These two cases are the ones that are *not*\n * ambiguous — a glob was configured, so something was expected.\n *\n * Silent when no glob is configured at all: that is a project which has not\n * adopted constructs, and has nothing to be missing.\n */\nfunction warnIfNothingFound(\n\tglobs: readonly string[],\n\tmatched: number,\n\tdeclared: number,\n): void {\n\tif (globs.length === 0) return;\n\n\tif (matched === 0) {\n\t\tlogger.warn(\n\t\t\t`\\n⚠️ The constructs glob matched no files, so nothing was declared.\\n` +\n\t\t\t\t` Patterns: ${globs.join(', ')}\\n` +\n\t\t\t\t` Nothing will be provisioned — no containers, no env keys, no ` +\n\t\t\t\t`resources.\\n` +\n\t\t\t\t` A common cause is depth: '*.ts' matches one level, '**/*.ts' ` +\n\t\t\t\t`matches any.`,\n\t\t);\n\t\treturn;\n\t}\n\n\tif (declared === 0) {\n\t\tlogger.warn(\n\t\t\t`\\n⚠️ The constructs glob matched ${matched} file(s) but none declared ` +\n\t\t\t\t`anything.\\n` +\n\t\t\t\t` Patterns: ${globs.join(', ')}\\n` +\n\t\t\t\t` Discovery keeps exports with an 'id' that can 'declare()'. A ` +\n\t\t\t\t`construct that is\\n` +\n\t\t\t\t` built but never exported is invisible to it.`,\n\t\t);\n\t}\n}\n\n/** Two constructs claiming one id. */\nexport class DuplicateConstruct extends GkmError {\n\t/** The id claimed twice. */\n\treadonly id: string;\n\t/** The files that claimed it. */\n\treadonly sources: readonly string[];\n\n\tconstructor(id: string, sources: readonly string[]) {\n\t\tsuper('Two constructs declare the same id');\n\t\tthis.name = 'DuplicateConstruct';\n\t\tthis.id = id;\n\t\tthis.sources = sources;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,gBAAgB;;;;;;AAOtB,SAAgB,WAAW,UAA0B;CACpD,OAAO,GAAG,WAAW;AACtB;;AAGA,SAAgB,iBAAiB,MAAkC;CAClE,OAAO,KAAK,SAAS,aAAa,IAC/B,KAAK,MAAM,GAAG,EAAqB,IACnC,KAAA;AACJ;;;;;AAMA,SAAgB,wBAAwB,WAGjB;CACtB,IAAI,UAAU,YACb,QAAA,GAAOA,oBAAAA,WAAAA,EAAAA,GACNC,oBAAAA,YAAAA,CAAY,UAAU,UAAU,GAChC,wBACD;CAED,IAAI,UAAU,WACb,QAAA,GAAOD,oBAAAA,WAAAA,EAAAA,GACNC,oBAA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,qIAInC;AAEF;;AAGA,IAAa,qBAAb,cAAwCK,eAAAA,SAAS;;CAEhD;;CAEA;CAEA,YAAY,IAAY,SAA4B;EACnD,MAAM,oCAAoC;EAC1C,KAAK,OAAO;EACZ,KAAK,KAAK;EACV,KAAK,UAAU;CAChB;AACD"}
@@ -1,5 +1,5 @@
1
1
  const require_define = require("./define-crmMcXFS.cjs");
2
- const require_engine = require("./engine-D7YNY3v7.cjs");
2
+ const require_engine = require("./engine-esxTxcIx.cjs");
3
3
  //#region src/target/dokploy/index.ts
4
4
  /**
5
5
  * The built-in `dokploy` target: the Dokploy engine `gkm deploy` has always
@@ -35,4 +35,4 @@ const dokployTarget = require_define.defineTarget({
35
35
  //#endregion
36
36
  exports.dokployTarget = dokployTarget;
37
37
 
38
- //# sourceMappingURL=dokploy-CiozgdKO.cjs.map
38
+ //# sourceMappingURL=dokploy-C0aQrCgs.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dokploy-CiozgdKO.cjs","names":["defineTarget","validateDokploy","planDokploy","provisionDokploy","releaseDokploy","verifyDokploy","rollbackDokploy","dokployResult"],"sources":["../src/target/dokploy/index.ts"],"sourcesContent":["/**\n * The built-in `dokploy` target: the Dokploy engine `gkm deploy` has always\n * run, behind the phases.\n *\n * - `provision`: the project, environment and registry, and what the\n * manifest declares — its databases' roles applied over a port published\n * for the purpose.\n * - `release`: the stage's migrations, then each image built and pushed\n * beside its application and deployed, waited on until Dokploy has\n * finished; backends first and checked before any site is released.\n * - `verify`: each site answering its health check.\n * - `rollback`: what failed — or, `--atomic`, everything the run released —\n * pointed back at the image it ran before.\n */\n\nimport { defineTarget } from '../define';\nimport {\n\ttype DokployRun,\n\tdokployResult,\n\tplanDokploy,\n\tprovisionDokploy,\n\treleaseDokploy,\n\trollbackDokploy,\n\tvalidateDokploy,\n\tverifyDokploy,\n} from './engine';\n\nexport const dokployTarget = defineTarget<undefined, DokployRun>({\n\tname: 'dokploy',\n\truntime: 'server',\n\tcapabilities: { rollback: true, migrations: 'target', images: true },\n\tcredentials: ['dokploy', 'registry'],\n\tvalidate: (ctx) => validateDokploy(ctx),\n\tplan: (_ctx, run) => planDokploy(run),\n\tprovision: (_ctx, run) => provisionDokploy(run),\n\trelease: (_ctx, run) => releaseDokploy(run),\n\tverify: (_ctx, run) => verifyDokploy(run),\n\trollback: (_ctx, run, failure) => rollbackDokploy(run, failure),\n\tresult: (_ctx, run) => dokployResult(run),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,MAAa,gBAAgBA,eAAAA,aAAoC;CAChE,MAAM;CACN,SAAS;CACT,cAAc;EAAE,UAAU;EAAM,YAAY;EAAU,QAAQ;CAAK;CACnE,aAAa,CAAC,WAAW,UAAU;CACnC,WAAW,QAAQC,eAAAA,gBAAgB,GAAG;CACtC,OAAO,MAAM,QAAQC,eAAAA,YAAY,GAAG;CACpC,YAAY,MAAM,QAAQC,eAAAA,iBAAiB,GAAG;CAC9C,UAAU,MAAM,QAAQC,eAAAA,eAAe,GAAG;CAC1C,SAAS,MAAM,QAAQC,eAAAA,cAAc,GAAG;CACxC,WAAW,MAAM,KAAK,YAAYC,eAAAA,gBAAgB,KAAK,OAAO;CAC9D,SAAS,MAAM,QAAQC,eAAAA,cAAc,GAAG;AACzC,CAAC"}
1
+ {"version":3,"file":"dokploy-C0aQrCgs.cjs","names":["defineTarget","validateDokploy","planDokploy","provisionDokploy","releaseDokploy","verifyDokploy","rollbackDokploy","dokployResult"],"sources":["../src/target/dokploy/index.ts"],"sourcesContent":["/**\n * The built-in `dokploy` target: the Dokploy engine `gkm deploy` has always\n * run, behind the phases.\n *\n * - `provision`: the project, environment and registry, and what the\n * manifest declares — its databases' roles applied over a port published\n * for the purpose.\n * - `release`: the stage's migrations, then each image built and pushed\n * beside its application and deployed, waited on until Dokploy has\n * finished; backends first and checked before any site is released.\n * - `verify`: each site answering its health check.\n * - `rollback`: what failed — or, `--atomic`, everything the run released —\n * pointed back at the image it ran before.\n */\n\nimport { defineTarget } from '../define';\nimport {\n\ttype DokployRun,\n\tdokployResult,\n\tplanDokploy,\n\tprovisionDokploy,\n\treleaseDokploy,\n\trollbackDokploy,\n\tvalidateDokploy,\n\tverifyDokploy,\n} from './engine';\n\nexport const dokployTarget = defineTarget<undefined, DokployRun>({\n\tname: 'dokploy',\n\truntime: 'server',\n\tcapabilities: { rollback: true, migrations: 'target', images: true },\n\tcredentials: ['dokploy', 'registry'],\n\tvalidate: (ctx) => validateDokploy(ctx),\n\tplan: (_ctx, run) => planDokploy(run),\n\tprovision: (_ctx, run) => provisionDokploy(run),\n\trelease: (_ctx, run) => releaseDokploy(run),\n\tverify: (_ctx, run) => verifyDokploy(run),\n\trollback: (_ctx, run, failure) => rollbackDokploy(run, failure),\n\tresult: (_ctx, run) => dokployResult(run),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,MAAa,gBAAgBA,eAAAA,aAAoC;CAChE,MAAM;CACN,SAAS;CACT,cAAc;EAAE,UAAU;EAAM,YAAY;EAAU,QAAQ;CAAK;CACnE,aAAa,CAAC,WAAW,UAAU;CACnC,WAAW,QAAQC,eAAAA,gBAAgB,GAAG;CACtC,OAAO,MAAM,QAAQC,eAAAA,YAAY,GAAG;CACpC,YAAY,MAAM,QAAQC,eAAAA,iBAAiB,GAAG;CAC9C,UAAU,MAAM,QAAQC,eAAAA,eAAe,GAAG;CAC1C,SAAS,MAAM,QAAQC,eAAAA,cAAc,GAAG;CACxC,WAAW,MAAM,KAAK,YAAYC,eAAAA,gBAAgB,KAAK,OAAO;CAC9D,SAAS,MAAM,QAAQC,eAAAA,cAAc,GAAG;AACzC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { t as defineTarget } from "./define-6poNqm5O.mjs";
2
- import { a as dokployResult, c as releaseDokploy, d as validateDokploy, f as verifyDokploy, o as planDokploy, s as provisionDokploy, u as rollbackDokploy } from "./engine-HVqo3mQu.mjs";
2
+ import { a as dokployResult, c as releaseDokploy, d as validateDokploy, f as verifyDokploy, o as planDokploy, s as provisionDokploy, u as rollbackDokploy } from "./engine-BuinpJfS.mjs";
3
3
  //#region src/target/dokploy/index.ts
4
4
  /**
5
5
  * The built-in `dokploy` target: the Dokploy engine `gkm deploy` has always
@@ -35,4 +35,4 @@ const dokployTarget = defineTarget({
35
35
  //#endregion
36
36
  export { dokployTarget };
37
37
 
38
- //# sourceMappingURL=dokploy-Boj1NSHV.mjs.map
38
+ //# sourceMappingURL=dokploy-MM7c3IE0.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dokploy-Boj1NSHV.mjs","names":[],"sources":["../src/target/dokploy/index.ts"],"sourcesContent":["/**\n * The built-in `dokploy` target: the Dokploy engine `gkm deploy` has always\n * run, behind the phases.\n *\n * - `provision`: the project, environment and registry, and what the\n * manifest declares — its databases' roles applied over a port published\n * for the purpose.\n * - `release`: the stage's migrations, then each image built and pushed\n * beside its application and deployed, waited on until Dokploy has\n * finished; backends first and checked before any site is released.\n * - `verify`: each site answering its health check.\n * - `rollback`: what failed — or, `--atomic`, everything the run released —\n * pointed back at the image it ran before.\n */\n\nimport { defineTarget } from '../define';\nimport {\n\ttype DokployRun,\n\tdokployResult,\n\tplanDokploy,\n\tprovisionDokploy,\n\treleaseDokploy,\n\trollbackDokploy,\n\tvalidateDokploy,\n\tverifyDokploy,\n} from './engine';\n\nexport const dokployTarget = defineTarget<undefined, DokployRun>({\n\tname: 'dokploy',\n\truntime: 'server',\n\tcapabilities: { rollback: true, migrations: 'target', images: true },\n\tcredentials: ['dokploy', 'registry'],\n\tvalidate: (ctx) => validateDokploy(ctx),\n\tplan: (_ctx, run) => planDokploy(run),\n\tprovision: (_ctx, run) => provisionDokploy(run),\n\trelease: (_ctx, run) => releaseDokploy(run),\n\tverify: (_ctx, run) => verifyDokploy(run),\n\trollback: (_ctx, run, failure) => rollbackDokploy(run, failure),\n\tresult: (_ctx, run) => dokployResult(run),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,MAAa,gBAAgB,aAAoC;CAChE,MAAM;CACN,SAAS;CACT,cAAc;EAAE,UAAU;EAAM,YAAY;EAAU,QAAQ;CAAK;CACnE,aAAa,CAAC,WAAW,UAAU;CACnC,WAAW,QAAQ,gBAAgB,GAAG;CACtC,OAAO,MAAM,QAAQ,YAAY,GAAG;CACpC,YAAY,MAAM,QAAQ,iBAAiB,GAAG;CAC9C,UAAU,MAAM,QAAQ,eAAe,GAAG;CAC1C,SAAS,MAAM,QAAQ,cAAc,GAAG;CACxC,WAAW,MAAM,KAAK,YAAY,gBAAgB,KAAK,OAAO;CAC9D,SAAS,MAAM,QAAQ,cAAc,GAAG;AACzC,CAAC"}
1
+ {"version":3,"file":"dokploy-MM7c3IE0.mjs","names":[],"sources":["../src/target/dokploy/index.ts"],"sourcesContent":["/**\n * The built-in `dokploy` target: the Dokploy engine `gkm deploy` has always\n * run, behind the phases.\n *\n * - `provision`: the project, environment and registry, and what the\n * manifest declares — its databases' roles applied over a port published\n * for the purpose.\n * - `release`: the stage's migrations, then each image built and pushed\n * beside its application and deployed, waited on until Dokploy has\n * finished; backends first and checked before any site is released.\n * - `verify`: each site answering its health check.\n * - `rollback`: what failed — or, `--atomic`, everything the run released —\n * pointed back at the image it ran before.\n */\n\nimport { defineTarget } from '../define';\nimport {\n\ttype DokployRun,\n\tdokployResult,\n\tplanDokploy,\n\tprovisionDokploy,\n\treleaseDokploy,\n\trollbackDokploy,\n\tvalidateDokploy,\n\tverifyDokploy,\n} from './engine';\n\nexport const dokployTarget = defineTarget<undefined, DokployRun>({\n\tname: 'dokploy',\n\truntime: 'server',\n\tcapabilities: { rollback: true, migrations: 'target', images: true },\n\tcredentials: ['dokploy', 'registry'],\n\tvalidate: (ctx) => validateDokploy(ctx),\n\tplan: (_ctx, run) => planDokploy(run),\n\tprovision: (_ctx, run) => provisionDokploy(run),\n\trelease: (_ctx, run) => releaseDokploy(run),\n\tverify: (_ctx, run) => verifyDokploy(run),\n\trollback: (_ctx, run, failure) => rollbackDokploy(run, failure),\n\tresult: (_ctx, run) => dokployResult(run),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,MAAa,gBAAgB,aAAoC;CAChE,MAAM;CACN,SAAS;CACT,cAAc;EAAE,UAAU;EAAM,YAAY;EAAU,QAAQ;CAAK;CACnE,aAAa,CAAC,WAAW,UAAU;CACnC,WAAW,QAAQ,gBAAgB,GAAG;CACtC,OAAO,MAAM,QAAQ,YAAY,GAAG;CACpC,YAAY,MAAM,QAAQ,iBAAiB,GAAG;CAC9C,UAAU,MAAM,QAAQ,eAAe,GAAG;CAC1C,SAAS,MAAM,QAAQ,cAAc,GAAG;CACxC,WAAW,MAAM,KAAK,YAAY,gBAAgB,KAAK,OAAO;CAC9D,SAAS,MAAM,QAAQ,cAAc,GAAG;AACzC,CAAC"}
@@ -1,4 +1,4 @@
1
- const require_SubscriberGenerator = require("./SubscriberGenerator-C8CPxrCK.cjs");
1
+ const require_SubscriberGenerator = require("./SubscriberGenerator-C3QTae-R.cjs");
2
2
  let node_path = require("node:path");
3
3
  let node_fs = require("node:fs");
4
4
  //#region src/generators/drivers.ts
@@ -221,4 +221,4 @@ Object.defineProperty(exports, "opensKmsKeys", {
221
221
  }
222
222
  });
223
223
 
224
- //# sourceMappingURL=drivers-DbjiYpW6.cjs.map
224
+ //# sourceMappingURL=drivers-CQ32PB5w.cjs.map