MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / Wk8

Function Wk8

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

Source from the content-addressed store, hash-verified

1361
1362Use the literal string \`VERDICT: \` followed by exactly one of \`PASS\`, \`FAIL\`, \`PARTIAL\`. No markdown bold, no punctuation, no variation.
1363- **FAIL**: include what failed, exact error output, reproduction steps.
1364- **PARTIAL**: what was verified, what could not be and why (missing tool/env), what the implementer should know.`});function li6(){return g8("tengu_amber_stoat",!0)}function Xk8(){if(i6(process.env.CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS)&&i7())return[];let q=[lF,d24];if(li6())q.push(cF,Mk8);if(process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-ts"&&process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-py"&&process.env.CLAUDE_CODE_ENTRYPOINT!=="sdk-cli")q.push(U24);return q}var Pk8=y(()=>{v8();o1();m8();Tx1();di6();ci6();vx1();c24();l24()});var s24={};T8(s24,{parseAgentsFromJson:()=>oi6,parseAgentFromMarkdown:()=>a24,parseAgentFromJson:()=>o24,isPluginAgent:()=>ii6,isCustomAgent:()=>ni6,isBuiltInAgent:()=>I2,hasRequiredMcpServers:()=>Wk8,getAgentDefinitionsWithOverrides:()=>VC,getActiveAgentsFromList:()=>AN,filterAgentsByMcpRequirements:()=>ri6,clearAgentDefinitionsCache:()=>kx1});import{basename as QQ_}from"path";function I2(q){return q.source==="built-in"}function ni6(q){return q.source!=="built-in"&&q.source!=="plugin"}function ii6(q){return q.source==="plugin"}function AN(q){let K=q.filter((j)=>j.source==="built-in"),_=q.filter((j)=>j.source==="plugin"),z=q.filter((j)=>j.source==="userSettings"),Y=q.filter((j)=>j.source==="projectSettings"),$=q.filter((j)=>j.source==="policySettings"),A=q.filter((j)=>j.source==="flagSettings"),O=[K,_,z,Y,A,$],w=new Map;for(let j of O)for(let H of j)w.set(H.agentType,H);return Array.from(w.values())}function Wk8(q,K){if(!q.requiredMcpServers||q.requiredMcpServers.length===0)return!0;return q.requiredMcpServers.every((_)=>K.some((z)=>z.toLowerCase().includes(_.toLowerCase())))}function ri6(q,K){return q.filter((_)=>Wk8(_,K))}function kx1(){VC.cache.clear?.(),jk8()}function cQ_(q){let{name:K,description:_}=q;if(!K||typeof K!=="string")return'Missing required "name" field in frontmatter';if(!_||typeof _!=="string")return'Missing required "description" field in frontmatter';return"Unknown parsing error"}function lQ_(q,K){if(!q.hooks)return;let _=Th().safeParse(q.hooks);if(!_.success){N(`Invalid hooks in agent '${K}': ${_.error.message}`);return}return _.data}function o24(q,K,_="flagSettings"){try{let z=r24().parse(K),Y=Y76(z.tools);if(l3()&&z.memory&&Y!==void 0){let w=new Set(Y);for(let j of[tK,X4,Cq])if(!w.has(j))Y=[...Y,j]}let $=z.disallowedTools!==void 0?Y76(z.disallowedTools):void 0,A=z.prompt;return{agentType:q,whenToUse:z.description,...Y!==void 0?{tools:Y}:{},...$!==void 0?{disallowedTools:$}:{},getSystemPrompt:()=>{if(l3()&&z.memory)return A+`
1365
1366`+kO6(q,z.memory);return A},source:_,...z.model?{model:z.model}:{},...z.effort!==void 0?{effort:z.effort}:{},...z.permissionMode?{permissionMode:z.permissionMode}:{},...z.mcpServers&&z.mcpServers.length>0?{mcpServers:z.mcpServers}:{},...z.hooks?{hooks:z.hooks}:{},...z.maxTurns!==void 0?{maxTurns:z.maxTurns}:{},...z.skills&&z.skills.length>0?{skills:z.skills}:{},...z.initialPrompt?{initialPrompt:z.initialPrompt}:{},...z.background?{background:z.background}:{},...z.memory?{memory:z.memory}:{},...z.isolation?{isolation:z.isolation}:{}}}catch(z){let Y=z instanceof Error?z.message:String(z);return N(`Error parsing agent '${q}' from JSON: ${Y}`),H6(z),null}}function oi6(q,K="flagSettings"){try{let _=dQ_().parse(q);return Object.entries(_).map(([z,Y])=>o24(z,Y,K)).filter((z)=>z!==null)}catch(_){let z=_ instanceof Error?_.message:String(_);return N(`Error parsing agents from JSON: ${z}`),H6(_),[]}}function a24(q,K,_,z,Y){try{let{name:$,description:A}=_;if(!$||typeof $!=="string")return null;if(!A||typeof A!=="string")return N(`Agent file ${q} is missing required 'description' in frontmatter`),null;A=A.replace(/\\n/g,`

Callers 2

ri6Function · 0.85
callFunction · 0.85

Calls 2

includesMethod · 0.80
toLowerCaseMethod · 0.80

Tested by

no test coverage detected