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

Function YRY

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

Source from the content-addressed store, hash-verified

7513 </div>
7514 <script>${S}</script>
7515</body>
7516</html>`}function zRY(q,K,_,z){let Y={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.88",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-03-30T21:59:52Z"}.VERSION,$=z?.hosts.filter((O)=>O.sessionCount>0).map((O)=>O.name),A={total:_.size,goal_categories:{},outcomes:{},satisfaction:{},friction:{}};for(let O of _.values()){for(let[w,j]of mS6(O.goal_categories))if(j>0)A.goal_categories[w]=(A.goal_categories[w]||0)+j;A.outcomes[O.outcome]=(A.outcomes[O.outcome]||0)+1;for(let[w,j]of mS6(O.user_satisfaction_counts))if(j>0)A.satisfaction[w]=(A.satisfaction[w]||0)+j;for(let[w,j]of mS6(O.friction_counts))if(j>0)A.friction[w]=(A.friction[w]||0)+j}return{metadata:{username:process.env.SAFEUSER||process.env.USER||"unknown",generated_at:new Date().toISOString(),claude_code_version:Y,date_range:q.date_range,session_count:q.total_sessions,...$&&$.length>0&&{remote_hosts_collected:$}},aggregated_data:q,insights:K,facets_summary:A}}async function YRY(){let q=Rp(),K;try{K=await RLY(q,{withFileTypes:!0})}catch{return[]}let _=K.filter((Y)=>Y.isDirectory()).map((Y)=>Ns(q,Y.name)),z=[];for(let Y=0;Y<_.length;Y++){let $=await Cq8(_[Y]);for(let[A,O]of $)z.push({sessionId:A,path:O.path,mtime:O.mtime,size:O.size});if(Y%10===9)await new Promise((A)=>setImmediate(A))}return z.sort((Y,$)=>$.mtime-Y.mtime),z}async function spK(q){let K,_=await YRY(),z=_.length,Y=50,$=200,A=[],O=[];for(let I=0;I<_.length;I+=Y){let B=_.slice(I,I+Y),p=await Promise.all(B.map(async(C)=>({sessionInfo:C,cached:await lLY(C.sessionId)})));for(let{sessionInfo:C,cached:g}of p)if(g)A.push(g);else if(O.length<$)O.push(C)}let w=new Map,j=(I)=>{for(let B of I.messages.slice(0,5))if(B.type==="user"&&B.message){let p=B.message.content;if(typeof p==="string"){if(p.includes("RESPOND WITH ONLY A VALID JSON OBJECT")||p.includes("record_facets"))return!0}}return!1},H=10;for(let I=0;I<O.length;I+=H){let B=O.slice(I,I+H),p=await Promise.all(B.map(async(g)=>{try{return await AQ8(g.path)}catch{return[]}})),C=[];for(let g of p)for(let F of g){if(j(F)||!pLY(F))continue;let U=L97(F);A.push(U),C.push(U),w.set(U.session_id,F)}await Promise.all(C.map((g)=>nLY(g)))}let J=new Map;for(let I of A){let B=J.get(I.session_id);if(!B||I.user_message_count>B.user_message_count||I.user_message_count===B.user_message_count&&I.duration_minutes>B.duration_minutes)J.set(I.session_id,I)}let M=new Set(J.keys());A=[...J.values()];for(let I of w.keys())if(!M.has(I))w.delete(I);A.sort((I,B)=>B.start_time.localeCompare(I.start_time));let X=(I)=>{if(I.user_message_count<2)return!1;if(I.duration_minutes<1)return!1;return!0},P=A.filter(X),W=new Map,D=[],f=50,G=await Promise.all(P.map(async(I)=>({sessionId:I.session_id,cached:await dLY(I.session_id)})));for(let{sessionId:I,cached:B}of G)if(B)W.set(I,B);else{let p=w.get(I);if(p&&D.length<f)D.push({log:p,sessionId:I})}let Z=50;for(let I=0;I<D.length;I+=Z){let B=D.slice(I,I+Z),p=await Promise.all(B.map(async({log:g,sessionId:F})=>{let U=await iLY(g,F);return{sessionId:F,newFacets:U}})),C=[];for(let{sessionId:g,newFacets:F}of p)if(F)W.set(g,F),C.push(F);await Promise.all(C.map((g)=>cLY(g)))}let T=(I)=>{let B=W.get(I);if(!B)return!1;let p=B.goal_categories,C=$RY(p).filter((g)=>(p[g]??0)>0);return C.length===1&&C[0]==="warmup_minimal"},v=P.filter((I)=>!T(I.session_id)),V=new Map;for(let[I,B]of W)if(!T(I))V.set(I,B);let E=rLY(v,V);E.total_sessions_scanned=z;let S=await aLY(E,W),R=_RY(E,S);try{await y97(YQ8(),{recursive:!0})}catch{}let x=Ns(YQ8(),"report.html");return await E97(x,R,{encoding:"utf-8",mode:384}),{insights:S,htmlPath:x,data:E,remoteStats:K,facets:V}}function mS6(q){return q?Object.entries(q):[]}function $RY(q){return q?Object.keys(q):[]}function tpK(q){if(!q||typeof q!=="object")return!1;let K=q;return typeof K.underlying_goal==="string"&&typeof K.outcome==="string"&&typeof K.brief_summary==="string"&&K.goal_categories!==null&&typeof K.goal_categories==="object"&&K.user_satisfaction_counts!==null&&typeof K.user_satisfaction_counts==="object"&&K.friction_counts!==null&&typeof K.friction_counts==="object"}var bLY,xLY,ILY=`Analyze this Claude Code session and extract structured facets.
7517
7518CRITICAL GUIDELINES:

Callers 1

spKFunction · 0.85

Calls 6

RpFunction · 0.85
Cq8Function · 0.85
setImmediateFunction · 0.85
filterMethod · 0.80
pushMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected