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

Function O3K

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

Source from the content-addressed store, hash-verified

2480</${XA}>
2481The remote review produced the following findings:
2482
2483${K}`;IO({value:z,mode:"task-notification"})}function O3K(q,K,_){if(!vo1(q,_))return;let z=`<${XA}>
2484<${jP}>${q}</${jP}>
2485<${Re}>remote_agent</${Re}>
2486<${wj}>failed</${wj}>
2487<${gw}>Remote review failed: ${K}</${gw}>
2488</${XA}>
2489Remote review did not produce output (${K}). Tell the user to retry /ultrareview, or use /review for a local review instead.`;IO({value:z,mode:"task-notification"})}function fdz(q){let K=q.findLast((Y)=>Y.type==="assistant"&&Y.message.content.some(($)=>$.type==="tool_use"&&$.name===im.name));if(!K)return[];let _=K.message.content.find((Y)=>Y.type==="tool_use"&&Y.name===im.name)?.input;if(!_)return[];let z=im.inputSchema.safeParse(_);if(!z.success)return[];return z.data.todos}function mx8(q){let{remoteTaskType:K,session:_,command:z,context:Y,toolUseId:$,isRemoteReview:A,isUltraplan:O,isLongRunning:w,remoteTaskMetadata:j}=q,H=aL("remote_agent");px8(H);let J={...C0(H,"remote_agent",_.title,$),type:"remote_agent",remoteTaskType:K,status:"running",sessionId:_.id,command:z,title:_.title,todoList:[],log:[],isRemoteReview:A,isUltraplan:O,isLongRunning:w,pollStartedAt:Date.now(),remoteTaskMetadata:j};H0(J,Y.setAppState),Xdz({taskId:H,remoteTaskType:K,sessionId:_.id,title:_.title,command:z,spawnedAt:Date.now(),toolUseId:$,isUltraplan:O,isRemoteReview:A,isLongRunning:w,remoteTaskMetadata:j});let M=w3K(H,Y);return{taskId:H,sessionId:_.id,cleanup:M}}async function ko1(q){try{await Zdz(q)}catch(K){N(`restoreRemoteAgentTasks failed: ${String(K)}`)}}async function Zdz(q){let K=await yo1();if(K.length===0)return;for(let _ of K){let z;try{z=(await s46(_.sessionId)).session_status}catch($){if($ instanceof Error&&$.message.startsWith("Session not found:"))N(`restoreRemoteAgentTasks: dropping ${_.taskId} (404: ${String($)})`),wa(_.taskId);else N(`restoreRemoteAgentTasks: skipping ${_.taskId} (recoverable: ${String($)})`);continue}if(z==="archived"){wa(_.taskId);continue}let Y={...C0(_.taskId,"remote_agent",_.title,_.toolUseId),type:"remote_agent",remoteTaskType:Jdz(_.remoteTaskType)?_.remoteTaskType:"remote-agent",status:"running",sessionId:_.sessionId,command:_.command,title:_.title,todoList:[],log:[],isRemoteReview:_.isRemoteReview,isUltraplan:_.isUltraplan,isLongRunning:_.isLongRunning,startTime:_.spawnedAt,pollStartedAt:Date.now(),remoteTaskMetadata:_.remoteTaskMetadata};H0(Y,q.setAppState),px8(_.taskId),w3K(_.taskId,q)}}function w3K(q,K){let _=!0,z=1000,Y=1800000,$=5,A=0,O=null,w=[],j=null,H=async()=>{if(!_)return;try{let M=K.getAppState().tasks?.[q];if(!M||M.status!=="running")return;let X=await T68(M.sessionId,O);O=X.lastEventId;let P=X.newEvents.length>0;if(P){w=[...w,...X.newEvents];let x=X.newEvents.map((I)=>{if(I.type==="assistant")return I.message.content.filter((B)=>B.type==="text").map((B)=>("text"in B)?B.text:"").join(`
2490`);return g6(I)}).join(`
2491`);if(x)j3K(q,x+`

Callers 1

HFunction · 0.85

Calls 2

vo1Function · 0.85
IOFunction · 0.85

Tested by

no test coverage detected