MCPcopy Create free account
hub / github.com/ChinaSiro/claude-code-sourcemap / EaY

Function EaY

package/cli.js:16477–16479  ·  view source on GitHub ↗
(q,K)

Source from the content-addressed store, hash-verified

16475To remove this server, run: claude mcp remove "${q}" -s ${K.scope}`),await xK(0)}async function kaY(q,K,_){try{let z=XN6(_.scope),Y=m5(K),A=_.clientSecret&&Y&&typeof Y==="object"&&"type"in Y&&(Y.type==="sse"||Y.type==="http")&&"url"in Y&&typeof Y.url==="string"&&"oauth"in Y&&Y.oauth&&typeof Y.oauth==="object"&&"clientId"in Y.oauth?await ja6():void 0;await xq6(q,Y,z);let O=Y&&typeof Y==="object"&&"type"in Y?String(Y.type||"stdio"):"stdio";if(A&&Y&&typeof Y==="object"&&"type"in Y&&(Y.type==="sse"||Y.type==="http")&&"url"in Y&&typeof Y.url==="string")Ha6(q,{type:Y.type,url:Y.url},A);d("tengu_mcp_add",{scope:z,source:"json",type:O}),gA(`Added ${O} MCP server ${q} to ${z} config`)}catch(z){o3(z.message)}}async function VaY(q){try{let K=XN6(q.scope),_=Z1();d("tengu_mcp_add",{scope:K,platform:_,source:"desktop"});let{readClaudeDesktopMcpServers:z}=await Promise.resolve().then(() => (fq5(),Dq5)),Y=await z();if(Object.keys(Y).length===0)gA("No MCP servers found in Claude Desktop configuration or configuration file does not exist.");let{unmount:$}=await vu(Nl8.default.createElement(LJ,null,Nl8.default.createElement(WM,null,Nl8.default.createElement(jq5,{servers:Y,scope:K,onDone:()=>{$()}}))),{exitOnCtrlC:!0})}catch(K){o3(K.message)}}async function NaY(){d("tengu_mcp_reset_mcpjson_choices",{}),jw((q)=>({...q,enabledMcpjsonServers:[],disabledMcpjsonServers:[],enableAllProjectMcpServers:!1})),gA(`All project-scoped (.mcp.json) server approvals and rejections have been reset.
16476You will be prompted for approval next time you start Claude Code.`)}var Nl8;var O36=y(()=>{np1();Hq5();s6();dU();k8();or();PD();f0();NJ();C7();V1();y8();RA();vO();vK();Nl8=O6(D6(),1)});var $x={};T8($x,{pluginValidateHandler:()=>EaY,pluginUpdateHandler:()=>maY,pluginUninstallHandler:()=>xaY,pluginListHandler:()=>LaY,pluginInstallHandler:()=>baY,pluginEnableHandler:()=>IaY,pluginDisableHandler:()=>uaY,marketplaceUpdateHandler:()=>CaY,marketplaceRemoveHandler:()=>SaY,marketplaceListHandler:()=>haY,marketplaceAddHandler:()=>RaY,handleMarketplaceError:()=>TK8,VALID_UPDATE_SCOPES:()=>rH6,VALID_INSTALLABLE_SCOPES:()=>e0});import{basename as yaY,dirname as Gq5}from"path";function TK8(q,K){H6(q),o3(`${t6.cross} Failed to ${K}: ${d6(q)}`)}function Tq5(q){if(q.errors.length>0)console.log(`${t6.cross} Found ${q.errors.length} ${A7(q.errors.length,"error")}:
16477`),q.errors.forEach((K)=>{console.log(` ${t6.pointer} ${K.path}: ${K.message}`)}),console.log("");if(q.warnings.length>0)console.log(`${t6.warning} Found ${q.warnings.length} ${A7(q.warnings.length,"warning")}:
16478`),q.warnings.forEach((K)=>{console.log(` ${t6.pointer} ${K.path}: ${K.message}`)}),console.log("")}async function EaY(q,K){if(K.cowork)ty(!0);try{let _=await GF8(q);console.log(`Validating ${_.fileType} manifest: ${_.filePath}
16479`),Tq5(_);let z=[];if(_.fileType==="plugin"){let A=Gq5(_.filePath);if(yaY(A)===".claude-plugin"){z=await byK(Gq5(A));for(let O of z)console.log(`Validating ${O.fileType}: ${O.filePath}
16480`),Tq5(O)}}let Y=_.success&&z.every((A)=>A.success),$=_.warnings.length>0||z.some((A)=>A.warnings.length>0);if(Y)gA($?`${t6.tick} Validation passed with warnings`:`${t6.tick} Validation passed`);else console.log(`${t6.cross} Validation failed`),process.exit(1)}catch(_){H6(_),console.error(`${t6.cross} Unexpected error during validation: ${d6(_)}`),process.exit(2)}}async function LaY(q){if(q.cowork)ty(!0);d("tengu_plugin_list_command",{});let K=cX(),{getPluginEditableScopes:_}=await Promise.resolve().then(() => (nh6(),_yK)),z=_(),Y=Object.keys(K.plugins),{enabled:$,disabled:A,errors:O}=await LM(),w=[...$,...A],j=w.filter((J)=>J.source.endsWith("@inline")),H=O.filter((J)=>J.source.endsWith("@inline")||J.source.startsWith("inline["));if(q.json){let J=new Map(w.map((X)=>[X.source,X])),M=[];for(let X of Y.sort()){let P=K.plugins[X];if(!P||P.length===0)continue;let W=Z4(X).name,D=O.filter((f)=>f.source===X||("plugin"in f)&&f.plugin===W).map($M);for(let f of P){let G=J.get(X),Z;if(G){let T=G.mcpServers||await Cq6(G);if(T&&Object.keys(T).length>0)Z=T}M.push({id:X,version:f.version||"unknown",scope:f.scope,enabled:z.has(X),installPath:f.installPath,installedAt:f.installedAt,lastUpdated:f.lastUpdated,projectPath:f.projectPath,mcpServers:Z,errors:D.length>0?D:void 0})}}for(let X of j){let P=X.mcpServers||await Cq6(X),W=H.filter((D)=>D.source===X.source||("plugin"in D)&&D.plugin===X.name).map($M);M.push({id:X.source,version:X.manifest.version??"unknown",scope:"session",enabled:X.enabled!==!1,installPath:X.path,mcpServers:P&&Object.keys(P).length>0?P:void 0,errors:W.length>0?W:void 0})}for(let X of H.filter((P)=>P.source.startsWith("inline[")))M.push({id:X.source,version:"unknown",scope:"session",enabled:!1,installPath:"path"in X?X.path:"",errors:[$M(X)]});if(q.available){let X=[];try{let[P,W]=await Promise.all([r_(),ih6()]),{marketplaces:D}=await Xp(P);for(let{name:f,data:G}of D)if(G)for(let Z of G.plugins){let T=eQ(Z.name,f);if(!Zb(T))X.push({pluginId:T,name:Z.name,description:Z.description,marketplaceName:f,version:Z.version,source:Z.source,installCount:W?.get(T)})}}catch{}gA(g6({installed:M,available:X},null,2))}else gA(g6(M,null,2))}if(Y.length===0&&j.length===0){if(H.length===0)gA("No plugins installed. Use `claude plugin install` to install a plugin.")}if(Y.length>0)console.log(`Installed plugins:
16481`);for(let J of Y.sort()){let M=K.plugins[J];if(!M||M.length===0)continue;let X=Z4(J).name,P=O.filter((W)=>W.source===J||("plugin"in W)&&W.plugin===X);for(let W of M){let D=z.has(J),f=P.length>0?`${t6.cross} failed to load`:D?`${t6.tick} enabled`:`${t6.cross} disabled`,G=W.version||"unknown",Z=W.scope;console.log(` ${t6.pointer} ${J}`),console.log(` Version: ${G}`),console.log(` Scope: ${Z}`),console.log(` Status: ${f}`);for(let T of P)console.log(` Error: ${$M(T)}`);console.log("")}}if(j.length>0||H.length>0){console.log(`Session-only plugins (--plugin-dir):
16482`);for(let J of j){let M=H.filter((P)=>P.source===J.source||("plugin"in P)&&P.plugin===J.name),X=M.length>0?`${t6.cross} loaded with errors`:`${t6.tick} loaded`;console.log(` ${t6.pointer} ${J.source}`),console.log(` Version: ${J.manifest.version??"unknown"}`),console.log(` Path: ${J.path}`),console.log(` Status: ${X}`);for(let P of M)console.log(` Error: ${$M(P)}`);console.log("")}for(let J of H.filter((M)=>M.source.startsWith("inline[")))console.log(` ${t6.pointer} ${J.source}: ${t6.cross} ${$M(J)}

Callers

nothing calls this directly

Calls 9

tyFunction · 0.85
GF8Function · 0.85
Tq5Function · 0.85
byKFunction · 0.85
gAFunction · 0.85
H6Function · 0.85
d6Function · 0.85
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected