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

Function Qj6

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

Source from the content-addressed store, hash-verified

7691
7692> WARNING: ${oP} is ${w}. Only part of it was loaded. Keep index entries to one line under ~200 chars; move detail into topic files.`,lineCount:z,byteCount:Y,wasLineTruncated:$,wasByteTruncated:A}}async function ZQ8(q){let K=X8();try{await K.mkdir(q)}catch(_){let z=_ instanceof Error&&"code"in _&&typeof _.code==="string"?_.code:void 0;N(`ensureMemoryDirExists failed for ${q}: ${z??String(_)}`,{level:"debug"})}}function fQ8(q,K){X8().readdir(q).then((z)=>{let Y=0,$=0;for(let A of z)if(A.isFile())Y++;else if(A.isDirectory())$++;d("tengu_memdir_loaded",{...K,total_file_count:Y,total_subdir_count:$})},()=>{d("tengu_memdir_loaded",K)})}function pBK(q,K,_,z=!1){let Y=z?["## How to save memories","","Write each memory to its own file (e.g., `user_role.md`, `feedback_testing.md`) using this frontmatter format:","",...jp,"","- Keep the name, description, and type fields in memory files up-to-date with the content","- Organize memory semantically by topic, not chronologically","- Update or remove memories that turn out to be wrong or outdated","- Do not write duplicate memories. First check if there is an existing memory you can update before writing a new one."]:["## How to save memories","","Saving a memory is a two-step process:","","**Step 1** — write the memory to its own file (e.g., `user_role.md`, `feedback_testing.md`) using this frontmatter format:","",...jp,"",`**Step 2** — add a pointer to that file in \`${oP}\`. \`${oP}\` is an index, not a memory — each entry should be one line, under ~150 characters: \`- [Title](file.md) — one-line hook\`. It has no frontmatter. Never write memory content directly into \`${oP}\`.`,"",`- \`${oP}\` is always loaded into your conversation context — lines after ${nK6} will be truncated, so keep the index concise`,"- Keep the name, description, and type fields in memory files up-to-date with the content","- Organize memory semantically by topic, not chronologically","- Update or remove memories that turn out to be wrong or outdated","- Do not write duplicate memories. First check if there is an existing memory you can update before writing a new one."],$=[`# ${q}`,"",`You have a persistent, file-based memory system at \`${K}\`. ${D87}`,"","You should build up this memory system over time so that future conversations can have a complete picture of who the user is, how they'd like to collaborate with you, what behaviors to avoid or repeat, and the context behind the work the user gives you.","","If the user explicitly asks you to remember something, save it immediately as whichever type fits best. If they ask you to forget something, find and remove the relevant entry.","",...Jp8,...XH6,"",...Y,"",...$WK,"",...Mp8,"","## Memory and other forms of persistence","Memory is one of several persistence mechanisms available to you as you assist the user in a given conversation. The distinction is often that memory can be recalled in future conversations and should not be used for persisting information that is only useful within the scope of the current conversation.","- When to use or update a plan instead of memory: If you are about to start a non-trivial implementation task and would like to reach alignment with the user on your approach you should use a Plan rather than saving this information to memory. Similarly, if you already have a plan within the conversation and you have changed your approach persist that change by updating the plan rather than saving a memory.","- When to use or update tasks instead of memory: When you need to break your work in current conversation into discrete steps or keep track of your progress use tasks instead of saving to memory. Tasks are great for persisting information about the work that needs to be done in the current conversation, but memory should be reserved for information that will be useful in future conversations.","",..._??[],""];return $.push(...r97(K)),$}function BBK(q){let{displayName:K,memoryDir:_,extraGuidelines:z}=q,Y=X8(),$=_+oP,A="";try{A=Y.readFileSync($,{encoding:"utf-8"})}catch{}let O=pBK(K,_,z);if(A.trim()){let w=HI1(A),j=K===$hY?"auto":"agent";fQ8(_,{content_length:w.byteCount,line_count:w.lineCount,was_truncated:w.wasLineTruncated,was_byte_truncated:w.wasByteTruncated,memory_type:j}),O.push(`## ${oP}`,"",w.content)}else O.push(`## ${oP}`,"",`Your ${oP} is currently empty. When you save new memories, they will appear here.`);return O.join(`
7693`)}function r97(q){if(!g8("tengu_coral_fern",!1))return[];let K=_2(r1()),_=Nj()||i$6(),z=_?`grep -rn "<search term>" ${q} --include="*.md"`:`${n3} with pattern="<search term>" path="${q}" glob="*.md"`,Y=_?`grep -rn "<search term>" ${K}/ --include="*.jsonl"`:`${n3} with pattern="<search term>" path="${K}/" glob="*.jsonl"`;return["## Searching past context","","When looking for past context:","1. Search topic files in your memory directory:","```",z,"```","2. Session transcript logs (last resort — large files, slow):","```",Y,"```","Use narrow search terms (error messages, file paths, function names) rather than broad keywords.",""]}async function GQ8(){let q=l3(),K=g8("tengu_moth_copse",!1),_=process.env.CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES,z=_&&_.trim().length>0?[_]:void 0;if(mBK.isTeamMemoryEnabled()){let Y=Vj(),$=mBK.getTeamMemPath();return await ZQ8($),fQ8(Y,{memory_type:"auto"}),fQ8($,{memory_type:"team"}),AhY.buildCombinedMemoryPrompt(z,K)}if(q){let Y=Vj();return await ZQ8(Y),fQ8(Y,{memory_type:"auto"}),pBK("auto memory",Y,z,K).join(`
7694`)}if(d("tengu_memdir_disabled",{disabled_by_env_var:i6(process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY),disabled_by_setting:!i6(process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY)&&N7().autoMemoryEnabled===!1}),g8("tengu_herring_clock",!1))d("tengu_team_memdir_disabled",{});return null}var mBK,oP="MEMORY.md",nK6=200,gq8=25000,$hY="auto memory",AhY,D87="This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence).",uBK="Both directories already exist — write to them directly with the Write tool (do not run mkdir or check for their existence).";var n76=y(()=>{e7();rw();v8();o1();k8();qM();k16();_8();ju();m8();U7();_K();U1();j18();mBK=(YL(),Eq(Pi));AhY=(IBK(),Eq(xBK))});import{join as ys,normalize as OhY,sep as Rd}from"path";function whY(q){return q.replace(/:/g,"-")}function gBK(q){if(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return ys(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR,"projects",JP(jH(Fz())??Fz()),"agent-memory-local",q)+Rd;return ys(Z8(),".claude","agent-memory-local",q)+Rd}function Nk6(q,K){let _=whY(q);switch(K){case"project":return ys(Z8(),".claude","agent-memory",_)+Rd;case"local":return gBK(_);case"user":return ys(D16(),"agent-memory",_)+Rd}}function i88(q){let K=OhY(q),_=D16();if(K.startsWith(ys(_,"agent-memory")+Rd))return!0;if(K.startsWith(ys(Z8(),".claude","agent-memory")+Rd))return!0;if(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR){if(K.includes(Rd+"agent-memory-local"+Rd)&&K.startsWith(ys(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR,"projects")+Rd))return!0}else if(K.startsWith(ys(Z8(),".claude","agent-memory-local")+Rd))return!0;return!1}function IU8(q){switch(q){case"user":return`User (${ys(D16(),"agent-memory")}/)`;case"project":return"Project (.claude/agent-memory/)";case"local":return`Local (${gBK("...")})`;default:return"None"}}function kO6(q,K){let _;switch(K){case"user":_="- Since this memory is user-scope, keep learnings general since they apply across all projects";break;case"project":_="- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project";break;case"local":_="- Since this memory is local-scope (not checked into version control), tailor your memories to this project and machine";break}let z=Nk6(q,K);ZQ8(z);let Y=process.env.CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES;return BBK({displayName:"Persistent Agent Memory",memoryDir:z,extraGuidelines:Y&&Y.trim().length>0?[_,Y]:[_]})}var pu=y(()=>{v8();n76();rw();I7();E5();dz()});import{randomBytes as jhY}from"crypto";import{homedir as UBK,tmpdir as HhY}from"os";import{join as Wk,normalize as cS6,posix as l56,sep as JZ}from"path";function oD(q){return q.toLowerCase()}function XhY(q){let K=lq(q),_=oD(K),z=[{dir:lq(Wk(r1(),".claude","skills")),prefix:"/.claude/skills/"},{dir:lq(Wk(UBK(),".claude","skills")),prefix:"~/.claude/skills/"}];for(let{dir:Y,prefix:$}of z){let A=oD(Y);for(let O of[JZ,"/"])if(_.startsWith(A+O.toLowerCase())){let w=K.slice(Y.length+O.length),j=w.indexOf("/"),H=JZ==="\\"?w.indexOf("\\"):-1,J=j===-1?H:H===-1?j:Math.min(j,H);if(J<=0)return null;let M=w.slice(0,J);if(!M||M==="."||M.includes(".."))return null;if(/[*?[\]]/.test(M))return null;return{skillName:M,pattern:$+M+"/**"}}}return null}function s97(q,K){if(Z1()==="windows"){let _=ff(q),z=ff(K);return l56.relative(_,z)}return l56.relative(q,K)}function MN4(q){if(Z1()==="windows")return ff(q);return q}function PhY(){return cT.map((q)=>Hj(q)).filter((q)=>q!==void 0)}function Hs1(q){let K=lq(q),_=oD(K);if(_.endsWith(`${JZ}.claude${JZ}settings.json`)||_.endsWith(`${JZ}.claude${JZ}settings.local.json`))return!0;return PhY().some((z)=>oD(z)===_)}function WhY(q){if(Hs1(q))return!0;let K=Wk(r1(),".claude","commands"),_=Wk(r1(),".claude","agents"),z=Wk(r1(),".claude","skills");return cV(q,K)||cV(q,_)||cV(q,z)}function QBK(q){let K=Wk(hA(),CQ()),_=cS6(q);return _.startsWith(K)&&_.endsWith(".md")}function TQ8(){return Wk(_2(Z8()),N8(),"session-memory")+JZ}function Fk6(){return Wk(TQ8(),"summary.md")}function DhY(q){return cS6(q).startsWith(TQ8())}function fhY(q){let K=_2(Z8()),_=cS6(q);return _===K||_.startsWith(K+JZ)}function Sd(){return tY("tengu_scratch")}function Na1(){if(Z1()==="windows")return"claude";return`claude-${process.getuid?.()??0}`}function vQ8(){return Wk(AC(),JP(r1()))+JZ}function n56(){return Wk(vQ8(),N8(),"scratchpad")}async function dBK(){if(!Sd())throw Error("Scratchpad directory feature is not enabled");let q=X8(),K=n56();return await q.mkdir(K,{mode:448}),K}function cBK(q){if(!Sd())return!1;let K=n56(),_=cS6(q);return _===K||_.startsWith(K+JZ)}function ZhY(q){let _=lq(q).split(JZ),z=_.at(-1);if(q.startsWith("\\\\")||q.startsWith("//"))return!0;for(let Y=0;Y<_.length;Y++){let $=_[Y],A=oD($);for(let O of MhY){if(A!==oD(O))continue;if(O===".claude"){let w=_[Y+1];if(w&&oD(w)==="worktrees")break}return!0}}if(z){let Y=oD(z);if(JhY.some(($)=>oD($)===Y))return!0}return!1}function lBK(q){if(Z1()==="windows"||Z1()==="wsl"){if(q.indexOf(":",2)!==-1)return!0}if(/~\d/.test(q))return!0;if(q.startsWith("\\\\?\\")||q.startsWith("\\\\.\\")||q.startsWith("//?/")||q.startsWith("//./"))return!0;if(/[.\s]+$/.test(q))return!0;if(/\.(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(q))return!0;if(/(^|\/|\\)\.{3,}(\/|\\|$)/.test(q))return!0;if(SF(q))return!0;return!1}function In6(q,K){let _=K??hx(q);for(let z of _)if(lBK(z))return{safe:!1,message:`Claude requested permissions to write to ${q}, which contains a suspicious Windows path pattern that requires manual approval.`,classifierApprovable:!1};for(let z of _)if(WhY(z))return{safe:!1,message:`Claude requested permissions to write to ${q}, but you haven't granted it yet.`,classifierApprovable:!0};for(let z of _)if(ZhY(z))return{safe:!1,message:`Claude requested permissions to edit ${q} which is a sensitive file.`,classifierApprovable:!0};return{safe:!0}}function ku(q){return new Set([r1(),...q.additionalWorkingDirectories.keys()])}function XL(q,K,_){let z=_??hx(q),Y=Array.from(ku(K)).flatMap(($)=>GhY($));return z.every(($)=>Y.some((A)=>cV($,A)))}function cV(q,K){let _=lq(q),z=lq(K),Y=_.replace(/^\/private\/var\//,"/var/").replace(/^\/private\/tmp(\/|$)/,"/tmp$1"),$=z.replace(/^\/private\/var\//,"/var/").replace(/^\/private\/tmp(\/|$)/,"/tmp$1"),A=oD(Y),O=oD($),w=s97(O,A);if(w==="")return!0;if(yB(w))return!1;return!l56.isAbsolute(w)}function ThY(q){switch(q){case"cliArg":case"command":case"session":return lq(r1());case"userSettings":case"policySettings":case"projectSettings":case"localSettings":case"flagSettings":return V_6(q)}}function a97(q){return l56.join(hd,q)}function vhY({patternRoot:q,pattern:K,rootPath:_}){let z=l56.join(q,K);if(q===_)return a97(K);else if(z.startsWith(`${_}${hd}`)){let Y=z.slice(_.length);return a97(Y)}else{let Y=l56.relative(_,q);if(!Y||Y.startsWith(`..${hd}`)||Y==="..")return null;else{let $=l56.join(Y,K);return a97($)}}}function oL6(q,K){let _=new Set(q.get(null)??[]);for(let[z,Y]of q.entries()){if(z===null)continue;for(let $ of Y){let A=vhY({patternRoot:z,pattern:$,rootPath:K});if(A)_.add(A)}}return Array.from(_)}function aL6(q){let K=nBK(q,"read","deny"),_=new Map;for(let[z,Y]of K.entries())_.set(z,Array.from(Y.keys()));return _}function khY(q,K){if(q.startsWith(`${hd}${hd}`)){let z=q.slice(1);if(Z1()==="windows"&&z.match(/^\/[a-z]\//i)){let Y=z[1]?.toUpperCase()??"C",$=z.slice(2),A=`${Y}:\\`;return{relativePattern:$.startsWith("/")?$.slice(1):$,root:A}}return{relativePattern:z,root:hd}}else if(q.startsWith(`~${hd}`))return{relativePattern:q.slice(1),root:UBK().normalize("NFC")};else if(q.startsWith(hd))return{relativePattern:q,root:ThY(K)};let _=q;if(q.startsWith(`.${hd}`))_=q.slice(2);return{relativePattern:_,root:null}}function nBK(q,K,_){let z=(()=>{switch(K){case"edit":return X4;case"read":return Cq}})(),Y=uj6(q,z,_),$=new Map;for(let[A,O]of Y.entries()){let{relativePattern:w,root:j}=khY(A,O.source),H=$.get(j);if(H===void 0)H=new Map,$.set(j,H);H.set(w,O)}return $}function VH(q,K,_,z){let Y=lq(q);if(Z1()==="windows"&&Y.includes("\\"))Y=ff(Y);let $=nBK(K,_,z);for(let[A,O]of $.entries()){let w=Array.from(O.keys()).map((M)=>{let X=M;if(X.endsWith("/**"))X=X.slice(0,-3);return X}),j=FBK.default().add(w),H=s97(A??Z8(),Y??Z8());if(H.startsWith(`..${hd}`))continue;if(!H)continue;let J=j.test(H);if(J.ignored&&J.rule){let M=J.rule.pattern,X=M+"/**";if(O.has(X))return O.get(X)??null;return O.get(M)??null}}return null}function RK6(q,K,_){if(typeof q.getPath!=="function")return{behavior:"ask",message:`Claude requested permissions to use ${q.name}, but you haven't granted it yet.`};let z=q.getPath(K),Y=hx(z);for(let H of Y)if(H.startsWith("\\\\")||H.startsWith("//"))return{behavior:"ask",message:`Claude requested permissions to read from ${z}, which appears to be a UNC path that could access network resources.`,decisionReason:{type:"other",reason:"UNC path detected (defense-in-depth check)"}};for(let H of Y)if(lBK(H))return{behavior:"ask",message:`Claude requested permissions to read from ${z}, which contains a suspicious Windows path pattern that requires manual approval.`,decisionReason:{type:"other",reason:"Path contains suspicious Windows-specific patterns (alternate data streams, short names, long path prefixes, or three or more consecutive dots) that require manual verification"}};for(let H of Y){let J=VH(H,_,"read","deny");if(J)return{behavior:"deny",message:`Permission to read ${z} has been denied.`,decisionReason:{type:"rule",rule:J}}}for(let H of Y){let J=VH(H,_,"read","ask");if(J)return{behavior:"ask",message:`Claude requested permissions to read from ${z}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:J}}}let $=Qj6(q,K,_,Y);if($.behavior==="allow")return $;if(XL(z,_,Y))return{behavior:"allow",updatedInput:K,decisionReason:{type:"mode",mode:"default"}};let O=lq(z),w=mn6(O,K);if(w.behavior!=="passthrough")return w;let j=VH(z,_,"read","allow");if(j)return{behavior:"allow",updatedInput:K,decisionReason:{type:"rule",rule:j}};return{behavior:"ask",message:`Claude requested permissions to read from ${z}, but you haven't granted it yet.`,suggestions:Fq8(z,"read",_,Y),decisionReason:{type:"workingDir",reason:"Path is outside allowed working directories"}}}function Qj6(q,K,_,z){if(typeof q.getPath!=="function")return{behavior:"ask",message:`Claude requested permissions to use ${q.name}, but you haven't granted it yet.`};let Y=q.getPath(K),$=z??hx(Y);for(let M of $){let X=VH(M,_,"edit","deny");if(X)return{behavior:"deny",message:`Permission to edit ${Y} has been denied.`,decisionReason:{type:"rule",rule:X}}}let A=lq(Y),O=un6(A,K);if(O.behavior!=="passthrough")return O;let w=VH(Y,{..._,alwaysAllowRules:{session:_.alwaysAllowRules.session??[]}},"edit","allow");if(w){let M=w.ruleValue.ruleContent;if(M&&(M.startsWith(Uf8.slice(0,-2))||M.startsWith(Qf8.slice(0,-2)))&&!M.includes("..")&&M.endsWith("/**"))return{behavior:"allow",updatedInput:K,decisionReason:{type:"rule",rule:w}}}let j=In6(Y,$);if(!j.safe){let M=XhY(Y),X=M?[{type:"addRules",rules:[{toolName:X4,ruleContent:M.pattern}],behavior:"allow",destination:"session"}]:Fq8(Y,"write",_,$);return{behavior:"ask",message:j.message,suggestions:X,decisionReason:{type:"safetyCheck",reason:j.message,classifierApprovable:j.classifierApprovable}}}for(let M of $){let X=VH(M,_,"edit","ask");if(X)return{behavior:"ask",message:`Claude requested permissions to write to ${Y}, but you haven't granted it yet.`,decisionReason:{type:"rule",rule:X}}}let H=XL(Y,_,$);if(_.mode==="acceptEdits"&&H)return{behavior:"allow",updatedInput:K,decisionReason:{type:"mode",mode:_.mode}};let J=VH(Y,_,"edit","allow");if(J)return{behavior:"allow",updatedInput:K,decisionReason:{type:"rule",rule:J}};return{behavior:"ask",message:`Claude requested permissions to write to ${Y}, but you haven't granted it yet.`,suggestions:Fq8(Y,"write",_,$),decisionReason:!H?{type:"workingDir",reason:"Path is outside allowed working directories"}:void 0}}function Fq8(q,K,_,z){let Y=!XL(q,_,z);if(K==="read"&&Y){let A=IZ(q);return hx(A).map((j)=>Kw6(j,"session")).filter((j)=>j!==void 0)}let $=_.mode==="default"||_.mode==="plan";if(K==="write"||K==="create"){let A=$?[{type:"setMode",mode:"acceptEdits",destination:"session"}]:[];if(Y){let O=IZ(q),w=hx(O);A.push({type:"addDirectories",directories:w,destination:"session"})}return A}return $?[{type:"setMode",mode:"acceptEdits",destination:"session"}]:[]}function un6(q,K){let _=cS6(q);if(QBK(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Plan files for current session are allowed for writing"}};if(cBK(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Scratchpad files for current session are allowed for writing"}};if(i88(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Agent memory files are allowed for writing"}};if(!Gf8()&&f16(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"auto memory files are allowed for writing"}};if(oD(_)===oD(Wk(r1(),".claude","launch.json")))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Preview launch config is allowed for writing"}};return{behavior:"passthrough",message:""}}function mn6(q,K){let _=cS6(q);if(DhY(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Session memory files are allowed for reading"}};if(fhY(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Project directory files are allowed for reading"}};if(QBK(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Plan files for current session are allowed for reading"}};let z=Bq6(),Y=z.endsWith(JZ)?z:z+JZ;if(_===z||_.startsWith(Y))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Tool result files are allowed for reading"}};if(cBK(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Scratchpad files for current session are allowed for reading"}};let $=vQ8();if(_.startsWith($))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Project temp directory files are allowed for reading"}};if(i88(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Agent memory files are allowed for reading"}};if(f16(_))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"auto memory files are allowed for reading"}};let A=Wk(c1(),"tasks")+JZ;if(_===A.slice(0,-1)||_.startsWith(A))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Task files are allowed for reading"}};let O=Wk(c1(),"teams")+JZ;if(_===O.slice(0,-1)||_.startsWith(O))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Team files are allowed for reading"}};let w=o37()+JZ;if(_.startsWith(w))return{behavior:"allow",updatedInput:K,decisionReason:{type:"other",reason:"Bundled skill reference files are allowed for reading"}};return{behavior:"passthrough",message:""}}var FBK,JhY,MhY,hd,AC,o37,GhY;var Tz=y(()=>{F4();rw();pu();v8();o1();IY();I7();m8();e7();dz();SJ();vK();_K();kO();U1();Vv6();IG();NB();LH();Fj();FBK=O6(n$6(),1),JhY=[".gitconfig",".gitmodules",".bashrc",".bash_profile",".zshrc",".zprofile",".profile",".ripgreprc",".mcp.json",".claude.json"],MhY=[".git",".vscode",".idea",".claude"];hd=l56.sep;AC=_1(function(){let K=process.env.CLAUDE_CODE_TMPDIR||(Z1()==="windows"?HhY():"/tmp"),_=X8(),z=K;try{z=_.realpathSync(K)}catch{}return Wk(z,Na1())+JZ}),o37=_1(function(){let K=jhY(16).toString("hex");return Wk(AC(),"bundled-skills",{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,K)});GhY=_1(hx)});import{constants as VJ6}from"fs";import{mkdir as VhY,open as oBK,stat as nl2,symlink as iBK,unlink as NhY}from"fs/promises";import{join as aBK}from"path";function vL6(){if(t97===void 0)t97=aBK(vQ8(),N8(),"tasks");return t97}async function q_7(){await VhY(vL6(),{recursive:!0})}function sz(q){return aBK(vL6(),`${q}.output`)}function NQ8(q){return rBK.add(q),q.finally(()=>rBK.delete(q)).catch(()=>{}),q}class jI8{#q;#K=null;#_=[];#Y=0;#z=!1;#O=null;#$=null;constructor(q){this.#q=sz(q)}append(q){if(this.#z)return;if(this.#Y+=q.length,this.#Y>VQ8)this.#z=!0,this.#_.push(`
7695[output truncated: exceeded ${e97} disk cap]
7696`);else this.#_.push(q);if(!this.#O)this.#O=new Promise((K)=>{this.#$=K}),NQ8(this.#A())}flush(){return this.#O??Promise.resolve()}cancel(){this.#_.length=0}async#w(){while(!0){try{if(!this.#K)await q_7(),this.#K=await oBK(this.#q,process.platform==="win32"?"a":VJ6.O_WRONLY|VJ6.O_APPEND|VJ6.O_CREAT|sBK);while(!0)if(await this.#H(),this.#_.length===0)break}finally{if(this.#K){let q=this.#K;this.#K=null,await q.close()}}if(this.#_.length)continue;break}}#H(){return this.#K.appendFile(this.#j())}#j(){let q=this.#_.splice(0,this.#_.length),K=0;for(let Y of q)K+=Buffer.byteLength(Y,"utf8");let _=Buffer.allocUnsafe(K),z=0;for(let Y of q)z+=_.write(Y,z,"utf8");return _}async#A(){try{await this.#w()}catch(q){if(H6(q),this.#_.length>0)try{await this.#w()}catch(K){H6(K)}}finally{let q=this.#$;this.#O=null,this.#$=null,q()}}}function yhY(q){let K=kQ8.get(q);if(!K)K=new jI8(q),kQ8.set(q,K);return K}function j3K(q,K){yhY(q).append(K)}function Zw(q){return NQ8((async()=>{let K=kQ8.get(q);if(K)await K.flush(),kQ8.delete(q)})())}async function xy4(q,K,_=tBK){try{let z=await H98(sz(q),K,_);if(!z)return{content:"",newOffset:K};return{content:z.content,newOffset:K+z.bytesRead}}catch(z){if(s1(z)==="ENOENT")return{content:"",newOffset:K};return H6(z),{content:"",newOffset:K}}}async function Se1(q,K=tBK){try{let{content:_,bytesTotal:z,bytesRead:Y}=await ot(sz(q),K);if(z>Y)return`[${Math.round((z-Y)/1024)}KB of earlier output omitted]

Callers 2

checkPermissionsFunction · 0.85
RK6Function · 0.85

Calls 13

hxFunction · 0.85
VHFunction · 0.85
lqFunction · 0.85
un6Function · 0.85
In6Function · 0.85
XhYFunction · 0.85
Fq8Function · 0.85
XLFunction · 0.85
includesMethod · 0.80
getPathMethod · 0.45
startsWithMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected