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

Function l_K

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

Source from the content-addressed store, hash-verified

2526
2527ARGUMENTS: ${K}`;return q}var S68=y(()=>{NX()});function C68(q,K){if(!q.includes("<claude-code-hint"))return{hints:[],stripped:q};let _=Flz(K),z=[],Y=q.replace(plz,(A)=>{let O=glz(A),w=Number(O.v),j=O.type,H=O.value;if(!ulz.has(w))return N(`[claudeCodeHints] dropped hint with unsupported v=${O.v}`),"";if(!j||!mlz.has(j))return N(`[claudeCodeHints] dropped hint with unsupported type=${j}`),"";if(!H)return N("[claudeCodeHints] dropped hint with empty value"),"";return z.push({v:w,type:j,value:H,sourceCommand:_}),""}),$=z.length>0||Y!==q?Y.replace(/\n{3,}/g,`
2528
2529`):Y;return{hints:z,stripped:$}}function glz(q){let K={};for(let _ of q.matchAll(Blz))K[_[1]]=_[2]??_[3]??"";return K}function Flz(q){let K=q.trim(),_=K.search(/\s/);return _===-1?K:K.slice(0,_)}function g_K(q){if(wa1)return;OI8=q,B_K()}function F_K(){if(OI8!==null)OI8=null,B_K()}function U_K(){wa1=!0}function ja1(){return OI8}function d_K(){return wa1}var ulz,mlz,plz,Blz,OI8=null,wa1=!1,p_K,B_K,Q_K;var b68=y(()=>{_8();ulz=new Set([1]),mlz=new Set(["plugin"]),plz=/^[ \t]*<claude-code-hint\s+([^>]*?)\s*\/>[ \t]*$/gm,Blz=/(\w+)=(?:"([^"]*)"|([^\s/>]+))/g;p_K=Dz(),B_K=p_K.emit;Q_K=p_K.subscribe});function zR(q){return v1("policySettings")?.enabledPlugins?.[q]===!1}var Sj6=y(()=>{U1()});function x68(q){if(!g8("tengu_lapis_finch",!1))return;if(d_K())return;let K=j8().claudeCodeHints;if(K?.disabled)return;let _=K?.plugin??[];if(_.length>=Ulz)return;let z=q.value,{name:Y,marketplace:$}=Z4(z);if(!Y||!$)return;if(!Ru($))return;if(_.includes(z))return;if(Zb(z))return;if(zR(z))return;if(c_K.has(z))return;c_K.add(z),g_K(q)}async function l_K(q){let K=q.value,{name:_,marketplace:z}=Z4(K),Y=await aG(K);if(d("tengu_plugin_hint_detected",{_PROTO_plugin_name:_??"",_PROTO_marketplace_name:z??"",result:Y?"passed":"not_in_cache"}),!Y)return N(`[hintRecommendation] ${K} not found in marketplace cache`),null;return{pluginId:K,pluginName:Y.entry.name,marketplaceName:z??"",pluginDescription:Y.entry.description,sourceCommand:q.sourceCommand}}function n_K(q){b8((K)=>{let _=K.claudeCodeHints?.plugin??[];if(_.includes(q))return K;return{...K,claudeCodeHints:{...K.claudeCodeHints,plugin:[..._,q]}}})}function i_K(){b8((q)=>{if(q.claudeCodeHints?.disabled)return q;return{...q,claudeCodeHints:{...q.claudeCodeHints,disabled:!0}}})}var Ulz=100,c_K;var wI8=y(()=>{o1();k8();b68();V1();_8();pX();Nw();hP();Sj6();c_K=new Set});class I68{capacity;buffer;head=0;size=0;constructor(q){this.capacity=q;this.buffer=Array(q)}add(q){if(this.buffer[this.head]=q,this.head=(this.head+1)%this.capacity,this.size<this.capacity)this.size++}addAll(q){for(let K of q)this.add(K)}getRecent(q){let K=[],_=this.size<this.capacity?0:this.head,z=Math.min(q,this.size);for(let Y=0;Y<z;Y++){let $=(_+this.size-z+Y)%this.capacity;K.push(this.buffer[$])}return K}toArray(){if(this.size===0)return[];let q=[],K=this.size<this.capacity?0:this.head;for(let _=0;_<this.size;_++){let z=(K+_)%this.capacity;q.push(this.buffer[z])}return q}clear(){this.buffer.length=0,this.head=0,this.size=0}length(){return this.size}}function GK6(q,K,_,z){if(!K)return{effective:_,status:"valid"};let Y=parseInt(K,10);if(isNaN(Y)||Y<=0){let $={effective:_,status:"invalid",message:`Invalid value "${K}" (using default: ${_})`};return N(`${q} ${$.message}`),$}if(Y>z){let $={effective:z,status:"capped",message:`Capped from ${Y} to ${z}`};return N(`${q} ${$.message}`),$}return{effective:Y,status:"valid"}}var u68=y(()=>{_8()});function fL6(){return GK6("BASH_MAX_OUTPUT_LENGTH",process.env.BASH_MAX_OUTPUT_LENGTH,Ja1,Ha1).effective}var Ha1=150000,Ja1=30000;var m68=y(()=>{u68()});import{unlink as Qlz}from"fs/promises";var dlz=8388608,clz=1000,llz=4096,JO;var ZL6=y(()=>{_8();e7();m68();Ij();JO=class JO{taskId;path;stdoutToFile;#q="";#K="";#_=null;#Y=new I68(1000);#z=0;#O=0;#$;#w;#H=!1;#j=0;static#A=new Map;static#M=new Map;static#D=null;constructor(q,K,_=!1,z=dlz){if(this.taskId=q,this.path=sz(q),this.stdoutToFile=_,this.#$=z,this.#w=K,_&&K)JO.#A.set(q,this)}static startPolling(q){let K=JO.#A.get(q);if(!K||!K.#w)return;if(JO.#M.set(q,K),!JO.#D)JO.#D=setInterval(JO.#P,clz),JO.#D.unref()}static stopPolling(q){if(JO.#M.delete(q),JO.#M.size===0&&JO.#D)clearInterval(JO.#D),JO.#D=null}static#P(){for(let[,q]of JO.#M){if(!q.#w)continue;ot(q.path,llz).then(({content:K,bytesRead:_,bytesTotal:z})=>{if(!q.#w)return;if(!K){q.#w("","",q.#z,z,!1);return}let Y=K.length,$=0,A=0,O=0;while(Y>0){if(Y=K.lastIndexOf(`
2530`,Y-1),O++,O===5)$=Y<=0?0:Y+1;if(O===100)A=Y<=0?0:Y+1}let w=_>=z?O:Math.max(q.#z,Math.round(z/_*O));q.#z=w,q.#O=z,q.#w(K.slice($),K.slice(A),w,z,_<z)},()=>{})}}writeStdout(q){this.#J(q,!1)}writeStderr(q){this.#J(q,!0)}#J(q,K){if(this.#O+=q.length,this.#f(q),this.#_){this.#_.append(K?`[stderr] ${q}`:q);return}if(this.#q.length+this.#K.length+q.length>this.#$){this.#W(K?q:null,K?null:q);return}if(K)this.#K+=q;else this.#q+=q}#f(q){let z=0,Y=[],$=0,A=q.length;while(A>0){let O=q.lastIndexOf(`
2531`,A-1);if(O===-1)break;if(z++,Y.length<100&&$<4096){let w=A-O-1;if(w>0&&w<=4096-$){let j=q.slice(O+1,A);if(j.trim())Y.push(Buffer.from(j).toString()),$+=w}}A=O}this.#z+=z;for(let O=Y.length-1;O>=0;O--)this.#Y.add(Y[O]);if(this.#w&&Y.length>0){let O=this.#Y.getRecent(5);this.#w(kA8(O,`

Callers 1

NsKFunction · 0.85

Calls 4

Z4Function · 0.85
aGFunction · 0.85
dFunction · 0.85
NFunction · 0.85

Tested by

no test coverage detected