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

Function Lb

package/cli.js:3755–3755  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3753<${FT}>${w}</${FT}>
3754<${wj}>${_}</${wj}>
3755<${gw}>${A}</${gw}>
3756</${XA}>`;IO({value:j,mode:"task-notification"})}function Bm8(q){if(typeof q!=="object"||q===null||!("type"in q)||!("agentType"in q))return!1;return q.type==="local_agent"&&q.agentType==="main-session"}function mMK({messages:q,queryParams:K,description:_,setAppState:z,agentDefinition:Y}){let{taskId:$,abortSignal:A}=FqY(_,z,Y);return SQ(q,$).catch((w)=>N(`bg-session initial transcript write failed: ${w}`)),KF({agentId:$,agentType:"subagent",subagentName:"main-session",isBuiltIn:!0},async()=>{try{let w=[...q],j=[],H=0,J=0,M=q.at(-1)?.uuid??null;for await(let X of Db({messages:w,...K})){if(A.aborted){let P=!1;if(A3($,z,(W)=>{return P=W.notified===!0,P?W:{...W,notified:!0}}),!P)ZN($,"stopped",{summary:_});return}if(X.type!=="user"&&X.type!=="assistant"&&X.type!=="system")continue;if(w.push(X),SQ([X],$,M).catch((P)=>N(`bg-session transcript write failed: ${P}`)),M=X.uuid,X.type==="assistant"){for(let P of X.message.content)if(P.type==="text")J+=E3(P.text);else if(P.type==="tool_use"){H++;let W={toolName:P.name,input:P.input};if(j.push(W),j.length>QqY)j.shift()}}z((P)=>{let W=P.tasks[$];if(!W||W.type!=="local_agent")return P;let D=W.progress;if(D?.tokenCount===J&&D.toolUseCount===H&&W.messages===w)return P;return{...P,tasks:{...P.tasks,[$]:{...W,progress:{tokenCount:J,toolUseCount:H,recentActivities:D?.toolUseCount===H?D.recentActivities:[...j]},messages:w}}}})}uMK($,!0,z)}catch(w){H6(w),uMK($,!1,z)}}),$}var BqY,IMK="0123456789abcdefghijklmnopqrstuvwxyz",QqY=5;var gm8=y(()=>{RY();Tj6();ON();GN();M0();B2();Ou();c9();_8();E8();p2();pC();_K();Ij();J0();BqY={agentType:"main-session",whenToUse:"Main session query",source:"userSettings",getSystemPrompt:()=>""}});function pMK(q){if(q.startsWith("uds:"))return{scheme:"uds",target:q.slice(4)};if(q.startsWith("bridge:"))return{scheme:"bridge",target:q.slice(7)};if(q.startsWith("/"))return{scheme:"uds",target:q};return{scheme:"other",target:q}}function Eb({mainThreadAgentDefinition:q,toolUseContext:K,customSystemPrompt:_,defaultSystemPrompt:z,appendSystemPrompt:Y,overrideSystemPrompt:$}){if($)return iK([$]);let A=q?I2(q)?q.getSystemPrompt({toolUseContext:{options:K.options}}):q.getSystemPrompt():void 0;if(q?.memory)d("tengu_agent_memory_loaded",{...!1,scope:q.memory,source:"main-thread"});return iK([...A?[A]:_?[_]:z,...Y?[Y]:[]])}var xR6=y(()=>{k8();SP();m8()});import{randomUUID as dqY}from"crypto";function Lb(){return!1}function FMK(q){return q.some((K)=>{if(K.type!=="user")return!1;let _=K.message.content;if(!Array.isArray(_))return!1;return _.some((z)=>z.type==="text"&&z.text.includes(`<${W$8}>`))})}function UMK(q,K){let _={...K,uuid:dqY(),message:{...K.message,content:[...K.message.content]}},z=K.message.content.filter((A)=>A.type==="tool_use");if(z.length===0)return N(`No tool_use blocks found in assistant message for fork directive: ${q.slice(0,50)}...`,{level:"error"}),[U8({content:[{type:"text",text:gMK(q)}]})];let Y=z.map((A)=>({type:"tool_result",tool_use_id:A.id,content:[{type:"text",text:lqY}]})),$=U8({content:[...Y,{type:"text",text:gMK(q)}]});return[_,$]}function gMK(q){return`<${W$8}>
3757STOP. READ THIS FIRST.
3758

Callers 6

F88Function · 0.85
yXKFunction · 0.85
cli.jsFile · 0.85
callFunction · 0.85
vSYFunction · 0.85
VSYFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected