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

Function F88

package/cli.js:3780–3780  ·  view source on GitHub ↗
({agentId:q,prompt:K,toolUseContext:_,canUseTool:z,invokingRequestId:Y})

Source from the content-addressed store, hash-verified

3778 Issues: <list — include only if there are issues to flag>
3779</${W$8}>
3780
3781${OL7}${q}`}function QMK(q,K){return`You've inherited the conversation context above from a parent agent working in ${q}. You are operating in an isolated git worktree at ${K} — same repository, same relative file structure, separate working copy. Paths in the inherited context refer to the parent's working directory; translate them to your worktree root. Re-read files before editing if the parent may have modified them since they appear in the context. Your changes stay in this worktree and will not affect the parent's files.`}var cqY="fork",IR6,lqY="Fork started — processing in background";var g88=y(()=>{v8();RY();So6();_8();i1();IR6={agentType:cqY,whenToUse:"Implicit fork — inherits full conversation context. Not selectable via subagent_type; triggered by omitting subagent_type when the fork experiment is active.",tools:["*"],maxTurns:200,model:"inherit",permissionMode:"bubble",source:"built-in",baseDir:"built-in",getSystemPrompt:()=>""}});import{promises as dMK}from"fs";async function F88({agentId:q,prompt:K,toolUseContext:_,canUseTool:z,invokingRequestId:Y}){let $=Date.now(),A=_.getAppState(),O=_.setAppStateForTasks??_.setAppState,w=A.toolPermissionContext.mode,[j,H]=await Promise.all([AK6(pO(q)),J67(pO(q))]);if(!j)throw Error(`No transcript found for agent ID: ${q}`);let J=W68(D68(Lx8(j.messages))),M=eR4(_.contentReplacementState,J,j.contentReplacements),X=H?.worktreePath?await dMK.stat(H.worktreePath).then((x)=>x.isDirectory()?H.worktreePath:void 0,()=>{N(`Resumed worktree ${H.worktreePath} no longer exists; falling back to parent cwd`);return}):void 0;if(X){let x=new Date;await dMK.utimes(X,x,x)}let P,W=!1;if(H?.agentType===IR6.agentType)P=IR6,W=!0;else if(H?.agentType)P=_.options.agentDefinitions.activeAgents.find((I)=>I.agentType===H.agentType)??lF;else P=lF;let D=H?.description??"(resumed)",f;if(W){if(_.renderedSystemPrompt)f=_.renderedSystemPrompt;else{let x=A.agent?A.agentDefinitions.activeAgents.find((p)=>p.agentType===A.agent):void 0,I=Array.from(A.toolPermissionContext.additionalWorkingDirectories.keys()),B=await QP(_.options.tools,_.options.mainLoopModel,I,_.options.mcpClients);f=Eb({mainThreadAgentDefinition:x,toolUseContext:_,customSystemPrompt:_.options.customSystemPrompt,defaultSystemPrompt:B,appendSystemPrompt:_.options.appendSystemPrompt})}if(!f)throw Error("Cannot resume fork agent: unable to reconstruct parent system prompt")}let G=BN6(P.model,_.options.mainLoopModel,void 0,w),Z={...A.toolPermissionContext,mode:P.permissionMode??"acceptEdits"},T=W?_.options.tools:nQ(Z,A.mcp.tools),v={agentDefinition:P,promptMessages:[...J,U8({content:K})],toolUseContext:_,canUseTool:z,isAsync:!0,querySource:QN8(P.agentType,I2(P)),model:void 0,override:W?{systemPrompt:f}:void 0,availableTools:T,forkContextMessages:void 0,...W&&{useExactTools:!0},worktreePath:X,description:H?.description,contentReplacementState:M},V=Fm8({agentId:q,description:D,prompt:K,selectedAgent:P,setAppState:O,toolUseId:_.toolUseId}),E={prompt:K,resolvedAgentModel:G,isBuiltInAgent:I2(P),startTime:$,agentType:P.agentType,isAsync:!0},S={agentId:q,parentSessionId:_F(),agentType:"subagent",subagentName:P.agentType,isBuiltIn:I2(P),invokingRequestId:Y,invocationKind:"resume",invocationEmitted:!1},R=(x)=>X?S$8(X,x):x();return KF(S,()=>R(()=>RL8({taskId:V.agentId,abortController:V.abortController,makeStream:(x)=>iN({...v,override:{...v.override,agentId:pO(V.agentId),abortController:V.abortController},onCacheSafeParams:x}),metadata:E,description:D,toolUseContext:_,rootSetAppState:O,agentIdForCleanup:q,enableSummarization:pV6()||Lb()||sp(),getWorktreeResult:async()=>X?{worktreePath:X}:{}}))),{agentId:q,description:D,outputFile:sz(q)}}var H67=y(()=>{v8();rL();So6();gP();BD();M0();Ou();I7();_8();i1();cq6();dN8();_K();xR6();Ij();AY();IG();rq6();ci6();g88();SP();i46()});function lMK(){return`
3782# SendMessage
3783

Callers 2

callFunction · 0.85
GA7Function · 0.85

Calls 15

AK6Function · 0.85
pOFunction · 0.85
J67Function · 0.85
W68Function · 0.85
D68Function · 0.85
Lx8Function · 0.85
eR4Function · 0.85
NFunction · 0.85
QPFunction · 0.85
EbFunction · 0.85
BN6Function · 0.85
nQFunction · 0.85

Tested by

no test coverage detected