@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,693 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
2
+ import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
3
+ import { a as discriminatedUnion, c as literal, d as object, f as record, n as array, p as string } from "./schemas-BCwKKA42.mjs";
4
+ import { i as activeSandbox, s as oncePerRun } from "./sandbox-CbVB7uOD.mjs";
5
+ import { t as WORKER_RESULT_MARKER } from "./workerRuntime-CsOyBRx2.mjs";
6
+ import { createRequire } from "node:module";
7
+ import { dirname, join, relative } from "node:path";
8
+ import { existsSync } from "node:fs";
9
+ import { assertDerivations, canonicalId, provideKey } from "@geekmidas/manifest";
10
+ import { fileURLToPath, pathToFileURL } from "node:url";
11
+ import { AsyncLocalStorage } from "node:async_hooks";
12
+ import { format } from "node:util";
13
+ import { Cron } from "@geekmidas/constructs/crons";
14
+ import { Processor } from "@geekmidas/constructs/processors";
15
+ import { Queue } from "@geekmidas/constructs/queue";
16
+ import { Subscriber } from "@geekmidas/constructs/subscribers";
17
+ import fg from "fast-glob";
18
+ import kebabCase$1 from "lodash.kebabcase";
19
+ //#region src/reconcile/edges.ts
20
+ /**
21
+ * Edges a process records for what its runnables consume, beyond the
22
+ * construct ids `.dependsOn()` names.
23
+ */
24
+ const EVENTS_SUFFIX = "#events";
25
+ /**
26
+ * A bucket's events, as an edge: what a process running one of the bucket's
27
+ * subscribers consumes. Not the bucket's id — binding to a bucket's changes
28
+ * is not reading its objects, so the process is handed the events key alone.
29
+ */
30
+ function eventsEdge(bucketId) {
31
+ return `${bucketId}${EVENTS_SUFFIX}`;
32
+ }
33
+ /** The bucket an events edge names, or nothing for any other edge. */
34
+ function eventsEdgeBucket(edge) {
35
+ return edge.endsWith(EVENTS_SUFFIX) ? edge.slice(0, -7) : void 0;
36
+ }
37
+ /**
38
+ * The env key a subscriber's deliveries come from: its topic's publisher
39
+ * connection string, or its bucket's events connection string.
40
+ */
41
+ function subscriberConnectionKey(construct) {
42
+ if (construct.bucketName) return provideKey(canonicalId(construct.bucketName), "eventsConnectionString");
43
+ if (construct.topicName) return provideKey(canonicalId(construct.topicName), "publisherConnectionString");
44
+ }
45
+ /**
46
+ * The key a bucket's relay token is read from, by the process that runs the
47
+ * bucket's subscribers — beside its events connection string.
48
+ */
49
+ function subscriberTokenKey(construct) {
50
+ return construct.bucketName ? provideKey(canonicalId(construct.bucketName), "eventsToken") : void 0;
51
+ }
52
+ //#endregion
53
+ //#region src/output.ts
54
+ /**
55
+ * Where the CLI's progress lines go.
56
+ *
57
+ * Commands write their progress through `output` rather than `console`. Run
58
+ * from the terminal that is the same thing. Run inside `deploy()`, each line
59
+ * goes to the run that wrote it instead — as an event its caller can iterate,
60
+ * and to the logger it was handed — so a deploy embedded in another program
61
+ * does not print over that program's own output.
62
+ *
63
+ * Carried by `AsyncLocalStorage` rather than passed down, because the lines
64
+ * come from everywhere a deploy reaches — the Dockerfile generator, the env
65
+ * sniffer, construct discovery — and two deploys running in one process must
66
+ * not hear each other.
67
+ */
68
+ const current = new AsyncLocalStorage();
69
+ /** Runs `fn` with every line written through `output` sent to `sink`. */
70
+ function withOutput(sink, fn) {
71
+ return current.run(sink, fn);
72
+ }
73
+ function write(level, fallback) {
74
+ return (...args) => {
75
+ const sink = current.getStore();
76
+ if (sink) sink(level, format(...args));
77
+ else fallback(...args);
78
+ };
79
+ }
80
+ /**
81
+ * `console`, for the methods the CLI logs through — routed to the current
82
+ * run's sink when there is one.
83
+ */
84
+ const output = {
85
+ log: write("info", (...args) => console.log(...args)),
86
+ info: write("info", (...args) => console.info(...args)),
87
+ warn: write("warn", (...args) => console.warn(...args)),
88
+ error: write("error", (...args) => console.error(...args))
89
+ };
90
+ //#endregion
91
+ //#region src/generators/Generator.ts
92
+ /**
93
+ * Zod v4 maintains a process-wide registry of schemas registered via
94
+ * `.meta({ id })`. When we cache-bust user module imports (by appending a
95
+ * `?t=timestamp` query), those modules re-execute and try to register the
96
+ * same ids again, which throws `ID X already exists in the registry`.
97
+ *
98
+ * Clearing the registry in the CLI process is safe: the user's running
99
+ * server lives in a subprocess and has its own isolated registry.
100
+ *
101
+ * Exported for tests.
102
+ */
103
+ function clearZodGlobalRegistry() {
104
+ const registry = globalThis.__zod_globalRegistry;
105
+ if (registry && typeof registry.clear === "function") registry.clear();
106
+ }
107
+ var ConstructGenerator = class {
108
+ static async build(context, outputDir, generator, patterns, options) {
109
+ const constructs = await generator.load(patterns);
110
+ return generator.build(context, constructs, outputDir, options);
111
+ }
112
+ async load(patterns, cwd = process.cwd(), bustCache = false) {
113
+ const logger = console;
114
+ const globPatterns = Array.isArray(patterns) ? patterns : patterns ? [patterns] : [];
115
+ const files = fg.stream(globPatterns, {
116
+ cwd,
117
+ absolute: true
118
+ });
119
+ if (bustCache) clearZodGlobalRegistry();
120
+ const constructs = [];
121
+ for await (const f of files) try {
122
+ const file = f.toString();
123
+ const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
124
+ for (const [key, construct] of Object.entries(module)) if (this.isConstruct(construct)) constructs.push({
125
+ key,
126
+ name: kebabCase$1(key),
127
+ construct,
128
+ path: {
129
+ absolute: file,
130
+ relative: relative(process.cwd(), file)
131
+ }
132
+ });
133
+ } catch (error) {
134
+ const err = error;
135
+ logger.error(`Failed to load ${f}: ${err.message}`);
136
+ if (err.stack) logger.error(err.stack);
137
+ throw error;
138
+ }
139
+ return constructs;
140
+ }
141
+ };
142
+ //#endregion
143
+ //#region src/owningTsconfigJsx.ts
144
+ const REGISTER = "owning-tsconfig-jsx-register.mjs";
145
+ /** The CLI's `bin/` was not found above the module looking for it. */
146
+ var OwningTsconfigJsxHookMissing = class extends Error {
147
+ from;
148
+ constructor(from) {
149
+ 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.`);
150
+ this.from = from;
151
+ this.name = "OwningTsconfigJsxHookMissing";
152
+ }
153
+ };
154
+ /**
155
+ * The CLI's `bin/owning-tsconfig-jsx-register.mjs`, as a file URL. Searched
156
+ * upward because this module runs from `src/` in the repo and from a chunk in
157
+ * `dist/` once built, and `bin/` sits beside both.
158
+ */
159
+ function registerUrl() {
160
+ const from = dirname(fileURLToPath(import.meta.url));
161
+ for (let dir = from;; dir = dirname(dir)) {
162
+ const candidate = join(dir, "bin", REGISTER);
163
+ if (existsSync(candidate)) return pathToFileURL(candidate).href;
164
+ if (dirname(dir) === dir) throw new OwningTsconfigJsxHookMissing(from);
165
+ }
166
+ }
167
+ /**
168
+ * `NODE_OPTIONS` for a process that runs app code through tsx, with the hook
169
+ * that compiles each `.tsx` with its own tsconfig's JSX settings (see
170
+ * `bin/owning-tsconfig-jsx.mjs`) put in front of every other `--import`, so it
171
+ * is registered before tsx and reads the source on tsx's behalf.
172
+ *
173
+ * `bin/gkm.mjs` already starts the CLI this way, and its children inherit it;
174
+ * this is for those that set `NODE_OPTIONS` themselves, or whose CLI was
175
+ * started with tsx already imported.
176
+ */
177
+ function withOwningTsconfigJsx(nodeOptions = "") {
178
+ if (nodeOptions.includes(REGISTER)) return nodeOptions;
179
+ return [`--import=${registerUrl()}`, nodeOptions].filter(Boolean).join(" ");
180
+ }
181
+ //#endregion
182
+ //#region src/sandbox/worker.ts
183
+ /**
184
+ * Running one of the CLI's own worker scripts inside a sandbox, and reading
185
+ * back the one JSON value it answers with.
186
+ *
187
+ * The worker imports the project's TypeScript — `gkm.config.ts`, construct
188
+ * modules, an app's entry — so it starts with the CLI's own tsx and the two
189
+ * hooks `gkm` itself runs with (JSX by the owning tsconfig, path aliases by
190
+ * the adjacent one). The host process needs none of them loaded: a program
191
+ * calling `deploy()` without `--import tsx` still loads a TypeScript config.
192
+ */
193
+ const here = dirname(fileURLToPath(import.meta.url));
194
+ /**
195
+ * A worker's file: `dist/sandbox/<name>.mjs` once built — whether this module
196
+ * was bundled into `dist/` or sits beside it — or the `.ts` source under tsx.
197
+ */
198
+ function workerFile(name) {
199
+ return [
200
+ join(here, "sandbox", `${name}.mjs`),
201
+ join(here, `${name}.mjs`),
202
+ join(here, "..", "sandbox", `${name}.mjs`),
203
+ join(here, `${name}.ts`)
204
+ ].find((path) => existsSync(path)) ?? join(here, `${name}.ts`);
205
+ }
206
+ /** tsx, from the CLI's own dependencies — never the project's. */
207
+ function tsxUrl() {
208
+ return pathToFileURL(createRequire(import.meta.url).resolve("tsx")).href;
209
+ }
210
+ /**
211
+ * `node`'s arguments for `script`: the CLI's TypeScript loaders, then any
212
+ * further `imports`, then the script and its `args` — an argument array, so
213
+ * nothing about a path is read by a shell.
214
+ */
215
+ function nodeWithTsx(script, args, imports = []) {
216
+ return [
217
+ ...withOwningTsconfigJsx(`--import=${tsxUrl()}`).split(" "),
218
+ ...imports.map((path) => `--import=${pathToFileURL(path).href}`),
219
+ script,
220
+ ...args
221
+ ];
222
+ }
223
+ /** A worker ended without the answer it exists to give. */
224
+ var SandboxWorkerFailed = class extends Error {
225
+ step;
226
+ exitCode;
227
+ stderr;
228
+ constructor(step, exitCode, stderr) {
229
+ 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.`);
230
+ this.step = step;
231
+ this.exitCode = exitCode;
232
+ this.stderr = stderr;
233
+ this.name = "SandboxWorkerFailed";
234
+ }
235
+ };
236
+ /**
237
+ * Run worker `name` in `sandbox`, and parse its answer with `schema`.
238
+ *
239
+ * The answer is the last marked line on stdout. Anything else the project's
240
+ * code printed is ignored, and an answer the schema refuses is a failure
241
+ * rather than data — a worker in an isolating sandbox runs code the host does
242
+ * not trust.
243
+ *
244
+ * Within a run (`withSandbox`), the same worker asked the same question is
245
+ * started once; every ask gets its own copy of the answer, and its stderr, as
246
+ * though it had run again.
247
+ */
248
+ async function runWorker(sandbox, step, options) {
249
+ if (options.secrets) return startWorker(sandbox, step, options);
250
+ const key = JSON.stringify([
251
+ options.name,
252
+ options.cwd,
253
+ options.args,
254
+ options.env ?? {}
255
+ ]);
256
+ const answer = await oncePerRun(sandbox, key, () => startWorker(sandbox, step, options));
257
+ return structuredClone(answer);
258
+ }
259
+ async function startWorker(sandbox, step, options) {
260
+ const result = await sandbox.exec("node", nodeWithTsx(workerFile(options.name), options.args), {
261
+ cwd: options.cwd,
262
+ env: {
263
+ ...sandbox.env,
264
+ ...options.env
265
+ },
266
+ timeoutMs: options.timeoutMs,
267
+ output: "capture",
268
+ ...options.secrets ? { secrets: options.secrets } : {},
269
+ ...options.signal ? { signal: options.signal } : {}
270
+ });
271
+ const line = result.stdout.split("\n").reverse().find((l) => l.startsWith(WORKER_RESULT_MARKER));
272
+ if (line) try {
273
+ const parsed = options.schema.safeParse(JSON.parse(line.slice(WORKER_RESULT_MARKER.length)));
274
+ if (parsed.success) return {
275
+ value: parsed.data,
276
+ stderr: result.stderr
277
+ };
278
+ } catch {}
279
+ throw new SandboxWorkerFailed(step, result.exitCode, result.stderr);
280
+ }
281
+ //#endregion
282
+ //#region src/reconcile/discover.ts
283
+ /**
284
+ * Discovery — one glob, one structural test.
285
+ *
286
+ * A glob per kind is the same specialness the construct model removes, and
287
+ * resources have no kind to be listed under: a declared `ObjectStorage` would
288
+ * never be found by `routes:` or `crons:`. So there is one `constructs` glob,
289
+ * every export of every matching module is inspected, and the per-kind
290
+ * `isConstruct` checks collapse into a single question — does it have an id and
291
+ * can it declare?
292
+ *
293
+ * Structural rather than `instanceof` on purpose. A construct from a different
294
+ * copy of `@geekmidas/constructs` — a linked workspace, two versions in a
295
+ * lockfile — is still a construct, and `instanceof` is exactly the check that
296
+ * says otherwise.
297
+ */
298
+ var discover_exports = /* @__PURE__ */ __exportAll({
299
+ ConstructDiscoveryFailed: () => ConstructDiscoveryFailed,
300
+ ConstructsNotSerializable: () => ConstructsNotSerializable,
301
+ DuplicateConstruct: () => DuplicateConstruct,
302
+ LiveConstructsUnavailable: () => LiveConstructsUnavailable,
303
+ ProcessorServerUnknown: () => ProcessorServerUnknown,
304
+ consumedBy: () => consumedBy,
305
+ discover: () => discover,
306
+ isDeclarable: () => isDeclarable
307
+ });
308
+ /** `console`, or the deploy run discovering the manifest. */
309
+ const logger = output;
310
+ /**
311
+ * Whether a module export is a construct.
312
+ *
313
+ * Deliberately loose about what else it carries — a construct that also has a
314
+ * `service` is still a construct, and requiring one would exclude the kinds that
315
+ * own no address.
316
+ */
317
+ function isDeclarable(value) {
318
+ if (typeof value !== "object" || value === null) return false;
319
+ const candidate = value;
320
+ return typeof candidate.id === "string" && candidate.id.length > 0 && typeof candidate.declare === "function";
321
+ }
322
+ /** What the discovery worker answers. Checked: the worker ran project code. */
323
+ const DiscoverAnswer = discriminatedUnion("reason", [
324
+ object({
325
+ reason: literal("discovered"),
326
+ manifest: record(string(), object({
327
+ id: string(),
328
+ kind: string()
329
+ }).loose()),
330
+ runnables: record(string(), array(string())),
331
+ background: record(string(), array(string())).optional(),
332
+ subscribers: record(string(), array(object({
333
+ name: string(),
334
+ connectionKey: string(),
335
+ events: array(string()).optional()
336
+ }))).optional()
337
+ }),
338
+ object({
339
+ reason: literal("live"),
340
+ paths: array(string())
341
+ }),
342
+ object({
343
+ reason: literal("failed"),
344
+ error: object({
345
+ name: string(),
346
+ message: string(),
347
+ id: string().optional(),
348
+ sources: array(string()).optional()
349
+ }).loose()
350
+ })
351
+ ]);
352
+ /**
353
+ * The manifest, discovered in `sandbox` and handed back as JSON — or
354
+ * `undefined` when it holds something JSON cannot carry and the sandbox is
355
+ * not isolating, for the caller to discover here as before.
356
+ */
357
+ async function discoverInSandbox(sandbox, options) {
358
+ const cwd = options.cwd ?? sandbox.root;
359
+ const patterns = typeof options.patterns === "string" ? [options.patterns] : [...options.patterns];
360
+ const { value, stderr } = await runWorker(sandbox, "construct discovery", {
361
+ name: "discover-worker",
362
+ args: [JSON.stringify({
363
+ patterns,
364
+ cwd
365
+ })],
366
+ cwd,
367
+ timeoutMs: DISCOVER_TIMEOUT_MS,
368
+ schema: DiscoverAnswer
369
+ });
370
+ if (stderr.trim()) logger.warn(stderr.replace(/\n$/, ""));
371
+ switch (value.reason) {
372
+ case "discovered":
373
+ if (options.runnables) for (const [owner, edges] of Object.entries(value.runnables)) options.runnables[owner] = edges;
374
+ if (options.background) for (const [owner, files] of Object.entries(value.background ?? {})) options.background[owner] = files;
375
+ if (options.subscribers) for (const [owner, bound] of Object.entries(value.subscribers ?? {})) options.subscribers[owner] = bound;
376
+ return value.manifest;
377
+ case "failed":
378
+ if (value.error.name === "DuplicateConstruct" && value.error.id) throw new DuplicateConstruct(value.error.id, value.error.sources ?? []);
379
+ throw new ConstructDiscoveryFailed(value.error.name, value.error.message);
380
+ case "live":
381
+ if (sandbox.isolating) throw new ConstructsNotSerializable(value.paths);
382
+ return;
383
+ }
384
+ }
385
+ /**
386
+ * A caller asked for the construct objects (`sources`) or a watcher's
387
+ * re-import under an isolating sandbox, where only data comes back.
388
+ */
389
+ var LiveConstructsUnavailable = class extends Error {
390
+ constructor() {
391
+ 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.");
392
+ this.name = "LiveConstructsUnavailable";
393
+ }
394
+ };
395
+ /** How long discovering a project's constructs may take in a sandbox. */
396
+ const DISCOVER_TIMEOUT_MS = 6e4;
397
+ /** Importing a construct module, or declaring one, threw in the sandbox. */
398
+ var ConstructDiscoveryFailed = class extends Error {
399
+ errorName;
400
+ detail;
401
+ constructor(errorName, detail) {
402
+ super(`Discovering constructs failed (${errorName}): ${detail}`);
403
+ this.errorName = errorName;
404
+ this.detail = detail;
405
+ this.name = "ConstructDiscoveryFailed";
406
+ }
407
+ };
408
+ /**
409
+ * The constructs' declarations hold something that is not data, and the
410
+ * sandbox they were discovered in hands the deploy nothing but data.
411
+ */
412
+ var ConstructsNotSerializable = class extends Error {
413
+ paths;
414
+ constructor(paths) {
415
+ 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.`);
416
+ this.paths = paths;
417
+ this.name = "ConstructsNotSerializable";
418
+ }
419
+ };
420
+ /**
421
+ * Build the construct manifest for a project.
422
+ *
423
+ * Runs the manifest's own validation before returning, so an app is wrong here
424
+ * — where the error names a file — rather than at deploy.
425
+ *
426
+ * @throws {DuplicateConstruct} when two exports claim one id.
427
+ */
428
+ async function discover(options) {
429
+ const sandbox = options.sandbox ?? activeSandbox();
430
+ if (sandbox) {
431
+ if (!options.sources && !options.bustCache) {
432
+ const sandboxed = await discoverInSandbox(sandbox, options);
433
+ if (sandboxed) return sandboxed;
434
+ } else if (sandbox.isolating) throw new LiveConstructsUnavailable();
435
+ }
436
+ const { patterns, cwd = process.cwd(), bustCache = false, sources: out } = options;
437
+ if (bustCache) clearZodGlobalRegistry();
438
+ const manifest = {};
439
+ /** Which file declared each id, for the error when two of them do. */
440
+ const sources = {};
441
+ /**
442
+ * Constructs already seen, by identity.
443
+ *
444
+ * A re-export is the *same object* reached through a second file — ESM
445
+ * bindings are live, so `export * from './database.js'` hands back the
446
+ * binding rather than a copy. Without this, a barrel file made every
447
+ * construct in it appear declared twice, and `constructs/index.ts` is the
448
+ * first thing anyone writes in a shared folder.
449
+ *
450
+ * Identity rather than file is also the more honest rule: what may not
451
+ * happen twice is two *different* constructs claiming one id, and that is
452
+ * still an error below.
453
+ */
454
+ const seen = /* @__PURE__ */ new WeakSet();
455
+ const globs = Array.isArray(patterns) ? [...patterns] : [patterns];
456
+ const files = fg.stream(globs, {
457
+ cwd,
458
+ absolute: true
459
+ });
460
+ /** Matched files, for the diagnostic below. */
461
+ let matched = 0;
462
+ /** Each processor, once, by the export that first reached it. */
463
+ const processors = /* @__PURE__ */ new Map();
464
+ for await (const found of files) {
465
+ matched++;
466
+ const file = found.toString();
467
+ const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
468
+ for (const [exportName, exported] of Object.entries(module)) {
469
+ if (options.background) recordBackground(options.background, exported, file);
470
+ if (options.served) recordServed(options.served, exported, file);
471
+ if (options.subscribers) recordSubscriber(options.subscribers, exported, exportName);
472
+ if (Processor.isProcessor(exported)) {
473
+ const seenAt = processors.get(exported);
474
+ if (!seenAt || definedIn(file, seenAt.file)) processors.set(exported, {
475
+ exportName,
476
+ file,
477
+ processor: exported
478
+ });
479
+ }
480
+ if (!isDeclarable(exported)) {
481
+ if (options.runnables) recordRunnable(options.runnables, exported);
482
+ continue;
483
+ }
484
+ if (seen.has(exported)) continue;
485
+ seen.add(exported);
486
+ if (options.runnables && typeof exported.owner === "string") recordRunnable(options.runnables, exported);
487
+ for (const declaration of exported.declare()) {
488
+ const id = canonicalId(declaration.id);
489
+ const source = relative(cwd, file);
490
+ const claimed = sources[id];
491
+ if (claimed !== void 0 && claimed !== source) throw new DuplicateConstruct(id, [claimed, source]);
492
+ manifest[id] = {
493
+ ...declaration,
494
+ id
495
+ };
496
+ sources[id] = source;
497
+ if (out) out[id] = {
498
+ file,
499
+ exportName,
500
+ construct: exported
501
+ };
502
+ }
503
+ }
504
+ }
505
+ nestProcessors(manifest, [...processors.values()], cwd);
506
+ assertDerivations(manifest);
507
+ warnIfNothingFound(globs, matched, Object.keys(manifest).length);
508
+ return manifest;
509
+ }
510
+ /**
511
+ * Record where a worker's background work is declared: a cron, a queue
512
+ * consumer or a topic subscriber, under the worker that owns it.
513
+ */
514
+ function recordBackground(background, exported, file) {
515
+ if (!Cron.isCron(exported) && !Queue.isQueue(exported) && !Subscriber.isSubscriber(exported)) return;
516
+ const owner = exported.owner;
517
+ if (typeof owner !== "string") return;
518
+ const key = canonicalId(owner);
519
+ const files = background[key] ?? [];
520
+ background[key] = files;
521
+ if (!files.includes(file)) files.push(file);
522
+ }
523
+ /** Record the file of anything built from a surface, under that surface. */
524
+ function recordServed(served, exported, file) {
525
+ if (typeof exported !== "object" || exported === null) return;
526
+ const surface = exported.surface?.id;
527
+ if (typeof surface !== "string") return;
528
+ const key = canonicalId(surface);
529
+ const files = served[key] ?? [];
530
+ served[key] = files;
531
+ if (!files.includes(file)) files.push(file);
532
+ }
533
+ /** A processor built from a file server the discovery never found. */
534
+ var ProcessorServerUnknown = class extends GkmError {
535
+ processor;
536
+ server;
537
+ constructor(processor, server) {
538
+ super(`The processor '${processor}' answers on '${server}', which no discovered file declares. Export the FileServer from a file the workspace's constructs glob matches.`);
539
+ this.processor = processor;
540
+ this.server = server;
541
+ this.name = "ProcessorServerUnknown";
542
+ }
543
+ };
544
+ /**
545
+ * Whether `file` is the likelier home of an export also reached from
546
+ * `other`: not a barrel (`index.*`) where the other is, and otherwise the
547
+ * first by path — so the answer never depends on the order the glob
548
+ * streamed them in.
549
+ */
550
+ function definedIn(file, other) {
551
+ const barrel = (path) => /(^|[/\\])index\.[cm]?[jt]s$/.test(path);
552
+ if (barrel(file) !== barrel(other)) return barrel(other);
553
+ return file < other;
554
+ }
555
+ /**
556
+ * Nest each processor in the file server it answers on.
557
+ *
558
+ * A processor is positional, as a subscriber is: it answers on its server's
559
+ * domain and nothing else. It is nested here, not only by the build, because
560
+ * every deploy path — the compose stack, the CDN in front of the bucket, the
561
+ * SST stack — reads the discovered manifest. Its handler is its source until a
562
+ * build replaces it with the generated one.
563
+ */
564
+ function nestProcessors(manifest, processors, cwd) {
565
+ for (const { exportName, file, processor } of processors) {
566
+ const server = manifest[processor.surfaceId];
567
+ if (server?.kind !== "file-server") throw new ProcessorServerUnknown(exportName, processor.surfaceId);
568
+ const declaration = {
569
+ id: exportName,
570
+ handler: `${relative(cwd, file)}#${exportName}`,
571
+ path: processor.pattern,
572
+ prefix: processor.prefix,
573
+ ...processor.native.length ? { native: [...processor.native] } : {},
574
+ ...processor.timeout !== void 0 ? { timeout: processor.timeout } : {},
575
+ ...processor.memorySize !== void 0 ? { memorySize: processor.memorySize } : {},
576
+ dependencies: processor.constructs.flatMap((id) => {
577
+ const target = manifest[canonicalId(id)];
578
+ return target ? [{
579
+ target: target.id,
580
+ kind: target.kind
581
+ }] : [];
582
+ })
583
+ };
584
+ manifest[server.id] = {
585
+ ...server,
586
+ processors: [...(server.processors ?? []).filter((p) => p.id !== exportName), declaration].sort((a, b) => a.id.localeCompare(b.id))
587
+ };
588
+ }
589
+ }
590
+ /**
591
+ * Record a subscriber — to a topic or to a bucket — under the worker that
592
+ * runs it, by its export. Once per name: a file reached twice through a
593
+ * re-export finds it again.
594
+ */
595
+ function recordSubscriber(subscribers, exported, exportName) {
596
+ if (!Subscriber.isSubscriber(exported)) return;
597
+ const owner = exported.owner;
598
+ const connectionKey = subscriberConnectionKey(exported);
599
+ if (typeof owner !== "string" || !connectionKey) return;
600
+ const key = canonicalId(owner);
601
+ const bound = subscribers[key] ?? [];
602
+ subscribers[key] = bound;
603
+ if (!bound.some((s) => s.connectionKey === connectionKey && s.name === exportName)) {
604
+ const events = exported.topicName ? exported.subscribedEvents : void 0;
605
+ bound.push({
606
+ name: exportName,
607
+ connectionKey,
608
+ ...events ? { events: [...events] } : {}
609
+ });
610
+ }
611
+ }
612
+ /**
613
+ * What a runnable consumes, by id: a queue's consumer drains that queue, a
614
+ * subscriber its topic. Nothing for anything else.
615
+ */
616
+ function consumedBy(runnable) {
617
+ if (Queue.isQueue(runnable)) return [runnable.id];
618
+ if (Subscriber.isSubscriber(runnable) && runnable.topicName) return [canonicalId(runnable.topicName)];
619
+ if (Subscriber.isSubscriber(runnable) && runnable.bucketName) return [canonicalId(runnable.bucketName)];
620
+ return [];
621
+ }
622
+ /**
623
+ * The edges a runnable's process records for what it consumes. A bucket's
624
+ * subscriber consumes the bucket's *events*, not the bucket: binding to its
625
+ * changes is not reading its objects, so its process is handed the events
626
+ * key and not the bucket's URL — that still takes `.dependsOn([bucket])`.
627
+ */
628
+ function consumedEdges(runnable) {
629
+ if (Subscriber.isSubscriber(runnable) && runnable.bucketName) return [eventsEdge(canonicalId(runnable.bucketName))];
630
+ return consumedBy(runnable);
631
+ }
632
+ /**
633
+ * Record a runnable's edges under the construct that owns it — the surface an
634
+ * endpoint was built from, or the worker a cron or subscriber was. Anything
635
+ * with no owner, or that is not a runnable at all, is left alone.
636
+ */
637
+ function recordRunnable(runnables, exported) {
638
+ if (typeof exported !== "object" || exported === null) return;
639
+ const runnable = exported;
640
+ const owner = typeof runnable.surface?.id === "string" ? runnable.surface.id : typeof runnable.owner === "string" ? runnable.owner : void 0;
641
+ if (!owner || !Array.isArray(runnable.constructs)) return;
642
+ const key = canonicalId(owner);
643
+ const edges = runnables[key] ?? [];
644
+ runnables[key] = edges;
645
+ for (const id of runnable.constructs) {
646
+ if (typeof id !== "string") continue;
647
+ const target = canonicalId(id);
648
+ if (!edges.includes(target)) edges.push(target);
649
+ }
650
+ for (const edge of consumedEdges(exported)) if (!edges.includes(edge)) edges.push(edge);
651
+ }
652
+ /**
653
+ * Say so when a glob was configured and found nothing.
654
+ *
655
+ * The glob is not a filter over declarations already known — it is *how they
656
+ * are found*, by importing what it matches. So a file it misses is a
657
+ * declaration that does not exist, and every symptom of that appears somewhere
658
+ * other than the cause: no container starts, no env key is written, and the
659
+ * application fails on first use against a resource it can see in its own
660
+ * source.
661
+ *
662
+ * Nothing reported it before, because an unmatched file is indistinguishable
663
+ * from a file nobody wrote. These two cases are the ones that are *not*
664
+ * ambiguous — a glob was configured, so something was expected.
665
+ *
666
+ * Silent when no glob is configured at all: that is a project which has not
667
+ * adopted constructs, and has nothing to be missing.
668
+ */
669
+ function warnIfNothingFound(globs, matched, declared) {
670
+ if (globs.length === 0) return;
671
+ if (matched === 0) {
672
+ 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.`);
673
+ return;
674
+ }
675
+ 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.`);
676
+ }
677
+ /** Two constructs claiming one id. */
678
+ var DuplicateConstruct = class extends GkmError {
679
+ /** The id claimed twice. */
680
+ id;
681
+ /** The files that claimed it. */
682
+ sources;
683
+ constructor(id, sources) {
684
+ super("Two constructs declare the same id");
685
+ this.name = "DuplicateConstruct";
686
+ this.id = id;
687
+ this.sources = sources;
688
+ }
689
+ };
690
+ //#endregion
691
+ 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 };
692
+
693
+ //# sourceMappingURL=discover-DOhYSKY_.mjs.map