@geekmidas/cli 10.0.0-alpha.13 → 10.0.0-alpha.131

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 (430) hide show
  1. package/README.md +313 -380
  2. package/bin/adjacent-tsconfig.mjs +46 -8
  3. package/bin/gkm.mjs +11 -3
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-B99OGzbO.mjs +1035 -0
  7. package/dist/EndpointGenerator-B99OGzbO.mjs.map +1 -0
  8. package/dist/EndpointGenerator-De0lknKD.cjs +1094 -0
  9. package/dist/EndpointGenerator-De0lknKD.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-D10Le3VX.mjs +388 -0
  11. package/dist/GoDaddyProvider-D10Le3VX.mjs.map +1 -0
  12. package/dist/GoDaddyProvider-DTfa47i3.cjs +388 -0
  13. package/dist/GoDaddyProvider-DTfa47i3.cjs.map +1 -0
  14. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-Cjh_2Ml6.mjs} +11 -6
  15. package/dist/HostingerProvider-Cjh_2Ml6.mjs.map +1 -0
  16. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-OdQmKXE3.cjs} +11 -6
  17. package/dist/HostingerProvider-OdQmKXE3.cjs.map +1 -0
  18. package/dist/LegacyStateStore-C5c_zS4h.mjs +124 -0
  19. package/dist/LegacyStateStore-C5c_zS4h.mjs.map +1 -0
  20. package/dist/LegacyStateStore-CZSBR6ar.cjs +124 -0
  21. package/dist/LegacyStateStore-CZSBR6ar.cjs.map +1 -0
  22. package/dist/LocalStateStore-Ba0Y6q5C.mjs +167 -0
  23. package/dist/LocalStateStore-Ba0Y6q5C.mjs.map +1 -0
  24. package/dist/LocalStateStore-CgQtQix2.cjs +178 -0
  25. package/dist/LocalStateStore-CgQtQix2.cjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-DMLzN-LU.cjs +541 -0
  27. package/dist/OpenApiTsGenerator-DMLzN-LU.cjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-DNUCgkkx.mjs +536 -0
  29. package/dist/OpenApiTsGenerator-DNUCgkkx.mjs.map +1 -0
  30. package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-Bllus2NR.cjs} +2 -2
  31. package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
  32. package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-QXxjkZO1.mjs} +2 -2
  33. package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
  34. package/dist/S3StateStore-00mB2AG4.mjs +223 -0
  35. package/dist/S3StateStore-00mB2AG4.mjs.map +1 -0
  36. package/dist/S3StateStore-C6amZI39.cjs +222 -0
  37. package/dist/S3StateStore-C6amZI39.cjs.map +1 -0
  38. package/dist/SSMStateStore-CkYqOAzW.mjs +205 -0
  39. package/dist/SSMStateStore-CkYqOAzW.mjs.map +1 -0
  40. package/dist/SSMStateStore-Cnn5fHCg.cjs +204 -0
  41. package/dist/SSMStateStore-Cnn5fHCg.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-0ruEmYXj.mjs +646 -0
  43. package/dist/SubscriberGenerator-0ruEmYXj.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-CPjbWEOI.cjs +687 -0
  45. package/dist/SubscriberGenerator-CPjbWEOI.cjs.map +1 -0
  46. package/dist/add-CdMInvmN.cjs +719 -0
  47. package/dist/add-CdMInvmN.cjs.map +1 -0
  48. package/dist/add-DZSU5Tcc.mjs +717 -0
  49. package/dist/add-DZSU5Tcc.mjs.map +1 -0
  50. package/dist/appPorts-BoXMwolc.mjs +249 -0
  51. package/dist/appPorts-BoXMwolc.mjs.map +1 -0
  52. package/dist/appPorts-IW-OZmRi.cjs +296 -0
  53. package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
  54. package/dist/aws-8QQ8n-t6.mjs +89 -0
  55. package/dist/aws-8QQ8n-t6.mjs.map +1 -0
  56. package/dist/aws-DY9NqQIT.cjs +100 -0
  57. package/dist/aws-DY9NqQIT.cjs.map +1 -0
  58. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  59. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  60. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  61. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  62. package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  63. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  64. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  65. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  66. package/dist/backups/runner.cjs +519 -0
  67. package/dist/backups/runner.cjs.map +1 -0
  68. package/dist/backups/runner.d.cts +102 -0
  69. package/dist/backups/runner.d.cts.map +1 -0
  70. package/dist/backups/runner.d.mts +102 -0
  71. package/dist/backups/runner.d.mts.map +1 -0
  72. package/dist/backups/runner.mjs +506 -0
  73. package/dist/backups/runner.mjs.map +1 -0
  74. package/dist/{bundler-BodTL4kf.mjs → bundler-BzDMJbx8.mjs} +32 -11
  75. package/dist/bundler-BzDMJbx8.mjs.map +1 -0
  76. package/dist/{bundler-BeNDZdHQ.cjs → bundler-GKF4xpYI.cjs} +32 -11
  77. package/dist/bundler-GKF4xpYI.cjs.map +1 -0
  78. package/dist/cli-Ct6PQtc7.cjs +71 -0
  79. package/dist/cli-Ct6PQtc7.cjs.map +1 -0
  80. package/dist/cli-DXeLFtpA.mjs +71 -0
  81. package/dist/cli-DXeLFtpA.mjs.map +1 -0
  82. package/dist/compose-BfLDidYU.cjs +3977 -0
  83. package/dist/compose-BfLDidYU.cjs.map +1 -0
  84. package/dist/compose-CnanpQBB.mjs +3834 -0
  85. package/dist/compose-CnanpQBB.mjs.map +1 -0
  86. package/dist/config-DPsCfNpR.d.mts +268 -0
  87. package/dist/config-DPsCfNpR.d.mts.map +1 -0
  88. package/dist/config-azErNJSd.d.cts +268 -0
  89. package/dist/config-azErNJSd.d.cts.map +1 -0
  90. package/dist/config.cjs +420 -9
  91. package/dist/config.cjs.map +1 -0
  92. package/dist/config.d.cts +4 -117
  93. package/dist/config.d.mts +4 -117
  94. package/dist/config.mjs +406 -3
  95. package/dist/config.mjs.map +1 -0
  96. package/dist/credentialSchemas-CM0rxWmS.cjs +272 -0
  97. package/dist/credentialSchemas-CM0rxWmS.cjs.map +1 -0
  98. package/dist/credentialSchemas-DPOGqOrU.mjs +237 -0
  99. package/dist/credentialSchemas-DPOGqOrU.mjs.map +1 -0
  100. package/dist/credentials-D7XJypNd.cjs +520 -0
  101. package/dist/credentials-D7XJypNd.cjs.map +1 -0
  102. package/dist/credentials-DpfnUvIR.mjs +395 -0
  103. package/dist/credentials-DpfnUvIR.mjs.map +1 -0
  104. package/dist/databases-Db48ZIXL.mjs +588 -0
  105. package/dist/databases-Db48ZIXL.mjs.map +1 -0
  106. package/dist/databases-P824RTnx.cjs +703 -0
  107. package/dist/databases-P824RTnx.cjs.map +1 -0
  108. package/dist/define-6poNqm5O.mjs +106 -0
  109. package/dist/define-6poNqm5O.mjs.map +1 -0
  110. package/dist/define-crmMcXFS.cjs +153 -0
  111. package/dist/define-crmMcXFS.cjs.map +1 -0
  112. package/dist/deploy/public.cjs +211 -0
  113. package/dist/deploy/public.cjs.map +1 -0
  114. package/dist/deploy/public.d.cts +652 -0
  115. package/dist/deploy/public.d.cts.map +1 -0
  116. package/dist/deploy/public.d.mts +652 -0
  117. package/dist/deploy/public.d.mts.map +1 -0
  118. package/dist/deploy/public.mjs +144 -0
  119. package/dist/deploy/public.mjs.map +1 -0
  120. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  121. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  122. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  123. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  124. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  125. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  126. package/dist/deploy/sniffer-hooks.cjs +1 -1
  127. package/dist/deploy/sniffer-hooks.mjs +1 -1
  128. package/dist/deploy/sniffer-loader.cjs +2 -2
  129. package/dist/deploy/sniffer-loader.mjs +1 -1
  130. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  131. package/dist/deploy/sniffer-routes-worker.mjs +2 -2
  132. package/dist/deploy-B35L6CMr.mjs +3439 -0
  133. package/dist/deploy-B35L6CMr.mjs.map +1 -0
  134. package/dist/deploy-zFe_W4WS.cjs +3494 -0
  135. package/dist/deploy-zFe_W4WS.cjs.map +1 -0
  136. package/dist/derive-BtGidITm.cjs +161 -0
  137. package/dist/derive-BtGidITm.cjs.map +1 -0
  138. package/dist/derive-Dew0QoGe.mjs +150 -0
  139. package/dist/derive-Dew0QoGe.mjs.map +1 -0
  140. package/dist/discover-DEOspD9M.cjs +796 -0
  141. package/dist/discover-DEOspD9M.cjs.map +1 -0
  142. package/dist/discover-DOhYSKY_.mjs +693 -0
  143. package/dist/discover-DOhYSKY_.mjs.map +1 -0
  144. package/dist/dokploy-BGJxcEh0.cjs +38 -0
  145. package/dist/dokploy-BGJxcEh0.cjs.map +1 -0
  146. package/dist/dokploy-sDTohVj5.mjs +38 -0
  147. package/dist/dokploy-sDTohVj5.mjs.map +1 -0
  148. package/dist/drivers-C47nm-wB.cjs +311 -0
  149. package/dist/drivers-C47nm-wB.cjs.map +1 -0
  150. package/dist/drivers-CDjpjakg.mjs +252 -0
  151. package/dist/drivers-CDjpjakg.mjs.map +1 -0
  152. package/dist/eas-Bxb9pymo.mjs +334 -0
  153. package/dist/eas-Bxb9pymo.mjs.map +1 -0
  154. package/dist/eas-DogHTOxl.cjs +337 -0
  155. package/dist/eas-DogHTOxl.cjs.map +1 -0
  156. package/dist/{emit-BdoPFjZf.cjs → emit-CYloptRS.cjs} +44 -54
  157. package/dist/emit-CYloptRS.cjs.map +1 -0
  158. package/dist/{emit-Bzq7JsMP.mjs → emit-CiJGdy_f.mjs} +45 -43
  159. package/dist/emit-CiJGdy_f.mjs.map +1 -0
  160. package/dist/encryption-BZk_sxC-.mjs +89 -0
  161. package/dist/encryption-BZk_sxC-.mjs.map +1 -0
  162. package/dist/encryption-DRXgL9Lh.cjs +90 -0
  163. package/dist/encryption-DRXgL9Lh.cjs.map +1 -0
  164. package/dist/engine-BuPhWFVm.cjs +3328 -0
  165. package/dist/engine-BuPhWFVm.cjs.map +1 -0
  166. package/dist/engine-uQmNnvNQ.mjs +3215 -0
  167. package/dist/engine-uQmNnvNQ.mjs.map +1 -0
  168. package/dist/errors-D8Gwp5kU.mjs +23 -0
  169. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  170. package/dist/errors-DMC4Umsb.cjs +34 -0
  171. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  172. package/dist/github-BCRbDSQa.cjs +901 -0
  173. package/dist/github-BCRbDSQa.cjs.map +1 -0
  174. package/dist/github-YknZQnYF.mjs +900 -0
  175. package/dist/github-YknZQnYF.mjs.map +1 -0
  176. package/dist/googlePlay-B_2dIDSO.mjs +931 -0
  177. package/dist/googlePlay-B_2dIDSO.mjs.map +1 -0
  178. package/dist/googlePlay-Cm2uipeZ.cjs +931 -0
  179. package/dist/googlePlay-Cm2uipeZ.cjs.map +1 -0
  180. package/dist/identity-CBXr4wNi.mjs +129 -0
  181. package/dist/identity-CBXr4wNi.mjs.map +1 -0
  182. package/dist/identity-CbLfgQNT.cjs +182 -0
  183. package/dist/identity-CbLfgQNT.cjs.map +1 -0
  184. package/dist/{index-D-iAVHx-.d.cts → index-D-gNc445.d.cts} +39 -15
  185. package/dist/index-D-gNc445.d.cts.map +1 -0
  186. package/dist/{index-Cd-qeOam.d.mts → index-Ur-ZIDYC.d.mts} +39 -15
  187. package/dist/index-Ur-ZIDYC.d.mts.map +1 -0
  188. package/dist/index.cjs +13468 -12280
  189. package/dist/index.cjs.map +1 -1
  190. package/dist/index.mjs +13491 -12301
  191. package/dist/index.mjs.map +1 -1
  192. package/dist/local-B7Zv1NoA.mjs +224 -0
  193. package/dist/local-B7Zv1NoA.mjs.map +1 -0
  194. package/dist/local-OPC9BCZt.cjs +241 -0
  195. package/dist/local-OPC9BCZt.cjs.map +1 -0
  196. package/dist/migrate-BB9fibbQ.cjs +272 -0
  197. package/dist/migrate-BB9fibbQ.cjs.map +1 -0
  198. package/dist/migrate-BIl4kLb1.cjs +181 -0
  199. package/dist/migrate-BIl4kLb1.cjs.map +1 -0
  200. package/dist/migrate-BKAh880g.mjs +267 -0
  201. package/dist/migrate-BKAh880g.mjs.map +1 -0
  202. package/dist/migrate-zqsyod5I.mjs +181 -0
  203. package/dist/migrate-zqsyod5I.mjs.map +1 -0
  204. package/dist/openapi.cjs +214 -7
  205. package/dist/openapi.cjs.map +1 -0
  206. package/dist/openapi.d.cts +32 -8
  207. package/dist/openapi.d.cts.map +1 -1
  208. package/dist/openapi.d.mts +32 -8
  209. package/dist/openapi.d.mts.map +1 -1
  210. package/dist/openapi.mjs +209 -2
  211. package/dist/openapi.mjs.map +1 -0
  212. package/dist/projectBucket-BBbQ1lHF.cjs +263 -0
  213. package/dist/projectBucket-BBbQ1lHF.cjs.map +1 -0
  214. package/dist/projectBucket-C_DN4WzF.mjs +222 -0
  215. package/dist/projectBucket-C_DN4WzF.mjs.map +1 -0
  216. package/dist/provider-BqpjG9QM.cjs +57 -0
  217. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  218. package/dist/provider-CEOKk8NS.mjs +46 -0
  219. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  220. package/dist/publish-BUnnuLl_.cjs +124 -0
  221. package/dist/publish-BUnnuLl_.cjs.map +1 -0
  222. package/dist/publish-BtmLOhV9.mjs +123 -0
  223. package/dist/publish-BtmLOhV9.mjs.map +1 -0
  224. package/dist/ready-BwtLriAF.mjs +375 -0
  225. package/dist/ready-BwtLriAF.mjs.map +1 -0
  226. package/dist/ready-Cj4pI0dw.cjs +404 -0
  227. package/dist/ready-Cj4pI0dw.cjs.map +1 -0
  228. package/dist/reconcile/public.cjs +2 -4
  229. package/dist/reconcile/public.d.cts +8 -67
  230. package/dist/reconcile/public.d.cts.map +1 -1
  231. package/dist/reconcile/public.d.mts +8 -67
  232. package/dist/reconcile/public.d.mts.map +1 -1
  233. package/dist/reconcile/public.mjs +3 -3
  234. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  235. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  236. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  237. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  238. package/dist/resolve-B1zK9f8_.mjs +263 -0
  239. package/dist/resolve-B1zK9f8_.mjs.map +1 -0
  240. package/dist/resolve-BVVSf27Y.cjs +316 -0
  241. package/dist/resolve-BVVSf27Y.cjs.map +1 -0
  242. package/dist/rollback-CAPWtOm3.mjs +136 -0
  243. package/dist/rollback-CAPWtOm3.mjs.map +1 -0
  244. package/dist/rollback-hV8Kbbg_.cjs +165 -0
  245. package/dist/rollback-hV8Kbbg_.cjs.map +1 -0
  246. package/dist/runtime-C0okGPpK.d.cts +82 -0
  247. package/dist/runtime-C0okGPpK.d.cts.map +1 -0
  248. package/dist/runtime-DfwIeO8f.d.mts +82 -0
  249. package/dist/runtime-DfwIeO8f.d.mts.map +1 -0
  250. package/dist/s3-CkERdmxm.mjs +215 -0
  251. package/dist/s3-CkERdmxm.mjs.map +1 -0
  252. package/dist/s3-xJtWm6WN.cjs +215 -0
  253. package/dist/s3-xJtWm6WN.cjs.map +1 -0
  254. package/dist/sandbox/config-worker.cjs +43 -0
  255. package/dist/sandbox/config-worker.cjs.map +1 -0
  256. package/dist/sandbox/config-worker.d.cts +1 -0
  257. package/dist/sandbox/config-worker.d.mts +1 -0
  258. package/dist/sandbox/config-worker.mjs +44 -0
  259. package/dist/sandbox/config-worker.mjs.map +1 -0
  260. package/dist/sandbox/credentials-worker.cjs +54 -0
  261. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  262. package/dist/sandbox/credentials-worker.d.cts +1 -0
  263. package/dist/sandbox/credentials-worker.d.mts +1 -0
  264. package/dist/sandbox/credentials-worker.mjs +55 -0
  265. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  266. package/dist/sandbox/discover-worker.cjs +50 -0
  267. package/dist/sandbox/discover-worker.cjs.map +1 -0
  268. package/dist/sandbox/discover-worker.d.cts +1 -0
  269. package/dist/sandbox/discover-worker.d.mts +1 -0
  270. package/dist/sandbox/discover-worker.mjs +51 -0
  271. package/dist/sandbox/discover-worker.mjs.map +1 -0
  272. package/dist/sandbox/migrate-worker.cjs +76 -0
  273. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  274. package/dist/sandbox/migrate-worker.d.cts +1 -0
  275. package/dist/sandbox/migrate-worker.d.mts +1 -0
  276. package/dist/sandbox/migrate-worker.mjs +77 -0
  277. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  278. package/dist/sandbox-CHv3OYXg.cjs +165 -0
  279. package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
  280. package/dist/sandbox-CbVB7uOD.mjs +118 -0
  281. package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
  282. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  283. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  284. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  285. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  286. package/dist/secretsManager-CQORubp9.mjs +97 -0
  287. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  288. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  289. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  290. package/dist/seeds-CNPdk_2f.mjs +9198 -0
  291. package/dist/seeds-CNPdk_2f.mjs.map +1 -0
  292. package/dist/seeds-MR13eS-F.cjs +10303 -0
  293. package/dist/seeds-MR13eS-F.cjs.map +1 -0
  294. package/dist/serverSetup-9kFFmA86.cjs +651 -0
  295. package/dist/serverSetup-9kFFmA86.cjs.map +1 -0
  296. package/dist/serverSetup-DgAERQ5s.mjs +651 -0
  297. package/dist/serverSetup-DgAERQ5s.mjs.map +1 -0
  298. package/dist/sniffer-Biw5SE1V.cjs +1998 -0
  299. package/dist/sniffer-Biw5SE1V.cjs.map +1 -0
  300. package/dist/sniffer-KS_EcbAk.mjs +1825 -0
  301. package/dist/sniffer-KS_EcbAk.mjs.map +1 -0
  302. package/dist/snsSubscriptions-Bl3CChIH.mjs +1472 -0
  303. package/dist/snsSubscriptions-Bl3CChIH.mjs.map +1 -0
  304. package/dist/snsSubscriptions-CQFfrCJf.cjs +1695 -0
  305. package/dist/snsSubscriptions-CQFfrCJf.cjs.map +1 -0
  306. package/dist/sst-DmVJRu5l.cjs +463 -0
  307. package/dist/sst-DmVJRu5l.cjs.map +1 -0
  308. package/dist/sst-fop6uZ25.mjs +440 -0
  309. package/dist/sst-fop6uZ25.mjs.map +1 -0
  310. package/dist/stage-BIKAMxNc.cjs +313 -0
  311. package/dist/stage-BIKAMxNc.cjs.map +1 -0
  312. package/dist/stage-tIMFTQtj.mjs +302 -0
  313. package/dist/stage-tIMFTQtj.mjs.map +1 -0
  314. package/dist/stages-C9uSkohw.cjs +190 -0
  315. package/dist/stages-C9uSkohw.cjs.map +1 -0
  316. package/dist/stages-DhmbURs_.mjs +190 -0
  317. package/dist/stages-DhmbURs_.mjs.map +1 -0
  318. package/dist/target/public.cjs +15 -0
  319. package/dist/target/public.d.cts +28 -0
  320. package/dist/target/public.d.cts.map +1 -0
  321. package/dist/target/public.d.mts +28 -0
  322. package/dist/target/public.d.mts.map +1 -0
  323. package/dist/target/public.mjs +4 -0
  324. package/dist/terminal-CebFDhWQ.mjs +85 -0
  325. package/dist/terminal-CebFDhWQ.mjs.map +1 -0
  326. package/dist/terminal-DBwedwSS.cjs +85 -0
  327. package/dist/terminal-DBwedwSS.cjs.map +1 -0
  328. package/dist/{types-BGo5TaNE.d.mts → types-Cjnqw1ta.d.cts} +2199 -462
  329. package/dist/types-Cjnqw1ta.d.cts.map +1 -0
  330. package/dist/{types-C5ZNpUad.d.cts → types-xBx-07__.d.mts} +2197 -462
  331. package/dist/types-xBx-07__.d.mts.map +1 -0
  332. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  333. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  334. package/dist/utils-D_fxUqvU.mjs +156 -0
  335. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  336. package/dist/vitest.cjs +65 -0
  337. package/dist/vitest.cjs.map +1 -0
  338. package/dist/vitest.d.cts +29 -0
  339. package/dist/vitest.d.cts.map +1 -0
  340. package/dist/vitest.d.mts +29 -0
  341. package/dist/vitest.d.mts.map +1 -0
  342. package/dist/vitest.mjs +65 -0
  343. package/dist/vitest.mjs.map +1 -0
  344. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  345. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  346. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  347. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  348. package/dist/workspace/index.cjs +6 -2
  349. package/dist/workspace/index.d.cts +3 -3
  350. package/dist/workspace/index.d.mts +3 -3
  351. package/dist/workspace/index.mjs +2 -2
  352. package/dist/workspace-CjSfjfMK.mjs +2396 -0
  353. package/dist/workspace-CjSfjfMK.mjs.map +1 -0
  354. package/dist/workspace-DImrdet4.cjs +2808 -0
  355. package/dist/workspace-DImrdet4.cjs.map +1 -0
  356. package/package.json +55 -20
  357. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  358. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  359. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  360. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  361. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  362. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  363. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  364. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  365. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  366. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  367. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  368. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  369. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  370. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  371. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  372. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  373. package/dist/config-Q1rvKHvw.cjs +0 -467
  374. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  375. package/dist/config-pqGD3hF9.mjs +0 -414
  376. package/dist/config-pqGD3hF9.mjs.map +0 -1
  377. package/dist/config.d.cts.map +0 -1
  378. package/dist/config.d.mts.map +0 -1
  379. package/dist/credentials-BekkKtY_.mjs +0 -2780
  380. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  381. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  382. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  383. package/dist/discover-BERGFg8v.cjs +0 -288
  384. package/dist/discover-BERGFg8v.cjs.map +0 -1
  385. package/dist/discover-CK-n3w6b.mjs +0 -244
  386. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  387. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  388. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  389. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  390. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  391. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  392. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  393. package/dist/generator-LfZU7NlU.mjs +0 -247
  394. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  395. package/dist/generator-Wdfp0jCS.cjs +0 -282
  396. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  397. package/dist/github-BfflNPVe.cjs +0 -203
  398. package/dist/github-BfflNPVe.cjs.map +0 -1
  399. package/dist/github-CRwnxKmD.mjs +0 -203
  400. package/dist/github-CRwnxKmD.mjs.map +0 -1
  401. package/dist/index-Cd-qeOam.d.mts.map +0 -1
  402. package/dist/index-D-iAVHx-.d.cts.map +0 -1
  403. package/dist/keystore-B4PRlbgE.mjs +0 -81
  404. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  405. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  406. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  407. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  408. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  409. package/dist/openapi-react-query.cjs +0 -158
  410. package/dist/openapi-react-query.cjs.map +0 -1
  411. package/dist/openapi-react-query.d.cts +0 -9
  412. package/dist/openapi-react-query.d.cts.map +0 -1
  413. package/dist/openapi-react-query.d.mts +0 -9
  414. package/dist/openapi-react-query.d.mts.map +0 -1
  415. package/dist/openapi-react-query.mjs +0 -158
  416. package/dist/openapi-react-query.mjs.map +0 -1
  417. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  418. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  419. package/dist/storage-C-30BD1e.cjs +0 -272
  420. package/dist/storage-C-30BD1e.cjs.map +0 -1
  421. package/dist/storage-P_b3w7uj.mjs +0 -231
  422. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  423. package/dist/sync-B3xxXtJT.mjs +0 -88
  424. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  425. package/dist/sync-D7uTIIEi.cjs +0 -111
  426. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  427. package/dist/types-BGo5TaNE.d.mts.map +0 -1
  428. package/dist/types-C5ZNpUad.d.cts.map +0 -1
  429. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  430. package/dist/workspace-mFpI_ky_.cjs.map +0 -1
@@ -0,0 +1,796 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_errors = require("./errors-DMC4Umsb.cjs");
3
+ const require_schemas = require("./schemas-BQ_v0lEX.cjs");
4
+ const require_sandbox = require("./sandbox-CHv3OYXg.cjs");
5
+ const require_workerRuntime = require("./workerRuntime-BXfhbe13.cjs");
6
+ let node_path = require("node:path");
7
+ let node_fs = require("node:fs");
8
+ let _geekmidas_manifest = require("@geekmidas/manifest");
9
+ let node_module = require("node:module");
10
+ let node_url = require("node:url");
11
+ let node_async_hooks = require("node:async_hooks");
12
+ let node_util = require("node:util");
13
+ let _geekmidas_constructs_crons = require("@geekmidas/constructs/crons");
14
+ let _geekmidas_constructs_processors = require("@geekmidas/constructs/processors");
15
+ let _geekmidas_constructs_queue = require("@geekmidas/constructs/queue");
16
+ let _geekmidas_constructs_subscribers = require("@geekmidas/constructs/subscribers");
17
+ let fast_glob = require("fast-glob");
18
+ fast_glob = require_rolldown_runtime.__toESM(fast_glob, 1);
19
+ let lodash_kebabcase = require("lodash.kebabcase");
20
+ lodash_kebabcase = require_rolldown_runtime.__toESM(lodash_kebabcase, 1);
21
+ //#region src/reconcile/edges.ts
22
+ /**
23
+ * Edges a process records for what its runnables consume, beyond the
24
+ * construct ids `.dependsOn()` names.
25
+ */
26
+ const EVENTS_SUFFIX = "#events";
27
+ /**
28
+ * A bucket's events, as an edge: what a process running one of the bucket's
29
+ * subscribers consumes. Not the bucket's id — binding to a bucket's changes
30
+ * is not reading its objects, so the process is handed the events key alone.
31
+ */
32
+ function eventsEdge(bucketId) {
33
+ return `${bucketId}${EVENTS_SUFFIX}`;
34
+ }
35
+ /** The bucket an events edge names, or nothing for any other edge. */
36
+ function eventsEdgeBucket(edge) {
37
+ return edge.endsWith(EVENTS_SUFFIX) ? edge.slice(0, -7) : void 0;
38
+ }
39
+ /**
40
+ * The env key a subscriber's deliveries come from: its topic's publisher
41
+ * connection string, or its bucket's events connection string.
42
+ */
43
+ function subscriberConnectionKey(construct) {
44
+ if (construct.bucketName) return (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.bucketName), "eventsConnectionString");
45
+ if (construct.topicName) return (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.topicName), "publisherConnectionString");
46
+ }
47
+ /**
48
+ * The key a bucket's relay token is read from, by the process that runs the
49
+ * bucket's subscribers — beside its events connection string.
50
+ */
51
+ function subscriberTokenKey(construct) {
52
+ return construct.bucketName ? (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.bucketName), "eventsToken") : void 0;
53
+ }
54
+ //#endregion
55
+ //#region src/output.ts
56
+ /**
57
+ * Where the CLI's progress lines go.
58
+ *
59
+ * Commands write their progress through `output` rather than `console`. Run
60
+ * from the terminal that is the same thing. Run inside `deploy()`, each line
61
+ * goes to the run that wrote it instead — as an event its caller can iterate,
62
+ * and to the logger it was handed — so a deploy embedded in another program
63
+ * does not print over that program's own output.
64
+ *
65
+ * Carried by `AsyncLocalStorage` rather than passed down, because the lines
66
+ * come from everywhere a deploy reaches — the Dockerfile generator, the env
67
+ * sniffer, construct discovery — and two deploys running in one process must
68
+ * not hear each other.
69
+ */
70
+ const current = new node_async_hooks.AsyncLocalStorage();
71
+ /** Runs `fn` with every line written through `output` sent to `sink`. */
72
+ function withOutput(sink, fn) {
73
+ return current.run(sink, fn);
74
+ }
75
+ function write(level, fallback) {
76
+ return (...args) => {
77
+ const sink = current.getStore();
78
+ if (sink) sink(level, (0, node_util.format)(...args));
79
+ else fallback(...args);
80
+ };
81
+ }
82
+ /**
83
+ * `console`, for the methods the CLI logs through — routed to the current
84
+ * run's sink when there is one.
85
+ */
86
+ const output = {
87
+ log: write("info", (...args) => console.log(...args)),
88
+ info: write("info", (...args) => console.info(...args)),
89
+ warn: write("warn", (...args) => console.warn(...args)),
90
+ error: write("error", (...args) => console.error(...args))
91
+ };
92
+ //#endregion
93
+ //#region src/generators/Generator.ts
94
+ /**
95
+ * Zod v4 maintains a process-wide registry of schemas registered via
96
+ * `.meta({ id })`. When we cache-bust user module imports (by appending a
97
+ * `?t=timestamp` query), those modules re-execute and try to register the
98
+ * same ids again, which throws `ID X already exists in the registry`.
99
+ *
100
+ * Clearing the registry in the CLI process is safe: the user's running
101
+ * server lives in a subprocess and has its own isolated registry.
102
+ *
103
+ * Exported for tests.
104
+ */
105
+ function clearZodGlobalRegistry() {
106
+ const registry = globalThis.__zod_globalRegistry;
107
+ if (registry && typeof registry.clear === "function") registry.clear();
108
+ }
109
+ var ConstructGenerator = class {
110
+ static async build(context, outputDir, generator, patterns, options) {
111
+ const constructs = await generator.load(patterns);
112
+ return generator.build(context, constructs, outputDir, options);
113
+ }
114
+ async load(patterns, cwd = process.cwd(), bustCache = false) {
115
+ const logger = console;
116
+ const globPatterns = Array.isArray(patterns) ? patterns : patterns ? [patterns] : [];
117
+ const files = fast_glob.default.stream(globPatterns, {
118
+ cwd,
119
+ absolute: true
120
+ });
121
+ if (bustCache) clearZodGlobalRegistry();
122
+ const constructs = [];
123
+ for await (const f of files) try {
124
+ const file = f.toString();
125
+ const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
126
+ for (const [key, construct] of Object.entries(module)) if (this.isConstruct(construct)) constructs.push({
127
+ key,
128
+ name: (0, lodash_kebabcase.default)(key),
129
+ construct,
130
+ path: {
131
+ absolute: file,
132
+ relative: (0, node_path.relative)(process.cwd(), file)
133
+ }
134
+ });
135
+ } catch (error) {
136
+ const err = error;
137
+ logger.error(`Failed to load ${f}: ${err.message}`);
138
+ if (err.stack) logger.error(err.stack);
139
+ throw error;
140
+ }
141
+ return constructs;
142
+ }
143
+ };
144
+ //#endregion
145
+ //#region src/owningTsconfigJsx.ts
146
+ const REGISTER = "owning-tsconfig-jsx-register.mjs";
147
+ /** The CLI's `bin/` was not found above the module looking for it. */
148
+ var OwningTsconfigJsxHookMissing = class extends Error {
149
+ from;
150
+ constructor(from) {
151
+ super(`Could not find bin/${REGISTER} in any directory above '${from}'. It ships with @geekmidas/cli beside bin/gkm.mjs; reinstall the package if it is missing.`);
152
+ this.from = from;
153
+ this.name = "OwningTsconfigJsxHookMissing";
154
+ }
155
+ };
156
+ /**
157
+ * The CLI's `bin/owning-tsconfig-jsx-register.mjs`, as a file URL. Searched
158
+ * upward because this module runs from `src/` in the repo and from a chunk in
159
+ * `dist/` once built, and `bin/` sits beside both.
160
+ */
161
+ function registerUrl() {
162
+ const from = (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
163
+ for (let dir = from;; dir = (0, node_path.dirname)(dir)) {
164
+ const candidate = (0, node_path.join)(dir, "bin", REGISTER);
165
+ if ((0, node_fs.existsSync)(candidate)) return (0, node_url.pathToFileURL)(candidate).href;
166
+ if ((0, node_path.dirname)(dir) === dir) throw new OwningTsconfigJsxHookMissing(from);
167
+ }
168
+ }
169
+ /**
170
+ * `NODE_OPTIONS` for a process that runs app code through tsx, with the hook
171
+ * that compiles each `.tsx` with its own tsconfig's JSX settings (see
172
+ * `bin/owning-tsconfig-jsx.mjs`) put in front of every other `--import`, so it
173
+ * is registered before tsx and reads the source on tsx's behalf.
174
+ *
175
+ * `bin/gkm.mjs` already starts the CLI this way, and its children inherit it;
176
+ * this is for those that set `NODE_OPTIONS` themselves, or whose CLI was
177
+ * started with tsx already imported.
178
+ */
179
+ function withOwningTsconfigJsx(nodeOptions = "") {
180
+ if (nodeOptions.includes(REGISTER)) return nodeOptions;
181
+ return [`--import=${registerUrl()}`, nodeOptions].filter(Boolean).join(" ");
182
+ }
183
+ //#endregion
184
+ //#region src/sandbox/worker.ts
185
+ /**
186
+ * Running one of the CLI's own worker scripts inside a sandbox, and reading
187
+ * back the one JSON value it answers with.
188
+ *
189
+ * The worker imports the project's TypeScript — `gkm.config.ts`, construct
190
+ * modules, an app's entry — so it starts with the CLI's own tsx and the two
191
+ * hooks `gkm` itself runs with (JSX by the owning tsconfig, path aliases by
192
+ * the adjacent one). The host process needs none of them loaded: a program
193
+ * calling `deploy()` without `--import tsx` still loads a TypeScript config.
194
+ */
195
+ const here = (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
196
+ /**
197
+ * A worker's file: `dist/sandbox/<name>.mjs` once built — whether this module
198
+ * was bundled into `dist/` or sits beside it — or the `.ts` source under tsx.
199
+ */
200
+ function workerFile(name) {
201
+ return [
202
+ (0, node_path.join)(here, "sandbox", `${name}.mjs`),
203
+ (0, node_path.join)(here, `${name}.mjs`),
204
+ (0, node_path.join)(here, "..", "sandbox", `${name}.mjs`),
205
+ (0, node_path.join)(here, `${name}.ts`)
206
+ ].find((path) => (0, node_fs.existsSync)(path)) ?? (0, node_path.join)(here, `${name}.ts`);
207
+ }
208
+ /** tsx, from the CLI's own dependencies — never the project's. */
209
+ function tsxUrl() {
210
+ return (0, node_url.pathToFileURL)((0, node_module.createRequire)(require("url").pathToFileURL(__filename).href).resolve("tsx")).href;
211
+ }
212
+ /**
213
+ * `node`'s arguments for `script`: the CLI's TypeScript loaders, then any
214
+ * further `imports`, then the script and its `args` — an argument array, so
215
+ * nothing about a path is read by a shell.
216
+ */
217
+ function nodeWithTsx(script, args, imports = []) {
218
+ return [
219
+ ...withOwningTsconfigJsx(`--import=${tsxUrl()}`).split(" "),
220
+ ...imports.map((path) => `--import=${(0, node_url.pathToFileURL)(path).href}`),
221
+ script,
222
+ ...args
223
+ ];
224
+ }
225
+ /** A worker ended without the answer it exists to give. */
226
+ var SandboxWorkerFailed = class extends Error {
227
+ step;
228
+ exitCode;
229
+ stderr;
230
+ constructor(step, exitCode, stderr) {
231
+ super(`The sandboxed ${step} ended (exit code ${exitCode}) without an answer.${stderr.trim() ? `\n${stderr.trim()}` : ""}\nIts output above says why; the sandbox must be able to run \`node\` with the CLI's own files at the paths they have here.`);
232
+ this.step = step;
233
+ this.exitCode = exitCode;
234
+ this.stderr = stderr;
235
+ this.name = "SandboxWorkerFailed";
236
+ }
237
+ };
238
+ /**
239
+ * Run worker `name` in `sandbox`, and parse its answer with `schema`.
240
+ *
241
+ * The answer is the last marked line on stdout. Anything else the project's
242
+ * code printed is ignored, and an answer the schema refuses is a failure
243
+ * rather than data — a worker in an isolating sandbox runs code the host does
244
+ * not trust.
245
+ *
246
+ * Within a run (`withSandbox`), the same worker asked the same question is
247
+ * started once; every ask gets its own copy of the answer, and its stderr, as
248
+ * though it had run again.
249
+ */
250
+ async function runWorker(sandbox, step, options) {
251
+ if (options.secrets) return startWorker(sandbox, step, options);
252
+ const key = JSON.stringify([
253
+ options.name,
254
+ options.cwd,
255
+ options.args,
256
+ options.env ?? {}
257
+ ]);
258
+ const answer = await require_sandbox.oncePerRun(sandbox, key, () => startWorker(sandbox, step, options));
259
+ return structuredClone(answer);
260
+ }
261
+ async function startWorker(sandbox, step, options) {
262
+ const result = await sandbox.exec("node", nodeWithTsx(workerFile(options.name), options.args), {
263
+ cwd: options.cwd,
264
+ env: {
265
+ ...sandbox.env,
266
+ ...options.env
267
+ },
268
+ timeoutMs: options.timeoutMs,
269
+ output: "capture",
270
+ ...options.secrets ? { secrets: options.secrets } : {},
271
+ ...options.signal ? { signal: options.signal } : {}
272
+ });
273
+ const line = result.stdout.split("\n").reverse().find((l) => l.startsWith(require_workerRuntime.WORKER_RESULT_MARKER));
274
+ if (line) try {
275
+ const parsed = options.schema.safeParse(JSON.parse(line.slice(require_workerRuntime.WORKER_RESULT_MARKER.length)));
276
+ if (parsed.success) return {
277
+ value: parsed.data,
278
+ stderr: result.stderr
279
+ };
280
+ } catch {}
281
+ throw new SandboxWorkerFailed(step, result.exitCode, result.stderr);
282
+ }
283
+ //#endregion
284
+ //#region src/reconcile/discover.ts
285
+ /**
286
+ * Discovery — one glob, one structural test.
287
+ *
288
+ * A glob per kind is the same specialness the construct model removes, and
289
+ * resources have no kind to be listed under: a declared `ObjectStorage` would
290
+ * never be found by `routes:` or `crons:`. So there is one `constructs` glob,
291
+ * every export of every matching module is inspected, and the per-kind
292
+ * `isConstruct` checks collapse into a single question — does it have an id and
293
+ * can it declare?
294
+ *
295
+ * Structural rather than `instanceof` on purpose. A construct from a different
296
+ * copy of `@geekmidas/constructs` — a linked workspace, two versions in a
297
+ * lockfile — is still a construct, and `instanceof` is exactly the check that
298
+ * says otherwise.
299
+ */
300
+ var discover_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
301
+ ConstructDiscoveryFailed: () => ConstructDiscoveryFailed,
302
+ ConstructsNotSerializable: () => ConstructsNotSerializable,
303
+ DuplicateConstruct: () => DuplicateConstruct,
304
+ LiveConstructsUnavailable: () => LiveConstructsUnavailable,
305
+ ProcessorServerUnknown: () => ProcessorServerUnknown,
306
+ consumedBy: () => consumedBy,
307
+ discover: () => discover,
308
+ isDeclarable: () => isDeclarable
309
+ });
310
+ /** `console`, or the deploy run discovering the manifest. */
311
+ const logger = output;
312
+ /**
313
+ * Whether a module export is a construct.
314
+ *
315
+ * Deliberately loose about what else it carries — a construct that also has a
316
+ * `service` is still a construct, and requiring one would exclude the kinds that
317
+ * own no address.
318
+ */
319
+ function isDeclarable(value) {
320
+ if (typeof value !== "object" || value === null) return false;
321
+ const candidate = value;
322
+ return typeof candidate.id === "string" && candidate.id.length > 0 && typeof candidate.declare === "function";
323
+ }
324
+ /** What the discovery worker answers. Checked: the worker ran project code. */
325
+ const DiscoverAnswer = require_schemas.discriminatedUnion("reason", [
326
+ require_schemas.object({
327
+ reason: require_schemas.literal("discovered"),
328
+ manifest: require_schemas.record(require_schemas.string(), require_schemas.object({
329
+ id: require_schemas.string(),
330
+ kind: require_schemas.string()
331
+ }).loose()),
332
+ runnables: require_schemas.record(require_schemas.string(), require_schemas.array(require_schemas.string())),
333
+ background: require_schemas.record(require_schemas.string(), require_schemas.array(require_schemas.string())).optional(),
334
+ subscribers: require_schemas.record(require_schemas.string(), require_schemas.array(require_schemas.object({
335
+ name: require_schemas.string(),
336
+ connectionKey: require_schemas.string(),
337
+ events: require_schemas.array(require_schemas.string()).optional()
338
+ }))).optional()
339
+ }),
340
+ require_schemas.object({
341
+ reason: require_schemas.literal("live"),
342
+ paths: require_schemas.array(require_schemas.string())
343
+ }),
344
+ require_schemas.object({
345
+ reason: require_schemas.literal("failed"),
346
+ error: require_schemas.object({
347
+ name: require_schemas.string(),
348
+ message: require_schemas.string(),
349
+ id: require_schemas.string().optional(),
350
+ sources: require_schemas.array(require_schemas.string()).optional()
351
+ }).loose()
352
+ })
353
+ ]);
354
+ /**
355
+ * The manifest, discovered in `sandbox` and handed back as JSON — or
356
+ * `undefined` when it holds something JSON cannot carry and the sandbox is
357
+ * not isolating, for the caller to discover here as before.
358
+ */
359
+ async function discoverInSandbox(sandbox, options) {
360
+ const cwd = options.cwd ?? sandbox.root;
361
+ const patterns = typeof options.patterns === "string" ? [options.patterns] : [...options.patterns];
362
+ const { value, stderr } = await runWorker(sandbox, "construct discovery", {
363
+ name: "discover-worker",
364
+ args: [JSON.stringify({
365
+ patterns,
366
+ cwd
367
+ })],
368
+ cwd,
369
+ timeoutMs: DISCOVER_TIMEOUT_MS,
370
+ schema: DiscoverAnswer
371
+ });
372
+ if (stderr.trim()) logger.warn(stderr.replace(/\n$/, ""));
373
+ switch (value.reason) {
374
+ case "discovered":
375
+ if (options.runnables) for (const [owner, edges] of Object.entries(value.runnables)) options.runnables[owner] = edges;
376
+ if (options.background) for (const [owner, files] of Object.entries(value.background ?? {})) options.background[owner] = files;
377
+ if (options.subscribers) for (const [owner, bound] of Object.entries(value.subscribers ?? {})) options.subscribers[owner] = bound;
378
+ return value.manifest;
379
+ case "failed":
380
+ if (value.error.name === "DuplicateConstruct" && value.error.id) throw new DuplicateConstruct(value.error.id, value.error.sources ?? []);
381
+ throw new ConstructDiscoveryFailed(value.error.name, value.error.message);
382
+ case "live":
383
+ if (sandbox.isolating) throw new ConstructsNotSerializable(value.paths);
384
+ return;
385
+ }
386
+ }
387
+ /**
388
+ * A caller asked for the construct objects (`sources`) or a watcher's
389
+ * re-import under an isolating sandbox, where only data comes back.
390
+ */
391
+ var LiveConstructsUnavailable = class extends Error {
392
+ constructor() {
393
+ super("Discovery was asked for the construct objects themselves under an isolating sandbox, which hands back only data. Run this step without one, or ask only for the manifest.");
394
+ this.name = "LiveConstructsUnavailable";
395
+ }
396
+ };
397
+ /** How long discovering a project's constructs may take in a sandbox. */
398
+ const DISCOVER_TIMEOUT_MS = 6e4;
399
+ /** Importing a construct module, or declaring one, threw in the sandbox. */
400
+ var ConstructDiscoveryFailed = class extends Error {
401
+ errorName;
402
+ detail;
403
+ constructor(errorName, detail) {
404
+ super(`Discovering constructs failed (${errorName}): ${detail}`);
405
+ this.errorName = errorName;
406
+ this.detail = detail;
407
+ this.name = "ConstructDiscoveryFailed";
408
+ }
409
+ };
410
+ /**
411
+ * The constructs' declarations hold something that is not data, and the
412
+ * sandbox they were discovered in hands the deploy nothing but data.
413
+ */
414
+ var ConstructsNotSerializable = class extends Error {
415
+ paths;
416
+ constructor(paths) {
417
+ super(`The construct manifest holds values that are not plain data at: ${paths.join(", ")}. Under an isolating sandbox the deploy only receives what JSON can carry; deploy with a sandbox that is not isolating if the host trusts this project.`);
418
+ this.paths = paths;
419
+ this.name = "ConstructsNotSerializable";
420
+ }
421
+ };
422
+ /**
423
+ * Build the construct manifest for a project.
424
+ *
425
+ * Runs the manifest's own validation before returning, so an app is wrong here
426
+ * — where the error names a file — rather than at deploy.
427
+ *
428
+ * @throws {DuplicateConstruct} when two exports claim one id.
429
+ */
430
+ async function discover(options) {
431
+ const sandbox = options.sandbox ?? require_sandbox.activeSandbox();
432
+ if (sandbox) {
433
+ if (!options.sources && !options.bustCache) {
434
+ const sandboxed = await discoverInSandbox(sandbox, options);
435
+ if (sandboxed) return sandboxed;
436
+ } else if (sandbox.isolating) throw new LiveConstructsUnavailable();
437
+ }
438
+ const { patterns, cwd = process.cwd(), bustCache = false, sources: out } = options;
439
+ if (bustCache) clearZodGlobalRegistry();
440
+ const manifest = {};
441
+ /** Which file declared each id, for the error when two of them do. */
442
+ const sources = {};
443
+ /**
444
+ * Constructs already seen, by identity.
445
+ *
446
+ * A re-export is the *same object* reached through a second file — ESM
447
+ * bindings are live, so `export * from './database.js'` hands back the
448
+ * binding rather than a copy. Without this, a barrel file made every
449
+ * construct in it appear declared twice, and `constructs/index.ts` is the
450
+ * first thing anyone writes in a shared folder.
451
+ *
452
+ * Identity rather than file is also the more honest rule: what may not
453
+ * happen twice is two *different* constructs claiming one id, and that is
454
+ * still an error below.
455
+ */
456
+ const seen = /* @__PURE__ */ new WeakSet();
457
+ const globs = Array.isArray(patterns) ? [...patterns] : [patterns];
458
+ const files = fast_glob.default.stream(globs, {
459
+ cwd,
460
+ absolute: true
461
+ });
462
+ /** Matched files, for the diagnostic below. */
463
+ let matched = 0;
464
+ /** Each processor, once, by the export that first reached it. */
465
+ const processors = /* @__PURE__ */ new Map();
466
+ for await (const found of files) {
467
+ matched++;
468
+ const file = found.toString();
469
+ const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
470
+ for (const [exportName, exported] of Object.entries(module)) {
471
+ if (options.background) recordBackground(options.background, exported, file);
472
+ if (options.served) recordServed(options.served, exported, file);
473
+ if (options.subscribers) recordSubscriber(options.subscribers, exported, exportName);
474
+ if (_geekmidas_constructs_processors.Processor.isProcessor(exported)) {
475
+ const seenAt = processors.get(exported);
476
+ if (!seenAt || definedIn(file, seenAt.file)) processors.set(exported, {
477
+ exportName,
478
+ file,
479
+ processor: exported
480
+ });
481
+ }
482
+ if (!isDeclarable(exported)) {
483
+ if (options.runnables) recordRunnable(options.runnables, exported);
484
+ continue;
485
+ }
486
+ if (seen.has(exported)) continue;
487
+ seen.add(exported);
488
+ if (options.runnables && typeof exported.owner === "string") recordRunnable(options.runnables, exported);
489
+ for (const declaration of exported.declare()) {
490
+ const id = (0, _geekmidas_manifest.canonicalId)(declaration.id);
491
+ const source = (0, node_path.relative)(cwd, file);
492
+ const claimed = sources[id];
493
+ if (claimed !== void 0 && claimed !== source) throw new DuplicateConstruct(id, [claimed, source]);
494
+ manifest[id] = {
495
+ ...declaration,
496
+ id
497
+ };
498
+ sources[id] = source;
499
+ if (out) out[id] = {
500
+ file,
501
+ exportName,
502
+ construct: exported
503
+ };
504
+ }
505
+ }
506
+ }
507
+ nestProcessors(manifest, [...processors.values()], cwd);
508
+ (0, _geekmidas_manifest.assertDerivations)(manifest);
509
+ warnIfNothingFound(globs, matched, Object.keys(manifest).length);
510
+ return manifest;
511
+ }
512
+ /**
513
+ * Record where a worker's background work is declared: a cron, a queue
514
+ * consumer or a topic subscriber, under the worker that owns it.
515
+ */
516
+ function recordBackground(background, exported, file) {
517
+ if (!_geekmidas_constructs_crons.Cron.isCron(exported) && !_geekmidas_constructs_queue.Queue.isQueue(exported) && !_geekmidas_constructs_subscribers.Subscriber.isSubscriber(exported)) return;
518
+ const owner = exported.owner;
519
+ if (typeof owner !== "string") return;
520
+ const key = (0, _geekmidas_manifest.canonicalId)(owner);
521
+ const files = background[key] ?? [];
522
+ background[key] = files;
523
+ if (!files.includes(file)) files.push(file);
524
+ }
525
+ /** Record the file of anything built from a surface, under that surface. */
526
+ function recordServed(served, exported, file) {
527
+ if (typeof exported !== "object" || exported === null) return;
528
+ const surface = exported.surface?.id;
529
+ if (typeof surface !== "string") return;
530
+ const key = (0, _geekmidas_manifest.canonicalId)(surface);
531
+ const files = served[key] ?? [];
532
+ served[key] = files;
533
+ if (!files.includes(file)) files.push(file);
534
+ }
535
+ /** A processor built from a file server the discovery never found. */
536
+ var ProcessorServerUnknown = class extends require_errors.GkmError {
537
+ processor;
538
+ server;
539
+ constructor(processor, server) {
540
+ super(`The processor '${processor}' answers on '${server}', which no discovered file declares. Export the FileServer from a file the workspace's constructs glob matches.`);
541
+ this.processor = processor;
542
+ this.server = server;
543
+ this.name = "ProcessorServerUnknown";
544
+ }
545
+ };
546
+ /**
547
+ * Whether `file` is the likelier home of an export also reached from
548
+ * `other`: not a barrel (`index.*`) where the other is, and otherwise the
549
+ * first by path — so the answer never depends on the order the glob
550
+ * streamed them in.
551
+ */
552
+ function definedIn(file, other) {
553
+ const barrel = (path) => /(^|[/\\])index\.[cm]?[jt]s$/.test(path);
554
+ if (barrel(file) !== barrel(other)) return barrel(other);
555
+ return file < other;
556
+ }
557
+ /**
558
+ * Nest each processor in the file server it answers on.
559
+ *
560
+ * A processor is positional, as a subscriber is: it answers on its server's
561
+ * domain and nothing else. It is nested here, not only by the build, because
562
+ * every deploy path — the compose stack, the CDN in front of the bucket, the
563
+ * SST stack — reads the discovered manifest. Its handler is its source until a
564
+ * build replaces it with the generated one.
565
+ */
566
+ function nestProcessors(manifest, processors, cwd) {
567
+ for (const { exportName, file, processor } of processors) {
568
+ const server = manifest[processor.surfaceId];
569
+ if (server?.kind !== "file-server") throw new ProcessorServerUnknown(exportName, processor.surfaceId);
570
+ const declaration = {
571
+ id: exportName,
572
+ handler: `${(0, node_path.relative)(cwd, file)}#${exportName}`,
573
+ path: processor.pattern,
574
+ prefix: processor.prefix,
575
+ ...processor.native.length ? { native: [...processor.native] } : {},
576
+ ...processor.timeout !== void 0 ? { timeout: processor.timeout } : {},
577
+ ...processor.memorySize !== void 0 ? { memorySize: processor.memorySize } : {},
578
+ dependencies: processor.constructs.flatMap((id) => {
579
+ const target = manifest[(0, _geekmidas_manifest.canonicalId)(id)];
580
+ return target ? [{
581
+ target: target.id,
582
+ kind: target.kind
583
+ }] : [];
584
+ })
585
+ };
586
+ manifest[server.id] = {
587
+ ...server,
588
+ processors: [...(server.processors ?? []).filter((p) => p.id !== exportName), declaration].sort((a, b) => a.id.localeCompare(b.id))
589
+ };
590
+ }
591
+ }
592
+ /**
593
+ * Record a subscriber — to a topic or to a bucket — under the worker that
594
+ * runs it, by its export. Once per name: a file reached twice through a
595
+ * re-export finds it again.
596
+ */
597
+ function recordSubscriber(subscribers, exported, exportName) {
598
+ if (!_geekmidas_constructs_subscribers.Subscriber.isSubscriber(exported)) return;
599
+ const owner = exported.owner;
600
+ const connectionKey = subscriberConnectionKey(exported);
601
+ if (typeof owner !== "string" || !connectionKey) return;
602
+ const key = (0, _geekmidas_manifest.canonicalId)(owner);
603
+ const bound = subscribers[key] ?? [];
604
+ subscribers[key] = bound;
605
+ if (!bound.some((s) => s.connectionKey === connectionKey && s.name === exportName)) {
606
+ const events = exported.topicName ? exported.subscribedEvents : void 0;
607
+ bound.push({
608
+ name: exportName,
609
+ connectionKey,
610
+ ...events ? { events: [...events] } : {}
611
+ });
612
+ }
613
+ }
614
+ /**
615
+ * What a runnable consumes, by id: a queue's consumer drains that queue, a
616
+ * subscriber its topic. Nothing for anything else.
617
+ */
618
+ function consumedBy(runnable) {
619
+ if (_geekmidas_constructs_queue.Queue.isQueue(runnable)) return [runnable.id];
620
+ if (_geekmidas_constructs_subscribers.Subscriber.isSubscriber(runnable) && runnable.topicName) return [(0, _geekmidas_manifest.canonicalId)(runnable.topicName)];
621
+ if (_geekmidas_constructs_subscribers.Subscriber.isSubscriber(runnable) && runnable.bucketName) return [(0, _geekmidas_manifest.canonicalId)(runnable.bucketName)];
622
+ return [];
623
+ }
624
+ /**
625
+ * The edges a runnable's process records for what it consumes. A bucket's
626
+ * subscriber consumes the bucket's *events*, not the bucket: binding to its
627
+ * changes is not reading its objects, so its process is handed the events
628
+ * key and not the bucket's URL — that still takes `.dependsOn([bucket])`.
629
+ */
630
+ function consumedEdges(runnable) {
631
+ if (_geekmidas_constructs_subscribers.Subscriber.isSubscriber(runnable) && runnable.bucketName) return [eventsEdge((0, _geekmidas_manifest.canonicalId)(runnable.bucketName))];
632
+ return consumedBy(runnable);
633
+ }
634
+ /**
635
+ * Record a runnable's edges under the construct that owns it — the surface an
636
+ * endpoint was built from, or the worker a cron or subscriber was. Anything
637
+ * with no owner, or that is not a runnable at all, is left alone.
638
+ */
639
+ function recordRunnable(runnables, exported) {
640
+ if (typeof exported !== "object" || exported === null) return;
641
+ const runnable = exported;
642
+ const owner = typeof runnable.surface?.id === "string" ? runnable.surface.id : typeof runnable.owner === "string" ? runnable.owner : void 0;
643
+ if (!owner || !Array.isArray(runnable.constructs)) return;
644
+ const key = (0, _geekmidas_manifest.canonicalId)(owner);
645
+ const edges = runnables[key] ?? [];
646
+ runnables[key] = edges;
647
+ for (const id of runnable.constructs) {
648
+ if (typeof id !== "string") continue;
649
+ const target = (0, _geekmidas_manifest.canonicalId)(id);
650
+ if (!edges.includes(target)) edges.push(target);
651
+ }
652
+ for (const edge of consumedEdges(exported)) if (!edges.includes(edge)) edges.push(edge);
653
+ }
654
+ /**
655
+ * Say so when a glob was configured and found nothing.
656
+ *
657
+ * The glob is not a filter over declarations already known — it is *how they
658
+ * are found*, by importing what it matches. So a file it misses is a
659
+ * declaration that does not exist, and every symptom of that appears somewhere
660
+ * other than the cause: no container starts, no env key is written, and the
661
+ * application fails on first use against a resource it can see in its own
662
+ * source.
663
+ *
664
+ * Nothing reported it before, because an unmatched file is indistinguishable
665
+ * from a file nobody wrote. These two cases are the ones that are *not*
666
+ * ambiguous — a glob was configured, so something was expected.
667
+ *
668
+ * Silent when no glob is configured at all: that is a project which has not
669
+ * adopted constructs, and has nothing to be missing.
670
+ */
671
+ function warnIfNothingFound(globs, matched, declared) {
672
+ if (globs.length === 0) return;
673
+ if (matched === 0) {
674
+ logger.warn(`\n⚠️ The constructs glob matched no files, so nothing was declared.\n Patterns: ${globs.join(", ")}\n Nothing will be provisioned — no containers, no env keys, no resources.\n A common cause is depth: '*.ts' matches one level, '**/*.ts' matches any.`);
675
+ return;
676
+ }
677
+ if (declared === 0) logger.warn(`\n⚠️ The constructs glob matched ${matched} file(s) but none declared anything.\n Patterns: ${globs.join(", ")}\n Discovery keeps exports with an 'id' that can 'declare()'. A construct that is\n built but never exported is invisible to it.`);
678
+ }
679
+ /** Two constructs claiming one id. */
680
+ var DuplicateConstruct = class extends require_errors.GkmError {
681
+ /** The id claimed twice. */
682
+ id;
683
+ /** The files that claimed it. */
684
+ sources;
685
+ constructor(id, sources) {
686
+ super("Two constructs declare the same id");
687
+ this.name = "DuplicateConstruct";
688
+ this.id = id;
689
+ this.sources = sources;
690
+ }
691
+ };
692
+ //#endregion
693
+ Object.defineProperty(exports, "ConstructDiscoveryFailed", {
694
+ enumerable: true,
695
+ get: function() {
696
+ return ConstructDiscoveryFailed;
697
+ }
698
+ });
699
+ Object.defineProperty(exports, "ConstructGenerator", {
700
+ enumerable: true,
701
+ get: function() {
702
+ return ConstructGenerator;
703
+ }
704
+ });
705
+ Object.defineProperty(exports, "ConstructsNotSerializable", {
706
+ enumerable: true,
707
+ get: function() {
708
+ return ConstructsNotSerializable;
709
+ }
710
+ });
711
+ Object.defineProperty(exports, "SandboxWorkerFailed", {
712
+ enumerable: true,
713
+ get: function() {
714
+ return SandboxWorkerFailed;
715
+ }
716
+ });
717
+ Object.defineProperty(exports, "consumedBy", {
718
+ enumerable: true,
719
+ get: function() {
720
+ return consumedBy;
721
+ }
722
+ });
723
+ Object.defineProperty(exports, "discover", {
724
+ enumerable: true,
725
+ get: function() {
726
+ return discover;
727
+ }
728
+ });
729
+ Object.defineProperty(exports, "discover_exports", {
730
+ enumerable: true,
731
+ get: function() {
732
+ return discover_exports;
733
+ }
734
+ });
735
+ Object.defineProperty(exports, "eventsEdge", {
736
+ enumerable: true,
737
+ get: function() {
738
+ return eventsEdge;
739
+ }
740
+ });
741
+ Object.defineProperty(exports, "eventsEdgeBucket", {
742
+ enumerable: true,
743
+ get: function() {
744
+ return eventsEdgeBucket;
745
+ }
746
+ });
747
+ Object.defineProperty(exports, "isDeclarable", {
748
+ enumerable: true,
749
+ get: function() {
750
+ return isDeclarable;
751
+ }
752
+ });
753
+ Object.defineProperty(exports, "nodeWithTsx", {
754
+ enumerable: true,
755
+ get: function() {
756
+ return nodeWithTsx;
757
+ }
758
+ });
759
+ Object.defineProperty(exports, "output", {
760
+ enumerable: true,
761
+ get: function() {
762
+ return output;
763
+ }
764
+ });
765
+ Object.defineProperty(exports, "runWorker", {
766
+ enumerable: true,
767
+ get: function() {
768
+ return runWorker;
769
+ }
770
+ });
771
+ Object.defineProperty(exports, "subscriberConnectionKey", {
772
+ enumerable: true,
773
+ get: function() {
774
+ return subscriberConnectionKey;
775
+ }
776
+ });
777
+ Object.defineProperty(exports, "subscriberTokenKey", {
778
+ enumerable: true,
779
+ get: function() {
780
+ return subscriberTokenKey;
781
+ }
782
+ });
783
+ Object.defineProperty(exports, "withOutput", {
784
+ enumerable: true,
785
+ get: function() {
786
+ return withOutput;
787
+ }
788
+ });
789
+ Object.defineProperty(exports, "withOwningTsconfigJsx", {
790
+ enumerable: true,
791
+ get: function() {
792
+ return withOwningTsconfigJsx;
793
+ }
794
+ });
795
+
796
+ //# sourceMappingURL=discover-DEOspD9M.cjs.map