@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.
- package/README.md +509 -0
- package/dist/agent-browser-CERTMCDL.js +117 -0
- package/dist/agent-browser-CIRZRIY4.js +118 -0
- package/dist/agent-pack-LF3O5TR4.js +1236 -0
- package/dist/agent-pack-RQT27V7R.js +1235 -0
- package/dist/airtable-BG2Q75G2.js +82 -0
- package/dist/airtable-JCQXFM5D.js +83 -0
- package/dist/alipay-MZX2XCDB.js +52 -0
- package/dist/alipay-TZQI34RB.js +51 -0
- package/dist/amap-5RQB3VGC.js +45 -0
- package/dist/amap-KPCLZYYL.js +44 -0
- package/dist/atlassian-LGOEWYC7.js +54 -0
- package/dist/atlassian-TVS2A4IU.js +55 -0
- package/dist/baidu-appbuilder-6UMESXHW.js +41 -0
- package/dist/baidu-appbuilder-QRRL3ETM.js +42 -0
- package/dist/baidu-maps-HEPMVP5D.js +44 -0
- package/dist/baidu-maps-HXC4FBVP.js +45 -0
- package/dist/baidu-netdisk-G5Q6B5NH.js +45 -0
- package/dist/baidu-netdisk-RS2K5W2M.js +44 -0
- package/dist/baidu-smartprogram-EWTK5WKK.js +41 -0
- package/dist/baidu-smartprogram-JHD3XWF6.js +40 -0
- package/dist/browserbase-IUIYVYI7.js +67 -0
- package/dist/browserbase-JFO2PCIA.js +68 -0
- package/dist/canva-3YOFL7JS.js +62 -0
- package/dist/canva-FMYN65SM.js +61 -0
- package/dist/chunk-6P2K6QZR.js +529 -0
- package/dist/chunk-7VMRQ7MG.js +90 -0
- package/dist/chunk-AD3JTIU3.js +17 -0
- package/dist/chunk-BF6CV2Y4.js +64 -0
- package/dist/chunk-CTNUKOQE.js +439 -0
- package/dist/chunk-EEFMJYKB.js +97 -0
- package/dist/chunk-EJKFQ35I.js +739 -0
- package/dist/chunk-HUICDC56.js +62 -0
- package/dist/chunk-JUPAE5IA.js +527 -0
- package/dist/chunk-JY2HTT7Q.js +437 -0
- package/dist/chunk-KEPTCLUO.js +121 -0
- package/dist/chunk-KKK5H7YX.js +3622 -0
- package/dist/chunk-POSVEKIY.js +210 -0
- package/dist/chunk-QET4LT4J.js +5769 -0
- package/dist/chunk-QV4XWO3P.js +30 -0
- package/dist/chunk-R52J3PH2.js +120 -0
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/chunk-RECNVWMT.js +212 -0
- package/dist/chunk-RTPBU5HF.js +92 -0
- package/dist/chunk-SUZ2ATT6.js +5774 -0
- package/dist/chunk-SVMXSIMG.js +98 -0
- package/dist/chunk-TV3CBM7R.js +28 -0
- package/dist/chunk-V2LU736V.js +3495 -0
- package/dist/chunk-ZUYL3W53.js +741 -0
- package/dist/claude-plugin-577TAQVS.js +1463 -0
- package/dist/claude-plugin-L3MXJJ6J.js +1464 -0
- package/dist/cli.js +7021 -0
- package/dist/cloudflare-HBBABPK6.js +114 -0
- package/dist/cloudflare-RDFPKMM5.js +115 -0
- package/dist/cnb-FLP3QX46.js +44 -0
- package/dist/cnb-YAVVEYFB.js +45 -0
- package/dist/console/index.html +12 -0
- package/dist/console/logo.png +0 -0
- package/dist/console/static/css/5079.f9e0918d.css +1 -0
- package/dist/console/static/css/index.7f91f806.css +1 -0
- package/dist/console/static/font/codicon.5b7d6fac.ttf +0 -0
- package/dist/console/static/js/5079.72a51ca2.js +699 -0
- package/dist/console/static/js/5079.72a51ca2.js.LICENSE.txt +35 -0
- package/dist/console/static/js/7426.f8d483ea.js +1 -0
- package/dist/console/static/js/async/1008.4df521b7.js +1 -0
- package/dist/console/static/js/async/102.1d473ec7.js +1 -0
- package/dist/console/static/js/async/1134.3f9fd9e7.js +1 -0
- package/dist/console/static/js/async/1318.4b8e48e7.js +1 -0
- package/dist/console/static/js/async/1360.5606da88.js +7 -0
- package/dist/console/static/js/async/1546.045f484f.js +1 -0
- package/dist/console/static/js/async/1562.187de2a8.js +1 -0
- package/dist/console/static/js/async/168.456d4813.js +1 -0
- package/dist/console/static/js/async/1750.e6dc2664.js +1 -0
- package/dist/console/static/js/async/1994.3fc86066.js +1 -0
- package/dist/console/static/js/async/2348.613ae3d9.js +1 -0
- package/dist/console/static/js/async/2390.1b890b9d.js +1 -0
- package/dist/console/static/js/async/2414.9d040212.js +1 -0
- package/dist/console/static/js/async/2454.4c1784ab.js +1 -0
- package/dist/console/static/js/async/2498.f5f92030.js +1 -0
- package/dist/console/static/js/async/2924.b823cd1a.js +1 -0
- package/dist/console/static/js/async/3062.63fddea6.js +1 -0
- package/dist/console/static/js/async/3078.dd712008.js +1 -0
- package/dist/console/static/js/async/3198.1f307065.js +1 -0
- package/dist/console/static/js/async/3246.3d5a899f.js +1 -0
- package/dist/console/static/js/async/3286.871676eb.js +1 -0
- package/dist/console/static/js/async/342.10bf3b90.js +1 -0
- package/dist/console/static/js/async/3446.9681a4d7.js +1 -0
- package/dist/console/static/js/async/3698.ccfaabec.js +1 -0
- package/dist/console/static/js/async/3790.2a1106a6.js +1 -0
- package/dist/console/static/js/async/4231.b29784d4.js +1 -0
- package/dist/console/static/js/async/4551.515bd41d.js +1 -0
- package/dist/console/static/js/async/4596.40f6e71b.js +1 -0
- package/dist/console/static/js/async/4600.4aaebe6d.js +1 -0
- package/dist/console/static/js/async/4718.1aae022f.js +1 -0
- package/dist/console/static/js/async/4846.a347c020.js +1 -0
- package/dist/console/static/js/async/4860.83dadf89.js +1 -0
- package/dist/console/static/js/async/500.fcfa37cb.js +1 -0
- package/dist/console/static/js/async/5096.b360203d.js +1 -0
- package/dist/console/static/js/async/5222.043274fe.js +1 -0
- package/dist/console/static/js/async/5362.f498001c.js +1 -0
- package/dist/console/static/js/async/54.c94f0755.js +1 -0
- package/dist/console/static/js/async/5478.50dd9ef0.js +2 -0
- package/dist/console/static/js/async/5478.50dd9ef0.js.LICENSE.txt +3 -0
- package/dist/console/static/js/async/5507.a6a1f793.js +1 -0
- package/dist/console/static/js/async/5638.bc6b102d.js +1 -0
- package/dist/console/static/js/async/5722.e0029049.js +1 -0
- package/dist/console/static/js/async/5942.74635c6b.js +1 -0
- package/dist/console/static/js/async/5994.1c5629c1.js +1 -0
- package/dist/console/static/js/async/6054.6bddf720.js +1 -0
- package/dist/console/static/js/async/6118.45e754e5.js +1 -0
- package/dist/console/static/js/async/6127.adcbcbb6.js +1 -0
- package/dist/console/static/js/async/614.3f434c20.js +1 -0
- package/dist/console/static/js/async/6234.ba3b002d.js +1 -0
- package/dist/console/static/js/async/6310.6546a9ba.js +1 -0
- package/dist/console/static/js/async/6378.9f805419.js +1 -0
- package/dist/console/static/js/async/6380.e4433c49.js +1 -0
- package/dist/console/static/js/async/6418.f23bcfda.js +1 -0
- package/dist/console/static/js/async/6428.77c86114.js +1 -0
- package/dist/console/static/js/async/6443.83318a6c.js +1 -0
- package/dist/console/static/js/async/6508.2b445d62.js +3 -0
- package/dist/console/static/js/async/6542.e82a26c8.js +1 -0
- package/dist/console/static/js/async/6544.62111ecb.js +1 -0
- package/dist/console/static/js/async/6612.a0c9fcf4.js +1 -0
- package/dist/console/static/js/async/6740.695aebf0.js +1 -0
- package/dist/console/static/js/async/6822.dbbb32bc.js +1 -0
- package/dist/console/static/js/async/6824.ad3540ab.js +1 -0
- package/dist/console/static/js/async/6930.585dab94.js +1 -0
- package/dist/console/static/js/async/6982.c81b95e6.js +1 -0
- package/dist/console/static/js/async/7046.ab2378c1.js +1 -0
- package/dist/console/static/js/async/7110.a603277f.js +1 -0
- package/dist/console/static/js/async/7142.4a21366f.js +1 -0
- package/dist/console/static/js/async/7348.15cc6148.js +1373 -0
- package/dist/console/static/js/async/7348.15cc6148.js.LICENSE.txt +14 -0
- package/dist/console/static/js/async/7374.b1ac5c44.js +1 -0
- package/dist/console/static/js/async/742.847f17ca.js +1 -0
- package/dist/console/static/js/async/7446.743954d8.js +1 -0
- package/dist/console/static/js/async/7673.59bbbaac.js +1 -0
- package/dist/console/static/js/async/7684.c5760c8c.js +1 -0
- package/dist/console/static/js/async/7714.c30d0f94.js +1 -0
- package/dist/console/static/js/async/8118.36d5a3bf.js +298 -0
- package/dist/console/static/js/async/8145.4bcf043a.js +1 -0
- package/dist/console/static/js/async/8246.408de938.js +1 -0
- package/dist/console/static/js/async/8390.bdae1f7d.js +1 -0
- package/dist/console/static/js/async/8422.fd94dbe1.js +1 -0
- package/dist/console/static/js/async/8434.94a0e2ae.js +1 -0
- package/dist/console/static/js/async/8518.3158de13.js +1 -0
- package/dist/console/static/js/async/8564.fc2eb841.js +1 -0
- package/dist/console/static/js/async/8678.73af4c9b.js +1 -0
- package/dist/console/static/js/async/8694.79747168.js +1 -0
- package/dist/console/static/js/async/8756.1de37b83.js +1 -0
- package/dist/console/static/js/async/8804.7fe6bdf9.js +3 -0
- package/dist/console/static/js/async/8883.e717ee94.js +1 -0
- package/dist/console/static/js/async/8886.fe6e876c.js +1 -0
- package/dist/console/static/js/async/9030.fc1ae402.js +1 -0
- package/dist/console/static/js/async/9094.5598d084.js +1 -0
- package/dist/console/static/js/async/9218.ee7b84b7.js +1 -0
- package/dist/console/static/js/async/94.9b80bc35.js +1 -0
- package/dist/console/static/js/async/9526.92aba34c.js +1 -0
- package/dist/console/static/js/async/9762.f83bc4f3.js +1 -0
- package/dist/console/static/js/async/984.e11c113a.js +1 -0
- package/dist/console/static/js/async/9846.246653cd.js +1 -0
- package/dist/console/static/js/index.4487e1ff.js +1 -0
- package/dist/console/static/js/lib-react.15d7ca9a.js +2 -0
- package/dist/console/static/js/lib-react.15d7ca9a.js.LICENSE.txt +49 -0
- package/dist/coze-C6PMDPBI.js +49 -0
- package/dist/coze-E6VGRNLV.js +48 -0
- package/dist/dashboard.command-J7XOZNXU.js +8 -0
- package/dist/dashboard.command-RV2NHDKW.js +7 -0
- package/dist/dingtalk-JNRNRN7E.js +77 -0
- package/dist/dingtalk-WZGGIAHJ.js +76 -0
- package/dist/douyin-miniprogram-AIJPPIZH.js +41 -0
- package/dist/douyin-miniprogram-HCYZ5NBW.js +42 -0
- package/dist/figma-2YYNSCDX.js +103 -0
- package/dist/figma-RYOBMENP.js +102 -0
- package/dist/firebase-2IJDDBXX.js +112 -0
- package/dist/firebase-OYSY6HPT.js +111 -0
- package/dist/firecrawl-2T3SBUW7.js +66 -0
- package/dist/firecrawl-IYYXLAZM.js +65 -0
- package/dist/flyai-7FJ4TRAG.js +81 -0
- package/dist/flyai-QS5Q6FJR.js +82 -0
- package/dist/gitagent-MWI75OIX.js +725 -0
- package/dist/gitagent-YBMWY7NZ.js +726 -0
- package/dist/gitee-3N7OFOM7.js +53 -0
- package/dist/gitee-KVNK6KLZ.js +54 -0
- package/dist/github-LUEC2LID.js +143 -0
- package/dist/github-XRO5Z3GC.js +142 -0
- package/dist/google-ads-A3QAJI4D.js +88 -0
- package/dist/google-ads-VPKWTX67.js +89 -0
- package/dist/google-analytics-C4UR5ZR2.js +50 -0
- package/dist/google-analytics-XDYZA2B7.js +49 -0
- package/dist/google-workspace-LL3EWVHH.js +320 -0
- package/dist/google-workspace-YX35SHHX.js +321 -0
- package/dist/huawei-xiaoyi-6BSMGJHR.js +40 -0
- package/dist/huawei-xiaoyi-KPWLTSHB.js +41 -0
- package/dist/hubspot-DIUHGEDI.js +45 -0
- package/dist/hubspot-FTIEMNZO.js +44 -0
- package/dist/huggingface-MJCOXA7E.js +116 -0
- package/dist/huggingface-UUXK2RHK.js +117 -0
- package/dist/index.d.ts +3013 -0
- package/dist/index.js +15649 -0
- package/dist/inference-ai-image-generation-CMI6R5T3.js +106 -0
- package/dist/inference-ai-image-generation-PXV6IG4U.js +107 -0
- package/dist/inference-sh-7AZOLEFI.js +94 -0
- package/dist/inference-sh-ABQOD3YF.js +95 -0
- package/dist/init.command-6E24K4H3.js +9 -0
- package/dist/init.command-O4HG4HKR.js +10 -0
- package/dist/klaviyo-6K5YEFNH.js +45 -0
- package/dist/klaviyo-LDPBWBSS.js +44 -0
- package/dist/kuaidi100-HGFM5VK2.js +42 -0
- package/dist/kuaidi100-UHPFCVXP.js +41 -0
- package/dist/lark-6LNA3LUQ.js +103 -0
- package/dist/lark-URVBZNS4.js +102 -0
- package/dist/linear-7QFSFPOD.js +57 -0
- package/dist/linear-T4ORUP7N.js +56 -0
- package/dist/lovart-PDUXRUHJ.js +99 -0
- package/dist/lovart-QO3SK55T.js +100 -0
- package/dist/meta-ads-SCNFI45S.js +42 -0
- package/dist/meta-ads-V6XPZWX3.js +41 -0
- package/dist/miclaw-5CNTW7VV.js +36 -0
- package/dist/miclaw-TPPPS2WN.js +35 -0
- package/dist/model-provider-AVSFJSZP.js +393 -0
- package/dist/model-provider-KFB76XV5.js +392 -0
- package/dist/notion-FZK76MN2.js +69 -0
- package/dist/notion-WFA7KGZZ.js +70 -0
- package/dist/oceanengine-3JZUS3PP.js +43 -0
- package/dist/oceanengine-5BRIJVJE.js +42 -0
- package/dist/opencli-PFXHGCS2.js +81 -0
- package/dist/opencli-VIGRJTGH.js +80 -0
- package/dist/paypal-33UADIPR.js +54 -0
- package/dist/paypal-Z5JYHIWD.js +55 -0
- package/dist/playwright-MG5WHK47.js +58 -0
- package/dist/playwright-SQAQ3DZG.js +59 -0
- package/dist/plugins-HZBWK3WQ.js +120 -0
- package/dist/plugins-I4GD5SZX.js +121 -0
- package/dist/posthog-MU5MAJOQ.js +79 -0
- package/dist/posthog-RJRRKDWB.js +80 -0
- package/dist/salesforce-34FVIJTG.js +82 -0
- package/dist/salesforce-3QZ6OFVO.js +83 -0
- package/dist/sentry-MCIRMACU.js +111 -0
- package/dist/sentry-PIWW46VA.js +110 -0
- package/dist/seo-suite-4SQ3I67Q.js +54 -0
- package/dist/seo-suite-WJXMA3S4.js +55 -0
- package/dist/serve.command-5FMIPQRY.js +10 -0
- package/dist/serve.command-DNE6GPMK.js +9 -0
- package/dist/shadowob-JELOWHWX.js +1068 -0
- package/dist/shadowob-PRSMI5MW.js +1069 -0
- package/dist/sherlock-2PKY2E2Y.js +66 -0
- package/dist/sherlock-C5ZWPPVT.js +67 -0
- package/dist/shopify-GL3NFVGE.js +94 -0
- package/dist/shopify-R4G3UXM6.js +93 -0
- package/dist/skill-discovery-7INAUP4D.js +77 -0
- package/dist/skill-discovery-YPXXV622.js +78 -0
- package/dist/state-7MCZBTR5.js +17 -0
- package/dist/state-FGOFLFBE.js +18 -0
- package/dist/stripe-C22RR4ZS.js +83 -0
- package/dist/stripe-LJNPQ3CQ.js +82 -0
- package/dist/supabase-IRNQ54FJ.js +98 -0
- package/dist/supabase-N4ONFJNQ.js +97 -0
- package/dist/taobao-aipaas-LRR4GMO3.js +45 -0
- package/dist/taobao-aipaas-RVKORSF4.js +46 -0
- package/dist/tapd-3JPVJ7XH.js +46 -0
- package/dist/tapd-TMQRSMFG.js +47 -0
- package/dist/tencent-ads-IGD33LO7.js +42 -0
- package/dist/tencent-ads-UHC6OPBV.js +43 -0
- package/dist/tencent-docs-C3A4J3CJ.js +47 -0
- package/dist/tencent-docs-O2SC4FHL.js +48 -0
- package/dist/tencent-maps-HMMWMNF4.js +37 -0
- package/dist/tencent-maps-OQOKHVW2.js +36 -0
- package/dist/vercel-KOXDDTHX.js +73 -0
- package/dist/vercel-OLNVDWMG.js +74 -0
- package/dist/webflow-FULU5Q2I.js +114 -0
- package/dist/webflow-OMJKZM54.js +115 -0
- package/dist/wechat-miniprogram-skyline-KYCDMQNW.js +74 -0
- package/dist/wechat-miniprogram-skyline-VR4FVIQL.js +75 -0
- package/dist/wechat-pay-BCMAJ6UW.js +50 -0
- package/dist/wechat-pay-YQQKXVUI.js +51 -0
- package/dist/wonda-NGWIORYN.js +81 -0
- package/dist/wonda-RBABXFNM.js +82 -0
- package/dist/wordpress-woocommerce-RDIUTHYT.js +57 -0
- package/dist/wordpress-woocommerce-RNA5HB3N.js +58 -0
- package/dist/wps-DAEFQHDE.js +47 -0
- package/dist/wps-LUWHMZQQ.js +48 -0
- package/dist/yuque-HCHTJWNI.js +72 -0
- package/dist/yuque-KRH5O74J.js +71 -0
- package/images/RUNNERS.md +270 -0
- package/images/cc-connect-runner/entrypoint.mjs +311 -0
- package/images/claude-runner/Dockerfile +88 -0
- package/images/claude-runner/RUNNER.md +222 -0
- package/images/claude-runner/entrypoint.mjs +2 -0
- package/images/codex-runner/Dockerfile +87 -0
- package/images/codex-runner/RUNNER.md +226 -0
- package/images/codex-runner/entrypoint.mjs +2 -0
- package/images/gemini-runner/Dockerfile +87 -0
- package/images/gemini-runner/RUNNER.md +218 -0
- package/images/gemini-runner/entrypoint.mjs +2 -0
- package/images/hermes-runner/Dockerfile +74 -0
- package/images/hermes-runner/RUNNER.md +243 -0
- package/images/hermes-runner/entrypoint.mjs +283 -0
- package/images/openclaw-runner/Dockerfile +212 -0
- package/images/openclaw-runner/RUNNER.md +170 -0
- package/images/openclaw-runner/entrypoint.mjs +1113 -0
- package/images/openclaw-runner/warm-runtime-deps.mjs +95 -0
- package/images/opencode-runner/Dockerfile +87 -0
- package/images/opencode-runner/RUNNER.md +202 -0
- package/images/opencode-runner/entrypoint.mjs +2 -0
- package/package.json +121 -0
- package/templates/agent-marketplace-buddy.template.json +131 -0
- package/templates/ai-werewolf.template.json +92 -0
- package/templates/bmad-method-buddy.template.json +123 -0
- package/templates/brain-fix.template.json +92 -0
- package/templates/claude-ads-buddy.template.json +123 -0
- package/templates/claude-financial-services-buddy.template.json +111 -0
- package/templates/claude-seo-buddy.template.json +123 -0
- package/templates/code-arena.template.json +92 -0
- package/templates/daily-brief.template.json +92 -0
- package/templates/e-wife.template.json +92 -0
- package/templates/everything-claude-code-buddy.template.json +125 -0
- package/templates/financial-freedom.template.json +92 -0
- package/templates/gitstory.template.json +92 -0
- package/templates/google-workspace-buddy.template.json +88 -0
- package/templates/gsd-buddy.template.json +119 -0
- package/templates/gstack-buddy.template.json +143 -0
- package/templates/gstack.template.json +92 -0
- package/templates/little-match-girl.template.json +114 -0
- package/templates/lovart-buddy.template.json +110 -0
- package/templates/marketingskills-buddy.template.json +102 -0
- package/templates/retire-buddy.template.json +92 -0
- package/templates/scientific-skills-buddy.template.json +119 -0
- package/templates/seomachine-buddy.template.json +113 -0
- package/templates/shadow-server-app-demo.template.json +105 -0
- package/templates/slavingia-skills-buddy.template.json +102 -0
- package/templates/superclaude-buddy.template.json +146 -0
- package/templates/superpowers-buddy.template.json +108 -0
- package/templates/world-pulse.template.json +92 -0
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/plugins/registry.ts
|
|
4
|
+
function createPluginRegistry() {
|
|
5
|
+
const plugins = /* @__PURE__ */ new Map();
|
|
6
|
+
return {
|
|
7
|
+
get size() {
|
|
8
|
+
return plugins.size;
|
|
9
|
+
},
|
|
10
|
+
register(plugin) {
|
|
11
|
+
const { id } = plugin.manifest;
|
|
12
|
+
if (plugins.has(id)) {
|
|
13
|
+
throw new Error(`Plugin "${id}" is already registered`);
|
|
14
|
+
}
|
|
15
|
+
plugins.set(id, plugin);
|
|
16
|
+
},
|
|
17
|
+
get(id) {
|
|
18
|
+
return plugins.get(id);
|
|
19
|
+
},
|
|
20
|
+
getAll() {
|
|
21
|
+
return [...plugins.values()];
|
|
22
|
+
},
|
|
23
|
+
getByCategory(category) {
|
|
24
|
+
return [...plugins.values()].filter((p) => p.manifest.category === category);
|
|
25
|
+
},
|
|
26
|
+
getByCapability(cap) {
|
|
27
|
+
return [...plugins.values()].filter((p) => p.manifest.capabilities.includes(cap));
|
|
28
|
+
},
|
|
29
|
+
search(query) {
|
|
30
|
+
const q = query.toLowerCase();
|
|
31
|
+
return [...plugins.values()].filter((p) => {
|
|
32
|
+
const m = p.manifest;
|
|
33
|
+
return m.name.toLowerCase().includes(q) || m.description.toLowerCase().includes(q) || m.id.toLowerCase().includes(q) || m.tags.some((t) => t.toLowerCase().includes(q));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var _globalRegistry = null;
|
|
39
|
+
function getPluginRegistry() {
|
|
40
|
+
if (!_globalRegistry) {
|
|
41
|
+
_globalRegistry = createPluginRegistry();
|
|
42
|
+
}
|
|
43
|
+
return _globalRegistry;
|
|
44
|
+
}
|
|
45
|
+
function resetPluginRegistry() {
|
|
46
|
+
_globalRegistry = null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/plugins/loader.ts
|
|
50
|
+
import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport";
|
|
51
|
+
import * as __typia_transform__createStandardSchema from "typia/lib/internal/_createStandardSchema";
|
|
52
|
+
var validatePluginManifest = (() => {
|
|
53
|
+
const _iv1 = /* @__PURE__ */ new Set(["communication", "project-management", "ai-provider", "devops", "database", "productivity", "automation", "crm", "finance", "analytics", "media", "email", "calendar", "search", "code", "other"]);
|
|
54
|
+
const _iv3 = /* @__PURE__ */ new Set(["channel", "tool", "notification", "webhook", "data-source", "action", "auth-provider", "skill", "cli", "mcp", "config-builder", "config-resolver"]);
|
|
55
|
+
const _vv7 = /* @__PURE__ */ new Set(["communication", "project-management", "ai-provider", "devops", "database", "productivity", "automation", "crm", "finance", "analytics", "media", "email", "calendar", "search", "code", "other"]);
|
|
56
|
+
const _vv9 = /* @__PURE__ */ new Set(["channel", "tool", "notification", "webhook", "data-source", "action", "auth-provider", "skill", "cli", "mcp", "config-builder", "config-resolver"]);
|
|
57
|
+
const _io0 = (input) => "string" === typeof input.id && "string" === typeof input.name && "string" === typeof input.description && "string" === typeof input.version && true === _iv1.has(input.category) && "string" === typeof input.icon && (void 0 === input.website || "string" === typeof input.website) && (void 0 === input.docs || "string" === typeof input.docs) && ("object" === typeof input.auth && null !== input.auth && _io1(input.auth)) && (void 0 === input.config || "object" === typeof input.config && null !== input.config && false === Array.isArray(input.config) && _io4(input.config)) && (Array.isArray(input.capabilities) && input.capabilities.every((elem) => true === _iv3.has(elem))) && (Array.isArray(input.tags) && input.tags.every((elem) => "string" === typeof elem)) && (void 0 === input.popularity || "number" === typeof input.popularity);
|
|
58
|
+
const _io1 = (input) => ("oauth2" === input.type || "api-key" === input.type || "token" === input.type || "basic" === input.type || "none" === input.type) && (Array.isArray(input.fields) && input.fields.every((elem) => "object" === typeof elem && null !== elem && _io2(elem))) && (void 0 === input.oauth || "object" === typeof input.oauth && null !== input.oauth && _io3(input.oauth));
|
|
59
|
+
const _io2 = (input) => "string" === typeof input.key && "string" === typeof input.label && (void 0 === input.description || "string" === typeof input.description) && "boolean" === typeof input.required && "boolean" === typeof input.sensitive && (void 0 === input.placeholder || "string" === typeof input.placeholder) && (void 0 === input.validation || "string" === typeof input.validation) && (void 0 === input.helpUrl || "string" === typeof input.helpUrl);
|
|
60
|
+
const _io3 = (input) => "string" === typeof input.authorizationUrl && "string" === typeof input.tokenUrl && (Array.isArray(input.scopes) && input.scopes.every((elem) => "string" === typeof elem)) && (void 0 === input.pkce || "boolean" === typeof input.pkce);
|
|
61
|
+
const _io4 = (input) => Object.keys(input).every((key) => {
|
|
62
|
+
const value = input[key];
|
|
63
|
+
if (void 0 === value)
|
|
64
|
+
return true;
|
|
65
|
+
return true;
|
|
66
|
+
});
|
|
67
|
+
const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.id || _report(_exceptionable, {
|
|
68
|
+
path: _path + ".id",
|
|
69
|
+
expected: "string",
|
|
70
|
+
value: input.id
|
|
71
|
+
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
72
|
+
path: _path + ".name",
|
|
73
|
+
expected: "string",
|
|
74
|
+
value: input.name
|
|
75
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
76
|
+
path: _path + ".description",
|
|
77
|
+
expected: "string",
|
|
78
|
+
value: input.description
|
|
79
|
+
}), "string" === typeof input.version || _report(_exceptionable, {
|
|
80
|
+
path: _path + ".version",
|
|
81
|
+
expected: "string",
|
|
82
|
+
value: input.version
|
|
83
|
+
}), true === _vv7.has(input.category) || _report(_exceptionable, {
|
|
84
|
+
path: _path + ".category",
|
|
85
|
+
expected: '("ai-provider" | "analytics" | "automation" | "calendar" | "code" | "communication" | "crm" | "database" | "devops" | "email" | "finance" | "media" | "other" | "productivity" | "project-management" | "search")',
|
|
86
|
+
value: input.category
|
|
87
|
+
}), "string" === typeof input.icon || _report(_exceptionable, {
|
|
88
|
+
path: _path + ".icon",
|
|
89
|
+
expected: "string",
|
|
90
|
+
value: input.icon
|
|
91
|
+
}), void 0 === input.website || "string" === typeof input.website || _report(_exceptionable, {
|
|
92
|
+
path: _path + ".website",
|
|
93
|
+
expected: "(string | undefined)",
|
|
94
|
+
value: input.website
|
|
95
|
+
}), void 0 === input.docs || "string" === typeof input.docs || _report(_exceptionable, {
|
|
96
|
+
path: _path + ".docs",
|
|
97
|
+
expected: "(string | undefined)",
|
|
98
|
+
value: input.docs
|
|
99
|
+
}), ("object" === typeof input.auth && null !== input.auth || _report(_exceptionable, {
|
|
100
|
+
path: _path + ".auth",
|
|
101
|
+
expected: "PluginAuth",
|
|
102
|
+
value: input.auth
|
|
103
|
+
})) && _vo1(input.auth, _path + ".auth", _exceptionable) || _report(_exceptionable, {
|
|
104
|
+
path: _path + ".auth",
|
|
105
|
+
expected: "PluginAuth",
|
|
106
|
+
value: input.auth
|
|
107
|
+
}), void 0 === input.config || ("object" === typeof input.config && null !== input.config && false === Array.isArray(input.config) || _report(_exceptionable, {
|
|
108
|
+
path: _path + ".config",
|
|
109
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
110
|
+
value: input.config
|
|
111
|
+
})) && _vo4(input.config, _path + ".config", _exceptionable) || _report(_exceptionable, {
|
|
112
|
+
path: _path + ".config",
|
|
113
|
+
expected: "(Record<string, unknown> | undefined)",
|
|
114
|
+
value: input.config
|
|
115
|
+
}), (Array.isArray(input.capabilities) || _report(_exceptionable, {
|
|
116
|
+
path: _path + ".capabilities",
|
|
117
|
+
expected: "Array<PluginCapability>",
|
|
118
|
+
value: input.capabilities
|
|
119
|
+
})) && input.capabilities.map((elem, _index8) => true === _vv9.has(elem) || _report(_exceptionable, {
|
|
120
|
+
path: _path + ".capabilities[" + _index8 + "]",
|
|
121
|
+
expected: '("action" | "auth-provider" | "channel" | "cli" | "config-builder" | "config-resolver" | "data-source" | "mcp" | "notification" | "skill" | "tool" | "webhook")',
|
|
122
|
+
value: elem
|
|
123
|
+
})).every((flag) => flag) || _report(_exceptionable, {
|
|
124
|
+
path: _path + ".capabilities",
|
|
125
|
+
expected: "Array<PluginCapability>",
|
|
126
|
+
value: input.capabilities
|
|
127
|
+
}), (Array.isArray(input.tags) || _report(_exceptionable, {
|
|
128
|
+
path: _path + ".tags",
|
|
129
|
+
expected: "Array<string>",
|
|
130
|
+
value: input.tags
|
|
131
|
+
})) && input.tags.map((elem, _index10) => "string" === typeof elem || _report(_exceptionable, {
|
|
132
|
+
path: _path + ".tags[" + _index10 + "]",
|
|
133
|
+
expected: "string",
|
|
134
|
+
value: elem
|
|
135
|
+
})).every((flag) => flag) || _report(_exceptionable, {
|
|
136
|
+
path: _path + ".tags",
|
|
137
|
+
expected: "Array<string>",
|
|
138
|
+
value: input.tags
|
|
139
|
+
}), void 0 === input.popularity || "number" === typeof input.popularity || _report(_exceptionable, {
|
|
140
|
+
path: _path + ".popularity",
|
|
141
|
+
expected: "(number | undefined)",
|
|
142
|
+
value: input.popularity
|
|
143
|
+
})].every((flag) => flag);
|
|
144
|
+
const _vo1 = (input, _path, _exceptionable = true) => ["oauth2" === input.type || "api-key" === input.type || "token" === input.type || "basic" === input.type || "none" === input.type || _report(_exceptionable, {
|
|
145
|
+
path: _path + ".type",
|
|
146
|
+
expected: '("api-key" | "basic" | "none" | "oauth2" | "token")',
|
|
147
|
+
value: input.type
|
|
148
|
+
}), (Array.isArray(input.fields) || _report(_exceptionable, {
|
|
149
|
+
path: _path + ".fields",
|
|
150
|
+
expected: "Array<PluginAuthField>",
|
|
151
|
+
value: input.fields
|
|
152
|
+
})) && input.fields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
153
|
+
path: _path + ".fields[" + _index11 + "]",
|
|
154
|
+
expected: "PluginAuthField",
|
|
155
|
+
value: elem
|
|
156
|
+
})) && _vo2(elem, _path + ".fields[" + _index11 + "]", _exceptionable) || _report(_exceptionable, {
|
|
157
|
+
path: _path + ".fields[" + _index11 + "]",
|
|
158
|
+
expected: "PluginAuthField",
|
|
159
|
+
value: elem
|
|
160
|
+
})).every((flag) => flag) || _report(_exceptionable, {
|
|
161
|
+
path: _path + ".fields",
|
|
162
|
+
expected: "Array<PluginAuthField>",
|
|
163
|
+
value: input.fields
|
|
164
|
+
}), void 0 === input.oauth || ("object" === typeof input.oauth && null !== input.oauth || _report(_exceptionable, {
|
|
165
|
+
path: _path + ".oauth",
|
|
166
|
+
expected: "(PluginOAuthConfig | undefined)",
|
|
167
|
+
value: input.oauth
|
|
168
|
+
})) && _vo3(input.oauth, _path + ".oauth", _exceptionable) || _report(_exceptionable, {
|
|
169
|
+
path: _path + ".oauth",
|
|
170
|
+
expected: "(PluginOAuthConfig | undefined)",
|
|
171
|
+
value: input.oauth
|
|
172
|
+
})].every((flag) => flag);
|
|
173
|
+
const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.key || _report(_exceptionable, {
|
|
174
|
+
path: _path + ".key",
|
|
175
|
+
expected: "string",
|
|
176
|
+
value: input.key
|
|
177
|
+
}), "string" === typeof input.label || _report(_exceptionable, {
|
|
178
|
+
path: _path + ".label",
|
|
179
|
+
expected: "string",
|
|
180
|
+
value: input.label
|
|
181
|
+
}), void 0 === input.description || "string" === typeof input.description || _report(_exceptionable, {
|
|
182
|
+
path: _path + ".description",
|
|
183
|
+
expected: "(string | undefined)",
|
|
184
|
+
value: input.description
|
|
185
|
+
}), "boolean" === typeof input.required || _report(_exceptionable, {
|
|
186
|
+
path: _path + ".required",
|
|
187
|
+
expected: "boolean",
|
|
188
|
+
value: input.required
|
|
189
|
+
}), "boolean" === typeof input.sensitive || _report(_exceptionable, {
|
|
190
|
+
path: _path + ".sensitive",
|
|
191
|
+
expected: "boolean",
|
|
192
|
+
value: input.sensitive
|
|
193
|
+
}), void 0 === input.placeholder || "string" === typeof input.placeholder || _report(_exceptionable, {
|
|
194
|
+
path: _path + ".placeholder",
|
|
195
|
+
expected: "(string | undefined)",
|
|
196
|
+
value: input.placeholder
|
|
197
|
+
}), void 0 === input.validation || "string" === typeof input.validation || _report(_exceptionable, {
|
|
198
|
+
path: _path + ".validation",
|
|
199
|
+
expected: "(string | undefined)",
|
|
200
|
+
value: input.validation
|
|
201
|
+
}), void 0 === input.helpUrl || "string" === typeof input.helpUrl || _report(_exceptionable, {
|
|
202
|
+
path: _path + ".helpUrl",
|
|
203
|
+
expected: "(string | undefined)",
|
|
204
|
+
value: input.helpUrl
|
|
205
|
+
})].every((flag) => flag);
|
|
206
|
+
const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.authorizationUrl || _report(_exceptionable, {
|
|
207
|
+
path: _path + ".authorizationUrl",
|
|
208
|
+
expected: "string",
|
|
209
|
+
value: input.authorizationUrl
|
|
210
|
+
}), "string" === typeof input.tokenUrl || _report(_exceptionable, {
|
|
211
|
+
path: _path + ".tokenUrl",
|
|
212
|
+
expected: "string",
|
|
213
|
+
value: input.tokenUrl
|
|
214
|
+
}), (Array.isArray(input.scopes) || _report(_exceptionable, {
|
|
215
|
+
path: _path + ".scopes",
|
|
216
|
+
expected: "Array<string>",
|
|
217
|
+
value: input.scopes
|
|
218
|
+
})) && input.scopes.map((elem, _index12) => "string" === typeof elem || _report(_exceptionable, {
|
|
219
|
+
path: _path + ".scopes[" + _index12 + "]",
|
|
220
|
+
expected: "string",
|
|
221
|
+
value: elem
|
|
222
|
+
})).every((flag) => flag) || _report(_exceptionable, {
|
|
223
|
+
path: _path + ".scopes",
|
|
224
|
+
expected: "Array<string>",
|
|
225
|
+
value: input.scopes
|
|
226
|
+
}), void 0 === input.pkce || "boolean" === typeof input.pkce || _report(_exceptionable, {
|
|
227
|
+
path: _path + ".pkce",
|
|
228
|
+
expected: "(boolean | undefined)",
|
|
229
|
+
value: input.pkce
|
|
230
|
+
})].every((flag) => flag);
|
|
231
|
+
const _vo4 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map((key) => {
|
|
232
|
+
const value = input[key];
|
|
233
|
+
if (void 0 === value)
|
|
234
|
+
return true;
|
|
235
|
+
return true;
|
|
236
|
+
}).every((flag) => flag)].every((flag) => flag);
|
|
237
|
+
const __is = (input) => "object" === typeof input && null !== input && _io0(input);
|
|
238
|
+
let errors;
|
|
239
|
+
let _report;
|
|
240
|
+
return __typia_transform__createStandardSchema._createStandardSchema((input) => {
|
|
241
|
+
if (false === __is(input)) {
|
|
242
|
+
errors = [];
|
|
243
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
244
|
+
((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, {
|
|
245
|
+
path: _path + "",
|
|
246
|
+
expected: "PluginManifest",
|
|
247
|
+
value: input2
|
|
248
|
+
})) && _vo0(input2, _path + "", true) || _report(true, {
|
|
249
|
+
path: _path + "",
|
|
250
|
+
expected: "PluginManifest",
|
|
251
|
+
value: input2
|
|
252
|
+
}))(input, "$input", true);
|
|
253
|
+
const success = 0 === errors.length;
|
|
254
|
+
return success ? {
|
|
255
|
+
success,
|
|
256
|
+
data: input
|
|
257
|
+
} : {
|
|
258
|
+
success,
|
|
259
|
+
errors,
|
|
260
|
+
data: input
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
success: true,
|
|
265
|
+
data: input
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
})();
|
|
269
|
+
function validateManifest(manifest) {
|
|
270
|
+
return validatePluginManifest(manifest).success;
|
|
271
|
+
}
|
|
272
|
+
function registerPlugin(registry, plugin) {
|
|
273
|
+
if (!validateManifest(plugin.manifest)) {
|
|
274
|
+
console.warn(`Invalid plugin manifest for "${plugin.manifest?.id ?? "unknown"}", skipping`);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
registry.register(plugin);
|
|
278
|
+
}
|
|
279
|
+
async function loadAllPlugins(registry) {
|
|
280
|
+
const pluginModules = await Promise.all([
|
|
281
|
+
import("./shadowob-PRSMI5MW.js"),
|
|
282
|
+
import("./model-provider-AVSFJSZP.js"),
|
|
283
|
+
import("./github-LUEC2LID.js"),
|
|
284
|
+
import("./google-workspace-YX35SHHX.js"),
|
|
285
|
+
import("./notion-WFA7KGZZ.js"),
|
|
286
|
+
import("./stripe-C22RR4ZS.js"),
|
|
287
|
+
import("./shopify-GL3NFVGE.js"),
|
|
288
|
+
import("./paypal-Z5JYHIWD.js"),
|
|
289
|
+
import("./agent-browser-CIRZRIY4.js"),
|
|
290
|
+
import("./skill-discovery-YPXXV622.js"),
|
|
291
|
+
import("./opencli-PFXHGCS2.js"),
|
|
292
|
+
import("./inference-sh-ABQOD3YF.js"),
|
|
293
|
+
import("./inference-ai-image-generation-PXV6IG4U.js"),
|
|
294
|
+
import("./wonda-RBABXFNM.js"),
|
|
295
|
+
import("./figma-2YYNSCDX.js"),
|
|
296
|
+
import("./canva-3YOFL7JS.js"),
|
|
297
|
+
import("./airtable-JCQXFM5D.js"),
|
|
298
|
+
import("./huggingface-UUXK2RHK.js"),
|
|
299
|
+
import("./linear-7QFSFPOD.js"),
|
|
300
|
+
import("./lovart-QO3SK55T.js"),
|
|
301
|
+
import("./atlassian-TVS2A4IU.js"),
|
|
302
|
+
import("./sentry-MCIRMACU.js"),
|
|
303
|
+
import("./posthog-RJRRKDWB.js"),
|
|
304
|
+
import("./sherlock-C5ZWPPVT.js"),
|
|
305
|
+
import("./firebase-2IJDDBXX.js"),
|
|
306
|
+
import("./firecrawl-2T3SBUW7.js"),
|
|
307
|
+
import("./playwright-SQAQ3DZG.js"),
|
|
308
|
+
import("./browserbase-JFO2PCIA.js"),
|
|
309
|
+
import("./lark-6LNA3LUQ.js"),
|
|
310
|
+
import("./dingtalk-JNRNRN7E.js"),
|
|
311
|
+
import("./tencent-docs-O2SC4FHL.js"),
|
|
312
|
+
import("./wps-LUWHMZQQ.js"),
|
|
313
|
+
import("./yuque-HCHTJWNI.js"),
|
|
314
|
+
import("./alipay-MZX2XCDB.js"),
|
|
315
|
+
import("./wechat-pay-YQQKXVUI.js"),
|
|
316
|
+
import("./amap-5RQB3VGC.js"),
|
|
317
|
+
import("./baidu-maps-HXC4FBVP.js"),
|
|
318
|
+
import("./tencent-maps-HMMWMNF4.js"),
|
|
319
|
+
import("./flyai-QS5Q6FJR.js"),
|
|
320
|
+
import("./kuaidi100-HGFM5VK2.js"),
|
|
321
|
+
import("./oceanengine-3JZUS3PP.js"),
|
|
322
|
+
import("./tencent-ads-UHC6OPBV.js"),
|
|
323
|
+
import("./coze-C6PMDPBI.js"),
|
|
324
|
+
import("./taobao-aipaas-RVKORSF4.js"),
|
|
325
|
+
import("./baidu-appbuilder-QRRL3ETM.js"),
|
|
326
|
+
import("./baidu-netdisk-G5Q6B5NH.js"),
|
|
327
|
+
import("./wechat-miniprogram-skyline-VR4FVIQL.js"),
|
|
328
|
+
import("./douyin-miniprogram-HCYZ5NBW.js"),
|
|
329
|
+
import("./baidu-smartprogram-EWTK5WKK.js"),
|
|
330
|
+
import("./miclaw-5CNTW7VV.js"),
|
|
331
|
+
import("./huawei-xiaoyi-KPWLTSHB.js"),
|
|
332
|
+
import("./gitee-KVNK6KLZ.js"),
|
|
333
|
+
import("./tapd-TMQRSMFG.js"),
|
|
334
|
+
import("./cnb-YAVVEYFB.js"),
|
|
335
|
+
import("./google-ads-VPKWTX67.js"),
|
|
336
|
+
import("./meta-ads-SCNFI45S.js"),
|
|
337
|
+
import("./seo-suite-WJXMA3S4.js"),
|
|
338
|
+
import("./wordpress-woocommerce-RNA5HB3N.js"),
|
|
339
|
+
import("./cloudflare-RDFPKMM5.js"),
|
|
340
|
+
import("./claude-plugin-L3MXJJ6J.js"),
|
|
341
|
+
import("./supabase-IRNQ54FJ.js"),
|
|
342
|
+
import("./google-analytics-C4UR5ZR2.js"),
|
|
343
|
+
import("./hubspot-DIUHGEDI.js"),
|
|
344
|
+
import("./klaviyo-6K5YEFNH.js"),
|
|
345
|
+
import("./webflow-OMJKZM54.js"),
|
|
346
|
+
import("./salesforce-3QZ6OFVO.js"),
|
|
347
|
+
import("./vercel-OLNVDWMG.js"),
|
|
348
|
+
import("./gitagent-YBMWY7NZ.js"),
|
|
349
|
+
import("./agent-pack-LF3O5TR4.js")
|
|
350
|
+
]);
|
|
351
|
+
for (const mod of pluginModules) {
|
|
352
|
+
const plugin = mod.default;
|
|
353
|
+
if (plugin?.manifest) {
|
|
354
|
+
registerPlugin(registry, plugin);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// src/utils/deep-merge.ts
|
|
360
|
+
function deepMerge(base, override) {
|
|
361
|
+
const result = { ...base };
|
|
362
|
+
for (const key of Object.keys(override)) {
|
|
363
|
+
const baseVal = result[key];
|
|
364
|
+
const overVal = override[key];
|
|
365
|
+
if (overVal !== void 0 && typeof baseVal === "object" && baseVal !== null && !Array.isArray(baseVal) && typeof overVal === "object" && overVal !== null && !Array.isArray(overVal)) {
|
|
366
|
+
result[key] = deepMerge(
|
|
367
|
+
baseVal,
|
|
368
|
+
overVal
|
|
369
|
+
);
|
|
370
|
+
} else if (overVal !== void 0) {
|
|
371
|
+
result[key] = overVal;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return result;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// src/plugins/config-merger.ts
|
|
378
|
+
function pluginLoadPaths(value) {
|
|
379
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
380
|
+
const load = value.load;
|
|
381
|
+
if (!load || typeof load !== "object" || Array.isArray(load)) return [];
|
|
382
|
+
const paths = load.paths;
|
|
383
|
+
return Array.isArray(paths) ? paths.filter((path) => typeof path === "string" && path.length > 0) : [];
|
|
384
|
+
}
|
|
385
|
+
function mergePluginFragments(base, fragmentOrFragments) {
|
|
386
|
+
const result = { ...base };
|
|
387
|
+
const fragments = Array.isArray(fragmentOrFragments) ? fragmentOrFragments : [fragmentOrFragments];
|
|
388
|
+
for (const fragment of fragments) {
|
|
389
|
+
if (fragment.channels) {
|
|
390
|
+
result.channels = deepMerge(
|
|
391
|
+
result.channels ?? {},
|
|
392
|
+
fragment.channels
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
if (fragment.bindings) {
|
|
396
|
+
const existingBindings = result.bindings ?? [];
|
|
397
|
+
result.bindings = [...existingBindings, ...fragment.bindings];
|
|
398
|
+
}
|
|
399
|
+
if (fragment.plugins) {
|
|
400
|
+
if (!result.plugins) result.plugins = {};
|
|
401
|
+
const existingLoadPaths = pluginLoadPaths(result.plugins);
|
|
402
|
+
const fragmentLoadPaths = pluginLoadPaths(fragment.plugins);
|
|
403
|
+
result.plugins = deepMerge(
|
|
404
|
+
result.plugins,
|
|
405
|
+
fragment.plugins
|
|
406
|
+
);
|
|
407
|
+
const mergedLoadPaths = [...existingLoadPaths, ...fragmentLoadPaths];
|
|
408
|
+
if (mergedLoadPaths.length > 0) {
|
|
409
|
+
const plugins = result.plugins;
|
|
410
|
+
plugins.load = {
|
|
411
|
+
...plugins.load ?? {},
|
|
412
|
+
paths: [...new Set(mergedLoadPaths)]
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (fragment.skills) {
|
|
417
|
+
if (!result.skills) result.skills = {};
|
|
418
|
+
result.skills = deepMerge(
|
|
419
|
+
result.skills,
|
|
420
|
+
fragment.skills
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
if (fragment.tools) {
|
|
424
|
+
if (!result.tools) result.tools = {};
|
|
425
|
+
result.tools = deepMerge(
|
|
426
|
+
result.tools,
|
|
427
|
+
fragment.tools
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
if (fragment.agents) {
|
|
431
|
+
const fragmentAgents = fragment.agents;
|
|
432
|
+
const existingAgents = result.agents ?? {};
|
|
433
|
+
if (fragmentAgents.defaults) {
|
|
434
|
+
result.agents = {
|
|
435
|
+
...existingAgents,
|
|
436
|
+
defaults: deepMerge(
|
|
437
|
+
existingAgents.defaults ?? {},
|
|
438
|
+
fragmentAgents.defaults
|
|
439
|
+
)
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
if (fragment.models) {
|
|
444
|
+
if (!result.models) result.models = {};
|
|
445
|
+
result.models = deepMerge(
|
|
446
|
+
result.models,
|
|
447
|
+
fragment.models
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return result;
|
|
452
|
+
}
|
|
453
|
+
function resolveAgentPluginConfig(pluginId, agentId, config) {
|
|
454
|
+
if (config.use?.length) {
|
|
455
|
+
const agent = config.deployments?.agents?.find((a) => a.id === agentId);
|
|
456
|
+
const agentUse = agent?.use;
|
|
457
|
+
const agentEntry = agentUse?.find((e) => e.plugin === pluginId);
|
|
458
|
+
if (agentEntry) return agentEntry.options ?? {};
|
|
459
|
+
const globalEntry = config.use.find((e) => e.plugin === pluginId);
|
|
460
|
+
if (globalEntry) return globalEntry.options ?? {};
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
const pluginInstanceConfig = config.plugins?.[pluginId];
|
|
464
|
+
if (pluginInstanceConfig) {
|
|
465
|
+
if (pluginInstanceConfig.enabled === false) return null;
|
|
466
|
+
const globalConfig = pluginInstanceConfig.config ?? {};
|
|
467
|
+
const agentOverride = pluginInstanceConfig.agents?.[agentId];
|
|
468
|
+
if (agentOverride?.enabled === false) return null;
|
|
469
|
+
const agentConfig = agentOverride?.config ?? {};
|
|
470
|
+
return { ...globalConfig, ...agentConfig };
|
|
471
|
+
}
|
|
472
|
+
const useEntry = config.use?.find((e) => e.plugin === pluginId);
|
|
473
|
+
if (useEntry) {
|
|
474
|
+
return useEntry.options ?? {};
|
|
475
|
+
}
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
function resolvePluginSecrets(pluginId, config, processEnv) {
|
|
479
|
+
const pluginInstanceConfig = config.plugins?.[pluginId];
|
|
480
|
+
const secretsMap = pluginInstanceConfig?.secrets ?? {};
|
|
481
|
+
if (!pluginInstanceConfig) {
|
|
482
|
+
const useEntry = config.use?.find((e) => e.plugin === pluginId);
|
|
483
|
+
if (useEntry?.options) {
|
|
484
|
+
for (const [key, val] of Object.entries(useEntry.options)) {
|
|
485
|
+
if (typeof val === "string") {
|
|
486
|
+
const envMatch = val.match(/^\$\{env:(\w+)\}$/);
|
|
487
|
+
if (envMatch?.[1]) {
|
|
488
|
+
const envKey = envMatch[1];
|
|
489
|
+
const envVal = processEnv[envKey];
|
|
490
|
+
if (envVal !== void 0) secretsMap[key] = envVal;
|
|
491
|
+
} else if (/^[A-Z0-9_]+$/.test(key)) {
|
|
492
|
+
secretsMap[key] = val;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return resolveSecretRefs(secretsMap, processEnv);
|
|
499
|
+
}
|
|
500
|
+
function resolveSecretRefs(secrets, processEnv) {
|
|
501
|
+
const resolved = {};
|
|
502
|
+
for (const [key, ref] of Object.entries(secrets)) {
|
|
503
|
+
const envMatch = ref.match(/^\$\{env:(\w+)\}$/);
|
|
504
|
+
if (envMatch) {
|
|
505
|
+
const envKey = envMatch[1];
|
|
506
|
+
if (!envKey) continue;
|
|
507
|
+
const envVal = processEnv[envKey];
|
|
508
|
+
if (envVal !== void 0) {
|
|
509
|
+
resolved[key] = envVal;
|
|
510
|
+
}
|
|
511
|
+
} else {
|
|
512
|
+
resolved[key] = ref;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
return resolved;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export {
|
|
519
|
+
createPluginRegistry,
|
|
520
|
+
getPluginRegistry,
|
|
521
|
+
resetPluginRegistry,
|
|
522
|
+
deepMerge,
|
|
523
|
+
mergePluginFragments,
|
|
524
|
+
resolveAgentPluginConfig,
|
|
525
|
+
resolvePluginSecrets,
|
|
526
|
+
validateManifest,
|
|
527
|
+
registerPlugin,
|
|
528
|
+
loadAllPlugins
|
|
529
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// src/utils/state.ts
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
3
|
+
import { dirname, join, resolve } from "path";
|
|
4
|
+
function getStateDir(configFilePath, stateSubdir = ".shadowob") {
|
|
5
|
+
return join(dirname(resolve(configFilePath)), stateSubdir);
|
|
6
|
+
}
|
|
7
|
+
function getStatePath(configFilePath, stateSubdir = ".shadowob") {
|
|
8
|
+
return join(getStateDir(configFilePath, stateSubdir), "provision-state.json");
|
|
9
|
+
}
|
|
10
|
+
function loadProvisionState(configFilePath, stateSubdir = ".shadowob") {
|
|
11
|
+
const statePath = getStatePath(configFilePath, stateSubdir);
|
|
12
|
+
if (!existsSync(statePath)) return null;
|
|
13
|
+
try {
|
|
14
|
+
const raw = readFileSync(statePath, "utf-8");
|
|
15
|
+
return JSON.parse(raw);
|
|
16
|
+
} catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function saveProvisionState(configFilePath, state, stateSubdir = ".shadowob") {
|
|
21
|
+
const stateDir = getStateDir(configFilePath, stateSubdir);
|
|
22
|
+
const statePath = getStatePath(configFilePath, stateSubdir);
|
|
23
|
+
mkdirSync(stateDir, { recursive: true });
|
|
24
|
+
writeFileSync(statePath, `${JSON.stringify(state, null, 2)}
|
|
25
|
+
`, "utf-8");
|
|
26
|
+
return statePath;
|
|
27
|
+
}
|
|
28
|
+
function mergeProvisionState(existing, newState) {
|
|
29
|
+
if (!existing) return newState;
|
|
30
|
+
const mergedPlugins = {};
|
|
31
|
+
for (const [pluginId, pluginState] of Object.entries(existing.plugins ?? {})) {
|
|
32
|
+
mergedPlugins[pluginId] = { ...pluginState };
|
|
33
|
+
}
|
|
34
|
+
for (const [pluginId, pluginState] of Object.entries(newState.plugins ?? {})) {
|
|
35
|
+
const prev = mergedPlugins[pluginId] ?? {};
|
|
36
|
+
const merged = { ...prev };
|
|
37
|
+
for (const [key, value] of Object.entries(pluginState)) {
|
|
38
|
+
const prevValue = prev[key];
|
|
39
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value) && prevValue !== null && typeof prevValue === "object" && !Array.isArray(prevValue)) {
|
|
40
|
+
merged[key] = {
|
|
41
|
+
...prevValue,
|
|
42
|
+
...value
|
|
43
|
+
};
|
|
44
|
+
} else {
|
|
45
|
+
merged[key] = value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
mergedPlugins[pluginId] = merged;
|
|
49
|
+
}
|
|
50
|
+
return { ...newState, plugins: mergedPlugins };
|
|
51
|
+
}
|
|
52
|
+
function formatProvisionState(state) {
|
|
53
|
+
const lines = [];
|
|
54
|
+
lines.push(`Provisioned at : ${new Date(state.provisionedAt).toLocaleString()}`);
|
|
55
|
+
if (state.namespace) lines.push(`K8s Namespace : ${state.namespace}`);
|
|
56
|
+
if (state.stackName) lines.push(`Pulumi Stack : ${state.stackName}`);
|
|
57
|
+
const shadowob = state.plugins?.shadowob;
|
|
58
|
+
if (shadowob) {
|
|
59
|
+
if (shadowob.shadowServerUrl) lines.push(`Shadow Server URL: ${shadowob.shadowServerUrl}`);
|
|
60
|
+
lines.push("");
|
|
61
|
+
if (shadowob.servers && Object.keys(shadowob.servers).length > 0) {
|
|
62
|
+
lines.push("Servers:");
|
|
63
|
+
for (const [configId, realId] of Object.entries(shadowob.servers)) {
|
|
64
|
+
lines.push(` ${configId.padEnd(24)} \u2192 ${realId}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (shadowob.channels && Object.keys(shadowob.channels).length > 0) {
|
|
68
|
+
lines.push("Channels:");
|
|
69
|
+
for (const [configId, realId] of Object.entries(shadowob.channels)) {
|
|
70
|
+
lines.push(` ${configId.padEnd(24)} \u2192 ${realId}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (shadowob.buddies && Object.keys(shadowob.buddies).length > 0) {
|
|
74
|
+
lines.push("Buddies:");
|
|
75
|
+
for (const [configId, info] of Object.entries(shadowob.buddies)) {
|
|
76
|
+
lines.push(` ${configId.padEnd(24)} \u2192 agent: ${info.agentId} user: ${info.userId}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return lines.join("\n");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
getStateDir,
|
|
85
|
+
getStatePath,
|
|
86
|
+
loadProvisionState,
|
|
87
|
+
saveProvisionState,
|
|
88
|
+
mergeProvisionState,
|
|
89
|
+
formatProvisionState
|
|
90
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
__require,
|
|
16
|
+
__export
|
|
17
|
+
};
|