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

Function qx4

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

Source from the content-addressed store, hash-verified

1990=== USER PROMPT (transcript) ===
1991${K}
1992`;return await XF1(Y,$,"utf-8"),N(`Dumped auto mode classifier error prompts to ${Y}`),Y}catch{return null}}function tb4(q){let K=[];for(let _ of q)if(_.type==="attachment"&&_.attachment.type==="queued_command"){let z=_.attachment.prompt,Y=null;if(typeof z==="string")Y=z;else if(Array.isArray(z))Y=z.filter(($)=>$.type==="text").map(($)=>$.text).join(`
1993`)||null;if(Y!==null)K.push({role:"user",content:[{type:"text",text:Y}]})}else if(_.type==="user"){let z=_.message.content,Y=[];if(typeof z==="string")Y.push({type:"text",text:z});else if(Array.isArray(z)){for(let $ of z)if($.type==="text")Y.push({type:"text",text:$.text})}if(Y.length>0)K.push({role:"user",content:Y})}else if(_.type==="assistant"){let z=[];for(let Y of _.message.content)if(Y.type==="tool_use")z.push({type:"tool_use",name:Y.name,input:Y.input});if(z.length>0)K.push({role:"assistant",content:z})}return K}function eb4(q){let K=new Map;for(let _ of q){K.set(_.name,_);for(let z of _.aliases??[])K.set(z,_)}return K}function qx4(q,K,_){if(q.type==="tool_use"){let z=_.get(q.name);if(!z)return"";let Y=q.input??{},$;try{$=z.toAutoClassifierInput(Y)??Y}catch(O){N(`toAutoClassifierInput failed for ${q.name}: ${d6(O)}`),d("tengu_auto_mode_malformed_tool_input",{toolName:q.name}),$=Y}if($==="")return"";if(nb4())return g6({[q.name]:$})+`
1994`;let A=typeof $==="string"?$:g6($);return`${q.name} ${A}
1995`}if(q.type==="text"&&K==="user")return nb4()?g6({user:q.text})+`
1996`:`User: ${q.text}
1997`;return""}function Kx4(q,K){return q.content.map((_)=>qx4(_,q.role,K)).join("")}function _x4(q,K){let _=eb4(K);return tb4(q).map((z)=>Kx4(z,_)).join("")}function qMz(){let q=Si8();if(q===null)return null;return{role:"user",content:[{type:"text",text:`The following is the user's CLAUDE.md configuration. These are instructions the user provided to the agent and should be treated as part of the user's intent when evaluating actions.
1998
1999<user_claude_md>

Callers 2

Kx4Function · 0.85
kL8Function · 0.85

Calls 6

NFunction · 0.85
d6Function · 0.85
dFunction · 0.85
nb4Function · 0.85
g6Function · 0.85
getMethod · 0.45

Tested by

no test coverage detected