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

Function F3Y

package/cli.js:4497–4503  ·  view source on GitHub ↗
(q,K)

Source from the content-addressed store, hash-verified

4495REMEMBER: Use the Edit tool in parallel and stop. Do not continue after the edits. Only include insights from the actual user conversation, never from these note-taking instructions. Do not delete or change section headers or italic _section descriptions_.`}async function m87(){let q=DDK(c1(),"session-memory","config","template.md");try{return await WDK(q,{encoding:"utf-8"})}catch(K){if(s1(K)==="ENOENT")return MDK;return H6(x1(K)),MDK}}async function B3Y(){let q=DDK(c1(),"session-memory","config","prompt.md");try{return await WDK(q,{encoding:"utf-8"})}catch(K){if(s1(K)==="ENOENT")return XDK();return H6(x1(K)),XDK()}}function g3Y(q){let K={},_=q.split(`
4496`),z="",Y=[];for(let $ of _)if($.startsWith("# ")){if(z&&Y.length>0){let A=Y.join(`
4497`).trim();K[z]=E3(A)}z=$,Y=[]}else Y.push($);if(z&&Y.length>0){let $=Y.join(`
4498`).trim();K[z]=E3($)}return K}function F3Y(q,K){let _=K>JDK,z=Object.entries(q).filter(([$,A])=>A>up8).sort(([,$],[,A])=>A-$).map(([$,A])=>`- "${$}" is ~${A} tokens (limit: ${up8})`);if(z.length===0&&!_)return"";let Y=[];if(_)Y.push(`
4499
4500CRITICAL: The session memory file is currently ~${K} tokens, which exceeds the maximum of ${JDK} tokens. You MUST condense the file to fit within this budget. Aggressively shorten oversized sections by removing less important details, merging related items, and summarizing older entries. Prioritize keeping "Current State" and "Errors & Corrections" accurate and detailed.`);if(z.length>0)Y.push(`
4501
4502${_?"Oversized sections to condense":"IMPORTANT: The following sections exceed the per-section limit and MUST be condensed"}:
4503${z.join(`
4504`)}`);return Y.join("")}function U3Y(q,K){return q.replace(/\{\{(\w+)\}\}/g,(_,z)=>Object.prototype.hasOwnProperty.call(K,z)?K[z]:_)}async function fDK(q){let K=await m87();return q.trim()===K.trim()}async function ZDK(q,K){let _=await B3Y(),z=g3Y(q),Y=E3(q),$=F3Y(z,Y);return U3Y(_,{currentNotes:q,notesPath:K})+$}function GDK(q){let K=q.split(`
4505`),_=up8*4,z=[],Y=[],$="",A=!1;for(let w of K)if(w.startsWith("# ")){let j=PDK($,Y,_);z.push(...j.lines),A=A||j.wasTruncated,$=w,Y=[]}else Y.push(w);let O=PDK($,Y,_);return z.push(...O.lines),A=A||O.wasTruncated,{truncatedContent:z.join(`
4506`),wasTruncated:A}}function PDK(q,K,_){if(!q)return{lines:K,wasTruncated:!1};if(K.join(`

Callers 1

ZDKFunction · 0.85

Calls 5

filterMethod · 0.80
sortMethod · 0.45
entriesMethod · 0.45
pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected