@geekmidas/cli 10.0.0-alpha.16 → 10.0.0-alpha.161

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 (446) hide show
  1. package/README.md +323 -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-B5BKAoLz.mjs +1039 -0
  7. package/dist/EndpointGenerator-B5BKAoLz.mjs.map +1 -0
  8. package/dist/EndpointGenerator-DxrRqfJ3.cjs +1098 -0
  9. package/dist/EndpointGenerator-DxrRqfJ3.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-CBqsvbER.cjs +412 -0
  11. package/dist/GoDaddyProvider-CBqsvbER.cjs.map +1 -0
  12. package/dist/GoDaddyProvider-CwqdLM1E.mjs +412 -0
  13. package/dist/GoDaddyProvider-CwqdLM1E.mjs.map +1 -0
  14. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-DtOtsFkM.cjs} +23 -9
  15. package/dist/HostingerProvider-DtOtsFkM.cjs.map +1 -0
  16. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-gD4uqzMN.mjs} +23 -9
  17. package/dist/HostingerProvider-gD4uqzMN.mjs.map +1 -0
  18. package/dist/LegacyStateStore-6xsGADme.mjs +124 -0
  19. package/dist/LegacyStateStore-6xsGADme.mjs.map +1 -0
  20. package/dist/LegacyStateStore-C0rm5slD.cjs +124 -0
  21. package/dist/LegacyStateStore-C0rm5slD.cjs.map +1 -0
  22. package/dist/LocalStateStore-G0JHXOVW.mjs +167 -0
  23. package/dist/LocalStateStore-G0JHXOVW.mjs.map +1 -0
  24. package/dist/LocalStateStore-NBMF3zCb.cjs +178 -0
  25. package/dist/LocalStateStore-NBMF3zCb.cjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-DOTLKBFf.cjs +539 -0
  27. package/dist/OpenApiTsGenerator-DOTLKBFf.cjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-Vaf0pI8u.mjs +534 -0
  29. package/dist/OpenApiTsGenerator-Vaf0pI8u.mjs.map +1 -0
  30. package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
  31. package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
  32. package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
  33. package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
  34. package/dist/S3StateStore-7n6gIYEJ.cjs +222 -0
  35. package/dist/S3StateStore-7n6gIYEJ.cjs.map +1 -0
  36. package/dist/S3StateStore-B7IPTvu0.mjs +223 -0
  37. package/dist/S3StateStore-B7IPTvu0.mjs.map +1 -0
  38. package/dist/SSMStateStore-CWEShHLS.mjs +205 -0
  39. package/dist/SSMStateStore-CWEShHLS.mjs.map +1 -0
  40. package/dist/SSMStateStore-O12NeGEg.cjs +204 -0
  41. package/dist/SSMStateStore-O12NeGEg.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-BybB6uez.mjs +783 -0
  43. package/dist/SubscriberGenerator-BybB6uez.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-mZpSuSU7.cjs +848 -0
  45. package/dist/SubscriberGenerator-mZpSuSU7.cjs.map +1 -0
  46. package/dist/add-C-nlqQgN.mjs +711 -0
  47. package/dist/add-C-nlqQgN.mjs.map +1 -0
  48. package/dist/add-ktNZmJb-.cjs +713 -0
  49. package/dist/add-ktNZmJb-.cjs.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/apps-C7SujLV-.mjs +5621 -0
  55. package/dist/apps-C7SujLV-.mjs.map +1 -0
  56. package/dist/apps-CtjYJS9e.cjs +6247 -0
  57. package/dist/apps-CtjYJS9e.cjs.map +1 -0
  58. package/dist/aws-C5LAU_Ii.mjs +97 -0
  59. package/dist/aws-C5LAU_Ii.mjs.map +1 -0
  60. package/dist/aws-DKC2m3sT.cjs +108 -0
  61. package/dist/aws-DKC2m3sT.cjs.map +1 -0
  62. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  63. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  64. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  65. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  66. package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  67. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  68. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  69. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  70. package/dist/backups/runner.cjs +519 -0
  71. package/dist/backups/runner.cjs.map +1 -0
  72. package/dist/backups/runner.d.cts +102 -0
  73. package/dist/backups/runner.d.cts.map +1 -0
  74. package/dist/backups/runner.d.mts +102 -0
  75. package/dist/backups/runner.d.mts.map +1 -0
  76. package/dist/backups/runner.mjs +506 -0
  77. package/dist/backups/runner.mjs.map +1 -0
  78. package/dist/{bundler-BeNDZdHQ.cjs → bundler-DGwgZmim.cjs} +59 -14
  79. package/dist/bundler-DGwgZmim.cjs.map +1 -0
  80. package/dist/{bundler-BodTL4kf.mjs → bundler-DnHKVaZz.mjs} +59 -14
  81. package/dist/bundler-DnHKVaZz.mjs.map +1 -0
  82. package/dist/cli-CI9v138l.mjs +80 -0
  83. package/dist/cli-CI9v138l.mjs.map +1 -0
  84. package/dist/cli-k2G7rG15.cjs +80 -0
  85. package/dist/cli-k2G7rG15.cjs.map +1 -0
  86. package/dist/compose-BD2rwRfn.cjs +1919 -0
  87. package/dist/compose-BD2rwRfn.cjs.map +1 -0
  88. package/dist/compose-Co-Dt-a4.mjs +1560 -0
  89. package/dist/compose-Co-Dt-a4.mjs.map +1 -0
  90. package/dist/compose-nGgRylPu.cjs +3163 -0
  91. package/dist/compose-nGgRylPu.cjs.map +1 -0
  92. package/dist/compose-reJW9x-G.mjs +3074 -0
  93. package/dist/compose-reJW9x-G.mjs.map +1 -0
  94. package/dist/config-B5Hi3mLK.cjs +821 -0
  95. package/dist/config-B5Hi3mLK.cjs.map +1 -0
  96. package/dist/config-C60T2h98.d.cts +291 -0
  97. package/dist/config-C60T2h98.d.cts.map +1 -0
  98. package/dist/config-CfI2g_Ho.d.mts +291 -0
  99. package/dist/config-CfI2g_Ho.d.mts.map +1 -0
  100. package/dist/config-DWTUVGRE.mjs +696 -0
  101. package/dist/config-DWTUVGRE.mjs.map +1 -0
  102. package/dist/config.cjs +13 -3
  103. package/dist/config.d.cts +4 -117
  104. package/dist/config.d.mts +4 -117
  105. package/dist/config.mjs +3 -3
  106. package/dist/credentialSchemas-BAklWDna.cjs +271 -0
  107. package/dist/credentialSchemas-BAklWDna.cjs.map +1 -0
  108. package/dist/credentialSchemas-mz9QZTYh.mjs +236 -0
  109. package/dist/credentialSchemas-mz9QZTYh.mjs.map +1 -0
  110. package/dist/credentials-BG1KOq9I.mjs +1838 -0
  111. package/dist/credentials-BG1KOq9I.mjs.map +1 -0
  112. package/dist/credentials-UlL1n_Rd.cjs +2293 -0
  113. package/dist/credentials-UlL1n_Rd.cjs.map +1 -0
  114. package/dist/databases-C1qqNxTu.mjs +588 -0
  115. package/dist/databases-C1qqNxTu.mjs.map +1 -0
  116. package/dist/databases-CrKh5jw6.cjs +703 -0
  117. package/dist/databases-CrKh5jw6.cjs.map +1 -0
  118. package/dist/define-6poNqm5O.mjs +106 -0
  119. package/dist/define-6poNqm5O.mjs.map +1 -0
  120. package/dist/define-crmMcXFS.cjs +153 -0
  121. package/dist/define-crmMcXFS.cjs.map +1 -0
  122. package/dist/deploy/public.cjs +211 -0
  123. package/dist/deploy/public.cjs.map +1 -0
  124. package/dist/deploy/public.d.cts +658 -0
  125. package/dist/deploy/public.d.cts.map +1 -0
  126. package/dist/deploy/public.d.mts +658 -0
  127. package/dist/deploy/public.d.mts.map +1 -0
  128. package/dist/deploy/public.mjs +144 -0
  129. package/dist/deploy/public.mjs.map +1 -0
  130. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  131. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  132. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  133. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  134. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  135. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  136. package/dist/deploy/sniffer-hooks.cjs +1 -1
  137. package/dist/deploy/sniffer-hooks.mjs +1 -1
  138. package/dist/deploy/sniffer-loader.cjs +2 -2
  139. package/dist/deploy/sniffer-loader.mjs +1 -1
  140. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  141. package/dist/deploy/sniffer-routes-worker.mjs +1 -1
  142. package/dist/deploy-CqIULk0k.cjs +3425 -0
  143. package/dist/deploy-CqIULk0k.cjs.map +1 -0
  144. package/dist/deploy-DRkCNV7f.mjs +3369 -0
  145. package/dist/deploy-DRkCNV7f.mjs.map +1 -0
  146. package/dist/destroy-CMldkiX-.cjs +789 -0
  147. package/dist/destroy-CMldkiX-.cjs.map +1 -0
  148. package/dist/destroy-DXIAL8nF.mjs +788 -0
  149. package/dist/destroy-DXIAL8nF.mjs.map +1 -0
  150. package/dist/discover-CRywE7yc.cjs +1085 -0
  151. package/dist/discover-CRywE7yc.cjs.map +1 -0
  152. package/dist/discover-DbDrCQ8h.mjs +940 -0
  153. package/dist/discover-DbDrCQ8h.mjs.map +1 -0
  154. package/dist/docker-DFFzQe2f.mjs +1408 -0
  155. package/dist/docker-DFFzQe2f.mjs.map +1 -0
  156. package/dist/docker-LwJW3dx_.cjs +1515 -0
  157. package/dist/docker-LwJW3dx_.cjs.map +1 -0
  158. package/dist/dokploy-DYm0D6Tp.mjs +38 -0
  159. package/dist/dokploy-DYm0D6Tp.mjs.map +1 -0
  160. package/dist/dokploy-wTsJqG-N.cjs +38 -0
  161. package/dist/dokploy-wTsJqG-N.cjs.map +1 -0
  162. package/dist/drivers-BhdC9Efj.cjs +248 -0
  163. package/dist/drivers-BhdC9Efj.cjs.map +1 -0
  164. package/dist/drivers-wcDnzf7l.mjs +213 -0
  165. package/dist/drivers-wcDnzf7l.mjs.map +1 -0
  166. package/dist/eas-BJ_Zlvm8.mjs +334 -0
  167. package/dist/eas-BJ_Zlvm8.mjs.map +1 -0
  168. package/dist/eas-C4EkjTGJ.cjs +337 -0
  169. package/dist/eas-C4EkjTGJ.cjs.map +1 -0
  170. package/dist/emit-C4KSXOeS.mjs +153 -0
  171. package/dist/emit-C4KSXOeS.mjs.map +1 -0
  172. package/dist/emit-DiW0kbue.cjs +164 -0
  173. package/dist/emit-DiW0kbue.cjs.map +1 -0
  174. package/dist/encryption-BQEqqrGq.cjs +90 -0
  175. package/dist/encryption-BQEqqrGq.cjs.map +1 -0
  176. package/dist/encryption-Cu5YTs9V.mjs +89 -0
  177. package/dist/encryption-Cu5YTs9V.mjs.map +1 -0
  178. package/dist/engine-DdRauUQC.cjs +3330 -0
  179. package/dist/engine-DdRauUQC.cjs.map +1 -0
  180. package/dist/engine-q8aCVbLH.mjs +3217 -0
  181. package/dist/engine-q8aCVbLH.mjs.map +1 -0
  182. package/dist/errors-D8Gwp5kU.mjs +23 -0
  183. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  184. package/dist/errors-DMC4Umsb.cjs +34 -0
  185. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  186. package/dist/github-CoXirRes.mjs +901 -0
  187. package/dist/github-CoXirRes.mjs.map +1 -0
  188. package/dist/github-OVZF2k0L.cjs +902 -0
  189. package/dist/github-OVZF2k0L.cjs.map +1 -0
  190. package/dist/googlePlay-CUeTUT7s.cjs +931 -0
  191. package/dist/googlePlay-CUeTUT7s.cjs.map +1 -0
  192. package/dist/googlePlay-HXRRVq0l.mjs +931 -0
  193. package/dist/googlePlay-HXRRVq0l.mjs.map +1 -0
  194. package/dist/iam-6LH6wptf.cjs +618 -0
  195. package/dist/iam-6LH6wptf.cjs.map +1 -0
  196. package/dist/iam-c0e8m04X.mjs +509 -0
  197. package/dist/iam-c0e8m04X.mjs.map +1 -0
  198. package/dist/{index-C-VLwB_Y.d.mts → index-DDY0cZCo.d.cts} +38 -14
  199. package/dist/index-DDY0cZCo.d.cts.map +1 -0
  200. package/dist/{index-C-HkOEBt.d.cts → index-DWNwkcy7.d.mts} +38 -14
  201. package/dist/index-DWNwkcy7.d.mts.map +1 -0
  202. package/dist/index.cjs +13752 -12326
  203. package/dist/index.cjs.map +1 -1
  204. package/dist/index.mjs +13791 -12363
  205. package/dist/index.mjs.map +1 -1
  206. package/dist/local-CCJ-T37d.mjs +224 -0
  207. package/dist/local-CCJ-T37d.mjs.map +1 -0
  208. package/dist/local-Dx0o6vfp.cjs +241 -0
  209. package/dist/local-Dx0o6vfp.cjs.map +1 -0
  210. package/dist/migrate-BkwSXhxv.mjs +181 -0
  211. package/dist/migrate-BkwSXhxv.mjs.map +1 -0
  212. package/dist/migrate-CJoKOCGY.cjs +181 -0
  213. package/dist/migrate-CJoKOCGY.cjs.map +1 -0
  214. package/dist/migrate-DEsYfgzn.cjs +272 -0
  215. package/dist/migrate-DEsYfgzn.cjs.map +1 -0
  216. package/dist/migrate-Dr0BeWsY.mjs +267 -0
  217. package/dist/migrate-Dr0BeWsY.mjs.map +1 -0
  218. package/dist/notes-BOyzuPqr.mjs +399 -0
  219. package/dist/notes-BOyzuPqr.mjs.map +1 -0
  220. package/dist/notes-VFPa51Pd.cjs +500 -0
  221. package/dist/notes-VFPa51Pd.cjs.map +1 -0
  222. package/dist/openapi.cjs +213 -7
  223. package/dist/openapi.cjs.map +1 -0
  224. package/dist/openapi.d.cts +32 -8
  225. package/dist/openapi.d.cts.map +1 -1
  226. package/dist/openapi.d.mts +32 -8
  227. package/dist/openapi.d.mts.map +1 -1
  228. package/dist/openapi.mjs +208 -2
  229. package/dist/openapi.mjs.map +1 -0
  230. package/dist/projectBucket-B26ucBRI.mjs +222 -0
  231. package/dist/projectBucket-B26ucBRI.mjs.map +1 -0
  232. package/dist/projectBucket-CWpY3Vxv.cjs +263 -0
  233. package/dist/projectBucket-CWpY3Vxv.cjs.map +1 -0
  234. package/dist/provider-BqpjG9QM.cjs +57 -0
  235. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  236. package/dist/provider-CEOKk8NS.mjs +46 -0
  237. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  238. package/dist/publish-Bg4iffje.mjs +123 -0
  239. package/dist/publish-Bg4iffje.mjs.map +1 -0
  240. package/dist/publish-IjcRoorJ.cjs +124 -0
  241. package/dist/publish-IjcRoorJ.cjs.map +1 -0
  242. package/dist/ready-BjFMu_1J.mjs +375 -0
  243. package/dist/ready-BjFMu_1J.mjs.map +1 -0
  244. package/dist/ready-eVMJIcWn.cjs +404 -0
  245. package/dist/ready-eVMJIcWn.cjs.map +1 -0
  246. package/dist/reconcile/public.cjs +3 -5
  247. package/dist/reconcile/public.d.cts +33 -89
  248. package/dist/reconcile/public.d.cts.map +1 -1
  249. package/dist/reconcile/public.d.mts +33 -89
  250. package/dist/reconcile/public.d.mts.map +1 -1
  251. package/dist/reconcile/public.mjs +3 -3
  252. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  253. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  254. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  255. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  256. package/dist/resolve-CgVDhWW8.cjs +316 -0
  257. package/dist/resolve-CgVDhWW8.cjs.map +1 -0
  258. package/dist/resolve-rw7mLp5E.mjs +263 -0
  259. package/dist/resolve-rw7mLp5E.mjs.map +1 -0
  260. package/dist/rollback-Cv02Cnky.mjs +136 -0
  261. package/dist/rollback-Cv02Cnky.mjs.map +1 -0
  262. package/dist/rollback-vdkPi_Rm.cjs +165 -0
  263. package/dist/rollback-vdkPi_Rm.cjs.map +1 -0
  264. package/dist/runtime-D-rOcRoq.d.cts +82 -0
  265. package/dist/runtime-D-rOcRoq.d.cts.map +1 -0
  266. package/dist/runtime-DG1mNh_5.d.mts +82 -0
  267. package/dist/runtime-DG1mNh_5.d.mts.map +1 -0
  268. package/dist/s3-DIvAtJwk.cjs +240 -0
  269. package/dist/s3-DIvAtJwk.cjs.map +1 -0
  270. package/dist/s3-DmsM_V2R.mjs +240 -0
  271. package/dist/s3-DmsM_V2R.mjs.map +1 -0
  272. package/dist/sandbox/config-worker.cjs +43 -0
  273. package/dist/sandbox/config-worker.cjs.map +1 -0
  274. package/dist/sandbox/config-worker.d.cts +1 -0
  275. package/dist/sandbox/config-worker.d.mts +1 -0
  276. package/dist/sandbox/config-worker.mjs +44 -0
  277. package/dist/sandbox/config-worker.mjs.map +1 -0
  278. package/dist/sandbox/credentials-worker.cjs +53 -0
  279. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  280. package/dist/sandbox/credentials-worker.d.cts +1 -0
  281. package/dist/sandbox/credentials-worker.d.mts +1 -0
  282. package/dist/sandbox/credentials-worker.mjs +54 -0
  283. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  284. package/dist/sandbox/discover-worker.cjs +47 -0
  285. package/dist/sandbox/discover-worker.cjs.map +1 -0
  286. package/dist/sandbox/discover-worker.d.cts +1 -0
  287. package/dist/sandbox/discover-worker.d.mts +1 -0
  288. package/dist/sandbox/discover-worker.mjs +48 -0
  289. package/dist/sandbox/discover-worker.mjs.map +1 -0
  290. package/dist/sandbox/migrate-worker.cjs +75 -0
  291. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  292. package/dist/sandbox/migrate-worker.d.cts +1 -0
  293. package/dist/sandbox/migrate-worker.d.mts +1 -0
  294. package/dist/sandbox/migrate-worker.mjs +76 -0
  295. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  296. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  297. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  298. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  299. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  300. package/dist/secretsManager-CJyxFcBH.mjs +113 -0
  301. package/dist/secretsManager-CJyxFcBH.mjs.map +1 -0
  302. package/dist/secretsManager-D8on44WI.cjs +124 -0
  303. package/dist/secretsManager-D8on44WI.cjs.map +1 -0
  304. package/dist/seeds-D7q1zKCJ.cjs +369 -0
  305. package/dist/seeds-D7q1zKCJ.cjs.map +1 -0
  306. package/dist/seeds-y1rzXlAc.mjs +298 -0
  307. package/dist/seeds-y1rzXlAc.mjs.map +1 -0
  308. package/dist/serverSetup-CvcN4zJQ.mjs +685 -0
  309. package/dist/serverSetup-CvcN4zJQ.mjs.map +1 -0
  310. package/dist/serverSetup-qXIRRhgw.cjs +685 -0
  311. package/dist/serverSetup-qXIRRhgw.cjs.map +1 -0
  312. package/dist/sniffer-CGfL25Bc.cjs +1997 -0
  313. package/dist/sniffer-CGfL25Bc.cjs.map +1 -0
  314. package/dist/sniffer-DuKVVAs_.mjs +1824 -0
  315. package/dist/sniffer-DuKVVAs_.mjs.map +1 -0
  316. package/dist/snsSubscriptions-DPfGjpuB.cjs +1179 -0
  317. package/dist/snsSubscriptions-DPfGjpuB.cjs.map +1 -0
  318. package/dist/snsSubscriptions-nnSUW2Eh.mjs +1048 -0
  319. package/dist/snsSubscriptions-nnSUW2Eh.mjs.map +1 -0
  320. package/dist/sst-Bw7686br.mjs +478 -0
  321. package/dist/sst-Bw7686br.mjs.map +1 -0
  322. package/dist/sst-Md7c1UC_.cjs +501 -0
  323. package/dist/sst-Md7c1UC_.cjs.map +1 -0
  324. package/dist/stack-D2cLLaO-.mjs +2256 -0
  325. package/dist/stack-D2cLLaO-.mjs.map +1 -0
  326. package/dist/stack-DTcnynGb.cjs +2431 -0
  327. package/dist/stack-DTcnynGb.cjs.map +1 -0
  328. package/dist/stage-Bw3bJ7Au.mjs +302 -0
  329. package/dist/stage-Bw3bJ7Au.mjs.map +1 -0
  330. package/dist/stage-RLOenlHV.cjs +313 -0
  331. package/dist/stage-RLOenlHV.cjs.map +1 -0
  332. package/dist/stages-B0yOikgt.cjs +190 -0
  333. package/dist/stages-B0yOikgt.cjs.map +1 -0
  334. package/dist/stages-yA9bhStl.mjs +190 -0
  335. package/dist/stages-yA9bhStl.mjs.map +1 -0
  336. package/dist/target/public.cjs +15 -0
  337. package/dist/target/public.d.cts +28 -0
  338. package/dist/target/public.d.cts.map +1 -0
  339. package/dist/target/public.d.mts +28 -0
  340. package/dist/target/public.d.mts.map +1 -0
  341. package/dist/target/public.mjs +4 -0
  342. package/dist/terminal-C-_cMKTY.cjs +85 -0
  343. package/dist/terminal-C-_cMKTY.cjs.map +1 -0
  344. package/dist/terminal-Dq29bK3u.mjs +85 -0
  345. package/dist/terminal-Dq29bK3u.mjs.map +1 -0
  346. package/dist/types-Bl_CwZC9.cjs +90 -0
  347. package/dist/types-Bl_CwZC9.cjs.map +1 -0
  348. package/dist/{types-RhXmHR-e.d.cts → types-CvucX3yD.d.mts} +2163 -364
  349. package/dist/types-CvucX3yD.d.mts.map +1 -0
  350. package/dist/{types-kvBQjpPo.d.mts → types-D1C8pUyh.d.cts} +2165 -364
  351. package/dist/types-D1C8pUyh.d.cts.map +1 -0
  352. package/dist/types-Y1NfWlyG.mjs +61 -0
  353. package/dist/types-Y1NfWlyG.mjs.map +1 -0
  354. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  355. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  356. package/dist/utils-D_fxUqvU.mjs +156 -0
  357. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  358. package/dist/vitest.cjs +65 -0
  359. package/dist/vitest.cjs.map +1 -0
  360. package/dist/vitest.d.cts +29 -0
  361. package/dist/vitest.d.cts.map +1 -0
  362. package/dist/vitest.d.mts +29 -0
  363. package/dist/vitest.d.mts.map +1 -0
  364. package/dist/vitest.mjs +65 -0
  365. package/dist/vitest.mjs.map +1 -0
  366. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  367. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  368. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  369. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  370. package/dist/workspace/index.cjs +6 -2
  371. package/dist/workspace/index.d.cts +3 -3
  372. package/dist/workspace/index.d.mts +3 -3
  373. package/dist/workspace/index.mjs +2 -2
  374. package/dist/workspace-1szcahj9.cjs +2916 -0
  375. package/dist/workspace-1szcahj9.cjs.map +1 -0
  376. package/dist/workspace-DFGsrjGD.mjs +2480 -0
  377. package/dist/workspace-DFGsrjGD.mjs.map +1 -0
  378. package/package.json +65 -13
  379. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  380. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  381. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  382. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  383. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  384. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  385. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  386. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  387. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  388. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  389. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  390. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  391. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  392. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  393. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  394. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  395. package/dist/config-Q1rvKHvw.cjs +0 -467
  396. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  397. package/dist/config-pqGD3hF9.mjs +0 -414
  398. package/dist/config-pqGD3hF9.mjs.map +0 -1
  399. package/dist/config.d.cts.map +0 -1
  400. package/dist/config.d.mts.map +0 -1
  401. package/dist/credentials-BekkKtY_.mjs +0 -2780
  402. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  403. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  404. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  405. package/dist/discover-BERGFg8v.cjs +0 -288
  406. package/dist/discover-BERGFg8v.cjs.map +0 -1
  407. package/dist/discover-CK-n3w6b.mjs +0 -244
  408. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  409. package/dist/emit-BdoPFjZf.cjs +0 -253
  410. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  411. package/dist/emit-Bzq7JsMP.mjs +0 -224
  412. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  413. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  414. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  415. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  416. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  417. package/dist/generator-LfZU7NlU.mjs +0 -247
  418. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  419. package/dist/generator-Wdfp0jCS.cjs +0 -282
  420. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  421. package/dist/github-BfflNPVe.cjs +0 -203
  422. package/dist/github-BfflNPVe.cjs.map +0 -1
  423. package/dist/github-CRwnxKmD.mjs +0 -203
  424. package/dist/github-CRwnxKmD.mjs.map +0 -1
  425. package/dist/index-C-HkOEBt.d.cts.map +0 -1
  426. package/dist/index-C-VLwB_Y.d.mts.map +0 -1
  427. package/dist/keystore-B4PRlbgE.mjs +0 -81
  428. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  429. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  430. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  431. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  432. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  433. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  434. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  435. package/dist/storage-C-30BD1e.cjs +0 -272
  436. package/dist/storage-C-30BD1e.cjs.map +0 -1
  437. package/dist/storage-P_b3w7uj.mjs +0 -231
  438. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  439. package/dist/sync-B3xxXtJT.mjs +0 -88
  440. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  441. package/dist/sync-D7uTIIEi.cjs +0 -111
  442. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  443. package/dist/types-RhXmHR-e.d.cts.map +0 -1
  444. package/dist/types-kvBQjpPo.d.mts.map +0 -1
  445. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  446. package/dist/workspace-mFpI_ky_.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-B5Hi3mLK.cjs","names":["GkmError","isWildcardSite","appKey","WILDCARD_SUBDOMAIN","kebabCase","WILDCARD_SUBDOMAIN","dependenciesOf","existsSync","dirname","parse","join","GkmError","runWorker","AsyncLocalStorage","resolve","activeSandbox","isWorkspaceConfig","processConfig","allConstructGlobs","discover","sep","realpathSync","getAppGkmConfig"],"sources":["../src/workspace/subdomains.ts","../src/workspace/derive.ts","../src/config.ts"],"sourcesContent":["/**\n * The subdomains of a stage's domain, as a wildcard site sees them.\n *\n * A site declared `subdomain: '*'` answers on every label nothing else does,\n * so the labels something else does answer on are the ones a tenant can never\n * take. They come from two places and from nowhere else: every app's own\n * label, read off the constructs and never listed by hand, and the names no\n * construct declares (`www`, `mail`, `status`), listed once in the workspace\n * config as `protectedSubdomains`.\n */\n\nimport {\n\tkebabCase as appKey,\n\ttype ConstructManifest,\n\tisWildcardSite,\n\ttype SiteDeclaration,\n\tWILDCARD_SUBDOMAIN,\n} from '@geekmidas/manifest';\nimport { GkmError } from '../errors';\n\n/** A `protectedSubdomains` entry an app already answers on. */\nexport class ProtectedSubdomainIsAnApp extends GkmError {\n\tconstructor(\n\t\treadonly subdomain: string,\n\t\treadonly app: string,\n\t) {\n\t\tsuper(\n\t\t\t`protectedSubdomains lists '${subdomain}', which '${app}' already ` +\n\t\t\t\t`answers on — a construct's own subdomain is protected without ` +\n\t\t\t\t`being listed. Remove it from protectedSubdomains.`,\n\t\t);\n\t\tthis.name = 'ProtectedSubdomainIsAnApp';\n\t}\n}\n\n/** Two sites that both answer on every subdomain. */\nexport class SecondWildcardSite extends GkmError {\n\tconstructor(readonly sites: readonly string[]) {\n\t\tsuper(\n\t\t\t`${sites.join(' and ')} both declare subdomain: '*', and two sites ` +\n\t\t\t\t`cannot share the same hosts. Keep one wildcard site per project; ` +\n\t\t\t\t`give the other a subdomain of its own.`,\n\t\t);\n\t\tthis.name = 'SecondWildcardSite';\n\t}\n}\n\n/** A wildcard site whose `hosts` route is on no surface the project declares. */\nexport class SiteHostsEndpointMissing extends GkmError {\n\tconstructor(\n\t\treadonly site: string,\n\t\treadonly surface: string,\n\t\treadonly path: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${site}' checks its hosts with GET ${path} on '${surface}', but ` +\n\t\t\t\t`'${surface}' serves no such route. Export the endpoint from the ` +\n\t\t\t\t`surface's endpoints, or point \\`hosts\\` at one it serves.`,\n\t\t);\n\t\tthis.name = 'SiteHostsEndpointMissing';\n\t}\n}\n\n/** The project's one wildcard site, or `undefined` when it has none. */\nexport function wildcardSite(\n\tmanifest: ConstructManifest,\n): SiteDeclaration | undefined {\n\treturn Object.values(manifest).find(isWildcardSite);\n}\n\n/**\n * Every label an app answers on, by the app it belongs to — what a deploy\n * puts under the stage's domain: a surface's or site's `subdomain` (or its id\n * kebab-cased), each file server and its processors' origin, and each worker,\n * which SNS may push to on a host of its own.\n *\n * The root site's is kept although it answers on the domain itself: which\n * site is the root can change without a tenant's slug changing meaning. The\n * wildcard site has none — its labels are whatever is left.\n */\nexport function appSubdomains(\n\tmanifest: ConstructManifest,\n): Map<string, string> {\n\tconst labels = new Map<string, string>();\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\tswitch (declaration.kind) {\n\t\t\tcase 'rest-api':\n\t\t\tcase 'websocket-api':\n\t\t\t\tlabels.set(declaration.subdomain ?? appKey(id), id);\n\t\t\t\tbreak;\n\t\t\tcase 'site':\n\t\t\t\tif (declaration.subdomain === WILDCARD_SUBDOMAIN) break;\n\t\t\t\tlabels.set(declaration.subdomain ?? appKey(id), id);\n\t\t\t\tbreak;\n\t\t\tcase 'file-server':\n\t\t\t\tlabels.set(appKey(id), id);\n\t\t\t\tif (declaration.processors?.length) {\n\t\t\t\t\tlabels.set(`${appKey(id)}-processors`, id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'worker':\n\t\t\t\tlabels.set(appKey(id), id);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn labels;\n}\n\n/**\n * The labels no tenant may take: every app's own and the workspace's\n * `protectedSubdomains`, sorted.\n */\nexport function protectedSubdomains(\n\tmanifest: ConstructManifest,\n\tconfigured: readonly string[] = [],\n): string[] {\n\treturn [\n\t\t...new Set([...appSubdomains(manifest).keys(), ...configured]),\n\t].sort();\n}\n\n/**\n * What a project's subdomains have to satisfy before anything is derived\n * from them.\n *\n * @throws {SecondWildcardSite} when two sites declare `subdomain: '*'`\n * @throws {SiteHostsEndpointMissing} when the wildcard site's `hosts` route is not served\n * @throws {ProtectedSubdomainIsAnApp} when `protectedSubdomains` repeats an app's own\n */\nexport function assertSubdomains(\n\tmanifest: ConstructManifest,\n\tconfigured: readonly string[] = [],\n): void {\n\tconst wildcards = Object.values(manifest).filter(isWildcardSite);\n\tif (wildcards.length > 1) {\n\t\tthrow new SecondWildcardSite(wildcards.map((site) => site.id).sort());\n\t}\n\n\tconst site = wildcards[0];\n\tif (site?.hosts) {\n\t\tconst surface = manifest[site.hosts.surface];\n\t\t// Every endpoint is in the surface's node, as discovery nested it.\n\t\tconst served =\n\t\t\tsurface?.kind === 'rest-api' &&\n\t\t\tsurface.endpoints.some(\n\t\t\t\t(endpoint) =>\n\t\t\t\t\tendpoint.method.toUpperCase() === 'GET' &&\n\t\t\t\t\tendpoint.path === site.hosts?.path,\n\t\t\t);\n\t\tif (!served) {\n\t\t\tthrow new SiteHostsEndpointMissing(\n\t\t\t\tsite.id,\n\t\t\t\tsite.hosts.surface,\n\t\t\t\tsite.hosts.path,\n\t\t\t);\n\t\t}\n\t}\n\n\tconst labels = appSubdomains(manifest);\n\tfor (const subdomain of configured) {\n\t\tconst app = labels.get(subdomain);\n\t\tif (app) throw new ProtectedSubdomainIsAnApp(subdomain, app);\n\t}\n}\n","/**\n * The apps a manifest implies.\n *\n * `gkm.config.ts` used to carry an `apps` block naming every app: its type, its\n * path, its port, its framework, which other apps it depended on. Every one of\n * those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`\n * and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',\n * dependencies: ['api'] }` are the same statement written twice, and only one of\n * them was checked against anything — so the copy in config was free to drift,\n * and a surface config had no entry for simply never deployed.\n *\n * So the list comes from the graph. A `site` is an app, and so is every\n * `rest-api` — one surface, one container, at the `path` it declared.\n *\n * What config still supplies is what no graph can answer: the backends a cache\n * and a mailer resolve to, the deploy endpoint, the stage's domain.\n */\n\nimport {\n\ttype AppSpec,\n\ttype ConstructManifest,\n\tdependenciesOf,\n\tkebabCase,\n\tWILDCARD_SUBDOMAIN,\n} from '@geekmidas/manifest';\nimport { assertSubdomains } from './subdomains.js';\nimport type {\n\tAppDomainConfig,\n\tDeployTargetName,\n\tFramework,\n\tNormalizedAppConfig,\n\tNormalizedWorkspace,\n} from './types.js';\n\n/** Which frontend framework builds each site variant. */\nconst FRAMEWORKS: Record<string, Framework> = {\n\tstatic: 'vite',\n\tnext: 'nextjs',\n\ttanstack: 'tanstack-start',\n};\n\n/**\n * The app key a construct id becomes.\n *\n * The same kebab form every physical name is built from, so `Api` is `api` in\n * the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an\n * environment — one id, three renderings, no second list.\n */\nexport function appKey(id: string): string {\n\treturn kebabCase(id);\n}\n\n/**\n * The app serving a surface: its own, always.\n *\n * Every surface gets a container. There is no arrangement in which one runs\n * inside another — two surfaces in a process share a filesystem, an\n * environment, and every credential either was granted, so an auth server\n * beside an API is one bug in the API away from being read by it.\n */\nexport function hostOf(\n\tmanifest: ConstructManifest,\n\tid: string,\n): string | undefined {\n\tconst declaration = manifest[id];\n\tif (\n\t\t!declaration ||\n\t\t(declaration.kind !== 'rest-api' && declaration.kind !== 'websocket-api')\n\t)\n\t\treturn undefined;\n\n\treturn id;\n}\n\n/**\n * Local ports, assigned so that adding a site does not renumber the others.\n *\n * Backends first, then the site holding the base domain, then the rest\n * alphabetically. The ordering is arbitrary but it is *fixed*, which is the\n * property that matters: a port that moves when an unrelated app is added is a\n * port nobody can put in a bookmark. A construct that names its own port keeps\n * it, and is skipped here.\n */\nfunction assignPorts(apps: Record<string, NormalizedAppConfig>): void {\n\tconst rank = (\n\t\tname: string,\n\t\tapp: NormalizedAppConfig,\n\t): [number, number, string] => [\n\t\tapp.type === 'backend' ? 0 : app.type === 'web' ? 1 : 2,\n\t\tapp.root ? 0 : 1,\n\t\tname,\n\t];\n\n\tconst ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {\n\t\tconst [at, ar, an] = rank(aName, a);\n\t\tconst [bt, br, bn] = rank(bName, b);\n\t\treturn at - bt || ar - br || an.localeCompare(bn);\n\t});\n\n\tconst taken = new Set(\n\t\tordered.map(([, app]) => app.port).filter((p): p is number => !!p),\n\t);\n\n\tlet next = 3000;\n\tfor (const [, app] of ordered) {\n\t\tif (app.port) continue;\n\t\twhile (taken.has(next)) next += 1;\n\t\tapp.port = next;\n\t\ttaken.add(next);\n\t}\n}\n\n/**\n * Whichever site holds the base domain.\n *\n * The convention first — a site named `web` — because it is one people already\n * rely on. Then an explicit `root: true`. A project with one site needs neither.\n */\nfunction markRoot(apps: Record<string, NormalizedAppConfig>): void {\n\t// A wildcard site answers on every subdomain, never on the domain itself.\n\tconst sites = Object.entries(apps).filter(\n\t\t([, a]) => a.type === 'web' && a.subdomain !== WILDCARD_SUBDOMAIN,\n\t);\n\tif (sites.length === 0) return;\n\tif (sites.some(([, a]) => a.root)) return;\n\n\tconst chosen =\n\t\tsites.find(([name]) => name === 'web') ??\n\t\t(sites.length === 1 ? sites[0] : undefined);\n\tif (chosen) chosen[1].root = true;\n}\n\nexport function derivedApps(\n\tmanifest: ConstructManifest,\n\tworkspace: NormalizedWorkspace,\n): Record<string, NormalizedAppConfig> {\n\tassertSubdomains(manifest, workspace.protectedSubdomains);\n\n\tconst apps: Record<string, NormalizedAppConfig> = {};\n\tconst defaultTarget: DeployTargetName =\n\t\tworkspace.deploy?.default ?? 'dokploy';\n\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\t// Three kinds are apps: a site, a mobile app and an HTTP surface. A worker\n\t\t// is not one — it names the process that runs a cron or a subscriber, and\n\t\t// that process is the app's server, which already exists. Everything else\n\t\t// is a resource one of them uses.\n\t\tif (\n\t\t\tdeclaration.kind !== 'site' &&\n\t\t\tdeclaration.kind !== 'mobile-app' &&\n\t\t\tdeclaration.kind !== 'rest-api' &&\n\t\t\tdeclaration.kind !== 'websocket-api'\n\t\t)\n\t\t\tcontinue;\n\n\t\t// No opt-in to be had. Each says where it lives.\n\t\tconst spec: AppSpec =\n\t\t\tdeclaration.kind === 'site' || declaration.kind === 'mobile-app'\n\t\t\t\t? declaration.app\n\t\t\t\t: {\n\t\t\t\t\t\tpath: declaration.path,\n\t\t\t\t\t\t...(declaration.kind === 'rest-api' && declaration.telescope\n\t\t\t\t\t\t\t? { telescope: true }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t};\n\n\t\tconst name = appKey(id);\n\t\t// A config entry of the same name still wins, so a workspace can override\n\t\t// one field without restating the app. Nothing in this repo needs to.\n\t\tconst configured = workspace.apps[name];\n\n\t\tapps[name] = {\n\t\t\t...configured,\n\t\t\ttype:\n\t\t\t\tdeclaration.kind === 'site'\n\t\t\t\t\t? 'web'\n\t\t\t\t\t: declaration.kind === 'mobile-app'\n\t\t\t\t\t\t? 'mobile'\n\t\t\t\t\t\t: 'backend',\n\t\t\tpath: spec.path,\n\t\t\tport: spec.port ?? configured?.port ?? 0,\n\t\t\t// The label it answers on, under a stage's domain and locally alike.\n\t\t\t...((declaration.kind === 'rest-api' ||\n\t\t\t\tdeclaration.kind === 'websocket-api' ||\n\t\t\t\tdeclaration.kind === 'site') &&\n\t\t\tdeclaration.subdomain\n\t\t\t\t? { subdomain: declaration.subdomain }\n\t\t\t\t: {}),\n\t\t\tdependencies: [],\n\t\t\tresolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,\n\t\t\t...(declaration.kind === 'site'\n\t\t\t\t? {\n\t\t\t\t\t\tframework: configured?.framework ?? FRAMEWORKS[declaration.variant],\n\t\t\t\t\t\t...(declaration.root ? { root: true } : {}),\n\t\t\t\t\t\t...(spec.config ? { config: spec.config } : {}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t...(declaration.kind === 'mobile-app'\n\t\t\t\t? {\n\t\t\t\t\t\tframework: configured?.framework ?? declaration.variant,\n\t\t\t\t\t\t...(spec.config ? { config: spec.config } : {}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t// One glob fans out to the six the build reads, because each generator\n\t\t\t// already inspects every export and keeps what it recognises. A\n\t\t\t// per-kind field still wins where one was given.\n\t\t\t...(spec.telescope !== undefined ? { telescope: spec.telescope } : {}),\n\t\t\t...(spec.openapi !== undefined ? { openapi: spec.openapi } : {}),\n\t\t\t...(spec.runtime !== undefined ? { runtime: spec.runtime } : {}),\n\t\t\t...(spec.env !== undefined ? { env: spec.env } : {}),\n\t\t\t...(spec.entry !== undefined ? { entry: spec.entry } : {}),\n\t\t\t...(configured?.domain\n\t\t\t\t? { domain: configured.domain as AppDomainConfig }\n\t\t\t\t: {}),\n\t\t} as NormalizedAppConfig;\n\t}\n\n\t// Build order, from the edges rather than from a hand-kept list. A site that\n\t// depends on a surface depends on the app that serves it — which for a\n\t// mounted auth server is its host, not a container that does not exist.\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\tif (\n\t\t\tdeclaration.kind !== 'site' &&\n\t\t\tdeclaration.kind !== 'mobile-app' &&\n\t\t\tdeclaration.kind !== 'rest-api' &&\n\t\t\tdeclaration.kind !== 'websocket-api'\n\t\t)\n\t\t\tcontinue;\n\n\t\tconst app = apps[appKey(id)];\n\t\tif (!app) continue;\n\n\t\t// Every edge it has: a site's own, a surface's authenticator and its\n\t\t// routes' — the same graph every other reader sees.\n\t\tconst edges = dependenciesOf(declaration);\n\n\t\tconst names = new Set<string>();\n\t\tfor (const edge of edges) {\n\t\t\tif (edge.kind !== 'rest-api') continue;\n\t\t\tconst host = hostOf(manifest, edge.target);\n\t\t\tif (!host) continue;\n\t\t\tconst key = appKey(host);\n\t\t\tif (key !== appKey(id) && apps[key]) names.add(key);\n\t\t}\n\n\t\tapp.dependencies = [...names].sort();\n\t}\n\n\tmarkRoot(apps);\n\tassignPorts(apps);\n\n\t// Apps config declared that the graph knows nothing about — a `type: 'mobile'`\n\t// entry, or a hand-run process. Kept rather than dropped: config is still the\n\t// escape hatch for what nothing declares.\n\tfor (const [name, app] of Object.entries(workspace.apps)) {\n\t\tif (!apps[name]) apps[name] = app;\n\t}\n\n\treturn apps;\n}\n","import { AsyncLocalStorage } from 'node:async_hooks';\nimport { existsSync, realpathSync } from 'node:fs';\nimport { dirname, join, parse, resolve, sep } from 'node:path';\nimport { z } from 'zod';\nimport { GkmError } from './errors';\nimport { output } from './output.js';\nimport { discover } from './reconcile/discover.js';\nimport { activeSandbox, type Sandbox } from './sandbox/sandbox.js';\nimport { runWorker } from './sandbox/worker.js';\nimport type { GkmConfig } from './types.js';\nimport { derivedApps } from './workspace/derive.js';\nimport {\n\tallConstructGlobs,\n\tgetAppGkmConfig,\n\tisWorkspaceConfig,\n\ttype LoadedConfig,\n\ttype NormalizedAppConfig,\n\ttype NormalizedWorkspace,\n\tprocessConfig,\n\ttype WorkspaceConfig,\n} from './workspace/index.js';\n\n// What `gkm dev`'s discovery endpoint answers, for the tools that read it.\nexport type {\n\tAppStatus,\n\tDataApiKind,\n\tDiscoveredApp,\n\tDiscoveredDataApi,\n\tDiscoveredWorkspace,\n\tDiscoveryEvent,\n\tDiscoveryResponse,\n} from './dev/discovery.js';\nexport type { GkmConfig } from './types.js';\nexport type { LoadedConfig, WorkspaceConfig } from './workspace/index.js';\nexport { defineWorkspace } from './workspace/index.js';\nexport type { DevConfig } from './workspace/types.js';\n/**\n * Define GKM configuration with full TypeScript support.\n * This is an identity function that provides type safety and autocomplete.\n *\n * @example\n * ```ts\n * // gkm.config.ts\n * import { defineConfig } from '@geekmidas/cli/config';\n *\n * export default defineConfig({\n * routes: './src/endpoints/**\\/*.ts',\n * envParser: './src/config/env',\n * logger: './src/config/logger',\n * telescope: true,\n * });\n * ```\n */\nexport function defineConfig(config: GkmConfig): GkmConfig {\n\treturn config;\n}\n\nexport interface ParsedModuleConfig {\n\tpath: string;\n\timportPattern: string;\n}\n\n/**\n * Parse a module config string into path and import pattern.\n *\n * @param configString - Config string in format \"./path/to/module\" or \"./path/to/module#exportName\"\n * @param defaultAlias - The default alias name to use if no export name specified\n * @returns Object with path and import pattern\n *\n * @example\n * parseModuleConfig('./src/config/env', 'envParser')\n * // { path: './src/config/env', importPattern: 'envParser' }\n *\n * parseModuleConfig('./src/config/env#envParser', 'envParser')\n * // { path: './src/config/env', importPattern: '{ envParser }' }\n *\n * parseModuleConfig('./src/config/env#myEnv', 'envParser')\n * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }\n */\nexport function parseModuleConfig(\n\tconfigString: string,\n\tdefaultAlias: string,\n): ParsedModuleConfig {\n\tconst parts = configString.split('#');\n\tconst path = parts[0] ?? configString;\n\tconst exportName = parts[1];\n\tconst importPattern = !exportName\n\t\t? defaultAlias\n\t\t: exportName === defaultAlias\n\t\t\t? `{ ${defaultAlias} }`\n\t\t\t: `{ ${exportName} as ${defaultAlias} }`;\n\n\treturn { path, importPattern };\n}\n\nexport interface ConfigDiscoveryResult {\n\tconfigPath: string;\n\tworkspaceRoot: string;\n}\n\n/**\n * Find and return the path to the config file.\n *\n * Resolution order:\n * 1. GKM_CONFIG_PATH env var (set by workspace dev command)\n * 2. Walk up directory tree from cwd\n */\nfunction findConfigPath(cwd: string): ConfigDiscoveryResult {\n\tconst files = ['gkm.config.json', 'gkm.config.ts', 'gkm.config.js'];\n\n\t// Check GKM_CONFIG_PATH env var first (set by workspace dev command)\n\tconst envConfigPath = process.env.GKM_CONFIG_PATH;\n\tif (envConfigPath && existsSync(envConfigPath)) {\n\t\treturn {\n\t\t\tconfigPath: envConfigPath,\n\t\t\tworkspaceRoot: dirname(envConfigPath),\n\t\t};\n\t}\n\n\t// Walk up directory tree to find config\n\tlet currentDir = cwd;\n\tconst { root } = parse(currentDir);\n\n\twhile (currentDir !== root) {\n\t\tfor (const file of files) {\n\t\t\tconst configPath = join(currentDir, file);\n\t\t\tif (existsSync(configPath)) {\n\t\t\t\treturn {\n\t\t\t\t\tconfigPath,\n\t\t\t\t\tworkspaceRoot: currentDir,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tcurrentDir = dirname(currentDir);\n\t}\n\n\tthrow new ConfigNotFound(cwd);\n}\n\n/**\n * The directory holding the gkm config that `cwd` belongs to — the project a\n * sandbox for it is confined to.\n *\n * @throws {ConfigNotFound} when neither `cwd` nor any parent has one.\n */\nexport function findWorkspaceRoot(cwd: string): string {\n\treturn findConfigPath(cwd).workspaceRoot;\n}\n\n/** No gkm config in a directory or any of its parents. */\nexport class ConfigNotFound extends GkmError {\n\tconstructor(readonly cwd: string) {\n\t\tsuper(\n\t\t\t'Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.',\n\t\t);\n\t\tthis.name = 'ConfigNotFound';\n\t}\n}\n\nexport interface RawConfigResult {\n\tconfig: GkmConfig | WorkspaceConfig;\n\tworkspaceRoot: string;\n}\n\nexport interface LoadConfigOptions {\n\t/**\n\t * Load the config — and discover the constructs it names — in this\n\t * sandbox rather than in this process. The config then arrives as data;\n\t * see {@link Sandbox.isolating} for what happens to one holding live\n\t * objects. Defaults to the run's own (`withSandbox`); with neither, the\n\t * config is imported here, as `gkm` always has.\n\t */\n\tsandbox?: Sandbox;\n\t/**\n\t * How long the sandboxed config load may run. Defaults to\n\t * {@link CONFIG_LOAD_TIMEOUT_MS}.\n\t */\n\ttimeoutMs?: number;\n}\n\n/**\n * How long loading a config, or discovering its constructs, may take in a\n * sandbox: room for tsx to compile a large project cold, and not a deploy\n * held open by a config that never finishes importing.\n */\nexport const CONFIG_LOAD_TIMEOUT_MS = 60_000;\n\n/** The config failed to import, or threw while it ran. */\nexport class ConfigLoadFailed extends Error {\n\tconstructor(\n\t\treadonly configPath: string,\n\t\treadonly detail: string,\n\t) {\n\t\tsuper(`Failed to load config: ${detail}`);\n\t\tthis.name = 'ConfigLoadFailed';\n\t}\n}\n\n/**\n * The config holds something that is not data — a custom state store, an\n * inline deploy target, a function — and the sandbox it was loaded in hands\n * the deploy nothing but data.\n */\nexport class ConfigObjectNotSerializable extends Error {\n\tconstructor(\n\t\treadonly configPath: string,\n\t\treadonly paths: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`${configPath} holds values that are not plain data at: ` +\n\t\t\t\t`${paths.join(', ')}. It was loaded in an isolating sandbox, which ` +\n\t\t\t\t'hands the deploy the config as JSON, so a live object — a custom ' +\n\t\t\t\t'store, an inline target, a function — cannot reach it. Configure ' +\n\t\t\t\t'these with plain values instead, or deploy this project with a ' +\n\t\t\t\t'sandbox that is not isolating (the default) if the host trusts it.',\n\t\t);\n\t\tthis.name = 'ConfigObjectNotSerializable';\n\t}\n}\n\n/** What the config worker answers. Checked: the worker ran project code. */\nconst ConfigAnswer = z.discriminatedUnion('reason', [\n\tz.object({\n\t\treason: z.literal('loaded'),\n\t\tconfig: z.record(z.string(), z.unknown()),\n\t}),\n\tz.object({ reason: z.literal('live'), paths: z.array(z.string()) }),\n\tz.object({\n\t\treason: z.literal('failed'),\n\t\terror: z.object({ name: z.string(), message: z.string() }),\n\t}),\n]);\n\n/** Import the config in this process — live objects and all. */\nasync function importConfig(\n\tconfigPath: string,\n): Promise<GkmConfig | WorkspaceConfig> {\n\ttry {\n\t\tconst config = await import(configPath);\n\t\treturn config.default;\n\t} catch (error) {\n\t\tthrow new ConfigLoadFailed(configPath, (error as Error).message);\n\t}\n}\n\n/**\n * The config, loaded in `sandbox` and handed back as JSON.\n *\n * A config holding live objects cannot come back that way. An isolating\n * sandbox refuses it with {@link ConfigObjectNotSerializable}; any other\n * imports it here as well, as before, since the host already runs this\n * project's code as its own.\n */\nasync function loadConfigInSandbox(\n\tsandbox: Sandbox,\n\tconfigPath: string,\n\tworkspaceRoot: string,\n\ttimeoutMs = CONFIG_LOAD_TIMEOUT_MS,\n): Promise<GkmConfig | WorkspaceConfig> {\n\tconst { value } = await runWorker(sandbox, 'config load', {\n\t\tname: 'config-worker',\n\t\targs: [configPath],\n\t\tcwd: workspaceRoot,\n\t\ttimeoutMs,\n\t\tschema: ConfigAnswer,\n\t});\n\n\tswitch (value.reason) {\n\t\tcase 'loaded':\n\t\t\t// Its shape is `processConfig`'s to check, against the workspace\n\t\t\t// schema, exactly as for a config imported here.\n\t\t\treturn value.config as unknown as GkmConfig | WorkspaceConfig;\n\t\tcase 'failed':\n\t\t\tthrow new ConfigLoadFailed(configPath, value.error.message);\n\t\tcase 'live':\n\t\t\tif (sandbox.isolating) {\n\t\t\t\tthrow new ConfigObjectNotSerializable(configPath, value.paths);\n\t\t\t}\n\t\t\treturn importConfig(configPath);\n\t}\n}\n\n/** A run's config, as its caller already loaded it (`withLoadedConfig`). */\ninterface LoadedRun {\n\tworkspaceRoot: string;\n\tconfig: GkmConfig | WorkspaceConfig;\n}\n\nconst loadedRun = new AsyncLocalStorage<LoadedRun>();\n\n/**\n * Run `fn` with `config` as the config of the workspace at `workspaceRoot`:\n * every load of it inside — however deep, sandboxed or not — answers with\n * this one rather than importing the file again.\n *\n * A config is the workspace's settings, and settings may come from the\n * environment it was loaded in (`domains: { prod: process.env.DOMAIN }`). A\n * reload in a sandbox, which passes on an allowlist of the environment, read\n * the same file to a different answer: the deploy saw no domain the command\n * had been given. Loaded once by the caller, every step of the run sees the\n * same settings. The constructs are still discovered in the run's sandbox.\n */\nexport function withLoadedConfig<T>(\n\tworkspaceRoot: string,\n\tconfig: GkmConfig | WorkspaceConfig,\n\tfn: () => T,\n): T {\n\treturn loadedRun.run({ workspaceRoot: resolve(workspaceRoot), config }, fn);\n}\n\n/**\n * The raw config of the workspace a directory belongs to, imported in this\n * process: what a caller hands {@link withLoadedConfig}, or `deploy()` as its\n * `config`.\n */\nexport async function loadRawWorkspaceConfig(\n\tcwd: string = process.cwd(),\n): Promise<RawConfigResult> {\n\tconst { configPath, workspaceRoot } = findConfigPath(cwd);\n\treturn { config: await importConfig(configPath), workspaceRoot };\n}\n\n/**\n * Load raw configuration from file.\n */\nasync function loadRawConfig(\n\tcwd: string,\n\toptions: LoadConfigOptions = {},\n): Promise<RawConfigResult> {\n\tconst { configPath, workspaceRoot } = findConfigPath(cwd);\n\tconst loaded = loadedRun.getStore();\n\tif (loaded && loaded.workspaceRoot === resolve(workspaceRoot)) {\n\t\treturn { config: loaded.config, workspaceRoot };\n\t}\n\t// The run's own sandbox when none is given: a deploy reloads the config\n\t// deep in the engine (generating Dockerfiles), and that load is the\n\t// project's code as much as the first.\n\tconst sandbox = options.sandbox ?? activeSandbox();\n\tconst config = sandbox\n\t\t? await loadConfigInSandbox(\n\t\t\t\tsandbox,\n\t\t\t\tconfigPath,\n\t\t\t\tworkspaceRoot,\n\t\t\t\toptions.timeoutMs,\n\t\t\t)\n\t\t: await importConfig(configPath);\n\n\treturn { config, workspaceRoot };\n}\n\n/**\n * Load configuration file (single-app format).\n * For backwards compatibility with existing code.\n *\n * @deprecated Use loadWorkspaceConfig for new code\n */\nexport async function loadConfig(\n\tcwd: string = process.cwd(),\n): Promise<GkmConfig> {\n\tconst { config } = await loadRawConfig(cwd);\n\n\t// If it's a workspace config, throw an error\n\tif (isWorkspaceConfig(config)) {\n\t\tthrow new Error(\n\t\t\t'Workspace configuration detected. Use loadWorkspaceConfig() instead.',\n\t\t);\n\t}\n\n\treturn config;\n}\n\n/**\n * Load configuration file and process it as a workspace.\n * Works with both single-app and workspace configurations.\n *\n * Single-app configs are automatically wrapped as a workspace with one app.\n *\n * @example\n * ```ts\n * const { type, workspace } = await loadWorkspaceConfig();\n *\n * if (type === 'workspace') {\n * console.log('Multi-app workspace:', workspace.apps);\n * } else {\n * console.log('Single app wrapped as workspace');\n * }\n * ```\n */\n/**\n * The workspace a directory belongs to, as its config states it — without\n * discovering its constructs.\n *\n * For callers that need a fact the config holds (where a stage's secrets are\n * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every\n * construct module to derive the apps, which is a cost a secrets read should\n * not pay.\n */\nexport async function loadWorkspaceSettings(\n\tcwd: string = process.cwd(),\n\toptions: LoadConfigOptions = {},\n): Promise<LoadedConfig['workspace']> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd, options);\n\treturn processConfig(config, workspaceRoot).workspace;\n}\n\nexport async function loadWorkspaceConfig(\n\tcwd: string = process.cwd(),\n\toptions: LoadConfigOptions = {},\n): Promise<LoadedConfig> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd, options);\n\treturn withDerivedApps(processConfig(config, workspaceRoot), options.sandbox);\n}\n\n/**\n * The loaded config, with its apps read off the graph.\n *\n * Here rather than at each call site because every command needs the same\n * answer, and the ones that forgot to ask were exactly the bugs: a site that\n * never deployed, a surface that could not be its own process. `gkm dev`,\n * `gkm build`, `gkm docker` and `gkm deploy` now all see the same apps without\n * any of them knowing a derivation happened.\n *\n * Discovery imports the construct modules — declarations only, not endpoints —\n * which is the same import the reconciler and the build already do. A workspace\n * with no `constructs` glob discovers nothing and keeps whatever its config\n * said, so nothing that worked before changes.\n *\n * A construct file that throws is reported and skipped rather than taking the\n * command down: `gkm dev` failing to start because a half-written declaration\n * cannot be imported is a worse failure than starting with the app it does not\n * describe yet.\n */\nasync function withDerivedApps(\n\tloaded: LoadedConfig,\n\tsandbox?: Sandbox,\n): Promise<LoadedConfig> {\n\tconst globs = allConstructGlobs(loaded.workspace);\n\tif (globs.length === 0) {\n\t\tthrow new WorkspaceDeclaresNoConstructs(loaded.workspace.root);\n\t}\n\n\ttry {\n\t\tconst background: Record<string, string[]> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: globs,\n\t\t\tcwd: loaded.workspace.root,\n\t\t\tbackground,\n\t\t\t...(sandbox ? { sandbox } : {}),\n\t\t});\n\n\t\treturn {\n\t\t\t...loaded,\n\t\t\tmanifest,\n\t\t\tbackground,\n\t\t\tworkspace: {\n\t\t\t\t...loaded.workspace,\n\t\t\t\tapps: derivedApps(manifest, loaded.workspace),\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\toutput.warn(\n\t\t\t`⚠️ Could not read constructs, so apps come from config alone: ${message}`,\n\t\t);\n\t\treturn loaded;\n\t}\n}\n\n/**\n * A workspace with no `constructs` glob.\n *\n * In v10 every address, container and app comes from what the workspace\n * declares — there is no second path that reads a hand-written compose file or\n * an `apps` block's ports. A config that declares nothing has nothing to run.\n */\nexport class WorkspaceDeclaresNoConstructs extends GkmError {\n\tconstructor(readonly root: string) {\n\t\tsuper(\n\t\t\t`The workspace at ${root} declares no constructs. Every workspace names ` +\n\t\t\t\t\"where its constructs live — `constructs: ['./constructs/**/*.ts', \" +\n\t\t\t\t\"'./apps/*/endpoints/**/*.ts']` in gkm.config.ts — and its apps, \" +\n\t\t\t\t'containers and URLs are derived from them.',\n\t\t);\n\t\tthis.name = 'WorkspaceDeclaresNoConstructs';\n\t}\n}\n\nexport interface AppConfigResult {\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tgkmConfig: GkmConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n\tappRoot: string;\n}\n\n/**\n * The app a directory is part of: the one whose `path` contains it.\n *\n * An app's path is the one its construct declares — `new RestApi('Api',\n * { path: 'apps/api' })` — read off the workspace the constructs were derived\n * into, never off the filesystem's package names. The deepest match wins, so\n * an app inside another app's folder is its own; the workspace root belongs to\n * no app unless one lives there.\n */\nfunction resolveWorkspaceApp(\n\tloadedConfig: LoadedConfig,\n\tcwd: string,\n): { key: string; app: NormalizedAppConfig } | undefined {\n\tconst here = real(cwd);\n\tlet found: { key: string; app: NormalizedAppConfig; dir: string } | undefined;\n\n\tfor (const [key, app] of Object.entries(loadedConfig.workspace.apps)) {\n\t\tconst dir = real(join(loadedConfig.workspace.root, app.path));\n\t\tconst inside = here === dir || here.startsWith(`${dir}${sep}`);\n\t\tif (inside && (!found || dir.length > found.dir.length)) {\n\t\t\tfound = { key, app, dir };\n\t\t}\n\t}\n\n\treturn found && { key: found.key, app: found.app };\n}\n\n/** A path with its symlinks resolved, where it exists — `/tmp` is `/private/tmp`. */\nfunction real(path: string): string {\n\tconst absolute = resolve(path);\n\treturn existsSync(absolute) ? realpathSync(absolute) : absolute;\n}\n\n/** A directory that no app in the workspace lives in. */\nexport class NotInAnApp extends GkmError {\n\tconstructor(\n\t\treadonly cwd: string,\n\t\treadonly apps: Readonly<Record<string, string>>,\n\t) {\n\t\tsuper(\n\t\t\t`${cwd} is not inside any app's path. Apps: ` +\n\t\t\t\tObject.entries(apps)\n\t\t\t\t\t.map(([key, path]) => `${key} (${path})`)\n\t\t\t\t\t.join(', ') +\n\t\t\t\t'.',\n\t\t);\n\t\tthis.name = 'NotInAnApp';\n\t}\n}\n\n/** Every app's path, by key — what `NotInAnApp` lists. */\nfunction appPaths(loadedConfig: LoadedConfig): Record<string, string> {\n\treturn Object.fromEntries(\n\t\tObject.entries(loadedConfig.workspace.apps).map(([key, app]) => [\n\t\t\tkey,\n\t\t\tapp.path,\n\t\t]),\n\t);\n}\n\n/**\n * The backend app a directory is part of, with its gkm config — found by the\n * `path` its construct declares.\n *\n * @example\n * ```ts\n * // From apps/api, where a construct declares `path: 'apps/api'`\n * const { app, workspace, workspaceRoot } = await loadAppConfig();\n * ```\n *\n * @throws {NotInAnApp} when no app's path contains the directory.\n * @throws {NotABackendApp} when the app it is in has no gkm config to run.\n */\nexport async function loadAppConfig(\n\tcwd: string = process.cwd(),\n): Promise<AppConfigResult> {\n\tconst { appName, app, workspace, workspaceRoot } =\n\t\tawait loadWorkspaceAppInfo(cwd);\n\n\tconst gkmConfig = getAppGkmConfig(workspace, appName);\n\tif (!gkmConfig) throw new NotABackendApp(appName);\n\n\treturn {\n\t\tappName,\n\t\tapp,\n\t\tgkmConfig,\n\t\tworkspace,\n\t\tworkspaceRoot,\n\t\tappRoot: join(workspaceRoot, app.path),\n\t};\n}\n\n/** The app a directory is in has no gkm config — a site, or an entry app. */\nexport class NotABackendApp extends GkmError {\n\tconstructor(readonly appName: string) {\n\t\tsuper(\n\t\t\t`App \"${appName}\" is not a backend app and cannot be run with gkm dev.`,\n\t\t);\n\t\tthis.name = 'NotABackendApp';\n\t}\n}\n\nexport interface WorkspaceAppInfo {\n\t/** The app's key in the workspace. */\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n}\n\n/**\n * The app a directory is part of, frontend or backend — found by the `path`\n * its construct declares. Unlike `loadAppConfig`, the app need not have a\n * gkm config, which is what `gkm exec` and `gkm test` from a site need.\n *\n * @throws {NotInAnApp} when no app's path contains the directory.\n */\nexport async function loadWorkspaceAppInfo(\n\tcwd: string = process.cwd(),\n): Promise<WorkspaceAppInfo> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\tconst loadedConfig = await withDerivedApps(\n\t\tprocessConfig(config, workspaceRoot),\n\t);\n\n\tconst resolved = resolveWorkspaceApp(loadedConfig, cwd);\n\tif (!resolved) throw new NotInAnApp(cwd, appPaths(loadedConfig));\n\n\treturn {\n\t\tappName: resolved.key,\n\t\tapp: resolved.app,\n\t\tworkspace: loadedConfig.workspace,\n\t\tworkspaceRoot,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,IAAa,4BAAb,cAA+CA,eAAAA,SAAS;CAE7C;CACA;CAFV,YACC,WACA,KACC;EACD,MACC,8BAA8B,UAAU,YAAY,IAAI,0HAGzD;EAPS,KAAA,YAAA;EACA,KAAA,MAAA;EAOT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,qBAAb,cAAwCA,eAAAA,SAAS;CAC3B;CAArB,YAAY,OAAmC;EAC9C,MACC,GAAG,MAAM,KAAK,OAAO,EAAE,oJAGxB;EALoB,KAAA,QAAA;EAMpB,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,2BAAb,cAA8CA,eAAAA,SAAS;CAE5C;CACA;CACA;CAHV,YACC,MACA,SACA,MACC;EACD,MACC,IAAI,KAAK,8BAA8B,KAAK,OAAO,QAAQ,UACtD,QAAQ,+GAEd;EARS,KAAA,OAAA;EACA,KAAA,UAAA;EACA,KAAA,OAAA;EAOT,KAAK,OAAO;CACb;AACD;;AAGA,SAAgB,aACf,UAC8B;CAC9B,OAAO,OAAO,OAAO,QAAQ,CAAC,CAAC,KAAKC,oBAAAA,cAAc;AACnD;;;;;;;;;;;AAYA,SAAgB,cACf,UACsB;CACtB,MAAM,yBAAS,IAAI,IAAoB;CACvC,KAAK,MAAM,CAAC,IAAI,gBAAgB,OAAO,Q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;EACA;EACA;EACA,UAAA,GAASZ,UAAAA,KAAAA,CAAK,eAAe,IAAI,IAAI;CACtC;AACD;;AAGA,IAAa,iBAAb,cAAoCC,eAAAA,SAAS;CACvB;CAArB,YAAY,SAA0B;EACrC,MACC,QAAQ,QAAQ,uDACjB;EAHoB,KAAA,UAAA;EAIpB,KAAK,OAAO;CACb;AACD;;;;;;;;AAiBA,eAAsB,qBACrB,MAAc,QAAQ,IAAI,GACE;CAC5B,MAAM,EAAE,QAAQ,kBAAkB,MAAM,cAAc,GAAG;CACzD,MAAM,eAAe,MAAM,gBAC1BM,kBAAAA,cAAc,QAAQ,aAAa,CACpC;CAEA,MAAM,WAAW,oBAAoB,cAAc,GAAG;CACtD,IAAI,CAAC,UAAU,MAAM,IAAI,WAAW,KAAK,SAAS,YAAY,CAAC;CAE/D,OAAO;EACN,SAAS,SAAS;EAClB,KAAK,SAAS;EACd,WAAW,aAAa;EACxB;CACD;AACD"}
@@ -0,0 +1,291 @@
1
+ import { D as WorkspaceConfig, Gt as GkmError, Rt as Sandbox, b as NormalizedAppConfig, r as GkmConfig, v as LoadedConfig, x as NormalizedWorkspace } from "./types-D1C8pUyh.cjs";
2
+ import "./index-DDY0cZCo.cjs";
3
+ import { ConstructManifest } from "@geekmidas/manifest";
4
+ //#region src/dev/discovery.d.ts
5
+ /** Where an app is in its life. `stopped` is a server that exited on its own. */
6
+ type AppStatus = 'starting' | 'ready' | 'reloading' | 'stopped';
7
+ /** A JSON API an app serves about itself. */
8
+ type DataApiKind = 'telescope' | 'database' | 'openapi';
9
+ /**
10
+ * The local OpenObserve `gkm dev` runs for a workspace that uses a
11
+ * `Telemetry` construct: where its UI is, and who signs in. Never the
12
+ * password — the endpoint is read by anything holding its token.
13
+ */
14
+ interface DevTelemetryUi {
15
+ /** `http://localhost:<port>`. */
16
+ url: string;
17
+ /** The local root user's email. */
18
+ email: string;
19
+ }
20
+ interface DiscoveredDataApi {
21
+ kind: DataApiKind;
22
+ /** Where the app serves it. */
23
+ path: string;
24
+ /** The app's own address for it — `http://localhost:<port><path>`. */
25
+ url: string;
26
+ /** The same API through this endpoint, relative to its origin. */
27
+ proxy: string;
28
+ }
29
+ interface DiscoveredApp {
30
+ name: string;
31
+ type: 'backend' | 'web' | 'mobile';
32
+ port: number;
33
+ /** `http://localhost:<port>`. */
34
+ url: string;
35
+ publicUrl: string | null;
36
+ status: AppStatus;
37
+ reloads: number;
38
+ /** The `gkm dev` running it, when it runs in one of its own. */
39
+ pid: number | null;
40
+ dataApis: DiscoveredDataApi[];
41
+ }
42
+ interface DiscoveredWorkspace {
43
+ /** Stable for a workspace's root: its name, and a hash of where it is. */
44
+ id: string;
45
+ name: string;
46
+ root: string;
47
+ stage: string;
48
+ manifest: ConstructManifest | null;
49
+ /** The local telemetry UI — OpenObserve — when the workspace runs one. */
50
+ telemetry: DevTelemetryUi | null;
51
+ apps: DiscoveredApp[];
52
+ }
53
+ /** The body of `GET /__gkm`. */
54
+ interface DiscoveryResponse {
55
+ version: 1;
56
+ /** The `gkm dev` serving this endpoint, which may change while you watch. */
57
+ host: {
58
+ pid: number;
59
+ port: number;
60
+ };
61
+ /** Where the changes stream, as server-sent events. */
62
+ events: string;
63
+ workspaces: DiscoveredWorkspace[];
64
+ }
65
+ /** One message on `GET /__gkm/events`; its SSE `event:` is its `type`. */
66
+ type DiscoveryEvent = {
67
+ type: 'snapshot';
68
+ snapshot: DiscoveryResponse;
69
+ } | {
70
+ type: 'workspace.started' | 'workspace.stopped';
71
+ workspace: string;
72
+ } | {
73
+ type: 'app.started' | 'app.stopped' | 'app.reloaded' | 'app.status';
74
+ workspace: string;
75
+ app: DiscoveredApp;
76
+ };
77
+ //#endregion
78
+ //#region src/config.d.ts
79
+ /**
80
+ * Define GKM configuration with full TypeScript support.
81
+ * This is an identity function that provides type safety and autocomplete.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * // gkm.config.ts
86
+ * import { defineConfig } from '@geekmidas/cli/config';
87
+ *
88
+ * export default defineConfig({
89
+ * routes: './src/endpoints/**\/*.ts',
90
+ * envParser: './src/config/env',
91
+ * logger: './src/config/logger',
92
+ * telescope: true,
93
+ * });
94
+ * ```
95
+ */
96
+ declare function defineConfig(config: GkmConfig): GkmConfig;
97
+ interface ParsedModuleConfig {
98
+ path: string;
99
+ importPattern: string;
100
+ }
101
+ /**
102
+ * Parse a module config string into path and import pattern.
103
+ *
104
+ * @param configString - Config string in format "./path/to/module" or "./path/to/module#exportName"
105
+ * @param defaultAlias - The default alias name to use if no export name specified
106
+ * @returns Object with path and import pattern
107
+ *
108
+ * @example
109
+ * parseModuleConfig('./src/config/env', 'envParser')
110
+ * // { path: './src/config/env', importPattern: 'envParser' }
111
+ *
112
+ * parseModuleConfig('./src/config/env#envParser', 'envParser')
113
+ * // { path: './src/config/env', importPattern: '{ envParser }' }
114
+ *
115
+ * parseModuleConfig('./src/config/env#myEnv', 'envParser')
116
+ * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
117
+ */
118
+ declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
119
+ interface ConfigDiscoveryResult {
120
+ configPath: string;
121
+ workspaceRoot: string;
122
+ }
123
+ /**
124
+ * The directory holding the gkm config that `cwd` belongs to — the project a
125
+ * sandbox for it is confined to.
126
+ *
127
+ * @throws {ConfigNotFound} when neither `cwd` nor any parent has one.
128
+ */
129
+ declare function findWorkspaceRoot(cwd: string): string;
130
+ /** No gkm config in a directory or any of its parents. */
131
+ declare class ConfigNotFound extends GkmError {
132
+ readonly cwd: string;
133
+ constructor(cwd: string);
134
+ }
135
+ interface RawConfigResult {
136
+ config: GkmConfig | WorkspaceConfig;
137
+ workspaceRoot: string;
138
+ }
139
+ interface LoadConfigOptions {
140
+ /**
141
+ * Load the config — and discover the constructs it names — in this
142
+ * sandbox rather than in this process. The config then arrives as data;
143
+ * see {@link Sandbox.isolating} for what happens to one holding live
144
+ * objects. Defaults to the run's own (`withSandbox`); with neither, the
145
+ * config is imported here, as `gkm` always has.
146
+ */
147
+ sandbox?: Sandbox;
148
+ /**
149
+ * How long the sandboxed config load may run. Defaults to
150
+ * {@link CONFIG_LOAD_TIMEOUT_MS}.
151
+ */
152
+ timeoutMs?: number;
153
+ }
154
+ /**
155
+ * How long loading a config, or discovering its constructs, may take in a
156
+ * sandbox: room for tsx to compile a large project cold, and not a deploy
157
+ * held open by a config that never finishes importing.
158
+ */
159
+ declare const CONFIG_LOAD_TIMEOUT_MS = 60000;
160
+ /** The config failed to import, or threw while it ran. */
161
+ declare class ConfigLoadFailed extends Error {
162
+ readonly configPath: string;
163
+ readonly detail: string;
164
+ constructor(configPath: string, detail: string);
165
+ }
166
+ /**
167
+ * The config holds something that is not data — a custom state store, an
168
+ * inline deploy target, a function — and the sandbox it was loaded in hands
169
+ * the deploy nothing but data.
170
+ */
171
+ declare class ConfigObjectNotSerializable extends Error {
172
+ readonly configPath: string;
173
+ readonly paths: readonly string[];
174
+ constructor(configPath: string, paths: readonly string[]);
175
+ }
176
+ /**
177
+ * Run `fn` with `config` as the config of the workspace at `workspaceRoot`:
178
+ * every load of it inside — however deep, sandboxed or not — answers with
179
+ * this one rather than importing the file again.
180
+ *
181
+ * A config is the workspace's settings, and settings may come from the
182
+ * environment it was loaded in (`domains: { prod: process.env.DOMAIN }`). A
183
+ * reload in a sandbox, which passes on an allowlist of the environment, read
184
+ * the same file to a different answer: the deploy saw no domain the command
185
+ * had been given. Loaded once by the caller, every step of the run sees the
186
+ * same settings. The constructs are still discovered in the run's sandbox.
187
+ */
188
+ declare function withLoadedConfig<T>(workspaceRoot: string, config: GkmConfig | WorkspaceConfig, fn: () => T): T;
189
+ /**
190
+ * The raw config of the workspace a directory belongs to, imported in this
191
+ * process: what a caller hands {@link withLoadedConfig}, or `deploy()` as its
192
+ * `config`.
193
+ */
194
+ declare function loadRawWorkspaceConfig(cwd?: string): Promise<RawConfigResult>;
195
+ /**
196
+ * Load configuration file (single-app format).
197
+ * For backwards compatibility with existing code.
198
+ *
199
+ * @deprecated Use loadWorkspaceConfig for new code
200
+ */
201
+ declare function loadConfig(cwd?: string): Promise<GkmConfig>;
202
+ /**
203
+ * Load configuration file and process it as a workspace.
204
+ * Works with both single-app and workspace configurations.
205
+ *
206
+ * Single-app configs are automatically wrapped as a workspace with one app.
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * const { type, workspace } = await loadWorkspaceConfig();
211
+ *
212
+ * if (type === 'workspace') {
213
+ * console.log('Multi-app workspace:', workspace.apps);
214
+ * } else {
215
+ * console.log('Single app wrapped as workspace');
216
+ * }
217
+ * ```
218
+ */
219
+ /**
220
+ * The workspace a directory belongs to, as its config states it — without
221
+ * discovering its constructs.
222
+ *
223
+ * For callers that need a fact the config holds (where a stage's secrets are
224
+ * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
225
+ * construct module to derive the apps, which is a cost a secrets read should
226
+ * not pay.
227
+ */
228
+ declare function loadWorkspaceSettings(cwd?: string, options?: LoadConfigOptions): Promise<LoadedConfig['workspace']>;
229
+ declare function loadWorkspaceConfig(cwd?: string, options?: LoadConfigOptions): Promise<LoadedConfig>;
230
+ /**
231
+ * A workspace with no `constructs` glob.
232
+ *
233
+ * In v10 every address, container and app comes from what the workspace
234
+ * declares — there is no second path that reads a hand-written compose file or
235
+ * an `apps` block's ports. A config that declares nothing has nothing to run.
236
+ */
237
+ declare class WorkspaceDeclaresNoConstructs extends GkmError {
238
+ readonly root: string;
239
+ constructor(root: string);
240
+ }
241
+ interface AppConfigResult {
242
+ appName: string;
243
+ app: NormalizedAppConfig;
244
+ gkmConfig: GkmConfig;
245
+ workspace: NormalizedWorkspace;
246
+ workspaceRoot: string;
247
+ appRoot: string;
248
+ }
249
+ /** A directory that no app in the workspace lives in. */
250
+ declare class NotInAnApp extends GkmError {
251
+ readonly cwd: string;
252
+ readonly apps: Readonly<Record<string, string>>;
253
+ constructor(cwd: string, apps: Readonly<Record<string, string>>);
254
+ }
255
+ /**
256
+ * The backend app a directory is part of, with its gkm config — found by the
257
+ * `path` its construct declares.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * // From apps/api, where a construct declares `path: 'apps/api'`
262
+ * const { app, workspace, workspaceRoot } = await loadAppConfig();
263
+ * ```
264
+ *
265
+ * @throws {NotInAnApp} when no app's path contains the directory.
266
+ * @throws {NotABackendApp} when the app it is in has no gkm config to run.
267
+ */
268
+ declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
269
+ /** The app a directory is in has no gkm config — a site, or an entry app. */
270
+ declare class NotABackendApp extends GkmError {
271
+ readonly appName: string;
272
+ constructor(appName: string);
273
+ }
274
+ interface WorkspaceAppInfo {
275
+ /** The app's key in the workspace. */
276
+ appName: string;
277
+ app: NormalizedAppConfig;
278
+ workspace: NormalizedWorkspace;
279
+ workspaceRoot: string;
280
+ }
281
+ /**
282
+ * The app a directory is part of, frontend or backend — found by the `path`
283
+ * its construct declares. Unlike `loadAppConfig`, the app need not have a
284
+ * gkm config, which is what `gkm exec` and `gkm test` from a site need.
285
+ *
286
+ * @throws {NotInAnApp} when no app's path contains the directory.
287
+ */
288
+ declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
289
+ //#endregion
290
+ export { DiscoveryResponse as A, withLoadedConfig as C, DiscoveredDataApi as D, DiscoveredApp as E, DiscoveredWorkspace as O, parseModuleConfig as S, DataApiKind as T, loadConfig as _, ConfigNotFound as a, loadWorkspaceConfig as b, NotABackendApp as c, RawConfigResult as d, WorkspaceAppInfo as f, loadAppConfig as g, findWorkspaceRoot as h, ConfigLoadFailed as i, DiscoveryEvent as k, NotInAnApp as l, defineConfig as m, CONFIG_LOAD_TIMEOUT_MS as n, ConfigObjectNotSerializable as o, WorkspaceDeclaresNoConstructs as p, ConfigDiscoveryResult as r, LoadConfigOptions as s, AppConfigResult as t, ParsedModuleConfig as u, loadRawWorkspaceConfig as v, AppStatus as w, loadWorkspaceSettings as x, loadWorkspaceAppInfo as y };
291
+ //# sourceMappingURL=config-C60T2h98.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-C60T2h98.d.cts","names":[],"sources":["../src/dev/discovery.ts","../src/config.ts"],"mappings":";;;;;KAqFY;;KAGA;;;;;;UAyBK;;EAEhB;;EAEA;;UA8BgB;EAChB,MAAM;;EAEN;;EAEA;;EAEA;;UAGgB;EAChB;EACA;EACA;;EAEA;EACA;EACA,QAAQ;EACR;;EAEA;EACA,UAAU;;UAGM;;EAEhB;EACA;EACA;EACA;EACA,UAAU;;EAEV,WAAW;EACX,MAAM;;;UAIU;EAChB;;EAEA;IAAQ;IAAa;;;EAErB;EACA,YAAY;;;KAID;EACP;EAAkB,UAAU;;EAC5B;EAAiD;;EAEnD;EACA;EACA,KAAK;;;;;;;;;;;;;;;;;;;;;iBCnJQ,aAAa,QAAQ,YAAY;UAIhC;EAChB;EACA;;;;;;;;;;;;;;;;;;;iBAoBe,kBACf,sBACA,uBACE;UAac;EAChB;EACA;;;;;;;;iBAgDe,kBAAkB;;cAKrB,uBAAuB;WACd;EAArB,YAAqB;;UAQL;EAChB,QAAQ,YAAY;EACpB;;UAGgB;;;;;;;;EAQhB,UAAU;;;;;EAKV;;;;;;;cAQY;;cAGA,yBAAyB;WAE3B;WACA;EAFV,YACU,oBACA;;;;;;;cAYE,oCAAoC;WAEtC;WACA;EAFV,YACU,oBACA;;;;;;;;;;;;;;iBAgGK,iBAAiB,GAChC,uBACA,QAAQ,YAAY,iBACpB,UAAU,IACR;;;;;;iBASmB,uBACrB,eACE,QAAQ;;;;;;;iBAuCW,WACrB,eACE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCW,sBACrB,cACA,UAAS,oBACP,QAAQ;iBAKW,oBACrB,cACA,UAAS,oBACP,QAAQ;;;;;;;;cAmEE,sCAAsC;WAC7B;EAArB,YAAqB;;UAWL;EAChB;EACA,KAAK;EACL,WAAW;EACX,WAAW;EACX;EACA;;;cAqCY,mBAAmB;WAErB;WACA,MAAM,SAAS;EAFzB,YACU,aACA,MAAM,SAAS;;;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