| 1361 | |
| 1362 | Use 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,` |
| 1367 | `);let{color:O,model:w}=_,j;if(typeof w==="string"&&w.trim().length>0){let t=w.trim();j=t.toLowerCase()==="inherit"?"inherit":t}let H=_.background;if(H!==void 0&&H!=="true"&&H!=="false"&&H!==!0&&H!==!1)N(`Agent file ${q} has invalid background value '${H}'. Must be 'true', 'false', or omitted.`);let J=H==="true"||H===!0?!0:void 0,M=["user","project","local"],X=_.memory,P;if(X!==void 0)if(M.includes(X))P=X;else N(`Agent file ${q} has invalid memory value '${X}'. Valid options: ${M.join(", ")}`);let W=["worktree"],D=_.isolation,f;if(D!==void 0)if(W.includes(D))f=D;else N(`Agent file ${q} has invalid isolation value '${D}'. Valid options: ${W.join(", ")}`);let G=_.effort,Z=G!==void 0?OC(G):void 0;if(G!==void 0&&Z===void 0)N(`Agent file ${q} has invalid effort '${G}'. Valid options: ${DL.join(", ")} or an integer`);let T=_.permissionMode,v=T&&pZ.includes(T);if(T&&!v){let t=`Agent file ${q} has invalid permissionMode '${T}'. Valid options: ${pZ.join(", ")}`;N(t)}let V=_.maxTurns,E=mG8(V);if(V!==void 0&&E===void 0)N(`Agent file ${q} has invalid maxTurns '${V}'. Must be a positive integer.`);let S=QQ_(q,".md"),R=Y76(_.tools);if(l3()&&P&&R!==void 0){let t=new Set(R);for(let q6 of[tK,X4,Cq])if(!t.has(q6))R=[...R,q6]}let x=_.disallowedTools,I=x!==void 0?Y76(x):void 0,B=RF(_.skills),p=_.initialPrompt,C=typeof p==="string"&&p.trim()?p:void 0,g=_.mcpServers,F;if(Array.isArray(g))F=g.map((t)=>{let q6=i24().safeParse(t);if(q6.success)return q6.data;return N(`Agent file ${q} has invalid mcpServers item: ${g6(t)}. Error: ${q6.error.message}`),null}).filter((t)=>t!==null);let U=lQ_(_,$),c=z.trim();return{baseDir:K,agentType:$,whenToUse:A,...R!==void 0?{tools:R}:{},...I!==void 0?{disallowedTools:I}:{},...B!==void 0?{skills:B}:{},...C!==void 0?{initialPrompt:C}:{},...F!==void 0&&F.length>0?{mcpServers:F}:{},...U!==void 0?{hooks:U}:{},getSystemPrompt:()=>{if(l3()&&P){let t=kO6($,P);return c+` |
| 1368 | |