@better-openclaw/core 1.0.22 → 1.0.24

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 (697) hide show
  1. package/dist/bare-metal-partition.test.cjs +3 -4
  2. package/dist/bare-metal-partition.test.cjs.map +1 -1
  3. package/dist/bare-metal-partition.test.mjs +3 -4
  4. package/dist/bare-metal-partition.test.mjs.map +1 -1
  5. package/dist/composer.cjs +40 -14
  6. package/dist/composer.cjs.map +1 -1
  7. package/dist/composer.d.cts.map +1 -1
  8. package/dist/composer.d.mts.map +1 -1
  9. package/dist/composer.mjs +40 -14
  10. package/dist/composer.mjs.map +1 -1
  11. package/dist/composer.snapshot.test.cjs +1 -1
  12. package/dist/composer.snapshot.test.mjs +1 -1
  13. package/dist/composer.test.cjs +3 -2
  14. package/dist/composer.test.cjs.map +1 -1
  15. package/dist/composer.test.mjs +3 -2
  16. package/dist/composer.test.mjs.map +1 -1
  17. package/dist/deployers/strip-host-ports.test.cjs +1 -1
  18. package/dist/deployers/strip-host-ports.test.mjs +1 -1
  19. package/dist/generate.cjs +7 -2
  20. package/dist/generate.cjs.map +1 -1
  21. package/dist/generate.d.cts.map +1 -1
  22. package/dist/generate.d.mts.map +1 -1
  23. package/dist/generate.mjs +7 -2
  24. package/dist/generate.mjs.map +1 -1
  25. package/dist/generate.test.cjs +2 -2
  26. package/dist/generate.test.cjs.map +1 -1
  27. package/dist/generate.test.mjs +2 -2
  28. package/dist/generate.test.mjs.map +1 -1
  29. package/dist/generators/bare-metal-install.test.cjs +1 -1
  30. package/dist/generators/bare-metal-install.test.mjs +1 -1
  31. package/dist/generators/caddy.test.cjs +1 -1
  32. package/dist/generators/caddy.test.mjs +1 -1
  33. package/dist/generators/clone-repos.cjs +140 -0
  34. package/dist/generators/clone-repos.cjs.map +1 -0
  35. package/dist/generators/clone-repos.d.cts +11 -0
  36. package/dist/generators/clone-repos.d.cts.map +1 -0
  37. package/dist/generators/clone-repos.d.mts +11 -0
  38. package/dist/generators/clone-repos.d.mts.map +1 -0
  39. package/dist/generators/clone-repos.mjs +139 -0
  40. package/dist/generators/clone-repos.mjs.map +1 -0
  41. package/dist/generators/clone-repos.test.cjs +140 -0
  42. package/dist/generators/clone-repos.test.cjs.map +1 -0
  43. package/dist/generators/clone-repos.test.d.cts +1 -0
  44. package/dist/generators/clone-repos.test.d.mts +1 -0
  45. package/dist/generators/clone-repos.test.mjs +141 -0
  46. package/dist/generators/clone-repos.test.mjs.map +1 -0
  47. package/dist/generators/env.cjs +146 -0
  48. package/dist/generators/env.cjs.map +1 -1
  49. package/dist/generators/env.d.cts.map +1 -1
  50. package/dist/generators/env.d.mts.map +1 -1
  51. package/dist/generators/env.mjs +146 -0
  52. package/dist/generators/env.mjs.map +1 -1
  53. package/dist/generators/env.test.cjs +1 -1
  54. package/dist/generators/env.test.mjs +1 -1
  55. package/dist/generators/health-check.test.cjs +1 -1
  56. package/dist/generators/health-check.test.mjs +1 -1
  57. package/dist/generators/openclaw-json.cjs +102 -7
  58. package/dist/generators/openclaw-json.cjs.map +1 -1
  59. package/dist/generators/openclaw-json.mjs +102 -7
  60. package/dist/generators/openclaw-json.mjs.map +1 -1
  61. package/dist/generators/postgres-init.cjs +20 -0
  62. package/dist/generators/postgres-init.cjs.map +1 -1
  63. package/dist/generators/postgres-init.d.cts.map +1 -1
  64. package/dist/generators/postgres-init.d.mts.map +1 -1
  65. package/dist/generators/postgres-init.mjs +20 -0
  66. package/dist/generators/postgres-init.mjs.map +1 -1
  67. package/dist/generators/readme.cjs +2 -1
  68. package/dist/generators/readme.cjs.map +1 -1
  69. package/dist/generators/readme.mjs +2 -1
  70. package/dist/generators/readme.mjs.map +1 -1
  71. package/dist/generators/scripts.cjs +332 -3
  72. package/dist/generators/scripts.cjs.map +1 -1
  73. package/dist/generators/scripts.d.cts +3 -1
  74. package/dist/generators/scripts.d.cts.map +1 -1
  75. package/dist/generators/scripts.d.mts +3 -1
  76. package/dist/generators/scripts.d.mts.map +1 -1
  77. package/dist/generators/scripts.mjs +332 -3
  78. package/dist/generators/scripts.mjs.map +1 -1
  79. package/dist/generators/scripts.test.cjs +39 -5
  80. package/dist/generators/scripts.test.cjs.map +1 -1
  81. package/dist/generators/scripts.test.mjs +39 -5
  82. package/dist/generators/scripts.test.mjs.map +1 -1
  83. package/dist/generators/stack-manifest.cjs +1 -0
  84. package/dist/generators/stack-manifest.cjs.map +1 -1
  85. package/dist/generators/stack-manifest.d.cts +3 -2
  86. package/dist/generators/stack-manifest.d.cts.map +1 -1
  87. package/dist/generators/stack-manifest.d.mts +3 -2
  88. package/dist/generators/stack-manifest.d.mts.map +1 -1
  89. package/dist/generators/stack-manifest.mjs +1 -0
  90. package/dist/generators/stack-manifest.mjs.map +1 -1
  91. package/dist/generators/traefik.test.cjs +1 -1
  92. package/dist/generators/traefik.test.mjs +1 -1
  93. package/dist/index.cjs +8 -1
  94. package/dist/index.d.cts +5 -3
  95. package/dist/index.d.mts +5 -3
  96. package/dist/index.mjs +5 -3
  97. package/dist/migrations.test.cjs +1 -1
  98. package/dist/migrations.test.mjs +1 -1
  99. package/dist/presets/registry.cjs +19 -0
  100. package/dist/presets/registry.cjs.map +1 -1
  101. package/dist/presets/registry.d.cts.map +1 -1
  102. package/dist/presets/registry.d.mts.map +1 -1
  103. package/dist/presets/registry.mjs +19 -0
  104. package/dist/presets/registry.mjs.map +1 -1
  105. package/dist/presets/registry.test.cjs +1 -1
  106. package/dist/presets/registry.test.mjs +1 -1
  107. package/dist/resolver.cjs +8 -0
  108. package/dist/resolver.cjs.map +1 -1
  109. package/dist/resolver.mjs +9 -1
  110. package/dist/resolver.mjs.map +1 -1
  111. package/dist/resolver.test.cjs +47 -12
  112. package/dist/resolver.test.cjs.map +1 -1
  113. package/dist/resolver.test.mjs +47 -12
  114. package/dist/resolver.test.mjs.map +1 -1
  115. package/dist/{schema-C_hc7e4k.d.cts → schema-eX44HhRp.d.mts} +78 -8
  116. package/dist/schema-eX44HhRp.d.mts.map +1 -0
  117. package/dist/{schema-CaesJaS2.d.mts → schema-tn5RK8CM.d.cts} +78 -8
  118. package/dist/schema-tn5RK8CM.d.cts.map +1 -0
  119. package/dist/schema.cjs +26 -4
  120. package/dist/schema.cjs.map +1 -1
  121. package/dist/schema.d.cts +2 -2
  122. package/dist/schema.d.mts +2 -2
  123. package/dist/schema.mjs +25 -5
  124. package/dist/schema.mjs.map +1 -1
  125. package/dist/schema.test.cjs +1 -1
  126. package/dist/schema.test.mjs +1 -1
  127. package/dist/services/definitions/adguard-home.cjs +74 -0
  128. package/dist/services/definitions/adguard-home.cjs.map +1 -0
  129. package/dist/services/definitions/adguard-home.d.cts +7 -0
  130. package/dist/services/definitions/adguard-home.d.cts.map +1 -0
  131. package/dist/services/definitions/adguard-home.d.mts +7 -0
  132. package/dist/services/definitions/adguard-home.d.mts.map +1 -0
  133. package/dist/services/definitions/adguard-home.mjs +73 -0
  134. package/dist/services/definitions/adguard-home.mjs.map +1 -0
  135. package/dist/services/definitions/apptension-saas.cjs +87 -0
  136. package/dist/services/definitions/apptension-saas.cjs.map +1 -0
  137. package/dist/services/definitions/apptension-saas.d.cts +7 -0
  138. package/dist/services/definitions/apptension-saas.d.cts.map +1 -0
  139. package/dist/services/definitions/apptension-saas.d.mts +7 -0
  140. package/dist/services/definitions/apptension-saas.d.mts.map +1 -0
  141. package/dist/services/definitions/apptension-saas.mjs +86 -0
  142. package/dist/services/definitions/apptension-saas.mjs.map +1 -0
  143. package/dist/services/definitions/audiobookshelf.cjs +81 -0
  144. package/dist/services/definitions/audiobookshelf.cjs.map +1 -0
  145. package/dist/services/definitions/audiobookshelf.d.cts +7 -0
  146. package/dist/services/definitions/audiobookshelf.d.cts.map +1 -0
  147. package/dist/services/definitions/audiobookshelf.d.mts +7 -0
  148. package/dist/services/definitions/audiobookshelf.d.mts.map +1 -0
  149. package/dist/services/definitions/audiobookshelf.mjs +80 -0
  150. package/dist/services/definitions/audiobookshelf.mjs.map +1 -0
  151. package/dist/services/definitions/baserow.cjs +115 -0
  152. package/dist/services/definitions/baserow.cjs.map +1 -0
  153. package/dist/services/definitions/baserow.d.cts +7 -0
  154. package/dist/services/definitions/baserow.d.cts.map +1 -0
  155. package/dist/services/definitions/baserow.d.mts +7 -0
  156. package/dist/services/definitions/baserow.d.mts.map +1 -0
  157. package/dist/services/definitions/baserow.mjs +114 -0
  158. package/dist/services/definitions/baserow.mjs.map +1 -0
  159. package/dist/services/definitions/boxyhq-saas.cjs +88 -0
  160. package/dist/services/definitions/boxyhq-saas.cjs.map +1 -0
  161. package/dist/services/definitions/boxyhq-saas.d.cts +7 -0
  162. package/dist/services/definitions/boxyhq-saas.d.cts.map +1 -0
  163. package/dist/services/definitions/boxyhq-saas.d.mts +7 -0
  164. package/dist/services/definitions/boxyhq-saas.d.mts.map +1 -0
  165. package/dist/services/definitions/boxyhq-saas.mjs +87 -0
  166. package/dist/services/definitions/boxyhq-saas.mjs.map +1 -0
  167. package/dist/services/definitions/calibre-web.cjs +91 -0
  168. package/dist/services/definitions/calibre-web.cjs.map +1 -0
  169. package/dist/services/definitions/calibre-web.d.cts +7 -0
  170. package/dist/services/definitions/calibre-web.d.cts.map +1 -0
  171. package/dist/services/definitions/calibre-web.d.mts +7 -0
  172. package/dist/services/definitions/calibre-web.d.mts.map +1 -0
  173. package/dist/services/definitions/calibre-web.mjs +90 -0
  174. package/dist/services/definitions/calibre-web.mjs.map +1 -0
  175. package/dist/services/definitions/clickhouse.cjs +113 -0
  176. package/dist/services/definitions/clickhouse.cjs.map +1 -0
  177. package/dist/services/definitions/clickhouse.d.cts +7 -0
  178. package/dist/services/definitions/clickhouse.d.cts.map +1 -0
  179. package/dist/services/definitions/clickhouse.d.mts +7 -0
  180. package/dist/services/definitions/clickhouse.d.mts.map +1 -0
  181. package/dist/services/definitions/clickhouse.mjs +112 -0
  182. package/dist/services/definitions/clickhouse.mjs.map +1 -0
  183. package/dist/services/definitions/cloudflared.cjs +55 -0
  184. package/dist/services/definitions/cloudflared.cjs.map +1 -0
  185. package/dist/services/definitions/cloudflared.d.cts +7 -0
  186. package/dist/services/definitions/cloudflared.d.cts.map +1 -0
  187. package/dist/services/definitions/cloudflared.d.mts +7 -0
  188. package/dist/services/definitions/cloudflared.d.mts.map +1 -0
  189. package/dist/services/definitions/cloudflared.mjs +54 -0
  190. package/dist/services/definitions/cloudflared.mjs.map +1 -0
  191. package/dist/services/definitions/cmsaas-starter.cjs +86 -0
  192. package/dist/services/definitions/cmsaas-starter.cjs.map +1 -0
  193. package/dist/services/definitions/cmsaas-starter.d.cts +7 -0
  194. package/dist/services/definitions/cmsaas-starter.d.cts.map +1 -0
  195. package/dist/services/definitions/cmsaas-starter.d.mts +7 -0
  196. package/dist/services/definitions/cmsaas-starter.d.mts.map +1 -0
  197. package/dist/services/definitions/cmsaas-starter.mjs +85 -0
  198. package/dist/services/definitions/cmsaas-starter.mjs.map +1 -0
  199. package/dist/services/definitions/cockroachdb.cjs +70 -0
  200. package/dist/services/definitions/cockroachdb.cjs.map +1 -0
  201. package/dist/services/definitions/cockroachdb.d.cts +7 -0
  202. package/dist/services/definitions/cockroachdb.d.cts.map +1 -0
  203. package/dist/services/definitions/cockroachdb.d.mts +7 -0
  204. package/dist/services/definitions/cockroachdb.d.mts.map +1 -0
  205. package/dist/services/definitions/cockroachdb.mjs +69 -0
  206. package/dist/services/definitions/cockroachdb.mjs.map +1 -0
  207. package/dist/services/definitions/coder.cjs +64 -0
  208. package/dist/services/definitions/coder.cjs.map +1 -0
  209. package/dist/services/definitions/coder.d.cts +7 -0
  210. package/dist/services/definitions/coder.d.cts.map +1 -0
  211. package/dist/services/definitions/coder.d.mts +7 -0
  212. package/dist/services/definitions/coder.d.mts.map +1 -0
  213. package/dist/services/definitions/coder.mjs +63 -0
  214. package/dist/services/definitions/coder.mjs.map +1 -0
  215. package/dist/services/definitions/dragonfly.cjs +64 -0
  216. package/dist/services/definitions/dragonfly.cjs.map +1 -0
  217. package/dist/services/definitions/dragonfly.d.cts +7 -0
  218. package/dist/services/definitions/dragonfly.d.cts.map +1 -0
  219. package/dist/services/definitions/dragonfly.d.mts +7 -0
  220. package/dist/services/definitions/dragonfly.d.mts.map +1 -0
  221. package/dist/services/definitions/dragonfly.mjs +63 -0
  222. package/dist/services/definitions/dragonfly.mjs.map +1 -0
  223. package/dist/services/definitions/drone-ci.cjs +95 -0
  224. package/dist/services/definitions/drone-ci.cjs.map +1 -0
  225. package/dist/services/definitions/drone-ci.d.cts +7 -0
  226. package/dist/services/definitions/drone-ci.d.cts.map +1 -0
  227. package/dist/services/definitions/drone-ci.d.mts +7 -0
  228. package/dist/services/definitions/drone-ci.d.mts.map +1 -0
  229. package/dist/services/definitions/drone-ci.mjs +94 -0
  230. package/dist/services/definitions/drone-ci.mjs.map +1 -0
  231. package/dist/services/definitions/element-web.cjs +61 -0
  232. package/dist/services/definitions/element-web.cjs.map +1 -0
  233. package/dist/services/definitions/element-web.d.cts +7 -0
  234. package/dist/services/definitions/element-web.d.cts.map +1 -0
  235. package/dist/services/definitions/element-web.d.mts +7 -0
  236. package/dist/services/definitions/element-web.d.mts.map +1 -0
  237. package/dist/services/definitions/element-web.mjs +60 -0
  238. package/dist/services/definitions/element-web.mjs.map +1 -0
  239. package/dist/services/definitions/focalboard.cjs +65 -0
  240. package/dist/services/definitions/focalboard.cjs.map +1 -0
  241. package/dist/services/definitions/focalboard.d.cts +7 -0
  242. package/dist/services/definitions/focalboard.d.cts.map +1 -0
  243. package/dist/services/definitions/focalboard.d.mts +7 -0
  244. package/dist/services/definitions/focalboard.d.mts.map +1 -0
  245. package/dist/services/definitions/focalboard.mjs +64 -0
  246. package/dist/services/definitions/focalboard.mjs.map +1 -0
  247. package/dist/services/definitions/forgejo.cjs +108 -0
  248. package/dist/services/definitions/forgejo.cjs.map +1 -0
  249. package/dist/services/definitions/forgejo.d.cts +7 -0
  250. package/dist/services/definitions/forgejo.d.cts.map +1 -0
  251. package/dist/services/definitions/forgejo.d.mts +7 -0
  252. package/dist/services/definitions/forgejo.d.mts.map +1 -0
  253. package/dist/services/definitions/forgejo.mjs +107 -0
  254. package/dist/services/definitions/forgejo.mjs.map +1 -0
  255. package/dist/services/definitions/graylog.cjs +103 -0
  256. package/dist/services/definitions/graylog.cjs.map +1 -0
  257. package/dist/services/definitions/graylog.d.cts +7 -0
  258. package/dist/services/definitions/graylog.d.cts.map +1 -0
  259. package/dist/services/definitions/graylog.d.mts +7 -0
  260. package/dist/services/definitions/graylog.d.mts.map +1 -0
  261. package/dist/services/definitions/graylog.mjs +102 -0
  262. package/dist/services/definitions/graylog.mjs.map +1 -0
  263. package/dist/services/definitions/index.cjs +154 -1
  264. package/dist/services/definitions/index.cjs.map +1 -1
  265. package/dist/services/definitions/index.d.cts +52 -1
  266. package/dist/services/definitions/index.d.cts.map +1 -1
  267. package/dist/services/definitions/index.d.mts +52 -1
  268. package/dist/services/definitions/index.d.mts.map +1 -1
  269. package/dist/services/definitions/index.mjs +104 -2
  270. package/dist/services/definitions/index.mjs.map +1 -1
  271. package/dist/services/definitions/influxdb.cjs +105 -0
  272. package/dist/services/definitions/influxdb.cjs.map +1 -0
  273. package/dist/services/definitions/influxdb.d.cts +7 -0
  274. package/dist/services/definitions/influxdb.d.cts.map +1 -0
  275. package/dist/services/definitions/influxdb.d.mts +7 -0
  276. package/dist/services/definitions/influxdb.d.mts.map +1 -0
  277. package/dist/services/definitions/influxdb.mjs +104 -0
  278. package/dist/services/definitions/influxdb.mjs.map +1 -0
  279. package/dist/services/definitions/invoke-ai.cjs +70 -0
  280. package/dist/services/definitions/invoke-ai.cjs.map +1 -0
  281. package/dist/services/definitions/invoke-ai.d.cts +7 -0
  282. package/dist/services/definitions/invoke-ai.d.cts.map +1 -0
  283. package/dist/services/definitions/invoke-ai.d.mts +7 -0
  284. package/dist/services/definitions/invoke-ai.d.mts.map +1 -0
  285. package/dist/services/definitions/invoke-ai.mjs +69 -0
  286. package/dist/services/definitions/invoke-ai.mjs.map +1 -0
  287. package/dist/services/definitions/ixartz-saas.cjs +88 -0
  288. package/dist/services/definitions/ixartz-saas.cjs.map +1 -0
  289. package/dist/services/definitions/ixartz-saas.d.cts +7 -0
  290. package/dist/services/definitions/ixartz-saas.d.cts.map +1 -0
  291. package/dist/services/definitions/ixartz-saas.d.mts +7 -0
  292. package/dist/services/definitions/ixartz-saas.d.mts.map +1 -0
  293. package/dist/services/definitions/ixartz-saas.mjs +87 -0
  294. package/dist/services/definitions/ixartz-saas.mjs.map +1 -0
  295. package/dist/services/definitions/jaeger.cjs +95 -0
  296. package/dist/services/definitions/jaeger.cjs.map +1 -0
  297. package/dist/services/definitions/jaeger.d.cts +7 -0
  298. package/dist/services/definitions/jaeger.d.cts.map +1 -0
  299. package/dist/services/definitions/jaeger.d.mts +7 -0
  300. package/dist/services/definitions/jaeger.d.mts.map +1 -0
  301. package/dist/services/definitions/jaeger.mjs +94 -0
  302. package/dist/services/definitions/jaeger.mjs.map +1 -0
  303. package/dist/services/definitions/jan.cjs +64 -0
  304. package/dist/services/definitions/jan.cjs.map +1 -0
  305. package/dist/services/definitions/jan.d.cts +7 -0
  306. package/dist/services/definitions/jan.d.cts.map +1 -0
  307. package/dist/services/definitions/jan.d.mts +7 -0
  308. package/dist/services/definitions/jan.d.mts.map +1 -0
  309. package/dist/services/definitions/jan.mjs +63 -0
  310. package/dist/services/definitions/jan.mjs.map +1 -0
  311. package/dist/services/definitions/jitsi-meet.cjs +102 -0
  312. package/dist/services/definitions/jitsi-meet.cjs.map +1 -0
  313. package/dist/services/definitions/jitsi-meet.d.cts +7 -0
  314. package/dist/services/definitions/jitsi-meet.d.cts.map +1 -0
  315. package/dist/services/definitions/jitsi-meet.d.mts +7 -0
  316. package/dist/services/definitions/jitsi-meet.d.mts.map +1 -0
  317. package/dist/services/definitions/jitsi-meet.mjs +101 -0
  318. package/dist/services/definitions/jitsi-meet.mjs.map +1 -0
  319. package/dist/services/definitions/local-ai.cjs +86 -0
  320. package/dist/services/definitions/local-ai.cjs.map +1 -0
  321. package/dist/services/definitions/local-ai.d.cts +7 -0
  322. package/dist/services/definitions/local-ai.d.cts.map +1 -0
  323. package/dist/services/definitions/local-ai.d.mts +7 -0
  324. package/dist/services/definitions/local-ai.d.mts.map +1 -0
  325. package/dist/services/definitions/local-ai.mjs +85 -0
  326. package/dist/services/definitions/local-ai.mjs.map +1 -0
  327. package/dist/services/definitions/metabase.cjs +108 -0
  328. package/dist/services/definitions/metabase.cjs.map +1 -0
  329. package/dist/services/definitions/metabase.d.cts +7 -0
  330. package/dist/services/definitions/metabase.d.cts.map +1 -0
  331. package/dist/services/definitions/metabase.d.mts +7 -0
  332. package/dist/services/definitions/metabase.d.mts.map +1 -0
  333. package/dist/services/definitions/metabase.mjs +107 -0
  334. package/dist/services/definitions/metabase.mjs.map +1 -0
  335. package/dist/services/definitions/mission-control.cjs +16 -2
  336. package/dist/services/definitions/mission-control.cjs.map +1 -1
  337. package/dist/services/definitions/mission-control.mjs +16 -2
  338. package/dist/services/definitions/mission-control.mjs.map +1 -1
  339. package/dist/services/definitions/mosquitto.cjs +82 -0
  340. package/dist/services/definitions/mosquitto.cjs.map +1 -0
  341. package/dist/services/definitions/mosquitto.d.cts +7 -0
  342. package/dist/services/definitions/mosquitto.d.cts.map +1 -0
  343. package/dist/services/definitions/mosquitto.d.mts +7 -0
  344. package/dist/services/definitions/mosquitto.d.mts.map +1 -0
  345. package/dist/services/definitions/mosquitto.mjs +81 -0
  346. package/dist/services/definitions/mosquitto.mjs.map +1 -0
  347. package/dist/services/definitions/navidrome.cjs +90 -0
  348. package/dist/services/definitions/navidrome.cjs.map +1 -0
  349. package/dist/services/definitions/navidrome.d.cts +7 -0
  350. package/dist/services/definitions/navidrome.d.cts.map +1 -0
  351. package/dist/services/definitions/navidrome.d.mts +7 -0
  352. package/dist/services/definitions/navidrome.d.mts.map +1 -0
  353. package/dist/services/definitions/navidrome.mjs +89 -0
  354. package/dist/services/definitions/navidrome.mjs.map +1 -0
  355. package/dist/services/definitions/nginx-proxy-manager.cjs +71 -0
  356. package/dist/services/definitions/nginx-proxy-manager.cjs.map +1 -0
  357. package/dist/services/definitions/nginx-proxy-manager.d.cts +7 -0
  358. package/dist/services/definitions/nginx-proxy-manager.d.cts.map +1 -0
  359. package/dist/services/definitions/nginx-proxy-manager.d.mts +7 -0
  360. package/dist/services/definitions/nginx-proxy-manager.d.mts.map +1 -0
  361. package/dist/services/definitions/nginx-proxy-manager.mjs +70 -0
  362. package/dist/services/definitions/nginx-proxy-manager.mjs.map +1 -0
  363. package/dist/services/definitions/node-red.cjs +77 -0
  364. package/dist/services/definitions/node-red.cjs.map +1 -0
  365. package/dist/services/definitions/node-red.d.cts +7 -0
  366. package/dist/services/definitions/node-red.d.cts.map +1 -0
  367. package/dist/services/definitions/node-red.d.mts +7 -0
  368. package/dist/services/definitions/node-red.d.mts.map +1 -0
  369. package/dist/services/definitions/node-red.mjs +76 -0
  370. package/dist/services/definitions/node-red.mjs.map +1 -0
  371. package/dist/services/definitions/open-saas.cjs +81 -0
  372. package/dist/services/definitions/open-saas.cjs.map +1 -0
  373. package/dist/services/definitions/open-saas.d.cts +7 -0
  374. package/dist/services/definitions/open-saas.d.cts.map +1 -0
  375. package/dist/services/definitions/open-saas.d.mts +7 -0
  376. package/dist/services/definitions/open-saas.d.mts.map +1 -0
  377. package/dist/services/definitions/open-saas.mjs +80 -0
  378. package/dist/services/definitions/open-saas.mjs.map +1 -0
  379. package/dist/services/definitions/photoprism.cjs +126 -0
  380. package/dist/services/definitions/photoprism.cjs.map +1 -0
  381. package/dist/services/definitions/photoprism.d.cts +7 -0
  382. package/dist/services/definitions/photoprism.d.cts.map +1 -0
  383. package/dist/services/definitions/photoprism.d.mts +7 -0
  384. package/dist/services/definitions/photoprism.d.mts.map +1 -0
  385. package/dist/services/definitions/photoprism.mjs +125 -0
  386. package/dist/services/definitions/photoprism.mjs.map +1 -0
  387. package/dist/services/definitions/pihole.cjs +73 -0
  388. package/dist/services/definitions/pihole.cjs.map +1 -0
  389. package/dist/services/definitions/pihole.d.cts +7 -0
  390. package/dist/services/definitions/pihole.d.cts.map +1 -0
  391. package/dist/services/definitions/pihole.d.mts +7 -0
  392. package/dist/services/definitions/pihole.d.mts.map +1 -0
  393. package/dist/services/definitions/pihole.mjs +72 -0
  394. package/dist/services/definitions/pihole.mjs.map +1 -0
  395. package/dist/services/definitions/piper-tts.cjs +70 -0
  396. package/dist/services/definitions/piper-tts.cjs.map +1 -0
  397. package/dist/services/definitions/piper-tts.d.cts +7 -0
  398. package/dist/services/definitions/piper-tts.d.cts.map +1 -0
  399. package/dist/services/definitions/piper-tts.d.mts +7 -0
  400. package/dist/services/definitions/piper-tts.d.mts.map +1 -0
  401. package/dist/services/definitions/piper-tts.mjs +69 -0
  402. package/dist/services/definitions/piper-tts.mjs.map +1 -0
  403. package/dist/services/definitions/plane.cjs +75 -0
  404. package/dist/services/definitions/plane.cjs.map +1 -0
  405. package/dist/services/definitions/plane.d.cts +7 -0
  406. package/dist/services/definitions/plane.d.cts.map +1 -0
  407. package/dist/services/definitions/plane.d.mts +7 -0
  408. package/dist/services/definitions/plane.d.mts.map +1 -0
  409. package/dist/services/definitions/plane.mjs +74 -0
  410. package/dist/services/definitions/plane.mjs.map +1 -0
  411. package/dist/services/definitions/plausible.cjs +94 -0
  412. package/dist/services/definitions/plausible.cjs.map +1 -0
  413. package/dist/services/definitions/plausible.d.cts +7 -0
  414. package/dist/services/definitions/plausible.d.cts.map +1 -0
  415. package/dist/services/definitions/plausible.d.mts +7 -0
  416. package/dist/services/definitions/plausible.d.mts.map +1 -0
  417. package/dist/services/definitions/plausible.mjs +93 -0
  418. package/dist/services/definitions/plausible.mjs.map +1 -0
  419. package/dist/services/definitions/pocket-id.cjs +101 -0
  420. package/dist/services/definitions/pocket-id.cjs.map +1 -0
  421. package/dist/services/definitions/pocket-id.d.cts +7 -0
  422. package/dist/services/definitions/pocket-id.d.cts.map +1 -0
  423. package/dist/services/definitions/pocket-id.d.mts +7 -0
  424. package/dist/services/definitions/pocket-id.d.mts.map +1 -0
  425. package/dist/services/definitions/pocket-id.mjs +100 -0
  426. package/dist/services/definitions/pocket-id.mjs.map +1 -0
  427. package/dist/services/definitions/posthog.cjs +94 -0
  428. package/dist/services/definitions/posthog.cjs.map +1 -0
  429. package/dist/services/definitions/posthog.d.cts +7 -0
  430. package/dist/services/definitions/posthog.d.cts.map +1 -0
  431. package/dist/services/definitions/posthog.d.mts +7 -0
  432. package/dist/services/definitions/posthog.d.mts.map +1 -0
  433. package/dist/services/definitions/posthog.mjs +93 -0
  434. package/dist/services/definitions/posthog.mjs.map +1 -0
  435. package/dist/services/definitions/redis.cjs +1 -1
  436. package/dist/services/definitions/redis.cjs.map +1 -1
  437. package/dist/services/definitions/redis.mjs +1 -1
  438. package/dist/services/definitions/redis.mjs.map +1 -1
  439. package/dist/services/definitions/revolt.cjs +64 -0
  440. package/dist/services/definitions/revolt.cjs.map +1 -0
  441. package/dist/services/definitions/revolt.d.cts +7 -0
  442. package/dist/services/definitions/revolt.d.cts.map +1 -0
  443. package/dist/services/definitions/revolt.d.mts +7 -0
  444. package/dist/services/definitions/revolt.d.mts.map +1 -0
  445. package/dist/services/definitions/revolt.mjs +63 -0
  446. package/dist/services/definitions/revolt.mjs.map +1 -0
  447. package/dist/services/definitions/sentry.cjs +101 -0
  448. package/dist/services/definitions/sentry.cjs.map +1 -0
  449. package/dist/services/definitions/sentry.d.cts +7 -0
  450. package/dist/services/definitions/sentry.d.cts.map +1 -0
  451. package/dist/services/definitions/sentry.d.mts +7 -0
  452. package/dist/services/definitions/sentry.d.mts.map +1 -0
  453. package/dist/services/definitions/sentry.mjs +100 -0
  454. package/dist/services/definitions/sentry.mjs.map +1 -0
  455. package/dist/services/definitions/sonarqube.cjs +86 -0
  456. package/dist/services/definitions/sonarqube.cjs.map +1 -0
  457. package/dist/services/definitions/sonarqube.d.cts +7 -0
  458. package/dist/services/definitions/sonarqube.d.cts.map +1 -0
  459. package/dist/services/definitions/sonarqube.d.mts +7 -0
  460. package/dist/services/definitions/sonarqube.d.mts.map +1 -0
  461. package/dist/services/definitions/sonarqube.mjs +85 -0
  462. package/dist/services/definitions/sonarqube.mjs.map +1 -0
  463. package/dist/services/definitions/superset.cjs +77 -0
  464. package/dist/services/definitions/superset.cjs.map +1 -0
  465. package/dist/services/definitions/superset.d.cts +7 -0
  466. package/dist/services/definitions/superset.d.cts.map +1 -0
  467. package/dist/services/definitions/superset.d.mts +7 -0
  468. package/dist/services/definitions/superset.d.mts.map +1 -0
  469. package/dist/services/definitions/superset.mjs +76 -0
  470. package/dist/services/definitions/superset.mjs.map +1 -0
  471. package/dist/services/definitions/surrealdb.cjs +72 -0
  472. package/dist/services/definitions/surrealdb.cjs.map +1 -0
  473. package/dist/services/definitions/surrealdb.d.cts +7 -0
  474. package/dist/services/definitions/surrealdb.d.cts.map +1 -0
  475. package/dist/services/definitions/surrealdb.d.mts +7 -0
  476. package/dist/services/definitions/surrealdb.d.mts.map +1 -0
  477. package/dist/services/definitions/surrealdb.mjs +71 -0
  478. package/dist/services/definitions/surrealdb.mjs.map +1 -0
  479. package/dist/services/definitions/tabby-ml.cjs +70 -0
  480. package/dist/services/definitions/tabby-ml.cjs.map +1 -0
  481. package/dist/services/definitions/tabby-ml.d.cts +7 -0
  482. package/dist/services/definitions/tabby-ml.d.cts.map +1 -0
  483. package/dist/services/definitions/tabby-ml.d.mts +7 -0
  484. package/dist/services/definitions/tabby-ml.d.mts.map +1 -0
  485. package/dist/services/definitions/tabby-ml.mjs +69 -0
  486. package/dist/services/definitions/tabby-ml.mjs.map +1 -0
  487. package/dist/services/definitions/tempo.cjs +57 -0
  488. package/dist/services/definitions/tempo.cjs.map +1 -0
  489. package/dist/services/definitions/tempo.d.cts +7 -0
  490. package/dist/services/definitions/tempo.d.cts.map +1 -0
  491. package/dist/services/definitions/tempo.d.mts +7 -0
  492. package/dist/services/definitions/tempo.d.mts.map +1 -0
  493. package/dist/services/definitions/tempo.mjs +56 -0
  494. package/dist/services/definitions/tempo.mjs.map +1 -0
  495. package/dist/services/definitions/text-gen-webui.cjs +88 -0
  496. package/dist/services/definitions/text-gen-webui.cjs.map +1 -0
  497. package/dist/services/definitions/text-gen-webui.d.cts +7 -0
  498. package/dist/services/definitions/text-gen-webui.d.cts.map +1 -0
  499. package/dist/services/definitions/text-gen-webui.d.mts +7 -0
  500. package/dist/services/definitions/text-gen-webui.d.mts.map +1 -0
  501. package/dist/services/definitions/text-gen-webui.mjs +87 -0
  502. package/dist/services/definitions/text-gen-webui.mjs.map +1 -0
  503. package/dist/services/definitions/timescaledb.cjs +87 -0
  504. package/dist/services/definitions/timescaledb.cjs.map +1 -0
  505. package/dist/services/definitions/timescaledb.d.cts +7 -0
  506. package/dist/services/definitions/timescaledb.d.cts.map +1 -0
  507. package/dist/services/definitions/timescaledb.d.mts +7 -0
  508. package/dist/services/definitions/timescaledb.d.mts.map +1 -0
  509. package/dist/services/definitions/timescaledb.mjs +86 -0
  510. package/dist/services/definitions/timescaledb.mjs.map +1 -0
  511. package/dist/services/definitions/valkey.cjs +1 -1
  512. package/dist/services/definitions/valkey.cjs.map +1 -1
  513. package/dist/services/definitions/valkey.mjs +1 -1
  514. package/dist/services/definitions/valkey.mjs.map +1 -1
  515. package/dist/services/definitions/vector-log.cjs +59 -0
  516. package/dist/services/definitions/vector-log.cjs.map +1 -0
  517. package/dist/services/definitions/vector-log.d.cts +7 -0
  518. package/dist/services/definitions/vector-log.d.cts.map +1 -0
  519. package/dist/services/definitions/vector-log.d.mts +7 -0
  520. package/dist/services/definitions/vector-log.d.mts.map +1 -0
  521. package/dist/services/definitions/vector-log.mjs +58 -0
  522. package/dist/services/definitions/vector-log.mjs.map +1 -0
  523. package/dist/services/definitions/vikunja.cjs +96 -0
  524. package/dist/services/definitions/vikunja.cjs.map +1 -0
  525. package/dist/services/definitions/vikunja.d.cts +7 -0
  526. package/dist/services/definitions/vikunja.d.cts.map +1 -0
  527. package/dist/services/definitions/vikunja.d.mts +7 -0
  528. package/dist/services/definitions/vikunja.d.mts.map +1 -0
  529. package/dist/services/definitions/vikunja.mjs +95 -0
  530. package/dist/services/definitions/vikunja.mjs.map +1 -0
  531. package/dist/services/definitions/wireguard.cjs +88 -0
  532. package/dist/services/definitions/wireguard.cjs.map +1 -0
  533. package/dist/services/definitions/wireguard.d.cts +7 -0
  534. package/dist/services/definitions/wireguard.d.cts.map +1 -0
  535. package/dist/services/definitions/wireguard.d.mts +7 -0
  536. package/dist/services/definitions/wireguard.d.mts.map +1 -0
  537. package/dist/services/definitions/wireguard.mjs +87 -0
  538. package/dist/services/definitions/wireguard.mjs.map +1 -0
  539. package/dist/services/definitions/woodpecker-ci.cjs +93 -0
  540. package/dist/services/definitions/woodpecker-ci.cjs.map +1 -0
  541. package/dist/services/definitions/woodpecker-ci.d.cts +7 -0
  542. package/dist/services/definitions/woodpecker-ci.d.cts.map +1 -0
  543. package/dist/services/definitions/woodpecker-ci.d.mts +7 -0
  544. package/dist/services/definitions/woodpecker-ci.d.mts.map +1 -0
  545. package/dist/services/definitions/woodpecker-ci.mjs +92 -0
  546. package/dist/services/definitions/woodpecker-ci.mjs.map +1 -0
  547. package/dist/services/definitions/zulip.cjs +116 -0
  548. package/dist/services/definitions/zulip.cjs.map +1 -0
  549. package/dist/services/definitions/zulip.d.cts +7 -0
  550. package/dist/services/definitions/zulip.d.cts.map +1 -0
  551. package/dist/services/definitions/zulip.d.mts +7 -0
  552. package/dist/services/definitions/zulip.d.mts.map +1 -0
  553. package/dist/services/definitions/zulip.mjs +115 -0
  554. package/dist/services/definitions/zulip.mjs.map +1 -0
  555. package/dist/services/registry.cjs +3 -0
  556. package/dist/services/registry.cjs.map +1 -1
  557. package/dist/services/registry.d.cts.map +1 -1
  558. package/dist/services/registry.d.mts.map +1 -1
  559. package/dist/services/registry.mjs +3 -0
  560. package/dist/services/registry.mjs.map +1 -1
  561. package/dist/services/registry.test.cjs +8 -1
  562. package/dist/services/registry.test.cjs.map +1 -1
  563. package/dist/services/registry.test.mjs +8 -1
  564. package/dist/services/registry.test.mjs.map +1 -1
  565. package/dist/{skill-manifest-BVUXU0__.mjs → skill-manifest-6XhrhWsG.mjs} +49 -1
  566. package/dist/{skill-manifest--IgY9REK.cjs.map → skill-manifest-6XhrhWsG.mjs.map} +1 -1
  567. package/dist/{skill-manifest--IgY9REK.cjs → skill-manifest-B8znSsym.cjs} +49 -1
  568. package/dist/{skill-manifest-BVUXU0__.mjs.map → skill-manifest-B8znSsym.cjs.map} +1 -1
  569. package/dist/skills/registry.cjs +3 -3
  570. package/dist/skills/registry.cjs.map +1 -1
  571. package/dist/skills/registry.mjs +3 -3
  572. package/dist/skills/registry.mjs.map +1 -1
  573. package/dist/skills/skill-manifest.cjs +1 -1
  574. package/dist/skills/skill-manifest.mjs +1 -1
  575. package/dist/track-analytics.cjs +50 -0
  576. package/dist/track-analytics.cjs.map +1 -0
  577. package/dist/track-analytics.d.cts +34 -0
  578. package/dist/track-analytics.d.cts.map +1 -0
  579. package/dist/track-analytics.d.mts +34 -0
  580. package/dist/track-analytics.d.mts.map +1 -0
  581. package/dist/track-analytics.mjs +48 -0
  582. package/dist/track-analytics.mjs.map +1 -0
  583. package/dist/track-analytics.test.cjs +91 -0
  584. package/dist/track-analytics.test.cjs.map +1 -0
  585. package/dist/track-analytics.test.d.cts +1 -0
  586. package/dist/track-analytics.test.d.mts +1 -0
  587. package/dist/track-analytics.test.mjs +92 -0
  588. package/dist/track-analytics.test.mjs.map +1 -0
  589. package/dist/types.cjs +35 -0
  590. package/dist/types.cjs.map +1 -1
  591. package/dist/types.d.cts +5 -2
  592. package/dist/types.d.cts.map +1 -1
  593. package/dist/types.d.mts +5 -2
  594. package/dist/types.d.mts.map +1 -1
  595. package/dist/types.mjs +35 -0
  596. package/dist/types.mjs.map +1 -1
  597. package/dist/validator.test.cjs +1 -1
  598. package/dist/validator.test.mjs +1 -1
  599. package/dist/version-manager.cjs +1 -1
  600. package/dist/version-manager.cjs.map +1 -1
  601. package/dist/version-manager.mjs +1 -1
  602. package/dist/version-manager.mjs.map +1 -1
  603. package/dist/version-manager.test.cjs +7 -5
  604. package/dist/version-manager.test.cjs.map +1 -1
  605. package/dist/version-manager.test.mjs +7 -5
  606. package/dist/version-manager.test.mjs.map +1 -1
  607. package/dist/{vi.2VT5v0um-DvC3SVNc.mjs → vi.2VT5v0um-C_jmO7m2.mjs} +5 -5
  608. package/dist/{vi.2VT5v0um-DvC3SVNc.mjs.map → vi.2VT5v0um-C_jmO7m2.mjs.map} +1 -1
  609. package/dist/{vi.2VT5v0um-CRqXre87.cjs → vi.2VT5v0um-iVBt6Fyq.cjs} +5 -5
  610. package/dist/{vi.2VT5v0um-CRqXre87.cjs.map → vi.2VT5v0um-iVBt6Fyq.cjs.map} +1 -1
  611. package/package.json +1 -1
  612. package/src/__snapshots__/composer.snapshot.test.ts.snap +285 -65
  613. package/src/bare-metal-partition.test.ts +4 -3
  614. package/src/composer.test.ts +4 -2
  615. package/src/composer.ts +45 -16
  616. package/src/generate.test.ts +2 -1
  617. package/src/generate.ts +11 -1
  618. package/src/generators/clone-repos.test.ts +154 -0
  619. package/src/generators/clone-repos.ts +159 -0
  620. package/src/generators/env.ts +214 -0
  621. package/src/generators/openclaw-json.ts +156 -1
  622. package/src/generators/postgres-init.ts +17 -0
  623. package/src/generators/readme.ts +2 -1
  624. package/src/generators/scripts.test.ts +52 -4
  625. package/src/generators/scripts.ts +351 -3
  626. package/src/generators/stack-manifest.ts +4 -2
  627. package/src/index.ts +8 -0
  628. package/src/presets/registry.ts +20 -0
  629. package/src/resolver.test.ts +53 -15
  630. package/src/resolver.ts +13 -1
  631. package/src/schema.ts +37 -4
  632. package/src/services/definitions/adguard-home.ts +79 -0
  633. package/src/services/definitions/apptension-saas.ts +84 -0
  634. package/src/services/definitions/audiobookshelf.ts +83 -0
  635. package/src/services/definitions/baserow.ts +118 -0
  636. package/src/services/definitions/boxyhq-saas.ts +84 -0
  637. package/src/services/definitions/calibre-web.ts +95 -0
  638. package/src/services/definitions/clickhouse.ts +115 -0
  639. package/src/services/definitions/cloudflared.ts +55 -0
  640. package/src/services/definitions/cmsaas-starter.ts +84 -0
  641. package/src/services/definitions/cockroachdb.ts +75 -0
  642. package/src/services/definitions/coder.ts +68 -0
  643. package/src/services/definitions/dragonfly.ts +68 -0
  644. package/src/services/definitions/drone-ci.ts +96 -0
  645. package/src/services/definitions/element-web.ts +62 -0
  646. package/src/services/definitions/focalboard.ts +69 -0
  647. package/src/services/definitions/forgejo.ts +109 -0
  648. package/src/services/definitions/graylog.ts +101 -0
  649. package/src/services/definitions/index.ts +159 -0
  650. package/src/services/definitions/influxdb.ts +109 -0
  651. package/src/services/definitions/invoke-ai.ts +76 -0
  652. package/src/services/definitions/ixartz-saas.ts +84 -0
  653. package/src/services/definitions/jaeger.ts +94 -0
  654. package/src/services/definitions/jan.ts +68 -0
  655. package/src/services/definitions/jitsi-meet.ts +108 -0
  656. package/src/services/definitions/local-ai.ts +90 -0
  657. package/src/services/definitions/metabase.ts +111 -0
  658. package/src/services/definitions/mission-control.ts +19 -2
  659. package/src/services/definitions/mosquitto.ts +84 -0
  660. package/src/services/definitions/navidrome.ts +95 -0
  661. package/src/services/definitions/nginx-proxy-manager.ts +70 -0
  662. package/src/services/definitions/node-red.ts +83 -0
  663. package/src/services/definitions/open-saas.ts +79 -0
  664. package/src/services/definitions/photoprism.ts +130 -0
  665. package/src/services/definitions/pihole.ts +79 -0
  666. package/src/services/definitions/piper-tts.ts +76 -0
  667. package/src/services/definitions/plane.ts +75 -0
  668. package/src/services/definitions/plausible.ts +97 -0
  669. package/src/services/definitions/pocket-id.ts +98 -0
  670. package/src/services/definitions/posthog.ts +97 -0
  671. package/src/services/definitions/redis.ts +1 -1
  672. package/src/services/definitions/revolt.ts +68 -0
  673. package/src/services/definitions/sentry.ts +104 -0
  674. package/src/services/definitions/sonarqube.ts +85 -0
  675. package/src/services/definitions/superset.ts +84 -0
  676. package/src/services/definitions/surrealdb.ts +77 -0
  677. package/src/services/definitions/tabby-ml.ts +76 -0
  678. package/src/services/definitions/tempo.ts +59 -0
  679. package/src/services/definitions/text-gen-webui.ts +92 -0
  680. package/src/services/definitions/timescaledb.ts +90 -0
  681. package/src/services/definitions/valkey.ts +1 -1
  682. package/src/services/definitions/vector-log.ts +61 -0
  683. package/src/services/definitions/vikunja.ts +96 -0
  684. package/src/services/definitions/wireguard.ts +89 -0
  685. package/src/services/definitions/woodpecker-ci.ts +97 -0
  686. package/src/services/definitions/zulip.ts +117 -0
  687. package/src/services/registry.test.ts +8 -0
  688. package/src/services/registry.ts +7 -0
  689. package/src/skills/manifest.json +64 -0
  690. package/src/skills/registry.ts +3 -3
  691. package/src/track-analytics.test.ts +82 -0
  692. package/src/track-analytics.ts +76 -0
  693. package/src/types.ts +40 -0
  694. package/src/version-manager.test.ts +10 -5
  695. package/src/version-manager.ts +1 -1
  696. package/dist/schema-C_hc7e4k.d.cts.map +0 -1
  697. package/dist/schema-CaesJaS2.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"generate.mjs","names":[],"sources":["../src/generate.ts"],"sourcesContent":["import {\n\tpartitionBareMetal,\n\tplatformToNativePlatform,\n\tresolvedWithOnlyServices,\n} from \"./bare-metal-partition.js\";\nimport { composeMultiFile } from \"./composer.js\";\nimport { StackConfigError, ValidationError } from \"./errors.js\";\nimport { generateBareMetalInstall } from \"./generators/bare-metal-install.js\";\nimport { generateCaddyfile } from \"./generators/caddy.js\";\nimport { generateCloudInit } from \"./generators/cloud-init.js\";\nimport { generateEnvFiles } from \"./generators/env.js\";\nimport { generateGsdScripts } from \"./generators/get-shit-done.js\";\nimport { generateGrafanaConfig, generateGrafanaDashboard } from \"./generators/grafana.js\";\nimport { generateHealthCheck } from \"./generators/health-check.js\";\nimport { generateN8nWorkflows } from \"./generators/n8n-workflows.js\";\nimport { generateNativeInstallScripts } from \"./generators/native-services.js\";\nimport { generateOpenclawInstallScript } from \"./generators/openclaw-install-script.js\";\nimport { generateOpenClawConfig } from \"./generators/openclaw-json.js\";\nimport { generatePostgresInit } from \"./generators/postgres-init.js\";\nimport { generatePrometheusConfig } from \"./generators/prometheus.js\";\nimport { generateReadme } from \"./generators/readme.js\";\nimport { generateScripts } from \"./generators/scripts.js\";\nimport { generateSkillFiles } from \"./generators/skills.js\";\nimport { generateStackManifest } from \"./generators/stack-manifest.js\";\nimport { generateTraefikConfig } from \"./generators/traefik.js\";\nimport { migrateConfig } from \"./migrations.js\";\nimport { resolve } from \"./resolver.js\";\nimport type {\n\tGeneratedFiles,\n\tGenerationInput,\n\tGenerationResult,\n\tPlatform,\n\tResolverInput,\n} from \"./types.js\";\nimport { validate } from \"./validator.js\";\n\n/** Resolver/compose only support linux image platforms; normalize for bare-metal (windows/macos). */\nfunction getComposePlatform(platform: Platform): \"linux/amd64\" | \"linux/arm64\" {\n\tif (platform === \"linux/amd64\" || platform === \"linux/arm64\") return platform;\n\treturn \"linux/amd64\";\n}\n\n/**\n * Main orchestration function: takes generation input, resolves dependencies,\n * generates all files, validates, and returns the complete file tree.\n */\nexport function generate(rawInput: GenerationInput): GenerationResult {\n\t// Apply config migrations if needed\n\tconst input = migrateConfig(rawInput as Record<string, unknown>) as GenerationInput;\n\n\tconst composePlatform = getComposePlatform(input.platform);\n\n\t// 1. Resolve dependencies\n\tconst resolverInput: ResolverInput = {\n\t\tservices: input.services,\n\t\tskillPacks: input.skillPacks,\n\t\taiProviders: input.aiProviders,\n\t\tproxy: input.proxy,\n\t\tgpu: input.gpu,\n\t\tplatform: composePlatform,\n\t\tmonitoring: input.monitoring,\n\t};\n\tconst resolved = resolve(resolverInput);\n\n\tif (!resolved.isValid) {\n\t\tthrow new StackConfigError(\n\t\t\t`Invalid stack configuration: ${resolved.errors.map((e) => e.message).join(\"; \")}`,\n\t\t);\n\t}\n\n\tconst isBareMetal = input.deploymentType === \"bare-metal\";\n\tlet resolvedForCompose = resolved;\n\tlet nativeIds = new Set<string>();\n\tlet nativeServices: typeof resolved.services = [];\n\tlet dockerOnlyServices: typeof resolved.services = [];\n\n\tif (isBareMetal) {\n\t\tconst partition = partitionBareMetal(resolved, input.platform);\n\t\tnativeServices = partition.nativeServices;\n\t\tdockerOnlyServices = partition.dockerOnlyServices;\n\t\tnativeIds = partition.nativeIds;\n\t\tif (nativeServices.length > 0) {\n\t\t\tresolvedForCompose = resolvedWithOnlyServices(resolved, dockerOnlyServices);\n\t\t}\n\t}\n\n\t// 2. Generate Docker Compose YAML (multi-file)\n\t// Compute Traefik labels before composing (labels get injected into docker-compose services)\n\tlet traefikOutput: ReturnType<typeof generateTraefikConfig> | undefined;\n\tif (input.proxy === \"traefik\" && input.domain) {\n\t\ttraefikOutput = generateTraefikConfig(resolvedForCompose, input.domain);\n\t}\n\n\tconst composeOptions = {\n\t\tprojectName: input.projectName,\n\t\tproxy: input.proxy,\n\t\tproxyHttpPort: input.proxyHttpPort,\n\t\tproxyHttpsPort: input.proxyHttpsPort,\n\t\tportOverrides: input.portOverrides,\n\t\tdomain: input.domain,\n\t\tgpu: input.gpu,\n\t\tplatform: composePlatform,\n\t\tdeployment: input.deployment,\n\t\topenclawVersion: input.openclawVersion,\n\t\tbareMetalNativeHost: isBareMetal && nativeIds.size > 0,\n\t\ttraefikLabels: traefikOutput?.serviceLabels,\n\t\topenclawImage: input.openclawImage ?? \"official\",\n\t\thardened: input.hardened ?? true,\n\t\topenclawInstallMethod: input.openclawInstallMethod ?? \"docker\",\n\t};\n\tconst composeResult = composeMultiFile(resolvedForCompose, composeOptions);\n\n\t// 3. Validate (using the base docker-compose.yml)\n\tconst validation = validate(resolvedForCompose, composeResult.files[\"docker-compose.yml\"] ?? \"\", {\n\t\tdomain: input.domain,\n\t\tgenerateSecrets: input.generateSecrets,\n\t});\n\tif (!validation.valid) {\n\t\tthrow new ValidationError(\n\t\t\t`Validation failed: ${validation.errors.map((e) => e.message).join(\"; \")}`,\n\t\t);\n\t}\n\n\t// 4. Generate all files\n\tconst files: GeneratedFiles = {};\n\n\t// Docker Compose (multi-file output)\n\tfor (const [filename, content] of Object.entries(composeResult.files)) {\n\t\tfiles[filename] = content;\n\t}\n\n\t// Environment files (when bare-metal with native services, host vars use host.docker.internal)\n\tconst envFiles = generateEnvFiles(resolved, {\n\t\tgenerateSecrets: input.generateSecrets,\n\t\tdomain: input.domain,\n\t\topenclawVersion: input.openclawVersion,\n\t\tnativeServiceIds: isBareMetal ? nativeIds : undefined,\n\t\tcomposeFiles: Object.keys(composeResult.files),\n\t\tcomposeProfiles: composeResult.profiles,\n\t\topenclawImage: input.openclawImage,\n\t});\n\tfiles[\".env.example\"] = envFiles.envExample;\n\tfiles[\".env\"] = envFiles.env;\n\n\t// .gitignore\n\tfiles[\".gitignore\"] = [\n\t\t\".env\",\n\t\t\".env.local\",\n\t\t\".env.*.local\",\n\t\t\"*.log\",\n\t\t\"docker-compose.override.yml\",\n\t].join(\"\\n\");\n\n\t// Stack manifest (consumed by Mission Control)\n\tconst manifestFiles = generateStackManifest(resolved, input);\n\tfor (const [path, content] of Object.entries(manifestFiles)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// Skills\n\tconst skillFiles = generateSkillFiles(resolved);\n\tfor (const [path, content] of Object.entries(skillFiles)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// OpenClaw Core Configuration\n\tfiles[\"openclaw/config/openclaw.json\"] = generateOpenClawConfig(resolved, {\n\t\tdeploymentType: input.deploymentType,\n\t\tgatewayPort: 18789,\n\t\topenclawVersion: input.openclawVersion,\n\t});\n\n\t// README\n\tfiles[\"README.md\"] = generateReadme(resolved, {\n\t\tprojectName: input.projectName,\n\t\tdomain: input.domain,\n\t\tproxy: input.proxy,\n\t\tdeploymentType: input.deploymentType,\n\t\thasNativeServices: isBareMetal && nativeServices.length > 0,\n\t\topenclawInstallMethod: input.openclawInstallMethod,\n\t});\n\n\t// Scripts\n\tconst scripts = generateScripts();\n\tfor (const [path, content] of Object.entries(scripts)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// Health check scripts (dynamic, stack-specific)\n\tconst healthCheckFiles = generateHealthCheck(resolved, {\n\t\tprojectName: input.projectName,\n\t\tdeploymentType: input.deploymentType,\n\t});\n\tfor (const [path, content] of Object.entries(healthCheckFiles)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// n8n workflows\n\tconst n8nWorkflows = generateN8nWorkflows(resolved);\n\tfor (const [path, content] of Object.entries(n8nWorkflows)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// PostgreSQL init script (creates per-service databases and users)\n\tconst postgresInit = generatePostgresInit(resolved);\n\tif (postgresInit) {\n\t\tfiles[\"postgres/init-databases.sh\"] = postgresInit;\n\t}\n\n\t// Caddy config\n\tif (input.proxy === \"caddy\" && input.domain) {\n\t\tfiles[\"caddy/Caddyfile\"] = generateCaddyfile(resolved, input.domain);\n\t}\n\n\t// Traefik config (labels are already injected via composeOptions.traefikLabels)\n\tif (traefikOutput) {\n\t\tfiles[\"traefik/traefik.yml\"] = traefikOutput.staticConfig;\n\t}\n\n\t// Prometheus config\n\tconst hasPrometheus = resolved.services.some((s) => s.definition.id === \"prometheus\");\n\tif (hasPrometheus) {\n\t\tfiles[\"prometheus/prometheus.yml\"] = generatePrometheusConfig(resolved);\n\t}\n\n\t// Grafana config\n\tconst hasGrafana = resolved.services.some((s) => s.definition.id === \"grafana\");\n\tif (hasGrafana) {\n\t\tconst grafanaFiles = generateGrafanaConfig();\n\t\tfor (const [path, content] of Object.entries(grafanaFiles)) {\n\t\t\tfiles[path] = content;\n\t\t}\n\t\t// Grafana dashboard\n\t\tfiles[\"config/grafana/dashboards/openclaw-stack-overview.json\"] = generateGrafanaDashboard();\n\t}\n\n\t// Docker Compose override (empty template)\n\tfiles[\"docker-compose.override.yml\"] = [\n\t\t\"# Local overrides for docker-compose.yml\",\n\t\t\"# This file is gitignored — use it for personal port changes, extra volumes, etc.\",\n\t\t\"services: {}\",\n\t\t\"\",\n\t].join(\"\\n\");\n\n\t// SERVICES.md documentation\n\tfiles[\"docs/SERVICES.md\"] = generateServicesDoc(resolved);\n\n\t// Bare-metal: native install scripts + top-level installer\n\tif (isBareMetal) {\n\t\tif (nativeServices.length > 0) {\n\t\t\tconst nativePlatform = platformToNativePlatform(input.platform);\n\t\t\tconst nativeScripts = generateNativeInstallScripts({\n\t\t\t\tnativeServices,\n\t\t\t\tplatform: nativePlatform,\n\t\t\t\tprojectName: input.projectName,\n\t\t\t});\n\t\t\tfor (const [path, content] of Object.entries(nativeScripts)) {\n\t\t\t\tfiles[path] = content;\n\t\t\t}\n\t\t}\n\t\tconst bareMetalFiles = generateBareMetalInstall({\n\t\t\tplatform: input.platform,\n\t\t\tprojectName: input.projectName,\n\t\t\thasNativeServices: nativeServices.length > 0,\n\t\t});\n\t\tfor (const [path, content] of Object.entries(bareMetalFiles)) {\n\t\t\tfiles[path] = content;\n\t\t}\n\t}\n\n\t// Get-Shit-Done setup scripts\n\tif (input.gsdRuntimes && input.gsdRuntimes.length > 0) {\n\t\tconst gsdScripts = generateGsdScripts(input.gsdRuntimes);\n\t\tif (gsdScripts) {\n\t\t\tfiles[\"openclaw/scripts/setup-gsd.sh\"] = gsdScripts.sh;\n\t\t\tfiles[\"openclaw/scripts/setup-gsd.ps1\"] = gsdScripts.ps1;\n\t\t}\n\t}\n\n\t// OpenClaw direct install scripts (host-based, no Docker gateway)\n\tif (input.openclawInstallMethod === \"direct\") {\n\t\tconst installScripts = generateOpenclawInstallScript({\n\t\t\tprojectName: input.projectName,\n\t\t});\n\t\tfor (const [path, content] of Object.entries(installScripts)) {\n\t\t\tfiles[path] = content;\n\t\t}\n\t}\n\n\t// Cloud-init deploy target\n\tif (input.deployTarget === \"cloud-init\") {\n\t\tconst mainCompose = composeResult.files[\"docker-compose.yml\"] ?? \"\";\n\t\tfiles[\"cloud-init.yml\"] = generateCloudInit({\n\t\t\tcomposeYaml: mainCompose,\n\t\t\tenvContent: envFiles.env,\n\t\t\tprojectName: input.projectName,\n\t\t\tgatewayPort: 18789,\n\t\t});\n\t}\n\n\t// 5. Calculate metadata\n\tconst skillCount = resolved.services.reduce((sum, s) => sum + s.definition.skills.length, 0);\n\n\treturn {\n\t\tfiles,\n\t\tmetadata: {\n\t\t\tserviceCount: resolved.services.length,\n\t\t\tskillCount,\n\t\t\testimatedMemoryMB: resolved.estimatedMemoryMB,\n\t\t\tgeneratedAt: new Date().toISOString(),\n\t\t},\n\t};\n}\n\nexport function generateServicesDoc(resolved: import(\"./types.js\").ResolverOutput): string {\n\tconst lines: string[] = [\n\t\t\"# Service Reference\",\n\t\t\"\",\n\t\t\"This document describes all companion services in your OpenClaw stack.\",\n\t\t\"\",\n\t];\n\n\tfor (const svc of resolved.services) {\n\t\tconst def = svc.definition;\n\t\tlines.push(`## ${def.icon} ${def.name}`);\n\t\tlines.push(\"\");\n\t\tlines.push(def.description);\n\t\tlines.push(\"\");\n\t\tlines.push(`- **Image**: \\`${def.image}:${def.imageTag}\\``);\n\t\tlines.push(`- **Category**: ${def.category}`);\n\t\tlines.push(`- **Maturity**: ${def.maturity}`);\n\t\tif (def.minMemoryMB) {\n\t\t\tlines.push(`- **Min Memory**: ${def.minMemoryMB}MB`);\n\t\t}\n\t\tif (def.ports.length > 0) {\n\t\t\tlines.push(\"- **Ports**:\");\n\t\t\tfor (const p of def.ports) {\n\t\t\t\tlines.push(\n\t\t\t\t\t` - \\`${p.container}\\` — ${p.description}${p.exposed ? \"\" : \" (internal only)\"}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tlines.push(`- **Docs**: ${def.docsUrl}`);\n\t\tlines.push(\"\");\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAS,mBAAmB,UAAmD;AAC9E,KAAI,aAAa,iBAAiB,aAAa,cAAe,QAAO;AACrE,QAAO;;;;;;AAOR,SAAgB,SAAS,UAA6C;CAErE,MAAM,QAAQ,cAAc,SAAoC;CAEhE,MAAM,kBAAkB,mBAAmB,MAAM,SAAS;CAY1D,MAAM,WAAW,QAToB;EACpC,UAAU,MAAM;EAChB,YAAY,MAAM;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;AACxC,QAAM,KAAK,GAAG;;AAGf,QAAO,MAAM,KAAK,KAAK"}
1
+ {"version":3,"file":"generate.mjs","names":[],"sources":["../src/generate.ts"],"sourcesContent":["import {\n\tpartitionBareMetal,\n\tplatformToNativePlatform,\n\tresolvedWithOnlyServices,\n} from \"./bare-metal-partition.js\";\nimport { composeMultiFile } from \"./composer.js\";\nimport { StackConfigError, ValidationError } from \"./errors.js\";\nimport { generateBareMetalInstall } from \"./generators/bare-metal-install.js\";\nimport { generateCaddyfile } from \"./generators/caddy.js\";\nimport { generateCloneScripts } from \"./generators/clone-repos.js\";\nimport { generateCloudInit } from \"./generators/cloud-init.js\";\nimport { generateEnvFiles } from \"./generators/env.js\";\nimport { generateGsdScripts } from \"./generators/get-shit-done.js\";\nimport { generateGrafanaConfig, generateGrafanaDashboard } from \"./generators/grafana.js\";\nimport { generateHealthCheck } from \"./generators/health-check.js\";\nimport { generateN8nWorkflows } from \"./generators/n8n-workflows.js\";\nimport { generateNativeInstallScripts } from \"./generators/native-services.js\";\nimport { generateOpenclawInstallScript } from \"./generators/openclaw-install-script.js\";\nimport { generateOpenClawConfig } from \"./generators/openclaw-json.js\";\nimport { generatePostgresInit } from \"./generators/postgres-init.js\";\nimport { generatePrometheusConfig } from \"./generators/prometheus.js\";\nimport { generateReadme } from \"./generators/readme.js\";\nimport { generateScripts } from \"./generators/scripts.js\";\nimport { generateSkillFiles } from \"./generators/skills.js\";\nimport { generateStackManifest } from \"./generators/stack-manifest.js\";\nimport { generateTraefikConfig } from \"./generators/traefik.js\";\nimport { migrateConfig } from \"./migrations.js\";\nimport { resolve } from \"./resolver.js\";\nimport type {\n\tGeneratedFiles,\n\tGenerationInput,\n\tGenerationResult,\n\tPlatform,\n\tResolverInput,\n} from \"./types.js\";\nimport { validate } from \"./validator.js\";\n\n/** Resolver/compose only support linux image platforms; normalize for bare-metal (windows/macos). */\nfunction getComposePlatform(platform: Platform): \"linux/amd64\" | \"linux/arm64\" {\n\tif (platform === \"linux/amd64\" || platform === \"linux/arm64\") return platform;\n\treturn \"linux/amd64\";\n}\n\n/**\n * Main orchestration function: takes generation input, resolves dependencies,\n * generates all files, validates, and returns the complete file tree.\n */\nexport function generate(rawInput: GenerationInput): GenerationResult {\n\t// Apply config migrations if needed\n\tconst input = migrateConfig(rawInput as Record<string, unknown>) as GenerationInput;\n\n\tconst composePlatform = getComposePlatform(input.platform);\n\n\t// 1. Resolve dependencies\n\tconst resolverInput: ResolverInput = {\n\t\tservices: input.services,\n\t\tskillPacks: input.skillPacks,\n\t\taiProviders: input.aiProviders,\n\t\tproxy: input.proxy,\n\t\tgpu: input.gpu,\n\t\tplatform: composePlatform,\n\t\tmonitoring: input.monitoring,\n\t};\n\tconst resolved = resolve(resolverInput);\n\n\tif (!resolved.isValid) {\n\t\tthrow new StackConfigError(\n\t\t\t`Invalid stack configuration: ${resolved.errors.map((e) => e.message).join(\"; \")}`,\n\t\t);\n\t}\n\n\tconst isBareMetal = input.deploymentType === \"bare-metal\";\n\tlet resolvedForCompose = resolved;\n\tlet nativeIds = new Set<string>();\n\tlet nativeServices: typeof resolved.services = [];\n\tlet dockerOnlyServices: typeof resolved.services = [];\n\n\tif (isBareMetal) {\n\t\tconst partition = partitionBareMetal(resolved, input.platform);\n\t\tnativeServices = partition.nativeServices;\n\t\tdockerOnlyServices = partition.dockerOnlyServices;\n\t\tnativeIds = partition.nativeIds;\n\t\tif (nativeServices.length > 0) {\n\t\t\tresolvedForCompose = resolvedWithOnlyServices(resolved, dockerOnlyServices);\n\t\t}\n\t}\n\n\t// 2. Generate Docker Compose YAML (multi-file)\n\t// Compute Traefik labels before composing (labels get injected into docker-compose services)\n\tlet traefikOutput: ReturnType<typeof generateTraefikConfig> | undefined;\n\tif (input.proxy === \"traefik\" && input.domain) {\n\t\ttraefikOutput = generateTraefikConfig(resolvedForCompose, input.domain);\n\t}\n\n\tconst composeOptions = {\n\t\tprojectName: input.projectName,\n\t\tproxy: input.proxy,\n\t\tproxyHttpPort: input.proxyHttpPort,\n\t\tproxyHttpsPort: input.proxyHttpsPort,\n\t\tportOverrides: input.portOverrides,\n\t\tdomain: input.domain,\n\t\tgpu: input.gpu,\n\t\tplatform: composePlatform,\n\t\tdeployment: input.deployment,\n\t\topenclawVersion: input.openclawVersion,\n\t\tbareMetalNativeHost: isBareMetal && nativeIds.size > 0,\n\t\ttraefikLabels: traefikOutput?.serviceLabels,\n\t\topenclawImage: input.openclawImage ?? \"official\",\n\t\thardened: input.hardened ?? true,\n\t\topenclawInstallMethod: input.openclawInstallMethod ?? \"docker\",\n\t};\n\tconst composeResult = composeMultiFile(resolvedForCompose, composeOptions);\n\n\t// 3. Validate (using the base docker-compose.yml)\n\tconst validation = validate(resolvedForCompose, composeResult.files[\"docker-compose.yml\"] ?? \"\", {\n\t\tdomain: input.domain,\n\t\tgenerateSecrets: input.generateSecrets,\n\t});\n\tif (!validation.valid) {\n\t\tthrow new ValidationError(\n\t\t\t`Validation failed: ${validation.errors.map((e) => e.message).join(\"; \")}`,\n\t\t);\n\t}\n\n\t// 4. Generate all files\n\tconst files: GeneratedFiles = {};\n\n\t// Docker Compose (multi-file output)\n\tfor (const [filename, content] of Object.entries(composeResult.files)) {\n\t\tfiles[filename] = content;\n\t}\n\n\t// Environment files (when bare-metal with native services, host vars use host.docker.internal)\n\tconst envFiles = generateEnvFiles(resolved, {\n\t\tgenerateSecrets: input.generateSecrets,\n\t\tdomain: input.domain,\n\t\topenclawVersion: input.openclawVersion,\n\t\tnativeServiceIds: isBareMetal ? nativeIds : undefined,\n\t\tcomposeFiles: Object.keys(composeResult.files),\n\t\tcomposeProfiles: composeResult.profiles,\n\t\topenclawImage: input.openclawImage,\n\t});\n\tfiles[\".env.example\"] = envFiles.envExample;\n\tfiles[\".env\"] = envFiles.env;\n\n\t// .gitignore\n\tfiles[\".gitignore\"] = [\n\t\t\".env\",\n\t\t\".env.local\",\n\t\t\".env.*.local\",\n\t\t\"*.log\",\n\t\t\"docker-compose.override.yml\",\n\t\t\"repos/\",\n\t].join(\"\\n\");\n\n\t// Stack manifest (consumed by Mission Control)\n\tconst manifestFiles = generateStackManifest(resolved, input);\n\tfor (const [path, content] of Object.entries(manifestFiles)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// Skills\n\tconst skillFiles = generateSkillFiles(resolved);\n\tfor (const [path, content] of Object.entries(skillFiles)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// OpenClaw Core Configuration\n\tfiles[\"openclaw/config/openclaw.json\"] = generateOpenClawConfig(resolved, {\n\t\tdeploymentType: input.deploymentType,\n\t\tgatewayPort: 18789,\n\t\topenclawVersion: input.openclawVersion,\n\t});\n\n\t// README\n\tfiles[\"README.md\"] = generateReadme(resolved, {\n\t\tprojectName: input.projectName,\n\t\tdomain: input.domain,\n\t\tproxy: input.proxy,\n\t\tdeploymentType: input.deploymentType,\n\t\thasNativeServices: isBareMetal && nativeServices.length > 0,\n\t\topenclawInstallMethod: input.openclawInstallMethod,\n\t});\n\n\t// Scripts\n\tconst hasGitServices = resolvedForCompose.services.some((s) => s.definition.gitSource);\n\tconst scripts = generateScripts({ hasGitServices });\n\tfor (const [path, content] of Object.entries(scripts)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// Clone scripts for git-based services (SaaS boilerplates)\n\tconst cloneScripts = generateCloneScripts(resolvedForCompose);\n\tfor (const [path, content] of Object.entries(cloneScripts)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// Health check scripts (dynamic, stack-specific)\n\tconst healthCheckFiles = generateHealthCheck(resolved, {\n\t\tprojectName: input.projectName,\n\t\tdeploymentType: input.deploymentType,\n\t});\n\tfor (const [path, content] of Object.entries(healthCheckFiles)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// n8n workflows\n\tconst n8nWorkflows = generateN8nWorkflows(resolved);\n\tfor (const [path, content] of Object.entries(n8nWorkflows)) {\n\t\tfiles[path] = content;\n\t}\n\n\t// PostgreSQL init script (creates per-service databases and users)\n\tconst postgresInit = generatePostgresInit(resolved);\n\tif (postgresInit) {\n\t\tfiles[\"postgres/init-databases.sh\"] = postgresInit;\n\t}\n\n\t// Caddy config\n\tif (input.proxy === \"caddy\" && input.domain) {\n\t\tfiles[\"caddy/Caddyfile\"] = generateCaddyfile(resolved, input.domain);\n\t}\n\n\t// Traefik config (labels are already injected via composeOptions.traefikLabels)\n\tif (traefikOutput) {\n\t\tfiles[\"traefik/traefik.yml\"] = traefikOutput.staticConfig;\n\t}\n\n\t// Prometheus config\n\tconst hasPrometheus = resolved.services.some((s) => s.definition.id === \"prometheus\");\n\tif (hasPrometheus) {\n\t\tfiles[\"prometheus/prometheus.yml\"] = generatePrometheusConfig(resolved);\n\t}\n\n\t// Grafana config\n\tconst hasGrafana = resolved.services.some((s) => s.definition.id === \"grafana\");\n\tif (hasGrafana) {\n\t\tconst grafanaFiles = generateGrafanaConfig();\n\t\tfor (const [path, content] of Object.entries(grafanaFiles)) {\n\t\t\tfiles[path] = content;\n\t\t}\n\t\t// Grafana dashboard\n\t\tfiles[\"config/grafana/dashboards/openclaw-stack-overview.json\"] = generateGrafanaDashboard();\n\t}\n\n\t// Docker Compose override (empty template)\n\tfiles[\"docker-compose.override.yml\"] = [\n\t\t\"# Local overrides for docker-compose.yml\",\n\t\t\"# This file is gitignored — use it for personal port changes, extra volumes, etc.\",\n\t\t\"services: {}\",\n\t\t\"\",\n\t].join(\"\\n\");\n\n\t// SERVICES.md documentation\n\tfiles[\"docs/SERVICES.md\"] = generateServicesDoc(resolved);\n\n\t// Bare-metal: native install scripts + top-level installer\n\tif (isBareMetal) {\n\t\tif (nativeServices.length > 0) {\n\t\t\tconst nativePlatform = platformToNativePlatform(input.platform);\n\t\t\tconst nativeScripts = generateNativeInstallScripts({\n\t\t\t\tnativeServices,\n\t\t\t\tplatform: nativePlatform,\n\t\t\t\tprojectName: input.projectName,\n\t\t\t});\n\t\t\tfor (const [path, content] of Object.entries(nativeScripts)) {\n\t\t\t\tfiles[path] = content;\n\t\t\t}\n\t\t}\n\t\tconst bareMetalFiles = generateBareMetalInstall({\n\t\t\tplatform: input.platform,\n\t\t\tprojectName: input.projectName,\n\t\t\thasNativeServices: nativeServices.length > 0,\n\t\t});\n\t\tfor (const [path, content] of Object.entries(bareMetalFiles)) {\n\t\t\tfiles[path] = content;\n\t\t}\n\t}\n\n\t// Get-Shit-Done setup scripts\n\tif (input.gsdRuntimes && input.gsdRuntimes.length > 0) {\n\t\tconst gsdScripts = generateGsdScripts(input.gsdRuntimes);\n\t\tif (gsdScripts) {\n\t\t\tfiles[\"openclaw/scripts/setup-gsd.sh\"] = gsdScripts.sh;\n\t\t\tfiles[\"openclaw/scripts/setup-gsd.ps1\"] = gsdScripts.ps1;\n\t\t}\n\t}\n\n\t// OpenClaw direct install scripts (host-based, no Docker gateway)\n\tif (input.openclawInstallMethod === \"direct\") {\n\t\tconst installScripts = generateOpenclawInstallScript({\n\t\t\tprojectName: input.projectName,\n\t\t});\n\t\tfor (const [path, content] of Object.entries(installScripts)) {\n\t\t\tfiles[path] = content;\n\t\t}\n\t}\n\n\t// Cloud-init deploy target\n\tif (input.deployTarget === \"cloud-init\") {\n\t\tconst mainCompose = composeResult.files[\"docker-compose.yml\"] ?? \"\";\n\t\tfiles[\"cloud-init.yml\"] = generateCloudInit({\n\t\t\tcomposeYaml: mainCompose,\n\t\t\tenvContent: envFiles.env,\n\t\t\tprojectName: input.projectName,\n\t\t\tgatewayPort: 18789,\n\t\t});\n\t}\n\n\t// 5. Calculate metadata\n\tconst skillCount = resolved.services.reduce((sum, s) => sum + s.definition.skills.length, 0);\n\n\treturn {\n\t\tfiles,\n\t\tmetadata: {\n\t\t\tserviceCount: resolved.services.length,\n\t\t\tskillCount,\n\t\t\testimatedMemoryMB: resolved.estimatedMemoryMB,\n\t\t\tresolvedServices: resolved.services.map((s) => s.definition.id),\n\t\t\tgeneratedAt: new Date().toISOString(),\n\t\t},\n\t};\n}\n\nexport function generateServicesDoc(resolved: import(\"./types.js\").ResolverOutput): string {\n\tconst lines: string[] = [\n\t\t\"# Service Reference\",\n\t\t\"\",\n\t\t\"This document describes all companion services in your OpenClaw stack.\",\n\t\t\"\",\n\t];\n\n\tfor (const svc of resolved.services) {\n\t\tconst def = svc.definition;\n\t\tlines.push(`## ${def.icon} ${def.name}`);\n\t\tlines.push(\"\");\n\t\tlines.push(def.description);\n\t\tlines.push(\"\");\n\t\tlines.push(`- **Image**: \\`${def.image}:${def.imageTag}\\``);\n\t\tlines.push(`- **Category**: ${def.category}`);\n\t\tlines.push(`- **Maturity**: ${def.maturity}`);\n\t\tif (def.minMemoryMB) {\n\t\t\tlines.push(`- **Min Memory**: ${def.minMemoryMB}MB`);\n\t\t}\n\t\tif (def.ports.length > 0) {\n\t\t\tlines.push(\"- **Ports**:\");\n\t\t\tfor (const p of def.ports) {\n\t\t\t\tlines.push(\n\t\t\t\t\t` - \\`${p.container}\\` — ${p.description}${p.exposed ? \"\" : \" (internal only)\"}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tlines.push(`- **Docs**: ${def.docsUrl}`);\n\t\tlines.push(\"\");\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,mBAAmB,UAAmD;AAC9E,KAAI,aAAa,iBAAiB,aAAa,cAAe,QAAO;AACrE,QAAO;;;;;;AAOR,SAAgB,SAAS,UAA6C;CAErE,MAAM,QAAQ,cAAc,SAAoC;CAEhE,MAAM,kBAAkB,mBAAmB,MAAM,SAAS;CAY1D,MAAM,WAAW,QAToB;EACpC,UAAU,MAAM;EAChB,YAAY,MAAM;EAClB,aAAa,MAAM;EACnB,OAAO,MAAM;EACb,KAAK,MAAM;EACX,UAAU;EACV,YAAY,MAAM;EAClB,CACsC;AAEvC,KAAI,CAAC,SAAS,QACb,OAAM,IAAI,iBACT,gCAAgC,SAAS,OAAO,KAAK,MAAM,EAAE,QAAQ,CAAC,KAAK,KAAK,GAChF;CAGF,MAAM,cAAc,MAAM,mBAAmB;CAC7C,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AAM,KAAK,GAAG;;AAGf,QAAO,MAAM,KAAK,KAAK"}
@@ -1,5 +1,5 @@
1
1
  require("./skills-BlzpHmpH.cjs");
2
- const require_vi_2VT5v0um = require("./vi.2VT5v0um-CRqXre87.cjs");
2
+ const require_vi_2VT5v0um = require("./vi.2VT5v0um-iVBt6Fyq.cjs");
3
3
  const require_generate = require("./generate.cjs");
4
4
  let yaml = require("yaml");
5
5
  //#region src/generate.test.ts
@@ -146,7 +146,7 @@ require_vi_2VT5v0um.describe("generate (end-to-end)", () => {
146
146
  if (doc?.services && typeof doc.services === "object") for (const id of Object.keys(doc.services)) allServiceIds.add(id);
147
147
  }
148
148
  for (const id of lasuiteMeetServices) require_vi_2VT5v0um.globalExpect(allServiceIds.has(id), `missing service ${id}`).toBe(true);
149
- require_vi_2VT5v0um.globalExpect(result.metadata.serviceCount).toBe(lasuiteMeetServices.length);
149
+ require_vi_2VT5v0um.globalExpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(lasuiteMeetServices.length);
150
150
  });
151
151
  require_vi_2VT5v0um.it("generates bare-metal installer for Windows (install.ps1)", () => {
152
152
  const result = require_generate.generate({
@@ -1 +1 @@
1
- {"version":3,"file":"generate.test.cjs","names":["describe","generate"],"sources":["../src/generate.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { parse } from \"yaml\";\nimport { generate } from \"./generate.js\";\n\ndescribe(\"generate (end-to-end)\", () => {\n\tit(\"generates a minimal stack (redis only)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"test-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Core files must be present\n\t\texpect(result.files).toHaveProperty(\"docker-compose.yml\");\n\t\texpect(result.files).toHaveProperty(\".env.example\");\n\t\texpect(result.files).toHaveProperty(\".env\");\n\t\texpect(result.files).toHaveProperty(\"README.md\");\n\n\t\t// docker-compose.yml must be valid YAML\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed).toHaveProperty(\"services\");\n\n\t\t// .env.example should reference REDIS_PASSWORD\n\t\texpect(result.files[\".env.example\"]).toContain(\"REDIS_PASSWORD\");\n\n\t\t// README should mention the project name\n\t\texpect(result.files[\"README.md\"]).toContain(\"test-stack\");\n\n\t\t// At least one service resolved\n\t\texpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(1);\n\t});\n\n\tit(\"generates research-agent stack from skill pack\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"research-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [\"research-agent\"],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Skill SKILL.md files for each skill in the research-agent pack\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/qdrant-memory/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/searxng-search/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/browserless-browse/SKILL.md\");\n\n\t\t// docker-compose.yml should contain the expected services\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).toHaveProperty(\"qdrant\");\n\t\texpect(composed.services).toHaveProperty(\"searxng\");\n\t\texpect(composed.services).toHaveProperty(\"browserless\");\n\t});\n\n\tit(\"generates full preset stack\", () => {\n\t\tconst fullServices = [\n\t\t\t\"redis\",\n\t\t\t\"postgresql\",\n\t\t\t\"qdrant\",\n\t\t\t\"n8n\",\n\t\t\t\"ffmpeg\",\n\t\t\t\"remotion\",\n\t\t\t\"minio\",\n\t\t\t\"caddy\",\n\t\t\t\"browserless\",\n\t\t\t\"searxng\",\n\t\t\t\"meilisearch\",\n\t\t\t\"uptime-kuma\",\n\t\t\t\"grafana\",\n\t\t\t\"prometheus\",\n\t\t\t\"ollama\",\n\t\t\t\"whisper\",\n\t\t\t\"gotify\",\n\t\t];\n\n\t\tconst result = generate({\n\t\t\tprojectName: \"full-stack\",\n\t\t\tservices: fullServices,\n\t\t\tskillPacks: [\n\t\t\t\t\"video-creator\",\n\t\t\t\t\"research-agent\",\n\t\t\t\t\"social-media\",\n\t\t\t\t\"dev-ops\",\n\t\t\t\t\"knowledge-base\",\n\t\t\t\t\"local-ai\",\n\t\t\t],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Should have many files\n\t\tconst fileCount = Object.keys(result.files).length;\n\t\texpect(fileCount).toBeGreaterThan(10);\n\n\t\t// Should include the start script\n\t\texpect(result.files).toHaveProperty(\"scripts/start.sh\");\n\n\t\t// Should not throw (it already didn't if we got here)\n\t\texpect(result.metadata.serviceCount).toBeGreaterThan(5);\n\t});\n\n\tit(\"generates caddy config when proxy is caddy\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"caddy-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"caddy/Caddyfile\");\n\t\texpect(result.files[\"caddy/Caddyfile\"]!.length).toBeGreaterThan(0);\n\t});\n\n\tit(\"generates prometheus config when monitoring enabled\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"monitored-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t\tmonitoring: true,\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"prometheus/prometheus.yml\");\n\t\t// Verify it's valid YAML\n\t\tconst promConfig = parse(result.files[\"prometheus/prometheus.yml\"]!);\n\t\texpect(promConfig).toBeDefined();\n\t});\n\n\tit(\"generates La Suite Meet stack with all expected services\", () => {\n\t\tconst lasuiteMeetServices = [\n\t\t\t\"postgresql\",\n\t\t\t\"redis\",\n\t\t\t\"livekit\",\n\t\t\t\"lasuite-meet-backend\",\n\t\t\t\"lasuite-meet-frontend\",\n\t\t\t\"lasuite-meet-agents\",\n\t\t];\n\t\tconst result = generate({\n\t\t\tprojectName: \"lasuite-meet-stack\",\n\t\t\tservices: lasuiteMeetServices,\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Services may be split across main and profile compose files\n\t\tconst allServiceIds = new Set<string>();\n\t\tfor (const [filename, content] of Object.entries(result.files)) {\n\t\t\tif (filename.endsWith(\".yml\") && content) {\n\t\t\t\tconst doc = parse(content);\n\t\t\t\tif (doc?.services && typeof doc.services === \"object\") {\n\t\t\t\t\tfor (const id of Object.keys(doc.services)) {\n\t\t\t\t\t\tallServiceIds.add(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const id of lasuiteMeetServices) {\n\t\t\texpect(allServiceIds.has(id), `missing service ${id}`).toBe(true);\n\t\t}\n\t\texpect(result.metadata.serviceCount).toBe(lasuiteMeetServices.length);\n\t});\n\n\tit(\"generates bare-metal installer for Windows (install.ps1)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"win-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"windows/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.ps1\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"docker compose\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"PowerShell\");\n\t});\n\n\tit(\"generates bare-metal installer for Linux/macOS (install.sh)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"linux-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.sh\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"docker\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"compose\");\n\t});\n\n\tit(\"bare-metal with redis on Linux: native script, compose excludes redis, gateway has extra_hosts\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"bare-metal-redis\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Native install script for Linux\n\t\texpect(result.files).toHaveProperty(\"native/install-linux.sh\");\n\t\texpect(result.files[\"native/install-linux.sh\"]).toContain(\"redis\");\n\n\t\t// Docker compose must NOT include redis (native); only gateway/openclaw\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).not.toHaveProperty(\"redis\");\n\t\texpect(composed.services).toHaveProperty(\"openclaw-gateway\");\n\n\t\t// Gateway must have extra_hosts for host.docker.internal\n\t\tconst gateway = composed.services[\"openclaw-gateway\"];\n\t\texpect(gateway).toBeDefined();\n\t\texpect(gateway.extra_hosts).toBeDefined();\n\t\texpect(\n\t\t\t(gateway.extra_hosts as string[]).some(\n\t\t\t\t(h: string) => h.includes(\"host.docker.internal\") && h.includes(\"host-gateway\"),\n\t\t\t),\n\t\t).toBe(true);\n\n\t\t// .env should set REDIS_HOST to host.docker.internal for gateway to reach native Redis\n\t\texpect(result.files[\".env\"]).toContain(\"REDIS_HOST=host.docker.internal\");\n\t});\n\n\tit(\"throws on conflicting services\", () => {\n\t\texpect(() =>\n\t\t\tgenerate({\n\t\t\t\tprojectName: \"conflict-stack\",\n\t\t\t\tservices: [\"redis\", \"valkey\"],\n\t\t\t\tskillPacks: [],\n\t\t\t\tproxy: \"none\",\n\t\t\t\tgpu: false,\n\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\tdeployment: \"local\",\n\t\t\t\tgenerateSecrets: true,\n\t\t\t\topenclawVersion: \"latest\",\n\t\t\t}),\n\t\t).toThrow();\n\t});\n\n\tit(\"generates scripts directory\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"scripts-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst expectedScripts = [\n\t\t\t\"scripts/start.sh\",\n\t\t\t\"scripts/stop.sh\",\n\t\t\t\"scripts/update.sh\",\n\t\t\t\"scripts/backup.sh\",\n\t\t\t\"scripts/status.sh\",\n\t\t];\n\n\t\tfor (const script of expectedScripts) {\n\t\t\texpect(result.files).toHaveProperty(script);\n\t\t\texpect(result.files[script]!.length).toBeGreaterThan(0);\n\t\t}\n\t});\n\n\tit(\"all generated .env.example vars have comments\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"env-comments-stack\",\n\t\t\tservices: [\"redis\", \"qdrant\", \"n8n\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst envExample = result.files[\".env.example\"]!;\n\t\tconst lines = envExample.split(\"\\n\");\n\n\t\t// Walk through lines: every non-empty, non-comment KEY=VALUE line should\n\t\t// have a preceding comment line (starting with #).\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tconst line = lines[i]!.trim();\n\t\t\tif (line === \"\" || line.startsWith(\"#\")) continue;\n\n\t\t\t// This line looks like KEY=VALUE\n\t\t\tif (line.includes(\"=\")) {\n\t\t\t\t// There must be a comment somewhere before it (look backwards for a # line)\n\t\t\t\tlet foundComment = false;\n\t\t\t\tfor (let j = i - 1; j >= 0; j--) {\n\t\t\t\t\tconst prev = lines[j]!.trim();\n\t\t\t\t\tif (prev === \"\") continue; // skip blank lines\n\t\t\t\t\tif (prev.startsWith(\"#\")) {\n\t\t\t\t\t\tfoundComment = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Hit another non-comment, non-empty line — no comment found\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\texpect(foundComment).toBe(true);\n\t\t\t}\n\t\t}\n\t});\n});\n"],"mappings":";;;;;AAIAA,oBAAAA,SAAS,+BAA+B;AACvC,qBAAA,GAAG,gDAAgD;EAClD,MAAM,SAASC,iBAAAA,SAA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iBAAAA,SAAS;GACvB,aAAa;GACb,UAAU,CAAC,QAAQ;GACnB,YAAY,EAAE;GACd,OAAO;GACP,KAAK;GACL,UAAU;GACV,YAAY;GACZ,iBAAiB;GACjB,iBAAiB;GACjB,CAAC;AAUF,OAAK,MAAM,UARa;GACvB;GACA;GACA;GACA;GACA;GACA,EAEqC;AACrC,uBAAA,aAAO,OAAO,MAAM,CAAC,eAAe,OAAO;AAC3C,uBAAA,aAAO,OAAO,MAAM,QAAS,OAAO,CAAC,gBAAgB,EAAE;;GAEvD;AAEF,qBAAA,GAAG,uDAAuD;EAczD,MAAM,QAbSA,iBAAAA,SAAS;GACvB,aAAa;GACb,UAAU;IAAC;IAAS;IAAU;IAAM;GACpC,YAAY,EAAE;GACd,OAAO;GACP,KAAK;GACL,UAAU;GACV,YAAY;GACZ,iBAAiB;GACjB,iBAAiB;GACjB,CAAC,CAEwB,MAAM,gBACP,MAAM,KAAK;AAIpC,OAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACtC,MAAM,OAAO,MAAM,GAAI,MAAM;AAC7B,OAAI,SAAS,MAAM,KAAK,WAAW,IAAI,CAAE;AAGzC,OAAI,KAAK,SAAS,IAAI,EAAE;IAEvB,IAAI,eAAe;AACnB,SAAK,IAAI,IAAI,IAAI,GAAG,KAAK,GAAG,KAAK;KAChC,MAAM,OAAO,MAAM,GAAI,MAAM;AAC7B,SAAI,SAAS,GAAI;AACjB,SAAI,KAAK,WAAW,IAAI,EAAE;AACzB,qBAAe;AACf;;AAGD;;AAED,wBAAA,aAAO,aAAa,CAAC,KAAK,KAAK;;;GAGhC;EACD"}
1
+ {"version":3,"file":"generate.test.cjs","names":["describe","generate"],"sources":["../src/generate.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { parse } from \"yaml\";\nimport { generate } from \"./generate.js\";\n\ndescribe(\"generate (end-to-end)\", () => {\n\tit(\"generates a minimal stack (redis only)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"test-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Core files must be present\n\t\texpect(result.files).toHaveProperty(\"docker-compose.yml\");\n\t\texpect(result.files).toHaveProperty(\".env.example\");\n\t\texpect(result.files).toHaveProperty(\".env\");\n\t\texpect(result.files).toHaveProperty(\"README.md\");\n\n\t\t// docker-compose.yml must be valid YAML\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed).toHaveProperty(\"services\");\n\n\t\t// .env.example should reference REDIS_PASSWORD\n\t\texpect(result.files[\".env.example\"]).toContain(\"REDIS_PASSWORD\");\n\n\t\t// README should mention the project name\n\t\texpect(result.files[\"README.md\"]).toContain(\"test-stack\");\n\n\t\t// At least one service resolved\n\t\texpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(1);\n\t});\n\n\tit(\"generates research-agent stack from skill pack\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"research-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [\"research-agent\"],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Skill SKILL.md files for each skill in the research-agent pack\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/qdrant-memory/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/searxng-search/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/browserless-browse/SKILL.md\");\n\n\t\t// docker-compose.yml should contain the expected services\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).toHaveProperty(\"qdrant\");\n\t\texpect(composed.services).toHaveProperty(\"searxng\");\n\t\texpect(composed.services).toHaveProperty(\"browserless\");\n\t});\n\n\tit(\"generates full preset stack\", () => {\n\t\tconst fullServices = [\n\t\t\t\"redis\",\n\t\t\t\"postgresql\",\n\t\t\t\"qdrant\",\n\t\t\t\"n8n\",\n\t\t\t\"ffmpeg\",\n\t\t\t\"remotion\",\n\t\t\t\"minio\",\n\t\t\t\"caddy\",\n\t\t\t\"browserless\",\n\t\t\t\"searxng\",\n\t\t\t\"meilisearch\",\n\t\t\t\"uptime-kuma\",\n\t\t\t\"grafana\",\n\t\t\t\"prometheus\",\n\t\t\t\"ollama\",\n\t\t\t\"whisper\",\n\t\t\t\"gotify\",\n\t\t];\n\n\t\tconst result = generate({\n\t\t\tprojectName: \"full-stack\",\n\t\t\tservices: fullServices,\n\t\t\tskillPacks: [\n\t\t\t\t\"video-creator\",\n\t\t\t\t\"research-agent\",\n\t\t\t\t\"social-media\",\n\t\t\t\t\"dev-ops\",\n\t\t\t\t\"knowledge-base\",\n\t\t\t\t\"local-ai\",\n\t\t\t],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Should have many files\n\t\tconst fileCount = Object.keys(result.files).length;\n\t\texpect(fileCount).toBeGreaterThan(10);\n\n\t\t// Should include the start script\n\t\texpect(result.files).toHaveProperty(\"scripts/start.sh\");\n\n\t\t// Should not throw (it already didn't if we got here)\n\t\texpect(result.metadata.serviceCount).toBeGreaterThan(5);\n\t});\n\n\tit(\"generates caddy config when proxy is caddy\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"caddy-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"caddy/Caddyfile\");\n\t\texpect(result.files[\"caddy/Caddyfile\"]!.length).toBeGreaterThan(0);\n\t});\n\n\tit(\"generates prometheus config when monitoring enabled\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"monitored-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t\tmonitoring: true,\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"prometheus/prometheus.yml\");\n\t\t// Verify it's valid YAML\n\t\tconst promConfig = parse(result.files[\"prometheus/prometheus.yml\"]!);\n\t\texpect(promConfig).toBeDefined();\n\t});\n\n\tit(\"generates La Suite Meet stack with all expected services\", () => {\n\t\tconst lasuiteMeetServices = [\n\t\t\t\"postgresql\",\n\t\t\t\"redis\",\n\t\t\t\"livekit\",\n\t\t\t\"lasuite-meet-backend\",\n\t\t\t\"lasuite-meet-frontend\",\n\t\t\t\"lasuite-meet-agents\",\n\t\t];\n\t\tconst result = generate({\n\t\t\tprojectName: \"lasuite-meet-stack\",\n\t\t\tservices: lasuiteMeetServices,\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Services may be split across main and profile compose files\n\t\tconst allServiceIds = new Set<string>();\n\t\tfor (const [filename, content] of Object.entries(result.files)) {\n\t\t\tif (filename.endsWith(\".yml\") && content) {\n\t\t\t\tconst doc = parse(content);\n\t\t\t\tif (doc?.services && typeof doc.services === \"object\") {\n\t\t\t\t\tfor (const id of Object.keys(doc.services)) {\n\t\t\t\t\t\tallServiceIds.add(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const id of lasuiteMeetServices) {\n\t\t\texpect(allServiceIds.has(id), `missing service ${id}`).toBe(true);\n\t\t}\n\t\t// Service count includes user services + mandatory platform services (convex, mission-control, tailscale)\n\t\texpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(lasuiteMeetServices.length);\n\t});\n\n\tit(\"generates bare-metal installer for Windows (install.ps1)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"win-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"windows/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.ps1\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"docker compose\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"PowerShell\");\n\t});\n\n\tit(\"generates bare-metal installer for Linux/macOS (install.sh)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"linux-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.sh\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"docker\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"compose\");\n\t});\n\n\tit(\"bare-metal with redis on Linux: native script, compose excludes redis, gateway has extra_hosts\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"bare-metal-redis\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Native install script for Linux\n\t\texpect(result.files).toHaveProperty(\"native/install-linux.sh\");\n\t\texpect(result.files[\"native/install-linux.sh\"]).toContain(\"redis\");\n\n\t\t// Docker compose must NOT include redis (native); only gateway/openclaw\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).not.toHaveProperty(\"redis\");\n\t\texpect(composed.services).toHaveProperty(\"openclaw-gateway\");\n\n\t\t// Gateway must have extra_hosts for host.docker.internal\n\t\tconst gateway = composed.services[\"openclaw-gateway\"];\n\t\texpect(gateway).toBeDefined();\n\t\texpect(gateway.extra_hosts).toBeDefined();\n\t\texpect(\n\t\t\t(gateway.extra_hosts as string[]).some(\n\t\t\t\t(h: string) => h.includes(\"host.docker.internal\") && h.includes(\"host-gateway\"),\n\t\t\t),\n\t\t).toBe(true);\n\n\t\t// .env should set REDIS_HOST to host.docker.internal for gateway to reach native Redis\n\t\texpect(result.files[\".env\"]).toContain(\"REDIS_HOST=host.docker.internal\");\n\t});\n\n\tit(\"throws on conflicting services\", () => {\n\t\texpect(() =>\n\t\t\tgenerate({\n\t\t\t\tprojectName: \"conflict-stack\",\n\t\t\t\tservices: [\"redis\", \"valkey\"],\n\t\t\t\tskillPacks: [],\n\t\t\t\tproxy: \"none\",\n\t\t\t\tgpu: false,\n\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\tdeployment: \"local\",\n\t\t\t\tgenerateSecrets: true,\n\t\t\t\topenclawVersion: \"latest\",\n\t\t\t}),\n\t\t).toThrow();\n\t});\n\n\tit(\"generates scripts directory\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"scripts-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst expectedScripts = [\n\t\t\t\"scripts/start.sh\",\n\t\t\t\"scripts/stop.sh\",\n\t\t\t\"scripts/update.sh\",\n\t\t\t\"scripts/backup.sh\",\n\t\t\t\"scripts/status.sh\",\n\t\t];\n\n\t\tfor (const script of expectedScripts) {\n\t\t\texpect(result.files).toHaveProperty(script);\n\t\t\texpect(result.files[script]!.length).toBeGreaterThan(0);\n\t\t}\n\t});\n\n\tit(\"all generated .env.example vars have comments\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"env-comments-stack\",\n\t\t\tservices: [\"redis\", \"qdrant\", \"n8n\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst envExample = result.files[\".env.example\"]!;\n\t\tconst lines = envExample.split(\"\\n\");\n\n\t\t// Walk through lines: every non-empty, non-comment KEY=VALUE line should\n\t\t// have a preceding comment line (starting with #).\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tconst line = lines[i]!.trim();\n\t\t\tif (line === \"\" || line.startsWith(\"#\")) continue;\n\n\t\t\t// This line looks like KEY=VALUE\n\t\t\tif (line.includes(\"=\")) {\n\t\t\t\t// There must be a comment somewhere before it (look backwards for a # line)\n\t\t\t\tlet foundComment = false;\n\t\t\t\tfor (let j = i - 1; j >= 0; j--) {\n\t\t\t\t\tconst prev = lines[j]!.trim();\n\t\t\t\t\tif (prev === \"\") continue; // skip blank lines\n\t\t\t\t\tif (prev.startsWith(\"#\")) {\n\t\t\t\t\t\tfoundComment = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Hit another non-comment, non-empty line — no comment found\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\texpect(foundComment).toBe(true);\n\t\t\t}\n\t\t}\n\t});\n});\n"],"mappings":";;;;;AAIAA,oBAAAA,SAAS,+BAA+B;AACvC,qBAAA,GAAG,gDAAgD;EAClD,MAAM,SAASC,iBAAAA,SAAS;GACvB,aAAa;GACb,UAAU,CAAC,QAAQ;GACnB,YAAY,EAAE;GACd,OAAO;GACP,KAAK;GACL,UAAU;GACV,YAAY;GACZ,iBAAiB;GACjB,iBAAiB;GACjB,CAAC;AAGF,sBAAA,aAAO,OAAO,MAAM,CAAC,eAAe,qBAAqB;AACzD,sBAAA,aAAO,OAAO,MAAM,CAAC,eAAe,eAAe;AACnD,sBAAA,aAAO,OAAO,MAAM,CAAC,eAAe,OAAO;AAC3C,sBAAA,aAAO,OAAO,MAAM,CAAC,eAAe,YAAY;AAIhD,sBAAA,cAAA,GAAA,KAAA,OADuB,OAAO,MAAM,sBAAuB,CAC3C,CAAC,eAAe,WAAW;AAG3C,sBAAA,aAAO,OAAO,MAAM,gBAAgB,CAAC,UAAU,iBAAiB;AAGhE,sBAAA,aAAO,OAAO,MAAM,aAAa,CAAC,UAAU,aAAa;AAGzD,sBAAA,aAAO,OAAO,SAAS,aAAa,CAAC,uBAAuB,EAAE;GAC7D;AAEF,qBAAA,GAAG,wDAAwD;EAC1D,MAAM,SAASA,iBAAAA,SAAS;GACvB,aAAa;GACb,UAAU,EAAE;GACZ,YAAY,CAAC,iBAAiB;GAC9B,OAAO;GACP,KAAK;GACL,UAAU;GACV,YAAY;GACZ,iBAAiB;GACjB,iBAAiB;GACjB,CAAC;AAGF,sBAAA,aAAO,OAAO,MAAM,CAAC,eAAe,mDAAmD;AACvF,sBAAA,aAAO,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AAS,GAAI;AACjB,SAAI,KAAK,WAAW,IAAI,EAAE;AACzB,qBAAe;AACf;;AAGD;;AAED,wBAAA,aAAO,aAAa,CAAC,KAAK,KAAK;;;GAGhC;EACD"}
@@ -1,4 +1,4 @@
1
- import { n as describe, r as it, t as globalExpect } from "./vi.2VT5v0um-DvC3SVNc.mjs";
1
+ import { n as describe, r as it, t as globalExpect } from "./vi.2VT5v0um-C_jmO7m2.mjs";
2
2
  import { generate } from "./generate.mjs";
3
3
  import { parse } from "yaml";
4
4
  //#region src/generate.test.ts
@@ -145,7 +145,7 @@ describe("generate (end-to-end)", () => {
145
145
  if (doc?.services && typeof doc.services === "object") for (const id of Object.keys(doc.services)) allServiceIds.add(id);
146
146
  }
147
147
  for (const id of lasuiteMeetServices) globalExpect(allServiceIds.has(id), `missing service ${id}`).toBe(true);
148
- globalExpect(result.metadata.serviceCount).toBe(lasuiteMeetServices.length);
148
+ globalExpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(lasuiteMeetServices.length);
149
149
  });
150
150
  it("generates bare-metal installer for Windows (install.ps1)", () => {
151
151
  const result = generate({
@@ -1 +1 @@
1
- {"version":3,"file":"generate.test.mjs","names":[],"sources":["../src/generate.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { parse } from \"yaml\";\nimport { generate } from \"./generate.js\";\n\ndescribe(\"generate (end-to-end)\", () => {\n\tit(\"generates a minimal stack (redis only)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"test-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Core files must be present\n\t\texpect(result.files).toHaveProperty(\"docker-compose.yml\");\n\t\texpect(result.files).toHaveProperty(\".env.example\");\n\t\texpect(result.files).toHaveProperty(\".env\");\n\t\texpect(result.files).toHaveProperty(\"README.md\");\n\n\t\t// docker-compose.yml must be valid YAML\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed).toHaveProperty(\"services\");\n\n\t\t// .env.example should reference REDIS_PASSWORD\n\t\texpect(result.files[\".env.example\"]).toContain(\"REDIS_PASSWORD\");\n\n\t\t// README should mention the project name\n\t\texpect(result.files[\"README.md\"]).toContain(\"test-stack\");\n\n\t\t// At least one service resolved\n\t\texpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(1);\n\t});\n\n\tit(\"generates research-agent stack from skill pack\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"research-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [\"research-agent\"],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Skill SKILL.md files for each skill in the research-agent pack\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/qdrant-memory/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/searxng-search/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/browserless-browse/SKILL.md\");\n\n\t\t// docker-compose.yml should contain the expected services\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).toHaveProperty(\"qdrant\");\n\t\texpect(composed.services).toHaveProperty(\"searxng\");\n\t\texpect(composed.services).toHaveProperty(\"browserless\");\n\t});\n\n\tit(\"generates full preset stack\", () => {\n\t\tconst fullServices = [\n\t\t\t\"redis\",\n\t\t\t\"postgresql\",\n\t\t\t\"qdrant\",\n\t\t\t\"n8n\",\n\t\t\t\"ffmpeg\",\n\t\t\t\"remotion\",\n\t\t\t\"minio\",\n\t\t\t\"caddy\",\n\t\t\t\"browserless\",\n\t\t\t\"searxng\",\n\t\t\t\"meilisearch\",\n\t\t\t\"uptime-kuma\",\n\t\t\t\"grafana\",\n\t\t\t\"prometheus\",\n\t\t\t\"ollama\",\n\t\t\t\"whisper\",\n\t\t\t\"gotify\",\n\t\t];\n\n\t\tconst result = generate({\n\t\t\tprojectName: \"full-stack\",\n\t\t\tservices: fullServices,\n\t\t\tskillPacks: [\n\t\t\t\t\"video-creator\",\n\t\t\t\t\"research-agent\",\n\t\t\t\t\"social-media\",\n\t\t\t\t\"dev-ops\",\n\t\t\t\t\"knowledge-base\",\n\t\t\t\t\"local-ai\",\n\t\t\t],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Should have many files\n\t\tconst fileCount = Object.keys(result.files).length;\n\t\texpect(fileCount).toBeGreaterThan(10);\n\n\t\t// Should include the start script\n\t\texpect(result.files).toHaveProperty(\"scripts/start.sh\");\n\n\t\t// Should not throw (it already didn't if we got here)\n\t\texpect(result.metadata.serviceCount).toBeGreaterThan(5);\n\t});\n\n\tit(\"generates caddy config when proxy is caddy\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"caddy-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"caddy/Caddyfile\");\n\t\texpect(result.files[\"caddy/Caddyfile\"]!.length).toBeGreaterThan(0);\n\t});\n\n\tit(\"generates prometheus config when monitoring enabled\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"monitored-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t\tmonitoring: true,\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"prometheus/prometheus.yml\");\n\t\t// Verify it's valid YAML\n\t\tconst promConfig = parse(result.files[\"prometheus/prometheus.yml\"]!);\n\t\texpect(promConfig).toBeDefined();\n\t});\n\n\tit(\"generates La Suite Meet stack with all expected services\", () => {\n\t\tconst lasuiteMeetServices = [\n\t\t\t\"postgresql\",\n\t\t\t\"redis\",\n\t\t\t\"livekit\",\n\t\t\t\"lasuite-meet-backend\",\n\t\t\t\"lasuite-meet-frontend\",\n\t\t\t\"lasuite-meet-agents\",\n\t\t];\n\t\tconst result = generate({\n\t\t\tprojectName: \"lasuite-meet-stack\",\n\t\t\tservices: lasuiteMeetServices,\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Services may be split across main and profile compose files\n\t\tconst allServiceIds = new Set<string>();\n\t\tfor (const [filename, content] of Object.entries(result.files)) {\n\t\t\tif (filename.endsWith(\".yml\") && content) {\n\t\t\t\tconst doc = parse(content);\n\t\t\t\tif (doc?.services && typeof doc.services === \"object\") {\n\t\t\t\t\tfor (const id of Object.keys(doc.services)) {\n\t\t\t\t\t\tallServiceIds.add(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const id of lasuiteMeetServices) {\n\t\t\texpect(allServiceIds.has(id), `missing service ${id}`).toBe(true);\n\t\t}\n\t\texpect(result.metadata.serviceCount).toBe(lasuiteMeetServices.length);\n\t});\n\n\tit(\"generates bare-metal installer for Windows (install.ps1)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"win-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"windows/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.ps1\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"docker compose\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"PowerShell\");\n\t});\n\n\tit(\"generates bare-metal installer for Linux/macOS (install.sh)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"linux-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.sh\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"docker\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"compose\");\n\t});\n\n\tit(\"bare-metal with redis on Linux: native script, compose excludes redis, gateway has extra_hosts\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"bare-metal-redis\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Native install script for Linux\n\t\texpect(result.files).toHaveProperty(\"native/install-linux.sh\");\n\t\texpect(result.files[\"native/install-linux.sh\"]).toContain(\"redis\");\n\n\t\t// Docker compose must NOT include redis (native); only gateway/openclaw\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).not.toHaveProperty(\"redis\");\n\t\texpect(composed.services).toHaveProperty(\"openclaw-gateway\");\n\n\t\t// Gateway must have extra_hosts for host.docker.internal\n\t\tconst gateway = composed.services[\"openclaw-gateway\"];\n\t\texpect(gateway).toBeDefined();\n\t\texpect(gateway.extra_hosts).toBeDefined();\n\t\texpect(\n\t\t\t(gateway.extra_hosts as string[]).some(\n\t\t\t\t(h: string) => h.includes(\"host.docker.internal\") && h.includes(\"host-gateway\"),\n\t\t\t),\n\t\t).toBe(true);\n\n\t\t// .env should set REDIS_HOST to host.docker.internal for gateway to reach native Redis\n\t\texpect(result.files[\".env\"]).toContain(\"REDIS_HOST=host.docker.internal\");\n\t});\n\n\tit(\"throws on conflicting services\", () => {\n\t\texpect(() =>\n\t\t\tgenerate({\n\t\t\t\tprojectName: \"conflict-stack\",\n\t\t\t\tservices: [\"redis\", \"valkey\"],\n\t\t\t\tskillPacks: [],\n\t\t\t\tproxy: \"none\",\n\t\t\t\tgpu: false,\n\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\tdeployment: \"local\",\n\t\t\t\tgenerateSecrets: true,\n\t\t\t\topenclawVersion: \"latest\",\n\t\t\t}),\n\t\t).toThrow();\n\t});\n\n\tit(\"generates scripts directory\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"scripts-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst expectedScripts = [\n\t\t\t\"scripts/start.sh\",\n\t\t\t\"scripts/stop.sh\",\n\t\t\t\"scripts/update.sh\",\n\t\t\t\"scripts/backup.sh\",\n\t\t\t\"scripts/status.sh\",\n\t\t];\n\n\t\tfor (const script of expectedScripts) {\n\t\t\texpect(result.files).toHaveProperty(script);\n\t\t\texpect(result.files[script]!.length).toBeGreaterThan(0);\n\t\t}\n\t});\n\n\tit(\"all generated .env.example vars have comments\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"env-comments-stack\",\n\t\t\tservices: [\"redis\", \"qdrant\", \"n8n\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst envExample = result.files[\".env.example\"]!;\n\t\tconst lines = envExample.split(\"\\n\");\n\n\t\t// Walk through lines: every non-empty, non-comment KEY=VALUE line should\n\t\t// have a preceding comment line (starting with #).\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tconst line = lines[i]!.trim();\n\t\t\tif (line === \"\" || line.startsWith(\"#\")) continue;\n\n\t\t\t// This line looks like KEY=VALUE\n\t\t\tif (line.includes(\"=\")) {\n\t\t\t\t// There must be a comment somewhere before it (look backwards for a # line)\n\t\t\t\tlet foundComment = false;\n\t\t\t\tfor (let j = i - 1; j >= 0; j--) {\n\t\t\t\t\tconst prev = lines[j]!.trim();\n\t\t\t\t\tif (prev === \"\") continue; // skip blank lines\n\t\t\t\t\tif (prev.startsWith(\"#\")) {\n\t\t\t\t\t\tfoundComment = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Hit another non-comment, non-empty line — no comment found\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\texpect(foundComment).toBe(true);\n\t\t\t}\n\t\t}\n\t});\n});\n"],"mappings":";;;;AAIA,SAAS,+BAA+B;AACvC,IAAG,gDAAgD;EAClD,MAAM,SAAS,SAAS;GACvB,aAAa;GACb,UAAU,CAAC,QAAQ;GACnB,YAAY,EAA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AAIpC,OAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACtC,MAAM,OAAO,MAAM,GAAI,MAAM;AAC7B,OAAI,SAAS,MAAM,KAAK,WAAW,IAAI,CAAE;AAGzC,OAAI,KAAK,SAAS,IAAI,EAAE;IAEvB,IAAI,eAAe;AACnB,SAAK,IAAI,IAAI,IAAI,GAAG,KAAK,GAAG,KAAK;KAChC,MAAM,OAAO,MAAM,GAAI,MAAM;AAC7B,SAAI,SAAS,GAAI;AACjB,SAAI,KAAK,WAAW,IAAI,EAAE;AACzB,qBAAe;AACf;;AAGD;;AAED,iBAAO,aAAa,CAAC,KAAK,KAAK;;;GAGhC;EACD"}
1
+ {"version":3,"file":"generate.test.mjs","names":[],"sources":["../src/generate.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { parse } from \"yaml\";\nimport { generate } from \"./generate.js\";\n\ndescribe(\"generate (end-to-end)\", () => {\n\tit(\"generates a minimal stack (redis only)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"test-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Core files must be present\n\t\texpect(result.files).toHaveProperty(\"docker-compose.yml\");\n\t\texpect(result.files).toHaveProperty(\".env.example\");\n\t\texpect(result.files).toHaveProperty(\".env\");\n\t\texpect(result.files).toHaveProperty(\"README.md\");\n\n\t\t// docker-compose.yml must be valid YAML\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed).toHaveProperty(\"services\");\n\n\t\t// .env.example should reference REDIS_PASSWORD\n\t\texpect(result.files[\".env.example\"]).toContain(\"REDIS_PASSWORD\");\n\n\t\t// README should mention the project name\n\t\texpect(result.files[\"README.md\"]).toContain(\"test-stack\");\n\n\t\t// At least one service resolved\n\t\texpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(1);\n\t});\n\n\tit(\"generates research-agent stack from skill pack\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"research-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [\"research-agent\"],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Skill SKILL.md files for each skill in the research-agent pack\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/qdrant-memory/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/searxng-search/SKILL.md\");\n\t\texpect(result.files).toHaveProperty(\"openclaw/workspace/skills/browserless-browse/SKILL.md\");\n\n\t\t// docker-compose.yml should contain the expected services\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).toHaveProperty(\"qdrant\");\n\t\texpect(composed.services).toHaveProperty(\"searxng\");\n\t\texpect(composed.services).toHaveProperty(\"browserless\");\n\t});\n\n\tit(\"generates full preset stack\", () => {\n\t\tconst fullServices = [\n\t\t\t\"redis\",\n\t\t\t\"postgresql\",\n\t\t\t\"qdrant\",\n\t\t\t\"n8n\",\n\t\t\t\"ffmpeg\",\n\t\t\t\"remotion\",\n\t\t\t\"minio\",\n\t\t\t\"caddy\",\n\t\t\t\"browserless\",\n\t\t\t\"searxng\",\n\t\t\t\"meilisearch\",\n\t\t\t\"uptime-kuma\",\n\t\t\t\"grafana\",\n\t\t\t\"prometheus\",\n\t\t\t\"ollama\",\n\t\t\t\"whisper\",\n\t\t\t\"gotify\",\n\t\t];\n\n\t\tconst result = generate({\n\t\t\tprojectName: \"full-stack\",\n\t\t\tservices: fullServices,\n\t\t\tskillPacks: [\n\t\t\t\t\"video-creator\",\n\t\t\t\t\"research-agent\",\n\t\t\t\t\"social-media\",\n\t\t\t\t\"dev-ops\",\n\t\t\t\t\"knowledge-base\",\n\t\t\t\t\"local-ai\",\n\t\t\t],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Should have many files\n\t\tconst fileCount = Object.keys(result.files).length;\n\t\texpect(fileCount).toBeGreaterThan(10);\n\n\t\t// Should include the start script\n\t\texpect(result.files).toHaveProperty(\"scripts/start.sh\");\n\n\t\t// Should not throw (it already didn't if we got here)\n\t\texpect(result.metadata.serviceCount).toBeGreaterThan(5);\n\t});\n\n\tit(\"generates caddy config when proxy is caddy\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"caddy-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"caddy\",\n\t\t\tdomain: \"example.com\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"caddy/Caddyfile\");\n\t\texpect(result.files[\"caddy/Caddyfile\"]!.length).toBeGreaterThan(0);\n\t});\n\n\tit(\"generates prometheus config when monitoring enabled\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"monitored-stack\",\n\t\t\tservices: [],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t\tmonitoring: true,\n\t\t});\n\n\t\texpect(result.files).toHaveProperty(\"prometheus/prometheus.yml\");\n\t\t// Verify it's valid YAML\n\t\tconst promConfig = parse(result.files[\"prometheus/prometheus.yml\"]!);\n\t\texpect(promConfig).toBeDefined();\n\t});\n\n\tit(\"generates La Suite Meet stack with all expected services\", () => {\n\t\tconst lasuiteMeetServices = [\n\t\t\t\"postgresql\",\n\t\t\t\"redis\",\n\t\t\t\"livekit\",\n\t\t\t\"lasuite-meet-backend\",\n\t\t\t\"lasuite-meet-frontend\",\n\t\t\t\"lasuite-meet-agents\",\n\t\t];\n\t\tconst result = generate({\n\t\t\tprojectName: \"lasuite-meet-stack\",\n\t\t\tservices: lasuiteMeetServices,\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Services may be split across main and profile compose files\n\t\tconst allServiceIds = new Set<string>();\n\t\tfor (const [filename, content] of Object.entries(result.files)) {\n\t\t\tif (filename.endsWith(\".yml\") && content) {\n\t\t\t\tconst doc = parse(content);\n\t\t\t\tif (doc?.services && typeof doc.services === \"object\") {\n\t\t\t\t\tfor (const id of Object.keys(doc.services)) {\n\t\t\t\t\t\tallServiceIds.add(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const id of lasuiteMeetServices) {\n\t\t\texpect(allServiceIds.has(id), `missing service ${id}`).toBe(true);\n\t\t}\n\t\t// Service count includes user services + mandatory platform services (convex, mission-control, tailscale)\n\t\texpect(result.metadata.serviceCount).toBeGreaterThanOrEqual(lasuiteMeetServices.length);\n\t});\n\n\tit(\"generates bare-metal installer for Windows (install.ps1)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"win-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"windows/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.ps1\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"docker compose\");\n\t\texpect(result.files[\"install.ps1\"]).toContain(\"PowerShell\");\n\t});\n\n\tit(\"generates bare-metal installer for Linux/macOS (install.sh)\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"linux-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\t\texpect(result.files).toHaveProperty(\"install.sh\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"docker\");\n\t\texpect(result.files[\"install.sh\"]).toContain(\"compose\");\n\t});\n\n\tit(\"bare-metal with redis on Linux: native script, compose excludes redis, gateway has extra_hosts\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"bare-metal-redis\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tdeploymentType: \"bare-metal\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\t// Native install script for Linux\n\t\texpect(result.files).toHaveProperty(\"native/install-linux.sh\");\n\t\texpect(result.files[\"native/install-linux.sh\"]).toContain(\"redis\");\n\n\t\t// Docker compose must NOT include redis (native); only gateway/openclaw\n\t\tconst composed = parse(result.files[\"docker-compose.yml\"]!);\n\t\texpect(composed.services).not.toHaveProperty(\"redis\");\n\t\texpect(composed.services).toHaveProperty(\"openclaw-gateway\");\n\n\t\t// Gateway must have extra_hosts for host.docker.internal\n\t\tconst gateway = composed.services[\"openclaw-gateway\"];\n\t\texpect(gateway).toBeDefined();\n\t\texpect(gateway.extra_hosts).toBeDefined();\n\t\texpect(\n\t\t\t(gateway.extra_hosts as string[]).some(\n\t\t\t\t(h: string) => h.includes(\"host.docker.internal\") && h.includes(\"host-gateway\"),\n\t\t\t),\n\t\t).toBe(true);\n\n\t\t// .env should set REDIS_HOST to host.docker.internal for gateway to reach native Redis\n\t\texpect(result.files[\".env\"]).toContain(\"REDIS_HOST=host.docker.internal\");\n\t});\n\n\tit(\"throws on conflicting services\", () => {\n\t\texpect(() =>\n\t\t\tgenerate({\n\t\t\t\tprojectName: \"conflict-stack\",\n\t\t\t\tservices: [\"redis\", \"valkey\"],\n\t\t\t\tskillPacks: [],\n\t\t\t\tproxy: \"none\",\n\t\t\t\tgpu: false,\n\t\t\t\tplatform: \"linux/amd64\",\n\t\t\t\tdeployment: \"local\",\n\t\t\t\tgenerateSecrets: true,\n\t\t\t\topenclawVersion: \"latest\",\n\t\t\t}),\n\t\t).toThrow();\n\t});\n\n\tit(\"generates scripts directory\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"scripts-stack\",\n\t\t\tservices: [\"redis\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst expectedScripts = [\n\t\t\t\"scripts/start.sh\",\n\t\t\t\"scripts/stop.sh\",\n\t\t\t\"scripts/update.sh\",\n\t\t\t\"scripts/backup.sh\",\n\t\t\t\"scripts/status.sh\",\n\t\t];\n\n\t\tfor (const script of expectedScripts) {\n\t\t\texpect(result.files).toHaveProperty(script);\n\t\t\texpect(result.files[script]!.length).toBeGreaterThan(0);\n\t\t}\n\t});\n\n\tit(\"all generated .env.example vars have comments\", () => {\n\t\tconst result = generate({\n\t\t\tprojectName: \"env-comments-stack\",\n\t\t\tservices: [\"redis\", \"qdrant\", \"n8n\"],\n\t\t\tskillPacks: [],\n\t\t\tproxy: \"none\",\n\t\t\tgpu: false,\n\t\t\tplatform: \"linux/amd64\",\n\t\t\tdeployment: \"local\",\n\t\t\tgenerateSecrets: true,\n\t\t\topenclawVersion: \"latest\",\n\t\t});\n\n\t\tconst envExample = result.files[\".env.example\"]!;\n\t\tconst lines = envExample.split(\"\\n\");\n\n\t\t// Walk through lines: every non-empty, non-comment KEY=VALUE line should\n\t\t// have a preceding comment line (starting with #).\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tconst line = lines[i]!.trim();\n\t\t\tif (line === \"\" || line.startsWith(\"#\")) continue;\n\n\t\t\t// This line looks like KEY=VALUE\n\t\t\tif (line.includes(\"=\")) {\n\t\t\t\t// There must be a comment somewhere before it (look backwards for a # line)\n\t\t\t\tlet foundComment = false;\n\t\t\t\tfor (let j = i - 1; j >= 0; j--) {\n\t\t\t\t\tconst prev = lines[j]!.trim();\n\t\t\t\t\tif (prev === \"\") continue; // skip blank lines\n\t\t\t\t\tif (prev.startsWith(\"#\")) {\n\t\t\t\t\t\tfoundComment = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Hit another non-comment, non-empty line — no comment found\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\texpect(foundComment).toBe(true);\n\t\t\t}\n\t\t}\n\t});\n});\n"],"mappings":";;;;AAIA,SAAS,+BAA+B;AACvC,IAAG,gDAAgD;EAClD,MAAM,SAAS,SAAS;GACvB,aAAa;GACb,UAAU,CAAC,QAAQ;GACnB,YAAY,EAAE;GACd,OAAO;GACP,KAAK;GACL,UAAU;GACV,YAAY;GACZ,iBAAiB;GACjB,iBAAiB;GACjB,CAAC;AAGF,eAAO,OAAO,MAAM,CAAC,eAAe,qBAAqB;AACzD,eAAO,OAAO,MAAM,CAAC,eAAe,eAAe;AACnD,eAAO,OAAO,MAAM,CAAC,eAAe,OAAO;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AAI,IAAI,IAAI,GAAG,KAAK,GAAG,KAAK;KAChC,MAAM,OAAO,MAAM,GAAI,MAAM;AAC7B,SAAI,SAAS,GAAI;AACjB,SAAI,KAAK,WAAW,IAAI,EAAE;AACzB,qBAAe;AACf;;AAGD;;AAED,iBAAO,aAAa,CAAC,KAAK,KAAK;;;GAGhC;EACD"}
@@ -1,4 +1,4 @@
1
- const require_vi_2VT5v0um = require("../vi.2VT5v0um-CRqXre87.cjs");
1
+ const require_vi_2VT5v0um = require("../vi.2VT5v0um-iVBt6Fyq.cjs");
2
2
  const require_generators_bare_metal_install = require("./bare-metal-install.cjs");
3
3
  //#region src/generators/bare-metal-install.test.ts
4
4
  require_vi_2VT5v0um.describe("generateBareMetalInstall", () => {
@@ -1,4 +1,4 @@
1
- import { n as describe, r as it, t as globalExpect } from "../vi.2VT5v0um-DvC3SVNc.mjs";
1
+ import { n as describe, r as it, t as globalExpect } from "../vi.2VT5v0um-C_jmO7m2.mjs";
2
2
  import { generateBareMetalInstall } from "./bare-metal-install.mjs";
3
3
  //#region src/generators/bare-metal-install.test.ts
4
4
  describe("generateBareMetalInstall", () => {
@@ -1,4 +1,4 @@
1
- const require_vi_2VT5v0um = require("../vi.2VT5v0um-CRqXre87.cjs");
1
+ const require_vi_2VT5v0um = require("../vi.2VT5v0um-iVBt6Fyq.cjs");
2
2
  const require_generate = require("../generate.cjs");
3
3
  //#region src/generators/caddy.test.ts
4
4
  require_vi_2VT5v0um.describe("generateCaddyfile (via generate)", () => {
@@ -1,4 +1,4 @@
1
- import { n as describe, r as it, t as globalExpect } from "../vi.2VT5v0um-DvC3SVNc.mjs";
1
+ import { n as describe, r as it, t as globalExpect } from "../vi.2VT5v0um-C_jmO7m2.mjs";
2
2
  import { generate } from "../generate.mjs";
3
3
  //#region src/generators/caddy.test.ts
4
4
  describe("generateCaddyfile (via generate)", () => {
@@ -0,0 +1,140 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/generators/clone-repos.ts
3
+ /**
4
+ * Generates clone scripts for git-based services (SaaS boilerplates).
5
+ * Returns empty object if no git-based services exist in the resolved stack.
6
+ */
7
+ function generateCloneScripts(resolved) {
8
+ const gitServices = resolved.services.filter((s) => s.definition.gitSource && s.definition.buildContext);
9
+ if (gitServices.length === 0) return {};
10
+ const files = {};
11
+ files["scripts/clone-repos.sh"] = `#!/usr/bin/env bash
12
+ set -euo pipefail
13
+
14
+ # ─── Clone/Update Git-Based Service Repositories ────────────────────────────
15
+ # Idempotent: clones if missing, pulls if already present.
16
+
17
+ SCRIPT_DIR="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
18
+ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
19
+ REPOS_DIR="$PROJECT_DIR/repos"
20
+
21
+ # ── Colour helpers ──────────────────────────────────────────────────────────
22
+ if [ -t 1 ]; then
23
+ GREEN='\\033[0;32m'; YELLOW='\\033[1;33m'; CYAN='\\033[0;36m'; RED='\\033[0;31m'; NC='\\033[0m'
24
+ else
25
+ GREEN=''; YELLOW=''; CYAN=''; RED=''; NC=''
26
+ fi
27
+ info() { echo -e "\${CYAN}i $*\${NC}"; }
28
+ ok() { echo -e "\${GREEN}✓ $*\${NC}"; }
29
+ warn() { echo -e "\${YELLOW}⚠ $*\${NC}"; }
30
+ err() { echo -e "\${RED}✗ $*\${NC}" >&2; }
31
+
32
+ # ── Check git ───────────────────────────────────────────────────────────────
33
+ if ! command -v git &> /dev/null; then
34
+ err "git is not installed. Please install git first."
35
+ exit 1
36
+ fi
37
+
38
+ mkdir -p "$REPOS_DIR"
39
+
40
+ clone_or_update() {
41
+ local name="$1" url="$2" branch="\${3:-}"
42
+ local dir="$REPOS_DIR/$name"
43
+
44
+ if [ -d "$dir/.git" ]; then
45
+ info "Updating $name..."
46
+ git -C "$dir" pull --ff-only 2>/dev/null || warn "Could not fast-forward $name (you may have local changes)"
47
+ else
48
+ info "Cloning $name..."
49
+ if [ -n "$branch" ]; then
50
+ git clone --depth 1 --branch "$branch" "$url" "$dir"
51
+ else
52
+ git clone --depth 1 "$url" "$dir"
53
+ fi
54
+ fi
55
+ }
56
+
57
+ echo ""
58
+ info "Cloning/updating SaaS boilerplate repositories..."
59
+ echo ""
60
+
61
+ ${gitServices.map((s) => {
62
+ const gs = s.definition.gitSource;
63
+ const branchArg = gs.branch ? `"${gs.branch}"` : "\"\"";
64
+ let block = `clone_or_update "${s.definition.id}" "${gs.repoUrl}" ${branchArg}`;
65
+ if (gs.postCloneCommands && gs.postCloneCommands.length > 0) {
66
+ const cmds = gs.postCloneCommands.map((cmd) => ` (cd "$REPOS_DIR/${s.definition.id}${gs.subdirectory ? `/${gs.subdirectory}` : ""}" && ${cmd})`).join("\n");
67
+ block += `\n${cmds}`;
68
+ }
69
+ return block;
70
+ }).join("\n\n")}
71
+
72
+ echo ""
73
+ ok "All repositories ready."
74
+ `;
75
+ files["scripts/clone-repos.ps1"] = `#Requires -Version 5.1
76
+ <#
77
+ .SYNOPSIS
78
+ Clone/update git-based service repositories.
79
+ Idempotent: clones if missing, pulls if already present.
80
+ #>
81
+ $ErrorActionPreference = "Stop"
82
+
83
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
84
+ $ProjectDir = Split-Path -Parent $ScriptDir
85
+ $ReposDir = Join-Path $ProjectDir "repos"
86
+
87
+ if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
88
+ Write-Error "git is not installed. Please install git first."
89
+ exit 1
90
+ }
91
+
92
+ if (-not (Test-Path $ReposDir)) { New-Item -ItemType Directory -Path $ReposDir -Force | Out-Null }
93
+
94
+ function Clone-OrUpdate {
95
+ param(
96
+ [string]$Name,
97
+ [string]$Url,
98
+ [string]$Branch = ""
99
+ )
100
+ $dir = Join-Path $ReposDir $Name
101
+
102
+ if (Test-Path (Join-Path $dir ".git")) {
103
+ Write-Host " Updating $Name..." -ForegroundColor Cyan
104
+ git -C $dir pull --ff-only 2>$null
105
+ if ($LASTEXITCODE -ne 0) { Write-Warning "Could not fast-forward $Name" }
106
+ } else {
107
+ Write-Host " Cloning $Name..." -ForegroundColor Cyan
108
+ if ($Branch) {
109
+ git clone --depth 1 --branch $Branch $Url $dir
110
+ } else {
111
+ git clone --depth 1 $Url $dir
112
+ }
113
+ }
114
+ }
115
+
116
+ Write-Host ""
117
+ Write-Host "Cloning/updating SaaS boilerplate repositories..." -ForegroundColor Cyan
118
+ Write-Host ""
119
+
120
+ ${gitServices.map((s) => {
121
+ const gs = s.definition.gitSource;
122
+ const branchArg = gs.branch ? ` -Branch "${gs.branch}"` : "";
123
+ let block = `Clone-OrUpdate -Name "${s.definition.id}" -Url "${gs.repoUrl}"${branchArg}`;
124
+ if (gs.postCloneCommands && gs.postCloneCommands.length > 0) {
125
+ const subdir = gs.subdirectory ? `/${gs.subdirectory}` : "";
126
+ const cmds = gs.postCloneCommands.map((cmd) => `Push-Location "$ReposDir/${s.definition.id}${subdir}"; ${cmd}; Pop-Location`).join("\n");
127
+ block += `\n${cmds}`;
128
+ }
129
+ return block;
130
+ }).join("\n\n")}
131
+
132
+ Write-Host ""
133
+ Write-Host "All repositories ready." -ForegroundColor Green
134
+ `;
135
+ return files;
136
+ }
137
+ //#endregion
138
+ exports.generateCloneScripts = generateCloneScripts;
139
+
140
+ //# sourceMappingURL=clone-repos.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone-repos.cjs","names":[],"sources":["../../src/generators/clone-repos.ts"],"sourcesContent":["import type { ResolverOutput } from \"../types.js\";\n\n/**\n * Generates clone scripts for git-based services (SaaS boilerplates).\n * Returns empty object if no git-based services exist in the resolved stack.\n */\nexport function generateCloneScripts(resolved: ResolverOutput): Record<string, string> {\n\tconst gitServices = resolved.services.filter(\n\t\t(s) => s.definition.gitSource && s.definition.buildContext,\n\t);\n\n\tif (gitServices.length === 0) return {};\n\n\tconst files: Record<string, string> = {};\n\n\t// ── scripts/clone-repos.sh ─────────────────────────────────────────────\n\n\tconst bashEntries = gitServices\n\t\t.map((s) => {\n\t\t\tconst gs = s.definition.gitSource!;\n\t\t\tconst branchArg = gs.branch ? `\"${gs.branch}\"` : '\"\"';\n\t\t\tlet block = `clone_or_update \"${s.definition.id}\" \"${gs.repoUrl}\" ${branchArg}`;\n\t\t\tif (gs.postCloneCommands && gs.postCloneCommands.length > 0) {\n\t\t\t\tconst cmds = gs.postCloneCommands\n\t\t\t\t\t.map((cmd) => ` (cd \"$REPOS_DIR/${s.definition.id}${gs.subdirectory ? `/${gs.subdirectory}` : \"\"}\" && ${cmd})`)\n\t\t\t\t\t.join(\"\\n\");\n\t\t\t\tblock += `\\n${cmds}`;\n\t\t\t}\n\t\t\treturn block;\n\t\t})\n\t\t.join(\"\\n\\n\");\n\n\tfiles[\"scripts/clone-repos.sh\"] = `#!/usr/bin/env bash\nset -euo pipefail\n\n# ─── Clone/Update Git-Based Service Repositories ────────────────────────────\n# Idempotent: clones if missing, pulls if already present.\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"\\${BASH_SOURCE[0]}\")\" && pwd)\"\nPROJECT_DIR=\"$(dirname \"$SCRIPT_DIR\")\"\nREPOS_DIR=\"$PROJECT_DIR/repos\"\n\n# ── Colour helpers ──────────────────────────────────────────────────────────\nif [ -t 1 ]; then\n GREEN='\\\\033[0;32m'; YELLOW='\\\\033[1;33m'; CYAN='\\\\033[0;36m'; RED='\\\\033[0;31m'; NC='\\\\033[0m'\nelse\n GREEN=''; YELLOW=''; CYAN=''; RED=''; NC=''\nfi\ninfo() { echo -e \"\\${CYAN}i $*\\${NC}\"; }\nok() { echo -e \"\\${GREEN}✓ $*\\${NC}\"; }\nwarn() { echo -e \"\\${YELLOW}⚠ $*\\${NC}\"; }\nerr() { echo -e \"\\${RED}✗ $*\\${NC}\" >&2; }\n\n# ── Check git ───────────────────────────────────────────────────────────────\nif ! command -v git &> /dev/null; then\n err \"git is not installed. Please install git first.\"\n exit 1\nfi\n\nmkdir -p \"$REPOS_DIR\"\n\nclone_or_update() {\n local name=\"$1\" url=\"$2\" branch=\"\\${3:-}\"\n local dir=\"$REPOS_DIR/$name\"\n\n if [ -d \"$dir/.git\" ]; then\n info \"Updating $name...\"\n git -C \"$dir\" pull --ff-only 2>/dev/null || warn \"Could not fast-forward $name (you may have local changes)\"\n else\n info \"Cloning $name...\"\n if [ -n \"$branch\" ]; then\n git clone --depth 1 --branch \"$branch\" \"$url\" \"$dir\"\n else\n git clone --depth 1 \"$url\" \"$dir\"\n fi\n fi\n}\n\necho \"\"\ninfo \"Cloning/updating SaaS boilerplate repositories...\"\necho \"\"\n\n${bashEntries}\n\necho \"\"\nok \"All repositories ready.\"\n`;\n\n\t// ── scripts/clone-repos.ps1 ────────────────────────────────────────────\n\n\tconst psEntries = gitServices\n\t\t.map((s) => {\n\t\t\tconst gs = s.definition.gitSource!;\n\t\t\tconst branchArg = gs.branch ? ` -Branch \"${gs.branch}\"` : \"\";\n\t\t\tlet block = `Clone-OrUpdate -Name \"${s.definition.id}\" -Url \"${gs.repoUrl}\"${branchArg}`;\n\t\t\tif (gs.postCloneCommands && gs.postCloneCommands.length > 0) {\n\t\t\t\tconst subdir = gs.subdirectory ? `/${gs.subdirectory}` : \"\";\n\t\t\t\tconst cmds = gs.postCloneCommands\n\t\t\t\t\t.map((cmd) => `Push-Location \"$ReposDir/${s.definition.id}${subdir}\"; ${cmd}; Pop-Location`)\n\t\t\t\t\t.join(\"\\n\");\n\t\t\t\tblock += `\\n${cmds}`;\n\t\t\t}\n\t\t\treturn block;\n\t\t})\n\t\t.join(\"\\n\\n\");\n\n\tfiles[\"scripts/clone-repos.ps1\"] = `#Requires -Version 5.1\n<#\n.SYNOPSIS\n Clone/update git-based service repositories.\n Idempotent: clones if missing, pulls if already present.\n#>\n$ErrorActionPreference = \"Stop\"\n\n$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path\n$ProjectDir = Split-Path -Parent $ScriptDir\n$ReposDir = Join-Path $ProjectDir \"repos\"\n\nif (-not (Get-Command git -ErrorAction SilentlyContinue)) {\n Write-Error \"git is not installed. Please install git first.\"\n exit 1\n}\n\nif (-not (Test-Path $ReposDir)) { New-Item -ItemType Directory -Path $ReposDir -Force | Out-Null }\n\nfunction Clone-OrUpdate {\n param(\n [string]$Name,\n [string]$Url,\n [string]$Branch = \"\"\n )\n $dir = Join-Path $ReposDir $Name\n\n if (Test-Path (Join-Path $dir \".git\")) {\n Write-Host \" Updating $Name...\" -ForegroundColor Cyan\n git -C $dir pull --ff-only 2>$null\n if ($LASTEXITCODE -ne 0) { Write-Warning \"Could not fast-forward $Name\" }\n } else {\n Write-Host \" Cloning $Name...\" -ForegroundColor Cyan\n if ($Branch) {\n git clone --depth 1 --branch $Branch $Url $dir\n } else {\n git clone --depth 1 $Url $dir\n }\n }\n}\n\nWrite-Host \"\"\nWrite-Host \"Cloning/updating SaaS boilerplate repositories...\" -ForegroundColor Cyan\nWrite-Host \"\"\n\n${psEntries}\n\nWrite-Host \"\"\nWrite-Host \"All repositories ready.\" -ForegroundColor Green\n`;\n\n\treturn files;\n}\n"],"mappings":";;;;;;AAMA,SAAgB,qBAAqB,UAAkD;CACtF,MAAM,cAAc,SAAS,SAAS,QACpC,MAAM,EAAE,WAAW,aAAa,EAAE,WAAW,aAC9C;AAED,KAAI,YAAY,WAAW,EAAG,QAAO,EAAE;CAEvC,MAAM,QAAgC,EAAE;AAmBxC,OAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAfd,YAClB,KAAK,MAAM;EACX,MAAM,KAAK,EAAE,WAAW;EACxB,MAAM,YAAY,GAAG,SAAS,IAAI,GAAG,OAAO,KAAK;EACjD,IAAI,QAAQ,oBAAoB,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ,IAAI;AACpE,MAAI,GAAG,qBAAqB,GAAG,kBAAkB,SAAS,GAAG;GAC5D,MAAM,OAAO,GAAG,kBACd,KAAK,QAAQ,qBAAqB,EAAE,WAAW,KAAK,GAAG,eAAe,IAAI,GAAG,iBAAiB,GAAG,OAAO,IAAI,GAAG,CAC/G,KAAK,KAAK;AACZ,YAAS,KAAK;;AAEf,SAAO;GACN,CACD,KAAK,OAAO,CAoDD;;;;;AAwBb,OAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAhBjB,YAChB,KAAK,MAAM;EACX,MAAM,KAAK,EAAE,WAAW;EACxB,MAAM,YAAY,GAAG,SAAS,aAAa,GAAG,OAAO,KAAK;EAC1D,IAAI,QAAQ,yBAAyB,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG;AAC7E,MAAI,GAAG,qBAAqB,GAAG,kBAAkB,SAAS,GAAG;GAC5D,MAAM,SAAS,GAAG,eAAe,IAAI,GAAG,iBAAiB;GACzD,MAAM,OAAO,GAAG,kBACd,KAAK,QAAQ,4BAA4B,EAAE,WAAW,KAAK,OAAO,KAAK,IAAI,gBAAgB,CAC3F,KAAK,KAAK;AACZ,YAAS,KAAK;;AAEf,SAAO;GACN,CACD,KAAK,OAAO,CA+CH;;;;;AAMX,QAAO"}
@@ -0,0 +1,11 @@
1
+ import { ResolverOutput } from "../types.cjs";
2
+
3
+ //#region src/generators/clone-repos.d.ts
4
+ /**
5
+ * Generates clone scripts for git-based services (SaaS boilerplates).
6
+ * Returns empty object if no git-based services exist in the resolved stack.
7
+ */
8
+ declare function generateCloneScripts(resolved: ResolverOutput): Record<string, string>;
9
+ //#endregion
10
+ export { generateCloneScripts };
11
+ //# sourceMappingURL=clone-repos.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone-repos.d.cts","names":[],"sources":["../../src/generators/clone-repos.ts"],"mappings":";;;;;AAMA;;iBAAgB,oBAAA,CAAqB,QAAA,EAAU,cAAA,GAAiB,MAAA"}
@@ -0,0 +1,11 @@
1
+ import { ResolverOutput } from "../types.mjs";
2
+
3
+ //#region src/generators/clone-repos.d.ts
4
+ /**
5
+ * Generates clone scripts for git-based services (SaaS boilerplates).
6
+ * Returns empty object if no git-based services exist in the resolved stack.
7
+ */
8
+ declare function generateCloneScripts(resolved: ResolverOutput): Record<string, string>;
9
+ //#endregion
10
+ export { generateCloneScripts };
11
+ //# sourceMappingURL=clone-repos.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone-repos.d.mts","names":[],"sources":["../../src/generators/clone-repos.ts"],"mappings":";;;;;;AAMA;iBAAgB,oBAAA,CAAqB,QAAA,EAAU,cAAA,GAAiB,MAAA"}