@geekmidas/cli 10.0.0-alpha.5 → 10.0.0-alpha.51

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 (267) hide show
  1. package/README.md +196 -257
  2. package/bin/adjacent-tsconfig.mjs +97 -0
  3. package/bin/gkm.mjs +16 -2
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
  7. package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
  8. package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-GF6NAZAK.mjs} +20 -21
  9. package/dist/HostingerProvider-GF6NAZAK.mjs.map +1 -0
  10. package/dist/{LocalStateProvider-Db9SEjyH.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
  11. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
  12. package/dist/{LocalStateProvider-Bn6tS-oL.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
  13. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
  14. package/dist/{openapi-CA0yJUTN.cjs → OpenApiTsGenerator-BN0PIZxd.cjs} +157 -372
  15. package/dist/OpenApiTsGenerator-BN0PIZxd.cjs.map +1 -0
  16. package/dist/{openapi-kkQbsRVj.mjs → OpenApiTsGenerator-BzIGy8KE.mjs} +128 -324
  17. package/dist/OpenApiTsGenerator-BzIGy8KE.mjs.map +1 -0
  18. package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
  19. package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
  20. package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
  21. package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
  22. package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
  23. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
  24. package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
  25. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
  26. package/dist/aws-DkHdTV-p.cjs +61 -0
  27. package/dist/aws-DkHdTV-p.cjs.map +1 -0
  28. package/dist/aws-DojzQnLd.mjs +61 -0
  29. package/dist/aws-DojzQnLd.mjs.map +1 -0
  30. package/dist/backends-B9V2XD2M.cjs +82 -0
  31. package/dist/backends-B9V2XD2M.cjs.map +1 -0
  32. package/dist/backends-CSuLl0YP.mjs +59 -0
  33. package/dist/backends-CSuLl0YP.mjs.map +1 -0
  34. package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
  35. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
  36. package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
  37. package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
  38. package/dist/{bundler-Be8Zg4Wd.mjs → bundler--fyybf1N.mjs} +19 -30
  39. package/dist/bundler--fyybf1N.mjs.map +1 -0
  40. package/dist/{bundler-BY1OmV1e.cjs → bundler-By6_sXiL.cjs} +20 -32
  41. package/dist/bundler-By6_sXiL.cjs.map +1 -0
  42. package/dist/{config-C21ocYNd.cjs → config-Cvr5fCbn.cjs} +210 -210
  43. package/dist/config-Cvr5fCbn.cjs.map +1 -0
  44. package/dist/{config-WRdsQYZK.mjs → config-SOkDH-n1.mjs} +143 -154
  45. package/dist/config-SOkDH-n1.mjs.map +1 -0
  46. package/dist/config.cjs +9 -6
  47. package/dist/config.d.cts +62 -33
  48. package/dist/config.d.cts.map +1 -1
  49. package/dist/config.d.mts +62 -33
  50. package/dist/config.d.mts.map +1 -1
  51. package/dist/config.mjs +3 -5
  52. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  53. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  54. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  55. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  56. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  57. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  58. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  59. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  60. package/dist/deploy/sniffer-hooks.cjs +13 -7
  61. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  62. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  63. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  64. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  65. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  66. package/dist/deploy/sniffer-hooks.mjs +9 -2
  67. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  68. package/dist/deploy/sniffer-loader.cjs +16 -7
  69. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  70. package/dist/deploy/sniffer-loader.d.cts +1 -1
  71. package/dist/deploy/sniffer-loader.d.mts +1 -1
  72. package/dist/deploy/sniffer-loader.mjs +13 -2
  73. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  74. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  75. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  76. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  77. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  78. package/dist/deploy/sniffer-routes-worker.mjs +3 -3
  79. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  80. package/dist/deploy/sniffer-worker.cjs +15 -6
  81. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  82. package/dist/deploy/sniffer-worker.d.cts +1 -3
  83. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  84. package/dist/deploy/sniffer-worker.d.mts +1 -3
  85. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  86. package/dist/deploy/sniffer-worker.mjs +15 -4
  87. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  88. package/dist/{discover-CAlFgYec.mjs → discover-Cf2jAcgF.mjs} +56 -63
  89. package/dist/discover-Cf2jAcgF.mjs.map +1 -0
  90. package/dist/{discover-DTmFeloL.cjs → discover-DXNviAh-.cjs} +86 -110
  91. package/dist/discover-DXNviAh-.cjs.map +1 -0
  92. package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
  93. package/dist/emit-C1e8qD08.mjs.map +1 -0
  94. package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
  95. package/dist/emit-Dmc1nvdS.cjs.map +1 -0
  96. package/dist/encryption-Bt8SHRI6.cjs +91 -0
  97. package/dist/encryption-Bt8SHRI6.cjs.map +1 -0
  98. package/dist/encryption-DRCXp-U4.mjs +90 -0
  99. package/dist/encryption-DRCXp-U4.mjs.map +1 -0
  100. package/dist/github-BGx4U61b.cjs +213 -0
  101. package/dist/github-BGx4U61b.cjs.map +1 -0
  102. package/dist/github-U_frvZgD.mjs +213 -0
  103. package/dist/github-U_frvZgD.mjs.map +1 -0
  104. package/dist/{index-CHB4tSzX.d.cts → index-DYh5TrsZ.d.mts} +4 -23
  105. package/dist/index-DYh5TrsZ.d.mts.map +1 -0
  106. package/dist/{index-BThUzEIp.d.mts → index-fU3qHy7c.d.cts} +4 -23
  107. package/dist/index-fU3qHy7c.d.cts.map +1 -0
  108. package/dist/index.cjs +9561 -7232
  109. package/dist/index.cjs.map +1 -1
  110. package/dist/index.d.cts +1 -1
  111. package/dist/index.d.mts +1 -1
  112. package/dist/index.mjs +9479 -7177
  113. package/dist/index.mjs.map +1 -1
  114. package/dist/migrate-dx4I0epp.cjs +743 -0
  115. package/dist/migrate-dx4I0epp.cjs.map +1 -0
  116. package/dist/migrate-soUQtku3.mjs +736 -0
  117. package/dist/migrate-soUQtku3.mjs.map +1 -0
  118. package/dist/openapi.cjs +198 -8
  119. package/dist/openapi.cjs.map +1 -0
  120. package/dist/openapi.d.cts +53 -15
  121. package/dist/openapi.d.cts.map +1 -1
  122. package/dist/openapi.d.mts +53 -15
  123. package/dist/openapi.d.mts.map +1 -1
  124. package/dist/openapi.mjs +193 -5
  125. package/dist/openapi.mjs.map +1 -0
  126. package/dist/ready-WfT-eWlm.mjs +861 -0
  127. package/dist/ready-WfT-eWlm.mjs.map +1 -0
  128. package/dist/ready-lr2Fm-ep.cjs +932 -0
  129. package/dist/ready-lr2Fm-ep.cjs.map +1 -0
  130. package/dist/reconcile/public.cjs +3 -5
  131. package/dist/reconcile/public.d.cts +30 -33
  132. package/dist/reconcile/public.d.cts.map +1 -1
  133. package/dist/reconcile/public.d.mts +30 -33
  134. package/dist/reconcile/public.d.mts.map +1 -1
  135. package/dist/reconcile/public.mjs +3 -4
  136. package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
  137. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  138. package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  139. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  140. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  141. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  142. package/dist/storage-BzaUxmqe.mjs +124 -0
  143. package/dist/storage-BzaUxmqe.mjs.map +1 -0
  144. package/dist/storage-CSGoC3bK.cjs +152 -0
  145. package/dist/storage-CSGoC3bK.cjs.map +1 -0
  146. package/dist/store-DQgxT_WR.cjs +211 -0
  147. package/dist/store-DQgxT_WR.cjs.map +1 -0
  148. package/dist/store-DeGATCS-.mjs +182 -0
  149. package/dist/store-DeGATCS-.mjs.map +1 -0
  150. package/dist/types-CT0ymlBk.d.mts +6230 -0
  151. package/dist/types-CT0ymlBk.d.mts.map +1 -0
  152. package/dist/types-DYDT4FfE.d.cts +6231 -0
  153. package/dist/types-DYDT4FfE.d.cts.map +1 -0
  154. package/dist/vitest.cjs +65 -0
  155. package/dist/vitest.cjs.map +1 -0
  156. package/dist/vitest.d.cts +29 -0
  157. package/dist/vitest.d.cts.map +1 -0
  158. package/dist/vitest.d.mts +29 -0
  159. package/dist/vitest.d.mts.map +1 -0
  160. package/dist/vitest.mjs +65 -0
  161. package/dist/vitest.mjs.map +1 -0
  162. package/dist/workspace/index.cjs +3 -4
  163. package/dist/workspace/index.d.cts +3 -3
  164. package/dist/workspace/index.d.mts +3 -3
  165. package/dist/workspace/index.mjs +2 -3
  166. package/dist/{workspace-BcucjwvA.cjs → workspace-BcCiLzTO.cjs} +1040 -1120
  167. package/dist/workspace-BcCiLzTO.cjs.map +1 -0
  168. package/dist/{credentials-BBIRJVp4.mjs → workspace-Dp2zK_Nk.mjs} +2212 -1732
  169. package/dist/workspace-Dp2zK_Nk.mjs.map +1 -0
  170. package/dist/{credentials-G1JwBoXH.cjs → workspace-GBzR_hID.cjs} +2348 -1849
  171. package/dist/workspace-GBzR_hID.cjs.map +1 -0
  172. package/dist/{workspace-BFMrAKqI.mjs → workspace-bOsks1uk.mjs} +871 -974
  173. package/dist/workspace-bOsks1uk.mjs.map +1 -0
  174. package/package.json +29 -20
  175. package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
  176. package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
  177. package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
  178. package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
  179. package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
  180. package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
  181. package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
  182. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
  183. package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
  184. package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
  185. package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
  186. package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
  187. package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
  188. package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
  189. package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
  190. package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
  191. package/dist/bundler-BY1OmV1e.cjs.map +0 -1
  192. package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
  193. package/dist/chunk-Duj1WY3L.mjs +0 -7
  194. package/dist/config-C21ocYNd.cjs.map +0 -1
  195. package/dist/config-WRdsQYZK.mjs.map +0 -1
  196. package/dist/credentials-B5zRHdAl.mjs +0 -141
  197. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  198. package/dist/credentials-BBIRJVp4.mjs.map +0 -1
  199. package/dist/credentials-BapzjyV5.cjs +0 -195
  200. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  201. package/dist/credentials-G1JwBoXH.cjs.map +0 -1
  202. package/dist/discover-CAlFgYec.mjs.map +0 -1
  203. package/dist/discover-DTmFeloL.cjs.map +0 -1
  204. package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
  205. package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
  206. package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
  207. package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
  208. package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
  209. package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
  210. package/dist/emit-CbcRolsa.cjs.map +0 -1
  211. package/dist/emit-CiZS_5Ub.mjs.map +0 -1
  212. package/dist/encryption-C6jaU0hE.cjs +0 -54
  213. package/dist/encryption-C6jaU0hE.cjs.map +0 -1
  214. package/dist/encryption-CHzzeR8a.cjs +0 -4
  215. package/dist/encryption-CQUncu7v.mjs +0 -3
  216. package/dist/encryption-D-abyhZx.mjs +0 -42
  217. package/dist/encryption-D-abyhZx.mjs.map +0 -1
  218. package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
  219. package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
  220. package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
  221. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
  222. package/dist/generator-CNzBw7g5.cjs +0 -289
  223. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  224. package/dist/generator-VE2JrFlY.mjs +0 -253
  225. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  226. package/dist/index-BThUzEIp.d.mts.map +0 -1
  227. package/dist/index-CHB4tSzX.d.cts.map +0 -1
  228. package/dist/openapi-CA0yJUTN.cjs.map +0 -1
  229. package/dist/openapi-kkQbsRVj.mjs.map +0 -1
  230. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  231. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  232. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  233. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  234. package/dist/openapi-react-query.cjs +0 -4
  235. package/dist/openapi-react-query.d.cts +0 -11
  236. package/dist/openapi-react-query.d.cts.map +0 -1
  237. package/dist/openapi-react-query.d.mts +0 -11
  238. package/dist/openapi-react-query.d.mts.map +0 -1
  239. package/dist/openapi-react-query.mjs +0 -4
  240. package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
  241. package/dist/reconcile-D0pimNiy.cjs.map +0 -1
  242. package/dist/setup-B5_oHHUj.cjs +0 -11
  243. package/dist/setup-Cm2UnAdh.cjs +0 -473
  244. package/dist/setup-Cm2UnAdh.cjs.map +0 -1
  245. package/dist/setup-DXvRLTZN.mjs +0 -443
  246. package/dist/setup-DXvRLTZN.mjs.map +0 -1
  247. package/dist/setup-ZijS4qeC.mjs +0 -11
  248. package/dist/storage-BJmzYxt8.cjs +0 -363
  249. package/dist/storage-BJmzYxt8.cjs.map +0 -1
  250. package/dist/storage-BM9hGpgv.cjs +0 -7
  251. package/dist/storage-Bi24WfoW.mjs +0 -297
  252. package/dist/storage-Bi24WfoW.mjs.map +0 -1
  253. package/dist/storage-CYlGwWTj.mjs +0 -3
  254. package/dist/sync-CmEuNZsB.mjs +0 -76
  255. package/dist/sync-CmEuNZsB.mjs.map +0 -1
  256. package/dist/sync-D306yOWu.cjs +0 -4
  257. package/dist/sync-SizaChmC.cjs +0 -93
  258. package/dist/sync-SizaChmC.cjs.map +0 -1
  259. package/dist/sync-hOqAWHR6.mjs +0 -3
  260. package/dist/types-C-arnQ1r.d.mts +0 -2184
  261. package/dist/types-C-arnQ1r.d.mts.map +0 -1
  262. package/dist/types-abJQuk7m.d.cts +0 -2184
  263. package/dist/types-abJQuk7m.d.cts.map +0 -1
  264. package/dist/workspace-BFMrAKqI.mjs.map +0 -1
  265. package/dist/workspace-BcucjwvA.cjs.map +0 -1
  266. package/dist/workspace-DdJss8I6.cjs +0 -9
  267. package/dist/workspace-k4l3rsFh.mjs +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-loader.cjs","names":["__filename","__dirname"],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":";;;;;;;AAkBA,MAAMA,eAAa,0EAA8B;AACjD,MAAMC,cAAY,uBAAQD,aAAW;AAGrC,MAAM,UAAU,oBAAKC,aAAW,oBAAoB;AACpD,MAAM,SAAS,oBAAKA,aAAW,mBAAmB;AAClD,MAAM,YAAY,wBAAW,QAAQ,GAAG,UAAU;AAGlD,0BAAS,4BAAc,UAAU,CAAC,oDAAsB"}
1
+ {"version":3,"file":"sniffer-loader.cjs","names":["__filename","fileURLToPath","__dirname","dirname","join","existsSync","register","pathToFileURL"],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAMA,gBAAAA,GAAaC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AAChD,MAAMC,eAAAA,GAAYC,UAAAA,QAAAA,CAAQH,YAAU;AAGpC,MAAM,WAAA,GAAUI,UAAAA,KAAAA,CAAKF,aAAW,mBAAmB;AACnD,MAAM,UAAA,GAASE,UAAAA,KAAAA,CAAKF,aAAW,kBAAkB;AACjD,MAAM,aAAA,GAAYG,QAAAA,WAAAA,CAAW,OAAO,IAAI,UAAU;CAGlDC,GAAAA,YAAAA,SAAAA,EAAAA,GAASC,SAAAA,cAAAA,CAAc,SAAS,CAAC,CAAC,MAAA,QAAA,KAAA,CAAA,CAAA,cAAA,UAAA,CAAA,CAAA,IAAqB"}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -2,14 +2,25 @@ import { register } from "node:module";
2
2
  import { existsSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
-
6
5
  //#region src/deploy/sniffer-loader.ts
6
+ /**
7
+ * Node.js module loader registration for entry app sniffing.
8
+ *
9
+ * This module registers a custom loader hook that intercepts imports of
10
+ * '@geekmidas/envkit' and replaces the EnvironmentParser with
11
+ * SnifferEnvironmentParser, allowing us to capture which environment
12
+ * variables an entry app accesses.
13
+ *
14
+ * Usage:
15
+ * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts
16
+ */
7
17
  const __filename = fileURLToPath(import.meta.url);
8
18
  const __dirname = dirname(__filename);
9
19
  const mjsPath = join(__dirname, "sniffer-hooks.mjs");
10
20
  const tsPath = join(__dirname, "sniffer-hooks.ts");
11
21
  const hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;
12
22
  register(pathToFileURL(hooksPath).href, import.meta.url);
13
-
14
23
  //#endregion
24
+ export {};
25
+
15
26
  //# sourceMappingURL=sniffer-loader.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-loader.mjs","names":[],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":";;;;;;AAkBA,MAAM,aAAa,cAAc,OAAO,KAAK,IAAI;AACjD,MAAM,YAAY,QAAQ,WAAW;AAGrC,MAAM,UAAU,KAAK,WAAW,oBAAoB;AACpD,MAAM,SAAS,KAAK,WAAW,mBAAmB;AAClD,MAAM,YAAY,WAAW,QAAQ,GAAG,UAAU;AAGlD,SAAS,cAAc,UAAU,CAAC,MAAM,OAAO,KAAK,IAAI"}
1
+ {"version":3,"file":"sniffer-loader.mjs","names":[],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAM,YAAY,QAAQ,UAAU;AAGpC,MAAM,UAAU,KAAK,WAAW,mBAAmB;AACnD,MAAM,SAAS,KAAK,WAAW,kBAAkB;AACjD,MAAM,YAAY,WAAW,OAAO,IAAI,UAAU;AAGlD,SAAS,cAAc,SAAS,CAAC,CAAC,MAAM,YAAY,GAAG"}
@@ -1,10 +1,10 @@
1
- const require_chunk = require('../chunk-CUT6urMc.cjs');
2
- const fast_glob = require_chunk.__toESM(require("fast-glob"));
3
- const __geekmidas_constructs_crons = require_chunk.__toESM(require("@geekmidas/constructs/crons"));
4
- const __geekmidas_constructs_endpoints = require_chunk.__toESM(require("@geekmidas/constructs/endpoints"));
5
- const __geekmidas_constructs_functions = require_chunk.__toESM(require("@geekmidas/constructs/functions"));
6
- const __geekmidas_constructs_subscribers = require_chunk.__toESM(require("@geekmidas/constructs/subscribers"));
7
-
1
+ const require_rolldown_runtime = require("../rolldown-runtime-C0BPl7ul.cjs");
2
+ let fast_glob = require("fast-glob");
3
+ fast_glob = require_rolldown_runtime.__toESM(fast_glob, 1);
4
+ let _geekmidas_constructs_endpoints = require("@geekmidas/constructs/endpoints");
5
+ let _geekmidas_constructs_crons = require("@geekmidas/constructs/crons");
6
+ let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
7
+ let _geekmidas_constructs_subscribers = require("@geekmidas/constructs/subscribers");
8
8
  //#region src/deploy/sniffer-routes-worker.ts
9
9
  const appPathArg = process.argv[2];
10
10
  const routesPatternArg = process.argv[3];
@@ -21,7 +21,7 @@ const routesPattern = routesPatternArg;
21
21
  * Check if a value is a gkm construct.
22
22
  */
23
23
  function isConstruct(value) {
24
- return __geekmidas_constructs_endpoints.Endpoint.isEndpoint(value) || __geekmidas_constructs_functions.Function.isFunction(value) || __geekmidas_constructs_crons.Cron.isCron(value) || __geekmidas_constructs_subscribers.Subscriber.isSubscriber(value);
24
+ return _geekmidas_constructs_endpoints.Endpoint.isEndpoint(value) || _geekmidas_constructs_functions.Function.isFunction(value) || _geekmidas_constructs_crons.Cron.isCron(value) || _geekmidas_constructs_subscribers.Subscriber.isSubscriber(value);
25
25
  }
26
26
  /**
27
27
  * Main sniffing function
@@ -36,8 +36,8 @@ async function sniff() {
36
36
  absolute: true
37
37
  });
38
38
  for (const file of files) try {
39
- const module$1 = await import(file);
40
- for (const [, exportValue] of Object.entries(module$1)) if (isConstruct(exportValue)) try {
39
+ const module = await import(file);
40
+ for (const [, exportValue] of Object.entries(module)) if (isConstruct(exportValue)) try {
41
41
  const constructEnvVars = await exportValue.getEnvironment({ markOptional: true });
42
42
  for (const name of constructEnvVars) if (name.endsWith("?")) optionalEnvVars.add(name.slice(0, -1));
43
43
  else envVars.add(name);
@@ -64,6 +64,6 @@ sniff().catch((e) => {
64
64
  }));
65
65
  process.exit(1);
66
66
  });
67
-
68
67
  //#endregion
68
+
69
69
  //# sourceMappingURL=sniffer-routes-worker.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-routes-worker.cjs","names":["appPath: string","routesPattern: string","value: unknown","error: string | null","module"],"sources":["../../src/deploy/sniffer-routes-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for route-based app sniffing.\n *\n * This script is executed in a subprocess with tsx loader,\n * which handles TypeScript compilation and path alias resolution.\n *\n * Usage:\n * node --import tsx ./sniffer-routes-worker.ts \"/path/to/app\" \"./src/endpoints/**\\/*.ts\"\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport type { Construct } from '@geekmidas/constructs';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Endpoint } from '@geekmidas/constructs/endpoints';\nimport { Function as GkmFunction } from '@geekmidas/constructs/functions';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport fg from 'fast-glob';\n\n// Get args from command line\nconst appPathArg = process.argv[2];\nconst routesPatternArg = process.argv[3];\n\nif (!appPathArg || !routesPatternArg) {\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: [],\n\t\t\terror: 'App path and routes pattern are required',\n\t\t}),\n\t);\n\tprocess.exit(1);\n}\n\n// After validation, these are guaranteed to be strings\nconst appPath: string = appPathArg;\nconst routesPattern: string = routesPatternArg;\n\n/**\n * Check if a value is a gkm construct.\n */\nfunction isConstruct(value: unknown): value is Construct {\n\treturn (\n\t\tEndpoint.isEndpoint(value) ||\n\t\tGkmFunction.isFunction(value) ||\n\t\tCron.isCron(value) ||\n\t\tSubscriber.isSubscriber(value)\n\t);\n}\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tconst envVars = new Set<string>();\n\tconst optionalEnvVars = new Set<string>();\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Find all route files matching the pattern\n\t\tconst files = await fg(routesPattern, {\n\t\t\tcwd: appPath,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Import each route file and find constructs\n\t\tfor (const file of files) {\n\t\t\ttry {\n\t\t\t\tconst module = await import(file);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [, exportValue] of Object.entries(module)) {\n\t\t\t\t\tif (isConstruct(exportValue)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// `markOptional`, so a key read through `.optional()` or\n\t\t\t\t\t\t\t// `.default()` comes back suffixed `?` and is reported\n\t\t\t\t\t\t\t// apart from the rest. Without it every sniffed read\n\t\t\t\t\t\t\t// looked required, and a key that is *absent by design*\n\t\t\t\t\t\t\t// — `AUTH_COOKIE_DOMAIN`, published only when a surface\n\t\t\t\t\t\t\t// has a domain to widen a cookie to — failed the deploy\n\t\t\t\t\t\t\t// as though it were a missing secret.\n\t\t\t\t\t\t\tconst constructEnvVars = await exportValue.getEnvironment({\n\t\t\t\t\t\t\t\tmarkOptional: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tfor (const name of constructEnvVars) {\n\t\t\t\t\t\t\t\tif (name.endsWith('?')) optionalEnvVars.add(name.slice(0, -1));\n\t\t\t\t\t\t\t\telse envVars.add(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Individual construct may fail, continue with others\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// Log import errors but continue with other files\n\t\t\t\tconst msg = e instanceof Error ? e.message : String(e);\n\t\t\t\tconsole.error(`[sniffer] Failed to import ${file}: ${msg}`);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Output result as JSON (last line of stdout)\n\t// A key required by one construct and optional in another is required: the\n\t// strictest read is the one that fails at runtime.\n\tfor (const name of envVars) optionalEnvVars.delete(name);\n\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: Array.from(envVars).sort(),\n\t\t\toptionalEnvVars: Array.from(optionalEnvVars).sort(),\n\t\t\terror,\n\t\t}),\n\t);\n}\n\n// Handle unhandled rejections\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;;AAqBA,MAAM,aAAa,QAAQ,KAAK;AAChC,MAAM,mBAAmB,QAAQ,KAAK;AAEtC,KAAK,eAAe,kBAAkB;AACrC,SAAQ,IACP,KAAK,UAAU;EACd,SAAS,CAAE;EACX,OAAO;CACP,EAAC,CACF;AACD,SAAQ,KAAK,EAAE;AACf;AAGD,MAAMA,UAAkB;AACxB,MAAMC,gBAAwB;;;;AAK9B,SAAS,YAAYC,OAAoC;AACxD,QACC,0CAAS,WAAW,MAAM,IAC1B,0CAAY,WAAW,MAAM,IAC7B,kCAAK,OAAO,MAAM,IAClB,8CAAW,aAAa,MAAM;AAE/B;;;;AAKD,eAAe,QAAuB;CACrC,MAAM,0BAAU,IAAI;CACpB,MAAM,kCAAkB,IAAI;CAC5B,IAAIC,QAAuB;AAE3B,KAAI;EAEH,MAAM,QAAQ,MAAM,uBAAG,eAAe;GACrC,KAAK;GACL,UAAU;EACV,EAAC;AAGF,OAAK,MAAM,QAAQ,MAClB,KAAI;GACH,MAAMC,WAAS,MAAM,OAAO;AAG5B,QAAK,MAAM,GAAG,YAAY,IAAI,OAAO,QAAQA,SAAO,CACnD,KAAI,YAAY,YAAY,CAC3B,KAAI;IAQH,MAAM,mBAAmB,MAAM,YAAY,eAAe,EACzD,cAAc,KACd,EAAC;AACF,SAAK,MAAM,QAAQ,iBAClB,KAAI,KAAK,SAAS,IAAI,CAAE,iBAAgB,IAAI,KAAK,MAAM,GAAG,GAAG,CAAC;QACzD,SAAQ,IAAI,KAAK;GAEvB,QAAO,CAEP;EAGH,SAAQ,GAAG;GAEX,MAAM,MAAM,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;AACtD,WAAQ,OAAO,6BAA6B,KAAK,IAAI,IAAI,EAAE;EAC3D;CAEF,SAAQ,GAAG;AACX,UAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;CAClD;AAKD,MAAK,MAAM,QAAQ,QAAS,iBAAgB,OAAO,KAAK;AAExD,SAAQ,IACP,KAAK,UAAU;EACd,SAAS,MAAM,KAAK,QAAQ,CAAC,MAAM;EACnC,iBAAiB,MAAM,KAAK,gBAAgB,CAAC,MAAM;EACnD;CACA,EAAC,CACF;AACD;AAGD,QAAQ,GAAG,sBAAsB,MAAM,CAEtC,EAAC;AAGF,OAAO,CAAC,MAAM,CAAC,MAAM;AACpB,SAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAE;EAAE,OAAO,EAAE,WAAW,OAAO,EAAE;CAAE,EAAC,CAAC;AAC3E,SAAQ,KAAK,EAAE;AACf,EAAC"}
1
+ {"version":3,"file":"sniffer-routes-worker.cjs","names":["Endpoint","GkmFunction","Cron","Subscriber","fg"],"sources":["../../src/deploy/sniffer-routes-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for route-based app sniffing.\n *\n * This script is executed in a subprocess with tsx loader,\n * which handles TypeScript compilation and path alias resolution.\n *\n * Usage:\n * node --import tsx ./sniffer-routes-worker.ts \"/path/to/app\" \"./src/endpoints/**\\/*.ts\"\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport type { Construct } from '@geekmidas/constructs';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Endpoint } from '@geekmidas/constructs/endpoints';\nimport { Function as GkmFunction } from '@geekmidas/constructs/functions';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport fg from 'fast-glob';\n\n// Get args from command line\nconst appPathArg = process.argv[2];\nconst routesPatternArg = process.argv[3];\n\nif (!appPathArg || !routesPatternArg) {\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: [],\n\t\t\terror: 'App path and routes pattern are required',\n\t\t}),\n\t);\n\tprocess.exit(1);\n}\n\n// After validation, these are guaranteed to be strings\nconst appPath: string = appPathArg;\nconst routesPattern: string = routesPatternArg;\n\n/**\n * Check if a value is a gkm construct.\n */\nfunction isConstruct(value: unknown): value is Construct {\n\treturn (\n\t\tEndpoint.isEndpoint(value) ||\n\t\tGkmFunction.isFunction(value) ||\n\t\tCron.isCron(value) ||\n\t\tSubscriber.isSubscriber(value)\n\t);\n}\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tconst envVars = new Set<string>();\n\tconst optionalEnvVars = new Set<string>();\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Find all route files matching the pattern\n\t\tconst files = await fg(routesPattern, {\n\t\t\tcwd: appPath,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Import each route file and find constructs\n\t\tfor (const file of files) {\n\t\t\ttry {\n\t\t\t\tconst module = await import(file);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [, exportValue] of Object.entries(module)) {\n\t\t\t\t\tif (isConstruct(exportValue)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// `markOptional`, so a key read through `.optional()` or\n\t\t\t\t\t\t\t// `.default()` comes back suffixed `?` and is reported\n\t\t\t\t\t\t\t// apart from the rest. Without it every sniffed read\n\t\t\t\t\t\t\t// looked required, and a key that is *absent by design*\n\t\t\t\t\t\t\t// — `AUTH_COOKIE_DOMAIN`, published only when a surface\n\t\t\t\t\t\t\t// has a domain to widen a cookie to — failed the deploy\n\t\t\t\t\t\t\t// as though it were a missing secret.\n\t\t\t\t\t\t\tconst constructEnvVars = await exportValue.getEnvironment({\n\t\t\t\t\t\t\t\tmarkOptional: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tfor (const name of constructEnvVars) {\n\t\t\t\t\t\t\t\tif (name.endsWith('?')) optionalEnvVars.add(name.slice(0, -1));\n\t\t\t\t\t\t\t\telse envVars.add(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Individual construct may fail, continue with others\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// Log import errors but continue with other files\n\t\t\t\tconst msg = e instanceof Error ? e.message : String(e);\n\t\t\t\tconsole.error(`[sniffer] Failed to import ${file}: ${msg}`);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Output result as JSON (last line of stdout)\n\t// A key required by one construct and optional in another is required: the\n\t// strictest read is the one that fails at runtime.\n\tfor (const name of envVars) optionalEnvVars.delete(name);\n\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: Array.from(envVars).sort(),\n\t\t\toptionalEnvVars: Array.from(optionalEnvVars).sort(),\n\t\t\terror,\n\t\t}),\n\t);\n}\n\n// Handle unhandled rejections\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;;AAqBA,MAAM,aAAa,QAAQ,KAAK;AAChC,MAAM,mBAAmB,QAAQ,KAAK;AAEtC,IAAI,CAAC,cAAc,CAAC,kBAAkB;CACrC,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,CAAC;EACV,OAAO;CACR,CAAC,CACF;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,UAAkB;AACxB,MAAM,gBAAwB;;;;AAK9B,SAAS,YAAY,OAAoC;CACxD,OACCA,gCAAAA,SAAS,WAAW,KAAK,KACzBC,gCAAAA,SAAY,WAAW,KAAK,KAC5BC,4BAAAA,KAAK,OAAO,KAAK,KACjBC,kCAAAA,WAAW,aAAa,KAAK;AAE/B;;;;AAKA,eAAe,QAAuB;CACrC,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,kCAAkB,IAAI,IAAY;CACxC,IAAI,QAAuB;CAE3B,IAAI;EAEH,MAAM,QAAQ,OAAA,GAAMC,UAAAA,QAAAA,CAAG,eAAe;GACrC,KAAK;GACL,UAAU;EACX,CAAC;EAGD,KAAK,MAAM,QAAQ,OAClB,IAAI;GACH,MAAM,SAAS,MAAM,OAAO;GAG5B,KAAK,MAAM,GAAG,gBAAgB,OAAO,QAAQ,MAAM,GAClD,IAAI,YAAY,WAAW,GAC1B,IAAI;IAQH,MAAM,mBAAmB,MAAM,YAAY,eAAe,EACzD,cAAc,KACf,CAAC;IACD,KAAK,MAAM,QAAQ,kBAClB,IAAI,KAAK,SAAS,GAAG,GAAG,gBAAgB,IAAI,KAAK,MAAM,GAAG,EAAE,CAAC;SACxD,QAAQ,IAAI,IAAI;GAEvB,QAAQ,CAER;EAGH,SAAS,GAAG;GAEX,MAAM,MAAM,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;GACrD,QAAQ,MAAM,8BAA8B,KAAK,IAAI,KAAK;EAC3D;CAEF,SAAS,GAAG;EACX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAKA,KAAK,MAAM,QAAQ,SAAS,gBAAgB,OAAO,IAAI;CAEvD,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,MAAM,KAAK,OAAO,CAAC,CAAC,KAAK;EAClC,iBAAiB,MAAM,KAAK,eAAe,CAAC,CAAC,KAAK;EAClD;CACD,CAAC,CACF;AACD;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,9 +1,8 @@
1
1
  import fg from "fast-glob";
2
- import { Cron } from "@geekmidas/constructs/crons";
3
2
  import { Endpoint } from "@geekmidas/constructs/endpoints";
3
+ import { Cron } from "@geekmidas/constructs/crons";
4
4
  import { Function } from "@geekmidas/constructs/functions";
5
5
  import { Subscriber } from "@geekmidas/constructs/subscribers";
6
-
7
6
  //#region src/deploy/sniffer-routes-worker.ts
8
7
  const appPathArg = process.argv[2];
9
8
  const routesPatternArg = process.argv[3];
@@ -63,6 +62,7 @@ sniff().catch((e) => {
63
62
  }));
64
63
  process.exit(1);
65
64
  });
66
-
67
65
  //#endregion
66
+ export {};
67
+
68
68
  //# sourceMappingURL=sniffer-routes-worker.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-routes-worker.mjs","names":["appPath: string","routesPattern: string","value: unknown","error: string | null"],"sources":["../../src/deploy/sniffer-routes-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for route-based app sniffing.\n *\n * This script is executed in a subprocess with tsx loader,\n * which handles TypeScript compilation and path alias resolution.\n *\n * Usage:\n * node --import tsx ./sniffer-routes-worker.ts \"/path/to/app\" \"./src/endpoints/**\\/*.ts\"\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport type { Construct } from '@geekmidas/constructs';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Endpoint } from '@geekmidas/constructs/endpoints';\nimport { Function as GkmFunction } from '@geekmidas/constructs/functions';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport fg from 'fast-glob';\n\n// Get args from command line\nconst appPathArg = process.argv[2];\nconst routesPatternArg = process.argv[3];\n\nif (!appPathArg || !routesPatternArg) {\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: [],\n\t\t\terror: 'App path and routes pattern are required',\n\t\t}),\n\t);\n\tprocess.exit(1);\n}\n\n// After validation, these are guaranteed to be strings\nconst appPath: string = appPathArg;\nconst routesPattern: string = routesPatternArg;\n\n/**\n * Check if a value is a gkm construct.\n */\nfunction isConstruct(value: unknown): value is Construct {\n\treturn (\n\t\tEndpoint.isEndpoint(value) ||\n\t\tGkmFunction.isFunction(value) ||\n\t\tCron.isCron(value) ||\n\t\tSubscriber.isSubscriber(value)\n\t);\n}\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tconst envVars = new Set<string>();\n\tconst optionalEnvVars = new Set<string>();\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Find all route files matching the pattern\n\t\tconst files = await fg(routesPattern, {\n\t\t\tcwd: appPath,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Import each route file and find constructs\n\t\tfor (const file of files) {\n\t\t\ttry {\n\t\t\t\tconst module = await import(file);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [, exportValue] of Object.entries(module)) {\n\t\t\t\t\tif (isConstruct(exportValue)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// `markOptional`, so a key read through `.optional()` or\n\t\t\t\t\t\t\t// `.default()` comes back suffixed `?` and is reported\n\t\t\t\t\t\t\t// apart from the rest. Without it every sniffed read\n\t\t\t\t\t\t\t// looked required, and a key that is *absent by design*\n\t\t\t\t\t\t\t// — `AUTH_COOKIE_DOMAIN`, published only when a surface\n\t\t\t\t\t\t\t// has a domain to widen a cookie to — failed the deploy\n\t\t\t\t\t\t\t// as though it were a missing secret.\n\t\t\t\t\t\t\tconst constructEnvVars = await exportValue.getEnvironment({\n\t\t\t\t\t\t\t\tmarkOptional: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tfor (const name of constructEnvVars) {\n\t\t\t\t\t\t\t\tif (name.endsWith('?')) optionalEnvVars.add(name.slice(0, -1));\n\t\t\t\t\t\t\t\telse envVars.add(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Individual construct may fail, continue with others\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// Log import errors but continue with other files\n\t\t\t\tconst msg = e instanceof Error ? e.message : String(e);\n\t\t\t\tconsole.error(`[sniffer] Failed to import ${file}: ${msg}`);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Output result as JSON (last line of stdout)\n\t// A key required by one construct and optional in another is required: the\n\t// strictest read is the one that fails at runtime.\n\tfor (const name of envVars) optionalEnvVars.delete(name);\n\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: Array.from(envVars).sort(),\n\t\t\toptionalEnvVars: Array.from(optionalEnvVars).sort(),\n\t\t\terror,\n\t\t}),\n\t);\n}\n\n// Handle unhandled rejections\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;AAqBA,MAAM,aAAa,QAAQ,KAAK;AAChC,MAAM,mBAAmB,QAAQ,KAAK;AAEtC,KAAK,eAAe,kBAAkB;AACrC,SAAQ,IACP,KAAK,UAAU;EACd,SAAS,CAAE;EACX,OAAO;CACP,EAAC,CACF;AACD,SAAQ,KAAK,EAAE;AACf;AAGD,MAAMA,UAAkB;AACxB,MAAMC,gBAAwB;;;;AAK9B,SAAS,YAAYC,OAAoC;AACxD,QACC,SAAS,WAAW,MAAM,IAC1B,SAAY,WAAW,MAAM,IAC7B,KAAK,OAAO,MAAM,IAClB,WAAW,aAAa,MAAM;AAE/B;;;;AAKD,eAAe,QAAuB;CACrC,MAAM,0BAAU,IAAI;CACpB,MAAM,kCAAkB,IAAI;CAC5B,IAAIC,QAAuB;AAE3B,KAAI;EAEH,MAAM,QAAQ,MAAM,GAAG,eAAe;GACrC,KAAK;GACL,UAAU;EACV,EAAC;AAGF,OAAK,MAAM,QAAQ,MAClB,KAAI;GACH,MAAM,SAAS,MAAM,OAAO;AAG5B,QAAK,MAAM,GAAG,YAAY,IAAI,OAAO,QAAQ,OAAO,CACnD,KAAI,YAAY,YAAY,CAC3B,KAAI;IAQH,MAAM,mBAAmB,MAAM,YAAY,eAAe,EACzD,cAAc,KACd,EAAC;AACF,SAAK,MAAM,QAAQ,iBAClB,KAAI,KAAK,SAAS,IAAI,CAAE,iBAAgB,IAAI,KAAK,MAAM,GAAG,GAAG,CAAC;QACzD,SAAQ,IAAI,KAAK;GAEvB,QAAO,CAEP;EAGH,SAAQ,GAAG;GAEX,MAAM,MAAM,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;AACtD,WAAQ,OAAO,6BAA6B,KAAK,IAAI,IAAI,EAAE;EAC3D;CAEF,SAAQ,GAAG;AACX,UAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;CAClD;AAKD,MAAK,MAAM,QAAQ,QAAS,iBAAgB,OAAO,KAAK;AAExD,SAAQ,IACP,KAAK,UAAU;EACd,SAAS,MAAM,KAAK,QAAQ,CAAC,MAAM;EACnC,iBAAiB,MAAM,KAAK,gBAAgB,CAAC,MAAM;EACnD;CACA,EAAC,CACF;AACD;AAGD,QAAQ,GAAG,sBAAsB,MAAM,CAEtC,EAAC;AAGF,OAAO,CAAC,MAAM,CAAC,MAAM;AACpB,SAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAE;EAAE,OAAO,EAAE,WAAW,OAAO,EAAE;CAAE,EAAC,CAAC;AAC3E,SAAQ,KAAK,EAAE;AACf,EAAC"}
1
+ {"version":3,"file":"sniffer-routes-worker.mjs","names":["GkmFunction"],"sources":["../../src/deploy/sniffer-routes-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for route-based app sniffing.\n *\n * This script is executed in a subprocess with tsx loader,\n * which handles TypeScript compilation and path alias resolution.\n *\n * Usage:\n * node --import tsx ./sniffer-routes-worker.ts \"/path/to/app\" \"./src/endpoints/**\\/*.ts\"\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport type { Construct } from '@geekmidas/constructs';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Endpoint } from '@geekmidas/constructs/endpoints';\nimport { Function as GkmFunction } from '@geekmidas/constructs/functions';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport fg from 'fast-glob';\n\n// Get args from command line\nconst appPathArg = process.argv[2];\nconst routesPatternArg = process.argv[3];\n\nif (!appPathArg || !routesPatternArg) {\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: [],\n\t\t\terror: 'App path and routes pattern are required',\n\t\t}),\n\t);\n\tprocess.exit(1);\n}\n\n// After validation, these are guaranteed to be strings\nconst appPath: string = appPathArg;\nconst routesPattern: string = routesPatternArg;\n\n/**\n * Check if a value is a gkm construct.\n */\nfunction isConstruct(value: unknown): value is Construct {\n\treturn (\n\t\tEndpoint.isEndpoint(value) ||\n\t\tGkmFunction.isFunction(value) ||\n\t\tCron.isCron(value) ||\n\t\tSubscriber.isSubscriber(value)\n\t);\n}\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tconst envVars = new Set<string>();\n\tconst optionalEnvVars = new Set<string>();\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Find all route files matching the pattern\n\t\tconst files = await fg(routesPattern, {\n\t\t\tcwd: appPath,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Import each route file and find constructs\n\t\tfor (const file of files) {\n\t\t\ttry {\n\t\t\t\tconst module = await import(file);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [, exportValue] of Object.entries(module)) {\n\t\t\t\t\tif (isConstruct(exportValue)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// `markOptional`, so a key read through `.optional()` or\n\t\t\t\t\t\t\t// `.default()` comes back suffixed `?` and is reported\n\t\t\t\t\t\t\t// apart from the rest. Without it every sniffed read\n\t\t\t\t\t\t\t// looked required, and a key that is *absent by design*\n\t\t\t\t\t\t\t// — `AUTH_COOKIE_DOMAIN`, published only when a surface\n\t\t\t\t\t\t\t// has a domain to widen a cookie to — failed the deploy\n\t\t\t\t\t\t\t// as though it were a missing secret.\n\t\t\t\t\t\t\tconst constructEnvVars = await exportValue.getEnvironment({\n\t\t\t\t\t\t\t\tmarkOptional: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tfor (const name of constructEnvVars) {\n\t\t\t\t\t\t\t\tif (name.endsWith('?')) optionalEnvVars.add(name.slice(0, -1));\n\t\t\t\t\t\t\t\telse envVars.add(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Individual construct may fail, continue with others\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// Log import errors but continue with other files\n\t\t\t\tconst msg = e instanceof Error ? e.message : String(e);\n\t\t\t\tconsole.error(`[sniffer] Failed to import ${file}: ${msg}`);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Output result as JSON (last line of stdout)\n\t// A key required by one construct and optional in another is required: the\n\t// strictest read is the one that fails at runtime.\n\tfor (const name of envVars) optionalEnvVars.delete(name);\n\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: Array.from(envVars).sort(),\n\t\t\toptionalEnvVars: Array.from(optionalEnvVars).sort(),\n\t\t\terror,\n\t\t}),\n\t);\n}\n\n// Handle unhandled rejections\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;AAqBA,MAAM,aAAa,QAAQ,KAAK;AAChC,MAAM,mBAAmB,QAAQ,KAAK;AAEtC,IAAI,CAAC,cAAc,CAAC,kBAAkB;CACrC,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,CAAC;EACV,OAAO;CACR,CAAC,CACF;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,UAAkB;AACxB,MAAM,gBAAwB;;;;AAK9B,SAAS,YAAY,OAAoC;CACxD,OACC,SAAS,WAAW,KAAK,KACzBA,SAAY,WAAW,KAAK,KAC5B,KAAK,OAAO,KAAK,KACjB,WAAW,aAAa,KAAK;AAE/B;;;;AAKA,eAAe,QAAuB;CACrC,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,kCAAkB,IAAI,IAAY;CACxC,IAAI,QAAuB;CAE3B,IAAI;EAEH,MAAM,QAAQ,MAAM,GAAG,eAAe;GACrC,KAAK;GACL,UAAU;EACX,CAAC;EAGD,KAAK,MAAM,QAAQ,OAClB,IAAI;GACH,MAAM,SAAS,MAAM,OAAO;GAG5B,KAAK,MAAM,GAAG,gBAAgB,OAAO,QAAQ,MAAM,GAClD,IAAI,YAAY,WAAW,GAC1B,IAAI;IAQH,MAAM,mBAAmB,MAAM,YAAY,eAAe,EACzD,cAAc,KACf,CAAC;IACD,KAAK,MAAM,QAAQ,kBAClB,IAAI,KAAK,SAAS,GAAG,GAAG,gBAAgB,IAAI,KAAK,MAAM,GAAG,EAAE,CAAC;SACxD,QAAQ,IAAI,IAAI;GAEvB,QAAQ,CAER;EAGH,SAAS,GAAG;GAEX,MAAM,MAAM,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;GACrD,QAAQ,MAAM,8BAA8B,KAAK,IAAI,KAAK;EAC3D;CAEF,SAAS,GAAG;EACX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAKA,KAAK,MAAM,QAAQ,SAAS,gBAAgB,OAAO,IAAI;CAEvD,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,MAAM,KAAK,OAAO,CAAC,CAAC,KAAK;EAClC,iBAAiB,MAAM,KAAK,eAAe,CAAC,CAAC,KAAK;EAClD;CACD,CAAC,CACF;AACD;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
@@ -1,7 +1,17 @@
1
- const require_chunk = require('../chunk-CUT6urMc.cjs');
2
- const node_url = require_chunk.__toESM(require("node:url"));
3
-
1
+ let node_url = require("node:url");
4
2
  //#region src/deploy/sniffer-worker.ts
3
+ /**
4
+ * Subprocess worker for entry app sniffing.
5
+ *
6
+ * This script is executed in a subprocess with the sniffer-loader.ts
7
+ * registered, which intercepts @geekmidas/envkit imports.
8
+ *
9
+ * Usage:
10
+ * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts
11
+ *
12
+ * Output (JSON to stdout):
13
+ * { "envVars": ["PORT", "DATABASE_URL", ...], "error": null }
14
+ */
5
15
  const entryPath = process.argv[2];
6
16
  if (!entryPath) {
7
17
  console.log(JSON.stringify({
@@ -17,8 +27,7 @@ const validEntryPath = entryPath;
17
27
  async function sniff() {
18
28
  let error = null;
19
29
  try {
20
- const entryUrl = (0, node_url.pathToFileURL)(validEntryPath).href;
21
- await import(entryUrl);
30
+ await import((0, node_url.pathToFileURL)(validEntryPath).href);
22
31
  } catch (e) {
23
32
  error = e instanceof Error ? e.message : String(e);
24
33
  }
@@ -39,6 +48,6 @@ sniff().catch((e) => {
39
48
  }));
40
49
  process.exit(1);
41
50
  });
42
-
43
51
  //#endregion
52
+
44
53
  //# sourceMappingURL=sniffer-worker.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-worker.cjs","names":["validEntryPath: string","error: string | null"],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for entry app sniffing.\n *\n * This script is executed in a subprocess with the sniffer-loader.ts\n * registered, which intercepts @geekmidas/envkit imports.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport { pathToFileURL } from 'node:url';\nimport type { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Get the entry file path from command line args\nconst entryPath = process.argv[2] as string | undefined;\n\nif (!entryPath) {\n\tconsole.log(\n\t\tJSON.stringify({ envVars: [], error: 'No entry file path provided' }),\n\t);\n\tprocess.exit(1);\n}\n\n// entryPath is guaranteed to be defined after the check above\nconst validEntryPath: string = entryPath;\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Import the entry file - this triggers:\n\t\t// 1. Entry imports config module\n\t\t// 2. Config module imports @geekmidas/envkit (intercepted by loader)\n\t\t// 3. Config creates EnvironmentParser (actually SnifferEnvironmentParser)\n\t\t// 4. Config calls .create() and .parse()\n\t\t// 5. Sniffer captures all accessed env var names\n\t\tconst entryUrl = pathToFileURL(validEntryPath).href;\n\t\tawait import(entryUrl);\n\t} catch (e) {\n\t\t// Entry may fail due to missing env vars or other runtime issues.\n\t\t// This is expected - we still capture the env vars that were accessed.\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Retrieve captured env vars from the global sniffer\n\tconst sniffer = globalThis.__envSniffer;\n\tconst envVars = sniffer ? sniffer.getEnvironmentVariables() : [];\n\tconst optionalEnvVars = sniffer ? sniffer.getOptionalVariables() : [];\n\n\t// Output result as JSON\n\tconsole.log(JSON.stringify({ envVars, optionalEnvVars, error }));\n}\n\n// Handle unhandled rejections (fire-and-forget promises)\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;AAuBA,MAAM,YAAY,QAAQ,KAAK;AAE/B,KAAK,WAAW;AACf,SAAQ,IACP,KAAK,UAAU;EAAE,SAAS,CAAE;EAAE,OAAO;CAA+B,EAAC,CACrE;AACD,SAAQ,KAAK,EAAE;AACf;AAGD,MAAMA,iBAAyB;;;;AAK/B,eAAe,QAAuB;CACrC,IAAIC,QAAuB;AAE3B,KAAI;EAOH,MAAM,WAAW,4BAAc,eAAe,CAAC;AAC/C,QAAM,OAAO;CACb,SAAQ,GAAG;AAGX,UAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;CAClD;CAGD,MAAM,UAAU,WAAW;CAC3B,MAAM,UAAU,UAAU,QAAQ,yBAAyB,GAAG,CAAE;CAChE,MAAM,kBAAkB,UAAU,QAAQ,sBAAsB,GAAG,CAAE;AAGrE,SAAQ,IAAI,KAAK,UAAU;EAAE;EAAS;EAAiB;CAAO,EAAC,CAAC;AAChE;AAGD,QAAQ,GAAG,sBAAsB,MAAM,CAEtC,EAAC;AAGF,OAAO,CAAC,MAAM,CAAC,MAAM;AACpB,SAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAE;EAAE,OAAO,EAAE,WAAW,OAAO,EAAE;CAAE,EAAC,CAAC;AAC3E,SAAQ,KAAK,EAAE;AACf,EAAC"}
1
+ {"version":3,"file":"sniffer-worker.cjs","names":["pathToFileURL"],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for entry app sniffing.\n *\n * This script is executed in a subprocess with the sniffer-loader.ts\n * registered, which intercepts @geekmidas/envkit imports.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport { pathToFileURL } from 'node:url';\nimport type { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Get the entry file path from command line args\nconst entryPath = process.argv[2] as string | undefined;\n\nif (!entryPath) {\n\tconsole.log(\n\t\tJSON.stringify({ envVars: [], error: 'No entry file path provided' }),\n\t);\n\tprocess.exit(1);\n}\n\n// entryPath is guaranteed to be defined after the check above\nconst validEntryPath: string = entryPath;\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Import the entry file - this triggers:\n\t\t// 1. Entry imports config module\n\t\t// 2. Config module imports @geekmidas/envkit (intercepted by loader)\n\t\t// 3. Config creates EnvironmentParser (actually SnifferEnvironmentParser)\n\t\t// 4. Config calls .create() and .parse()\n\t\t// 5. Sniffer captures all accessed env var names\n\t\tconst entryUrl = pathToFileURL(validEntryPath).href;\n\t\tawait import(entryUrl);\n\t} catch (e) {\n\t\t// Entry may fail due to missing env vars or other runtime issues.\n\t\t// This is expected - we still capture the env vars that were accessed.\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Retrieve captured env vars from the global sniffer\n\tconst sniffer = globalThis.__envSniffer;\n\tconst envVars = sniffer ? sniffer.getEnvironmentVariables() : [];\n\tconst optionalEnvVars = sniffer ? sniffer.getOptionalVariables() : [];\n\n\t// Output result as JSON\n\tconsole.log(JSON.stringify({ envVars, optionalEnvVars, error }));\n}\n\n// Handle unhandled rejections (fire-and-forget promises)\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAM,YAAY,QAAQ,KAAK;AAE/B,IAAI,CAAC,WAAW;CACf,QAAQ,IACP,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO;CAA8B,CAAC,CACrE;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,iBAAyB;;;;AAK/B,eAAe,QAAuB;CACrC,IAAI,QAAuB;CAE3B,IAAI;EAQH,MAAM,QAAA,GADWA,SAAAA,cAAAA,CAAc,cAAc,CAAC,CAAC;CAEhD,SAAS,GAAG;EAGX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAGA,MAAM,UAAU,WAAW;CAC3B,MAAM,UAAU,UAAU,QAAQ,wBAAwB,IAAI,CAAC;CAC/D,MAAM,kBAAkB,UAAU,QAAQ,qBAAqB,IAAI,CAAC;CAGpE,QAAQ,IAAI,KAAK,UAAU;EAAE;EAAS;EAAiB;CAAM,CAAC,CAAC;AAChE;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { SnifferEnvironmentParser } from "@geekmidas/envkit/sniffer";
2
-
3
2
  //#region src/deploy/sniffer-worker.d.ts
4
-
5
3
  declare global {
6
4
  var __envSniffer: SnifferEnvironmentParser | undefined;
7
5
  }
8
- //# sourceMappingURL=sniffer-worker.d.ts.map
6
+ //#endregion
9
7
  //# sourceMappingURL=sniffer-worker.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-worker.d.cts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":[],"mappings":";;;;;oBAmBmB"}
1
+ {"version":3,"file":"sniffer-worker.d.cts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"mappings":";;QAiBQ;MAEH,cAAc"}
@@ -1,9 +1,7 @@
1
1
  import { SnifferEnvironmentParser } from "@geekmidas/envkit/sniffer";
2
-
3
2
  //#region src/deploy/sniffer-worker.d.ts
4
-
5
3
  declare global {
6
4
  var __envSniffer: SnifferEnvironmentParser | undefined;
7
5
  }
8
- //# sourceMappingURL=sniffer-worker.d.ts.map
6
+ //#endregion
9
7
  //# sourceMappingURL=sniffer-worker.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-worker.d.mts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":[],"mappings":";;;;;oBAmBmB"}
1
+ {"version":3,"file":"sniffer-worker.d.mts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"mappings":";;QAiBQ;MAEH,cAAc"}
@@ -1,6 +1,17 @@
1
1
  import { pathToFileURL } from "node:url";
2
-
3
2
  //#region src/deploy/sniffer-worker.ts
3
+ /**
4
+ * Subprocess worker for entry app sniffing.
5
+ *
6
+ * This script is executed in a subprocess with the sniffer-loader.ts
7
+ * registered, which intercepts @geekmidas/envkit imports.
8
+ *
9
+ * Usage:
10
+ * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts
11
+ *
12
+ * Output (JSON to stdout):
13
+ * { "envVars": ["PORT", "DATABASE_URL", ...], "error": null }
14
+ */
4
15
  const entryPath = process.argv[2];
5
16
  if (!entryPath) {
6
17
  console.log(JSON.stringify({
@@ -16,8 +27,7 @@ const validEntryPath = entryPath;
16
27
  async function sniff() {
17
28
  let error = null;
18
29
  try {
19
- const entryUrl = pathToFileURL(validEntryPath).href;
20
- await import(entryUrl);
30
+ await import(pathToFileURL(validEntryPath).href);
21
31
  } catch (e) {
22
32
  error = e instanceof Error ? e.message : String(e);
23
33
  }
@@ -38,6 +48,7 @@ sniff().catch((e) => {
38
48
  }));
39
49
  process.exit(1);
40
50
  });
41
-
42
51
  //#endregion
52
+ export {};
53
+
43
54
  //# sourceMappingURL=sniffer-worker.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-worker.mjs","names":["validEntryPath: string","error: string | null"],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for entry app sniffing.\n *\n * This script is executed in a subprocess with the sniffer-loader.ts\n * registered, which intercepts @geekmidas/envkit imports.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport { pathToFileURL } from 'node:url';\nimport type { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Get the entry file path from command line args\nconst entryPath = process.argv[2] as string | undefined;\n\nif (!entryPath) {\n\tconsole.log(\n\t\tJSON.stringify({ envVars: [], error: 'No entry file path provided' }),\n\t);\n\tprocess.exit(1);\n}\n\n// entryPath is guaranteed to be defined after the check above\nconst validEntryPath: string = entryPath;\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Import the entry file - this triggers:\n\t\t// 1. Entry imports config module\n\t\t// 2. Config module imports @geekmidas/envkit (intercepted by loader)\n\t\t// 3. Config creates EnvironmentParser (actually SnifferEnvironmentParser)\n\t\t// 4. Config calls .create() and .parse()\n\t\t// 5. Sniffer captures all accessed env var names\n\t\tconst entryUrl = pathToFileURL(validEntryPath).href;\n\t\tawait import(entryUrl);\n\t} catch (e) {\n\t\t// Entry may fail due to missing env vars or other runtime issues.\n\t\t// This is expected - we still capture the env vars that were accessed.\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Retrieve captured env vars from the global sniffer\n\tconst sniffer = globalThis.__envSniffer;\n\tconst envVars = sniffer ? sniffer.getEnvironmentVariables() : [];\n\tconst optionalEnvVars = sniffer ? sniffer.getOptionalVariables() : [];\n\n\t// Output result as JSON\n\tconsole.log(JSON.stringify({ envVars, optionalEnvVars, error }));\n}\n\n// Handle unhandled rejections (fire-and-forget promises)\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;AAuBA,MAAM,YAAY,QAAQ,KAAK;AAE/B,KAAK,WAAW;AACf,SAAQ,IACP,KAAK,UAAU;EAAE,SAAS,CAAE;EAAE,OAAO;CAA+B,EAAC,CACrE;AACD,SAAQ,KAAK,EAAE;AACf;AAGD,MAAMA,iBAAyB;;;;AAK/B,eAAe,QAAuB;CACrC,IAAIC,QAAuB;AAE3B,KAAI;EAOH,MAAM,WAAW,cAAc,eAAe,CAAC;AAC/C,QAAM,OAAO;CACb,SAAQ,GAAG;AAGX,UAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;CAClD;CAGD,MAAM,UAAU,WAAW;CAC3B,MAAM,UAAU,UAAU,QAAQ,yBAAyB,GAAG,CAAE;CAChE,MAAM,kBAAkB,UAAU,QAAQ,sBAAsB,GAAG,CAAE;AAGrE,SAAQ,IAAI,KAAK,UAAU;EAAE;EAAS;EAAiB;CAAO,EAAC,CAAC;AAChE;AAGD,QAAQ,GAAG,sBAAsB,MAAM,CAEtC,EAAC;AAGF,OAAO,CAAC,MAAM,CAAC,MAAM;AACpB,SAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAE;EAAE,OAAO,EAAE,WAAW,OAAO,EAAE;CAAE,EAAC,CAAC;AAC3E,SAAQ,KAAK,EAAE;AACf,EAAC"}
1
+ {"version":3,"file":"sniffer-worker.mjs","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for entry app sniffing.\n *\n * This script is executed in a subprocess with the sniffer-loader.ts\n * registered, which intercepts @geekmidas/envkit imports.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport { pathToFileURL } from 'node:url';\nimport type { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Get the entry file path from command line args\nconst entryPath = process.argv[2] as string | undefined;\n\nif (!entryPath) {\n\tconsole.log(\n\t\tJSON.stringify({ envVars: [], error: 'No entry file path provided' }),\n\t);\n\tprocess.exit(1);\n}\n\n// entryPath is guaranteed to be defined after the check above\nconst validEntryPath: string = entryPath;\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Import the entry file - this triggers:\n\t\t// 1. Entry imports config module\n\t\t// 2. Config module imports @geekmidas/envkit (intercepted by loader)\n\t\t// 3. Config creates EnvironmentParser (actually SnifferEnvironmentParser)\n\t\t// 4. Config calls .create() and .parse()\n\t\t// 5. Sniffer captures all accessed env var names\n\t\tconst entryUrl = pathToFileURL(validEntryPath).href;\n\t\tawait import(entryUrl);\n\t} catch (e) {\n\t\t// Entry may fail due to missing env vars or other runtime issues.\n\t\t// This is expected - we still capture the env vars that were accessed.\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Retrieve captured env vars from the global sniffer\n\tconst sniffer = globalThis.__envSniffer;\n\tconst envVars = sniffer ? sniffer.getEnvironmentVariables() : [];\n\tconst optionalEnvVars = sniffer ? sniffer.getOptionalVariables() : [];\n\n\t// Output result as JSON\n\tconsole.log(JSON.stringify({ envVars, optionalEnvVars, error }));\n}\n\n// Handle unhandled rejections (fire-and-forget promises)\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAM,YAAY,QAAQ,KAAK;AAE/B,IAAI,CAAC,WAAW;CACf,QAAQ,IACP,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO;CAA8B,CAAC,CACrE;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,iBAAyB;;;;AAK/B,eAAe,QAAuB;CACrC,IAAI,QAAuB;CAE3B,IAAI;EAQH,MAAM,OADW,cAAc,cAAc,CAAC,CAAC;CAEhD,SAAS,GAAG;EAGX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAGA,MAAM,UAAU,WAAW;CAC3B,MAAM,UAAU,UAAU,QAAQ,wBAAwB,IAAI,CAAC;CAC/D,MAAM,kBAAkB,UAAU,QAAQ,qBAAqB,IAAI,CAAC;CAGpE,QAAQ,IAAI,KAAK,UAAU;EAAE;EAAS;EAAiB;CAAM,CAAC,CAAC;AAChE;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
@@ -1,50 +1,8 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
1
2
  import { relative } from "node:path";
2
3
  import { assertDerivations, canonicalId } from "@geekmidas/manifest";
3
4
  import fg from "fast-glob";
4
5
  import kebabCase$1 from "lodash.kebabcase";
5
-
6
- //#region src/types.ts
7
- function isPartitionedRoutes(routes) {
8
- return typeof routes === "object" && routes !== null && !Array.isArray(routes) && "paths" in routes;
9
- }
10
- /**
11
- * The backend a project gets when it says nothing, by where it deploys.
12
- *
13
- * Flat defaults could not be right for both: `upstash` on a single box means a
14
- * SaaS round-trip for a cache the database could have held, and `minio` on AWS
15
- * means running a bucket beside S3. So the default is a function of the target,
16
- * and an app that says nothing gets the obvious answer in both places — which
17
- * is the whole of what "zero config" can mean once there is more than one
18
- * target.
19
- *
20
- * `server` covers Dokploy and a bare host alike: the question these answer is
21
- * whether the app is next to a managed cloud or next to its own containers, and
22
- * on that question the two are the same.
23
- *
24
- * A per-construct, per-stage override is the layer above this — see
25
- * `constructs-outstanding.md` — so two buckets in one app can differ. This is
26
- * only what happens when nobody has said anything at all.
27
- */
28
- const DEFAULT_CACHE = {
29
- aws: "upstash",
30
- server: "db"
31
- };
32
- /** Where a bucket lives when nobody said — see {@link DEFAULT_CACHE}. */
33
- const DEFAULT_STORAGE = {
34
- aws: "s3",
35
- server: "minio"
36
- };
37
- /**
38
- * Who delivers mail when nobody said.
39
- *
40
- * Flat, unlike the others, and deliberately: mail is a SaaS on every target.
41
- * There is no self-hosted preset to default a container deploy to — Mailpit is
42
- * a development inbox, not a sender — so `server` has no answer of its own to
43
- * give and would only be `ses` written twice.
44
- */
45
- const DEFAULT_EMAIL = "ses";
46
-
47
- //#endregion
48
6
  //#region src/generators/Generator.ts
49
7
  /**
50
8
  * Zod v4 maintains a process-wide registry of schemas registered via
@@ -67,13 +25,8 @@ var ConstructGenerator = class {
67
25
  return generator.build(context, constructs, outputDir, options);
68
26
  }
69
27
  async load(patterns, cwd = process.cwd(), bustCache = false) {
70
- const logger$1 = console;
71
- let globPatterns;
72
- let partitionFn;
73
- if (isPartitionedRoutes(patterns)) {
74
- globPatterns = Array.isArray(patterns.paths) ? patterns.paths : [patterns.paths];
75
- partitionFn = patterns.partition;
76
- } else globPatterns = Array.isArray(patterns) ? patterns : patterns ? [patterns] : [];
28
+ const logger = console;
29
+ const globPatterns = Array.isArray(patterns) ? patterns : patterns ? [patterns] : [];
77
30
  const files = fg.stream(globPatterns, {
78
31
  cwd,
79
32
  absolute: true
@@ -82,9 +35,7 @@ var ConstructGenerator = class {
82
35
  const constructs = [];
83
36
  for await (const f of files) try {
84
37
  const file = f.toString();
85
- const importPath = bustCache ? `${file}?t=${Date.now()}` : file;
86
- const module = await import(importPath);
87
- const partition = partitionFn ? partitionFn(file) : void 0;
38
+ const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
88
39
  for (const [key, construct] of Object.entries(module)) if (this.isConstruct(construct)) constructs.push({
89
40
  key,
90
41
  name: kebabCase$1(key),
@@ -92,21 +43,39 @@ var ConstructGenerator = class {
92
43
  path: {
93
44
  absolute: file,
94
45
  relative: relative(process.cwd(), file)
95
- },
96
- partition
46
+ }
97
47
  });
98
48
  } catch (error) {
99
49
  const err = error;
100
- logger$1.error(`Failed to load ${f}: ${err.message}`);
101
- if (err.stack) logger$1.error(err.stack);
50
+ logger.error(`Failed to load ${f}: ${err.message}`);
51
+ if (err.stack) logger.error(err.stack);
102
52
  throw error;
103
53
  }
104
54
  return constructs;
105
55
  }
106
56
  };
107
-
108
57
  //#endregion
109
58
  //#region src/reconcile/discover.ts
59
+ /**
60
+ * Discovery — one glob, one structural test.
61
+ *
62
+ * A glob per kind is the same specialness the construct model removes, and
63
+ * resources have no kind to be listed under: a declared `ObjectStorage` would
64
+ * never be found by `routes:` or `crons:`. So there is one `constructs` glob,
65
+ * every export of every matching module is inspected, and the per-kind
66
+ * `isConstruct` checks collapse into a single question — does it have an id and
67
+ * can it declare?
68
+ *
69
+ * Structural rather than `instanceof` on purpose. A construct from a different
70
+ * copy of `@geekmidas/constructs` — a linked workspace, two versions in a
71
+ * lockfile — is still a construct, and `instanceof` is exactly the check that
72
+ * says otherwise.
73
+ */
74
+ var discover_exports = /* @__PURE__ */ __exportAll({
75
+ DuplicateConstruct: () => DuplicateConstruct,
76
+ discover: () => discover,
77
+ isDeclarable: () => isDeclarable
78
+ });
110
79
  /** Matches the rest of the CLI, which logs through `console` directly. */
111
80
  const logger = console;
112
81
  /**
@@ -161,9 +130,13 @@ async function discover(options) {
161
130
  const file = found.toString();
162
131
  const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
163
132
  for (const [exportName, exported] of Object.entries(module)) {
164
- if (!isDeclarable(exported)) continue;
133
+ if (!isDeclarable(exported)) {
134
+ if (options.runnables) recordRunnable(options.runnables, exported);
135
+ continue;
136
+ }
165
137
  if (seen.has(exported)) continue;
166
138
  seen.add(exported);
139
+ if (options.runnables && typeof exported.owner === "string") recordRunnable(options.runnables, exported);
167
140
  for (const declaration of exported.declare()) {
168
141
  const id = canonicalId(declaration.id);
169
142
  const source = relative(cwd, file);
@@ -176,7 +149,8 @@ async function discover(options) {
176
149
  sources[id] = source;
177
150
  if (out) out[id] = {
178
151
  file,
179
- exportName
152
+ exportName,
153
+ construct: exported
180
154
  };
181
155
  }
182
156
  }
@@ -186,6 +160,25 @@ async function discover(options) {
186
160
  return manifest;
187
161
  }
188
162
  /**
163
+ * Record a runnable's edges under the construct that owns it — the surface an
164
+ * endpoint was built from, or the worker a cron or subscriber was. Anything
165
+ * with no owner, or that is not a runnable at all, is left alone.
166
+ */
167
+ function recordRunnable(runnables, exported) {
168
+ if (typeof exported !== "object" || exported === null) return;
169
+ const runnable = exported;
170
+ const owner = typeof runnable.surface?.id === "string" ? runnable.surface.id : typeof runnable.owner === "string" ? runnable.owner : void 0;
171
+ if (!owner || !Array.isArray(runnable.constructs)) return;
172
+ const key = canonicalId(owner);
173
+ const edges = runnables[key] ?? [];
174
+ runnables[key] = edges;
175
+ for (const id of runnable.constructs) {
176
+ if (typeof id !== "string") continue;
177
+ const target = canonicalId(id);
178
+ if (!edges.includes(target)) edges.push(target);
179
+ }
180
+ }
181
+ /**
189
182
  * Say so when a glob was configured and found nothing.
190
183
  *
191
184
  * The glob is not a filter over declarations already known — it is *how they
@@ -223,7 +216,7 @@ var DuplicateConstruct = class extends Error {
223
216
  this.sources = sources;
224
217
  }
225
218
  };
226
-
227
219
  //#endregion
228
- export { ConstructGenerator, DEFAULT_CACHE, DEFAULT_EMAIL, DEFAULT_STORAGE, discover, isDeclarable, isPartitionedRoutes };
229
- //# sourceMappingURL=discover-CAlFgYec.mjs.map
220
+ export { ConstructGenerator as i, discover_exports as n, isDeclarable as r, discover as t };
221
+
222
+ //# sourceMappingURL=discover-Cf2jAcgF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover-Cf2jAcgF.mjs","names":["kebabCase"],"sources":["../src/generators/Generator.ts","../src/reconcile/discover.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport type { Construct } from '@geekmidas/constructs';\nimport fg from 'fast-glob';\nimport kebabCase from 'lodash.kebabcase';\nimport type { BuildContext } from '../build/types';\nimport type { MainProvider, Routes } from '../types';\n\n/**\n * Zod v4 maintains a process-wide registry of schemas registered via\n * `.meta({ id })`. When we cache-bust user module imports (by appending a\n * `?t=timestamp` query), those modules re-execute and try to register the\n * same ids again, which throws `ID X already exists in the registry`.\n *\n * Clearing the registry in the CLI process is safe: the user's running\n * server lives in a subprocess and has its own isolated registry.\n *\n * Exported for tests.\n */\nexport function clearZodGlobalRegistry(): void {\n\tconst registry = (\n\t\tglobalThis as { __zod_globalRegistry?: { clear?: () => void } }\n\t).__zod_globalRegistry;\n\tif (registry && typeof registry.clear === 'function') {\n\t\tregistry.clear();\n\t}\n}\n\nexport interface GeneratorOptions {\n\t/** Where the build deploys: one Lambda per construct, or one process. */\n\ttarget?: MainProvider;\n\t/**\n\t * What a handler path in the manifest is relative to — the workspace root,\n\t * which is where `sst.config.ts` runs and resolves it from.\n\t */\n\troot?: string;\n\t[key: string]: any;\n}\n\nexport abstract class ConstructGenerator<T extends Construct, R = void> {\n\tabstract isConstruct(value: any): value is T;\n\n\tstatic async build<T extends Construct, R = void>(\n\t\tcontext: BuildContext,\n\t\toutputDir: string,\n\t\tgenerator: ConstructGenerator<T, R>,\n\t\tpatterns?: Routes,\n\t\toptions?: GeneratorOptions,\n\t): Promise<R> {\n\t\tconst constructs = await generator.load(patterns);\n\t\treturn generator.build(context, constructs, outputDir, options);\n\t}\n\n\tabstract build(\n\t\tcontext: BuildContext,\n\t\tconstructs: GeneratedConstruct<T>[],\n\t\toutputDir: string,\n\t\toptions?: GeneratorOptions,\n\t): Promise<R>;\n\n\tasync load(\n\t\tpatterns?: Routes,\n\t\tcwd = process.cwd(),\n\t\tbustCache = false,\n\t): Promise<GeneratedConstruct<T>[]> {\n\t\tconst logger = console;\n\n\t\tconst globPatterns = Array.isArray(patterns)\n\t\t\t? patterns\n\t\t\t: patterns\n\t\t\t\t? [patterns]\n\t\t\t\t: [];\n\n\t\t// Find all files\n\t\tconst files = fg.stream(globPatterns, {\n\t\t\tcwd,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Cache-busted re-imports re-execute user modules, which would try to\n\t\t// re-register Zod schemas with the same `.meta({ id })`. Clear the\n\t\t// global registry once per load to prevent duplicate-id errors.\n\t\tif (bustCache) {\n\t\t\tclearZodGlobalRegistry();\n\t\t}\n\n\t\t// Load constructs\n\t\tconst constructs: GeneratedConstruct<T>[] = [];\n\n\t\tfor await (const f of files) {\n\t\t\ttry {\n\t\t\t\tconst file = f.toString();\n\t\t\t\t// Append cache-busting query param to force re-import of changed modules\n\t\t\t\tconst importPath = bustCache ? `${file}?t=${Date.now()}` : file;\n\t\t\t\tconst module = await import(importPath);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [key, construct] of Object.entries(module)) {\n\t\t\t\t\tif (this.isConstruct(construct)) {\n\t\t\t\t\t\tconstructs.push({\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tname: kebabCase(key),\n\t\t\t\t\t\t\tconstruct,\n\t\t\t\t\t\t\tpath: {\n\t\t\t\t\t\t\t\tabsolute: file,\n\t\t\t\t\t\t\t\trelative: relative(process.cwd(), file),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconst err = error as Error;\n\t\t\t\tlogger.error(`Failed to load ${f}: ${err.message}`);\n\t\t\t\tif (err.stack) {\n\t\t\t\t\tlogger.error(err.stack);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\treturn constructs;\n\t}\n}\n\nexport interface GeneratedConstruct<T extends Construct> {\n\tkey: string;\n\tname: string;\n\tconstruct: T;\n\tpath: {\n\t\tabsolute: string;\n\t\trelative: string;\n\t};\n}\n","/**\n * Discovery — one glob, one structural test.\n *\n * A glob per kind is the same specialness the construct model removes, and\n * resources have no kind to be listed under: a declared `ObjectStorage` would\n * never be found by `routes:` or `crons:`. So there is one `constructs` glob,\n * every export of every matching module is inspected, and the per-kind\n * `isConstruct` checks collapse into a single question — does it have an id and\n * can it declare?\n *\n * Structural rather than `instanceof` on purpose. A construct from a different\n * copy of `@geekmidas/constructs` — a linked workspace, two versions in a\n * lockfile — is still a construct, and `instanceof` is exactly the check that\n * says otherwise.\n */\n\nimport { relative } from 'node:path';\nimport {\n\tassertDerivations,\n\ttype ConstructManifest,\n\tcanonicalId,\n\ttype Declaration,\n} from '@geekmidas/manifest';\nimport fg from 'fast-glob';\nimport { clearZodGlobalRegistry } from '../generators/Generator';\n\n/** Matches the rest of the CLI, which logs through `console` directly. */\nconst logger = console;\n\n/** The construct face discovery needs: an id, and the ability to declare. */\ninterface Declarable {\n\tid: string;\n\tdeclare(): Declaration[];\n}\n\n/**\n * Whether a module export is a construct.\n *\n * Deliberately loose about what else it carries — a construct that also has a\n * `service` is still a construct, and requiring one would exclude the kinds that\n * own no address.\n */\nexport function isDeclarable(value: unknown): value is Declarable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Declarable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\tcandidate.id.length > 0 &&\n\t\ttypeof candidate.declare === 'function'\n\t);\n}\n\nexport interface DiscoverOptions {\n\t/** The glob(s) to search. One pattern, not one per kind. */\n\tpatterns: string | readonly string[];\n\tcwd?: string;\n\t/**\n\t * Re-import changed modules, for the dev watcher.\n\t *\n\t * A single glob makes discovery more central, not less: a new construct file\n\t * has to be picked up on `add`, not only on `change`.\n\t */\n\tbustCache?: boolean;\n\t/**\n\t * Filled in with where each construct was found, when provided.\n\t *\n\t * Discovery is the only thing that knows: it globbed the files and imported\n\t * them. Everything downstream that needs to *write* an import — the build,\n\t * generating a server entry that reads a surface's logger — would otherwise\n\t * have to be told the path in config, which is the string this removes.\n\t *\n\t * An out-parameter rather than a second return value so that every existing\n\t * caller, which wants the manifest and nothing else, is unchanged.\n\t */\n\tsources?: Record<string, ConstructSource>;\n\t/**\n\t * Filled in, when provided, with the ids each owner's runnables declared an\n\t * edge to — keyed by the surface an endpoint was built from, or the worker\n\t * a cron or subscriber was.\n\t *\n\t * A runnable is not a declaration: a surface's endpoints are found by the\n\t * glob, not listed by the surface, so its node says `endpoints: []` until a\n\t * build folds the routes in. Anything deciding what an app's process reaches\n\t * — which keys its container is given — needs those edges before any build,\n\t * and discovery is already importing the files they are in.\n\t */\n\trunnables?: Record<string, string[]>;\n}\n\n/** Where a construct was declared, and under what name. */\nexport interface ConstructSource {\n\t/** Absolute path to the module that exported it. */\n\tfile: string;\n\t/** The name it was exported as — what an import statement has to say. */\n\texportName: string;\n\t/**\n\t * The exported construct itself.\n\t *\n\t * What a declaration cannot say — whether it serves itself — the object can\n\t * be asked, and discovery already imported it.\n\t */\n\tconstruct: unknown;\n}\n\n/**\n * Build the construct manifest for a project.\n *\n * Runs the manifest's own validation before returning, so an app is wrong here\n * — where the error names a file — rather than at deploy.\n *\n * @throws {DuplicateConstruct} when two exports claim one id.\n */\nexport async function discover(\n\toptions: DiscoverOptions,\n): Promise<ConstructManifest> {\n\tconst {\n\t\tpatterns,\n\t\tcwd = process.cwd(),\n\t\tbustCache = false,\n\t\tsources: out,\n\t} = options;\n\n\t// Re-importing user modules re-executes them, and Zod v4 throws on a\n\t// re-registered `.meta({ id })`. Same reason the generators clear it.\n\tif (bustCache) clearZodGlobalRegistry();\n\n\tconst manifest: Record<string, Declaration> = {};\n\t/** Which file declared each id, for the error when two of them do. */\n\tconst sources: Record<string, string> = {};\n\t/**\n\t * Constructs already seen, by identity.\n\t *\n\t * A re-export is the *same object* reached through a second file — ESM\n\t * bindings are live, so `export * from './database.js'` hands back the\n\t * binding rather than a copy. Without this, a barrel file made every\n\t * construct in it appear declared twice, and `constructs/index.ts` is the\n\t * first thing anyone writes in a shared folder.\n\t *\n\t * Identity rather than file is also the more honest rule: what may not\n\t * happen twice is two *different* constructs claiming one id, and that is\n\t * still an error below.\n\t */\n\tconst seen = new WeakSet<object>();\n\n\tconst globs = Array.isArray(patterns) ? [...patterns] : [patterns as string];\n\tconst files = fg.stream(globs, { cwd, absolute: true });\n\n\t/** Matched files, for the diagnostic below. */\n\tlet matched = 0;\n\n\tfor await (const found of files) {\n\t\tmatched++;\n\t\tconst file = found.toString();\n\t\tconst module = await import(bustCache ? `${file}?t=${Date.now()}` : file);\n\n\t\tfor (const [exportName, exported] of Object.entries(module)) {\n\t\t\tif (!isDeclarable(exported)) {\n\t\t\t\tif (options.runnables) recordRunnable(options.runnables, exported);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// The same construct, reached again through a re-export. Skipped\n\t\t\t// rather than re-declared: it has already claimed its id, from the\n\t\t\t// file that defined it.\n\t\t\tif (seen.has(exported as object)) continue;\n\t\t\tseen.add(exported as object);\n\n\t\t\t// A construct that is also something a process runs — a queue and its\n\t\t\t// consumer, built from a worker — reaches what it depends on through\n\t\t\t// that process, exactly as an endpoint or a cron does.\n\t\t\tif (\n\t\t\t\toptions.runnables &&\n\t\t\t\ttypeof (exported as { owner?: unknown }).owner === 'string'\n\t\t\t) {\n\t\t\t\trecordRunnable(options.runnables, exported);\n\t\t\t}\n\n\t\t\tfor (const declaration of exported.declare()) {\n\t\t\t\t// Canonicalise here too: a construct built by hand rather than through\n\t\t\t\t// a constructor is still subject to the same identity rule.\n\t\t\t\tconst id = canonicalId(declaration.id);\n\t\t\t\tconst source = relative(cwd, file);\n\n\t\t\t\tconst claimed = sources[id];\n\t\t\t\tif (claimed !== undefined && claimed !== source) {\n\t\t\t\t\tthrow new DuplicateConstruct(id, [claimed, source]);\n\t\t\t\t}\n\n\t\t\t\tmanifest[id] = { ...declaration, id };\n\t\t\t\tsources[id] = source;\n\t\t\t\tif (out) out[id] = { file, exportName, construct: exported };\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reference integrity before anyone reads it — a schema tenant naming a\n\t// database that was deleted is a manifest error, not a reconcile failure.\n\tassertDerivations(manifest);\n\n\twarnIfNothingFound(globs, matched, Object.keys(manifest).length);\n\n\treturn manifest;\n}\n\n/**\n * Record a runnable's edges under the construct that owns it — the surface an\n * endpoint was built from, or the worker a cron or subscriber was. Anything\n * with no owner, or that is not a runnable at all, is left alone.\n */\nfunction recordRunnable(\n\trunnables: Record<string, string[]>,\n\texported: unknown,\n): void {\n\tif (typeof exported !== 'object' || exported === null) return;\n\n\tconst runnable = exported as {\n\t\tsurface?: { id?: unknown };\n\t\towner?: unknown;\n\t\tconstructs?: unknown;\n\t};\n\tconst owner =\n\t\ttypeof runnable.surface?.id === 'string'\n\t\t\t? runnable.surface.id\n\t\t\t: typeof runnable.owner === 'string'\n\t\t\t\t? runnable.owner\n\t\t\t\t: undefined;\n\tif (!owner || !Array.isArray(runnable.constructs)) return;\n\n\tconst key = canonicalId(owner);\n\tconst edges = runnables[key] ?? [];\n\trunnables[key] = edges;\n\tfor (const id of runnable.constructs) {\n\t\tif (typeof id !== 'string') continue;\n\t\tconst target = canonicalId(id);\n\t\tif (!edges.includes(target)) edges.push(target);\n\t}\n}\n\n/**\n * Say so when a glob was configured and found nothing.\n *\n * The glob is not a filter over declarations already known — it is *how they\n * are found*, by importing what it matches. So a file it misses is a\n * declaration that does not exist, and every symptom of that appears somewhere\n * other than the cause: no container starts, no env key is written, and the\n * application fails on first use against a resource it can see in its own\n * source.\n *\n * Nothing reported it before, because an unmatched file is indistinguishable\n * from a file nobody wrote. These two cases are the ones that are *not*\n * ambiguous — a glob was configured, so something was expected.\n *\n * Silent when no glob is configured at all: that is a project which has not\n * adopted constructs, and has nothing to be missing.\n */\nfunction warnIfNothingFound(\n\tglobs: readonly string[],\n\tmatched: number,\n\tdeclared: number,\n): void {\n\tif (globs.length === 0) return;\n\n\tif (matched === 0) {\n\t\tlogger.warn(\n\t\t\t`\\n⚠️ The constructs glob matched no files, so nothing was declared.\\n` +\n\t\t\t\t` Patterns: ${globs.join(', ')}\\n` +\n\t\t\t\t` Nothing will be provisioned — no containers, no env keys, no ` +\n\t\t\t\t`resources.\\n` +\n\t\t\t\t` A common cause is depth: '*.ts' matches one level, '**/*.ts' ` +\n\t\t\t\t`matches any.`,\n\t\t);\n\t\treturn;\n\t}\n\n\tif (declared === 0) {\n\t\tlogger.warn(\n\t\t\t`\\n⚠️ The constructs glob matched ${matched} file(s) but none declared ` +\n\t\t\t\t`anything.\\n` +\n\t\t\t\t` Patterns: ${globs.join(', ')}\\n` +\n\t\t\t\t` Discovery keeps exports with an 'id' that can 'declare()'. A ` +\n\t\t\t\t`construct that is\\n` +\n\t\t\t\t` built but never exported is invisible to it.`,\n\t\t);\n\t}\n}\n\n/** Two constructs claiming one id. */\nexport class DuplicateConstruct extends Error {\n\t/** The id claimed twice. */\n\treadonly id: string;\n\t/** The files that claimed it. */\n\treadonly sources: readonly string[];\n\n\tconstructor(id: string, sources: readonly string[]) {\n\t\tsuper('Two constructs declare the same id');\n\t\tthis.name = 'DuplicateConstruct';\n\t\tthis.id = id;\n\t\tthis.sources = sources;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,yBAA+B;CAC9C,MAAM,WACL,WACC;CACF,IAAI,YAAY,OAAO,SAAS,UAAU,YACzC,SAAS,MAAM;AAEjB;AAaA,IAAsB,qBAAtB,MAAwE;CAGvE,aAAa,MACZ,SACA,WACA,WACA,UACA,SACa;EACb,MAAM,aAAa,MAAM,UAAU,KAAK,QAAQ;EAChD,OAAO,UAAU,MAAM,SAAS,YAAY,WAAW,OAAO;CAC/D;CASA,MAAM,KACL,UACA,MAAM,QAAQ,IAAI,GAClB,YAAY,OACuB;EACnC,MAAM,SAAS;EAEf,MAAM,eAAe,MAAM,QAAQ,QAAQ,IACxC,WACA,WACC,CAAC,QAAQ,IACT,CAAC;EAGL,MAAM,QAAQ,GAAG,OAAO,cAAc;GACrC;GACA,UAAU;EACX,CAAC;EAKD,IAAI,WACH,uBAAuB;EAIxB,MAAM,aAAsC,CAAC;EAE7C,WAAW,MAAM,KAAK,OACrB,IAAI;GACH,MAAM,OAAO,EAAE,SAAS;GAGxB,MAAM,SAAS,OADI,YAAA,OAAY,GAAG,KAAK,KAAK,KAAK,IAAI,OAAA,OAAM;GAI3D,KAAK,MAAM,CAAC,KAAK,cAAc,OAAO,QAAQ,MAAM,GACnD,IAAI,KAAK,YAAY,SAAS,GAC7B,WAAW,KAAK;IACf;IACA,MAAMA,YAAU,GAAG;IACnB;IACA,MAAM;KACL,UAAU;KACV,UAAU,SAAS,QAAQ,IAAI,GAAG,IAAI;IACvC;GACD,CAAC;EAGJ,SAAS,OAAO;GACf,MAAM,MAAM;GACZ,OAAO,MAAM,kBAAkB,EAAE,IAAI,IAAI,SAAS;GAClD,IAAI,IAAI,OACP,OAAO,MAAM,IAAI,KAAK;GAEvB,MAAM;EACP;EAGD,OAAO;CACR;AACD;;;;;;;;;;;;;;;;;;;;;;;;AC9FA,MAAM,SAAS;;;;;;;;AAef,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,UAAU,GAAG,SAAS,KACtB,OAAO,UAAU,YAAY;AAE/B;;;;;;;;;AA8DA,eAAsB,SACrB,SAC6B;CAC7B,MAAM,EACL,UACA,MAAM,QAAQ,IAAI,GAClB,YAAY,OACZ,SAAS,QACN;CAIJ,IAAI,WAAW,uBAAuB;CAEtC,MAAM,WAAwC,CAAC;;CAE/C,MAAM,UAAkC,CAAC;;;;;;;;;;;;;;CAczC,MAAM,uBAAO,IAAI,QAAgB;CAEjC,MAAM,QAAQ,MAAM,QAAQ,QAAQ,IAAI,CAAC,GAAG,QAAQ,IAAI,CAAC,QAAkB;CAC3E,MAAM,QAAQ,GAAG,OAAO,OAAO;EAAE;EAAK,UAAU;CAAK,CAAC;;CAGtD,IAAI,UAAU;CAEd,WAAW,MAAM,SAAS,OAAO;EAChC;EACA,MAAM,OAAO,MAAM,SAAS;EAC5B,MAAM,SAAS,OAAa,YAAA,OAAY,GAAG,KAAK,KAAK,KAAK,IAAI,OAAA,OAAM;EAEpE,KAAK,MAAM,CAAC,YAAY,aAAa,OAAO,QAAQ,MAAM,GAAG;GAC5D,IAAI,CAAC,aAAa,QAAQ,GAAG;IAC5B,IAAI,QAAQ,WAAW,eAAe,QAAQ,WAAW,QAAQ;IACjE;GACD;GAKA,IAAI,KAAK,IAAI,QAAkB,GAAG;GAClC,KAAK,IAAI,QAAkB;GAK3B,IACC,QAAQ,aACR,OAAQ,SAAiC,UAAU,UAEnD,eAAe,QAAQ,WAAW,QAAQ;GAG3C,KAAK,MAAM,eAAe,SAAS,QAAQ,GAAG;IAG7C,MAAM,KAAK,YAAY,YAAY,EAAE;IACrC,MAAM,SAAS,SAAS,KAAK,IAAI;IAEjC,MAAM,UAAU,QAAQ;IACxB,IAAI,YAAY,KAAA,KAAa,YAAY,QACxC,MAAM,IAAI,mBAAmB,IAAI,CAAC,SAAS,MAAM,CAAC;IAGnD,SAAS,MAAM;KAAE,GAAG;KAAa;IAAG;IACpC,QAAQ,MAAM;IACd,IAAI,KAAK,IAAI,MAAM;KAAE;KAAM;KAAY,WAAW;IAAS;GAC5D;EACD;CACD;CAIA,kBAAkB,QAAQ;CAE1B,mBAAmB,OAAO,SAAS,OAAO,KAAK,QAAQ,CAAC,CAAC,MAAM;CAE/D,OAAO;AACR;;;;;;AAOA,SAAS,eACR,WACA,UACO;CACP,IAAI,OAAO,aAAa,YAAY,aAAa,MAAM;CAEvD,MAAM,WAAW;CAKjB,MAAM,QACL,OAAO,SAAS,SAAS,OAAO,WAC7B,SAAS,QAAQ,KACjB,OAAO,SAAS,UAAU,WACzB,SAAS,QACT,KAAA;CACL,IAAI,CAAC,SAAS,CAAC,MAAM,QAAQ,SAAS,UAAU,GAAG;CAEnD,MAAM,MAAM,YAAY,KAAK;CAC7B,MAAM,QAAQ,UAAU,QAAQ,CAAC;CACjC,UAAU,OAAO;CACjB,KAAK,MAAM,MAAM,SAAS,YAAY;EACrC,IAAI,OAAO,OAAO,UAAU;EAC5B,MAAM,SAAS,YAAY,EAAE;EAC7B,IAAI,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,KAAK,MAAM;CAC/C;AACD;;;;;;;;;;;;;;;;;;AAmBA,SAAS,mBACR,OACA,SACA,UACO;CACP,IAAI,MAAM,WAAW,GAAG;CAExB,IAAI,YAAY,GAAG;EAClB,OAAO,KACN,sFACiB,MAAM,KAAK,IAAI,EAAE,2JAKnC;EACA;CACD;CAEA,IAAI,aAAa,GAChB,OAAO,KACN,qCAAqC,QAAQ,qDAE5B,MAAM,KAAK,IAAI,EAAE,qIAInC;AAEF;;AAGA,IAAa,qBAAb,cAAwC,MAAM;;CAE7C;;CAEA;CAEA,YAAY,IAAY,SAA4B;EACnD,MAAM,oCAAoC;EAC1C,KAAK,OAAO;EACZ,KAAK,KAAK;EACV,KAAK,UAAU;CAChB;AACD"}