@shadowob/cloud 1.1.6-dev.311

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 (334) hide show
  1. package/README.md +509 -0
  2. package/dist/agent-browser-CERTMCDL.js +117 -0
  3. package/dist/agent-browser-CIRZRIY4.js +118 -0
  4. package/dist/agent-pack-LF3O5TR4.js +1236 -0
  5. package/dist/agent-pack-RQT27V7R.js +1235 -0
  6. package/dist/airtable-BG2Q75G2.js +82 -0
  7. package/dist/airtable-JCQXFM5D.js +83 -0
  8. package/dist/alipay-MZX2XCDB.js +52 -0
  9. package/dist/alipay-TZQI34RB.js +51 -0
  10. package/dist/amap-5RQB3VGC.js +45 -0
  11. package/dist/amap-KPCLZYYL.js +44 -0
  12. package/dist/atlassian-LGOEWYC7.js +54 -0
  13. package/dist/atlassian-TVS2A4IU.js +55 -0
  14. package/dist/baidu-appbuilder-6UMESXHW.js +41 -0
  15. package/dist/baidu-appbuilder-QRRL3ETM.js +42 -0
  16. package/dist/baidu-maps-HEPMVP5D.js +44 -0
  17. package/dist/baidu-maps-HXC4FBVP.js +45 -0
  18. package/dist/baidu-netdisk-G5Q6B5NH.js +45 -0
  19. package/dist/baidu-netdisk-RS2K5W2M.js +44 -0
  20. package/dist/baidu-smartprogram-EWTK5WKK.js +41 -0
  21. package/dist/baidu-smartprogram-JHD3XWF6.js +40 -0
  22. package/dist/browserbase-IUIYVYI7.js +67 -0
  23. package/dist/browserbase-JFO2PCIA.js +68 -0
  24. package/dist/canva-3YOFL7JS.js +62 -0
  25. package/dist/canva-FMYN65SM.js +61 -0
  26. package/dist/chunk-6P2K6QZR.js +529 -0
  27. package/dist/chunk-7VMRQ7MG.js +90 -0
  28. package/dist/chunk-AD3JTIU3.js +17 -0
  29. package/dist/chunk-BF6CV2Y4.js +64 -0
  30. package/dist/chunk-CTNUKOQE.js +439 -0
  31. package/dist/chunk-EEFMJYKB.js +97 -0
  32. package/dist/chunk-EJKFQ35I.js +739 -0
  33. package/dist/chunk-HUICDC56.js +62 -0
  34. package/dist/chunk-JUPAE5IA.js +527 -0
  35. package/dist/chunk-JY2HTT7Q.js +437 -0
  36. package/dist/chunk-KEPTCLUO.js +121 -0
  37. package/dist/chunk-KKK5H7YX.js +3622 -0
  38. package/dist/chunk-POSVEKIY.js +210 -0
  39. package/dist/chunk-QET4LT4J.js +5769 -0
  40. package/dist/chunk-QV4XWO3P.js +30 -0
  41. package/dist/chunk-R52J3PH2.js +120 -0
  42. package/dist/chunk-R5U7XKVJ.js +16 -0
  43. package/dist/chunk-RECNVWMT.js +212 -0
  44. package/dist/chunk-RTPBU5HF.js +92 -0
  45. package/dist/chunk-SUZ2ATT6.js +5774 -0
  46. package/dist/chunk-SVMXSIMG.js +98 -0
  47. package/dist/chunk-TV3CBM7R.js +28 -0
  48. package/dist/chunk-V2LU736V.js +3495 -0
  49. package/dist/chunk-ZUYL3W53.js +741 -0
  50. package/dist/claude-plugin-577TAQVS.js +1463 -0
  51. package/dist/claude-plugin-L3MXJJ6J.js +1464 -0
  52. package/dist/cli.js +7021 -0
  53. package/dist/cloudflare-HBBABPK6.js +114 -0
  54. package/dist/cloudflare-RDFPKMM5.js +115 -0
  55. package/dist/cnb-FLP3QX46.js +44 -0
  56. package/dist/cnb-YAVVEYFB.js +45 -0
  57. package/dist/console/index.html +12 -0
  58. package/dist/console/logo.png +0 -0
  59. package/dist/console/static/css/5079.f9e0918d.css +1 -0
  60. package/dist/console/static/css/index.7f91f806.css +1 -0
  61. package/dist/console/static/font/codicon.5b7d6fac.ttf +0 -0
  62. package/dist/console/static/js/5079.72a51ca2.js +699 -0
  63. package/dist/console/static/js/5079.72a51ca2.js.LICENSE.txt +35 -0
  64. package/dist/console/static/js/7426.f8d483ea.js +1 -0
  65. package/dist/console/static/js/async/1008.4df521b7.js +1 -0
  66. package/dist/console/static/js/async/102.1d473ec7.js +1 -0
  67. package/dist/console/static/js/async/1134.3f9fd9e7.js +1 -0
  68. package/dist/console/static/js/async/1318.4b8e48e7.js +1 -0
  69. package/dist/console/static/js/async/1360.5606da88.js +7 -0
  70. package/dist/console/static/js/async/1546.045f484f.js +1 -0
  71. package/dist/console/static/js/async/1562.187de2a8.js +1 -0
  72. package/dist/console/static/js/async/168.456d4813.js +1 -0
  73. package/dist/console/static/js/async/1750.e6dc2664.js +1 -0
  74. package/dist/console/static/js/async/1994.3fc86066.js +1 -0
  75. package/dist/console/static/js/async/2348.613ae3d9.js +1 -0
  76. package/dist/console/static/js/async/2390.1b890b9d.js +1 -0
  77. package/dist/console/static/js/async/2414.9d040212.js +1 -0
  78. package/dist/console/static/js/async/2454.4c1784ab.js +1 -0
  79. package/dist/console/static/js/async/2498.f5f92030.js +1 -0
  80. package/dist/console/static/js/async/2924.b823cd1a.js +1 -0
  81. package/dist/console/static/js/async/3062.63fddea6.js +1 -0
  82. package/dist/console/static/js/async/3078.dd712008.js +1 -0
  83. package/dist/console/static/js/async/3198.1f307065.js +1 -0
  84. package/dist/console/static/js/async/3246.3d5a899f.js +1 -0
  85. package/dist/console/static/js/async/3286.871676eb.js +1 -0
  86. package/dist/console/static/js/async/342.10bf3b90.js +1 -0
  87. package/dist/console/static/js/async/3446.9681a4d7.js +1 -0
  88. package/dist/console/static/js/async/3698.ccfaabec.js +1 -0
  89. package/dist/console/static/js/async/3790.2a1106a6.js +1 -0
  90. package/dist/console/static/js/async/4231.b29784d4.js +1 -0
  91. package/dist/console/static/js/async/4551.515bd41d.js +1 -0
  92. package/dist/console/static/js/async/4596.40f6e71b.js +1 -0
  93. package/dist/console/static/js/async/4600.4aaebe6d.js +1 -0
  94. package/dist/console/static/js/async/4718.1aae022f.js +1 -0
  95. package/dist/console/static/js/async/4846.a347c020.js +1 -0
  96. package/dist/console/static/js/async/4860.83dadf89.js +1 -0
  97. package/dist/console/static/js/async/500.fcfa37cb.js +1 -0
  98. package/dist/console/static/js/async/5096.b360203d.js +1 -0
  99. package/dist/console/static/js/async/5222.043274fe.js +1 -0
  100. package/dist/console/static/js/async/5362.f498001c.js +1 -0
  101. package/dist/console/static/js/async/54.c94f0755.js +1 -0
  102. package/dist/console/static/js/async/5478.50dd9ef0.js +2 -0
  103. package/dist/console/static/js/async/5478.50dd9ef0.js.LICENSE.txt +3 -0
  104. package/dist/console/static/js/async/5507.a6a1f793.js +1 -0
  105. package/dist/console/static/js/async/5638.bc6b102d.js +1 -0
  106. package/dist/console/static/js/async/5722.e0029049.js +1 -0
  107. package/dist/console/static/js/async/5942.74635c6b.js +1 -0
  108. package/dist/console/static/js/async/5994.1c5629c1.js +1 -0
  109. package/dist/console/static/js/async/6054.6bddf720.js +1 -0
  110. package/dist/console/static/js/async/6118.45e754e5.js +1 -0
  111. package/dist/console/static/js/async/6127.adcbcbb6.js +1 -0
  112. package/dist/console/static/js/async/614.3f434c20.js +1 -0
  113. package/dist/console/static/js/async/6234.ba3b002d.js +1 -0
  114. package/dist/console/static/js/async/6310.6546a9ba.js +1 -0
  115. package/dist/console/static/js/async/6378.9f805419.js +1 -0
  116. package/dist/console/static/js/async/6380.e4433c49.js +1 -0
  117. package/dist/console/static/js/async/6418.f23bcfda.js +1 -0
  118. package/dist/console/static/js/async/6428.77c86114.js +1 -0
  119. package/dist/console/static/js/async/6443.83318a6c.js +1 -0
  120. package/dist/console/static/js/async/6508.2b445d62.js +3 -0
  121. package/dist/console/static/js/async/6542.e82a26c8.js +1 -0
  122. package/dist/console/static/js/async/6544.62111ecb.js +1 -0
  123. package/dist/console/static/js/async/6612.a0c9fcf4.js +1 -0
  124. package/dist/console/static/js/async/6740.695aebf0.js +1 -0
  125. package/dist/console/static/js/async/6822.dbbb32bc.js +1 -0
  126. package/dist/console/static/js/async/6824.ad3540ab.js +1 -0
  127. package/dist/console/static/js/async/6930.585dab94.js +1 -0
  128. package/dist/console/static/js/async/6982.c81b95e6.js +1 -0
  129. package/dist/console/static/js/async/7046.ab2378c1.js +1 -0
  130. package/dist/console/static/js/async/7110.a603277f.js +1 -0
  131. package/dist/console/static/js/async/7142.4a21366f.js +1 -0
  132. package/dist/console/static/js/async/7348.15cc6148.js +1373 -0
  133. package/dist/console/static/js/async/7348.15cc6148.js.LICENSE.txt +14 -0
  134. package/dist/console/static/js/async/7374.b1ac5c44.js +1 -0
  135. package/dist/console/static/js/async/742.847f17ca.js +1 -0
  136. package/dist/console/static/js/async/7446.743954d8.js +1 -0
  137. package/dist/console/static/js/async/7673.59bbbaac.js +1 -0
  138. package/dist/console/static/js/async/7684.c5760c8c.js +1 -0
  139. package/dist/console/static/js/async/7714.c30d0f94.js +1 -0
  140. package/dist/console/static/js/async/8118.36d5a3bf.js +298 -0
  141. package/dist/console/static/js/async/8145.4bcf043a.js +1 -0
  142. package/dist/console/static/js/async/8246.408de938.js +1 -0
  143. package/dist/console/static/js/async/8390.bdae1f7d.js +1 -0
  144. package/dist/console/static/js/async/8422.fd94dbe1.js +1 -0
  145. package/dist/console/static/js/async/8434.94a0e2ae.js +1 -0
  146. package/dist/console/static/js/async/8518.3158de13.js +1 -0
  147. package/dist/console/static/js/async/8564.fc2eb841.js +1 -0
  148. package/dist/console/static/js/async/8678.73af4c9b.js +1 -0
  149. package/dist/console/static/js/async/8694.79747168.js +1 -0
  150. package/dist/console/static/js/async/8756.1de37b83.js +1 -0
  151. package/dist/console/static/js/async/8804.7fe6bdf9.js +3 -0
  152. package/dist/console/static/js/async/8883.e717ee94.js +1 -0
  153. package/dist/console/static/js/async/8886.fe6e876c.js +1 -0
  154. package/dist/console/static/js/async/9030.fc1ae402.js +1 -0
  155. package/dist/console/static/js/async/9094.5598d084.js +1 -0
  156. package/dist/console/static/js/async/9218.ee7b84b7.js +1 -0
  157. package/dist/console/static/js/async/94.9b80bc35.js +1 -0
  158. package/dist/console/static/js/async/9526.92aba34c.js +1 -0
  159. package/dist/console/static/js/async/9762.f83bc4f3.js +1 -0
  160. package/dist/console/static/js/async/984.e11c113a.js +1 -0
  161. package/dist/console/static/js/async/9846.246653cd.js +1 -0
  162. package/dist/console/static/js/index.4487e1ff.js +1 -0
  163. package/dist/console/static/js/lib-react.15d7ca9a.js +2 -0
  164. package/dist/console/static/js/lib-react.15d7ca9a.js.LICENSE.txt +49 -0
  165. package/dist/coze-C6PMDPBI.js +49 -0
  166. package/dist/coze-E6VGRNLV.js +48 -0
  167. package/dist/dashboard.command-J7XOZNXU.js +8 -0
  168. package/dist/dashboard.command-RV2NHDKW.js +7 -0
  169. package/dist/dingtalk-JNRNRN7E.js +77 -0
  170. package/dist/dingtalk-WZGGIAHJ.js +76 -0
  171. package/dist/douyin-miniprogram-AIJPPIZH.js +41 -0
  172. package/dist/douyin-miniprogram-HCYZ5NBW.js +42 -0
  173. package/dist/figma-2YYNSCDX.js +103 -0
  174. package/dist/figma-RYOBMENP.js +102 -0
  175. package/dist/firebase-2IJDDBXX.js +112 -0
  176. package/dist/firebase-OYSY6HPT.js +111 -0
  177. package/dist/firecrawl-2T3SBUW7.js +66 -0
  178. package/dist/firecrawl-IYYXLAZM.js +65 -0
  179. package/dist/flyai-7FJ4TRAG.js +81 -0
  180. package/dist/flyai-QS5Q6FJR.js +82 -0
  181. package/dist/gitagent-MWI75OIX.js +725 -0
  182. package/dist/gitagent-YBMWY7NZ.js +726 -0
  183. package/dist/gitee-3N7OFOM7.js +53 -0
  184. package/dist/gitee-KVNK6KLZ.js +54 -0
  185. package/dist/github-LUEC2LID.js +143 -0
  186. package/dist/github-XRO5Z3GC.js +142 -0
  187. package/dist/google-ads-A3QAJI4D.js +88 -0
  188. package/dist/google-ads-VPKWTX67.js +89 -0
  189. package/dist/google-analytics-C4UR5ZR2.js +50 -0
  190. package/dist/google-analytics-XDYZA2B7.js +49 -0
  191. package/dist/google-workspace-LL3EWVHH.js +320 -0
  192. package/dist/google-workspace-YX35SHHX.js +321 -0
  193. package/dist/huawei-xiaoyi-6BSMGJHR.js +40 -0
  194. package/dist/huawei-xiaoyi-KPWLTSHB.js +41 -0
  195. package/dist/hubspot-DIUHGEDI.js +45 -0
  196. package/dist/hubspot-FTIEMNZO.js +44 -0
  197. package/dist/huggingface-MJCOXA7E.js +116 -0
  198. package/dist/huggingface-UUXK2RHK.js +117 -0
  199. package/dist/index.d.ts +3013 -0
  200. package/dist/index.js +15649 -0
  201. package/dist/inference-ai-image-generation-CMI6R5T3.js +106 -0
  202. package/dist/inference-ai-image-generation-PXV6IG4U.js +107 -0
  203. package/dist/inference-sh-7AZOLEFI.js +94 -0
  204. package/dist/inference-sh-ABQOD3YF.js +95 -0
  205. package/dist/init.command-6E24K4H3.js +9 -0
  206. package/dist/init.command-O4HG4HKR.js +10 -0
  207. package/dist/klaviyo-6K5YEFNH.js +45 -0
  208. package/dist/klaviyo-LDPBWBSS.js +44 -0
  209. package/dist/kuaidi100-HGFM5VK2.js +42 -0
  210. package/dist/kuaidi100-UHPFCVXP.js +41 -0
  211. package/dist/lark-6LNA3LUQ.js +103 -0
  212. package/dist/lark-URVBZNS4.js +102 -0
  213. package/dist/linear-7QFSFPOD.js +57 -0
  214. package/dist/linear-T4ORUP7N.js +56 -0
  215. package/dist/lovart-PDUXRUHJ.js +99 -0
  216. package/dist/lovart-QO3SK55T.js +100 -0
  217. package/dist/meta-ads-SCNFI45S.js +42 -0
  218. package/dist/meta-ads-V6XPZWX3.js +41 -0
  219. package/dist/miclaw-5CNTW7VV.js +36 -0
  220. package/dist/miclaw-TPPPS2WN.js +35 -0
  221. package/dist/model-provider-AVSFJSZP.js +393 -0
  222. package/dist/model-provider-KFB76XV5.js +392 -0
  223. package/dist/notion-FZK76MN2.js +69 -0
  224. package/dist/notion-WFA7KGZZ.js +70 -0
  225. package/dist/oceanengine-3JZUS3PP.js +43 -0
  226. package/dist/oceanengine-5BRIJVJE.js +42 -0
  227. package/dist/opencli-PFXHGCS2.js +81 -0
  228. package/dist/opencli-VIGRJTGH.js +80 -0
  229. package/dist/paypal-33UADIPR.js +54 -0
  230. package/dist/paypal-Z5JYHIWD.js +55 -0
  231. package/dist/playwright-MG5WHK47.js +58 -0
  232. package/dist/playwright-SQAQ3DZG.js +59 -0
  233. package/dist/plugins-HZBWK3WQ.js +120 -0
  234. package/dist/plugins-I4GD5SZX.js +121 -0
  235. package/dist/posthog-MU5MAJOQ.js +79 -0
  236. package/dist/posthog-RJRRKDWB.js +80 -0
  237. package/dist/salesforce-34FVIJTG.js +82 -0
  238. package/dist/salesforce-3QZ6OFVO.js +83 -0
  239. package/dist/sentry-MCIRMACU.js +111 -0
  240. package/dist/sentry-PIWW46VA.js +110 -0
  241. package/dist/seo-suite-4SQ3I67Q.js +54 -0
  242. package/dist/seo-suite-WJXMA3S4.js +55 -0
  243. package/dist/serve.command-5FMIPQRY.js +10 -0
  244. package/dist/serve.command-DNE6GPMK.js +9 -0
  245. package/dist/shadowob-JELOWHWX.js +1068 -0
  246. package/dist/shadowob-PRSMI5MW.js +1069 -0
  247. package/dist/sherlock-2PKY2E2Y.js +66 -0
  248. package/dist/sherlock-C5ZWPPVT.js +67 -0
  249. package/dist/shopify-GL3NFVGE.js +94 -0
  250. package/dist/shopify-R4G3UXM6.js +93 -0
  251. package/dist/skill-discovery-7INAUP4D.js +77 -0
  252. package/dist/skill-discovery-YPXXV622.js +78 -0
  253. package/dist/state-7MCZBTR5.js +17 -0
  254. package/dist/state-FGOFLFBE.js +18 -0
  255. package/dist/stripe-C22RR4ZS.js +83 -0
  256. package/dist/stripe-LJNPQ3CQ.js +82 -0
  257. package/dist/supabase-IRNQ54FJ.js +98 -0
  258. package/dist/supabase-N4ONFJNQ.js +97 -0
  259. package/dist/taobao-aipaas-LRR4GMO3.js +45 -0
  260. package/dist/taobao-aipaas-RVKORSF4.js +46 -0
  261. package/dist/tapd-3JPVJ7XH.js +46 -0
  262. package/dist/tapd-TMQRSMFG.js +47 -0
  263. package/dist/tencent-ads-IGD33LO7.js +42 -0
  264. package/dist/tencent-ads-UHC6OPBV.js +43 -0
  265. package/dist/tencent-docs-C3A4J3CJ.js +47 -0
  266. package/dist/tencent-docs-O2SC4FHL.js +48 -0
  267. package/dist/tencent-maps-HMMWMNF4.js +37 -0
  268. package/dist/tencent-maps-OQOKHVW2.js +36 -0
  269. package/dist/vercel-KOXDDTHX.js +73 -0
  270. package/dist/vercel-OLNVDWMG.js +74 -0
  271. package/dist/webflow-FULU5Q2I.js +114 -0
  272. package/dist/webflow-OMJKZM54.js +115 -0
  273. package/dist/wechat-miniprogram-skyline-KYCDMQNW.js +74 -0
  274. package/dist/wechat-miniprogram-skyline-VR4FVIQL.js +75 -0
  275. package/dist/wechat-pay-BCMAJ6UW.js +50 -0
  276. package/dist/wechat-pay-YQQKXVUI.js +51 -0
  277. package/dist/wonda-NGWIORYN.js +81 -0
  278. package/dist/wonda-RBABXFNM.js +82 -0
  279. package/dist/wordpress-woocommerce-RDIUTHYT.js +57 -0
  280. package/dist/wordpress-woocommerce-RNA5HB3N.js +58 -0
  281. package/dist/wps-DAEFQHDE.js +47 -0
  282. package/dist/wps-LUWHMZQQ.js +48 -0
  283. package/dist/yuque-HCHTJWNI.js +72 -0
  284. package/dist/yuque-KRH5O74J.js +71 -0
  285. package/images/RUNNERS.md +270 -0
  286. package/images/cc-connect-runner/entrypoint.mjs +311 -0
  287. package/images/claude-runner/Dockerfile +88 -0
  288. package/images/claude-runner/RUNNER.md +222 -0
  289. package/images/claude-runner/entrypoint.mjs +2 -0
  290. package/images/codex-runner/Dockerfile +87 -0
  291. package/images/codex-runner/RUNNER.md +226 -0
  292. package/images/codex-runner/entrypoint.mjs +2 -0
  293. package/images/gemini-runner/Dockerfile +87 -0
  294. package/images/gemini-runner/RUNNER.md +218 -0
  295. package/images/gemini-runner/entrypoint.mjs +2 -0
  296. package/images/hermes-runner/Dockerfile +74 -0
  297. package/images/hermes-runner/RUNNER.md +243 -0
  298. package/images/hermes-runner/entrypoint.mjs +283 -0
  299. package/images/openclaw-runner/Dockerfile +212 -0
  300. package/images/openclaw-runner/RUNNER.md +170 -0
  301. package/images/openclaw-runner/entrypoint.mjs +1113 -0
  302. package/images/openclaw-runner/warm-runtime-deps.mjs +95 -0
  303. package/images/opencode-runner/Dockerfile +87 -0
  304. package/images/opencode-runner/RUNNER.md +202 -0
  305. package/images/opencode-runner/entrypoint.mjs +2 -0
  306. package/package.json +121 -0
  307. package/templates/agent-marketplace-buddy.template.json +131 -0
  308. package/templates/ai-werewolf.template.json +92 -0
  309. package/templates/bmad-method-buddy.template.json +123 -0
  310. package/templates/brain-fix.template.json +92 -0
  311. package/templates/claude-ads-buddy.template.json +123 -0
  312. package/templates/claude-financial-services-buddy.template.json +111 -0
  313. package/templates/claude-seo-buddy.template.json +123 -0
  314. package/templates/code-arena.template.json +92 -0
  315. package/templates/daily-brief.template.json +92 -0
  316. package/templates/e-wife.template.json +92 -0
  317. package/templates/everything-claude-code-buddy.template.json +125 -0
  318. package/templates/financial-freedom.template.json +92 -0
  319. package/templates/gitstory.template.json +92 -0
  320. package/templates/google-workspace-buddy.template.json +88 -0
  321. package/templates/gsd-buddy.template.json +119 -0
  322. package/templates/gstack-buddy.template.json +143 -0
  323. package/templates/gstack.template.json +92 -0
  324. package/templates/little-match-girl.template.json +114 -0
  325. package/templates/lovart-buddy.template.json +110 -0
  326. package/templates/marketingskills-buddy.template.json +102 -0
  327. package/templates/retire-buddy.template.json +92 -0
  328. package/templates/scientific-skills-buddy.template.json +119 -0
  329. package/templates/seomachine-buddy.template.json +113 -0
  330. package/templates/shadow-server-app-demo.template.json +105 -0
  331. package/templates/slavingia-skills-buddy.template.json +102 -0
  332. package/templates/superclaude-buddy.template.json +146 -0
  333. package/templates/superpowers-buddy.template.json +108 -0
  334. package/templates/world-pulse.template.json +92 -0
@@ -0,0 +1,726 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ definePlugin
4
+ } from "./chunk-CTNUKOQE.js";
5
+ import "./chunk-AD3JTIU3.js";
6
+
7
+ // src/plugins/gitagent/index.ts
8
+ import { existsSync as existsSync2 } from "fs";
9
+ import { resolve } from "path";
10
+
11
+ // src/plugins/gitagent/k8s.ts
12
+ var STANDARD_GITAGENT_FILES = [
13
+ "SOUL.md",
14
+ "RULES.md",
15
+ "AGENTS.md",
16
+ "INSTRUCTIONS.md",
17
+ "agent.yaml",
18
+ "scheduler.yml",
19
+ "scheduler.yaml",
20
+ "skills",
21
+ "tools",
22
+ "hooks",
23
+ "skillflows",
24
+ "memory",
25
+ "knowledge",
26
+ "compliance"
27
+ ];
28
+ function buildGitCloneCommand(opts) {
29
+ const { url, ref, depth, agentDir, mountPath, include } = opts;
30
+ const cloneTarget = "/tmp/agent-source";
31
+ const cmds = [];
32
+ cmds.push(`git clone --depth ${depth} --branch "${ref}" "${url}" "${cloneTarget}"`);
33
+ const sourceDir = agentDir ? `${cloneTarget}/${agentDir}` : cloneTarget;
34
+ cmds.push(`mkdir -p "${mountPath}"`);
35
+ if (include && include.length > 0) {
36
+ for (const pattern of include) {
37
+ cmds.push(`cp -r "${sourceDir}/${pattern}" "${mountPath}/" 2>/dev/null || true`);
38
+ }
39
+ } else {
40
+ for (const f of STANDARD_GITAGENT_FILES) {
41
+ cmds.push(`cp -r "${sourceDir}/${f}" "${mountPath}/" 2>/dev/null || true`);
42
+ }
43
+ }
44
+ return ["/bin/sh", "-c", cmds.join(" && ")];
45
+ }
46
+ function parsePollInterval(input) {
47
+ if (input == null) return 0;
48
+ if (typeof input === "number") return Math.max(0, Math.floor(input));
49
+ const m = /^(\d+)\s*(s|m|h)?$/.exec(input.trim());
50
+ if (!m) return 0;
51
+ const n = Number(m[1]);
52
+ const unit = m[2] ?? "s";
53
+ switch (unit) {
54
+ case "h":
55
+ return n * 3600;
56
+ case "m":
57
+ return n * 60;
58
+ default:
59
+ return n;
60
+ }
61
+ }
62
+ function buildGitSyncSidecar(opts) {
63
+ const { name, url, ref, depth, agentDir, mountPath, include, intervalSec } = opts;
64
+ if (!intervalSec || intervalSec <= 0) return void 0;
65
+ const cloneTarget = "/tmp/agent-source";
66
+ const filesToCopy = include && include.length > 0 ? include : STANDARD_GITAGENT_FILES;
67
+ const copySnippet = filesToCopy.map(
68
+ (f) => `cp -r "${cloneTarget}/${agentDir ?? "."}/${f}" "${mountPath}/" 2>/dev/null || true`
69
+ ).join("; ");
70
+ const script = `
71
+ set -e
72
+ if [ ! -d "${cloneTarget}/.git" ]; then
73
+ git clone --depth ${depth} --branch "${ref}" "${url}" "${cloneTarget}"
74
+ fi
75
+ while true; do
76
+ cd "${cloneTarget}"
77
+ git fetch --depth ${depth} origin "${ref}" 2>&1 || echo "[gitagent-sync] fetch failed, will retry"
78
+ git reset --hard "origin/${ref}" 2>&1 || git reset --hard "${ref}" 2>&1 || true
79
+ mkdir -p "${mountPath}"
80
+ ${copySnippet}
81
+ # touch a marker file so readers using chokidar(fs) can debounce on it
82
+ date -u +%FT%TZ > "${mountPath}/.gitagent-synced-at" || true
83
+ sleep ${intervalSec}
84
+ done
85
+ `.trim();
86
+ return {
87
+ name,
88
+ image: "alpine/git:latest",
89
+ imagePullPolicy: "IfNotPresent",
90
+ command: ["/bin/sh", "-c", script],
91
+ volumeMounts: [{ name: "gitagent-src", mountPath }],
92
+ resources: {
93
+ requests: { cpu: "10m", memory: "32Mi" },
94
+ limits: { cpu: "100m", memory: "128Mi" }
95
+ }
96
+ };
97
+ }
98
+
99
+ // src/plugins/gitagent/manifest.json
100
+ var manifest_default = {
101
+ id: "gitagent",
102
+ name: "GitAgent",
103
+ description: "Deploy agents from gitagent-standard git repositories. Supports init-container (runtime clone) and build-image (pre-baked) strategies.",
104
+ version: "1.0.0",
105
+ category: "code",
106
+ icon: "git-branch",
107
+ website: "https://gitagent.sh/",
108
+ docs: "https://github.com/open-gitagent/gitagent",
109
+ auth: {
110
+ type: "token",
111
+ fields: [
112
+ {
113
+ key: "GITHUB_TOKEN",
114
+ label: "Git Token (HTTPS)",
115
+ description: "Personal access token for private HTTPS repositories",
116
+ required: false,
117
+ sensitive: true,
118
+ placeholder: "ghp_..."
119
+ }
120
+ ]
121
+ },
122
+ config: {
123
+ type: "object",
124
+ properties: {
125
+ git: {
126
+ type: "object",
127
+ description: "Git repository source",
128
+ properties: {
129
+ url: { type: "string", description: "Repository URL (HTTPS or SSH)" },
130
+ ref: { type: "string", description: "Branch, tag, or commit SHA" },
131
+ dir: { type: "string", description: "Subdirectory within the repo" },
132
+ depth: { type: "number", description: "Shallow clone depth" },
133
+ sshKeySecret: { type: "string", description: "K8s Secret name for SSH key" },
134
+ tokenSecret: {
135
+ type: "string",
136
+ description: "K8s Secret name or env var for HTTPS token"
137
+ }
138
+ }
139
+ },
140
+ path: { type: "string", description: "Local gitagent directory (dev mode)" },
141
+ poll: {
142
+ type: "string",
143
+ description: "Poll interval for live git-pull sidecar, e.g. '5m', '30s'. Omit to disable."
144
+ },
145
+ strategy: {
146
+ type: "string",
147
+ enum: ["init-container", "build-image"],
148
+ default: "init-container"
149
+ },
150
+ mountPath: { type: "string", default: "/agent" },
151
+ include: { type: "array", items: { type: "string" } },
152
+ imageTag: { type: "string", description: "Docker image tag for build-image strategy" }
153
+ }
154
+ },
155
+ capabilities: ["config-builder"],
156
+ tags: ["git", "gitagent", "source", "repository", "init-container", "build-image"]
157
+ };
158
+
159
+ // src/plugins/gitagent/reader.ts
160
+ import { existsSync, readdirSync, readFileSync } from "fs";
161
+ import { readdir, readFile as readFileAsync, stat } from "fs/promises";
162
+ import { join } from "path";
163
+ function parseYaml(content) {
164
+ const lines = content.split("\n");
165
+ let pos = 0;
166
+ const at = (i) => lines[i];
167
+ function skipEmptyAndComments() {
168
+ while (pos < lines.length) {
169
+ const line = at(pos);
170
+ const trimmed = line.trim();
171
+ if (trimmed === "" || trimmed.startsWith("#")) {
172
+ pos++;
173
+ } else {
174
+ break;
175
+ }
176
+ }
177
+ }
178
+ function getIndent(line) {
179
+ return line.length - line.trimStart().length;
180
+ }
181
+ function parseValue(raw) {
182
+ const v = raw.trim();
183
+ if (v === "true" || v === "yes") return true;
184
+ if (v === "false" || v === "no") return false;
185
+ if (v === "null" || v === "~" || v === "") return null;
186
+ if (/^-?\d+$/.test(v)) return Number.parseInt(v, 10);
187
+ if (/^-?\d*\.\d+$/.test(v)) return Number.parseFloat(v);
188
+ if (v.startsWith('"') && v.endsWith('"') || v.startsWith("'") && v.endsWith("'")) {
189
+ return v.slice(1, -1);
190
+ }
191
+ if (v.startsWith("[") && v.endsWith("]")) {
192
+ const inner = v.slice(1, -1);
193
+ if (inner.trim() === "") return [];
194
+ return inner.split(",").map((s) => parseValue(s.trim())).filter((s) => s !== null && s !== "");
195
+ }
196
+ return v;
197
+ }
198
+ function parseBlock(minIndent) {
199
+ skipEmptyAndComments();
200
+ if (pos >= lines.length) return null;
201
+ const firstLine = at(pos);
202
+ const firstIndent = getIndent(firstLine);
203
+ if (firstIndent < minIndent) return null;
204
+ const firstTrimmed = firstLine.trim();
205
+ if (firstTrimmed.startsWith("- ") || firstTrimmed === "-") {
206
+ const arr = [];
207
+ while (pos < lines.length) {
208
+ skipEmptyAndComments();
209
+ if (pos >= lines.length) break;
210
+ const line = at(pos);
211
+ const indent = getIndent(line);
212
+ if (indent < minIndent) break;
213
+ const trimmed = line.trim();
214
+ if (!trimmed.startsWith("-")) break;
215
+ const afterDash = trimmed.slice(1).trim();
216
+ pos++;
217
+ if (afterDash === "") {
218
+ arr.push(parseBlock(indent + 2));
219
+ } else if (afterDash.includes(":")) {
220
+ const obj = {};
221
+ const [k, ...rest] = afterDash.split(":");
222
+ const v = rest.join(":").trim();
223
+ if (v !== "") {
224
+ obj[k.trim()] = parseValue(v);
225
+ }
226
+ while (pos < lines.length) {
227
+ skipEmptyAndComments();
228
+ if (pos >= lines.length) break;
229
+ const nextLine = at(pos);
230
+ const nextIndent = getIndent(nextLine);
231
+ if (nextIndent < indent + 2) break;
232
+ const nextTrimmed = nextLine.trim();
233
+ if (!nextTrimmed.includes(":")) break;
234
+ const [nk, ...nrest] = nextTrimmed.split(":");
235
+ const nv = nrest.join(":").trim();
236
+ pos++;
237
+ obj[nk.trim()] = nv !== "" ? parseValue(nv) : parseBlock(nextIndent + 2);
238
+ }
239
+ arr.push(Object.keys(obj).length > 1 ? obj : parseValue(afterDash));
240
+ } else {
241
+ arr.push(parseValue(afterDash));
242
+ }
243
+ }
244
+ return arr;
245
+ }
246
+ if (firstTrimmed.includes(":")) {
247
+ const obj = {};
248
+ while (pos < lines.length) {
249
+ skipEmptyAndComments();
250
+ if (pos >= lines.length) break;
251
+ const line = at(pos);
252
+ const indent = getIndent(line);
253
+ if (indent < minIndent) break;
254
+ const trimmed = line.trim();
255
+ if (trimmed.startsWith("-")) break;
256
+ const colonIdx = trimmed.indexOf(":");
257
+ if (colonIdx < 0) {
258
+ pos++;
259
+ continue;
260
+ }
261
+ const key = trimmed.slice(0, colonIdx).trim();
262
+ const afterColon = trimmed.slice(colonIdx + 1).trim();
263
+ pos++;
264
+ if (afterColon === "" || afterColon === "|" || afterColon === ">") {
265
+ if (afterColon === "|" || afterColon === ">") {
266
+ const blockLines = [];
267
+ while (pos < lines.length) {
268
+ const subLine = at(pos);
269
+ const subIndent = getIndent(subLine);
270
+ if (subLine.trim() === "") {
271
+ blockLines.push("");
272
+ pos++;
273
+ continue;
274
+ }
275
+ if (subIndent <= indent) break;
276
+ blockLines.push(subLine.slice(indent + 2));
277
+ pos++;
278
+ }
279
+ obj[key] = blockLines.join("\n").trimEnd();
280
+ } else {
281
+ skipEmptyAndComments();
282
+ if (pos < lines.length) {
283
+ const nextLine = at(pos);
284
+ const nextIndent = getIndent(nextLine);
285
+ if (nextIndent > indent) {
286
+ obj[key] = parseBlock(nextIndent);
287
+ } else {
288
+ obj[key] = null;
289
+ }
290
+ }
291
+ }
292
+ } else {
293
+ obj[key] = parseValue(afterColon);
294
+ }
295
+ }
296
+ return obj;
297
+ }
298
+ pos++;
299
+ return parseValue(firstTrimmed);
300
+ }
301
+ return parseBlock(0);
302
+ }
303
+ function safeParseYaml(content, context) {
304
+ try {
305
+ const result = parseYaml(content);
306
+ if (result !== null && typeof result === "object" && !Array.isArray(result)) {
307
+ return result;
308
+ }
309
+ return {};
310
+ } catch (err) {
311
+ process.stderr.write(`[gitagent] YAML parse warning in ${context}: ${String(err)}
312
+ `);
313
+ return {};
314
+ }
315
+ }
316
+ function readFileSync_(dir, ...parts) {
317
+ const p = join(dir, ...parts);
318
+ if (!existsSync(p)) return null;
319
+ return readFileSync(p, "utf-8");
320
+ }
321
+ function listDirSync(dir, ...parts) {
322
+ const p = join(dir, ...parts);
323
+ if (!existsSync(p)) return [];
324
+ try {
325
+ return readdirSync(p);
326
+ } catch {
327
+ return [];
328
+ }
329
+ }
330
+ function parseAgentYaml(content) {
331
+ const raw = safeParseYaml(content, "agent.yaml");
332
+ const model = raw.model;
333
+ const compliance = raw.compliance;
334
+ const supervision = compliance?.supervision ?? {};
335
+ const recordkeeping = compliance?.recordkeeping ?? {};
336
+ return {
337
+ name: raw.name ?? "",
338
+ version: raw.version,
339
+ description: raw.description,
340
+ model: model ? {
341
+ preferred: model.preferred ?? "",
342
+ fallbacks: model.fallbacks ?? void 0,
343
+ constraints: model.constraints ? {
344
+ temperature: model.constraints.temperature ?? void 0,
345
+ max_tokens: model.constraints.max_tokens ?? void 0,
346
+ top_p: model.constraints.top_p ?? void 0,
347
+ thinking_level: model.constraints.thinking_level ?? void 0
348
+ } : void 0
349
+ } : void 0,
350
+ skills: raw.skills ?? void 0,
351
+ tools: raw.tools ?? void 0,
352
+ runtime: raw.runtime,
353
+ compliance: compliance ? {
354
+ risk_tier: compliance.risk_tier,
355
+ frameworks: compliance.frameworks ?? void 0,
356
+ supervision: {
357
+ human_in_the_loop: supervision.human_in_the_loop
358
+ },
359
+ recordkeeping: {
360
+ audit_logging: recordkeeping.audit_logging,
361
+ retention_period: recordkeeping.retention_period
362
+ },
363
+ model_risk: compliance.model_risk
364
+ } : void 0,
365
+ dependencies: raw.dependencies,
366
+ agents: raw.agents ?? void 0,
367
+ delegation: raw.delegation,
368
+ exports: raw.exports
369
+ };
370
+ }
371
+ function parseSoulMd(content) {
372
+ const lines = content.split("\n");
373
+ let name;
374
+ let personality = "";
375
+ for (const line of lines) {
376
+ if (!name && line.startsWith("# ")) {
377
+ name = line.slice(2).trim();
378
+ continue;
379
+ }
380
+ personality += `${line}
381
+ `;
382
+ }
383
+ personality = personality.trim();
384
+ return {
385
+ name,
386
+ personality: personality || void 0
387
+ };
388
+ }
389
+ function parseRulesMd(content) {
390
+ return content.trim();
391
+ }
392
+ function parseInstructionsMd(content) {
393
+ return content.trim();
394
+ }
395
+ function parseSkillMd(skillId, content) {
396
+ const fmMatch = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
397
+ if (!fmMatch) {
398
+ return { id: skillId, content };
399
+ }
400
+ const meta = safeParseYaml(fmMatch[1], `skills/${skillId}/SKILL.md`);
401
+ return {
402
+ id: skillId,
403
+ name: meta.name ?? skillId,
404
+ version: meta.version,
405
+ description: meta.description,
406
+ triggers: meta.triggers ?? void 0,
407
+ content: fmMatch[2].trim()
408
+ };
409
+ }
410
+ function parseToolYaml(toolId, content) {
411
+ const raw = safeParseYaml(content, `tools/${toolId}.yaml`);
412
+ return {
413
+ id: toolId,
414
+ name: raw.name ?? toolId,
415
+ description: raw.description,
416
+ type: raw.type,
417
+ schema: raw.schema
418
+ };
419
+ }
420
+ function parseHooksYaml(content) {
421
+ const raw = safeParseYaml(content, "hooks/hooks.yaml");
422
+ const lifecycle = raw.lifecycle;
423
+ const events = raw.events;
424
+ return {
425
+ lifecycle: lifecycle ? {
426
+ on_start: lifecycle.on_start,
427
+ on_stop: lifecycle.on_stop,
428
+ on_error: lifecycle.on_error,
429
+ on_reset: lifecycle.on_reset
430
+ } : void 0,
431
+ events: events?.map((e) => ({
432
+ name: e.name ?? "",
433
+ trigger: e.trigger ?? "",
434
+ skill: e.skill,
435
+ tool: e.tool,
436
+ prompt: e.prompt
437
+ })),
438
+ bootstrap: void 0,
439
+ teardown: void 0
440
+ };
441
+ }
442
+ function parseSkillFlowYaml(content, filename) {
443
+ const raw = safeParseYaml(content, filename);
444
+ const stepsRaw = raw.steps ?? {};
445
+ const steps = {};
446
+ for (const [stepId, stepRaw] of Object.entries(stepsRaw)) {
447
+ if (!stepRaw || typeof stepRaw !== "object") continue;
448
+ steps[stepId] = {
449
+ skill: stepRaw.skill,
450
+ agent: stepRaw.agent,
451
+ tool: stepRaw.tool,
452
+ dependsOn: stepRaw.depends_on ?? void 0,
453
+ inputs: stepRaw.inputs ?? void 0,
454
+ prompt: stepRaw.prompt,
455
+ conditions: stepRaw.conditions ?? void 0
456
+ };
457
+ }
458
+ const errorHandling = raw.error_handling;
459
+ return {
460
+ name: raw.name ?? filename,
461
+ description: raw.description,
462
+ triggers: raw.triggers ?? void 0,
463
+ schedule: raw.schedule,
464
+ steps,
465
+ errorHandling: errorHandling ? {
466
+ onFailure: errorHandling.on_failure,
467
+ notifyChannel: errorHandling.notify_channel,
468
+ maxRetries: errorHandling.max_retries
469
+ } : void 0
470
+ };
471
+ }
472
+ function parseSchedulerYaml(content) {
473
+ const raw = safeParseYaml(content, "scheduler.yml");
474
+ const schedules = raw.schedules;
475
+ return {
476
+ schedules: schedules?.map((s) => ({
477
+ name: s.name ?? "",
478
+ cron: s.cron,
479
+ interval: s.interval,
480
+ skill: s.skill,
481
+ tool: s.tool,
482
+ prompt: s.prompt,
483
+ enabled: s.enabled
484
+ }))
485
+ };
486
+ }
487
+ function readGitAgentDir(dir) {
488
+ const parsed = {
489
+ skills: [],
490
+ tools: [],
491
+ skillFlows: [],
492
+ dir
493
+ };
494
+ const agentYaml = readFileSync_(dir, "agent.yaml");
495
+ if (agentYaml) parsed.manifest = parseAgentYaml(agentYaml);
496
+ const soulMd = readFileSync_(dir, "SOUL.md");
497
+ if (soulMd) parsed.soul = parseSoulMd(soulMd);
498
+ const rulesMd = readFileSync_(dir, "RULES.md");
499
+ if (rulesMd) parsed.rules = parseRulesMd(rulesMd);
500
+ const instructionsMd = readFileSync_(dir, "INSTRUCTIONS.md");
501
+ if (instructionsMd) parsed.instructions = parseInstructionsMd(instructionsMd);
502
+ const agentsMd = readFileSync_(dir, "AGENTS.md");
503
+ if (agentsMd) parsed.agents = agentsMd.trim();
504
+ for (const skillDir of listDirSync(dir, "skills")) {
505
+ const skillMd = readFileSync_(dir, "skills", skillDir, "SKILL.md");
506
+ if (skillMd) {
507
+ parsed.skills.push(parseSkillMd(skillDir, skillMd));
508
+ }
509
+ }
510
+ for (const toolFile of listDirSync(dir, "tools")) {
511
+ if (!toolFile.endsWith(".yaml") && !toolFile.endsWith(".yml")) continue;
512
+ const toolContent = readFileSync_(dir, "tools", toolFile);
513
+ if (toolContent) {
514
+ const toolId = toolFile.replace(/\.(ya?ml)$/, "");
515
+ parsed.tools.push(parseToolYaml(toolId, toolContent));
516
+ }
517
+ }
518
+ const hooksYaml = readFileSync_(dir, "hooks", "hooks.yaml");
519
+ if (hooksYaml) {
520
+ parsed.hooks = parseHooksYaml(hooksYaml);
521
+ parsed.hooks.bootstrap = readFileSync_(dir, "hooks", "bootstrap.md") ?? void 0;
522
+ parsed.hooks.teardown = readFileSync_(dir, "hooks", "teardown.md") ?? void 0;
523
+ } else {
524
+ const bootstrap = readFileSync_(dir, "hooks", "bootstrap.md");
525
+ const teardown = readFileSync_(dir, "hooks", "teardown.md");
526
+ if (bootstrap || teardown) {
527
+ parsed.hooks = { bootstrap: bootstrap ?? void 0, teardown: teardown ?? void 0 };
528
+ }
529
+ }
530
+ for (const sfFile of listDirSync(dir, "skillflows")) {
531
+ if (!sfFile.endsWith(".yaml") && !sfFile.endsWith(".yml")) continue;
532
+ const sfContent = readFileSync_(dir, "skillflows", sfFile);
533
+ if (sfContent) {
534
+ parsed.skillFlows.push(parseSkillFlowYaml(sfContent, sfFile));
535
+ }
536
+ }
537
+ const schedulerYml = readFileSync_(dir, "scheduler.yml") ?? readFileSync_(dir, "scheduler.yaml");
538
+ if (schedulerYml) parsed.scheduler = parseSchedulerYaml(schedulerYml);
539
+ const memoryMd = readFileSync_(dir, "memory", "MEMORY.md");
540
+ if (memoryMd) parsed.memoryInstructions = memoryMd.trim();
541
+ return parsed;
542
+ }
543
+ function adaptGitAgentModel(manifest) {
544
+ if (!manifest.model?.preferred) return void 0;
545
+ const m = manifest.model;
546
+ return {
547
+ preferred: m.preferred,
548
+ fallbacks: m.fallbacks,
549
+ constraints: m.constraints ? {
550
+ temperature: m.constraints.temperature,
551
+ maxTokens: m.constraints.max_tokens,
552
+ topP: m.constraints.top_p,
553
+ thinkingLevel: m.constraints.thinking_level
554
+ } : void 0
555
+ };
556
+ }
557
+ function adaptGitAgentCompliance(manifest) {
558
+ if (!manifest.compliance) return void 0;
559
+ const c = manifest.compliance;
560
+ return {
561
+ riskTier: c.risk_tier,
562
+ frameworks: c.frameworks,
563
+ humanInTheLoop: c.supervision?.human_in_the_loop,
564
+ auditLogging: c.recordkeeping?.audit_logging,
565
+ retentionPeriod: c.recordkeeping?.retention_period
566
+ };
567
+ }
568
+ function enrichAgentFromGitAgent(agent, parsed) {
569
+ const enriched = { ...agent };
570
+ if (parsed.soul) {
571
+ enriched.identity = {
572
+ name: agent.identity?.name ?? parsed.soul.name,
573
+ description: agent.identity?.description ?? parsed.manifest?.description,
574
+ personality: agent.identity?.personality ?? parsed.soul.personality,
575
+ systemPrompt: agent.identity?.systemPrompt
576
+ };
577
+ }
578
+ if (!enriched.description && parsed.manifest?.description) {
579
+ enriched.description = parsed.manifest.description;
580
+ }
581
+ if (!enriched.model && parsed.manifest) {
582
+ enriched.model = adaptGitAgentModel(parsed.manifest) ?? enriched.model;
583
+ }
584
+ if (!enriched.compliance && parsed.manifest) {
585
+ enriched.compliance = adaptGitAgentCompliance(parsed.manifest) ?? enriched.compliance;
586
+ }
587
+ if (!enriched.workflows?.length && parsed.skillFlows.length > 0) {
588
+ enriched.workflows = parsed.skillFlows;
589
+ }
590
+ return enriched;
591
+ }
592
+ function buildOpenClawFromGitAgent(parsed, mountPath) {
593
+ const result = {};
594
+ result.agents = {
595
+ defaults: {
596
+ repoRoot: mountPath
597
+ }
598
+ };
599
+ if (parsed.skills.length > 0) {
600
+ result.skills = {
601
+ load: { extraDirs: [join(mountPath, "skills")] },
602
+ entries: Object.fromEntries(
603
+ parsed.skills.map((s) => [
604
+ s.id,
605
+ {
606
+ enabled: true
607
+ }
608
+ ])
609
+ )
610
+ };
611
+ }
612
+ if (parsed.scheduler?.schedules?.length) {
613
+ const firstSchedule = parsed.scheduler.schedules[0];
614
+ if (firstSchedule.cron || firstSchedule.interval) {
615
+ if (!result.agents) result.agents = {};
616
+ if (!result.agents.defaults) result.agents.defaults = {};
617
+ result.agents.defaults.heartbeat = {
618
+ every: firstSchedule.interval ?? firstSchedule.cron,
619
+ prompt: firstSchedule.prompt ?? `Run scheduled task: ${firstSchedule.name}`
620
+ };
621
+ }
622
+ }
623
+ return result;
624
+ }
625
+
626
+ // src/plugins/gitagent/index.ts
627
+ var gitagentK8sProvider = {
628
+ buildK8s(agent, _ctx) {
629
+ const src = agent.source;
630
+ if (!src) return void 0;
631
+ const useGitagent = src.gitagent !== false;
632
+ if (!useGitagent) return void 0;
633
+ const git = src.git;
634
+ if (!git?.url) return void 0;
635
+ const mountPath = src.mountPath ?? "/agent";
636
+ const ref = git.ref ?? "main";
637
+ const depth = git.depth ?? 1;
638
+ const include = src.include;
639
+ const poll = src.poll;
640
+ const intervalSec = parsePollInterval(poll);
641
+ const result = {
642
+ initContainers: [
643
+ {
644
+ name: "gitagent-clone",
645
+ image: "alpine/git:latest",
646
+ imagePullPolicy: "IfNotPresent",
647
+ command: buildGitCloneCommand({
648
+ url: git.url,
649
+ ref,
650
+ depth,
651
+ agentDir: git.dir,
652
+ mountPath,
653
+ include
654
+ }),
655
+ volumeMounts: [{ name: "gitagent-src", mountPath }]
656
+ }
657
+ ],
658
+ volumes: [{ name: "gitagent-src", spec: { emptyDir: {} } }],
659
+ volumeMounts: [{ name: "gitagent-src", mountPath }],
660
+ envVars: [{ name: "OPENCLAW_AGENT_DIR", value: mountPath }],
661
+ labels: { "gitagent.url": git.url.replace(/[^A-Za-z0-9._-]/g, "_").slice(0, 63) }
662
+ };
663
+ const sidecar = buildGitSyncSidecar({
664
+ name: "gitagent-sync",
665
+ url: git.url,
666
+ ref,
667
+ depth,
668
+ agentDir: git.dir,
669
+ mountPath,
670
+ include,
671
+ intervalSec
672
+ });
673
+ if (sidecar) result.sidecars = [sidecar];
674
+ return result;
675
+ }
676
+ };
677
+ var plugin = definePlugin(manifest_default, (api) => {
678
+ api.onResolveAgent((agent, _config) => {
679
+ const gitagentEntry = agent.use?.find((u) => u.plugin === "gitagent");
680
+ if (!gitagentEntry?.options) return agent;
681
+ let a = agent.source ? agent : { ...agent, source: gitagentEntry.options };
682
+ const localPath = a.source?.path ? resolve(a.source.path) : void 0;
683
+ if (localPath && existsSync2(localPath)) {
684
+ const parsed = readGitAgentDir(localPath);
685
+ a = enrichAgentFromGitAgent(a, parsed);
686
+ }
687
+ return a;
688
+ });
689
+ api.onBuildConfig((context) => {
690
+ const { agent } = context;
691
+ if (!agent.source) return {};
692
+ const mountPath = agent.source.mountPath ?? "/agent";
693
+ const useGitagent = agent.source.gitagent !== false;
694
+ if (!useGitagent) return {};
695
+ const fragment = {
696
+ agents: {
697
+ defaults: {
698
+ repoRoot: mountPath
699
+ }
700
+ }
701
+ };
702
+ if (agent.source.path) {
703
+ const localPath = resolve(agent.source.path);
704
+ if (existsSync2(localPath)) {
705
+ const parsed = readGitAgentDir(localPath);
706
+ const additions = buildOpenClawFromGitAgent(parsed, mountPath);
707
+ if (additions.skills) {
708
+ fragment.skills = additions.skills;
709
+ }
710
+ if (additions.agents?.defaults?.heartbeat) {
711
+ ;
712
+ fragment.agents.defaults = {
713
+ ...fragment.agents.defaults,
714
+ heartbeat: additions.agents.defaults.heartbeat
715
+ };
716
+ }
717
+ }
718
+ }
719
+ return fragment;
720
+ });
721
+ });
722
+ plugin.k8s = gitagentK8sProvider;
723
+ var gitagent_default = plugin;
724
+ export {
725
+ gitagent_default as default
726
+ };